@chat21/chat21-web-widget 5.0.46-rc.4 → 5.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/app/utils/globals.ts +0 -1
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_chat21_chat21_web_widget=self.webpackChunk_chat21_chat21_web_widget||[]).push([[179],{98255:function(Ve){function Qe(ye){return Promise.resolve().then(function(){var Le=new Error("Cannot find module '"+ye+"'");throw Le.code="MODULE_NOT_FOUND",Le})}Qe.keys=function(){return[]},Qe.resolve=Qe,Qe.id=98255,Ve.exports=Qe},23268:function(Ve,Qe,ye){var Le=ye(35554).default,e=ye(75725).default,_e=ye(73560).default,De=ye(71556).default,nt=ye(47934).default,gt=ye(59545).default;Ve.exports=function L(X,K,g){function b(d,_){if(!K[d]){if(!X[d]){if(C)return C(d,!0);var M=new Error("Cannot find module '"+d+"'");throw M.code="MODULE_NOT_FOUND",M}var T=K[d]={exports:{}};X[d][0].call(T.exports,function(E){return b(X[d][1][E]||E)},T,T.exports,L,X,K,g)}return K[d].exports}for(var C=void 0,f=0;f<g.length;f++)b(g[f]);return b}({1:[function(L,X,K){(function(g,b){"use strict";var C=L("events").EventEmitter,f=L("./store"),d=L("mqtt-packet"),_=L("readable-stream").Writable,m=L("inherits"),M=L("reinterval"),T=L("./validations"),E=L("xtend"),h=L("debug")("mqttjs:client"),p=g?g.nextTick:function(Z){setTimeout(Z,0)},O=b.setImmediate||function(Z){p(Z)},A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},P=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],R={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function B(Z,U,W){h("sendPacket :: packet: %O",U),h("sendPacket :: emitting `packetsend`"),Z.emit("packetsend",U),h("sendPacket :: writing to stream");var S=d.writeToStream(U,Z.stream,Z.options);h("sendPacket :: writeToStream result %s",S),!S&&W?(h("sendPacket :: handle events on `drain` once through callback."),Z.stream.once("drain",W)):W&&(h("sendPacket :: invoking cb"),W())}function I(Z,U,W,S){h("storeAndSend :: store packet with cmd %s to outgoingStore",U.cmd),Z.outgoingStore.put(U,function(q){if(q)return W&&W(q);S(),B(Z,U,W)})}function $(Z){h("nop ::",Z)}function F(Z,U){var W,S=this;if(!(this instanceof F))return new F(Z,U);for(W in this.options=U||{},A)this.options[W]=void 0===this.options[W]?A[W]:U[W];h("MqttClient :: options.protocol",U.protocol),h("MqttClient :: options.protocolVersion",U.protocolVersion),h("MqttClient :: options.username",U.username),h("MqttClient :: options.keepalive",U.keepalive),h("MqttClient :: options.reconnectPeriod",U.reconnectPeriod),h("MqttClient :: options.rejectUnauthorized",U.rejectUnauthorized),this.options.clientId="string"==typeof U.clientId?U.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),h("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===U.protocolVersion&&U.customHandleAcks?U.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=Z,this.outgoingStore=U.outgoingStore||new f,this.incomingStore=U.incomingStore||new f,this.queueQoSZero=void 0===U.queueQoSZero||U.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this._firstConnection=!0,this.on("connect",function(){var q=this.queue;h("connect :: sending queued packets"),function G(){var oe,re=q.shift();h("deliver :: entry %o",re),re&&(h("deliver :: call _sendPacket for %o",oe=re.packet),S._sendPacket(oe,function(se){re.cb&&re.cb(se),G()}))}()}),this.on("close",function(){h("close :: connected set to `false`"),this.connected=!1,h("close :: clearing connackTimer"),clearTimeout(this.connackTimer),h("close :: clearing ping timer"),null!==S.pingTimer&&(S.pingTimer.clear(),S.pingTimer=null),h("close :: calling _setupReconnect"),this._setupReconnect()}),C.call(this),h("MqttClient :: setting up stream"),this._setupStream()}m(F,C),F.prototype._setupStream=function(){var U,Z=this,W=this,S=new _,q=d.parser(this.options),G=null,re=[];function oe(){if(re.length)p(se);else{var Y=G;G=null,Y()}}function se(){h("work :: getting next packet in queue");var Y=re.shift();if(Y)h("work :: packet pulled from queue"),W._handlePacket(Y,oe);else{h("work :: no packets in queue");var N=G;G=null,h("work :: done flag is %s",!!N),N&&N()}}if(h("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),h("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),q.on("packet",function(Y){h("parser :: on packet push to packets array."),re.push(Y)}),S._write=function(Y,N,V){G=V,h("writable stream :: parsing buffer"),q.parse(Y),se()},h("_setupStream :: pipe stream to writable stream"),this.stream.pipe(S),this.stream.on("error",function(Y){h("streamErrorHandler :: error",Y.message),P.includes(Y.code)?(h("streamErrorHandler :: emitting error"),W.emit("error",Y)):$(Y)}),this.stream.on("close",function(){var Y;h("(%s)stream :: on close",W.options.clientId),(Y=W.outgoing)&&(h("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(Y).forEach(function(N){Y[N].volatile&&"function"==typeof Y[N].cb&&(Y[N].cb(new Error("Connection closed")),delete Y[N])})),h("stream: emit close to MqttClient"),W.emit("close")}),h("_setupStream: sending packet `connect`"),(U=Object.create(this.options)).cmd="connect",B(this,U),q.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return W.end(function(){return Z.emit("error",new Error("Packet has no Authentication Method"))}),this;this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket&&B(this,E({cmd:"auth",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){h("!!connectTimeout hit!! Calling _cleanUp with force `true`"),W._cleanUp(!0)},this.options.connectTimeout)},F.prototype._handlePacket=function(Z,U){var W=this.options;if(5===W.protocolVersion&&W.properties&&W.properties.maximumPacketSize&&W.properties.maximumPacketSize<Z.length)return this.emit("error",new Error("exceeding packets size "+Z.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(h("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",Z),Z.cmd){case"publish":this._handlePublish(Z,U);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(Z),U();break;case"pubrel":this._handlePubrel(Z,U);break;case"connack":this._handleConnack(Z),U();break;case"pingresp":this._handlePingresp(Z),U();break;case"disconnect":this._handleDisconnect(Z),U()}},F.prototype._checkDisconnecting=function(Z){return this.disconnecting&&(Z?Z(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},F.prototype.publish=function(Z,U,W,S){var q;h("publish :: message `%s` to topic `%s`",U,Z);var G=this.options;if("function"==typeof W&&(S=W,W=null),W=E({qos:0,retain:!1,dup:!1},W),this._checkDisconnecting(S))return this;switch(q={cmd:"publish",topic:Z,payload:U,qos:W.qos,retain:W.retain,messageId:this._nextId(),dup:W.dup},5===G.protocolVersion&&(q.properties=W.properties,(!G.properties&&q.properties&&q.properties.topicAlias||W.properties&&G.properties&&(W.properties.topicAlias&&G.properties.topicAliasMaximum&&W.properties.topicAlias>G.properties.topicAliasMaximum||!G.properties.topicAliasMaximum&&W.properties.topicAlias))&&delete q.properties.topicAlias),h("publish :: qos",W.qos),W.qos){case 1:case 2:this.outgoing[q.messageId]={volatile:!1,cb:S||$},this._storeProcessing?(h("_storeProcessing enabled"),this._packetIdsDuringStoreProcessing[q.messageId]=!1,this._storePacket(q,void 0,W.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,void 0,W.cbStorePut));break;default:this._storeProcessing?(h("_storeProcessing enabled"),this._storePacket(q,S,W.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,S,W.cbStorePut))}return this},F.prototype.subscribe=function(){for(var Z,U=new Array(arguments.length),W=0;W<arguments.length;W++)U[W]=arguments[W];var S,q=[],G=U.shift(),re=G.resubscribe,oe=U.pop()||$,se=U.pop(),Y=this,N=this.options.protocolVersion;if(delete G.resubscribe,"string"==typeof G&&(G=[G]),"function"!=typeof oe&&(se=oe,oe=$),null!==(S=T.validateTopics(G)))return O(oe,new Error("Invalid topic "+S)),this;if(this._checkDisconnecting(oe))return h("subscribe: discconecting true"),this;var V={qos:0};if(5===N&&(V.nl=!1,V.rap=!1,V.rh=0),se=E(V,se),Array.isArray(G)?G.forEach(function(v){if(h("subscribe: array topic %s",v),!Y._resubscribeTopics.hasOwnProperty(v)||Y._resubscribeTopics[v].qos<se.qos||re){var x={topic:v,qos:se.qos};5===N&&(x.nl=se.nl,x.rap=se.rap,x.rh=se.rh,x.properties=se.properties),h("subscribe: pushing topic `%s` and qos `%s` to subs list",x.topic,x.qos),q.push(x)}}):Object.keys(G).forEach(function(v){if(h("subscribe: object topic %s",v),!Y._resubscribeTopics.hasOwnProperty(v)||Y._resubscribeTopics[v].qos<G[v].qos||re){var x={topic:v,qos:G[v].qos};5===N&&(x.nl=G[v].nl,x.rap=G[v].rap,x.rh=G[v].rh,x.properties=se.properties),h("subscribe: pushing `%s` to subs list",x),q.push(x)}}),Z={cmd:"subscribe",subscriptions:q,qos:1,retain:!1,dup:!1,messageId:this._nextId()},se.properties&&(Z.properties=se.properties),q.length){if(this.options.resubscribe){h("subscribe :: resubscribe true");var Q=[];q.forEach(function(v){if(Y.options.reconnectPeriod>0){var x={qos:v.qos};5===N&&(x.nl=v.nl||!1,x.rap=v.rap||!1,x.rh=v.rh||0,x.properties=v.properties),Y._resubscribeTopics[v.topic]=x,Q.push(v.topic)}}),Y.messageIdToTopic[Z.messageId]=Q}return this.outgoing[Z.messageId]={volatile:!0,cb:function(x,D){if(!x)for(var H=D.granted,ee=0;ee<H.length;ee+=1)q[ee].qos=H[ee];oe(x,q)}},h("subscribe :: call _sendPacket"),this._sendPacket(Z),this}oe(null,[])},F.prototype.unsubscribe=function(){for(var Z={cmd:"unsubscribe",qos:1,messageId:this._nextId()},U=this,W=new Array(arguments.length),S=0;S<arguments.length;S++)W[S]=arguments[S];var q=W.shift(),G=W.pop()||$,re=W.pop();return"string"==typeof q&&(q=[q]),"function"!=typeof G&&(re=G,G=$),this._checkDisconnecting(G)||("string"==typeof q?Z.unsubscriptions=[q]:Array.isArray(q)&&(Z.unsubscriptions=q),this.options.resubscribe&&Z.unsubscriptions.forEach(function(oe){delete U._resubscribeTopics[oe]}),"object"==typeof re&&re.properties&&(Z.properties=re.properties),this.outgoing[Z.messageId]={volatile:!0,cb:G},h("unsubscribe: call _sendPacket"),this._sendPacket(Z)),this},F.prototype.end=function(Z,U,W){var S=this;function q(){h("end :: (%s) :: finish :: calling _cleanUp with force %s",S.options.clientId,Z),S._cleanUp(Z,function(){h("end :: finish :: calling process.nextTick on closeStores"),p(function(){h("end :: closeStores: closing incoming and outgoing stores"),S.disconnected=!0,S.incomingStore.close(function(G){S.outgoingStore.close(function(re){if(h("end :: closeStores: emitting end"),S.emit("end"),W){var oe=G||re;h("end :: closeStores: invoking callback with args"),W(oe)}})}),S._deferredReconnect&&S._deferredReconnect()}.bind(S))},U)}return h("end :: (%s)",this.options.clientId),null!=Z&&"boolean"==typeof Z||(W=U||$,U=Z,Z=!1,"object"!=typeof U&&(W=U,U=null,"function"!=typeof W&&(W=$))),"object"!=typeof U&&(W=U,U=null),h("end :: cb? %s",!!W),W=W||$,this.disconnecting?(W(),this):(this._clearReconnect(),this.disconnecting=!0,!Z&&Object.keys(this.outgoing).length>0?(h("end :: (%s) :: calling finish in 10ms once outgoing is empty",S.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,q,10))):(h("end :: (%s) :: immediately calling finish",S.options.clientId),q()),this)},F.prototype.removeOutgoingMessage=function(Z){var U=this.outgoing[Z]?this.outgoing[Z].cb:null;return delete this.outgoing[Z],this.outgoingStore.del({messageId:Z},function(){U(new Error("Message removed"))}),this},F.prototype.reconnect=function(Z){h("client reconnect");var U=this,W=function(){Z?(U.options.incomingStore=Z.incomingStore,U.options.outgoingStore=Z.outgoingStore):(U.options.incomingStore=null,U.options.outgoingStore=null),U.incomingStore=U.options.incomingStore||new f,U.outgoingStore=U.options.outgoingStore||new f,U.disconnecting=!1,U.disconnected=!1,U._deferredReconnect=null,U._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=W:W(),this},F.prototype._reconnect=function(){var Z=this;h("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(function(){Z._setupStream()}),h("client already connected. disconnecting first.")):(h("_reconnect: calling _setupStream"),this._setupStream())},F.prototype._setupReconnect=function(){var Z=this;!Z.disconnecting&&!Z.reconnectTimer&&Z.options.reconnectPeriod>0?(this.reconnecting||(h("_setupReconnect :: emit `offline` state"),this.emit("offline"),h("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),h("_setupReconnect :: setting reconnectTimer for %d ms",Z.options.reconnectPeriod),Z.reconnectTimer=setInterval(function(){h("reconnectTimer :: reconnect triggered!"),Z._reconnect()},Z.options.reconnectPeriod)):h("_setupReconnect :: doing nothing...")},F.prototype._clearReconnect=function(){h("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},F.prototype._cleanUp=function(Z,U){var W,S=arguments[2];if(U&&(h("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",U)),h("_cleanUp :: forced? %s",Z),Z)0===this.options.reconnectPeriod&&this.options.clean&&(W=this.outgoing)&&(h("flush: queue exists? %b",!!W),Object.keys(W).forEach(function(G){"function"==typeof W[G].cb&&(W[G].cb(new Error("Connection closed")),delete W[G])})),h("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{var q=E({cmd:"disconnect"},S);h("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(q,O.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(h("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(h("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),U&&!this.connected&&(h("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",U),U())},F.prototype._sendPacket=function(Z,U,W){if(h("_sendPacket :: (%s) :: start",this.options.clientId),W=W||$,!this.connected)return h("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(Z,U,W);switch(this._shiftPingInterval(),Z.cmd){case"publish":break;case"pubrel":return void I(this,Z,U,W);default:return void B(this,Z,U)}switch(Z.qos){case 2:case 1:I(this,Z,U,W);break;case 0:default:B(this,Z,U)}h("_sendPacket :: (%s) :: end",this.options.clientId)},F.prototype._storePacket=function(Z,U,W){h("_storePacket :: packet: %o",Z),h("_storePacket :: cb? %s",!!U),W=W||$,0===(Z.qos||0)&&this.queueQoSZero||"publish"!==Z.cmd?this.queue.push({packet:Z,cb:U}):Z.qos>0?(U=this.outgoing[Z.messageId]?this.outgoing[Z.messageId].cb:null,this.outgoingStore.put(Z,function(S){if(S)return U&&U(S);W()})):U&&U(new Error("No connection to broker"))},F.prototype._setupPingTimer=function(){h("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);var Z=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=M(function(){Z._checkPing()},1e3*this.options.keepalive))},F.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},F.prototype._checkPing=function(){h("_checkPing :: checking ping..."),this.pingResp?(h("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(h("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},F.prototype._handlePingresp=function(){this.pingResp=!0},F.prototype._handleConnack=function(Z){h("_handleConnack");var U=this.options,W=5===U.protocolVersion?Z.reasonCode:Z.returnCode;if(clearTimeout(this.connackTimer),Z.properties&&(Z.properties.topicAliasMaximum&&(U.properties||(U.properties={}),U.properties.topicAliasMaximum=Z.properties.topicAliasMaximum),Z.properties.serverKeepAlive&&U.keepalive&&(U.keepalive=Z.properties.serverKeepAlive,this._shiftPingInterval()),Z.properties.maximumPacketSize&&(U.properties||(U.properties={}),U.properties.maximumPacketSize=Z.properties.maximumPacketSize)),0===W)this.reconnecting=!1,this._onConnect(Z);else if(W>0){var S=new Error("Connection refused: "+R[W]);S.code=W,this.emit("error",S)}},F.prototype._handlePublish=function(Z,U){h("_handlePublish: packet %o",Z),U=void 0!==U?U:$;var W=Z.topic.toString(),S=Z.payload,q=Z.qos,G=Z.messageId,re=this,oe=this.options,se=[0,16,128,131,135,144,145,151,153];switch(h("_handlePublish: qos %d",q),q){case 2:oe.customHandleAcks(W,S,Z,function(Y,N){return Y instanceof Error||(N=Y,Y=null),Y?re.emit("error",Y):-1===se.indexOf(N)?re.emit("error",new Error("Wrong reason code for pubrec")):void(N?re._sendPacket({cmd:"pubrec",messageId:G,reasonCode:N},U):re.incomingStore.put(Z,function(){re._sendPacket({cmd:"pubrec",messageId:G},U)}))});break;case 1:oe.customHandleAcks(W,S,Z,function(Y,N){return Y instanceof Error||(N=Y,Y=null),Y?re.emit("error",Y):-1===se.indexOf(N)?re.emit("error",new Error("Wrong reason code for puback")):(N||re.emit("message",W,S,Z),void re.handleMessage(Z,function(V){if(V)return U&&U(V);re._sendPacket({cmd:"puback",messageId:G,reasonCode:N},U)}))});break;case 0:this.emit("message",W,S,Z),this.handleMessage(Z,U);break;default:h("_handlePublish: unknown QoS. Doing nothing.")}},F.prototype.handleMessage=function(Z,U){U()},F.prototype._handleAck=function(Z){var U,W=Z.messageId,S=Z.cmd,q=null,G=this.outgoing[W]?this.outgoing[W].cb:null,re=this;if(G){switch(h("_handleAck :: packet type",S),S){case"pubcomp":case"puback":var oe=Z.reasonCode;oe&&oe>0&&16!==oe&&((U=new Error("Publish error: "+R[oe])).code=oe,G(U,Z)),delete this.outgoing[W],this.outgoingStore.del(Z,G);break;case"pubrec":q={cmd:"pubrel",qos:2,messageId:W};var se=Z.reasonCode;se&&se>0&&16!==se?((U=new Error("Publish error: "+R[se])).code=se,G(U,Z)):this._sendPacket(q);break;case"suback":delete this.outgoing[W];for(var Y=0;Y<Z.granted.length;Y++)if(0!=(128&Z.granted[Y])){var N=this.messageIdToTopic[W];N&&N.forEach(function(V){delete re._resubscribeTopics[V]})}G(null,Z);break;case"unsuback":delete this.outgoing[W],G(null);break;default:re.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else h("_handleAck :: Server sent an ack in error. Ignoring.")},F.prototype._handlePubrel=function(Z,U){h("handling pubrel packet"),U=void 0!==U?U:$;var W=this,S={cmd:"pubcomp",messageId:Z.messageId};W.incomingStore.get(Z,function(q,G){q?W._sendPacket(S,U):(W.emit("message",G.topic,G.payload,G),W.handleMessage(G,function(re){if(re)return U(re);W.incomingStore.del(G,$),W._sendPacket(S,U)}))})},F.prototype._handleDisconnect=function(Z){this.emit("disconnect",Z)},F.prototype._nextId=function(){var Z=this.nextId++;return 65536===this.nextId&&(this.nextId=1),Z},F.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},F.prototype._resubscribe=function(Z){h("_resubscribe");var U=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!Z.sessionPresent)&&U.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){h("_resubscribe: protocolVersion 5");for(var W=0;W<U.length;W++){var S={};S[U[W]]=this._resubscribeTopics[U[W]],S.resubscribe=!0,this.subscribe(S,{properties:S[U[W]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},F.prototype._onConnect=function(Z){if(this.disconnected)this.emit("connect",Z);else{var U=this;this._setupPingTimer(),this._resubscribe(Z),this.connected=!0,function W(){var S=U.outgoingStore.createStream();function q(){U._storeProcessing=!1,U._packetIdsDuringStoreProcessing={}}function G(){S.destroy(),S=null,q()}U.once("close",G),S.on("error",function(re){q(),U.removeListener("close",G),U.emit("error",re)}),S.on("end",function(){var re=!0;for(var oe in U._packetIdsDuringStoreProcessing)if(!U._packetIdsDuringStoreProcessing[oe]){re=!1;break}re?(q(),U.removeListener("close",G),U.emit("connect",Z)):W()}),function re(){if(S){U._storeProcessing=!0;var oe,se=S.read(1);se?U._packetIdsDuringStoreProcessing[se.messageId]?re():U.disconnecting||U.reconnectTimer?S.destroy&&S.destroy():(oe=U.outgoing[se.messageId]?U.outgoing[se.messageId].cb:null,U.outgoing[se.messageId]={volatile:!1,cb:function(N,V){oe&&oe(N,V),re()}},U._packetIdsDuringStoreProcessing[se.messageId]=!0,U._sendPacket(se)):S.once("readable",re)}}()}()}},X.exports=F}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./store":7,"./validations":8,_process:44,debug:14,events:27,inherits:29,"mqtt-packet":34,"readable-stream":63,reinterval:64,xtend:74}],2:[function(L,X,K){(function(g){"use strict";var b,C,f,d=L("readable-stream").Transform,_=L("duplexify"),m=!1;X.exports=function(M,T){if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");var p,E="MQIsdp"===T.protocolId&&3===T.protocolVersion?"mqttv3.1":"mqtt";(p=T).hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={});var h=function(p,O){var A="alis"===p.protocol?"wss":"ws",P=A+"://"+p.hostname+p.path;return p.port&&80!==p.port&&443!==p.port&&(P=A+"://"+p.hostname+":"+p.port+p.path),"function"==typeof p.transformWsUrl&&(P=p.transformWsUrl(P,p,O)),P}(T,M);return(b=T.my).connectSocket({url:h,protocols:E}),C=function(){var p=new d;return p._write=function(O,A,P){b.sendSocketMessage({data:O.buffer,success:function(){P()},fail:function(){P(new Error)}})},p._flush=function(O){b.closeSocket({success:function(){O()}})},p}(),f=_.obj(),m||(m=!0,b.onSocketOpen(function(){f.setReadable(C),f.setWritable(C),f.emit("connect")}),b.onSocketMessage(function(p){if("string"==typeof p.data){var O=g.from(p.data,"base64");C.push(O)}else{var A=new FileReader;A.addEventListener("load",function(){var P=A.result;P=P instanceof ArrayBuffer?g.from(P):g.from(P,"utf8"),C.push(P)}),A.readAsArrayBuffer(p.data)}}),b.onSocketClose(function(){f.end(),f.destroy()}),b.onSocketError(function(p){f.destroy(p)})),f}}).call(this,L("buffer").Buffer)},{buffer:12,duplexify:16,"readable-stream":63}],3:[function(L,X,K){"use strict";var g=L("net"),b=L("debug")("mqttjs:tcp");X.exports=function(C,f){var d,_;return f.port=f.port||1883,f.hostname=f.hostname||f.host||"localhost",b("port %d and host %s",d=f.port,_=f.hostname),g.createConnection(d,_)}},{debug:14,net:11}],4:[function(L,X,K){"use strict";var g=L("tls"),b=L("debug")("mqttjs:tls");X.exports=function(C,f){var d;function _(m){f.rejectUnauthorized&&C.emit("error",m),d.end()}return f.port=f.port||8883,f.host=f.hostname||f.host||"localhost",f.servername=f.host,f.rejectUnauthorized=!1!==f.rejectUnauthorized,delete f.path,b("port %d host %s rejectUnauthorized %b",f.port,f.host,f.rejectUnauthorized),(d=g.connect(f)).on("secureConnect",function(){f.rejectUnauthorized&&!d.authorized?d.emit("error",new Error("TLS not authorized")):d.removeListener("error",_)}),d.on("error",_),d}},{debug:14,tls:11}],5:[function(L,X,K){(function(g,b){"use strict";var C=L("ws"),f=L("debug")("mqttjs:ws"),d=L("duplexify"),_=L("readable-stream").Transform,m=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],M=void 0!==g&&"browser"===g.title||"function"==typeof ye;function T(h,p){var O=h.protocol+"://"+h.hostname+":"+h.port+h.path;return"function"==typeof h.transformWsUrl&&(O=h.transformWsUrl(O,h,p)),O}function E(h){var p=h;return h.hostname||(p.hostname="localhost"),h.port||(p.port="wss"===h.protocol?443:80),h.path||(p.path="/"),h.wsOptions||(p.wsOptions={}),M||"wss"!==h.protocol||m.forEach(function(O){h.hasOwnProperty(O)&&!h.wsOptions.hasOwnProperty(O)&&(p.wsOptions[O]=h[O])}),p}X.exports=M?function(h,p){var O;f("browserStreamBuilder");var G,re,oe,se,A=function(q){var G=E(q);if(G.hostname||(G.hostname=G.host),!G.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");var re=new URL(document.URL);G.hostname=re.hostname,G.port||(G.port=re.port)}return void 0===G.objectMode&&(G.objectMode=!(!0===G.binary||void 0===G.binary)),G}(p).browserBufferSize||524288,P=p.browserBufferTimeout||1e3,R=!p.objectMode,B=(re="MQIsdp"===(G=p).protocolId&&3===G.protocolVersion?"mqttv3.1":"mqtt",oe=T(G,h),(se=new WebSocket(oe,[re])).binaryType="arraybuffer",se),I=function(q,G,re){var oe=new _({objectModeMode:q.objectMode});return oe._write=function q(G,re,oe){B.bufferedAmount>A&&setTimeout(q,P,G,re,oe),R&&"string"==typeof G&&(G=b.from(G,"utf8"));try{B.send(G)}catch(se){return oe(se)}oe()},oe._flush=function(q){B.close(),q()},oe}(p);p.objectMode||(I._writev=S),I.on("close",function(){B.close()});var $=void 0===B.addEventListener;function F(){O.setReadable(I),O.setWritable(I),O.emit("connect")}function Z(){O.end(),O.destroy()}function U(q){O.destroy(q)}function W(q){var G=q.data;G=G instanceof ArrayBuffer?b.from(G):b.from(G,"utf8"),I.push(G)}function S(q,G){for(var re=new Array(q.length),oe=0;oe<q.length;oe++)re[oe]="string"==typeof q[oe].chunk?b.from(q[oe],"utf8"):q[oe].chunk;this._write(b.concat(re),"binary",G)}return B.readyState===B.OPEN?O=I:(O=O=d(void 0,void 0,p),p.objectMode||(O._writev=S),$?B.addEventListener("open",F):B.onopen=F),O.socket=B,$?(B.addEventListener("close",Z),B.addEventListener("error",U),B.addEventListener("message",W)):(B.onclose=Z,B.onerror=U,B.onmessage=W),O}:function(h,p){f("streamBuilder");var O=E(p),A=T(O,h),P=function(B,I,$){f("createWebSocket"),f("protocol: "+$.protocolId+" "+$.protocolVersion);var F="MQIsdp"===$.protocolId&&3===$.protocolVersion?"mqttv3.1":"mqtt";return f("creating new Websocket for url: "+I+" and protocol: "+F),new C(I,[F],$.wsOptions)}(0,A,O),R=C.createWebSocketStream(P,O.wsOptions);return R.url=A,R}}).call(this,L("_process"),L("buffer").Buffer)},{_process:44,buffer:12,debug:14,duplexify:16,"readable-stream":63,ws:73}],6:[function(L,X,K){(function(g){"use strict";var b,C,f,d=L("readable-stream").Transform,_=L("duplexify");X.exports=function(m,M){if(M.hostname=M.hostname||M.host,!M.hostname)throw new Error("Could not determine host. Specify host manually.");var p,T="MQIsdp"===M.protocolId&&3===M.protocolVersion?"mqttv3.1":"mqtt";(p=M).hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={});var E=function(p,O){var A="wxs"===p.protocol?"wss":"ws",P=A+"://"+p.hostname+p.path;return p.port&&80!==p.port&&443!==p.port&&(P=A+"://"+p.hostname+":"+p.port+p.path),"function"==typeof p.transformWsUrl&&(P=p.transformWsUrl(P,p,O)),P}(M,m);b=wx.connectSocket({url:E,protocols:[T]}),C=function(){var p=new d;return p._write=function(O,A,P){b.send({data:O.buffer,success:function(){P()},fail:function(B){P(new Error(B))}})},p._flush=function(O){b.close({success:function(){O()}})},p}(),(f=_.obj())._destroy=function(p,O){b.close({success:function(){O&&O(p)}})};var h=f.destroy;return f.destroy=function(){f.destroy=h;var p=this;setTimeout(function(){b.close({fail:function(){p._destroy(new Error)}})},0)}.bind(f),b.onOpen(function(){f.setReadable(C),f.setWritable(C),f.emit("connect")}),b.onMessage(function(p){var O=p.data;O=O instanceof ArrayBuffer?g.from(O):g.from(O,"utf8"),C.push(O)}),b.onClose(function(){f.end(),f.destroy()}),b.onError(function(p){f.destroy(new Error(p.errMsg))}),f}}).call(this,L("buffer").Buffer)},{buffer:12,duplexify:16,"readable-stream":63}],7:[function(L,X,K){"use strict";var g=L("xtend"),b=L("readable-stream").Readable,C={objectMode:!0},f={clean:!0};function d(_){if(!(this instanceof d))return new d(_);this.options=_||{},this.options=g(f,_),this._inflights=new Map}d.prototype.put=function(_,m){return this._inflights.set(_.messageId,_),m&&m(),this},d.prototype.createStream=function(){var _=new b(C),m=!1,M=[],T=0;return this._inflights.forEach(function(E,h){M.push(E)}),_._read=function(){this.push(!m&&T<M.length?M[T++]:null)},_.destroy=function(){if(!m){var E=this;m=!0,setTimeout(function(){E.emit("close")},0)}},_},d.prototype.del=function(_,m){return(_=this._inflights.get(_.messageId))?(this._inflights.delete(_.messageId),m(null,_)):m&&m(new Error("missing packet")),this},d.prototype.get=function(_,m){return(_=this._inflights.get(_.messageId))?m(null,_):m&&m(new Error("missing packet")),this},d.prototype.close=function(_){this.options.clean&&(this._inflights=null),_&&_()},X.exports=d},{"readable-stream":63,xtend:74}],8:[function(L,X,K){"use strict";function g(b){for(var C=b.split("/"),f=0;f<C.length;f++)if("+"!==C[f]){if("#"===C[f])return f===C.length-1;if(-1!==C[f].indexOf("+")||-1!==C[f].indexOf("#"))return!1}return!0}X.exports={validateTopics:function(C){if(0===C.length)return"empty_topic_list";for(var f=0;f<C.length;f++)if(!g(C[f]))return C[f];return null}}},{}],9:[function(L,X,K){(function(g){"use strict";var b=L("../client"),C=L("../store"),f=L("url"),d=L("xtend"),_=L("debug")("mqttjs"),m={};function M(T,E){if(_("connecting to an MQTT broker..."),"object"!=typeof T||E||(E=T,T=null),E=E||{},T){var h=f.parse(T,!0);if(null!=h.port&&(h.port=Number(h.port)),null===(E=d(h,E)).protocol)throw new Error("Missing protocol");E.protocol=E.protocol.replace(/:$/,"")}if((A=E).auth&&((P=A.auth.match(/^(.+):(.+)$/))?(A.username=P[1],A.password=P[2]):A.username=A.auth),E.query&&"string"==typeof E.query.clientId&&(E.clientId=E.query.clientId),E.cert&&E.key){if(!E.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(E.protocol))switch(E.protocol){case"mqtt":E.protocol="mqtts";break;case"ws":E.protocol="wss";break;case"wx":E.protocol="wxs";break;case"ali":E.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+E.protocol+'"!')}}var A,P;if(!m[E.protocol]){var p=-1!==["mqtts","wss"].indexOf(E.protocol);E.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(A,P){return(!p||P%2!=0)&&"function"==typeof m[A]})[0]}if(!1===E.clean&&!E.clientId)throw new Error("Missing clientId for unclean clients");E.protocol&&(E.defaultProtocol=E.protocol);var O=new b(function(A){return E.servers&&(A._reconnectCount&&A._reconnectCount!==E.servers.length||(A._reconnectCount=0),E.host=E.servers[A._reconnectCount].host,E.port=E.servers[A._reconnectCount].port,E.protocol=E.servers[A._reconnectCount].protocol?E.servers[A._reconnectCount].protocol:E.defaultProtocol,E.hostname=E.host,A._reconnectCount++),_("calling streambuilder for",E.protocol),m[E.protocol](A,E)},E);return O.on("error",function(){}),O}void 0!==g&&"browser"!==g.title||"function"!=typeof ye?(m.mqtt=L("./tcp"),m.tcp=L("./tcp"),m.ssl=L("./tls"),m.tls=L("./tls"),m.mqtts=L("./tls")):(m.wx=L("./wx"),m.wxs=L("./wx"),m.ali=L("./ali"),m.alis=L("./ali")),m.ws=L("./ws"),m.wss=L("./ws"),X.exports=M,X.exports.connect=M,X.exports.MqttClient=b,X.exports.Store=C}).call(this,L("_process"))},{"../client":1,"../store":7,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:44,debug:14,url:69,xtend:74}],10:[function(L,X,K){"use strict";K.byteLength=function(T){var E=m(T),p=E[1];return 3*(E[0]+p)/4-p},K.toByteArray=function(T){var E,h,F,p=m(T),O=p[0],A=p[1],P=new C(3*(O+(F=A))/4-F),R=0,B=A>0?O-4:O;for(h=0;h<B;h+=4)E=b[T.charCodeAt(h)]<<18|b[T.charCodeAt(h+1)]<<12|b[T.charCodeAt(h+2)]<<6|b[T.charCodeAt(h+3)],P[R++]=E>>16&255,P[R++]=E>>8&255,P[R++]=255&E;return 2===A&&(E=b[T.charCodeAt(h)]<<2|b[T.charCodeAt(h+1)]>>4,P[R++]=255&E),1===A&&(E=b[T.charCodeAt(h)]<<10|b[T.charCodeAt(h+1)]<<4|b[T.charCodeAt(h+2)]>>2,P[R++]=E>>8&255,P[R++]=255&E),P},K.fromByteArray=function(T){for(var E,h=T.length,p=h%3,O=[],A=0,P=h-p;A<P;A+=16383)O.push(M(T,A,A+16383>P?P:A+16383));return 1===p?O.push(g[(E=T[h-1])>>2]+g[E<<4&63]+"=="):2===p&&O.push(g[(E=(T[h-2]<<8)+T[h-1])>>10]+g[E>>4&63]+g[E<<2&63]+"="),O.join("")};for(var g=[],b=[],C="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,_=f.length;d<_;++d)g[d]=f[d],b[f.charCodeAt(d)]=d;function m(T){var E=T.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=T.indexOf("=");return-1===h&&(h=E),[h,h===E?0:4-h%4]}function M(T,E,h){for(var O,A=[],P=E;P<h;P+=3)A.push(g[(O=(T[P]<<16&16711680)+(T[P+1]<<8&65280)+(255&T[P+2]))>>18&63]+g[O>>12&63]+g[O>>6&63]+g[63&O]);return A.join("")}b["-".charCodeAt(0)]=62,b["_".charCodeAt(0)]=63},{}],11:[function(L,X,K){},{}],12:[function(L,X,K){(function(g){"use strict";var b=L("base64-js"),C=L("ieee754");K.Buffer=g,K.SlowBuffer=function(l){return+l!=l&&(l=0),g.alloc(+l)},K.INSPECT_MAX_BYTES=50;var f=2147483647;function d(l){if(l>f)throw new RangeError('The value "'+l+'" is invalid for option "size"');var s=new Uint8Array(l);return s.__proto__=g.prototype,s}function g(l,s,c){if("number"==typeof l){if("string"==typeof s)throw new TypeError('The "string" argument must be of type string. Received type number');return M(l)}return _(l,s,c)}function _(l,s,c){if("string"==typeof l)return function(z,ne){if("string"==typeof ne&&""!==ne||(ne="utf8"),!g.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);var ae=0|h(z,ne),fe=d(ae),le=fe.write(z,ne);return le!==ae&&(fe=fe.slice(0,le)),fe}(l,s);if(ArrayBuffer.isView(l))return T(l);if(null==l)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(ee(l,ArrayBuffer)||l&&ee(l.buffer,ArrayBuffer))return function(z,ne,ae){if(ne<0||z.byteLength<ne)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<ne+(ae||0))throw new RangeError('"length" is outside of buffer bounds');var fe;return(fe=void 0===ne&&void 0===ae?new Uint8Array(z):void 0===ae?new Uint8Array(z,ne):new Uint8Array(z,ne,ae)).__proto__=g.prototype,fe}(l,s,c);if("number"==typeof l)throw new TypeError('The "value" argument must not be of type number. Received type number');var w=l.valueOf&&l.valueOf();if(null!=w&&w!==l)return g.from(w,s,c);var k=function(z){if(g.isBuffer(z)){var ne=0|E(z.length),ae=d(ne);return 0===ae.length||z.copy(ae,0,0,ne),ae}return void 0!==z.length?"number"!=typeof z.length||te(z.length)?d(0):T(z):"Buffer"===z.type&&Array.isArray(z.data)?T(z.data):void 0}(l);if(k)return k;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof l[Symbol.toPrimitive])return g.from(l[Symbol.toPrimitive]("string"),s,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}function m(l){if("number"!=typeof l)throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function M(l){return m(l),d(l<0?0:0|E(l))}function T(l){for(var s=l.length<0?0:0|E(l.length),c=d(s),w=0;w<s;w+=1)c[w]=255&l[w];return c}function E(l){if(l>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|l}function h(l,s){if(g.isBuffer(l))return l.length;if(ArrayBuffer.isView(l)||ee(l,ArrayBuffer))return l.byteLength;if("string"!=typeof l)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof l);var c=l.length,w=arguments.length>2&&!0===arguments[2];if(!w&&0===c)return 0;for(var k=!1;;)switch(s){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return x(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return D(l).length;default:if(k)return w?-1:x(l).length;s=(""+s).toLowerCase(),k=!0}}function p(l,s,c){var w=l[s];l[s]=l[c],l[c]=w}function O(l,s,c,w,k){if(0===l.length)return-1;if("string"==typeof c?(w=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),te(c=+c)&&(c=k?0:l.length-1),c<0&&(c=l.length+c),c>=l.length){if(k)return-1;c=l.length-1}else if(c<0){if(!k)return-1;c=0}if("string"==typeof s&&(s=g.from(s,w)),g.isBuffer(s))return 0===s.length?-1:A(l,s,c,w,k);if("number"==typeof s)return s&=255,"function"==typeof Uint8Array.prototype.indexOf?k?Uint8Array.prototype.indexOf.call(l,s,c):Uint8Array.prototype.lastIndexOf.call(l,s,c):A(l,[s],c,w,k);throw new TypeError("val must be string, number or Buffer")}function A(l,s,c,w,k){var z,ne=1,ae=l.length,fe=s.length;if(void 0!==w&&("ucs2"===(w=String(w).toLowerCase())||"ucs-2"===w||"utf16le"===w||"utf-16le"===w)){if(l.length<2||s.length<2)return-1;ne=2,ae/=2,fe/=2,c/=2}function le(we,Ce){return 1===ne?we[Ce]:we.readUInt16BE(Ce*ne)}if(k){var ce=-1;for(z=c;z<ae;z++)if(le(l,z)===le(s,-1===ce?0:z-ce)){if(-1===ce&&(ce=z),z-ce+1===fe)return ce*ne}else-1!==ce&&(z-=z-ce),ce=-1}else for(c+fe>ae&&(c=ae-fe),z=c;z>=0;z--){for(var xe=!0,Ne=0;Ne<fe;Ne++)if(le(l,z+Ne)!==le(s,Ne)){xe=!1;break}if(xe)return z}return-1}function P(l,s,c,w){c=Number(c)||0;var k=l.length-c;w?(w=Number(w))>k&&(w=k):w=k;var z=s.length;w>z/2&&(w=z/2);for(var ne=0;ne<w;++ne){var ae=parseInt(s.substr(2*ne,2),16);if(te(ae))return ne;l[c+ne]=ae}return ne}function R(l,s,c,w){return H(x(s,l.length-c),l,c,w)}function B(l,s,c,w){return H(function(k){for(var z=[],ne=0;ne<k.length;++ne)z.push(255&k.charCodeAt(ne));return z}(s),l,c,w)}function I(l,s,c,w){return B(l,s,c,w)}function $(l,s,c,w){return H(D(s),l,c,w)}function F(l,s,c,w){return H(function(k,z){for(var ne,ae,le=[],ce=0;ce<k.length&&!((z-=2)<0);++ce)ae=(ne=k.charCodeAt(ce))>>8,le.push(ne%256),le.push(ae);return le}(s,l.length-c),l,c,w)}function Z(l,s,c){return b.fromByteArray(0===s&&c===l.length?l:l.slice(s,c))}function U(l,s,c){c=Math.min(l.length,c);for(var w=[],k=s;k<c;){var z,ne,ae,fe,le=l[k],ce=null,xe=le>239?4:le>223?3:le>191?2:1;if(k+xe<=c)switch(xe){case 1:le<128&&(ce=le);break;case 2:128==(192&(z=l[k+1]))&&(fe=(31&le)<<6|63&z)>127&&(ce=fe);break;case 3:ne=l[k+2],128==(192&(z=l[k+1]))&&128==(192&ne)&&(fe=(15&le)<<12|(63&z)<<6|63&ne)>2047&&(fe<55296||fe>57343)&&(ce=fe);break;case 4:ne=l[k+2],ae=l[k+3],128==(192&(z=l[k+1]))&&128==(192&ne)&&128==(192&ae)&&(fe=(15&le)<<18|(63&z)<<12|(63&ne)<<6|63&ae)>65535&&fe<1114112&&(ce=fe)}null===ce?(ce=65533,xe=1):ce>65535&&(w.push((ce-=65536)>>>10&1023|55296),ce=56320|1023&ce),w.push(ce),k+=xe}return function(Ne){var we=Ne.length;if(we<=W)return String.fromCharCode.apply(String,Ne);for(var Ce="",he=0;he<we;)Ce+=String.fromCharCode.apply(String,Ne.slice(he,he+=W));return Ce}(w)}K.kMaxLength=f,(g.TYPED_ARRAY_SUPPORT=function(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===l.foo()}catch(s){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192,g.from=function(l,s,c){return _(l,s,c)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,g.alloc=function(l,s,c){return k=s,z=c,m(w=l),w<=0?d(w):void 0!==k?"string"==typeof z?d(w).fill(k,z):d(w).fill(k):d(w);var w,k,z},g.allocUnsafe=function(l){return M(l)},g.allocUnsafeSlow=function(l){return M(l)},g.isBuffer=function(l){return null!=l&&!0===l._isBuffer&&l!==g.prototype},g.compare=function(l,s){if(ee(l,Uint8Array)&&(l=g.from(l,l.offset,l.byteLength)),ee(s,Uint8Array)&&(s=g.from(s,s.offset,s.byteLength)),!g.isBuffer(l)||!g.isBuffer(s))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===s)return 0;for(var c=l.length,w=s.length,k=0,z=Math.min(c,w);k<z;++k)if(l[k]!==s[k]){c=l[k],w=s[k];break}return c<w?-1:w<c?1:0},g.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(l,s){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(0===l.length)return g.alloc(0);var c;if(void 0===s)for(s=0,c=0;c<l.length;++c)s+=l[c].length;var w=g.allocUnsafe(s),k=0;for(c=0;c<l.length;++c){var z=l[c];if(ee(z,Uint8Array)&&(z=g.from(z)),!g.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(w,k),k+=z.length}return w},g.byteLength=h,g.prototype._isBuffer=!0,g.prototype.swap16=function(){var l=this.length;if(l%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var s=0;s<l;s+=2)p(this,s,s+1);return this},g.prototype.swap32=function(){var l=this.length;if(l%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var s=0;s<l;s+=4)p(this,s,s+3),p(this,s+1,s+2);return this},g.prototype.swap64=function(){var l=this.length;if(l%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var s=0;s<l;s+=8)p(this,s,s+7),p(this,s+1,s+6),p(this,s+2,s+5),p(this,s+3,s+4);return this},g.prototype.toLocaleString=g.prototype.toString=function(){var l=this.length;return 0===l?"":0===arguments.length?U(this,0,l):function(s,c,w){var k=!1;if((void 0===c||c<0)&&(c=0),c>this.length||((void 0===w||w>this.length)&&(w=this.length),w<=0)||(w>>>=0)<=(c>>>=0))return"";for(s||(s="utf8");;)switch(s){case"hex":return G(this,c,w);case"utf8":case"utf-8":return U(this,c,w);case"ascii":return S(this,c,w);case"latin1":case"binary":return q(this,c,w);case"base64":return Z(this,c,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,c,w);default:if(k)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),k=!0}}.apply(this,arguments)},g.prototype.equals=function(l){if(!g.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l||0===g.compare(this,l)},g.prototype.inspect=function(){var l="",s=K.INSPECT_MAX_BYTES;return l=this.toString("hex",0,s).replace(/(.{2})/g,"$1 ").trim(),this.length>s&&(l+=" ... "),"<Buffer "+l+">"},g.prototype.compare=function(l,s,c,w,k){if(ee(l,Uint8Array)&&(l=g.from(l,l.offset,l.byteLength)),!g.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(void 0===s&&(s=0),void 0===c&&(c=l?l.length:0),void 0===w&&(w=0),void 0===k&&(k=this.length),s<0||c>l.length||w<0||k>this.length)throw new RangeError("out of range index");if(w>=k&&s>=c)return 0;if(w>=k)return-1;if(s>=c)return 1;if(this===l)return 0;for(var z=(k>>>=0)-(w>>>=0),ne=(c>>>=0)-(s>>>=0),ae=Math.min(z,ne),fe=this.slice(w,k),le=l.slice(s,c),ce=0;ce<ae;++ce)if(fe[ce]!==le[ce]){z=fe[ce],ne=le[ce];break}return z<ne?-1:ne<z?1:0},g.prototype.includes=function(l,s,c){return-1!==this.indexOf(l,s,c)},g.prototype.indexOf=function(l,s,c){return O(this,l,s,c,!0)},g.prototype.lastIndexOf=function(l,s,c){return O(this,l,s,c,!1)},g.prototype.write=function(l,s,c,w){if(void 0===s)w="utf8",c=this.length,s=0;else if(void 0===c&&"string"==typeof s)w=s,c=this.length,s=0;else{if(!isFinite(s))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");s>>>=0,isFinite(c)?(c>>>=0,void 0===w&&(w="utf8")):(w=c,c=void 0)}var k=this.length-s;if((void 0===c||c>k)&&(c=k),l.length>0&&(c<0||s<0)||s>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");for(var z=!1;;)switch(w){case"hex":return P(this,l,s,c);case"utf8":case"utf-8":return R(this,l,s,c);case"ascii":return B(this,l,s,c);case"latin1":case"binary":return I(this,l,s,c);case"base64":return $(this,l,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,l,s,c);default:if(z)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),z=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var W=4096;function S(l,s,c){var w="";c=Math.min(l.length,c);for(var k=s;k<c;++k)w+=String.fromCharCode(127&l[k]);return w}function q(l,s,c){var w="";c=Math.min(l.length,c);for(var k=s;k<c;++k)w+=String.fromCharCode(l[k]);return w}function G(l,s,c){var w=l.length;(!s||s<0)&&(s=0),(!c||c<0||c>w)&&(c=w);for(var k="",z=s;z<c;++z)k+=v(l[z]);return k}function re(l,s,c){for(var w=l.slice(s,c),k="",z=0;z<w.length;z+=2)k+=String.fromCharCode(w[z]+256*w[z+1]);return k}function oe(l,s,c){if(l%1!=0||l<0)throw new RangeError("offset is not uint");if(l+s>c)throw new RangeError("Trying to access beyond buffer length")}function se(l,s,c,w,k,z){if(!g.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(s>k||s<z)throw new RangeError('"value" argument is out of bounds');if(c+w>l.length)throw new RangeError("Index out of range")}function Y(l,s,c,w,k,z){if(c+w>l.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function N(l,s,c,w,k){return s=+s,c>>>=0,k||Y(l,0,c,4),C.write(l,s,c,w,23,4),c+4}function V(l,s,c,w,k){return s=+s,c>>>=0,k||Y(l,0,c,8),C.write(l,s,c,w,52,8),c+8}g.prototype.slice=function(l,s){var c=this.length;(l=~~l)<0?(l+=c)<0&&(l=0):l>c&&(l=c),(s=void 0===s?c:~~s)<0?(s+=c)<0&&(s=0):s>c&&(s=c),s<l&&(s=l);var w=this.subarray(l,s);return w.__proto__=g.prototype,w},g.prototype.readUIntLE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l],k=1,z=0;++z<s&&(k*=256);)w+=this[l+z]*k;return w},g.prototype.readUIntBE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l+--s],k=1;s>0&&(k*=256);)w+=this[l+--s]*k;return w},g.prototype.readUInt8=function(l,s){return l>>>=0,s||oe(l,1,this.length),this[l]},g.prototype.readUInt16LE=function(l,s){return l>>>=0,s||oe(l,2,this.length),this[l]|this[l+1]<<8},g.prototype.readUInt16BE=function(l,s){return l>>>=0,s||oe(l,2,this.length),this[l]<<8|this[l+1]},g.prototype.readUInt32LE=function(l,s){return l>>>=0,s||oe(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+16777216*this[l+3]},g.prototype.readUInt32BE=function(l,s){return l>>>=0,s||oe(l,4,this.length),16777216*this[l]+(this[l+1]<<16|this[l+2]<<8|this[l+3])},g.prototype.readIntLE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l],k=1,z=0;++z<s&&(k*=256);)w+=this[l+z]*k;return w>=(k*=128)&&(w-=Math.pow(2,8*s)),w},g.prototype.readIntBE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=s,k=1,z=this[l+--w];w>0&&(k*=256);)z+=this[l+--w]*k;return z>=(k*=128)&&(z-=Math.pow(2,8*s)),z},g.prototype.readInt8=function(l,s){return l>>>=0,s||oe(l,1,this.length),128&this[l]?-1*(255-this[l]+1):this[l]},g.prototype.readInt16LE=function(l,s){l>>>=0,s||oe(l,2,this.length);var c=this[l]|this[l+1]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt16BE=function(l,s){l>>>=0,s||oe(l,2,this.length);var c=this[l+1]|this[l]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt32LE=function(l,s){return l>>>=0,s||oe(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},g.prototype.readInt32BE=function(l,s){return l>>>=0,s||oe(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},g.prototype.readFloatLE=function(l,s){return l>>>=0,s||oe(l,4,this.length),C.read(this,l,!0,23,4)},g.prototype.readFloatBE=function(l,s){return l>>>=0,s||oe(l,4,this.length),C.read(this,l,!1,23,4)},g.prototype.readDoubleLE=function(l,s){return l>>>=0,s||oe(l,8,this.length),C.read(this,l,!0,52,8)},g.prototype.readDoubleBE=function(l,s){return l>>>=0,s||oe(l,8,this.length),C.read(this,l,!1,52,8)},g.prototype.writeUIntLE=function(l,s,c,w){l=+l,s>>>=0,c>>>=0,w||se(this,l,s,c,Math.pow(2,8*c)-1,0);var k=1,z=0;for(this[s]=255&l;++z<c&&(k*=256);)this[s+z]=l/k&255;return s+c},g.prototype.writeUIntBE=function(l,s,c,w){l=+l,s>>>=0,c>>>=0,w||se(this,l,s,c,Math.pow(2,8*c)-1,0);var k=c-1,z=1;for(this[s+k]=255&l;--k>=0&&(z*=256);)this[s+k]=l/z&255;return s+c},g.prototype.writeUInt8=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,1,255,0),this[s]=255&l,s+1},g.prototype.writeUInt16LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,65535,0),this[s]=255&l,this[s+1]=l>>>8,s+2},g.prototype.writeUInt16BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,65535,0),this[s]=l>>>8,this[s+1]=255&l,s+2},g.prototype.writeUInt32LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,4294967295,0),this[s+3]=l>>>24,this[s+2]=l>>>16,this[s+1]=l>>>8,this[s]=255&l,s+4},g.prototype.writeUInt32BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,4294967295,0),this[s]=l>>>24,this[s+1]=l>>>16,this[s+2]=l>>>8,this[s+3]=255&l,s+4},g.prototype.writeIntLE=function(l,s,c,w){if(l=+l,s>>>=0,!w){var k=Math.pow(2,8*c-1);se(this,l,s,c,k-1,-k)}var z=0,ne=1,ae=0;for(this[s]=255&l;++z<c&&(ne*=256);)l<0&&0===ae&&0!==this[s+z-1]&&(ae=1),this[s+z]=(l/ne>>0)-ae&255;return s+c},g.prototype.writeIntBE=function(l,s,c,w){if(l=+l,s>>>=0,!w){var k=Math.pow(2,8*c-1);se(this,l,s,c,k-1,-k)}var z=c-1,ne=1,ae=0;for(this[s+z]=255&l;--z>=0&&(ne*=256);)l<0&&0===ae&&0!==this[s+z+1]&&(ae=1),this[s+z]=(l/ne>>0)-ae&255;return s+c},g.prototype.writeInt8=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,1,127,-128),l<0&&(l=255+l+1),this[s]=255&l,s+1},g.prototype.writeInt16LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,32767,-32768),this[s]=255&l,this[s+1]=l>>>8,s+2},g.prototype.writeInt16BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,32767,-32768),this[s]=l>>>8,this[s+1]=255&l,s+2},g.prototype.writeInt32LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,2147483647,-2147483648),this[s]=255&l,this[s+1]=l>>>8,this[s+2]=l>>>16,this[s+3]=l>>>24,s+4},g.prototype.writeInt32BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[s]=l>>>24,this[s+1]=l>>>16,this[s+2]=l>>>8,this[s+3]=255&l,s+4},g.prototype.writeFloatLE=function(l,s,c){return N(this,l,s,!0,c)},g.prototype.writeFloatBE=function(l,s,c){return N(this,l,s,!1,c)},g.prototype.writeDoubleLE=function(l,s,c){return V(this,l,s,!0,c)},g.prototype.writeDoubleBE=function(l,s,c){return V(this,l,s,!1,c)},g.prototype.copy=function(l,s,c,w){if(!g.isBuffer(l))throw new TypeError("argument should be a Buffer");if(c||(c=0),w||0===w||(w=this.length),s>=l.length&&(s=l.length),s||(s=0),w>0&&w<c&&(w=c),w===c||0===l.length||0===this.length)return 0;if(s<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),l.length-s<w-c&&(w=l.length-s+c);var k=w-c;if(this===l&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(s,c,w);else if(this===l&&c<s&&s<w)for(var z=k-1;z>=0;--z)l[z+s]=this[z+c];else Uint8Array.prototype.set.call(l,this.subarray(c,w),s);return k},g.prototype.fill=function(l,s,c,w){if("string"==typeof l){if("string"==typeof s?(w=s,s=0,c=this.length):"string"==typeof c&&(w=c,c=this.length),void 0!==w&&"string"!=typeof w)throw new TypeError("encoding must be a string");if("string"==typeof w&&!g.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(1===l.length){var k=l.charCodeAt(0);("utf8"===w&&k<128||"latin1"===w)&&(l=k)}}else"number"==typeof l&&(l&=255);if(s<0||this.length<s||this.length<c)throw new RangeError("Out of range index");if(c<=s)return this;var z;if(s>>>=0,c=void 0===c?this.length:c>>>0,l||(l=0),"number"==typeof l)for(z=s;z<c;++z)this[z]=l;else{var ne=g.isBuffer(l)?l:g.from(l,w),ae=ne.length;if(0===ae)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(z=0;z<c-s;++z)this[z+s]=ne[z%ae]}return this};var Q=/[^+/0-9A-Za-z-_]/g;function v(l){return l<16?"0"+l.toString(16):l.toString(16)}function x(l,s){var c;s=s||1/0;for(var w=l.length,k=null,z=[],ne=0;ne<w;++ne){if((c=l.charCodeAt(ne))>55295&&c<57344){if(!k){if(c>56319){(s-=3)>-1&&z.push(239,191,189);continue}if(ne+1===w){(s-=3)>-1&&z.push(239,191,189);continue}k=c;continue}if(c<56320){(s-=3)>-1&&z.push(239,191,189),k=c;continue}c=65536+(k-55296<<10|c-56320)}else k&&(s-=3)>-1&&z.push(239,191,189);if(k=null,c<128){if((s-=1)<0)break;z.push(c)}else if(c<2048){if((s-=2)<0)break;z.push(c>>6|192,63&c|128)}else if(c<65536){if((s-=3)<0)break;z.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((s-=4)<0)break;z.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return z}function D(l){return b.toByteArray(function(s){if((s=(s=s.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;s.length%4!=0;)s+="=";return s}(l))}function H(l,s,c,w){for(var k=0;k<w&&!(k+c>=s.length||k>=l.length);++k)s[k+c]=l[k];return k}function ee(l,s){return l instanceof s||null!=l&&null!=l.constructor&&null!=l.constructor.name&&l.constructor.name===s.name}function te(l){return l!=l}}).call(this,L("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:28}],13:[function(L,X,K){(function(g){function b(C){return Object.prototype.toString.call(C)}K.isArray=function(C){return Array.isArray?Array.isArray(C):"[object Array]"===b(C)},K.isBoolean=function(C){return"boolean"==typeof C},K.isNull=function(C){return null===C},K.isNullOrUndefined=function(C){return null==C},K.isNumber=function(C){return"number"==typeof C},K.isString=function(C){return"string"==typeof C},K.isSymbol=function(C){return"symbol"==typeof C},K.isUndefined=function(C){return void 0===C},K.isRegExp=function(C){return"[object RegExp]"===b(C)},K.isObject=function(C){return"object"==typeof C&&null!==C},K.isDate=function(C){return"[object Date]"===b(C)},K.isError=function(C){return"[object Error]"===b(C)||C instanceof Error},K.isFunction=function(C){return"function"==typeof C},K.isPrimitive=function(C){return null===C||"boolean"==typeof C||"number"==typeof C||"string"==typeof C||"symbol"==typeof C||void 0===C},K.isBuffer=g.isBuffer}).call(this,{isBuffer:L("../../is-buffer/index.js")})},{"../../is-buffer/index.js":30}],14:[function(L,X,K){(function(g){K.log=function(){var C;return"object"==typeof console&&console.log&&(C=console).log.apply(C,arguments)},K.formatArgs=function(C){if(C[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+C[0]+(this.useColors?"%c ":" ")+"+"+X.exports.humanize(this.diff),this.useColors){var f="color: "+this.color;C.splice(1,0,f,"color: inherit");var d=0,_=0;C[0].replace(/%[a-zA-Z%]/g,function(m){"%%"!==m&&"%c"===m&&(_=++d)}),C.splice(_,0,f)}},K.save=function(C){try{C?K.storage.setItem("debug",C):K.storage.removeItem("debug")}catch(f){}},K.load=function(){var C;try{C=K.storage.getItem("debug")}catch(f){}return!C&&void 0!==g&&"env"in g&&(C=g.env.DEBUG),C},K.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},K.storage=function(){try{return localStorage}catch(C){}}(),K.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],X.exports=L("./common")(K),X.exports.formatters.j=function(C){try{return JSON.stringify(C)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}}).call(this,L("_process"))},{"./common":15,_process:44}],15:[function(L,X,K){X.exports=function(g){function b(m){for(var M=0,T=0;T<m.length;T++)M=(M<<5)-M+m.charCodeAt(T),M|=0;return C.colors[Math.abs(M)%C.colors.length]}function C(m){var M;function T(){for(var E=arguments.length,h=new Array(E),p=0;p<E;p++)h[p]=arguments[p];if(T.enabled){var O=T,A=Number(new Date);O.diff=A-(M||A),O.prev=M,O.curr=A,M=A,h[0]=C.coerce(h[0]),"string"!=typeof h[0]&&h.unshift("%O");var R=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,function(B,I){if("%%"===B)return B;R++;var $=C.formatters[I];return"function"==typeof $&&(B=$.call(O,h[R]),h.splice(R,1),R--),B}),C.formatArgs.call(O,h),(O.log||C.log).apply(O,h)}}return T.namespace=m,T.enabled=C.enabled(m),T.useColors=C.useColors(),T.color=b(m),T.destroy=f,T.extend=d,"function"==typeof C.init&&C.init(T),C.instances.push(T),T}function f(){var m=C.instances.indexOf(this);return-1!==m&&(C.instances.splice(m,1),!0)}function d(m,M){var T=C(this.namespace+(void 0===M?":":M)+m);return T.log=this.log,T}function _(m){return m.toString().substring(2,m.toString().length-2).replace(/\.\*\?$/,"*")}return C.debug=C,C.default=C,C.coerce=function(m){return m instanceof Error?m.stack||m.message:m},C.disable=function(){var m=[].concat(gt(C.names.map(_)),gt(C.skips.map(_).map(function(M){return"-"+M}))).join(",");return C.enable(""),m},C.enable=function(m){var M;C.save(m),C.names=[],C.skips=[];var T=("string"==typeof m?m:"").split(/[\s,]+/),E=T.length;for(M=0;M<E;M++)T[M]&&("-"===(m=T[M].replace(/\*/g,".*?"))[0]?C.skips.push(new RegExp("^"+m.substr(1)+"$")):C.names.push(new RegExp("^"+m+"$")));for(M=0;M<C.instances.length;M++){var h=C.instances[M];h.enabled=C.enabled(h.namespace)}},C.enabled=function(m){if("*"===m[m.length-1])return!0;var M,T;for(M=0,T=C.skips.length;M<T;M++)if(C.skips[M].test(m))return!1;for(M=0,T=C.names.length;M<T;M++)if(C.names[M].test(m))return!0;return!1},C.humanize=L("ms"),Object.keys(g).forEach(function(m){C[m]=g[m]}),C.instances=[],C.names=[],C.skips=[],C.formatters={},C.selectColor=b,C.enable(C.load()),C}},{ms:41}],16:[function(L,X,K){(function(g,b){var C=L("readable-stream"),f=L("end-of-stream"),d=L("inherits"),_=L("stream-shift"),m=b.from&&b.from!==Uint8Array.from?b.from([0]):new b([0]),M=function(p,O){p._corked?p.once("uncork",O):O()},T=function(p,O){return function(A){var P;A?(P=p)._autoDestroy&&P.destroy("premature close"===A.message?null:A):O&&!p._ended&&p.end()}},E=function h(p,O,A){if(!(this instanceof h))return new h(p,O,A);C.Duplex.call(this,A),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!A||!1!==A.autoDestroy,this._forwardDestroy=!A||!1!==A.destroy,this._forwardEnd=!A||!1!==A.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,p&&this.setWritable(p),O&&this.setReadable(O)};d(E,C.Duplex),E.obj=function(h,p,O){return O||(O={}),O.objectMode=!0,O.highWaterMark=16,new E(h,p,O)},E.prototype.cork=function(){1==++this._corked&&this.emit("cork")},E.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},E.prototype.setWritable=function(h){if(this._unwrite&&this._unwrite(),this.destroyed)h&&h.destroy&&h.destroy();else if(null!==h&&!1!==h){var p=this,O=f(h,{writable:!0,readable:!1},T(this,this._forwardEnd)),A=function(){var R=p._ondrain;p._ondrain=null,R&&R()};this._unwrite&&g.nextTick(A),this._writable=h,this._writable.on("drain",A),this._unwrite=function(){p._writable.removeListener("drain",A),O()},this.uncork()}else this.end()},E.prototype.setReadable=function(h){if(this._unread&&this._unread(),this.destroyed)h&&h.destroy&&h.destroy();else{if(null===h||!1===h)return this.push(null),void this.resume();var p,O=this,A=f(h,{writable:!1,readable:!0},T(this)),P=function(){O._forward()},R=function(){O.push(null)};this._drained=!0,this._readable=h,this._readable2=h._readableState?h:(p=h,new C.Readable({objectMode:!0,highWaterMark:16}).wrap(p)),this._readable2.on("readable",P),this._readable2.on("end",R),this._unread=function(){O._readable2.removeListener("readable",P),O._readable2.removeListener("end",R),A()},this._forward()}},E.prototype._read=function(){this._drained=!0,this._forward()},E.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var h;for(this._forwarding=!0;this._drained&&null!==(h=_(this._readable2));)this.destroyed||(this._drained=this.push(h));this._forwarding=!1}},E.prototype.destroy=function(h){if(!this.destroyed){this.destroyed=!0;var p=this;g.nextTick(function(){p._destroy(h)})}},E.prototype._destroy=function(h){if(h){var p=this._ondrain;this._ondrain=null,p?p(h):this.emit("error",h)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},E.prototype._write=function(h,p,O){return this.destroyed?O():this._corked?M(this,this._write.bind(this,h,p,O)):h===m?this._finish(O):this._writable?void(!1===this._writable.write(h)?this._ondrain=O:O()):O()},E.prototype._finish=function(h){var p=this;this.emit("preend"),M(this,function(){var O,A;A=function(){!1===p._writableState.prefinished&&(p._writableState.prefinished=!0),p.emit("prefinish"),M(p,h)},(O=p._forwardEnd&&p._writable)?O._writableState&&O._writableState.finished?A():O._writableState?O.end(A):(O.end(),A()):A()})},E.prototype.end=function(h,p,O){return"function"==typeof h?this.end(null,null,h):"function"==typeof p?this.end(h,null,p):(this._ended=!0,h&&this.write(h),this._writableState.ending||this.write(m),C.Writable.prototype.end.call(this,O))},X.exports=E}).call(this,L("_process"),L("buffer").Buffer)},{_process:44,buffer:12,"end-of-stream":26,inherits:29,"readable-stream":25,"stream-shift":66}],17:[function(L,X,K){"use strict";var g=L("process-nextick-args"),b=Object.keys||function(p){var O=[];for(var A in p)O.push(A);return O};X.exports=T;var C=Object.create(L("core-util-is"));C.inherits=L("inherits");var f=L("./_stream_readable"),d=L("./_stream_writable");C.inherits(T,f);for(var _=b(d.prototype),m=0;m<_.length;m++){var M=_[m];T.prototype[M]||(T.prototype[M]=d.prototype[M])}function T(p){if(!(this instanceof T))return new T(p);f.call(this,p),d.call(this,p),p&&!1===p.readable&&(this.readable=!1),p&&!1===p.writable&&(this.writable=!1),this.allowHalfOpen=!0,p&&!1===p.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",E)}function E(){this.allowHalfOpen||this._writableState.ended||g.nextTick(h,this)}function h(p){p.end()}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(O){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=O,this._writableState.destroyed=O)}}),T.prototype._destroy=function(p,O){this.push(null),this.end(),g.nextTick(O,p)}},{"./_stream_readable":19,"./_stream_writable":21,"core-util-is":13,inherits:29,"process-nextick-args":43}],18:[function(L,X,K){"use strict";X.exports=C;var g=L("./_stream_transform"),b=Object.create(L("core-util-is"));function C(f){if(!(this instanceof C))return new C(f);g.call(this,f)}b.inherits=L("inherits"),b.inherits(C,g),C.prototype._transform=function(f,d,_){_(null,f)}},{"./_stream_transform":20,"core-util-is":13,inherits:29}],19:[function(L,X,K){(function(g,b){"use strict";var C=L("process-nextick-args");X.exports=I;var f,d=L("isarray");I.ReadableState=B,L("events");var _=function(x,D){return x.listeners(D).length},m=L("./internal/streams/stream"),M=L("safe-buffer").Buffer,T=b.Uint8Array||function(){},E=Object.create(L("core-util-is"));E.inherits=L("inherits");var h=L("util"),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var O,A=L("./internal/streams/BufferList"),P=L("./internal/streams/destroy");E.inherits(I,m);var R=["error","close","destroy","pause","resume"];function B(v,x){var D=x instanceof(f=f||L("./_stream_duplex"));this.objectMode=!!(v=v||{}).objectMode,D&&(this.objectMode=this.objectMode||!!v.readableObjectMode);var H=v.highWaterMark,ee=v.readableHighWaterMark;this.highWaterMark=H||0===H?H:D&&(ee||0===ee)?ee:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=v.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,v.encoding&&(O||(O=L("string_decoder/").StringDecoder),this.decoder=new O(v.encoding),this.encoding=v.encoding)}function I(v){if(f=f||L("./_stream_duplex"),!(this instanceof I))return new I(v);this._readableState=new B(v,this),this.readable=!0,v&&("function"==typeof v.read&&(this._read=v.read),"function"==typeof v.destroy&&(this._destroy=v.destroy)),m.call(this)}function $(v,x,D,H,ee){var te,s,c,w,k,l=v._readableState;return null===x?(l.reading=!1,function(s,c){if(!c.ended){if(c.decoder){var w=c.decoder.end();w&&w.length&&(c.buffer.push(w),c.length+=c.objectMode?1:w.length)}c.ended=!0,W(s)}}(v,l)):(ee||(s=l,M.isBuffer(k=c=x)||k instanceof T||"string"==typeof c||void 0===c||s.objectMode||(w=new TypeError("Invalid non-string/buffer chunk")),te=w),te?v.emit("error",te):l.objectMode||x&&x.length>0?("string"==typeof x||l.objectMode||Object.getPrototypeOf(x)===M.prototype||(x=function(s){return M.from(s)}(x)),H?l.endEmitted?v.emit("error",new Error("stream.unshift() after end event")):F(v,l,x,!0):l.ended?v.emit("error",new Error("stream.push() after EOF")):(l.reading=!1,l.decoder&&!D?(x=l.decoder.write(x),l.objectMode||0!==x.length?F(v,l,x,!1):q(v,l)):F(v,l,x,!1))):H||(l.reading=!1)),function(s){return!s.ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}(l)}function F(v,x,D,H){x.flowing&&0===x.length&&!x.sync?(v.emit("data",D),v.read(0)):(x.length+=x.objectMode?1:D.length,H?x.buffer.unshift(D):x.buffer.push(D),x.needReadable&&W(v)),q(v,x)}Object.defineProperty(I.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),I.prototype.destroy=P.destroy,I.prototype._undestroy=P.undestroy,I.prototype._destroy=function(v,x){this.push(null),x(v)},I.prototype.push=function(v,x){var D,H=this._readableState;return H.objectMode?D=!0:"string"==typeof v&&((x=x||H.defaultEncoding)!==H.encoding&&(v=M.from(v,x),x=""),D=!0),$(this,v,x,!1,D)},I.prototype.unshift=function(v){return $(this,v,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(v){return O||(O=L("string_decoder/").StringDecoder),this._readableState.decoder=new O(v),this._readableState.encoding=v,this};var Z=8388608;function U(v,x){return v<=0||0===x.length&&x.ended?0:x.objectMode?1:v!=v?x.flowing&&x.length?x.buffer.head.data.length:x.length:(v>x.highWaterMark&&(x.highWaterMark=((D=v)>=Z?D=Z:(D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++),D)),v<=x.length?v:x.ended?x.length:(x.needReadable=!0,0));var D}function W(v){var x=v._readableState;x.needReadable=!1,x.emittedReadable||(p("emitReadable",x.flowing),x.emittedReadable=!0,x.sync?C.nextTick(S,v):S(v))}function S(v){p("emit readable"),v.emit("readable"),se(v)}function q(v,x){x.readingMore||(x.readingMore=!0,C.nextTick(G,v,x))}function G(v,x){for(var D=x.length;!x.reading&&!x.flowing&&!x.ended&&x.length<x.highWaterMark&&(p("maybeReadMore read 0"),v.read(0),D!==x.length);)D=x.length;x.readingMore=!1}function re(v){p("readable nexttick read 0"),v.read(0)}function oe(v,x){x.reading||(p("resume read 0"),v.read(0)),x.resumeScheduled=!1,x.awaitDrain=0,v.emit("resume"),se(v),x.flowing&&!x.reading&&v.read(0)}function se(v){var x=v._readableState;for(p("flow",x.flowing);x.flowing&&null!==v.read(););}function Y(v,x){return 0===x.length?null:(x.objectMode?D=x.buffer.shift():!v||v>=x.length?(D=x.decoder?x.buffer.join(""):1===x.buffer.length?x.buffer.head.data:x.buffer.concat(x.length),x.buffer.clear()):(te=x.decoder,(H=v)<(ee=x.buffer).head.data.length?(l=ee.head.data.slice(0,H),ee.head.data=ee.head.data.slice(H)):l=H===ee.head.data.length?ee.shift():te?function(s,c){var w=c.head,k=1,z=w.data;for(s-=z.length;w=w.next;){var ne=w.data,ae=s>ne.length?ne.length:s;if(z+=ae===ne.length?ne:ne.slice(0,s),0==(s-=ae)){ae===ne.length?(++k,c.head=w.next?w.next:c.tail=null):(c.head=w,w.data=ne.slice(ae));break}++k}return c.length-=k,z}(H,ee):function(s,c){var w=M.allocUnsafe(s),k=c.head,z=1;for(k.data.copy(w),s-=k.data.length;k=k.next;){var ne=k.data,ae=s>ne.length?ne.length:s;if(ne.copy(w,w.length-s,0,ae),0==(s-=ae)){ae===ne.length?(++z,c.head=k.next?k.next:c.tail=null):(c.head=k,k.data=ne.slice(ae));break}++z}return c.length-=z,w}(H,ee),D=l),D);var H,ee,te,l,D}function N(v){var x=v._readableState;if(x.length>0)throw new Error('"endReadable()" called on non-empty stream');x.endEmitted||(x.ended=!0,C.nextTick(V,x,v))}function V(v,x){v.endEmitted||0!==v.length||(v.endEmitted=!0,x.readable=!1,x.emit("end"))}function Q(v,x){for(var D=0,H=v.length;D<H;D++)if(v[D]===x)return D;return-1}I.prototype.read=function(v){p("read",v),v=parseInt(v,10);var x=this._readableState,D=v;if(0!==v&&(x.emittedReadable=!1),0===v&&x.needReadable&&(x.length>=x.highWaterMark||x.ended))return p("read: emitReadable",x.length,x.ended),0===x.length&&x.ended?N(this):W(this),null;if(0===(v=U(v,x))&&x.ended)return 0===x.length&&N(this),null;var H,ee=x.needReadable;return p("need readable",ee),(0===x.length||x.length-v<x.highWaterMark)&&p("length less than watermark",ee=!0),x.ended||x.reading?p("reading or ended",ee=!1):ee&&(p("do read"),x.reading=!0,x.sync=!0,0===x.length&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(v=U(D,x))),null===(H=v>0?Y(v,x):null)?(x.needReadable=!0,v=0):x.length-=v,0===x.length&&(x.ended||(x.needReadable=!0),D!==v&&x.ended&&N(this)),null!==H&&this.emit("data",H),H},I.prototype._read=function(v){this.emit("error",new Error("_read() is not implemented"))},I.prototype.pipe=function(v,x){var D=this,H=this._readableState;switch(H.pipesCount){case 0:H.pipes=v;break;case 1:H.pipes=[H.pipes,v];break;default:H.pipes.push(v)}H.pipesCount+=1,p("pipe count=%d opts=%j",H.pipesCount,x);var ee=x&&!1===x.end||v===g.stdout||v===g.stderr?fe:l;function l(){p("onend"),v.end()}H.endEmitted?C.nextTick(ee):D.once("end",ee),v.on("unpipe",function te(le,ce){p("onunpipe"),le===D&&ce&&!1===ce.hasUnpiped&&(ce.hasUnpiped=!0,p("cleanup"),v.removeListener("close",ne),v.removeListener("finish",ae),v.removeListener("drain",s),v.removeListener("error",z),v.removeListener("unpipe",te),D.removeListener("end",l),D.removeListener("end",fe),D.removeListener("data",k),c=!0,!H.awaitDrain||v._writableState&&!v._writableState.needDrain||s())});var le,s=(le=D,function(){var ce=le._readableState;p("pipeOnDrain",ce.awaitDrain),ce.awaitDrain&&ce.awaitDrain--,0===ce.awaitDrain&&_(le,"data")&&(ce.flowing=!0,se(le))});v.on("drain",s);var c=!1,w=!1;function k(le){p("ondata"),w=!1,!1!==v.write(le)||w||((1===H.pipesCount&&H.pipes===v||H.pipesCount>1&&-1!==Q(H.pipes,v))&&!c&&(p("false write response, pause",D._readableState.awaitDrain),D._readableState.awaitDrain++,w=!0),D.pause())}function z(le){p("onerror",le),fe(),v.removeListener("error",z),0===_(v,"error")&&v.emit("error",le)}function ne(){v.removeListener("finish",ae),fe()}function ae(){p("onfinish"),v.removeListener("close",ne),fe()}function fe(){p("unpipe"),D.unpipe(v)}return D.on("data",k),function(le,ce,xe){if("function"==typeof le.prependListener)return le.prependListener(ce,xe);le._events&&le._events[ce]?d(le._events[ce])?le._events[ce].unshift(xe):le._events[ce]=[xe,le._events[ce]]:le.on(ce,xe)}(v,"error",z),v.once("close",ne),v.once("finish",ae),v.emit("pipe",D),H.flowing||(p("pipe resume"),D.resume()),v},I.prototype.unpipe=function(v){var x=this._readableState,D={hasUnpiped:!1};if(0===x.pipesCount)return this;if(1===x.pipesCount)return v&&v!==x.pipes||(v||(v=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,v&&v.emit("unpipe",this,D)),this;if(!v){var H=x.pipes,ee=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var te=0;te<ee;te++)H[te].emit("unpipe",this,D);return this}var l=Q(x.pipes,v);return-1===l||(x.pipes.splice(l,1),x.pipesCount-=1,1===x.pipesCount&&(x.pipes=x.pipes[0]),v.emit("unpipe",this,D)),this},I.prototype.addListener=I.prototype.on=function(v,x){var D=m.prototype.on.call(this,v,x);if("data"===v)!1!==this._readableState.flowing&&this.resume();else if("readable"===v){var H=this._readableState;H.endEmitted||H.readableListening||(H.readableListening=H.needReadable=!0,H.emittedReadable=!1,H.reading?H.length&&W(this):C.nextTick(re,this))}return D},I.prototype.resume=function(){var D,v=this._readableState;return v.flowing||(p("resume"),v.flowing=!0,this,(D=v).resumeScheduled||(D.resumeScheduled=!0,C.nextTick(oe,this,D))),this},I.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},I.prototype.wrap=function(v){var x=this,D=this._readableState,H=!1;for(var ee in v.on("end",function(){if(p("wrapped end"),D.decoder&&!D.ended){var l=D.decoder.end();l&&l.length&&x.push(l)}x.push(null)}),v.on("data",function(l){p("wrapped data"),D.decoder&&(l=D.decoder.write(l)),(!D.objectMode||null!=l)&&(D.objectMode||l&&l.length)&&(x.push(l)||(H=!0,v.pause()))}),v)void 0===this[ee]&&"function"==typeof v[ee]&&(this[ee]=function(l){return function(){return v[l].apply(v,arguments)}}(ee));for(var te=0;te<R.length;te++)v.on(R[te],this.emit.bind(this,R[te]));return this._read=function(l){p("wrapped _read",l),H&&(H=!1,v.resume())},this},Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),I._fromList=Y}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":17,"./internal/streams/BufferList":22,"./internal/streams/destroy":23,"./internal/streams/stream":24,_process:44,"core-util-is":13,events:27,inherits:29,isarray:31,"process-nextick-args":43,"safe-buffer":65,"string_decoder/":67,util:11}],20:[function(L,X,K){"use strict";X.exports=C;var g=L("./_stream_duplex"),b=Object.create(L("core-util-is"));function C(_){if(!(this instanceof C))return new C(_);g.call(this,_),this._transformState={afterTransform:function(m,M){var T=this._transformState;T.transforming=!1;var E=T.writecb;if(!E)return this.emit("error",new Error("write callback called multiple times"));T.writechunk=null,T.writecb=null,null!=M&&this.push(M),E(m);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,_&&("function"==typeof _.transform&&(this._transform=_.transform),"function"==typeof _.flush&&(this._flush=_.flush)),this.on("prefinish",f)}function f(){var _=this;"function"==typeof this._flush?this._flush(function(m,M){d(_,m,M)}):d(this,null,null)}function d(_,m,M){if(m)return _.emit("error",m);if(null!=M&&_.push(M),_._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(_._transformState.transforming)throw new Error("Calling transform done when still transforming");return _.push(null)}b.inherits=L("inherits"),b.inherits(C,g),C.prototype.push=function(_,m){return this._transformState.needTransform=!1,g.prototype.push.call(this,_,m)},C.prototype._transform=function(_,m,M){throw new Error("_transform() is not implemented")},C.prototype._write=function(_,m,M){var T=this._transformState;if(T.writecb=M,T.writechunk=_,T.writeencoding=m,!T.transforming){var E=this._readableState;(T.needTransform||E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}},C.prototype._read=function(_){var m=this._transformState;null!==m.writechunk&&m.writecb&&!m.transforming?(m.transforming=!0,this._transform(m.writechunk,m.writeencoding,m.afterTransform)):m.needTransform=!0},C.prototype._destroy=function(_,m){var M=this;g.prototype._destroy.call(this,_,function(T){m(T),M.emit("close")})}},{"./_stream_duplex":17,"core-util-is":13,inherits:29}],21:[function(L,X,K){(function(g,b,C){"use strict";var f=L("process-nextick-args");function d(S){var q=this;this.next=null,this.entry=null,this.finish=function(){!function(G,re,oe){var se=G.entry;for(G.entry=null;se;){var Y=se.callback;re.pendingcb--,Y(undefined),se=se.next}re.corkedRequestsFree?re.corkedRequestsFree.next=G:re.corkedRequestsFree=G}(q,S)}}X.exports=B;var _,m=!g.browser&&["v0.10","v0.9."].indexOf(g.version.slice(0,5))>-1?C:f.nextTick;B.WritableState=R;var M=Object.create(L("core-util-is"));M.inherits=L("inherits");var O,T={deprecate:L("util-deprecate")},E=L("./internal/streams/stream"),h=L("safe-buffer").Buffer,p=b.Uint8Array||function(){},A=L("./internal/streams/destroy");function P(){}function R(S,q){_=_||L("./_stream_duplex");var G=q instanceof _;this.objectMode=!!(S=S||{}).objectMode,G&&(this.objectMode=this.objectMode||!!S.writableObjectMode);var re=S.highWaterMark,oe=S.writableHighWaterMark;this.highWaterMark=re||0===re?re:G&&(oe||0===oe)?oe:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===S.decodeStrings),this.defaultEncoding=S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(N){!function(V,Q){var ee,v=V._writableState,x=v.sync,D=v.writecb;if((ee=v).writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0,Q)!function(ee,te,l,s,c){--te.pendingcb,l?(f.nextTick(c,s),f.nextTick(W,ee,te),ee._writableState.errorEmitted=!0,ee.emit("error",s)):(c(s),ee._writableState.errorEmitted=!0,ee.emit("error",s),W(ee,te))}(V,v,x,Q,D);else{var H=Z(v);H||v.corked||v.bufferProcessing||!v.bufferedRequest||F(V,v),x?m($,V,v,H,D):$(V,v,H,D)}}(q,N)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}function B(S){if(_=_||L("./_stream_duplex"),!(O.call(B,this)||this instanceof _))return new B(S);this._writableState=new R(S,this),this.writable=!0,S&&("function"==typeof S.write&&(this._write=S.write),"function"==typeof S.writev&&(this._writev=S.writev),"function"==typeof S.destroy&&(this._destroy=S.destroy),"function"==typeof S.final&&(this._final=S.final)),E.call(this)}function I(S,q,G,re,oe,se,Y){q.writelen=re,q.writecb=Y,q.writing=!0,q.sync=!0,G?S._writev(oe,q.onwrite):S._write(oe,se,q.onwrite),q.sync=!1}function $(S,q,G,re){var oe,se;G||(oe=S,0===(se=q).length&&se.needDrain&&(se.needDrain=!1,oe.emit("drain"))),q.pendingcb--,re(),W(S,q)}function F(S,q){q.bufferProcessing=!0;var G=q.bufferedRequest;if(S._writev&&G&&G.next){var oe=new Array(q.bufferedRequestCount),se=q.corkedRequestsFree;se.entry=G;for(var Y=0,N=!0;G;)oe[Y]=G,G.isBuf||(N=!1),G=G.next,Y+=1;oe.allBuffers=N,I(S,q,!0,q.length,oe,"",se.finish),q.pendingcb++,q.lastBufferedRequest=null,se.next?(q.corkedRequestsFree=se.next,se.next=null):q.corkedRequestsFree=new d(q),q.bufferedRequestCount=0}else{for(;G;){var V=G.chunk;if(I(S,q,!1,q.objectMode?1:V.length,V,G.encoding,G.callback),G=G.next,q.bufferedRequestCount--,q.writing)break}null===G&&(q.lastBufferedRequest=null)}q.bufferedRequest=G,q.bufferProcessing=!1}function Z(S){return S.ending&&0===S.length&&null===S.bufferedRequest&&!S.finished&&!S.writing}function U(S,q){S._final(function(G){q.pendingcb--,G&&S.emit("error",G),q.prefinished=!0,S.emit("prefinish"),W(S,q)})}function W(S,q){var re,oe,G=Z(q);return G&&(re=S,(oe=q).prefinished||oe.finalCalled||("function"==typeof re._final?(oe.pendingcb++,oe.finalCalled=!0,f.nextTick(U,re,oe)):(oe.prefinished=!0,re.emit("prefinish"))),0===q.pendingcb&&(q.finished=!0,S.emit("finish"))),G}M.inherits(B,E),R.prototype.getBuffer=function(){for(var S=this.bufferedRequest,q=[];S;)q.push(S),S=S.next;return q},function(){try{Object.defineProperty(R.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(S){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(O=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(q){return!!O.call(this,q)||this===B&&q&&q._writableState instanceof R}})):O=function(q){return q instanceof this},B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},B.prototype.write=function(S,q,G){var re,N,V,Q,oe=this._writableState,se=!1,Y=!oe.objectMode&&(h.isBuffer(re=S)||re instanceof p);return Y&&!h.isBuffer(S)&&(S=h.from(S)),"function"==typeof q&&(G=q,q=null),Y?q="buffer":q||(q=oe.defaultEncoding),"function"!=typeof G&&(G=P),oe.ended?(N=this,V=G,Q=new Error("write after end"),N.emit("error",Q),f.nextTick(V,Q)):(Y||function(N,V,Q,v){var x=!0,D=!1;return null===Q?D=new TypeError("May not write null values to stream"):"string"==typeof Q||void 0===Q||V.objectMode||(D=new TypeError("Invalid non-string/buffer chunk")),D&&(N.emit("error",D),f.nextTick(v,D),x=!1),x}(this,oe,S,G))&&(oe.pendingcb++,se=function(N,V,Q,v,x,D){if(!Q){var H=(c=v,(s=V).objectMode||!1===s.decodeStrings||"string"!=typeof c||(c=h.from(c,x)),c);v!==H&&(Q=!0,x="buffer",v=H)}var s,c,ee=V.objectMode?1:v.length;V.length+=ee;var te=V.length<V.highWaterMark;if(te||(V.needDrain=!0),V.writing||V.corked){var l=V.lastBufferedRequest;V.lastBufferedRequest={chunk:v,encoding:x,isBuf:Q,callback:D,next:null},l?l.next=V.lastBufferedRequest:V.bufferedRequest=V.lastBufferedRequest,V.bufferedRequestCount+=1}else I(N,V,!1,ee,v,x,D);return te}(this,oe,Y,S,q,G)),se},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var S=this._writableState;S.corked&&(S.corked--,S.writing||S.corked||S.finished||S.bufferProcessing||!S.bufferedRequest||F(this,S))},B.prototype.setDefaultEncoding=function(S){if("string"==typeof S&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(S,q,G){G(new Error("_write() is not implemented"))},B.prototype._writev=null,B.prototype.end=function(S,q,G){var se,Y,re=this._writableState;"function"==typeof S?(G=S,S=null,q=null):"function"==typeof q&&(G=q,q=null),null!=S&&this.write(S,q),re.corked&&(re.corked=1,this.uncork()),re.ending||re.finished||(this,Y=G,(se=re).ending=!0,W(this,se),Y&&(se.finished?f.nextTick(Y):this.once("finish",Y)),se.ended=!0,this.writable=!1)},Object.defineProperty(B.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(q){this._writableState&&(this._writableState.destroyed=q)}}),B.prototype.destroy=A.destroy,B.prototype._undestroy=A.undestroy,B.prototype._destroy=function(S,q){this.end(),q(S)}}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},L("timers").setImmediate)},{"./_stream_duplex":17,"./internal/streams/destroy":23,"./internal/streams/stream":24,_process:44,"core-util-is":13,inherits:29,"process-nextick-args":43,"safe-buffer":65,timers:68,"util-deprecate":71}],22:[function(L,X,K){"use strict";var g=L("safe-buffer").Buffer,b=L("util");X.exports=function(){function C(){(function(f,d){if(!(f instanceof d))throw new TypeError("Cannot call a class as a function")})(this,C),this.head=null,this.tail=null,this.length=0}return C.prototype.push=function(f){var d={data:f,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length},C.prototype.unshift=function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length},C.prototype.shift=function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}},C.prototype.clear=function(){this.head=this.tail=null,this.length=0},C.prototype.join=function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _},C.prototype.concat=function(f){if(0===this.length)return g.alloc(0);if(1===this.length)return this.head.data;for(var M=g.allocUnsafe(f>>>0),T=this.head,E=0;T;)T.data.copy(M,E),E+=T.data.length,T=T.next;return M},C}(),b&&b.inspect&&b.inspect.custom&&(X.exports.prototype[b.inspect.custom]=function(){var C=b.inspect({length:this.length});return this.constructor.name+" "+C})},{"safe-buffer":65,util:11}],23:[function(L,X,K){"use strict";var g=L("process-nextick-args");function b(C,f){C.emit("error",f)}X.exports={destroy:function(f,d){var _=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(d?d(f):!f||this._writableState&&this._writableState.errorEmitted||g.nextTick(b,this,f),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(T){!d&&T?(g.nextTick(b,_,T),_._writableState&&(_._writableState.errorEmitted=!0)):d&&d(T)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":43}],24:[function(L,X,K){X.exports=L("events").EventEmitter},{events:27}],25:[function(L,X,K){(K=X.exports=L("./lib/_stream_readable.js")).Stream=K,K.Readable=K,K.Writable=L("./lib/_stream_writable.js"),K.Duplex=L("./lib/_stream_duplex.js"),K.Transform=L("./lib/_stream_transform.js"),K.PassThrough=L("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":17,"./lib/_stream_passthrough.js":18,"./lib/_stream_readable.js":19,"./lib/_stream_transform.js":20,"./lib/_stream_writable.js":21}],26:[function(L,X,K){(function(g){var b=L("once"),C=function(){};X.exports=function d(_,m,M){if("function"==typeof m)return d(_,null,m);m||(m={}),M=b(M||C);var U,T=_._writableState,E=_._readableState,h=m.readable||!1!==m.readable&&_.readable,p=m.writable||!1!==m.writable&&_.writable,O=!1,A=function(){_.writable||P()},P=function(){p=!1,h||M.call(_)},R=function(){h=!1,p||M.call(_)},B=function(W){M.call(_,W?new Error("exited with error code: "+W):null)},I=function(W){M.call(_,W)},$=function(){g.nextTick(F)},F=function(){if(!O)return(!h||E&&E.ended&&!E.destroyed)&&(!p||T&&T.ended&&!T.destroyed)?void 0:M.call(_,new Error("premature close"))},Z=function(){_.req.on("finish",P)};return(U=_).setHeader&&"function"==typeof U.abort?(_.on("complete",P),_.on("abort",$),_.req?Z():_.on("request",Z)):p&&!T&&(_.on("end",A),_.on("close",A)),function(U){return U.stdio&&Array.isArray(U.stdio)&&3===U.stdio.length}(_)&&_.on("exit",B),_.on("end",R),_.on("finish",P),!1!==m.error&&_.on("error",I),_.on("close",$),function(){O=!0,_.removeListener("complete",P),_.removeListener("abort",$),_.removeListener("request",Z),_.req&&_.req.removeListener("finish",P),_.removeListener("end",A),_.removeListener("close",A),_.removeListener("finish",P),_.removeListener("exit",B),_.removeListener("end",R),_.removeListener("error",I),_.removeListener("close",$)}}}).call(this,L("_process"))},{_process:44,once:42}],27:[function(L,X,K){var g=Object.create||function(P){var R=function(){};return R.prototype=P,new R},b=Object.keys||function(P){var R=[];for(var B in P)Object.prototype.hasOwnProperty.call(P,B)&&R.push(B);return B},C=Function.prototype.bind||function(P){var R=this;return function(){return R.apply(P,arguments)}};function f(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=g(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}X.exports=f,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._maxListeners=void 0;var d,_=10;try{var m={};Object.defineProperty&&Object.defineProperty(m,"x",{value:0}),d=0===m.x}catch(P){d=!1}function M(P){return void 0===P._maxListeners?f.defaultMaxListeners:P._maxListeners}function T(P,R,B,I){var $,F,Z;if("function"!=typeof B)throw new TypeError('"listener" argument must be a function');if((F=P._events)?(F.newListener&&(P.emit("newListener",R,B.listener?B.listener:B),F=P._events),Z=F[R]):(F=P._events=g(null),P._eventsCount=0),Z){if("function"==typeof Z?Z=F[R]=I?[B,Z]:[Z,B]:I?Z.unshift(B):Z.push(B),!Z.warned&&($=M(P))&&$>0&&Z.length>$){Z.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+Z.length+' "'+String(R)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');U.name="MaxListenersExceededWarning",U.emitter=P,U.type=R,U.count=Z.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",U.name,U.message)}}else Z=F[R]=B,++P._eventsCount;return P}function E(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var P=new Array(arguments.length),R=0;R<P.length;++R)P[R]=arguments[R];this.listener.apply(this.target,P)}}function h(P,R,B){var I={fired:!1,wrapFn:void 0,target:P,type:R,listener:B},$=C.call(E,I);return $.listener=B,I.wrapFn=$,$}function p(P,R,B){var I=P._events;if(!I)return[];var $=I[R];return $?"function"==typeof $?B?[$.listener||$]:[$]:B?function(F){for(var Z=new Array(F.length),U=0;U<Z.length;++U)Z[U]=F[U].listener||F[U];return Z}($):A($,$.length):[]}function O(P){var R=this._events;if(R){var B=R[P];if("function"==typeof B)return 1;if(B)return B.length}return 0}function A(P,R){for(var B=new Array(R),I=0;I<R;++I)B[I]=P[I];return B}d?Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return _},set:function(R){if("number"!=typeof R||R<0||R!=R)throw new TypeError('"defaultMaxListeners" must be a positive number');_=R}}):f.defaultMaxListeners=_,f.prototype.setMaxListeners=function(P){if("number"!=typeof P||P<0||isNaN(P))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=P,this},f.prototype.getMaxListeners=function(){return M(this)},f.prototype.emit=function(P){var R,B,I,$,F,Z,U="error"===P;if(Z=this._events)U=U&&null==Z.error;else if(!U)return!1;if(U){if(arguments.length>1&&(R=arguments[1]),R instanceof Error)throw R;var W=new Error('Unhandled "error" event. ('+R+")");throw W.context=R,W}if(!(B=Z[P]))return!1;var S="function"==typeof B;switch(I=arguments.length){case 1:!function(q,G,re){if(G)q.call(re);else for(var oe=q.length,se=A(q,oe),Y=0;Y<oe;++Y)se[Y].call(re)}(B,S,this);break;case 2:!function(q,G,re,oe){if(G)q.call(re,oe);else for(var se=q.length,Y=A(q,se),N=0;N<se;++N)Y[N].call(re,oe)}(B,S,this,arguments[1]);break;case 3:!function(q,G,re,oe,se){if(G)q.call(re,oe,se);else for(var Y=q.length,N=A(q,Y),V=0;V<Y;++V)N[V].call(re,oe,se)}(B,S,this,arguments[1],arguments[2]);break;case 4:!function(q,G,re,oe,se,Y){if(G)q.call(re,oe,se,Y);else for(var N=q.length,V=A(q,N),Q=0;Q<N;++Q)V[Q].call(re,oe,se,Y)}(B,S,this,arguments[1],arguments[2],arguments[3]);break;default:for($=new Array(I-1),F=1;F<I;F++)$[F-1]=arguments[F];!function(q,G,re,oe){if(G)q.apply(re,oe);else for(var se=q.length,Y=A(q,se),N=0;N<se;++N)Y[N].apply(re,oe)}(B,S,this,$)}return!0},f.prototype.on=f.prototype.addListener=function(P,R){return T(this,P,R,!1)},f.prototype.prependListener=function(P,R){return T(this,P,R,!0)},f.prototype.once=function(P,R){if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');return this.on(P,h(this,P,R)),this},f.prototype.prependOnceListener=function(P,R){if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');return this.prependListener(P,h(this,P,R)),this},f.prototype.removeListener=function(P,R){var B,I,$,F,Z;if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');if(!(I=this._events))return this;if(!(B=I[P]))return this;if(B===R||B.listener===R)0==--this._eventsCount?this._events=g(null):(delete I[P],I.removeListener&&this.emit("removeListener",P,B.listener||R));else if("function"!=typeof B){for($=-1,F=B.length-1;F>=0;F--)if(B[F]===R||B[F].listener===R){Z=B[F].listener,$=F;break}if($<0)return this;0===$?B.shift():function(U,W){for(var S=W,q=S+1,G=U.length;q<G;S+=1,q+=1)U[S]=U[q];U.pop()}(B,$),1===B.length&&(I[P]=B[0]),I.removeListener&&this.emit("removeListener",P,Z||R)}return this},f.prototype.removeAllListeners=function(P){var R,B,I;if(!(B=this._events))return this;if(!B.removeListener)return 0===arguments.length?(this._events=g(null),this._eventsCount=0):B[P]&&(0==--this._eventsCount?this._events=g(null):delete B[P]),this;if(0===arguments.length){var $,F=b(B);for(I=0;I<F.length;++I)"removeListener"!==($=F[I])&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=g(null),this._eventsCount=0,this}if("function"==typeof(R=B[P]))this.removeListener(P,R);else if(R)for(I=R.length-1;I>=0;I--)this.removeListener(P,R[I]);return this},f.prototype.listeners=function(P){return p(this,P,!0)},f.prototype.rawListeners=function(P){return p(this,P,!1)},f.listenerCount=function(P,R){return"function"==typeof P.listenerCount?P.listenerCount(R):O.call(P,R)},f.prototype.listenerCount=O,f.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],28:[function(L,X,K){K.read=function(g,b,C,f,d){var _,m,M=8*d-f-1,T=(1<<M)-1,E=T>>1,h=-7,p=C?d-1:0,O=C?-1:1,A=g[b+p];for(p+=O,_=A&(1<<-h)-1,A>>=-h,h+=M;h>0;_=256*_+g[b+p],p+=O,h-=8);for(m=_&(1<<-h)-1,_>>=-h,h+=f;h>0;m=256*m+g[b+p],p+=O,h-=8);if(0===_)_=1-E;else{if(_===T)return m?NaN:1/0*(A?-1:1);m+=Math.pow(2,f),_-=E}return(A?-1:1)*m*Math.pow(2,_-f)},K.write=function(g,b,C,f,d,_){var m,M,T,E=8*_-d-1,h=(1<<E)-1,p=h>>1,O=23===d?Math.pow(2,-24)-Math.pow(2,-77):0,A=f?0:_-1,P=f?1:-1,R=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(M=isNaN(b)?1:0,m=h):(m=Math.floor(Math.log(b)/Math.LN2),b*(T=Math.pow(2,-m))<1&&(m--,T*=2),(b+=m+p>=1?O/T:O*Math.pow(2,1-p))*T>=2&&(m++,T/=2),m+p>=h?(M=0,m=h):m+p>=1?(M=(b*T-1)*Math.pow(2,d),m+=p):(M=b*Math.pow(2,p-1)*Math.pow(2,d),m=0));d>=8;g[C+A]=255&M,A+=P,M/=256,d-=8);for(m=m<<d|M,E+=d;E>0;g[C+A]=255&m,A+=P,m/=256,E-=8);g[C+A-P]|=128*R}},{}],29:[function(L,X,K){X.exports="function"==typeof Object.create?function(g,b){b&&(g.super_=b,g.prototype=Object.create(b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}))}:function(g,b){if(b){g.super_=b;var C=function(){};C.prototype=b.prototype,g.prototype=new C,g.prototype.constructor=g}}},{}],30:[function(L,X,K){function g(b){return!!b.constructor&&"function"==typeof b.constructor.isBuffer&&b.constructor.isBuffer(b)}X.exports=function(b){return null!=b&&(g(b)||"function"==typeof(C=b).readFloatLE&&"function"==typeof C.slice&&g(C.slice(0,0))||!!b._isBuffer);var C}},{}],31:[function(L,X,K){var g={}.toString;X.exports=Array.isArray||function(b){return"[object Array]"==g.call(b)}},{}],32:[function(L,X,K){(function(g){var b=X.exports;for(var C in b.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},b.codes={},b.types)b.codes[b.types[C]]=C;for(var d in b.CMD_SHIFT=4,b.CMD_MASK=240,b.DUP_MASK=8,b.QOS_MASK=3,b.QOS_SHIFT=1,b.RETAIN_MASK=1,b.VARBYTEINT_MASK=127,b.VARBYTEINT_FIN_MASK=128,b.SESSIONPRESENT_MASK=1,b.SESSIONPRESENT_HEADER=g.from([b.SESSIONPRESENT_MASK]),b.CONNACK_HEADER=g.from([b.codes.connack<<b.CMD_SHIFT]),b.USERNAME_MASK=128,b.PASSWORD_MASK=64,b.WILL_RETAIN_MASK=32,b.WILL_QOS_MASK=24,b.WILL_QOS_SHIFT=3,b.WILL_FLAG_MASK=4,b.CLEAN_SESSION_MASK=2,b.CONNECT_HEADER=g.from([b.codes.connect<<b.CMD_SHIFT]),b.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},b.propertiesCodes={},b.properties)b.propertiesCodes[b.properties[d]]=d;function m(M){return[0,1,2].map(function(T){return[0,1].map(function(E){return[0,1].map(function(h){var p=g.alloc(1);return p.writeUInt8(b.codes[M]<<b.CMD_SHIFT|(E?b.DUP_MASK:0)|T<<b.QOS_SHIFT|h,0,!0),p})})})}b.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},b.PUBLISH_HEADER=m("publish"),b.SUBSCRIBE_HEADER=m("subscribe"),b.SUBSCRIBE_OPTIONS_QOS_MASK=3,b.SUBSCRIBE_OPTIONS_NL_MASK=1,b.SUBSCRIBE_OPTIONS_NL_SHIFT=2,b.SUBSCRIBE_OPTIONS_RAP_MASK=1,b.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,b.SUBSCRIBE_OPTIONS_RH_MASK=3,b.SUBSCRIBE_OPTIONS_RH_SHIFT=4,b.SUBSCRIBE_OPTIONS_RH=[0,16,32],b.SUBSCRIBE_OPTIONS_NL=4,b.SUBSCRIBE_OPTIONS_RAP=8,b.SUBSCRIBE_OPTIONS_QOS=[0,1,2],b.UNSUBSCRIBE_HEADER=m("unsubscribe"),b.ACKS={unsuback:m("unsuback"),puback:m("puback"),pubcomp:m("pubcomp"),pubrel:m("pubrel"),pubrec:m("pubrec")},b.SUBACK_HEADER=g.from([b.codes.suback<<b.CMD_SHIFT]),b.VERSION3=g.from([3]),b.VERSION4=g.from([4]),b.VERSION5=g.from([5]),b.QOS=[0,1,2].map(function(M){return g.from([M])}),b.EMPTY={pingreq:g.from([b.codes.pingreq<<4,0]),pingresp:g.from([b.codes.pingresp<<4,0]),disconnect:g.from([b.codes.disconnect<<4,0])}}).call(this,L("buffer").Buffer)},{buffer:12}],33:[function(L,X,K){(function(g){var b=L("./writeToStream"),f=function(d){"use strict";De(m,d);var _=nt(m);function m(){var M;return e(this,m),(M=_.call(this))._array=new Array(20),M._i=0,M}return _e(m,[{key:"write",value:function(T){return this._array[this._i++]=T,!0}},{key:"concat",value:function(){var p,T=0,E=new Array(this._array.length),h=this._array,O=0;for(p=0;p<h.length&&void 0!==h[p];p++)E[p]="string"!=typeof h[p]?h[p].length:g.byteLength(h[p]),T+=E[p];var A=g.allocUnsafe(T);for(p=0;p<h.length&&void 0!==h[p];p++)"string"!=typeof h[p]?(h[p].copy(A,O),O+=E[p]):(A.write(h[p],O),O+=E[p]);return A}}]),m}(L("events"));X.exports=function(d,_){var m=new f;return b(d,m,_),m.concat()}}).call(this,L("buffer").Buffer)},{"./writeToStream":40,buffer:12,events:27}],34:[function(L,X,K){K.parser=L("./parser").parser,K.generate=L("./generate"),K.writeToStream=L("./writeToStream")},{"./generate":33,"./parser":39,"./writeToStream":40}],35:[function(L,X,K){"use strict";var b=L("buffer").Buffer,C=Symbol.for("BufferList");function f(d){if(!(this instanceof f))return new f(d);f._init.call(this,d)}f._init=function(d){Object.defineProperty(this,C,{value:!0}),this._bufs=[],this.length=0,d&&this.append(d)},f.prototype._new=function(d){return new f(d)},f.prototype._offset=function(d){if(0===d)return[0,0];for(var _=0,m=0;m<this._bufs.length;m++){var M=_+this._bufs[m].length;if(d<M||m===this._bufs.length-1)return[m,d-_];_=M}},f.prototype._reverseOffset=function(d){for(var _=d[0],m=d[1],M=0;M<_;M++)m+=this._bufs[M].length;return m},f.prototype.get=function(d){if(!(d>this.length||d<0)){var _=this._offset(d);return this._bufs[_[0]][_[1]]}},f.prototype.slice=function(d,_){return"number"==typeof d&&d<0&&(d+=this.length),"number"==typeof _&&_<0&&(_+=this.length),this.copy(null,0,d,_)},f.prototype.copy=function(d,_,m,M){if(("number"!=typeof m||m<0)&&(m=0),("number"!=typeof M||M>this.length)&&(M=this.length),m>=this.length||M<=0)return d||b.alloc(0);var T=!!d,E=this._offset(m),h=M-m,p=h,O=T&&_||0,A=E[1];if(0===m&&M===this.length){if(!T)return 1===this._bufs.length?this._bufs[0]:b.concat(this._bufs,this.length);for(var P=0;P<this._bufs.length;P++)this._bufs[P].copy(d,O),O+=this._bufs[P].length;return d}if(p<=this._bufs[E[0]].length-A)return T?this._bufs[E[0]].copy(d,_,A,A+p):this._bufs[E[0]].slice(A,A+p);T||(d=b.allocUnsafe(h));for(var R=E[0];R<this._bufs.length;R++){var B=this._bufs[R].length-A;if(!(p>B)){this._bufs[R].copy(d,O,A,A+p),O+=B;break}this._bufs[R].copy(d,O,A),O+=B,p-=B,A&&(A=0)}return d.length>O?d.slice(0,O):d},f.prototype.shallowSlice=function(d,_){if((d=d||0)<0&&(d+=this.length),(_="number"!=typeof _?this.length:_)<0&&(_+=this.length),d===_)return this._new();var m=this._offset(d),M=this._offset(_),T=this._bufs.slice(m[0],M[0]+1);return 0===M[1]?T.pop():T[T.length-1]=T[T.length-1].slice(0,M[1]),0!==m[1]&&(T[0]=T[0].slice(m[1])),this._new(T)},f.prototype.toString=function(d,_,m){return this.slice(_,m).toString(d)},f.prototype.consume=function(d){if(d=Math.trunc(d),Number.isNaN(d)||d<=0)return this;for(;this._bufs.length;){if(!(d>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(d),this.length-=d;break}d-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},f.prototype.duplicate=function(){for(var d=this._new(),_=0;_<this._bufs.length;_++)d.append(this._bufs[_]);return d},f.prototype.append=function(d){if(null==d)return this;if(d.buffer)this._appendBuffer(b.from(d.buffer,d.byteOffset,d.byteLength));else if(Array.isArray(d))for(var _=0;_<d.length;_++)this.append(d[_]);else if(this._isBufferList(d))for(var m=0;m<d._bufs.length;m++)this.append(d._bufs[m]);else"number"==typeof d&&(d=d.toString()),this._appendBuffer(b.from(d));return this},f.prototype._appendBuffer=function(d){this._bufs.push(d),this.length+=d.length},f.prototype.indexOf=function(d,_,m){if(void 0===m&&"string"==typeof _&&(m=_,_=void 0),"function"==typeof d||Array.isArray(d))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof d?d=b.from([d]):"string"==typeof d?d=b.from(d,m):this._isBufferList(d)?d=d.slice():Array.isArray(d.buffer)?d=b.from(d.buffer,d.byteOffset,d.byteLength):b.isBuffer(d)||(d=b.from(d)),_=Number(_||0),isNaN(_)&&(_=0),_<0&&(_=this.length+_),_<0&&(_=0),0===d.length)return _>this.length?this.length:_;for(var M=this._offset(_),T=M[0],E=M[1];T<this._bufs.length;T++){for(var h=this._bufs[T];E<h.length;)if(h.length-E>=d.length){var p=h.indexOf(d,E);if(-1!==p)return this._reverseOffset([T,p]);E=h.length-d.length+1}else{var O=this._reverseOffset([T,E]);if(this._match(O,d))return O;E++}E=0}return-1},f.prototype._match=function(d,_){if(this.length-d<_.length)return!1;for(var m=0;m<_.length;m++)if(this.get(d+m)!==_[m])return!1;return!0},function(){var d={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(var _ in d)!function(m){f.prototype[m]=null===d[m]?function(M,T){return this.slice(M,M+T)[m](0,T)}:function(M){return this.slice(M,M+d[m])[m](0)}}(_)}(),f.prototype._isBufferList=function(d){return d instanceof f||f.isBufferList(d)},f.isBufferList=function(d){return null!=d&&d[C]},X.exports=f},{buffer:12}],36:[function(L,X,K){"use strict";var g=L("readable-stream").Duplex,b=L("inherits"),C=L("./BufferList");function f(d){if(!(this instanceof f))return new f(d);if("function"==typeof d){this._callback=d;var _=function(m){this._callback&&(this._callback(m),this._callback=null)}.bind(this);this.on("pipe",function(m){m.on("error",_)}),this.on("unpipe",function(m){m.removeListener("error",_)}),d=null}C._init.call(this,d),g.call(this)}b(f,g),Object.assign(f.prototype,C.prototype),f.prototype._new=function(d){return new f(d)},f.prototype._write=function(d,_,m){this._appendBuffer(d),"function"==typeof m&&m()},f.prototype._read=function(d){if(!this.length)return this.push(null);d=Math.min(d,this.length),this.push(this.slice(0,d)),this.consume(d)},f.prototype.end=function(d){g.prototype.end.call(this,d),this._callback&&(this._callback(null,this.slice()),this._callback=null)},f.prototype._destroy=function(d,_){this._bufs.length=0,this.length=0,_(d)},f.prototype._isBufferList=function(d){return d instanceof f||d instanceof C||f.isBufferList(d)},f.isBufferList=C.isBufferList,X.exports=f,X.exports.BufferListStream=f,X.exports.BufferList=C},{"./BufferList":35,inherits:29,"readable-stream":63}],37:[function(L,X,K){(function(g){var C={},f=g.isBuffer(g.from([1,2]).subarray(0,1));function d(_){var m=g.allocUnsafe(2);return m.writeUInt8(_>>8,0),m.writeUInt8(255&_,1),m}X.exports={cache:C,generateCache:function(){for(var m=0;m<65536;m++)C[m]=d(m)},generateNumber:d,genBufVariableByteInt:function(m){var M=0,T=0,E=g.allocUnsafe(4);do{M=m%128|0,(m=m/128|0)>0&&(M|=128),E.writeUInt8(M,T++)}while(m>0&&T<4);return m>0&&(T=0),f?E.subarray(0,T):E.slice(0,T)},generate4ByteBuffer:function(m){var M=g.allocUnsafe(4);return M.writeUInt32BE(m,0),M}}}).call(this,L("buffer").Buffer)},{buffer:12}],38:[function(L,X,K){X.exports=function(){"use strict";return _e(function g(){e(this,g),this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null})}()},{}],39:[function(L,X,K){var g=L("bl"),b=L("events"),C=L("./packet"),f=L("./constants"),d=L("debug")("mqtt-packet:parser");X.exports=function(m){"use strict";De(T,m);var M=nt(T);function T(){var E;return e(this,T),(E=M.call(this)).parser=E.constructor.parser,E}return _e(T,[{key:"_resetState",value:function(){d("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new C,this.error=null,this._list=g(),this._stateCounter=0}},{key:"parse",value:function(h){for(this.error&&this._resetState(),this._list.append(h),d("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,d("parse: state complete. _stateCounter is now: %d",this._stateCounter),d("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return d("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}},{key:"_parseHeader",value:function(){var h=this._list.readUInt8(0);return this.packet.cmd=f.types[h>>f.CMD_SHIFT],this.packet.retain=0!=(h&f.RETAIN_MASK),this.packet.qos=h>>f.QOS_SHIFT&f.QOS_MASK,this.packet.dup=0!=(h&f.DUP_MASK),d("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}},{key:"_parseLength",value:function(){var h=this._parseVarByteNum(!0);return h?(this.packet.length=h.value,this._list.consume(h.bytes)):this._emitError(new Error("Invalid length")),d("_parseLength %d",h.value),!!h}},{key:"_parsePayload",value:function(){d("_parsePayload: payload %O",this._list);var h=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}h=!0}return d("_parsePayload complete result: %s",h),h}},{key:"_parseConnect",value:function(){var h,p,O,A;d("_parseConnect");var P={},R=this.packet,B=this._parseString();if(null===B)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==B&&"MQIsdp"!==B)return this._emitError(new Error("Invalid protocolId"));if(R.protocolId=B,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(R.protocolVersion=this._list.readUInt8(this._pos),3!==R.protocolVersion&&4!==R.protocolVersion&&5!==R.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(P.username=this._list.readUInt8(this._pos)&f.USERNAME_MASK,P.password=this._list.readUInt8(this._pos)&f.PASSWORD_MASK,P.will=this._list.readUInt8(this._pos)&f.WILL_FLAG_MASK,P.will&&(R.will={},R.will.retain=0!=(this._list.readUInt8(this._pos)&f.WILL_RETAIN_MASK),R.will.qos=(this._list.readUInt8(this._pos)&f.WILL_QOS_MASK)>>f.WILL_QOS_SHIFT),R.clean=0!=(this._list.readUInt8(this._pos)&f.CLEAN_SESSION_MASK),this._pos++,R.keepalive=this._parseNum(),-1===R.keepalive)return this._emitError(new Error("Packet too short"));if(5===R.protocolVersion){var I=this._parseProperties();Object.getOwnPropertyNames(I).length&&(R.properties=I)}var $=this._parseString();if(null===$)return this._emitError(new Error("Packet too short"));if(R.clientId=$,d("_parseConnect: packet.clientId: %s",R.clientId),P.will){if(5===R.protocolVersion){var F=this._parseProperties();Object.getOwnPropertyNames(F).length&&(R.will.properties=F)}if(null===(h=this._parseString()))return this._emitError(new Error("Cannot parse will topic"));if(R.will.topic=h,d("_parseConnect: packet.will.topic: %s",R.will.topic),null===(p=this._parseBuffer()))return this._emitError(new Error("Cannot parse will payload"));R.will.payload=p,d("_parseConnect: packet.will.paylaod: %s",R.will.payload)}if(P.username){if(null===(A=this._parseString()))return this._emitError(new Error("Cannot parse username"));R.username=A,d("_parseConnect: packet.username: %s",R.username)}if(P.password){if(null===(O=this._parseBuffer()))return this._emitError(new Error("Cannot parse password"));R.password=O}return this.settings=R,d("_parseConnect: complete"),R}},{key:"_parseConnack",value:function(){d("_parseConnack");var h=this.packet;if(this._list.length<2)return null;if(h.sessionPresent=!!(this._list.readUInt8(this._pos++)&f.SESSIONPRESENT_MASK),5===this.settings.protocolVersion?h.reasonCode=this._list.readUInt8(this._pos++):h.returnCode=this._list.readUInt8(this._pos++),-1===h.returnCode||-1===h.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}d("_parseConnack: complete")}},{key:"_parsePublish",value:function(){d("_parsePublish");var h=this.packet;if(h.topic=this._parseString(),null===h.topic)return this._emitError(new Error("Cannot parse topic"));if(!(h.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}h.payload=this._list.slice(this._pos,h.length),d("_parsePublish: payload from buffer list: %o",h.payload)}}},{key:"_parseSubscribe",value:function(){d("_parseSubscribe");var p,O,A,P,R,I,h=this.packet;if(1!==h.qos)return this._emitError(new Error("Wrong subscribe header"));if(h.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var $=this._parseProperties();Object.getOwnPropertyNames($).length&&(h.properties=$)}for(;this._pos<h.length;){if(null===(p=this._parseString()))return this._emitError(new Error("Cannot parse topic"));if(this._pos>=h.length)return this._emitError(new Error("Malformed Subscribe Payload"));A=(O=this._parseByte())&f.SUBSCRIBE_OPTIONS_QOS_MASK,R=0!=(O>>f.SUBSCRIBE_OPTIONS_RAP_SHIFT&f.SUBSCRIBE_OPTIONS_RAP_MASK),P=O>>f.SUBSCRIBE_OPTIONS_RH_SHIFT&f.SUBSCRIBE_OPTIONS_RH_MASK,I={topic:p,qos:A},5===this.settings.protocolVersion&&(I.nl=0!=(O>>f.SUBSCRIBE_OPTIONS_NL_SHIFT&f.SUBSCRIBE_OPTIONS_NL_MASK),I.rap=R,I.rh=P),d("_parseSubscribe: push subscription `%s` to subscription",I),h.subscriptions.push(I)}}}},{key:"_parseSuback",value:function(){d("_parseSuback");var h=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}},{key:"_parseUnsubscribe",value:function(){d("_parseUnsubscribe");var h=this.packet;if(h.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}for(;this._pos<h.length;){var O=this._parseString();if(null===O)return this._emitError(new Error("Cannot parse topic"));d("_parseUnsubscribe: push topic `%s` to unsubscriptions",O),h.unsubscriptions.push(O)}}}},{key:"_parseUnsuback",value:function(){d("_parseUnsuback");var h=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){var p=this._parseProperties();for(Object.getOwnPropertyNames(p).length&&(h.properties=p),h.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}},{key:"_parseConfirmation",value:function(){d("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);var h=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(h.length>2&&(h.reasonCode=this._parseByte(),d("_parseConfirmation: packet.reasonCode `%d`",h.reasonCode)),h.length>3)){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}return!0}},{key:"_parseDisconnect",value:function(){var h=this.packet;if(d("_parseDisconnect"),5===this.settings.protocolVersion){h.reasonCode=this._parseByte();var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}return d("_parseDisconnect result: true"),!0}},{key:"_parseAuth",value:function(){d("_parseAuth");var h=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));h.reasonCode=this._parseByte();var p=this._parseProperties();return Object.getOwnPropertyNames(p).length&&(h.properties=p),d("_parseAuth: result: true"),!0}},{key:"_parseMessageId",value:function(){var h=this.packet;return h.messageId=this._parseNum(),null===h.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(d("_parseMessageId: packet.messageId %d",h.messageId),!0)}},{key:"_parseString",value:function(h){var p=this._parseNum(),O=p+this._pos;if(-1===p||O>this._list.length||O>this.packet.length)return null;var A=this._list.toString("utf8",this._pos,O);return this._pos+=p,d("_parseString: result: %s",A),A}},{key:"_parseStringPair",value:function(){return d("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}},{key:"_parseBuffer",value:function(){var h=this._parseNum(),p=h+this._pos;if(-1===h||p>this._list.length||p>this.packet.length)return null;var O=this._list.slice(this._pos,p);return this._pos+=h,d("_parseBuffer: result: %o",O),O}},{key:"_parseNum",value:function(){if(this._list.length-this._pos<2)return-1;var h=this._list.readUInt16BE(this._pos);return this._pos+=2,d("_parseNum: result: %s",h),h}},{key:"_parse4ByteNum",value:function(){if(this._list.length-this._pos<4)return-1;var h=this._list.readUInt32BE(this._pos);return this._pos+=4,d("_parse4ByteNum: result: %s",h),h}},{key:"_parseVarByteNum",value:function(h){d("_parseVarByteNum");for(var p,O=0,A=1,P=0,R=!1,B=this._pos?this._pos:0;O<5;){if(P+=A*((p=this._list.readUInt8(B+O++))&f.VARBYTEINT_MASK),A*=128,0==(p&f.VARBYTEINT_FIN_MASK)){R=!0;break}if(this._list.length<=O)break}return B&&(this._pos+=O),d("_parseVarByteNum: result: %o",R=!!R&&(h?{bytes:O,value:P}:P)),R}},{key:"_parseByte",value:function(){var h=this._list.readUInt8(this._pos);return this._pos++,d("_parseByte: result: %o",h),h}},{key:"_parseByType",value:function(h){switch(d("_parseByType: type: %s",h),h){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}},{key:"_parseProperties",value:function(){d("_parseProperties");for(var h=this._parseVarByteNum(),p=this._pos+h,O={};this._pos<p;){var A=this._parseByte(),P=f.propertiesCodes[A];if(!P)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==P)O[P]?(Array.isArray(O[P])||(O[P]=[O[P]]),O[P].push(this._parseByType(f.propertiesTypes[P]))):O[P]=this._parseByType(f.propertiesTypes[P]);else{O[P]||(O[P]=Object.create(null));var R=this._parseByType(f.propertiesTypes[P]);O[P][R.name]?(Array.isArray(O[P][R.name])||(O[P][R.name]=[O[P][R.name]]),O[P][R.name].push(R.value)):O[P][R.name]=R.value}}return O}},{key:"_newPacket",value:function(){return d("_newPacket"),this.packet&&(this._list.consume(this.packet.length),d("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),d("_newPacket: new packet"),this.packet=new C,this._pos=0,!0}},{key:"_emitError",value:function(h){d("_emitError"),this.error=h,this.emit("error",h)}}],[{key:"parser",value:function(h){return this instanceof T?(this.settings=h||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new T).parser(h)}}]),T}(b)},{"./constants":32,"./packet":38,bl:36,debug:14,events:27}],40:[function(L,X,K){(function(g){var b=L("./constants"),C=g.allocUnsafe(0),f=g.from([0]),d=L("./numbers"),_=L("process-nextick-args").nextTick,m=L("debug")("mqtt-packet:writeToStream"),M=d.cache,T=d.generateNumber,E=d.generateCache,h=d.genBufVariableByteInt,p=d.generate4ByteBuffer,O=Z,A=!0;function P(Y,N,V){switch(m("generate called"),N.cork&&(N.cork(),_(R,N)),A&&(A=!1,E()),m("generate: packet.cmd: %s",Y.cmd),Y.cmd){case"connect":return function(Q,v,x){var D=Q||{},H=D.protocolId||"MQTT",ee=D.protocolVersion||4,te=D.will,l=D.clean,s=D.keepalive||0,c=D.clientId||"",w=D.username,k=D.password,z=D.properties;void 0===l&&(l=!0);var ne=0;if(!H||"string"!=typeof H&&!g.isBuffer(H))return v.emit("error",new Error("Invalid protocolId")),!1;if(ne+=H.length+2,3!==ee&&4!==ee&&5!==ee)return v.emit("error",new Error("Invalid protocol version")),!1;if(ne+=1,"string"!=typeof c&&!g.isBuffer(c)||!c&&4!==ee||!c&&!l){if(ee<4)return v.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return v.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else ne+=c.length+2;if("number"!=typeof s||s<0||s>65535||s%1!=0)return v.emit("error",new Error("Invalid keepalive")),!1;if(ne+=2,ne+=1,5===ee){var ae=S(v,z);if(!ae)return!1;ne+=ae.length}if(te){if("object"!=typeof te)return v.emit("error",new Error("Invalid will")),!1;if(!te.topic||"string"!=typeof te.topic)return v.emit("error",new Error("Invalid will topic")),!1;if(ne+=g.byteLength(te.topic)+2,ne+=2,te.payload){if(!(te.payload.length>=0))return v.emit("error",new Error("Invalid will payload")),!1;ne+="string"==typeof te.payload?g.byteLength(te.payload):te.payload.length}var fe={};if(5===ee){if(!(fe=S(v,te.properties)))return!1;ne+=fe.length}}var le=!1;if(null!=w){if(!se(w))return v.emit("error",new Error("Invalid username")),!1;le=!0,ne+=g.byteLength(w)+2}if(null!=k){if(!le)return v.emit("error",new Error("Username is required to use password")),!1;if(!se(k))return v.emit("error",new Error("Invalid password")),!1;ne+=oe(k)+2}v.write(b.CONNECT_HEADER),I(v,ne),W(v,H),v.write(4===ee?b.VERSION4:5===ee?b.VERSION5:b.VERSION3);var ce=0;return ce|=null!=w?b.USERNAME_MASK:0,ce|=null!=k?b.PASSWORD_MASK:0,ce|=te&&te.retain?b.WILL_RETAIN_MASK:0,ce|=te&&te.qos?te.qos<<b.WILL_QOS_SHIFT:0,ce|=te?b.WILL_FLAG_MASK:0,v.write(g.from([ce|=l?b.CLEAN_SESSION_MASK:0])),O(v,s),5===ee&&ae.write(),W(v,c),te&&(5===ee&&fe.write(),$(v,te.topic),W(v,te.payload)),null!=w&&W(v,w),null!=k&&W(v,k),!0}(Y,N);case"connack":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=5===D?H.reasonCode:H.returnCode,te=H.properties,l=2;if("number"!=typeof ee)return v.emit("error",new Error("Invalid return code")),!1;var s=null;if(5===D){if(!(s=S(v,te)))return!1;l+=s.length}return v.write(b.CONNACK_HEADER),I(v,l),v.write(H.sessionPresent?b.SESSIONPRESENT_HEADER:f),v.write(g.from([ee])),null!=s&&s.write(),!0}(Y,N,V);case"publish":return function(Q,v,x){m("publish: packet: %o",Q);var D=x?x.protocolVersion:4,H=Q||{},ee=H.qos||0,te=H.retain?b.RETAIN_MASK:0,l=H.topic,s=H.payload||C,c=H.messageId,w=H.properties,k=0;if("string"==typeof l)k+=g.byteLength(l)+2;else{if(!g.isBuffer(l))return v.emit("error",new Error("Invalid topic")),!1;k+=l.length+2}if(g.isBuffer(s)?k+=s.length:k+=g.byteLength(s),ee&&"number"!=typeof c)return v.emit("error",new Error("Invalid messageId")),!1;ee&&(k+=2);var z=null;if(5===D){if(!(z=S(v,w)))return!1;k+=z.length}return v.write(b.PUBLISH_HEADER[ee][H.dup?1:0][te?1:0]),I(v,k),O(v,oe(l)),v.write(l),ee>0&&O(v,c),null!=z&&z.write(),m("publish: payload: %o",s),v.write(s)}(Y,N,V);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.cmd||"puback",te=H.messageId,l=H.dup&&"pubrel"===ee?b.DUP_MASK:0,s=0,c=H.reasonCode,w=H.properties,k=5===D?3:2;if("pubrel"===ee&&(s=1),"number"!=typeof te)return v.emit("error",new Error("Invalid messageId")),!1;var z=null;if(5===D&&"object"==typeof w){if(!(z=q(v,w,x,k)))return!1;k+=z.length}return v.write(b.ACKS[ee][s][l][0]),I(v,k),O(v,te),5===D&&v.write(g.from([c])),null!==z&&z.write(),!0}(Y,N,V);case"subscribe":return function(Q,v,x){m("subscribe: packet: ");var D=x?x.protocolVersion:4,H=Q||{},ee=H.dup?b.DUP_MASK:0,te=H.messageId,l=H.subscriptions,s=H.properties,c=0;if("number"!=typeof te)return v.emit("error",new Error("Invalid messageId")),!1;c+=2;var w=null;if(5===D){if(!(w=S(v,s)))return!1;c+=w.length}if("object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid subscriptions")),!1;for(var k=0;k<l.length;k+=1){var z=l[k].topic,ne=l[k].qos;if("string"!=typeof z)return v.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof ne)return v.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===D){if("boolean"!=typeof(l[k].nl||!1))return v.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(l[k].rap||!1))return v.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;var le=l[k].rh||0;if("number"!=typeof le||le>2)return v.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=g.byteLength(z)+2+1}m("subscribe: writing to stream: %o",b.SUBSCRIBE_HEADER),v.write(b.SUBSCRIBE_HEADER[1][ee?1:0][0]),I(v,c),O(v,te),null!==w&&w.write();var Ne,ce=!0,xe=Le(l);try{for(xe.s();!(Ne=xe.n()).done;){var we=Ne.value,he=we.qos,Pe=+we.nl,it=+we.rap,Lt=we.rh,ct=void 0;$(v,we.topic),ct=b.SUBSCRIBE_OPTIONS_QOS[he],5===D&&(ct|=Pe?b.SUBSCRIBE_OPTIONS_NL:0,ct|=it?b.SUBSCRIBE_OPTIONS_RAP:0,ct|=Lt?b.SUBSCRIBE_OPTIONS_RH[Lt]:0),ce=v.write(g.from([ct]))}}catch(ln){xe.e(ln)}finally{xe.f()}return ce}(Y,N,V);case"suback":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.granted,l=H.properties,s=0;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(s+=2,"object"!=typeof te||!te.length)return v.emit("error",new Error("Invalid qos vector")),!1;for(var c=0;c<te.length;c+=1){if("number"!=typeof te[c])return v.emit("error",new Error("Invalid qos vector")),!1;s+=1}var w=null;if(5===D){if(!(w=q(v,l,x,s)))return!1;s+=w.length}return v.write(b.SUBACK_HEADER),I(v,s),O(v,ee),null!==w&&w.write(),v.write(g.from(te))}(Y,N,V);case"unsubscribe":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.dup?b.DUP_MASK:0,l=H.unsubscriptions,s=H.properties,c=0;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid unsubscriptions")),!1;for(var w=0;w<l.length;w+=1){if("string"!=typeof l[w])return v.emit("error",new Error("Invalid unsubscriptions")),!1;c+=g.byteLength(l[w])+2}var k=null;if(5===D){if(!(k=S(v,s)))return!1;c+=k.length}v.write(b.UNSUBSCRIBE_HEADER[1][te?1:0][0]),I(v,c),O(v,ee),null!==k&&k.write();for(var z=!0,ne=0;ne<l.length;ne++)z=$(v,l[ne]);return z}(Y,N,V);case"unsuback":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.dup?b.DUP_MASK:0,l=H.granted,s=H.properties,c=H.cmd,w=2;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(5===D){if("object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid qos vector")),!1;for(var k=0;k<l.length;k+=1){if("number"!=typeof l[k])return v.emit("error",new Error("Invalid qos vector")),!1;w+=1}}var z=null;if(5===D){if(!(z=q(v,s,x,w)))return!1;w+=z.length}return v.write(b.ACKS[c][0][te][0]),I(v,w),O(v,ee),null!==z&&z.write(),5===D&&v.write(g.from(l)),!0}(Y,N,V);case"pingreq":case"pingresp":return N.write(b.EMPTY[Y.cmd]);case"disconnect":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.reasonCode,l=5===D?1:0,s=null;if(5===D){if(!(s=q(v,H.properties,x,l)))return!1;l+=s.length}return v.write(g.from([b.codes.disconnect<<4])),I(v,l),5===D&&v.write(g.from([ee])),null!==s&&s.write(),!0}(Y,N,V);case"auth":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.reasonCode,te=H.properties,l=5===D?1:0;5!==D&&v.emit("error",new Error("Invalid mqtt version for auth packet"));var s=q(v,te,x,l);return!!s&&(l+=s.length,v.write(g.from([b.codes.auth<<4])),I(v,l),v.write(g.from([ee])),null!==s&&s.write(),!0)}(Y,N,V);default:return N.emit("error",new Error("Unknown command")),!1}}function R(Y){Y.uncork()}Object.defineProperty(P,"cacheNumbers",{get:function(){return O===Z},set:function(N){N?(M&&0!==Object.keys(M).length||(A=!0),O=Z):(A=!1,O=U)}});var B={};function I(Y,N){var V=B[N];V||(V=h(N),N<16384&&(B[N]=V)),m("writeVarByteInt: writing to stream: %o",V),Y.write(V)}function $(Y,N){var V=g.byteLength(N);return O(Y,V),m("writeString: %s",N),Y.write(N,"utf8")}function F(Y,N,V){$(Y,N),$(Y,V)}function Z(Y,N){return m("writeNumberCached: number: %d",N),m("writeNumberCached: %o",M[N]),Y.write(M[N])}function U(Y,N){var V=T(N);return m("writeNumberGenerated: %o",V),Y.write(V)}function W(Y,N){"string"==typeof N?$(Y,N):N?(O(Y,N.length),Y.write(N)):O(Y,0)}function S(Y,N){if("object"!=typeof N||null!=N.length)return{length:1,write:function(){re(Y,{},0)}};var V=0;function Q(te,l){var s=0;switch(b.propertiesTypes[te]){case"byte":if("boolean"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=2;break;case"int8":if("number"!=typeof l||l<0||l>255)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=2;break;case"binary":if(l&&null===l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=1+g.byteLength(l)+2;break;case"int16":if("number"!=typeof l||l<0||l>65535)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=3;break;case"int32":if("number"!=typeof l||l<0||l>4294967295)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=5;break;case"var":if("number"!=typeof l||l<0||l>268435455)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=1+g.byteLength(h(l));break;case"string":if("string"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=3+g.byteLength(l.toString());break;case"pair":if("object"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=Object.getOwnPropertyNames(l).reduce(function(c,w){var k=l[w];return Array.isArray(k)?c+=k.reduce(function(z,ne){return z+(3+g.byteLength(w.toString())+2+g.byteLength(ne.toString()))},0):c+=3+g.byteLength(w.toString())+2+g.byteLength(l[w].toString()),c},0);break;default:return Y.emit("error",new Error("Invalid property ".concat(te,": ").concat(l))),!1}return s}if(N)for(var v in N){var x=0,D=0,H=N[v];if(Array.isArray(H))for(var ee=0;ee<H.length;ee++){if(!(D=Q(v,H[ee])))return!1;x+=D}else{if(!(D=Q(v,H)))return!1;x=D}if(!x)return!1;V+=x}return{length:g.byteLength(h(V))+V,write:function(){re(Y,N,V)}}}function q(Y,N,V,Q){var v=["reasonString","userProperties"],x=V&&V.properties&&V.properties.maximumPacketSize?V.properties.maximumPacketSize:0,D=S(Y,N);if(x)for(;Q+D.length>x;){var H=v.shift();if(!H||!N[H])return!1;delete N[H],D=S(Y,N)}return D}function G(Y,N,V){switch(b.propertiesTypes[N]){case"byte":Y.write(g.from([b.properties[N]])),Y.write(g.from([+V]));break;case"int8":Y.write(g.from([b.properties[N]])),Y.write(g.from([V]));break;case"binary":Y.write(g.from([b.properties[N]])),W(Y,V);break;case"int16":Y.write(g.from([b.properties[N]])),O(Y,V);break;case"int32":Y.write(g.from([b.properties[N]])),Q=Y,x=p(V),m("write4ByteNumber: %o",x),Q.write(x);break;case"var":Y.write(g.from([b.properties[N]])),I(Y,V);break;case"string":Y.write(g.from([b.properties[N]])),$(Y,V);break;case"pair":Object.getOwnPropertyNames(V).forEach(function(Q){var v=V[Q];Array.isArray(v)?v.forEach(function(x){Y.write(g.from([b.properties[N]])),F(Y,Q.toString(),x.toString())}):(Y.write(g.from([b.properties[N]])),F(Y,Q.toString(),v.toString()))});break;default:return Y.emit("error",new Error("Invalid property ".concat(N," value: ").concat(V))),!1}var Q,x}function re(Y,N,V){for(var Q in I(Y,V),N)if(Object.prototype.hasOwnProperty.call(N,Q)&&null!==N[Q]){var v=N[Q];if(Array.isArray(v))for(var x=0;x<v.length;x++)G(Y,Q,v[x]);else G(Y,Q,v)}}function oe(Y){return Y?Y instanceof g?Y.length:g.byteLength(Y):0}function se(Y){return"string"==typeof Y||Y instanceof g}X.exports=P}).call(this,L("buffer").Buffer)},{"./constants":32,"./numbers":37,buffer:12,debug:14,"process-nextick-args":43}],41:[function(L,X,K){var g=1e3,b=60*g,C=60*b,f=24*C;function m(M,T,E,h){var p=T>=1.5*E;return Math.round(M/E)+" "+h+(p?"s":"")}X.exports=function(M,T){T=T||{};var h,p,E=typeof M;if("string"===E&&M.length>0)return function(h){if(!((h=String(h)).length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(p){var O=parseFloat(p[1]);switch((p[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*O;case"weeks":case"week":case"w":return 6048e5*O;case"days":case"day":case"d":return O*f;case"hours":case"hour":case"hrs":case"hr":case"h":return O*C;case"minutes":case"minute":case"mins":case"min":case"m":return O*b;case"seconds":case"second":case"secs":case"sec":case"s":return O*g;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return O;default:return}}}}(M);if("number"===E&&isFinite(M))return T.long?(h=M,(p=Math.abs(h))>=f?m(h,p,f,"day"):p>=C?m(h,p,C,"hour"):p>=b?m(h,p,b,"minute"):p>=g?m(h,p,g,"second"):h+" ms"):function(h){var p=Math.abs(h);return p>=f?Math.round(h/f)+"d":p>=C?Math.round(h/C)+"h":p>=b?Math.round(h/b)+"m":p>=g?Math.round(h/g)+"s":h+"ms"}(M);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(M))}},{}],42:[function(L,X,K){var g=L("wrappy");function b(f){var d=function _(){return _.called?_.value:(_.called=!0,_.value=f.apply(this,arguments))};return d.called=!1,d}function C(f){var d=function m(){if(m.called)throw new Error(m.onceError);return m.called=!0,m.value=f.apply(this,arguments)};return d.onceError=(f.name||"Function wrapped with `once`")+" shouldn't be called more than once",d.called=!1,d}X.exports=g(b),X.exports.strict=g(C),b.proto=b(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return b(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return C(this)},configurable:!0})})},{wrappy:72}],43:[function(L,X,K){(function(g){"use strict";X.exports=void 0===g||!g.version||0===g.version.indexOf("v0.")||0===g.version.indexOf("v1.")&&0!==g.version.indexOf("v1.8.")?{nextTick:function(C,f,d,_){if("function"!=typeof C)throw new TypeError('"callback" argument must be a function');var m,M,T=arguments.length;switch(T){case 0:case 1:return g.nextTick(C);case 2:return g.nextTick(function(){C.call(null,f)});case 3:return g.nextTick(function(){C.call(null,f,d)});case 4:return g.nextTick(function(){C.call(null,f,d,_)});default:for(m=new Array(T-1),M=0;M<m.length;)m[M++]=arguments[M];return g.nextTick(function(){C.apply(null,m)})}}}:g}).call(this,L("_process"))},{_process:44}],44:[function(L,X,K){var g,b,C=X.exports={};function f(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function _(P){if(g===setTimeout)return setTimeout(P,0);if((g===f||!g)&&setTimeout)return g=setTimeout,setTimeout(P,0);try{return g(P,0)}catch(R){try{return g.call(null,P,0)}catch(B){return g.call(this,P,0)}}}!function(){try{g="function"==typeof setTimeout?setTimeout:f}catch(P){g=f}try{b="function"==typeof clearTimeout?clearTimeout:d}catch(P){b=d}}();var m,M=[],T=!1,E=-1;function h(){T&&m&&(T=!1,m.length?M=m.concat(M):E=-1,M.length&&p())}function p(){if(!T){var P=_(h);T=!0;for(var R=M.length;R;){for(m=M,M=[];++E<R;)m&&m[E].run();E=-1,R=M.length}m=null,T=!1,function(B){if(b===clearTimeout)return clearTimeout(B);if((b===d||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(B);try{b(B)}catch(I){try{return b.call(null,B)}catch($){return b.call(this,B)}}}(P)}}function O(P,R){this.fun=P,this.array=R}function A(){}C.nextTick=function(P){var R=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)R[B-1]=arguments[B];M.push(new O(P,R)),1!==M.length||T||_(p)},O.prototype.run=function(){this.fun.apply(null,this.array)},C.title="browser",C.browser=!0,C.env={},C.argv=[],C.version="",C.versions={},C.on=A,C.addListener=A,C.once=A,C.off=A,C.removeListener=A,C.removeAllListeners=A,C.emit=A,C.prependListener=A,C.prependOnceListener=A,C.listeners=function(P){return[]},C.binding=function(P){throw new Error("process.binding is not supported")},C.cwd=function(){return"/"},C.chdir=function(P){throw new Error("process.chdir is not supported")},C.umask=function(){return 0}},{}],45:[function(L,X,K){(function(g){!function(b){var C="object"==typeof K&&K&&!K.nodeType&&K,f="object"==typeof X&&X&&!X.nodeType&&X,d="object"==typeof g&&g;d.global!==d&&d.window!==d&&d.self!==d||(b=d);var _,m,M=2147483647,T=36,B=/^xn--/,I=/[^\x20-\x7E]/,$=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=Math.floor,W=String.fromCharCode;function S(Q){throw new RangeError(F[Q])}function q(Q,v){for(var x=Q.length,D=[];x--;)D[x]=v(Q[x]);return D}function G(Q,v){var x=Q.split("@"),D="";return x.length>1&&(D=x[0]+"@",Q=x[1]),D+q((Q=Q.replace($,".")).split("."),v).join(".")}function re(Q){for(var v,x,D=[],H=0,ee=Q.length;H<ee;)(v=Q.charCodeAt(H++))>=55296&&v<=56319&&H<ee?56320==(64512&(x=Q.charCodeAt(H++)))?D.push(((1023&v)<<10)+(1023&x)+65536):(D.push(v),H--):D.push(v);return D}function oe(Q){return q(Q,function(v){var x="";return v>65535&&(x+=W((v-=65536)>>>10&1023|55296),v=56320|1023&v),x+W(v)}).join("")}function se(Q,v){return Q+22+75*(Q<26)-((0!=v)<<5)}function Y(Q,v,x){var D=0;for(Q=x?U(Q/700):Q>>1,Q+=U(Q/v);Q>455;D+=T)Q=U(Q/35);return U(D+36*Q/(Q+38))}function N(Q){var v,x,D,H,ee,te,l,s,c,w,k,z=[],ne=Q.length,ae=0,fe=128,le=72;for((x=Q.lastIndexOf("-"))<0&&(x=0),D=0;D<x;++D)Q.charCodeAt(D)>=128&&S("not-basic"),z.push(Q.charCodeAt(D));for(H=x>0?x+1:0;H<ne;){for(ee=ae,te=1,l=T;H>=ne&&S("invalid-input"),((s=(k=Q.charCodeAt(H++))-48<10?k-22:k-65<26?k-65:k-97<26?k-97:T)>=T||s>U((M-ae)/te))&&S("overflow"),ae+=s*te,!(s<(c=l<=le?1:l>=le+26?26:l-le));l+=T)te>U(M/(w=T-c))&&S("overflow"),te*=w;le=Y(ae-ee,v=z.length+1,0==ee),U(ae/v)>M-fe&&S("overflow"),fe+=U(ae/v),ae%=v,z.splice(ae++,0,fe)}return oe(z)}function V(Q){var v,x,D,H,ee,te,l,s,c,w,k,z,ne,ae,fe,le=[];for(z=(Q=re(Q)).length,v=128,x=0,ee=72,te=0;te<z;++te)(k=Q[te])<128&&le.push(W(k));for(D=H=le.length,H&&le.push("-");D<z;){for(l=M,te=0;te<z;++te)(k=Q[te])>=v&&k<l&&(l=k);for(l-v>U((M-x)/(ne=D+1))&&S("overflow"),x+=(l-v)*ne,v=l,te=0;te<z;++te)if((k=Q[te])<v&&++x>M&&S("overflow"),k==v){for(s=x,c=T;!(s<(w=c<=ee?1:c>=ee+26?26:c-ee));c+=T)le.push(W(se(w+(fe=s-w)%(ae=T-w),0))),s=U(fe/ae);le.push(W(se(s,0))),ee=Y(x,ne,D==H),x=0,++D}++x,++v}return le.join("")}if(_={version:"1.4.1",ucs2:{decode:re,encode:oe},decode:N,encode:V,toASCII:function(v){return G(v,function(x){return I.test(x)?"xn--"+V(x):x})},toUnicode:function(v){return G(v,function(x){return B.test(x)?N(x.slice(4).toLowerCase()):x})}},C&&f)if(X.exports==C)f.exports=_;else for(m in _)_.hasOwnProperty(m)&&(C[m]=_[m]);else b.punycode=_}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(L,X,K){"use strict";function g(C,f){return Object.prototype.hasOwnProperty.call(C,f)}X.exports=function(C,f,d,_){d=d||"=";var m={};if("string"!=typeof C||0===C.length)return m;var M=/\+/g;C=C.split(f=f||"&");var T=1e3;_&&"number"==typeof _.maxKeys&&(T=_.maxKeys);var E=C.length;T>0&&E>T&&(E=T);for(var h=0;h<E;++h){var p,O,A,P,R=C[h].replace(M,"%20"),B=R.indexOf(d);B>=0?(p=R.substr(0,B),O=R.substr(B+1)):(p=R,O=""),A=decodeURIComponent(p),P=decodeURIComponent(O),g(m,A)?b(m[A])?m[A].push(P):m[A]=[m[A],P]:m[A]=P}return m};var b=Array.isArray||function(C){return"[object Array]"===Object.prototype.toString.call(C)}},{}],47:[function(L,X,K){"use strict";var g=function(_){switch(typeof _){case"string":return _;case"boolean":return _?"true":"false";case"number":return isFinite(_)?_:"";default:return""}};X.exports=function(d,_,m,M){return _=_||"&",m=m||"=",null===d&&(d=void 0),"object"==typeof d?C(f(d),function(T){var E=encodeURIComponent(g(T))+m;return b(d[T])?C(d[T],function(h){return E+encodeURIComponent(g(h))}).join(_):E+encodeURIComponent(g(d[T]))}).join(_):M?encodeURIComponent(g(M))+m+encodeURIComponent(g(d)):""};var b=Array.isArray||function(d){return"[object Array]"===Object.prototype.toString.call(d)};function C(d,_){if(d.map)return d.map(_);for(var m=[],M=0;M<d.length;M++)m.push(_(d[M],M));return m}var f=Object.keys||function(d){var _=[];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&_.push(m);return _}},{}],48:[function(L,X,K){"use strict";K.decode=K.parse=L("./decode"),K.encode=K.stringify=L("./encode")},{"./decode":46,"./encode":47}],49:[function(L,X,K){"use strict";var g={};function b(f,d,_){_||(_=Error);var m=function(M){var T,E;function h(p,O,A){return M.call(this,"string"==typeof d?d:d(p,O,A))||this}return E=M,(T=h).prototype=Object.create(E.prototype),T.prototype.constructor=T,T.__proto__=E,h}(_);m.prototype.name=_.name,m.prototype.code=f,g[f]=m}function C(f,d){if(Array.isArray(f)){var _=f.length;return f=f.map(function(m){return String(m)}),_>2?"one of ".concat(d," ").concat(f.slice(0,_-1).join(", "),", or ")+f[_-1]:2===_?"one of ".concat(d," ").concat(f[0]," or ").concat(f[1]):"of ".concat(d," ").concat(f[0])}return"of ".concat(d," ").concat(String(f))}b("ERR_INVALID_OPT_VALUE",function(f,d){return'The value "'+d+'" is invalid for option "'+f+'"'},TypeError),b("ERR_INVALID_ARG_TYPE",function(f,d,_){var m,E,p,A;if("string"==typeof d&&"not "===d.substr(0,"not ".length)?(m="must not be",d=d.replace(/^not /,"")):m="must be",p=f,(void 0===A||A>p.length)&&(A=p.length)," argument"===p.substring(A-" argument".length,A))E="The ".concat(f," ").concat(m," ").concat(C(d,"type"));else{var h=function(p,O,A){return"number"!=typeof A&&(A=0),!(A+".".length>p.length)&&-1!==p.indexOf(".",A)}(f)?"property":"argument";E='The "'.concat(f,'" ').concat(h," ").concat(m," ").concat(C(d,"type"))}return E+". Received type ".concat(typeof _)},TypeError),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),b("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),b("ERR_STREAM_PREMATURE_CLOSE","Premature close"),b("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),b("ERR_STREAM_WRITE_AFTER_END","write after end"),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),X.exports.codes=g},{}],50:[function(L,X,K){(function(g){"use strict";var b=Object.keys||function(h){var p=[];for(var O in h)p.push(O);return p};X.exports=M;var C=L("./_stream_readable"),f=L("./_stream_writable");L("inherits")(M,C);for(var d=b(f.prototype),_=0;_<d.length;_++){var m=d[_];M.prototype[m]||(M.prototype[m]=f.prototype[m])}function M(h){if(!(this instanceof M))return new M(h);C.call(this,h),f.call(this,h),this.allowHalfOpen=!0,h&&(!1===h.readable&&(this.readable=!1),!1===h.writable&&(this.writable=!1),!1===h.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||g.nextTick(E,this)}function E(h){h.end()}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(p){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}})}).call(this,L("_process"))},{"./_stream_readable":52,"./_stream_writable":54,_process:44,inherits:29}],51:[function(L,X,K){"use strict";X.exports=b;var g=L("./_stream_transform");function b(C){if(!(this instanceof b))return new b(C);g.call(this,C)}L("inherits")(b,g),b.prototype._transform=function(C,f,d){d(null,C)}},{"./_stream_transform":53,inherits:29}],52:[function(L,X,K){(function(g,b){"use strict";var C;X.exports=S,S.ReadableState=W,L("events");var M,f=function(c,w){return c.listeners(w).length},d=L("./internal/streams/stream"),_=L("buffer").Buffer,m=b.Uint8Array||function(){},T=L("util");M=T&&T.debuglog?T.debuglog("stream"):function(){};var E,h,p,O=L("./internal/streams/buffer_list"),A=L("./internal/streams/destroy"),P=L("./internal/streams/state").getHighWaterMark,R=L("../errors").codes,B=R.ERR_INVALID_ARG_TYPE,I=R.ERR_STREAM_PUSH_AFTER_EOF,$=R.ERR_METHOD_NOT_IMPLEMENTED,F=R.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;L("inherits")(S,d);var Z=A.errorOrDestroy,U=["error","close","destroy","pause","resume"];function W(s,c,w){C=C||L("./_stream_duplex"),"boolean"!=typeof w&&(w=c instanceof C),this.objectMode=!!(s=s||{}).objectMode,w&&(this.objectMode=this.objectMode||!!s.readableObjectMode),this.highWaterMark=P(this,s,"readableHighWaterMark",w),this.buffer=new O,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==s.emitClose,this.autoDestroy=!!s.autoDestroy,this.destroyed=!1,this.defaultEncoding=s.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,s.encoding&&(E||(E=L("string_decoder/").StringDecoder),this.decoder=new E(s.encoding),this.encoding=s.encoding)}function S(s){if(C=C||L("./_stream_duplex"),!(this instanceof S))return new S(s);this._readableState=new W(s,this,this instanceof C),this.readable=!0,s&&("function"==typeof s.read&&(this._read=s.read),"function"==typeof s.destroy&&(this._destroy=s.destroy)),d.call(this)}function q(s,c,w,k,z){M("readableAddChunk",c);var ne,fe,le,ce,xe,ae=s._readableState;if(null===c)ae.reading=!1,function(fe,le){if(M("onEofChunk"),!le.ended){if(le.decoder){var ce=le.decoder.end();ce&&ce.length&&(le.buffer.push(ce),le.length+=le.objectMode?1:ce.length)}le.ended=!0,le.sync?se(fe):(le.needReadable=!1,le.emittedReadable||(le.emittedReadable=!0,Y(fe)))}}(s,ae);else if(z||(fe=ae,_.isBuffer(xe=le=c)||xe instanceof m||"string"==typeof le||void 0===le||fe.objectMode||(ce=new B("chunk",["string","Buffer","Uint8Array"],le)),ne=ce),ne)Z(s,ne);else if(ae.objectMode||c&&c.length>0)if("string"==typeof c||ae.objectMode||Object.getPrototypeOf(c)===_.prototype||(c=function(fe){return _.from(fe)}(c)),k)ae.endEmitted?Z(s,new F):G(s,ae,c,!0);else if(ae.ended)Z(s,new I);else{if(ae.destroyed)return!1;ae.reading=!1,ae.decoder&&!w?(c=ae.decoder.write(c),ae.objectMode||0!==c.length?G(s,ae,c,!1):N(s,ae)):G(s,ae,c,!1)}else k||(ae.reading=!1,N(s,ae));return!ae.ended&&(ae.length<ae.highWaterMark||0===ae.length)}function G(s,c,w,k){c.flowing&&0===c.length&&!c.sync?(c.awaitDrain=0,s.emit("data",w)):(c.length+=c.objectMode?1:w.length,k?c.buffer.unshift(w):c.buffer.push(w),c.needReadable&&se(s)),N(s,c)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(c){this._readableState&&(this._readableState.destroyed=c)}}),S.prototype.destroy=A.destroy,S.prototype._undestroy=A.undestroy,S.prototype._destroy=function(s,c){c(s)},S.prototype.push=function(s,c){var w,k=this._readableState;return k.objectMode?w=!0:"string"==typeof s&&((c=c||k.defaultEncoding)!==k.encoding&&(s=_.from(s,c),c=""),w=!0),q(this,s,c,!1,w)},S.prototype.unshift=function(s){return q(this,s,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(s){E||(E=L("string_decoder/").StringDecoder);var c=new E(s);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;for(var w=this._readableState.buffer.head,k="";null!==w;)k+=c.write(w.data),w=w.next;return this._readableState.buffer.clear(),""!==k&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var re=1073741824;function oe(s,c){return s<=0||0===c.length&&c.ended?0:c.objectMode?1:s!=s?c.flowing&&c.length?c.buffer.head.data.length:c.length:(s>c.highWaterMark&&(c.highWaterMark=((w=s)>=re?w=re:(w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++),w)),s<=c.length?s:c.ended?c.length:(c.needReadable=!0,0));var w}function se(s){var c=s._readableState;M("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,c.emittedReadable||(M("emitReadable",c.flowing),c.emittedReadable=!0,g.nextTick(Y,s))}function Y(s){var c=s._readableState;M("emitReadable_",c.destroyed,c.length,c.ended),c.destroyed||!c.length&&!c.ended||(s.emit("readable"),c.emittedReadable=!1),c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,D(s)}function N(s,c){c.readingMore||(c.readingMore=!0,g.nextTick(V,s,c))}function V(s,c){for(;!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&0===c.length);){var w=c.length;if(M("maybeReadMore read 0"),s.read(0),w===c.length)break}c.readingMore=!1}function Q(s){var c=s._readableState;c.readableListening=s.listenerCount("readable")>0,c.resumeScheduled&&!c.paused?c.flowing=!0:s.listenerCount("data")>0&&s.resume()}function v(s){M("readable nexttick read 0"),s.read(0)}function x(s,c){M("resume",c.reading),c.reading||s.read(0),c.resumeScheduled=!1,s.emit("resume"),D(s),c.flowing&&!c.reading&&s.read(0)}function D(s){var c=s._readableState;for(M("flow",c.flowing);c.flowing&&null!==s.read(););}function H(s,c){return 0===c.length?null:(c.objectMode?w=c.buffer.shift():!s||s>=c.length?(w=c.decoder?c.buffer.join(""):1===c.buffer.length?c.buffer.first():c.buffer.concat(c.length),c.buffer.clear()):w=c.buffer.consume(s,c.decoder),w);var w}function ee(s){var c=s._readableState;M("endReadable",c.endEmitted),c.endEmitted||(c.ended=!0,g.nextTick(te,c,s))}function te(s,c){if(M("endReadableNT",s.endEmitted,s.length),!s.endEmitted&&0===s.length&&(s.endEmitted=!0,c.readable=!1,c.emit("end"),s.autoDestroy)){var w=c._writableState;(!w||w.autoDestroy&&w.finished)&&c.destroy()}}function l(s,c){for(var w=0,k=s.length;w<k;w++)if(s[w]===c)return w;return-1}S.prototype.read=function(s){M("read",s),s=parseInt(s,10);var c=this._readableState,w=s;if(0!==s&&(c.emittedReadable=!1),0===s&&c.needReadable&&((0!==c.highWaterMark?c.length>=c.highWaterMark:c.length>0)||c.ended))return M("read: emitReadable",c.length,c.ended),0===c.length&&c.ended?ee(this):se(this),null;if(0===(s=oe(s,c))&&c.ended)return 0===c.length&&ee(this),null;var k,z=c.needReadable;return M("need readable",z),(0===c.length||c.length-s<c.highWaterMark)&&M("length less than watermark",z=!0),c.ended||c.reading?M("reading or ended",z=!1):z&&(M("do read"),c.reading=!0,c.sync=!0,0===c.length&&(c.needReadable=!0),this._read(c.highWaterMark),c.sync=!1,c.reading||(s=oe(w,c))),null===(k=s>0?H(s,c):null)?(c.needReadable=c.length<=c.highWaterMark,s=0):(c.length-=s,c.awaitDrain=0),0===c.length&&(c.ended||(c.needReadable=!0),w!==s&&c.ended&&ee(this)),null!==k&&this.emit("data",k),k},S.prototype._read=function(s){Z(this,new $("_read()"))},S.prototype.pipe=function(s,c){var w=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=s;break;case 1:k.pipes=[k.pipes,s];break;default:k.pipes.push(s)}k.pipesCount+=1,M("pipe count=%d opts=%j",k.pipesCount,c);var z=c&&!1===c.end||s===g.stdout||s===g.stderr?Ce:ae;function ae(){M("onend"),s.end()}k.endEmitted?g.nextTick(z):w.once("end",z),s.on("unpipe",function ne(he,Pe){M("onunpipe"),he===w&&Pe&&!1===Pe.hasUnpiped&&(Pe.hasUnpiped=!0,M("cleanup"),s.removeListener("close",Ne),s.removeListener("finish",we),s.removeListener("drain",fe),s.removeListener("error",xe),s.removeListener("unpipe",ne),w.removeListener("end",ae),w.removeListener("end",Ce),w.removeListener("data",ce),le=!0,!k.awaitDrain||s._writableState&&!s._writableState.needDrain||fe())});var he,fe=(he=w,function(){var Pe=he._readableState;M("pipeOnDrain",Pe.awaitDrain),Pe.awaitDrain&&Pe.awaitDrain--,0===Pe.awaitDrain&&f(he,"data")&&(Pe.flowing=!0,D(he))});s.on("drain",fe);var le=!1;function ce(he){M("ondata");var Pe=s.write(he);M("dest.write",Pe),!1===Pe&&((1===k.pipesCount&&k.pipes===s||k.pipesCount>1&&-1!==l(k.pipes,s))&&!le&&(M("false write response, pause",k.awaitDrain),k.awaitDrain++),w.pause())}function xe(he){M("onerror",he),Ce(),s.removeListener("error",xe),0===f(s,"error")&&Z(s,he)}function Ne(){s.removeListener("finish",we),Ce()}function we(){M("onfinish"),s.removeListener("close",Ne),Ce()}function Ce(){M("unpipe"),w.unpipe(s)}return w.on("data",ce),function(he,Pe,it){if("function"==typeof he.prependListener)return he.prependListener(Pe,it);he._events&&he._events[Pe]?Array.isArray(he._events[Pe])?he._events[Pe].unshift(it):he._events[Pe]=[it,he._events[Pe]]:he.on(Pe,it)}(s,"error",xe),s.once("close",Ne),s.once("finish",we),s.emit("pipe",w),k.flowing||(M("pipe resume"),w.resume()),s},S.prototype.unpipe=function(s){var c=this._readableState,w={hasUnpiped:!1};if(0===c.pipesCount)return this;if(1===c.pipesCount)return s&&s!==c.pipes||(s||(s=c.pipes),c.pipes=null,c.pipesCount=0,c.flowing=!1,s&&s.emit("unpipe",this,w)),this;if(!s){var k=c.pipes,z=c.pipesCount;c.pipes=null,c.pipesCount=0,c.flowing=!1;for(var ne=0;ne<z;ne++)k[ne].emit("unpipe",this,{hasUnpiped:!1});return this}var ae=l(c.pipes,s);return-1===ae||(c.pipes.splice(ae,1),c.pipesCount-=1,1===c.pipesCount&&(c.pipes=c.pipes[0]),s.emit("unpipe",this,w)),this},S.prototype.addListener=S.prototype.on=function(s,c){var w=d.prototype.on.call(this,s,c),k=this._readableState;return"data"===s?(k.readableListening=this.listenerCount("readable")>0,!1!==k.flowing&&this.resume()):"readable"===s&&(k.endEmitted||k.readableListening||(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,M("on readable",k.length,k.reading),k.length?se(this):k.reading||g.nextTick(v,this))),w},S.prototype.removeListener=function(s,c){var w=d.prototype.removeListener.call(this,s,c);return"readable"===s&&g.nextTick(Q,this),w},S.prototype.removeAllListeners=function(s){var c=d.prototype.removeAllListeners.apply(this,arguments);return"readable"!==s&&void 0!==s||g.nextTick(Q,this),c},S.prototype.resume=function(){var w,s=this._readableState;return s.flowing||(M("resume"),s.flowing=!s.readableListening,this,(w=s).resumeScheduled||(w.resumeScheduled=!0,g.nextTick(x,this,w))),s.paused=!1,this},S.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(s){var c=this,w=this._readableState,k=!1;for(var z in s.on("end",function(){if(M("wrapped end"),w.decoder&&!w.ended){var ae=w.decoder.end();ae&&ae.length&&c.push(ae)}c.push(null)}),s.on("data",function(ae){M("wrapped data"),w.decoder&&(ae=w.decoder.write(ae)),(!w.objectMode||null!=ae)&&(w.objectMode||ae&&ae.length)&&(c.push(ae)||(k=!0,s.pause()))}),s)void 0===this[z]&&"function"==typeof s[z]&&(this[z]=function(ae){return function(){return s[ae].apply(s,arguments)}}(z));for(var ne=0;ne<U.length;ne++)s.on(U[ne],this.emit.bind(this,U[ne]));return this._read=function(ae){M("wrapped _read",ae),k&&(k=!1,s.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=L("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}}),S._fromList=H,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(s,c){return void 0===p&&(p=L("./internal/streams/from")),p(S,s,c)})}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":49,"./_stream_duplex":50,"./internal/streams/async_iterator":55,"./internal/streams/buffer_list":56,"./internal/streams/destroy":57,"./internal/streams/from":59,"./internal/streams/state":61,"./internal/streams/stream":62,_process:44,buffer:12,events:27,inherits:29,"string_decoder/":67,util:11}],53:[function(L,X,K){"use strict";X.exports=m;var g=L("../errors").codes,b=g.ERR_METHOD_NOT_IMPLEMENTED,C=g.ERR_MULTIPLE_CALLBACK,f=g.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=g.ERR_TRANSFORM_WITH_LENGTH_0,_=L("./_stream_duplex");function m(E){if(!(this instanceof m))return new m(E);_.call(this,E),this._transformState={afterTransform:function(h,p){var O=this._transformState;O.transforming=!1;var A=O.writecb;if(null===A)return this.emit("error",new C);O.writechunk=null,O.writecb=null,null!=p&&this.push(p),A(h);var P=this._readableState;P.reading=!1,(P.needReadable||P.length<P.highWaterMark)&&this._read(P.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,E&&("function"==typeof E.transform&&(this._transform=E.transform),"function"==typeof E.flush&&(this._flush=E.flush)),this.on("prefinish",M)}function M(){var E=this;"function"!=typeof this._flush||this._readableState.destroyed?T(this,null,null):this._flush(function(h,p){T(E,h,p)})}function T(E,h,p){if(h)return E.emit("error",h);if(null!=p&&E.push(p),E._writableState.length)throw new d;if(E._transformState.transforming)throw new f;return E.push(null)}L("inherits")(m,_),m.prototype.push=function(E,h){return this._transformState.needTransform=!1,_.prototype.push.call(this,E,h)},m.prototype._transform=function(E,h,p){p(new b("_transform()"))},m.prototype._write=function(E,h,p){var O=this._transformState;if(O.writecb=p,O.writechunk=E,O.writeencoding=h,!O.transforming){var A=this._readableState;(O.needTransform||A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}},m.prototype._read=function(E){var h=this._transformState;null===h.writechunk||h.transforming?h.needTransform=!0:(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform))},m.prototype._destroy=function(E,h){_.prototype._destroy.call(this,E,function(p){h(p)})}},{"../errors":49,"./_stream_duplex":50,inherits:29}],54:[function(L,X,K){(function(g,b){"use strict";function C(N){var V=this;this.next=null,this.entry=null,this.finish=function(){!function(Q,v,x){var D=Q.entry;for(Q.entry=null;D;){var H=D.callback;v.pendingcb--,H(undefined),D=D.next}v.corkedRequestsFree.next=Q}(V,N)}}var f;X.exports=S,S.WritableState=W;var T,d={deprecate:L("util-deprecate")},_=L("./internal/streams/stream"),m=L("buffer").Buffer,M=b.Uint8Array||function(){},E=L("./internal/streams/destroy"),h=L("./internal/streams/state").getHighWaterMark,p=L("../errors").codes,O=p.ERR_INVALID_ARG_TYPE,A=p.ERR_METHOD_NOT_IMPLEMENTED,P=p.ERR_MULTIPLE_CALLBACK,R=p.ERR_STREAM_CANNOT_PIPE,B=p.ERR_STREAM_DESTROYED,I=p.ERR_STREAM_NULL_VALUES,$=p.ERR_STREAM_WRITE_AFTER_END,F=p.ERR_UNKNOWN_ENCODING,Z=E.errorOrDestroy;function U(){}function W(N,V,Q){f=f||L("./_stream_duplex"),"boolean"!=typeof Q&&(Q=V instanceof f),this.objectMode=!!(N=N||{}).objectMode,Q&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=h(this,N,"writableHighWaterMark",Q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===N.decodeStrings),this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(x){!function(D,H){var c,ee=D._writableState,te=ee.sync,l=ee.writecb;if("function"!=typeof l)throw new P;if((c=ee).writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0,H)!function(c,w,k,z,ne){--w.pendingcb,k?(g.nextTick(ne,z),g.nextTick(Y,c,w),c._writableState.errorEmitted=!0,Z(c,z)):(ne(z),c._writableState.errorEmitted=!0,Z(c,z),Y(c,w))}(D,ee,te,H,l);else{var s=oe(ee)||D.destroyed;s||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||re(D,ee),te?g.nextTick(G,D,ee,s,l):G(D,ee,s,l)}}(V,x)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==N.emitClose,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new C(this)}function S(N){var V=this instanceof(f=f||L("./_stream_duplex"));if(!V&&!T.call(S,this))return new S(N);this._writableState=new W(N,this,V),this.writable=!0,N&&("function"==typeof N.write&&(this._write=N.write),"function"==typeof N.writev&&(this._writev=N.writev),"function"==typeof N.destroy&&(this._destroy=N.destroy),"function"==typeof N.final&&(this._final=N.final)),_.call(this)}function q(N,V,Q,v,x,D,H){V.writelen=v,V.writecb=H,V.writing=!0,V.sync=!0,V.destroyed?V.onwrite(new B("write")):Q?N._writev(x,V.onwrite):N._write(x,D,V.onwrite),V.sync=!1}function G(N,V,Q,v){var x,D;Q||(x=N,0===(D=V).length&&D.needDrain&&(D.needDrain=!1,x.emit("drain"))),V.pendingcb--,v(),Y(N,V)}function re(N,V){V.bufferProcessing=!0;var Q=V.bufferedRequest;if(N._writev&&Q&&Q.next){var x=new Array(V.bufferedRequestCount),D=V.corkedRequestsFree;D.entry=Q;for(var H=0,ee=!0;Q;)x[H]=Q,Q.isBuf||(ee=!1),Q=Q.next,H+=1;x.allBuffers=ee,q(N,V,!0,V.length,x,"",D.finish),V.pendingcb++,V.lastBufferedRequest=null,D.next?(V.corkedRequestsFree=D.next,D.next=null):V.corkedRequestsFree=new C(V),V.bufferedRequestCount=0}else{for(;Q;){var te=Q.chunk;if(q(N,V,!1,V.objectMode?1:te.length,te,Q.encoding,Q.callback),Q=Q.next,V.bufferedRequestCount--,V.writing)break}null===Q&&(V.lastBufferedRequest=null)}V.bufferedRequest=Q,V.bufferProcessing=!1}function oe(N){return N.ending&&0===N.length&&null===N.bufferedRequest&&!N.finished&&!N.writing}function se(N,V){N._final(function(Q){V.pendingcb--,Q&&Z(N,Q),V.prefinished=!0,N.emit("prefinish"),Y(N,V)})}function Y(N,V){var x,D,Q=oe(V);if(Q&&(x=N,(D=V).prefinished||D.finalCalled||("function"!=typeof x._final||D.destroyed?(D.prefinished=!0,x.emit("prefinish")):(D.pendingcb++,D.finalCalled=!0,g.nextTick(se,x,D))),0===V.pendingcb&&(V.finished=!0,N.emit("finish"),V.autoDestroy))){var v=N._readableState;(!v||v.autoDestroy&&v.endEmitted)&&N.destroy()}return Q}L("inherits")(S,_),W.prototype.getBuffer=function(){for(var N=this.bufferedRequest,V=[];N;)V.push(N),N=N.next;return V},function(){try{Object.defineProperty(W.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(N){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(V){return!!T.call(this,V)||this===S&&V&&V._writableState instanceof W}})):T=function(V){return V instanceof this},S.prototype.pipe=function(){Z(this,new R)},S.prototype.write=function(N,V,Q){var v,ee,te,l,x=this._writableState,D=!1,H=!x.objectMode&&(m.isBuffer(v=N)||v instanceof M);return H&&!m.isBuffer(N)&&(N=m.from(N)),"function"==typeof V&&(Q=V,V=null),H?V="buffer":V||(V=x.defaultEncoding),"function"!=typeof Q&&(Q=U),x.ending?(ee=this,te=Q,l=new $,Z(ee,l),g.nextTick(te,l)):(H||function(ee,te,l,s){var c;return null===l?c=new I:"string"==typeof l||te.objectMode||(c=new O("chunk",["string","Buffer"],l)),!c||(Z(ee,c),g.nextTick(s,c),!1)}(this,x,N,Q))&&(x.pendingcb++,D=function(ee,te,l,s,c,w){if(!l){var k=(le=s,(fe=te).objectMode||!1===fe.decodeStrings||"string"!=typeof le||(le=m.from(le,c)),le);s!==k&&(l=!0,c="buffer",s=k)}var fe,le,z=te.objectMode?1:s.length;te.length+=z;var ne=te.length<te.highWaterMark;if(ne||(te.needDrain=!0),te.writing||te.corked){var ae=te.lastBufferedRequest;te.lastBufferedRequest={chunk:s,encoding:c,isBuf:l,callback:w,next:null},ae?ae.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else q(ee,te,!1,z,s,c,w);return ne}(this,x,H,N,V,Q)),D},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,N.writing||N.corked||N.bufferProcessing||!N.bufferedRequest||re(this,N))},S.prototype.setDefaultEncoding=function(N){if("string"==typeof N&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new F(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(N,V,Q){Q(new A("_write()"))},S.prototype._writev=null,S.prototype.end=function(N,V,Q){var x,D,H,v=this._writableState;return"function"==typeof N?(Q=N,N=null,V=null):"function"==typeof V&&(Q=V,V=null),null!=N&&this.write(N,V),v.corked&&(v.corked=1,this.uncork()),v.ending||(x=this,H=Q,(D=v).ending=!0,Y(x,D),H&&(D.finished?g.nextTick(H):x.once("finish",H)),D.ended=!0,x.writable=!1),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),S.prototype.destroy=E.destroy,S.prototype._undestroy=E.undestroy,S.prototype._destroy=function(N,V){V(N)}}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":49,"./_stream_duplex":50,"./internal/streams/destroy":57,"./internal/streams/state":61,"./internal/streams/stream":62,_process:44,buffer:12,inherits:29,"util-deprecate":71}],55:[function(L,X,K){(function(g){"use strict";var b;function C(R,B,I){return B in R?Object.defineProperty(R,B,{value:I,enumerable:!0,configurable:!0,writable:!0}):R[B]=I,R}var f=L("./end-of-stream"),d=Symbol("lastResolve"),_=Symbol("lastReject"),m=Symbol("error"),M=Symbol("ended"),T=Symbol("lastPromise"),E=Symbol("handlePromise"),h=Symbol("stream");function p(R,B){return{value:R,done:B}}function O(R){var B=R[d];if(null!==B){var I=R[h].read();null!==I&&(R[T]=null,R[d]=null,R[_]=null,B(p(I,!1)))}}var A=Object.getPrototypeOf(function(){}),P=Object.setPrototypeOf((C(b={get stream(){return this[h]},next:function(){var B=this,I=this[m];if(null!==I)return Promise.reject(I);if(this[M])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(U,W){g.nextTick(function(){B[m]?W(B[m]):U(p(void 0,!0))})});var $,U,W,F=this[T];if(F)$=new Promise((U=F,W=this,function(S,q){U.then(function(){W[M]?S(p(void 0,!0)):W[E](S,q)},q)}));else{var Z=this[h].read();if(null!==Z)return Promise.resolve(p(Z,!1));$=new Promise(this[E])}return this[T]=$,$}},Symbol.asyncIterator,function(){return this}),C(b,"return",function(){var R=this;return new Promise(function(B,I){R[h].destroy(null,function($){$?I($):B(p(void 0,!0))})})}),b),A);X.exports=function(R){var B,I=Object.create(P,(C(B={},h,{value:R,writable:!0}),C(B,d,{value:null,writable:!0}),C(B,_,{value:null,writable:!0}),C(B,m,{value:null,writable:!0}),C(B,M,{value:R._readableState.endEmitted,writable:!0}),C(B,E,{value:function(F,Z){var U=I[h].read();U?(I[T]=null,I[d]=null,I[_]=null,F(p(U,!1))):(I[d]=F,I[_]=Z)},writable:!0}),B));return I[T]=null,f(R,function($){if($&&"ERR_STREAM_PREMATURE_CLOSE"!==$.code){var F=I[_];return null!==F&&(I[T]=null,I[d]=null,I[_]=null,F($)),void(I[m]=$)}var Z=I[d];null!==Z&&(I[T]=null,I[d]=null,I[_]=null,Z(p(void 0,!0))),I[M]=!0}),R.on("readable",function($){g.nextTick(O,$)}.bind(null,I)),I}}).call(this,L("_process"))},{"./end-of-stream":58,_process:44}],56:[function(L,X,K){"use strict";function g(m,M){var T=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);M&&(E=E.filter(function(h){return Object.getOwnPropertyDescriptor(m,h).enumerable})),T.push.apply(T,E)}return T}function b(m,M,T){return M in m?Object.defineProperty(m,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):m[M]=T,m}function C(m,M){for(var T=0;T<M.length;T++){var E=M[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(m,E.key,E)}}var f=L("buffer").Buffer,d=L("util").inspect,_=d&&d.custom||"inspect";X.exports=function(){function m(){(function(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")})(this,m),this.head=null,this.tail=null,this.length=0}var M,T;return M=m,(T=[{key:"push",value:function(p){var O={data:p,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(p){var O={data:p,next:this.head};0===this.length&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(0!==this.length){var p=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(0===this.length)return"";for(var O=this.head,A=""+O.data;O=O.next;)A+=p+O.data;return A}},{key:"concat",value:function(p){if(0===this.length)return f.alloc(0);for(var R=f.allocUnsafe(p>>>0),B=this.head,I=0;B;)f.prototype.copy.call(B.data,R,I),I+=B.data.length,B=B.next;return R}},{key:"consume",value:function(p,O){var A;return p<this.head.data.length?(A=this.head.data.slice(0,p),this.head.data=this.head.data.slice(p)):A=p===this.head.data.length?this.shift():O?this._getString(p):this._getBuffer(p),A}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(p){var O=this.head,A=1,P=O.data;for(p-=P.length;O=O.next;){var R=O.data,B=p>R.length?R.length:p;if(P+=B===R.length?R:R.slice(0,p),0==(p-=B)){B===R.length?(++A,this.head=O.next?O.next:this.tail=null):(this.head=O,O.data=R.slice(B));break}++A}return this.length-=A,P}},{key:"_getBuffer",value:function(p){var O=f.allocUnsafe(p),A=this.head,P=1;for(A.data.copy(O),p-=A.data.length;A=A.next;){var R=A.data,B=p>R.length?R.length:p;if(R.copy(O,O.length-p,0,B),0==(p-=B)){B===R.length?(++P,this.head=A.next?A.next:this.tail=null):(this.head=A,A.data=R.slice(B));break}++P}return this.length-=P,O}},{key:_,value:function(p,O){return d(this,function(A){for(var P=1;P<arguments.length;P++){var R=null!=arguments[P]?arguments[P]:{};P%2?g(Object(R),!0).forEach(function(B){b(A,B,R[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(R)):g(Object(R)).forEach(function(B){Object.defineProperty(A,B,Object.getOwnPropertyDescriptor(R,B))})}return A}({},O,{depth:0,customInspect:!1}))}}])&&C(M.prototype,T),m}()},{buffer:12,util:11}],57:[function(L,X,K){(function(g){"use strict";function b(d,_){f(d,_),C(d)}function C(d){d._writableState&&!d._writableState.emitClose||d._readableState&&!d._readableState.emitClose||d.emit("close")}function f(d,_){d.emit("error",_)}X.exports={destroy:function(_,m){var M=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(m?m(_):_&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,g.nextTick(f,this,_)):g.nextTick(f,this,_)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(_||null,function(h){!m&&h?M._writableState?M._writableState.errorEmitted?g.nextTick(C,M):(M._writableState.errorEmitted=!0,g.nextTick(b,M,h)):g.nextTick(b,M,h):m?(g.nextTick(C,M),m(h)):g.nextTick(C,M)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(_,m){var M=_._readableState,T=_._writableState;M&&M.autoDestroy||T&&T.autoDestroy?_.destroy(m):_.emit("error",m)}}}).call(this,L("_process"))},{_process:44}],58:[function(L,X,K){"use strict";var g=L("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function b(){}X.exports=function C(f,d,_){if("function"==typeof d)return C(f,null,d);var B,I;d||(d={}),B=_||b,I=!1,_=function(){if(!I){I=!0;for(var $=arguments.length,F=new Array($),Z=0;Z<$;Z++)F[Z]=arguments[Z];B.apply(this,F)}};var m=d.readable||!1!==d.readable&&f.readable,M=d.writable||!1!==d.writable&&f.writable,T=function(){f.writable||h()},E=f._writableState&&f._writableState.finished,h=function(){M=!1,E=!0,m||_.call(f)},p=f._readableState&&f._readableState.endEmitted,O=function(){m=!1,p=!0,M||_.call(f)},A=function(I){_.call(f,I)},P=function(){var I;return m&&!p?(f._readableState&&f._readableState.ended||(I=new g),_.call(f,I)):M&&!E?(f._writableState&&f._writableState.ended||(I=new g),_.call(f,I)):void 0},R=function(){f.req.on("finish",h)};return function(B){return B.setHeader&&"function"==typeof B.abort}(f)?(f.on("complete",h),f.on("abort",P),f.req?R():f.on("request",R)):M&&!f._writableState&&(f.on("end",T),f.on("close",T)),f.on("end",O),f.on("finish",h),!1!==d.error&&f.on("error",A),f.on("close",P),function(){f.removeListener("complete",h),f.removeListener("abort",P),f.removeListener("request",R),f.req&&f.req.removeListener("finish",h),f.removeListener("end",T),f.removeListener("close",T),f.removeListener("finish",h),f.removeListener("end",O),f.removeListener("error",A),f.removeListener("close",P)}}},{"../../../errors":49}],59:[function(L,X,K){X.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],60:[function(L,X,K){"use strict";var g,b=L("../../../errors").codes,C=b.ERR_MISSING_ARGS,f=b.ERR_STREAM_DESTROYED;function d(M){if(M)throw M}function _(M){M()}function m(M,T){return M.pipe(T)}X.exports=function(){for(var M=arguments.length,T=new Array(M),E=0;E<M;E++)T[E]=arguments[E];var h,A,p=(A=T).length?"function"!=typeof A[A.length-1]?d:A.pop():d;if(Array.isArray(T[0])&&(T=T[0]),T.length<2)throw new C("streams");var O=T.map(function(A,P){var R=P<T.length-1;return function(B,I,$,F){var W,S;W=F,S=!1,F=function(){S||(S=!0,W.apply(void 0,arguments))};var Z=!1;B.on("close",function(){Z=!0}),void 0===g&&(g=L("./end-of-stream")),g(B,{readable:I,writable:$},function(W){if(W)return F(W);Z=!0,F()});var U=!1;return function(W){if(!Z&&!U)return U=!0,function(S){return S.setHeader&&"function"==typeof S.abort}(B)?B.abort():"function"==typeof B.destroy?B.destroy():void F(W||new f("pipe"))}}(A,R,P>0,function(B){h||(h=B),B&&O.forEach(_),R||(O.forEach(_),p(h))})});return T.reduce(m)}},{"../../../errors":49,"./end-of-stream":58}],61:[function(L,X,K){"use strict";var g=L("../../../errors").codes.ERR_INVALID_OPT_VALUE;X.exports={getHighWaterMark:function(C,f,d,_){var M,m=null!=(M=f).highWaterMark?M.highWaterMark:_?M[d]:null;if(null!=m){if(!isFinite(m)||Math.floor(m)!==m||m<0)throw new g(_?d:"highWaterMark",m);return Math.floor(m)}return C.objectMode?16:16384}}},{"../../../errors":49}],62:[function(L,X,K){arguments[4][24][0].apply(K,arguments)},{dup:24,events:27}],63:[function(L,X,K){(K=X.exports=L("./lib/_stream_readable.js")).Stream=K,K.Readable=K,K.Writable=L("./lib/_stream_writable.js"),K.Duplex=L("./lib/_stream_duplex.js"),K.Transform=L("./lib/_stream_transform.js"),K.PassThrough=L("./lib/_stream_passthrough.js"),K.finished=L("./lib/internal/streams/end-of-stream.js"),K.pipeline=L("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":50,"./lib/_stream_passthrough.js":51,"./lib/_stream_readable.js":52,"./lib/_stream_transform.js":53,"./lib/_stream_writable.js":54,"./lib/internal/streams/end-of-stream.js":58,"./lib/internal/streams/pipeline.js":60}],64:[function(L,X,K){"use strict";X.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var g;if(arguments.length>0){g=new Array(arguments.length-2);for(var b=0;b<g.length;b++)g[b]=arguments[b+2]}return new function(C,f,d){var _=this;this._callback=C,this._args=d,this._interval=setInterval(C,f,this._args),this.reschedule=function(m){m||(m=_._interval),_._interval&&clearInterval(_._interval),_._interval=setInterval(_._callback,m,_._args)},this.clear=function(){_._interval&&(clearInterval(_._interval),_._interval=void 0)},this.destroy=function(){_._interval&&clearInterval(_._interval),_._callback=void 0,_._interval=void 0,_._args=void 0}}(arguments[0],arguments[1],g)}},{}],65:[function(L,X,K){var g=L("buffer"),b=g.Buffer;function C(d,_){for(var m in d)_[m]=d[m]}function f(d,_,m){return b(d,_,m)}b.from&&b.alloc&&b.allocUnsafe&&b.allocUnsafeSlow?X.exports=g:(C(g,K),K.Buffer=f),C(b,f),f.from=function(d,_,m){if("number"==typeof d)throw new TypeError("Argument must not be a number");return b(d,_,m)},f.alloc=function(d,_,m){if("number"!=typeof d)throw new TypeError("Argument must be a number");var M=b(d);return void 0!==_?"string"==typeof m?M.fill(_,m):M.fill(_):M.fill(0),M},f.allocUnsafe=function(d){if("number"!=typeof d)throw new TypeError("Argument must be a number");return b(d)},f.allocUnsafeSlow=function(d){if("number"!=typeof d)throw new TypeError("Argument must be a number");return g.SlowBuffer(d)}},{buffer:12}],66:[function(L,X,K){X.exports=function(g){var C,b=g._readableState;return b?b.objectMode||"number"==typeof g._duplexState?g.read():g.read((C=b).buffer.length?C.buffer.head?C.buffer.head.data.length:C.buffer[0].length:C.length):null}},{}],67:[function(L,X,K){"use strict";var g=L("safe-buffer").Buffer,b=g.isEncoding||function(p){switch((p=""+p)&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function C(p){var O;switch(this.encoding=function(A){var P=function(R){if(!R)return"utf8";for(var B;;)switch(R){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return R;default:if(B)return;R=(""+R).toLowerCase(),B=!0}}(A);if("string"!=typeof P&&(g.isEncoding===b||!b(A)))throw new Error("Unknown encoding: "+A);return P||A}(p),this.encoding){case"utf16le":this.text=_,this.end=m,O=4;break;case"utf8":this.fillLast=d,O=4;break;case"base64":this.text=M,this.end=T,O=3;break;default:return this.write=E,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(O)}function f(p){return p<=127?0:p>>5==6?2:p>>4==14?3:p>>3==30?4:p>>6==2?-1:-2}function d(p){var O=this.lastTotal-this.lastNeed,A=function(P,R,B){if(128!=(192&R[0]))return P.lastNeed=0,"\ufffd";if(P.lastNeed>1&&R.length>1){if(128!=(192&R[1]))return P.lastNeed=1,"\ufffd";if(P.lastNeed>2&&R.length>2&&128!=(192&R[2]))return P.lastNeed=2,"\ufffd"}}(this,p);return void 0!==A?A:this.lastNeed<=p.length?(p.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(p.copy(this.lastChar,O,0,p.length),void(this.lastNeed-=p.length))}function _(p,O){if((p.length-O)%2==0){var A=p.toString("utf16le",O);if(A){var P=A.charCodeAt(A.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",O,p.length-1)}function m(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function M(p,O){var A=(p.length-O)%3;return 0===A?p.toString("base64",O):(this.lastNeed=3-A,this.lastTotal=3,1===A?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",O,p.length-A))}function T(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function E(p){return p.toString(this.encoding)}function h(p){return p&&p.length?this.write(p):""}K.StringDecoder=C,C.prototype.write=function(p){if(0===p.length)return"";var O,A;if(this.lastNeed){if(void 0===(O=this.fillLast(p)))return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A<p.length?O?O+this.text(p,A):this.text(p,A):O||""},C.prototype.end=function(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+"\ufffd":O},C.prototype.text=function(p,O){var A=function(R,B,I){var $=B.length-1;if($<I)return 0;var F=f(B[$]);return F>=0?(F>0&&(R.lastNeed=F-1),F):--$<I||-2===F?0:(F=f(B[$]))>=0?(F>0&&(R.lastNeed=F-2),F):--$<I||-2===F?0:(F=f(B[$]))>=0?(F>0&&(2===F?F=0:R.lastNeed=F-3),F):0}(this,p,O);if(!this.lastNeed)return p.toString("utf8",O);this.lastTotal=A;var P=p.length-(A-this.lastNeed);return p.copy(this.lastChar,0,P),p.toString("utf8",O,P)},C.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length}},{"safe-buffer":65}],68:[function(L,X,K){(function(g,b){var C=L("process/browser.js").nextTick,f=Function.prototype.apply,d=Array.prototype.slice,_={},m=0;function M(T,E){this._id=T,this._clearFn=E}K.setTimeout=function(){return new M(f.call(setTimeout,window,arguments),clearTimeout)},K.setInterval=function(){return new M(f.call(setInterval,window,arguments),clearInterval)},K.clearTimeout=K.clearInterval=function(T){T.close()},M.prototype.unref=M.prototype.ref=function(){},M.prototype.close=function(){this._clearFn.call(window,this._id)},K.enroll=function(T,E){clearTimeout(T._idleTimeoutId),T._idleTimeout=E},K.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},K._unrefActive=K.active=function(T){clearTimeout(T._idleTimeoutId);var E=T._idleTimeout;E>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},E))},K.setImmediate="function"==typeof g?g:function(T){var E=m++,h=!(arguments.length<2)&&d.call(arguments,1);return _[E]=!0,C(function(){_[E]&&(h?T.apply(null,h):T.call(null),K.clearImmediate(E))}),E},K.clearImmediate="function"==typeof b?b:function(T){delete _[T]}}).call(this,L("timers").setImmediate,L("timers").clearImmediate)},{"process/browser.js":44,timers:68}],69:[function(L,X,K){"use strict";var g=L("punycode"),b=L("./util");function C(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}K.parse=B,K.resolve=function(I,$){return B(I,!1,!0).resolve($)},K.resolveObject=function(I,$){return I?B(I,!1,!0).resolveObject($):$},K.format=function(I){return b.isString(I)&&(I=B(I)),I instanceof C?I.format():C.prototype.format.call(I)},K.Url=C;var f=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,_=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,m=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(m),T=["%","/","?",";","#"].concat(M),E=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=L("querystring");function B(I,$,F){if(I&&b.isObject(I)&&I instanceof C)return I;var Z=new C;return Z.parse(I,$,F),Z}C.prototype.parse=function(I,$,F){if(!b.isString(I))throw new TypeError("Parameter 'url' must be a string, not "+typeof I);var Z=I.indexOf("?"),U=-1!==Z&&Z<I.indexOf("#")?"?":"#",W=I.split(U);W[0]=W[0].replace(/\\/g,"/");var S=I=W.join(U);if(S=S.trim(),!F&&1===I.split("#").length){var q=_.exec(S);if(q)return this.path=S,this.href=S,this.pathname=q[1],q[2]?(this.search=q[2],this.query=$?R.parse(this.search.substr(1)):this.search.substr(1)):$&&(this.search="",this.query={}),this}var G=f.exec(S);if(G){var re=(G=G[0]).toLowerCase();this.protocol=re,S=S.substr(G.length)}if(F||G||S.match(/^\/\/[^@\/]+@[^@\/]+/)){var oe="//"===S.substr(0,2);!oe||G&&A[G]||(S=S.substr(2),this.slashes=!0)}if(!A[G]&&(oe||G&&!P[G])){for(var se,Y,N=-1,V=0;V<E.length;V++)-1!==(Q=S.indexOf(E[V]))&&(-1===N||Q<N)&&(N=Q);for(-1!==(Y=-1===N?S.lastIndexOf("@"):S.lastIndexOf("@",N))&&(se=S.slice(0,Y),S=S.slice(Y+1),this.auth=decodeURIComponent(se)),N=-1,V=0;V<T.length;V++){var Q;-1!==(Q=S.indexOf(T[V]))&&(-1===N||Q<N)&&(N=Q)}-1===N&&(N=S.length),this.host=S.slice(0,N),S=S.slice(N),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var x=this.hostname.split(/\./),D=(V=0,x.length);V<D;V++){var H=x[V];if(H&&!H.match(h)){for(var ee="",te=0,l=H.length;te<l;te++)H.charCodeAt(te)>127?ee+="x":ee+=H[te];if(!ee.match(h)){var s=x.slice(0,V),c=x.slice(V+1),w=H.match(p);w&&(s.push(w[1]),c.unshift(w[2])),c.length&&(S="/"+c.join(".")+S),this.hostname=s.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),v||(this.hostname=g.toASCII(this.hostname));var k=this.port?":"+this.port:"";this.host=(this.hostname||"")+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==S[0]&&(S="/"+S))}if(!O[re])for(V=0,D=M.length;V<D;V++){var ne=M[V];if(-1!==S.indexOf(ne)){var ae=encodeURIComponent(ne);ae===ne&&(ae=escape(ne)),S=S.split(ne).join(ae)}}var fe=S.indexOf("#");-1!==fe&&(this.hash=S.substr(fe),S=S.slice(0,fe));var le=S.indexOf("?");return-1!==le?(this.search=S.substr(le),this.query=S.substr(le+1),$&&(this.query=R.parse(this.query)),S=S.slice(0,le)):$&&(this.search="",this.query={}),S&&(this.pathname=S),P[re]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(this.path=(k=this.pathname||"")+(this.search||"")),this.href=this.format(),this},C.prototype.format=function(){var I=this.auth||"";I&&(I=(I=encodeURIComponent(I)).replace(/%3A/i,":"),I+="@");var $=this.protocol||"",F=this.pathname||"",Z=this.hash||"",U=!1,W="";this.host?U=I+this.host:this.hostname&&(U=I+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(U+=":"+this.port)),this.query&&b.isObject(this.query)&&Object.keys(this.query).length&&(W=R.stringify(this.query));var S=this.search||W&&"?"+W||"";return $&&":"!==$.substr(-1)&&($+=":"),this.slashes||(!$||P[$])&&!1!==U?(U="//"+(U||""),F&&"/"!==F.charAt(0)&&(F="/"+F)):U||(U=""),Z&&"#"!==Z.charAt(0)&&(Z="#"+Z),S&&"?"!==S.charAt(0)&&(S="?"+S),$+U+(F=F.replace(/[?#]/g,function(q){return encodeURIComponent(q)}))+(S=S.replace("#","%23"))+Z},C.prototype.resolve=function(I){return this.resolveObject(B(I,!1,!0)).format()},C.prototype.resolveObject=function(I){if(b.isString(I)){var $=new C;$.parse(I,!1,!0),I=$}for(var F=new C,Z=Object.keys(this),U=0;U<Z.length;U++){var W=Z[U];F[W]=this[W]}if(F.hash=I.hash,""===I.href)return F.href=F.format(),F;if(I.slashes&&!I.protocol){for(var S=Object.keys(I),q=0;q<S.length;q++){var G=S[q];"protocol"!==G&&(F[G]=I[G])}return P[F.protocol]&&F.hostname&&!F.pathname&&(F.path=F.pathname="/"),F.href=F.format(),F}if(I.protocol&&I.protocol!==F.protocol){if(!P[I.protocol]){for(var re=Object.keys(I),oe=0;oe<re.length;oe++){var se=re[oe];F[se]=I[se]}return F.href=F.format(),F}if(F.protocol=I.protocol,I.host||A[I.protocol])F.pathname=I.pathname;else{for(var Y=(I.pathname||"").split("/");Y.length&&!(I.host=Y.shift()););I.host||(I.host=""),I.hostname||(I.hostname=""),""!==Y[0]&&Y.unshift(""),Y.length<2&&Y.unshift(""),F.pathname=Y.join("/")}return F.search=I.search,F.query=I.query,F.host=I.host||"",F.auth=I.auth,F.hostname=I.hostname||I.host,F.port=I.port,(F.pathname||F.search)&&(F.path=(F.pathname||"")+(F.search||"")),F.slashes=F.slashes||I.slashes,F.href=F.format(),F}var Q=F.pathname&&"/"===F.pathname.charAt(0),v=I.host||I.pathname&&"/"===I.pathname.charAt(0),x=v||Q||F.host&&I.pathname,D=x,H=F.pathname&&F.pathname.split("/")||[],ee=(Y=I.pathname&&I.pathname.split("/")||[],F.protocol&&!P[F.protocol]);if(ee&&(F.hostname="",F.port=null,F.host&&(""===H[0]?H[0]=F.host:H.unshift(F.host)),F.host="",I.protocol&&(I.hostname=null,I.port=null,I.host&&(""===Y[0]?Y[0]=I.host:Y.unshift(I.host)),I.host=null),x=x&&(""===Y[0]||""===H[0])),v)F.host=I.host||""===I.host?I.host:F.host,F.hostname=I.hostname||""===I.hostname?I.hostname:F.hostname,F.search=I.search,F.query=I.query,H=Y;else if(Y.length)H||(H=[]),H.pop(),H=H.concat(Y),F.search=I.search,F.query=I.query;else if(!b.isNullOrUndefined(I.search))return ee&&(F.hostname=F.host=H.shift(),(w=!!(F.host&&F.host.indexOf("@")>0)&&F.host.split("@"))&&(F.auth=w.shift(),F.host=F.hostname=w.shift())),F.search=I.search,F.query=I.query,b.isNull(F.pathname)&&b.isNull(F.search)||(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.href=F.format(),F;if(!H.length)return F.pathname=null,F.path=F.search?"/"+F.search:null,F.href=F.format(),F;for(var te=H.slice(-1)[0],l=(F.host||I.host||H.length>1)&&("."===te||".."===te)||""===te,s=0,c=H.length;c>=0;c--)"."===(te=H[c])?H.splice(c,1):".."===te?(H.splice(c,1),s++):s&&(H.splice(c,1),s--);if(!x&&!D)for(;s--;s)H.unshift("..");!x||""===H[0]||H[0]&&"/"===H[0].charAt(0)||H.unshift(""),l&&"/"!==H.join("/").substr(-1)&&H.push("");var w,k=""===H[0]||H[0]&&"/"===H[0].charAt(0);return ee&&(F.hostname=F.host=k?"":H.length?H.shift():"",(w=!!(F.host&&F.host.indexOf("@")>0)&&F.host.split("@"))&&(F.auth=w.shift(),F.host=F.hostname=w.shift())),(x=x||F.host&&H.length)&&!k&&H.unshift(""),H.length?F.pathname=H.join("/"):(F.pathname=null,F.path=null),b.isNull(F.pathname)&&b.isNull(F.search)||(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.auth=I.auth||F.auth,F.slashes=F.slashes||I.slashes,F.href=F.format(),F},C.prototype.parseHost=function(){var I=this.host,$=d.exec(I);$&&(":"!==($=$[0])&&(this.port=$.substr(1)),I=I.substr(0,I.length-$.length)),I&&(this.hostname=I)}},{"./util":70,punycode:45,querystring:48}],70:[function(L,X,K){"use strict";X.exports={isString:function(b){return"string"==typeof b},isObject:function(b){return"object"==typeof b&&null!==b},isNull:function(b){return null===b},isNullOrUndefined:function(b){return null==b}}},{}],71:[function(L,X,K){(function(g){function b(C){try{if(!g.localStorage)return!1}catch(d){return!1}var f=g.localStorage[C];return null!=f&&"true"===String(f).toLowerCase()}X.exports=function(C,f){if(b("noDeprecation"))return C;var d=!1;return function(){if(!d){if(b("throwDeprecation"))throw new Error(f);b("traceDeprecation")?console.trace(f):console.warn(f),d=!0}return C.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],72:[function(L,X,K){X.exports=function g(b,C){if(b&&C)return g(b)(C);if("function"!=typeof b)throw new TypeError("need wrapper function");return Object.keys(b).forEach(function(d){f[d]=b[d]}),f;function f(){for(var d=new Array(arguments.length),_=0;_<d.length;_++)d[_]=arguments[_];var m=b.apply(this,d),M=d[d.length-1];return"function"==typeof m&&m!==M&&Object.keys(M).forEach(function(T){m[T]=M[T]}),m}}},{}],73:[function(L,X,K){"use strict";X.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],74:[function(L,X,K){X.exports=function(){for(var b={},C=0;C<arguments.length;C++){var f=arguments[C];for(var d in f)g.call(f,d)&&(b[d]=f[d])}return b};var g=Object.prototype.hasOwnProperty},{}]},{},[9])(9)},27565:function(Ve,Qe,ye){"use strict";var Le=ye(99624),e=ye(63150),_e=ye(64762),De="mqtt",_=200,B="text",I="image",$="file",W="direct",N="INFO",V="MINE",Q="OTHERS",x="CHAT_REOPENED",D="CHAT_CLOSED",H="MEMBER_JOINED_GROUP",ee="MEMBER_LEFT_GROUP",te="LEAD_UPDATED",l="TOUCHING_OPERATOR",z="tiledesk_widget_",le={ERROR:0,WARN:1,INFO:2,DEBUG:3},ce={production:!0,version:ye(4147).i8,remoteConfig:!1,remoteConfigUrl:"/widget-config.json",remoteTranslationsUrl:"https://tiledesk-server-pre.herokuapp.com/",loadRemoteTranslations:!0,chatEngine:"firebase",uploadEngine:"firebase",fileUploadAccept:"*/*",logLevel:"DEBUG",firebaseConfig:{apiKey:"AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",authDomain:"chat21-pre-01.firebaseapp.com",databaseURL:"https://chat21-pre-01.firebaseio.com",projectId:"chat21-pre-01",storageBucket:"chat21-pre-01.appspot.com",messagingSenderId:"269505353043",appId:"1:269505353043:web:b82af070572669e3707da6",tenant:"tilechat"},chat21Config:{appId:"tilechat",MQTTendpoint:"mqtt://localhost:15675/ws",APIendpoint:"http://localhost:8004/api"},apiUrl:"https://tiledesk-server-pre.herokuapp.com/",baseImageUrl:"https://firebasestorage.googleapis.com/v0/b/",dashboardUrl:"https://support-pre.tiledesk.com/dashboard/",defaultLang:"en",storage_prefix:"widget_sv5",authPersistence:"LOCAL",supportMode:!0,enbedJs:!0},xe=ye(29609),Ne=ye(84232),we=ye(99713),Ce=function(){function i(){}return i.getInstance=function(){return i.instance},i.setInstance=function(o){i.instance=o},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),he=ye(78512),Pe=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je,Ye){this.id=o,this.activeOperatingHours=n,this.channels=t,this.name=r,this.createdAt=a,this.createdBy=u,this.isActiveSubscription=y,this.profile=j,this.agents=J,this.trialDays=ie,this.type=ue,this.status=ge,this.trialDaysLeft=de,this.trialExpired=ve,this.updatedAt=Te,this.versions=ke,this.widgetTitle=Ae,this.logoChat=Be,this.avatar=Ze,this.color=ze,this.welcomeTitle=je,this.welcomeMsg=Ye}return i.prototype.initialize=function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke){this.id=o,this.activeOperatingHours=n,this.channels=t,this.name=r,this.createdAt=a,this.createdBy=u,this.isActiveSubscription=y,this.profile=j,this.agents=J,this.trialDays=ie,this.type=ue,this.status=ge,this.trialDaysLeft=de,this.trialExpired=ve,this.updatedAt=Te,this.versions=ke},i.prototype.customization=function(o,n,t,r,a,u){this.widgetTitle=o,this.logoChat=n,this.avatar=t,this.color=r,this.welcomeTitle=a,this.welcomeMsg=u},i}(),Nt=(ye(19270),ye(21266),"text"),dn="support-group-",We=230;function Ft(i){return i&&(i=function(i){return(i=(i=(i=(i=i.replace(/&/g,"&")).replace(/>/g,">")).replace(/</g,"<")).replace(/"/g,""")).replace(/'/g,"'")}(i)),i}function gn(i){try{var o=i.split("popup=")[1];return!!o&&!!o.startsWith("true")}catch(n){return!1}}function so(i,o,n){var t=this.strip_tags(o),u=screen.width/2-300,y=screen.height/2-300,j=i.open(t,"_blank","fullscreen=1, titlebar=0, toolbar=no, location=0, status=0, menubar=0, scrollbars=0, resizable=0, width=600, height=600, top="+y+", left="+u);i.focus&&j.focus()}function lo(i){return i.replace(/<.*?>/g,"").trim()}function Bt(i){var o="";return i&&i.split(" ").forEach(function(t){t.trim().length>1&&o.length<3&&(o+=t.substring(0,1).toUpperCase())}),o}function Ut(i){var o=["#fba76f","#80d066","#73cdd0","#ecd074","#6fb1e4","#f98bae"],n=0;if(i){var t=i.charCodeAt(i.length-1);n=Math.round(t%o.length)}return o[n]}function mn(i){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(i.navigator.userAgent)}function Ee(i,o){var n=i;if(i&&i.indexOf("#")>-1)i=i.replace("#",""),n="rgba("+parseInt(i.substring(0,2),16)+","+parseInt(i.substring(2,4),16)+","+parseInt(i.substring(4,6),16)+","+o/100+")";else if(i&&i.indexOf("rgba")>-1)n="rgba("+(u=i.split(","))[0].substring(5)+","+u[1]+","+u[2]+","+o/100+")";else if(i&&i.indexOf("rgb(")>-1){var u;n="rgba("+(u=i.split(","))[0].substring(4)+","+u[1]+","+u[2].substring(0,u[2].length-1)+","+o/100+")"}return n}function pe(i,o){var n=i.location.href;o=o.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+o+"(=([^&]*)|&|$)").exec(n);return r?r[2]?"false"===r[2]||"0"===r[2]?"false":decodeURIComponent(r[2].replace(/\+/g," ")):"true":null}function be(i){var o=i;if("string"!=typeof i)return o;if(i)switch(o.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case null:return!1;default:return o}}function Mt(i,o){return"/apps/"+i+"/users/"+o+"/conversations"}function Zt(i,o){return"/apps/"+i+"/users/"+o+"/archived_conversations"}function rt(){try{return"localStorage"in window&&null!==window.localStorage}catch(i){return console.log("supports_html5_storage > Error :"+i),!1}}function Dt(){try{return"sessionStorage"in window&&null!==window.sessionStorage}catch(i){return console.log("supports_html5_session > Error :"+i),!1}}function Ue(i,o){return i.findIndex(function(n){return n.uid===o})}function po(i){try{var o=i.split("popup=")[1];return!!o&&!!o.startsWith("true")}catch(n){return!1}}function Ht(i,o,n){var t=function(i){return i.replace(/<.*?>/g,"").trim()}(o),u=screen.width/2-300,y=screen.height/2-300,j=i.open(t,"_blank","fullscreen=1, titlebar=0, toolbar=no, location=0, status=0, menubar=0, scrollbars=0, resizable=0, width=600, height=600, top="+y+", left="+u);i.focus&&j.focus()}function Ie(i,o){var n=i;if(i&&i.indexOf("#")>-1)i=i.replace("#",""),n="rgba("+parseInt(i.substring(0,2),16)+","+parseInt(i.substring(2,4),16)+","+parseInt(i.substring(4,6),16)+","+o/100+")";else if(i&&i.indexOf("rgba")>-1)n="rgba("+(u=i.split(","))[0].substring(5)+","+u[1]+","+u[2]+","+o/100+")";else if(i&&i.indexOf("rgb(")>-1){var u;n="rgba("+(u=i.split(","))[0].substring(4)+","+u[1]+","+u[2].substring(0,u[2].length-1)+","+o/100+")"}return n}function at(i,o){return void 0===o&&(o="asc"),function(n,t){if(!n.hasOwnProperty(i)||!t.hasOwnProperty(i))return 0;var r="string"==typeof n[i]?n[i].toUpperCase():n[i],a="string"==typeof t[i]?t[i].toUpperCase():t[i],u=0;return r>a?u=1:r<a&&(u=-1),"desc"===o?-1*u:u}}function ft(i){return xe.locale(window.navigator.language),xe.unix(i).fromNow()}function Cn(i){return!(!i||!i.recipient||!i.recipient.startsWith("group-")&&!i.recipient.startsWith("support-group"))}function Ke(i,o){var n,t,r;if(i.includes("rgb")&&(i=function(i){var n,u="";return(n=/^rgb\(\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*\)$/.exec(i))&&(u="#"+(16777216+(jt(n[1],n[2])<<16)+(jt(n[3],n[4])<<8)+jt(n[5],n[6])).toString(16).slice(1)),u}(i)),0===i.indexOf("#")&&(i=i.slice(1)),3===i.length&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),6!==i.length)throw new Error("Invalid HEX color.");return n=parseInt(i.slice(0,2),16),t=parseInt(i.slice(2,4),16),r=parseInt(i.slice(4,6),16),o?.299*n+.587*t+.114*r>186?"#000000":"#FFFFFF":(n=(255-n).toString(16),t=(255-t).toString(16),r=(255-r).toString(16),"#"+zt(n,2)+zt(t,2)+zt(r,2))}function zt(i,o){return o=o||2,(new Array(o).join("0")+i).slice(-o)}function jt(i,o){var n=Math.max(0,parseInt(i,10));return o?Math.floor(255*Math.min(100,n)/100):Math.min(255,n)}var Re=function(){function i(){this.obsObjChanged=new he.X(null),this.obsIsOpen=new he.X(null),this.BASE_LOCATION="https://widget.tiledesk.com/v2",this.POWERED_BY='<a tabindex="-1" target="_blank" href="http://www.tiledesk.com/"><img src="https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-logo_new_gray.svg"/></a>',this.DEFAULT_LOGO_CHAT="/assets/images/tiledesk_logo_white_small.svg",this.WIDGET_TITLE="Tiledesk",this.convertColorToRGBA=Ie,this.project=new Pe,this.availableAgents=[],this.isLogout=!1,this.availableAgentsStatus=!1,this.firstOpen=!0,this.departmentID=null,this.privacyApproved=!1,this.startedAt=new Date}return i.prototype.initDefafultParameters=function(){this.globalsParameters={},this.filterSystemMsg=!0;var o=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(o=window.parent);var n=pe(window,"windowcontext");null!==n&&"window.parent"===n&&(o=window.parent),this.windowContext=o,this.baseLocation=this.BASE_LOCATION,this.autoStart=!0,this.startHidden=!1,this.isShown=!0,this.isOpen=!1,this.startFromHome=!0,this.isOpenPrechatForm=!0,this.isOpenStartRating=!1,this.projectid="",this.preChatForm=!1,this.align="",this.calloutTimer=-1,this.calloutTitle="",this.calloutMsg="",this.calloutStaus=!0,this.userFullname="",this.userEmail="",this.widgetTitle="",this.dynamicWaitTimeReply=!0,this.hideHeaderCloseButton=!1,this.fullscreenMode=!1,this.themeColor=Ie("#2a6ac1",100),this.themeColorOpacity=100,this.themeForegroundColor=Ie("#ffffff",100),this.allowTranscriptDownload=!1,this.poweredBy=this.POWERED_BY,this.logoChat=this.BASE_LOCATION+this.DEFAULT_LOGO_CHAT,this.marginX="20px",this.marginY="20px",this.mobileMarginX="0px",this.mobileMarginY="0px",this.launcherWidth="60px",this.launcherHeight="60px",this.baloonImage="",this.baloonShape="50%",this.isLogEnabled=!1,this.openExternalLinkButton=!0,this.hideHeaderConversationOptionsMenu=!1,this.hideCloseConversationOptionMenu=!1,this.hideRestartConversationOptionsMenu=!1,this.hideSettings=!1,this.filterByRequester=!1,this.persistence="local",this.preChatFormJson=[{name:"userFullname",type:"text",mandatory:!0,label:"LABEL_FIELD_NAME"},{name:"userEmail",type:"text",mandatory:!0,regex:"/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/",label:"LABEL_FIELD_EMAIL",errorLabel:"LABEL_ERROR_FIELD_EMAIL"}],this.bubbleSentBackground=Ie("#2a6ac1",100),this.bubbleSentTextColor=Ie("#ffffff",100),this.bubbleReceivedBackground=Ie("#f0f2f7",100),this.bubbleReceivedTextColor=Ie("#06132b",100),this.fontSize="1.4em",this.fontFamily="'Roboto','Google Sans', Helvetica, Arial, sans-serif'",this.buttonFontSize="15px",this.buttonBackgroundColor=Ie("#ffffff",100),this.buttonTextColor=Ie("#2a6ac1",100),this.buttonHoverBackgroundColor=Ie("#2a6ac1",100),this.buttonHoverTextColor=Ie("#ffffff",100),this.singleConversation=!1,this.nativeRating=!0,this.showInfoMessage="MEMBER_JOINED_GROUP".split(",").map(function(t){return t.trim()}),this.typingLocation="content",this.allowReopen=!1,this.continueConversationBeforeTime=48,this.participants=[],this.showWaitTime=!0,this.showAvailableAgents=!0,this.showLogoutOption=!1,this.offline_msg=this.LABEL_FIRST_MSG_NO_AGENTS,this.online_msg=this.LABEL_FIRST_MSG,this.isOpenNewMessage=!1,this.showAttachmentButton=!0,this.showAllConversations=!0,this.tenant=ce.firebaseConfig.tenant,this.channelType="group",this.default_settings={},this.isMobile=!1,this.isLogged=!1,this.BUILD_VERSION="v."+ce.version,this.filterSystemMsg=!0,this.soundEnabled=!0,this.conversationsBadge=0,this.isOpenMenuOptions=!1,this.signInWithCustomToken=!1,this.displayEyeCatcherCard="none",this.supportMode=!0,this.newConversationStart=!0},i.prototype.initialize=function(){this.createDefaultSettingsObject(),this.setParameter("isMobile",mn(this.windowContext)),this.setParameter("attributes",this.attributes),this.setProjectParameters()},i.prototype.setProjectParameters=function(){var o=this.project.name;this.widgetTitle&&""!==this.widgetTitle&&(o=this.widgetTitle),this.project.customization(o,this.logoChat,Bt(o),Ut(o),this.welcomeTitle,this.welcomeMsg)},i.prototype.createDefaultSettingsObject=function(){this.default_settings={align:this.align,allowReopen:this.allowReopen,allowTranscriptDownload:this.allowTranscriptDownload,autoStart:this.autoStart,baloonShape:this.baloonShape,baloonImage:this.baloonImage,bubbleSentBackground:this.bubbleSentBackground,bubbleSentTextColor:this.bubbleSentTextColor,bubbleReceivedBackground:this.bubbleReceivedBackground,bubbleReceivedTextColor:this.bubbleReceivedTextColor,buttonBackgroundColor:this.buttonBackgroundColor,buttonTextColor:this.buttonTextColor,buttonFontSize:this.buttonFontSize,buttonHoverBackgroundColor:this.buttonHoverBackgroundColor,buttonHoverTextColor:this.buttonHoverTextColor,calloutTitle:this.calloutTitle,calloutMsg:this.calloutMsg,calloutTimer:this.calloutTimer,calloutStaus:this.calloutStaus,channelType:this.channelType,dynamicWaitTimeReply:this.dynamicWaitTimeReply,fontSize:this.fontSize,fontFamily:this.fontFamily,fullscreenMode:this.fullscreenMode,filterByRequester:this.filterByRequester,hideHeaderConversationOptionsMenu:this.hideHeaderConversationOptionsMenu,hideHeaderCloseButton:this.hideHeaderCloseButton,hideCloseConversationOptionMenu:this.hideCloseConversationOptionMenu,hideRestartConversationOptionsMenu:this.hideRestartConversationOptionsMenu,hideSettings:this.hideSettings,isLogEnabled:this.isLogEnabled,isOpen:this.isOpen,isShown:this.isShown,jwt:this.jwt,logLevel:this.logLevel,logoChat:this.logoChat,lang:this.lang,lancherWidth:this.launcherWidth,lancherHeight:this.launcherHeight,marginX:this.marginX,marginY:this.marginY,mobileMarginX:this.mobileMarginX,mobileMarginY:this.mobileMarginY,nativeRating:this.nativeRating,openExternalLinkButton:this.openExternalLinkButton,participants:this.participants,persistence:this.persistence,poweredBy:this.poweredBy,preChatForm:this.preChatForm,preChatFormJson:this.preChatFormJson,projectid:this.projectid,recipientId:this.recipientId,singleConversation:this.singleConversation,showInfoMessage:this.showInfoMessage,showAllConversations:this.showAllConversations,showWaitTime:this.showWaitTime,showAvailableAgents:this.showAvailableAgents,showLogoutOption:this.showLogoutOption,showAttachmentButton:this.showAttachmentButton,soundEnabled:this.soundEnabled,startHidden:this.startHidden,startFromHome:this.startFromHome,tenant:this.tenant,themeColor:this.themeColor,themeColorOpacity:this.themeColorOpacity,themeForegroundColor:this.themeForegroundColor,typingLocation:this.typingLocation,userEmail:this.userEmail,userFullname:this.userFullname,widgetTitle:this.widgetTitle,welcomeMsg:this.welcomeMsg,welcomeTitle:this.welcomeTitle}},i.prototype.setColorWithGradient=function(){this.colorGradient="linear-gradient("+this.themeColor+", "+Ie(this.themeColor,this.themeColorOpacity)+")",this.colorGradient180="linear-gradient( 180grad, "+this.themeColor+", "+Ie(this.themeColor,this.themeColorOpacity)+")",this.bubbleSentBackground="linear-gradient( 135grad, "+this.bubbleSentBackground+", "+Ie(this.bubbleSentBackground,80)+")"},i.prototype.setParentBodyStyleMobile=function(o,n){o&&n?(window.parent.document.body.style.height="0",window.parent.document.body.style.width="100%",window.parent.document.body.style.overflowY="hidden",window.parent.document.body.style.position="fixed"):!o&&n&&(window.parent.document.body.style.removeProperty("height"),window.parent.document.body.style.removeProperty("width"),window.parent.document.body.style.removeProperty("overflow-y"),window.parent.document.body.style.removeProperty("position"))},i.prototype.setElementStyle=function(o){var n=this.windowContext.document.getElementById("tiledeskdiv"),t=document.getElementById("chat21-conversations");o&&n?setTimeout(function(){n.classList.add("shadow"),t.classList.add("shadow")},1e3):!o&&n&&(n.classList.remove("shadow"),t.classList.remove("shadow")),o&&this.isMobile&&t?t.classList.add("isMobile"):!o&&t&&t.classList.remove("isMobile")},i.prototype.setIsOpen=function(o){this.isOpen=o,this.setParentBodyStyleMobile(o,this.isMobile),this.setElementStyle(o),this.obsIsOpen.next(o)},i.prototype.setParameter=function(o,n,t){this[o]=n,!0===t&&this.obsObjChanged.next({key:o,val:n})},i.prototype.setAttributeParameter=function(o,n){this.attributes[o]=n,this.setParameter("attributes",this.attributes,!0)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)},providedIn:"root"}),i}(),me=ye(61116);function wo(i,o){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.emoticon)}}function Oo(i,o){if(1&i&&(e.TgZ(0,"p",17),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.calloutMsg," ")}}function Mo(i,o){if(1&i&&(e.TgZ(0,"p",17),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.CALLOUT_MSG_PLACEHOLDER," ")}}var xo=function(i,o){return{"c21-align-left":i,"c21-align-right":o}},Eo=function(i,o,n,t){return{display:i,bottom:o,left:n,right:t}};function To(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",1),e.NdJ("mouseenter",function(){return e.CHM(n),e.oxw().mouseEnter()})("mouseleave",function(){return e.CHM(n),e.oxw().mouseLeave()}),e.TgZ(1,"div",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.NdJ("click",function(){return e.CHM(n),e.oxw().closeEyeCatcherCard()}),e.O4$(),e.TgZ(4,"svg",5),e._UZ(5,"path",6),e._UZ(6,"path",7),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"div",8),e.NdJ("click",function(){return e.CHM(n),e.oxw().openChatFromEyeCatcherCard()}),e.TgZ(8,"div",9),e.YNc(9,wo,2,1,"span",10),e.qZA(),e.qZA(),e.TgZ(10,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw().openChatFromEyeCatcherCard()}),e.TgZ(11,"div",12),e.TgZ(12,"p",13),e._uU(13),e.qZA(),e.YNc(14,Oo,2,1,"p",14),e.YNc(15,Mo,2,1,"ng-template",null,15,e.W1O),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.MAs(16),r=e.oxw();e.ekj("mobile",r.g.isMobile),e.Q6J("ngClass",e.WLB(9,xo,"left"===r.g.align,"left"!==r.g.align))("ngStyle",e.l5B(12,Eo,r.g.displayEyeCatcherCard,r.g.marginY+"px","left"===r.g.align?r.g.marginX+"px":"","right"===r.g.align?r.g.marginX+"px":"")),e.xp6(8),e.Q6J("@rotatedState",r.state),e.xp6(1),e.Q6J("ngIf",r.emoticon),e.xp6(4),e.Oqu(r.title),e.xp6(1),e.Q6J("ngIf",""!==r.g.calloutMsg)("ngIfElse",t)}}var yn=function(){function i(o){this.g=o,this.onOpenChat=new e.vpe,this.onCloseEyeCatcherCard=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.state="default",this.g.setParameter("displayEyeCatcherCard","none"),this.displayEyeCatcherCardCloseBtnWrapper="none",this.displayEyeCatcherCardCloseBtnIsMobileWrapper="none",this.displayEyeCatcherCardCloseBtn="none",this.openIfCallOutTimer()},i.prototype.openIfCallOutTimer=function(){var o=this,n=this.g.calloutTimer;n>=0&&setTimeout(function(){o.openEyeCatcher()},1e3*n)},i.prototype.openEyeCatcher=function(){this.checkIsEmoji();var o=this.g.isOpen;this.logger.debug("[EYEEYE-CATCHER-CARD] openEyeCatcher: calloutStaus ---------\x3e ",this.g.calloutStaus),!1===o&&this.g.calloutStaus?(this.onCloseEyeCatcherCard.emit(!0),this.g.setParameter("displayEyeCatcherCard","block"),this.displayEyeCatcherCardCloseBtnWrapper="block",this.displayEyeCatcherCardCloseBtnIsMobileWrapper="block"):this.logger.debug("[EYEEYE-CATCHER-CARD] openEyeCatcher: \xbb\xbb\xbb\xbb\xbb\xbb\xbb CALLING OPEN-EYE-CATCHER BUT NOT DISPLAY THE CARD BECAUSE THE CHAT IS ALREADY OPEN ")},i.prototype.checkIsEmoji=function(){var o=this.g.CALLOUT_TITLE_PLACEHOLDER.trim();this.g.calloutTitle&&""!==this.g.calloutTitle&&(o=this.g.calloutTitle.trim()),this.title=o;for(var r,t=ye(81126)();r=t.exec(o);){var a=r[0];this.logger.debug("[EYEEYE-CATCHER-CARD]--\x3e match",r),0===o.indexOf(a)&&(this.title=o.replace(a,""),this.emoticon=a);break}},i.prototype.openChatFromEyeCatcherCard=function(){this.g.setParameter("displayEyeCatcherCard","none"),this.onOpenChat.emit()},i.prototype.mouseEnter=function(){},i.prototype.mouseLeave=function(){},i.prototype.closeEyeCatcherCard=function(){this.onCloseEyeCatcherCard.emit(!1),this.g.setParameter("displayEyeCatcherCard","none"),this.g.setParameter("calloutStaus",!1,!0),this.displayEyeCatcherCardCloseBtnWrapper="none"},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-eyeeye-catcher-card"]],outputs:{onOpenChat:"onOpenChat",onCloseEyeCatcherCard:"onCloseEyeCatcherCard"},decls:1,vars:1,consts:[["class","eye-catcher-card scale-in-center",3,"mobile","ngClass","ngStyle","mouseenter","mouseleave",4,"ngIf"],[1,"eye-catcher-card","scale-in-center",3,"ngClass","ngStyle","mouseenter","mouseleave"],[1,"eye-catcher_row"],[1,"eye-catcher-card-close-btn-wrapper"],[1,"eye-catcher-card-close-btn",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","white","width","24px","height","24px",1,"eye-catcher-card-close-btn-img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"],[1,"eye-catcher_column","ec_left",3,"click"],[1,"eye-catcher-card-emoticons-wrapper"],["class","chat21-card-emoticons",4,"ngIf"],[1,"eye-catcher_column","ec_right",3,"click"],[1,"eye-catcher-card-text-wrapper"],[1,"eye-catcher-card-title"],["class","eye-catcher-card-msg",4,"ngIf","ngIfElse"],["calloutMsg_placeholder",""],[1,"chat21-card-emoticons"],[1,"eye-catcher-card-msg"]],template:function(n,t){1&n&&e.YNc(0,To,17,17,"div",0),2&n&&e.Q6J("ngIf",!t.g.isOpenNewMessage)},directives:[me.O5,me.mk,me.PC],styles:['.eye-catcher_column[_ngcontent-%COMP%]{float:left}.ec_right[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.eye-catcher_row[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.eye-catcher-card-emoticons-wrapper[_ngcontent-%COMP%]{text-align:center}.eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{z-index:1;height:40px;width:40px;position:absolute;top:-14px;display:none}.eye-catcher-card-close-btn[_ngcontent-%COMP%]{z-index:2;background-color:#5d6c80;width:24px;height:24px;border-radius:50%;position:relative;left:0px;right:0px;cursor:pointer;float:right;margin:4px;box-shadow:0 2px 8px rgba(35,47,53,.1)}.eye-catcher-card-close-btn-img[_ngcontent-%COMP%]{fill:#fff;width:18px;height:18px;margin:calc(50% - 9px)}.eye-catcher-card-close-btn-img-is-mobile-wrapper[_ngcontent-%COMP%]{z-index:1;position:absolute;right:-1px;top:-39px;right:-14px;cursor:pointer}.eye-catcher-card-close-btn-img-is-mobile[_ngcontent-%COMP%]{width:40px;position:relative;max-width:none}.eye-catcher-card[_ngcontent-%COMP%]{position:absolute;z-index:1;bottom:0px;cursor:pointer;background-color:#fff;border:0px solid #dedfde;box-shadow:rgba(35,47,53,.09) 0 2px 8px;width:300px;height:70px;border-radius:35px}.eye-catcher-card[_ngcontent-%COMP%] .eye-catcher_row[_ngcontent-%COMP%]{width:100%;height:100%;position:absolute}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%]{margin:16px 14px 15px 16px;padding-left:70px}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{right:0px}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .ec_left[_ngcontent-%COMP%]{width:40px;height:auto;margin:20px 4px 16px 0;overflow:hidden;position:absolute;top:0;right:0}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .ec_right[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 40px);height:100%;padding:0;vertical-align:middle;display:inline-table;position:absolute;top:0;left:0}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .eye-catcher_row[_ngcontent-%COMP%]{width:calc(100% - 70px)}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%]{margin:16px 14px 15px 16px;padding-right:70px}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{left:-14px}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .ec_left[_ngcontent-%COMP%]{width:40px;height:auto;margin:18px 3px;overflow:hidden;position:absolute;top:0;left:0}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .ec_right[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 115px);height:100%;padding:0;vertical-align:middle;display:inline-table;position:absolute;top:0;left:46px}.eye-catcher-card[_ngcontent-%COMP%]:hover .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{display:block}.eye-catcher-card-text-wrapper[_ngcontent-%COMP%]{width:100%;height:auto;vertical-align:middle;font-family:"Helvetica Neue","Apple Color Emoji",Helvetica,Arial,sans-serif;font-weight:normal;word-wrap:break-word;margin:0;position:absolute;line-height:normal;top:50%;transform:translateY(-50%)}.eye-catcher-card-title[_ngcontent-%COMP%]{font-size:15px;color:#3b3c40;display:block;margin:0;padding:0 0 4px}.eye-catcher-card-msg[_ngcontent-%COMP%]{letter-spacing:1px;font-size:13px;color:#7b7b7b;display:block;padding:0;margin:0;line-height:normal;width:100%}.eye-catcher-card-img-wrapper[_ngcontent-%COMP%]{border:1px solid #dedfde;border-radius:100px;height:65px;width:65px}.eye-catcher-card[_ngcontent-%COMP%] .chat21-card-img[_ngcontent-%COMP%]{position:relative;bottom:14px;right:15px;width:95px;max-width:none}.chat21-card-emoticons[_ngcontent-%COMP%]{font-size:26px}.eye-catcher-card.mobile[_ngcontent-%COMP%]{max-width:calc(100% - 100px)}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-img-wrapper[_ngcontent-%COMP%]{border:1px solid #dedfde;border-radius:100px;height:65px;width:65px}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn[_ngcontent-%COMP%]{background-color:#fcfcfc;width:30px;height:30px;margin:4px -4px;box-shadow:0 2px 8px rgba(35,47,53,.2)}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{display:block}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn-img[_ngcontent-%COMP%]{fill:#5d6c80}'],data:{animation:[(0,we.X$)("rotatedState",[])]}}),i}();function qt(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"image"===i.type)}function wn(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"frame"===i.type)}function So(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"file"===i.type)}function xt(i){return!(!i||!i.attributes||"info"!==i.attributes.subtype&&"info/support"!==i.attributes.subtype)}function On(i){return!!(i&&i.attributes&&"info"===i.attributes.subtype&&i.attributes.messagelabel&&"USER_BANNED"===i.attributes.messagelabel.key)}function Vt(i){return!(!i||!i.isSender)}function Xe(i,o){return"DATE"===i?!(!o.headerDate||""===o.headerDate):i===N?xt(o):i===V?Vt(o):i===Q?!1===xt(o)&&!1===Vt(o):void 0}function Po(i){try{if(!i)return!1;var o=i.replace(new RegExp("[\0-\u1eeff]","g"),""),n=i.replace(new RegExp("[\n\rs]+|( )+","g"),"");return""!==o&&""!=n&&o.length===n.length&&o.length<=2}catch(t){return!1}}function Wt(i,o){return o>i}function Mn(i,o){return!(!(i&&i.attributes&&i.attributes.messagelabel&&"MEMBER_JOINED_GROUP"===i.attributes.messagelabel.key&&i.attributes.messagelabel.parameters.member_id!==o.uid)||i.attributes.messagelabel.parameters.member_id.includes("bot")||i.attributes.messagelabel.parameters.member_id.includes("system"))||!!(i&&i.attributes&&i.attributes.messagelabel&&"MEMBER_JOINED_GROUP"!==i.attributes.messagelabel.key)}function Et(i,o){return!(i&&i.attributes&&i.attributes.messagelabel&&o.includes(i.attributes.messagelabel.key))}var xn=function(){function i(){this.logger=Ce.getInstance()}return i.prototype.setElement=function(o){this.el=o},i.prototype.setWindowContext=function(o){this.windowContext=o},i.prototype.triggerBeforeSendMessageEvent=function(o){this.logger.debug(" ---------------- triggerBeforeSendMessageEvent ---------------- ",o);try{var n=new CustomEvent("onBeforeMessageSend",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerAfterSendMessageEvent=function(o){this.logger.debug(" ---------------- triggerAfterSendMessageEvent ---------------- ",o);try{var n=new CustomEvent("onAfterMessageSend",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnNewConversationInit=function(o){this.logger.debug(" ---------------- triggerOnNewConversationComponentInit ---------------- ",o);var n=new CustomEvent("onNewConversationComponentInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerBeforeMessageRender=function(o){try{var n=new CustomEvent("beforeMessageRender",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerAfterMessageRender=function(o){try{var n=new CustomEvent("afterMessageRender",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnMessageCreated=function(o){this.logger.debug(" ---------------- triggerOnMessageCreated ---------------- ",o);var n=new CustomEvent("onMessageCreated",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnViewInit=function(o){this.logger.debug(" ---------------- triggerOnInit ---------------- ",o);var n=new CustomEvent("onInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnOpenEvent=function(o){this.logger.debug(" ---------------- triggerOnOpenEvent ---------------- ",o);var n=new CustomEvent("onOpen",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnCloseEvent=function(o){this.logger.debug(" ---------------- triggerOnCloseEvent ---------------- ",o);var n=new CustomEvent("onClose",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnOpenEyeCatcherEvent=function(o){this.logger.debug(" ---------------- triggerOnOpenEyeCatcherEvent ---------------- ",o);var n=new CustomEvent("onOpenEyeCatcher",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnClosedEyeCatcherEvent=function(){this.logger.debug(" ---------------- triggerOnClosedEyeCatcherEvent ---------------- ");var o=new CustomEvent("onClosedEyeCatcher",{detail:{}}),n=this.windowContext;n.tiledesk&&n.tiledesk.tiledeskroot?(n.tiledesk.tiledeskroot.dispatchEvent(o),this.windowContext=n):this.el.nativeElement.dispatchEvent(o)},i.prototype.triggerOnLoggedIn=function(o){this.logger.debug(" ---------------- triggerOnLoggedIn ---------------- ",o);var n=new CustomEvent("onLoggedIn",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnLoggedOut=function(o){this.logger.debug(" ---------------- triggerOnLoggedOut ---------------- ",o);var n=new CustomEvent("onLoggedOut",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnAuthStateChanged=function(o){this.logger.debug(" ---------------- triggerOnAuthStateChanged ---------------- ",o);var n=new CustomEvent("onAuthStateChanged",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerNewConversationEvent=function(o){this.logger.debug(" ---------------- triggerNewConversationEvent ---------------- ",o);var n=new CustomEvent("onNewConversation",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerLoadParamsEvent=function(o){this.logger.debug(" ---------------- triggerOnLoadParamsEvent ---------------- ",o);var n=new CustomEvent("onLoadParams",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnBeforeInit=function(o){this.logger.debug(" ---------------- triggerOnBeforeInitEvent ---------------- ",o);var n=new CustomEvent("onBeforeInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnConversationUpdated=function(o){this.logger.debug(" ---------------- triggerOnConversationUpdated ---------------- ",o);try{var n=new CustomEvent("onConversationUpdated",{detail:{conversation:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnCloseMessagePreview=function(){this.logger.debug(" ---------------- triggerOnCloseMessagePreview ---------------- ");try{var o=new CustomEvent("onCloseMessagePreview",{detail:{}}),n=this.windowContext;n.tiledesk&&n.tiledesk.tiledeskroot?(n.tiledesk.tiledeskroot.dispatchEvent(o),this.windowContext=n):this.el.nativeElement.dispatchEvent(o)}catch(t){this.logger.error("[TRIGGER-HANDLER] > Error:"+t)}},i.prototype.triggerOnbeforeDepartmentsFormRender=function(o){this.logger.debug(" ---------------- triggerOnbeforeDepartmentsFormRender ---------------- ");var n=new CustomEvent("onBeforeDepartmentsFormRender",{detail:{departments:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerGetImageUrlThumb=function(o){this.logger.debug(" ---------------- getImageUrlThumb ---------------- ");try{var n=new CustomEvent("getImageUrlThumb",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot&&t.tiledesk.tiledeskroot.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Se=ye(42693),ko=ye(96791),He=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Fe=function(){function i(o,n){this.http=o,this.g=n,this.appConfig=ce}return i.prototype.loadAppConfig=function(){var o=this.appConfig.remoteConfigUrl;if(!this.appConfig.remoteConfigUrl.startsWith("http")){var n=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(n=window.parent);var t=function(i,o){var n=window.location.href;o=o.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+o+"(=([^&#]*)|&|#|$)").exec(n);return r?r[2]?"false"===r[2]||"0"===r[2]?"false":decodeURIComponent(r[2].replace(/\+/g," ")):"true":null}(0,"windowcontext");if(null!==t&&"window.parent"===t&&(n=window.parent),!n.tiledesk)return;var r=n.tiledesk.getBaseLocation();void 0!==r&&(this.g.baseLocation=r,o=this.g.baseLocation+this.appConfig.remoteConfigUrl)}var a=this;return this.http.get(o).toPromise().then(function(u){a.appConfig=u}).catch(function(u){console.error("error loadAppConfig",u)})},i.prototype.getConfig=function(){return this.appConfig},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i}(),En=function(){function i(o,n,t){this.http=o,this.appStorageService=n,this.appConfigService=t,this.logger=Ce.getInstance(),this.obsSettingsService=new he.X(null)}return i.prototype.initWidgetParamiters=function(o,n){var r,t=this;this.globals=o,this.el=n,this.globals.initDefafultParameters();try{r=this.setProjectId()}catch(a){return void this.logger.error("[GLOBAL-SET] > Error :"+a)}this.setMainParametersFromSettings(o),this.globals.tenant=this.appConfigService.getConfig().firebaseConfig.tenant,this.globals.logLevel=this.appConfigService.getConfig().logLevel,this.globals.persistence=this.appConfigService.getConfig().authPersistence,this.getProjectParametersById(r).subscribe(function(a){var u=a.project;u&&t.globals.project.initialize(u.id,u.activeOperatingHours,u.channels,u.name,u.createdAt,u.createdBy,u.isActiveSubscription,u.profile,u.agents,u.trialDays,u.type,u.status,u.trialDaysLeft,u.trialExpired,u.updatedAt,u.versions),t.setParameters(a)},function(a){t.setParameters(null)},function(){})},i.prototype.setProjectId=function(){try{(o=this.globals.windowContext.tiledeskSettings.projectid)&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 1 > Error :"+n)}try{(o=this.el.nativeElement.getAttribute("projectid"))&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 2 > Error :"+n)}try{var o;(o=pe(this.globals.windowContext,"tiledesk_projectid"))&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 3 > Error :"+n)}return this.globals.projectid},i.prototype.setMainParametersFromSettings=function(o){var n;try{var t=this.globals.windowContext.tiledesk.getBaseLocation();this.logger.debug("[GLOBAL-SET] 1 > baseLocation: ",t),void 0!==t&&(this.globals.baseLocation=t)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings baseLocation > Error :",ie)}try{n=this.globals.windowContext.tiledeskSettings}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings tiledeskSettings > Error :",ie)}try{var r=n.persistence;void 0!==r&&(this.globals.persistence=r)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings persistence > Error :",ie)}try{var a=n.filterByRequester;this.logger.debug("[GLOBAL-SET] setMainParametersFromSettings > filterByRequester: ",a),void 0!==a&&(this.globals.filterByRequester=!0===a)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings filterByRequester > Error :",ie)}try{var u=n.isLogEnabled;void 0!==u&&(this.globals.isLogEnabled=!0===u)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings isLogEnabled > Error :",ie)}try{var y=n.departmentID;void 0!==y&&(this.globals.departmentID=y)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings departmentID > Error :",ie)}try{var j=n.showAttachmentButton;void 0!==j&&(this.globals.showAttachmentButton=!0===j)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings showAttachmentButton > Error :",ie)}try{var J=n.showAllConversations;void 0!==J&&(this.globals.showAllConversations=!0===J)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings showAllConversations > Error :",ie)}},i.prototype.setParameters=function(o){this.logger.debug("[GLOBAL-SET] ***** setParameters ***** ",o),null!==o&&this.setVariablesFromService(this.globals,o),this.setVariableFromStorage(this.globals),this.setVariablesFromSettings(this.globals),this.setVariablesFromAttributeHtml(this.globals,this.el),this.setVariablesFromUrlParameters(this.globals),this.setDepartmentFromExternal(),this.globals.setColorWithGradient(),this.setCssIframe(),this.logger.debug("[GLOBAL-SET] ***** END SET PARAMETERS *****"),this.obsSettingsService.next(!0)},i.prototype.setCssIframe=function(){this.globals.setParameter("isMobile",mn(this.globals.windowContext));var o=this.globals.windowContext.document.getElementById("tiledeskdiv");o&&("left"===this.globals.align?(o.classList.add("align-left"),o.style.left=this.globals.isMobile?this.globals.mobileMarginX:this.globals.marginX):(o.classList.add("align-right"),o.style.right=this.globals.isMobile?this.globals.mobileMarginX:this.globals.marginX),o.style.bottom=this.globals.isMobile?this.globals.mobileMarginY:this.globals.marginY,!0===this.globals.fullscreenMode&&(o.style.left=0,o.style.right=0,o.style.top=0,o.style.bottom=0,o.style.width="100%",o.style.height="100%",o.style.maxHeight="none",o.style.maxWidth="none"))},i.prototype.setVariablesFromService=function(o,n){var t,r;this.logger.debug("[GLOBAL-SET] > setVariablesFromService :",n),this.globals=o;try{var a=n.departments;void 0!==a&&this.initDepartments(a)}catch(ve){this.initDepartments(null),this.logger.error("[GLOBAL-SET] setVariablesFromService > Error is departments: ",ve)}try{var u=n.user_available;void 0!==u&&(this.logger.debug("[GLOBAL-SET] setVariablesFromService > user_available ::::",u),this.setAvailableAgentsStatus(u))}catch(ve){this.setAvailableAgentsStatus(null),this.logger.error("[GLOBAL-SET] setVariablesFromService > Error is departments: ",ve)}try{var y=n.project.widget;if(void 0!==y)try{for(var j=(0,_e.XA)(Object.keys(y)),J=j.next();!J.done;J=j.next()){var ie=J.value;"align"===ie&&"left"===y[ie]?(o.windowContext.document.getElementById("tiledeskdiv").style.left="0!important",o.align="left"):"align"===ie&&"right"===y[ie]&&(o.windowContext.document.getElementById("tiledeskdiv").style.right="0!important",o.align="right"),y.hasOwnProperty("calloutTimer")&&(o.calloutTimer=y.calloutTimer),y.hasOwnProperty("dynamicWaitTimeReply")&&(o.dynamicWaitTimeReply=be(y.dynamicWaitTimeReply)),y.hasOwnProperty("logoChat")&&(o.logoChat=y.logoChat),y.hasOwnProperty("preChatForm")&&(o.preChatForm=y.preChatForm),y.hasOwnProperty("preChatFormCustomFieldsEnabled")&&y.hasOwnProperty("preChatFormJson")&&(o.preChatFormJson=y.preChatFormJson),y.hasOwnProperty("themeColor")&&(o.themeColor=y.themeColor,o.bubbleSentBackground=y.themeColor,o.bubbleSentTextColor=Ke(y.themeColor,!0),o.buttonTextColor=y.themeColor,o.buttonHoverBackgroundColor=y.themeColor),y.hasOwnProperty("themeColorOpacity")&&(o.themeColorOpacity=y.themeColorOpacity),y.hasOwnProperty("themeForegroundColor")&&(o.themeForegroundColor=y.themeForegroundColor),y.hasOwnProperty("nativeRating")&&(o.nativeRating=y.nativeRating),y.hasOwnProperty("poweredBy")&&(o.poweredBy=y.poweredBy),y.hasOwnProperty("baloonImage")&&(o.baloonImage=y.baloonImage),y.hasOwnProperty("allowReopen")&&(o.allowReopen=y.allowReopen,o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),y.hasOwnProperty("singleConversation")&&(o.singleConversation=y.singleConversation),y.hasOwnProperty("themeColorOpacity")&&(o.themeColorOpacity=y.themeColorOpacity)}}catch(ve){t={error:ve}}finally{try{J&&!J.done&&(r=j.return)&&r.call(j)}finally{if(t)throw t.error}}}catch(ve){this.logger.error("[GLOBAL-SET] setVariablesFromService widget > Error :",ve)}try{var de=n.ip.split(",").shift();this.globals.attributes||(this.globals.attributes={}),this.globals.attributes.ipAddress=de,this.globals.setAttributeParameter("ipAddress",de),this.logger.debug("[GLOBAL-SET] setVariablesFromService > ipAddress :",de)}catch(ve){this.logger.error("[GLOBAL-SET] setVariablesFromService > ipAddress > Error :",ve)}this.appStorageService.setItem("attributes",JSON.stringify(this.globals.attributes))},i.prototype.setVariablesFromSettings=function(o){var n=o.windowContext;if(n.tiledesk){var t=n.tiledesk.getBaseLocation();void 0!==t&&(o.baseLocation=t);var r,a=n.tiledeskSettings;void 0!==(r=a.tenant)&&(o.tenant=r),void 0!==(r=a.recipientId)&&(o.recipientId=r),void 0!==(r=a.widgetTitle)&&(o.widgetTitle=r),void 0!==(r=a.userEmail)&&(o.userEmail=r),void 0!==(r=a.userFullname)&&(o.userFullname=r),void 0!==(r=a.preChatForm)&&(o.preChatForm=!0===r),void 0!==(r=a.isOpen)&&(o.isOpen=!0===r),void 0!==(r=a.open)&&(o.isOpen=!0===r),void 0!==(r=a.channelType)&&(o.channelType=r),r=a.lang,ko.XAE&&(o.lang=r),void 0!==(r=a.align)&&(o.align=r),void 0!==(r=a.marginX)&&(o.marginX=r),void 0!==(r=a.marginY)&&(o.marginY=r),void 0!==(r=a.mobileMarginX)&&(o.mobileMarginX=r),void 0!==(r=a.mobileMarginY)&&(o.mobileMarginY=r),void 0!==(r=a.launcherWidth)&&(o.launcherWidth=r),void 0!==(r=a.launcherHeight)&&(o.launcherHeight=r),void 0!==(r=a.baloonImage)&&(o.baloonImage=r),void 0!==(r=a.baloonShape)&&(o.baloonShape=r),void 0!==(r=a.calloutTimer)&&(o.calloutTimer=r),void 0!==(r=a.calloutTitle)&&(o.calloutTitle=r),void 0!==(r=a.calloutMsg)&&(o.calloutMsg=r),void 0!==(r=a.fullscreenMode)&&(o.fullscreenMode=r),void 0!==(r=a.hideHeaderCloseButton)&&(o.hideHeaderCloseButton=r),void 0!==(r=a.themeColor)&&(o.themeColor=Ee(r,100),o.bubbleSentBackground=Ee(r,100),o.bubbleSentTextColor=Ke(r,!0),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.themeColorOpacity)&&(o.themeColorOpacity=+r),void 0!==(r=a.themeForegroundColor)&&(o.themeForegroundColor=Ee(r,100)),void 0!==(r=a.allowTranscriptDownload)&&(o.allowTranscriptDownload=!0===r),void 0!==(r=a.startFromHome)&&(o.startFromHome=!0===r),void 0!==(r=a.logoChat)&&(o.logoChat=r),void 0!==(r=a.welcomeTitle)&&(o.welcomeTitle=r),void 0!==(r=a.welcomeMsg)&&(o.welcomeMsg=r),void 0!==(r=a.autoStart)&&(o.autoStart=!0===r),void 0!==(r=a.startHidden)&&(o.startHidden=!0===r),void 0!==(r=a.isShown)&&(o.isShown=!0===r),void 0!==(r=a.filterByRequester)&&(o.filterByRequester=!0===r),void 0!==(r=a.showWaitTime)&&(o.showWaitTime=!0===r),void 0!==(r=a.showAvailableAgents)&&(o.showAvailableAgents=!0===r),void 0!==(r=a.showLogoutOption)&&(o.showLogoutOption=!0===r),void 0!==(r=a.customAttributes)&&(o.customAttributes=r),void 0!==(r=a.showAttachmentButton)&&(o.showAttachmentButton=!0===r),void 0!==(r=a.showAllConversations)&&(o.showAllConversations=!0===r),void 0!==(r=a.dynamicWaitTimeReply)&&(o.dynamicWaitTimeReply=be(r)),void 0!==(r=a.soundEnabled)&&(o.soundEnabled=r),void 0!==(r=a.openExternalLinkButton)&&(o.openExternalLinkButton=r),void 0!==(r=a.hideCloseConversationOptionMenu)&&(o.hideCloseConversationOptionMenu=!0===r),void 0!==(r=a.hideRestartConversationOptionsMenu)&&(o.hideRestartConversationOptionsMenu=!0===r),void 0!==(r=a.hideHeaderConversationOptionsMenu)&&(o.hideHeaderConversationOptionsMenu=!0===r),void 0!==(r=a.hideSettings)&&(o.hideSettings=!0===r),void 0!==(r=a.logLevel)&&(o.logLevel=r),void 0!==(r=a.preChatFormJson)&&function(i){var o=!0;return Array.isArray(i)&&i.forEach(function(n){if("object"!=typeof n)return o=!1}),o}(r)&&(o.preChatFormJson=r),void 0!==(r=a.bubbleSentBackground)&&(o.bubbleSentBackground=Ee(r,100),o.bubbleSentTextColor=Ke(r,!0),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.bubbleSentTextColor)&&(o.bubbleSentTextColor=Ee(r,100)),void 0!==(r=a.bubbleReceivedBackground)&&(o.bubbleReceivedBackground=Ee(r,100),o.bubbleReceivedTextColor=Ke(r,!0)),void 0!==(r=a.bubbleReceivedTextColor)&&(o.bubbleReceivedTextColor=Ee(r,100)),void 0!==(r=a.fontSize)&&(o.fontSize=r),void 0!==(r=a.fontFamily)&&(o.fontFamily=r),void 0!==(r=a.buttonFontSize)&&(o.buttonFontSize=r),void 0!==(r=a.buttonBackgroundColor)&&(o.buttonBackgroundColor=Ee(r,100),o.buttonTextColor=Ke(r,!0),o.buttonHoverBackgroundColor=Ke(r,!0),o.buttonHoverTextColor=Ee(r,100)),void 0!==(r=a.buttonTextColor)&&(o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.buttonHoverBackgroundColor)&&(o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.buttonHoverTextColor)&&(o.buttonHoverTextColor=Ee(r,100)),void 0!==(r=a.singleConversation)&&(o.singleConversation=!0===r),void 0!==(r=a.nativeRating)&&(o.nativeRating=!0===r),void 0!==(r=a.showInfoMessage)&&(o.showInfoMessage=r.split(",").map(function(u){return u.trim()})),void 0!==(r=a.typingLocation)&&(o.typingLocation=r),void 0!==(r=a.allowReopen)&&(o.allowReopen=!0===r,o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),void 0!==(r=a.continueConversationBeforeTime)&&(o.continueConversationBeforeTime=+r),void 0!==(r=a.participants)&&(o.participants=r.split(",").map(function(u){return u.trim()}))}},i.prototype.setVariablesFromAttributeHtml=function(o,n){var t;null!==(t=n.nativeElement.getAttribute("tenant"))&&(this.globals.tenant=t),null!==(t=n.nativeElement.getAttribute("recipientId"))&&(this.globals.recipientId=t),null!==(t=n.nativeElement.getAttribute("widgetTitle"))&&(this.globals.widgetTitle=t),null!==(t=n.nativeElement.getAttribute("userEmail"))&&(this.globals.userEmail=t),null!==(t=n.nativeElement.getAttribute("userFullname"))&&(this.globals.userFullname=t),null!==(t=n.nativeElement.getAttribute("preChatForm"))&&(this.globals.preChatForm=!0===t),null!==(t=n.nativeElement.getAttribute("isOpen"))&&(this.globals.isOpen=!0===t),null!==(t=n.nativeElement.getAttribute("open"))&&(this.globals.isOpen=!0===t),null!==(t=n.nativeElement.getAttribute("channelType"))&&(this.globals.channelType=t),null!==(t=n.nativeElement.getAttribute("lang"))&&(this.globals.lang=t),null!==(t=n.nativeElement.getAttribute("align"))&&(this.globals.align=t),null!==(t=n.nativeElement.getAttribute("marginX"))&&(this.globals.marginX=t),null!==(t=n.nativeElement.getAttribute("marginY"))&&(this.globals.marginY=t),null!==(t=n.nativeElement.getAttribute("mobileMarginX"))&&(this.globals.mobileMarginX=t),null!==(t=n.nativeElement.getAttribute("mobileMarginY"))&&(this.globals.mobileMarginY=t),null!==(t=n.nativeElement.getAttribute("launcherWidth"))&&(this.globals.launcherWidth=t),null!==(t=n.nativeElement.getAttribute("launcherHeight"))&&(this.globals.launcherHeight=t),null!==(t=n.nativeElement.getAttribute("baloonImage"))&&(this.globals.baloonImage=t),null!==(t=n.nativeElement.getAttribute("baloonShape"))&&(this.globals.baloonShape=t),null!==(t=n.nativeElement.getAttribute("calloutTimer"))&&(this.globals.calloutTimer=t),null!==(t=n.nativeElement.getAttribute("welcomeMsg"))&&(this.globals.welcomeMsg=t),null!==(t=n.nativeElement.getAttribute("welcomeTitle"))&&(this.globals.welcomeTitle=t),null!==(t=n.nativeElement.getAttribute("calloutTitle"))&&(this.globals.calloutTitle=t),null!==(t=n.nativeElement.getAttribute("calloutMsg"))&&(this.globals.calloutMsg=t),null!==(t=n.nativeElement.getAttribute("startFromHome"))&&(this.globals.startFromHome=!0===t),null!==(t=n.nativeElement.getAttribute("logoChat"))&&(this.globals.logoChat=t),null!==(t=n.nativeElement.getAttribute("autoStart"))&&(this.globals.autoStart=!0===t),null!==(t=n.nativeElement.getAttribute("startHidden"))&&(this.globals.startHidden=!0===t),null!==(t=n.nativeElement.getAttribute("isShown"))&&(this.globals.isShown=!0===t),null!==(t=n.nativeElement.getAttribute("isLogEnabled"))&&(this.globals.isLogEnabled=!0===t),null!==(t=n.nativeElement.getAttribute("filterByRequester"))&&(this.globals.filterByRequester=!0===t),null!==(t=n.nativeElement.getAttribute("showAttachmentButton"))&&(this.globals.showAttachmentButton=!0===t),null!==(t=n.nativeElement.getAttribute("departmentID"))&&(this.globals.departmentID=t),null!==(t=n.nativeElement.getAttribute("showAllConversations"))&&(this.globals.showAllConversations=!0===t),null!==(t=n.nativeElement.getAttribute("dynamicWaitTimeReply"))&&(this.globals.dynamicWaitTimeReply=be(t)),null!==(t=n.nativeElement.getAttribute("soundEnabled"))&&(this.globals.soundEnabled=t),null!==(t=n.nativeElement.getAttribute("openExternalLinkButton"))&&(this.globals.openExternalLinkButton=t),null!==(t=n.nativeElement.getAttribute("hideHeaderConversationOptionsMenu"))&&(this.globals.hideHeaderConversationOptionsMenu=t),null!==(t=n.nativeElement.getAttribute("hideCloseConversationOptionMenu"))&&(this.globals.hideCloseConversationOptionMenu=t),null!==(t=n.nativeElement.getAttribute("hideRestartConversationOptionsMenu"))&&(this.globals.hideRestartConversationOptionsMenu=t),null!==(t=n.nativeElement.getAttribute("hideSettings"))&&(this.globals.hideSettings=t),null!==(t=n.nativeElement.getAttribute("logLevel"))&&(this.globals.logLevel=t),null!==(t=n.nativeElement.getAttribute("preChatFormJson"))&&(this.globals.preChatFormJson=t),null!==(t=n.nativeElement.getAttribute("fontSize"))&&(this.globals.fontSize=t),null!==(t=n.nativeElement.getAttribute("fontFamily"))&&(this.globals.fontFamily=t),null!==(t=n.nativeElement.getAttribute("buttonFontSize"))&&(this.globals.buttonFontSize=t),null!==(t=n.nativeElement.getAttribute("buttonBackgroundColor"))&&(this.globals.buttonBackgroundColor=t),null!==(t=n.nativeElement.getAttribute("buttonTextColor"))&&(this.globals.buttonTextColor=t),null!==(t=n.nativeElement.getAttribute("buttonHoverBackgroundColor"))&&(this.globals.buttonHoverBackgroundColor=t),null!==(t=n.nativeElement.getAttribute("buttonHoverTextColor"))&&(this.globals.buttonHoverTextColor=t),null!==(t=n.nativeElement.getAttribute("singleConversation"))&&(this.globals.singleConversation=!0===t),null!==(t=n.nativeElement.getAttribute("nativeRating"))&&(this.globals.nativeRating=!0===t),null!==(t=n.nativeElement.getAttribute("showInfoMessage"))&&(this.globals.showInfoMessage=t.split(",").map(function(r){return r.trim()})),null!==(t=n.nativeElement.getAttribute("typingLocation"))&&(this.globals.typingLocation=t),null!==(t=n.nativeElement.getAttribute("allowReopen"))&&(this.globals.allowReopen=t,this.globals.allowReopen&&!this.globals.showInfoMessage.includes("CHAT_CLOSED")&&this.globals.showInfoMessage.push("CHAT_CLOSED")),null!==(t=n.nativeElement.getAttribute("continueConversationBeforeTime"))&&(this.globals.continueConversationBeforeTime=+t),null!==(t=n.nativeElement.getAttribute("participants"))&&(this.globals.participants=t.split(",").map(function(r){return r.trim()}))},i.prototype.setVariablesFromUrlParameters=function(o){this.logger.debug("[GLOBAL-SET] setVariablesFromUrlParameters: ");var t,n=o.windowContext;if((t=pe(n,"tiledesk_tenant"))&&(o.tenant=be(t)),(t=pe(n,"tiledesk_recipientId"))&&(o.recipientId=be(t)),(t=pe(n,"tiledesk_widgetTitle"))&&(o.widgetTitle=be(t)),(t=pe(n,"tiledesk_userEmail"))&&(o.userEmail=be(t)),(t=pe(n,"tiledesk_userFullname"))&&(o.userFullname=be(t)),(t=pe(n,"tiledesk_channelType"))&&(o.channelType=be(t)),(t=pe(n,"tiledesk_lang"))&&(o.lang=be(t)),(t=pe(n,"tiledesk_calloutTimer"))&&(o.calloutTimer=Number(t)),(t=pe(n,"tiledesk_align"))&&(o.align=be(t)),(t=pe(n,"tiledesk_marginX"))&&(o.marginX=be(t)),(t=pe(n,"tiledesk_marginY"))&&(o.marginY=be(t)),(t=pe(n,"tiledesk_mobileMarginX"))&&(o.mobileMarginX=be(t)),(t=pe(n,"tiledesk_mobileMarginY"))&&(o.mobileMarginY=be(t)),(t=pe(n,"tiledesk_launcherWidth"))&&(o.launcherWidth=be(t)),(t=pe(n,"tiledesk_launcherHeight"))&&(o.launcherHeight=be(t)),(t=pe(n,"tiledesk_baloonImage"))&&(o.baloonImage=be(t)),(t=pe(n,"tiledesk_baloonShape"))&&(o.baloonShape=be(t)),(t=pe(n,"tiledesk_welcomeMsg"))&&(o.welcomeMsg=be(t)),(t=pe(n,"tiledesk_calloutTitle"))&&(o.calloutTitle=be(t)),(t=pe(n,"tiledesk_calloutMsg"))&&(o.calloutMsg=be(t)),(t=pe(n,"tiledesk_hideHeaderCloseButton"))&&(o.hideHeaderCloseButton=be(t)),t=pe(n,"tiledesk_themeColor")){var r=be(t);o.themeColor=Ee(r,100),o.bubbleSentBackground=Ee(r,100),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)}if((t=pe(n,"tiledesk_themeColorOpacity"))&&(o.themeColorOpacity=+t),t=pe(n,"tiledesk_themeForegroundColor")){var a=be(t);o.themeForegroundColor=Ee(a,100),o.bubbleSentTextColor=Ee(a,100)}if((t=pe(n,"tiledesk_logoChat"))&&(o.logoChat=be(t)),(t=pe(n,"tiledesk_welcomeTitle"))&&(o.welcomeTitle=be(t)),(t=pe(n,"tiledesk_autoStart"))&&(o.autoStart=be(t)),(t=pe(n,"tiledesk_startHidden"))&&(o.startHidden=be(t)),(t=pe(n,"tiledesk_isShown"))&&(o.isShown=be(t)),(t=pe(n,"tiledesk_isLogEnabled"))&&(o.isLogEnabled=be(t)),(t=pe(n,"tiledesk_filterByRequester"))&&(o.filterByRequester=be(t)),(t=pe(n,"tiledesk_showWaitTime"))&&(o.showWaitTime=be(t)),(t=pe(n,"tiledesk_showAvailableAgents"))&&(o.showAvailableAgents=be(t)),(t=pe(n,"tiledesk_showLogoutOption"))&&(o.showLogoutOption=be(t)),(t=pe(n,"tiledesk_preChatForm"))&&(o.preChatForm=be(t)),(t=pe(n,"tiledesk_isOpen"))&&(o.isOpen=be(t)),(t=pe(n,"tiledesk_open"))&&(o.isOpen=be(t)),(t=pe(n,"tiledesk_allowTranscriptDownload"))&&(o.allowTranscriptDownload=be(t)),(t=pe(n,"tiledesk_startFromHome"))&&(o.startFromHome=be(t)),(t=pe(n,"tiledesk_fullscreenMode"))&&(o.fullscreenMode=be(t)),(t=pe(n,"tiledesk_customAttributes"))&&(o.customAttributes=JSON.parse(t)),(t=pe(n,"tiledesk_showAttachmentButton"))&&(o.showAttachmentButton=be(t)),(t=pe(n,"tiledesk_departmentID"))&&(o.departmentID=t),(t=pe(n,"tiledesk_persistence"))&&(o.persistence=t),(t=pe(n,"tiledesk_showAllConversations"))&&(o.showAllConversations=be(t)),(t=pe(n,"tiledesk_jwt"))&&(o.jwt=t),(t=pe(n,"tiledesk_dynamicWaitTimeReply"))&&(o.dynamicWaitTimeReply=be(t)),(t=pe(n,"tiledesk_soundEnabled"))&&(o.soundEnabled=be(t)),(t=pe(n,"tiledesk_openExternalLinkButton"))&&(o.openExternalLinkButton=be(t)),(t=pe(n,"tiledesk_hideHeaderConversationOptionsMenu"))&&(o.hideHeaderConversationOptionsMenu=be(t)),(t=pe(n,"tiledesk_hideCloseConversationOptionMenu"))&&(o.hideCloseConversationOptionMenu=be(t)),(t=pe(n,"tiledesk_hideRestartConversationOptionsMenu"))&&(o.hideRestartConversationOptionsMenu=be(t)),(t=pe(n,"tiledesk_hideSettings"))&&(o.hideSettings=be(t)),(t=pe(n,"tiledesk_logLevel"))&&(o.logLevel=t),(t=pe(n,"tiledesk_preChatFormJson"))&&(o.preChatFormJson=JSON.parse(t)),t=pe(n,"tiledesk_bubbleSentBackground")){var u=be(t);o.bubbleSentBackground=Ee(u,100),o.bubbleSentTextColor=Ke(u,!0),o.buttonTextColor=Ee(u,100),o.buttonHoverBackgroundColor=Ee(u,100)}if(t=pe(n,"tiledesk_bubbleSentTextColor")){var y=be(t);o.bubbleSentTextColor=Ee(y,100)}if(t=pe(n,"tiledesk_bubbleReceivedBackground")){var j=be(t);o.bubbleReceivedBackground=Ee(j,100),o.bubbleReceivedTextColor=Ke(t,!0)}if(t=pe(n,"tiledesk_bubbleReceivedTextColor")){var J=be(t);o.bubbleReceivedTextColor=Ee(J,100)}if((t=pe(n,"tiledesk_fontSize"))&&(o.fontSize=t),(t=pe(n,"tiledesk_fontFamily"))&&(o.fontFamily=t),(t=pe(n,"tiledesk_buttonFontSize"))&&(o.buttonFontSize=t),t=pe(n,"tiledesk_buttonBackgroundColor")){var ie=be(t);o.buttonBackgroundColor=Ee(ie,100),o.buttonTextColor=Ke(ie,!0),o.buttonHoverBackgroundColor=Ke(ie,!0),o.buttonHoverTextColor=Ee(ie,100)}if(t=pe(n,"tiledesk_buttonTextColor")){var ue=be(t);o.buttonTextColor=Ee(ue,100)}if(t=pe(n,"tiledesk_buttonHoverBackgroundColor")){var ge=be(t);o.buttonHoverBackgroundColor=Ee(ge,100)}if(t=pe(n,"tiledesk_buttonHoverTextColor")){var de=be(t);o.buttonHoverTextColor=Ee(de,100)}(t=pe(n,"tiledesk_singleConversation"))&&(o.singleConversation=be(t)),(t=pe(n,"tiledesk_nativeRating"))&&(o.nativeRating=be(t)),(t=pe(n,"tiledesk_typingLocation"))&&(o.typingLocation=t),(t=pe(n,"tiledesk_showInfoMessage"))&&(o.showInfoMessage=t.split(",").map(function(ve){return ve.trim()})),(t=pe(n,"tiledesk_allowReopen"))&&(o.allowReopen=be(t),o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),(t=pe(n,"tiledesk_continueConversationBeforeTime"))&&(o.continueConversationBeforeTime=+t),(t=pe(n,"tiledesk_participants"))&&(o.participants=t.split(",").map(function(ve){return ve.trim()}))},i.prototype.setVariableFromStorage=function(o){var n,t;this.logger.debug("[GLOBAL-SET] setVariableFromStorage :::::::: SET VARIABLE ----------\x3e",Object.keys(o));try{for(var r=(0,_e.XA)(Object.keys(o)),a=r.next();!a.done;a=r.next()){var u=a.value,y=this.appStorageService.getItem(u);y&&null!==y&&(o[u]=be(y))}}catch(j){n={error:j}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(n)throw n.error}}},i.prototype.initDepartments=function(o){var n=this;if(this.globals.setParameter("departmentSelected",null),this.globals.setParameter("departmentDefault",null),this.logger.info("[GLOBAL-SET] initDepartments departments ::::",o),null!==o){if(this.globals.departments=o,1===o.length){var t=o[0];this.logger.debug("[GLOBAL-SET] initDepartments DEPARTMENT FIRST ::::",o[0]),this.globals.setParameter("departmentDefault",o[0]),t&&t.online_msg&&""!==t.online_msg&&(this.globals.online_msg=t.online_msg),t&&t.offline_msg&&""!==t.offline_msg&&(this.globals.offline_msg=t.offline_msg),this.setDepartment(o[0])}else if(o.length>1){this.logger.debug("[GLOBAL-SET] initDepartments > MORE THAN 1 DEPARTMENT ::::",o[0]);var r=0;o.forEach(function(a){if(!0===a.default)return a&&a.online_msg&&""!==a.online_msg&&(n.globals.online_msg=a.online_msg),a&&a.offline_msg&&""!==a.offline_msg&&(n.globals.offline_msg=a.offline_msg),void o.splice(r,1);r++}),this.globals.setParameter("departmentDefault",o[0]),this.setDepartment(o[0])}else this.logger.error("[GLOBAL-SET] initDepartments > DEPARTMENT DEFAULT NON RESTITUISCE RISULTATI ::::");this.setDepartmentFromExternal()}},i.prototype.setDepartmentFromExternal=function(){var o=this,n=!1;this.globals.departmentID&&(this.globals.departments.forEach(function(t){if(t._id===o.globals.departmentID)return o.logger.debug("[GLOBAL-SET] setDepartmentFromExternal > EXTERNAL DEPARTMENT ::::"+t._id),o.globals.setParameter("departmentDefault",t),o.setDepartment(t),void(n=!0)}),!1===n&&(this.globals.departmentID=null),this.logger.debug("[GLOBAL-SET] setDepartmentFromExternal > END departmentID ::::"+this.globals.departmentID+n))},i.prototype.setDepartment=function(o){this.logger.debug("[GLOBAL-SET] setDepartment: ",JSON.stringify(o)),this.globals.setParameter("departmentSelected",o);var n=JSON.parse(this.appStorageService.getItem("attributes"));n?(n.departmentId=o._id,n.departmentName=o.name):n={departmentId:o._id,departmentName:o.name},this.logger.debug("[GLOBAL-SET] setDepartment > setAttributes: ",JSON.stringify(n)),this.globals.setParameter("departmentSelected",o),this.globals.setParameter("attributes",n)},i.prototype.setAvailableAgentsStatus=function(o){if(this.globals.setParameter("availableAgentsStatus",!1),null!==o&&o.length>0){var n=[];o.forEach(function(t,r){t.imageurl=function(i){return"https://firebasestorage.googleapis.com/v0/b/"+ce.firebaseConfig.storageBucket+"/o/profiles%2F"+i+"%2Fthumb_photo.jpg?alt=media"}(t.id),n.push(t)}),this.globals.availableAgents=n,this.globals.setParameter("availableAgentsStatus",!0)}},i.prototype.getProjectParametersById=function(o){if(o){var t=this.appConfigService.getConfig().apiUrl+o+"/widgets",r=new Se.WM;return r.append("Content-Type","application/json"),this.http.get(t,{headers:r})}},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Tn=function(){function i(o,n){this.g=o,this.appStorageService=n}return i.prototype.initialize=function(){this.setGlobalsSubscription()},i.prototype.setGlobalsSubscription=function(){var o=this;this.g.obsObjChanged.subscribe(function(n){n&&o.setVariable(n.key,n.val)})},i.prototype.setVariable=function(o,n){JSON.stringify(n)},i.\u0275fac=function(n){return new(n||i)(e.LFG(Re),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Ao=ye(31225),Io=ye(47727),Yt=ye(14095),Gt=function(){function i(o,n,t,r){this._translate=o,this.http=n,this.g=t,this.appConfigService=r,this.defaultLanguage="en",this.logger=Ce.getInstance();var a=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(a=window.parent),a.tiledesk&&(this.baseLocation=a.tiledesk.getBaseLocation())}return i.prototype.getLanguage=function(){return this.language},i.prototype.initializeTransaltorService=function(){var o=this;this._translate.setDefaultLang("it");var n=this._translate.getBrowserLang();this.logger.debug("[TRANSLATOR-SERV] initializeTransaltorService--\x3e DEVICE LANG ",n),n&&("it"===n?(this._translate.use("it"),this.http.get(this.baseLocation+"/assets/i18n/"+n+".json").subscribe(function(t){console.log("ress lang",JSON.parse(t._body)),o._translate.setTranslation("it",JSON.parse(t._body)),o._translate.get("LABEL_PREVIEW").subscribe(function(r){console.log("default translate --\x3e ",r)})})):this._translate.use("en"))},i.prototype.getTranslationFileUrl=function(o){this.remoteTranslationsUrl=ce.remoteTranslationsUrl;var n=this.appConfigService.getConfig().remoteTranslationsUrl;return n&&(this.remoteTranslationsUrl=n),ce.loadRemoteTranslations?this.remoteTranslationsUrl+this.g.projectid+"/labels/"+o.toUpperCase():this.baseLocation+"/assets/i18n/"+o+".json"},i.prototype.initI18n=function(){var o=this;this._translate.addLangs(["en","it"]),this.logger.debug("[TRANSLATOR-SERV]\xbb\xbb\xbb\xbb initI18n getLangs ",this._translate.getLangs());var n="en";this.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n setDefaultLang "),this._translate.setDefaultLang(n),this.language=n;var t=this._translate.getBrowserLang();return this.g.lang&&""!==this.g.lang?(t=this.g.lang,this.language=this.g.lang):this.g.lang=t,new Promise(function(r,a){o.http.get(o.getTranslationFileUrl(t)).pipe((0,Io.K)(function(y){return o._translate.use(n),o.http.get(o.getTranslationFileUrl(n)).subscribe(function(j){o.translateWithBrowserLang(j.data,n)},function(j){o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Get default language - ERROR ",j),o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n - \xbb\xbb\xbb loadRemoteTranslations IN ERROR ?",ce.loadRemoteTranslations)},function(){r(!0)}),(0,Ao._)(y)})).subscribe(function(y){o.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Successfully initialized '"+t+"' language from URL'",o.getTranslationFileUrl(t)),y.data&&void 0!==y.data&&""!==y.data?(o.language=y.lang.toLowerCase(),o.translateWithBrowserLang(y.data,o.language)):(t=n,o.language=n,o.g.lang=n,o._translate.use(n),o.http.get(o.getTranslationFileUrl(n)).subscribe(function(j){o.translateWithBrowserLang(j.data,t)}))},function(y){o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Get '"+t+"' language - ERROR ",y)},function(){r(!0)})})},i.prototype.translateWithBrowserLang=function(o,n){this._translate.use(n),this.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n - \xbb\xbb\xbb loadRemoteTranslations ?",ce.loadRemoteTranslations),this._translate.setTranslation(n,o,!0)},i.prototype.translate=function(o){var n=this;this._translate.get(["LABEL_TU","LABEL_PLACEHOLDER","LABEL_START_NW_CONV","LABEL_FIRST_MSG","LABEL_FIRST_MSG_NO_AGENTS","LABEL_SELECT_TOPIC","LABEL_COMPLETE_FORM","LABEL_FIELD_NAME","LABEL_ERROR_FIELD_NAME","LABEL_FIELD_EMAIL","LABEL_ERROR_FIELD_EMAIL","LABEL_ERROR_FIELD_REQUIRED","LABEL_WRITING","LABEL_SEND_NEW_MESSAGE","AGENT_NOT_AVAILABLE","AGENT_AVAILABLE","GUEST_LABEL","ALL_AGENTS_OFFLINE_LABEL","CALLOUT_TITLE_PLACEHOLDER","CALLOUT_MSG_PLACEHOLDER","ALERT_LEAVE_CHAT","YES","NO","BUTTON_CLOSE_TO_ICON","BUTTON_EDIT_PROFILE","DOWNLOAD_TRANSCRIPT","RATE_CHAT","WELLCOME_TITLE","WELLCOME_MSG","OPTIONS","SOUND_ON","SOUND_OFF","LOGOUT","CUSTOMER_SATISFACTION","YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE","YOUR_RATING","WRITE_YOUR_OPINION","SUBMIT","THANK_YOU_FOR_YOUR_EVALUATION","YOUR_RATING_HAS_BEEN_RECEIVED","CLOSE","PREV_CONVERSATIONS","YOU","SHOW_ALL_CONV","START_A_CONVERSATION","NO_CONVERSATION","SEE_PREVIOUS","WAITING_TIME_FOUND","WAITING_TIME_NOT_FOUND","CLOSED","LABEL_PREVIEW"]).subscribe(function(r){o.LABEL_TU=r.LABEL_TU,o.LABEL_PLACEHOLDER=r.LABEL_PLACEHOLDER,o.LABEL_START_NW_CONV=r.LABEL_START_NW_CONV,o.LABEL_FIRST_MSG=r.LABEL_FIRST_MSG,o.LABEL_FIRST_MSG_NO_AGENTS=r.LABEL_FIRST_MSG_NO_AGENTS,o.LABEL_SELECT_TOPIC=r.LABEL_SELECT_TOPIC,o.LABEL_COMPLETE_FORM=r.LABEL_COMPLETE_FORM,o.LABEL_FIELD_NAME=r.LABEL_FIELD_NAME,o.LABEL_ERROR_FIELD_NAME=r.LABEL_ERROR_FIELD_NAME,o.LABEL_FIELD_EMAIL=r.LABEL_FIELD_EMAIL,o.LABEL_ERROR_FIELD_EMAIL=r.LABEL_ERROR_FIELD_EMAIL,o.LABEL_WRITING=r.LABEL_WRITING,o.LABEL_SEND_NEW_MESSAGE=r.LABEL_SEND_NEW_MESSAGE,o.AGENT_NOT_AVAILABLE=r.AGENT_NOT_AVAILABLE,o.AGENT_AVAILABLE=r.AGENT_AVAILABLE,o.GUEST_LABEL=r.GUEST_LABEL,o.ALL_AGENTS_OFFLINE_LABEL=r.ALL_AGENTS_OFFLINE_LABEL,o.CALLOUT_TITLE_PLACEHOLDER=r.CALLOUT_TITLE_PLACEHOLDER,o.CALLOUT_MSG_PLACEHOLDER=r.CALLOUT_MSG_PLACEHOLDER,o.ALERT_LEAVE_CHAT=r.ALERT_LEAVE_CHAT,o.YES=r.YES,o.NO=r.NO,o.BUTTON_CLOSE_TO_ICON=r.BUTTON_CLOSE_TO_ICON,o.BUTTON_EDIT_PROFILE=r.BUTTON_EDIT_PROFILE,o.DOWNLOAD_TRANSCRIPT=r.DOWNLOAD_TRANSCRIPT,o.RATE_CHAT=r.RATE_CHAT,o.WELLCOME_TITLE=r.WELLCOME_TITLE,o.WELLCOME_MSG=r.WELLCOME_MSG,o.OPTIONS=r.OPTIONS,o.SOUND_ON=r.SOUND_ON,o.SOUND_OFF=r.SOUND_OFF,o.LOGOUT=r.LOGOUT,o.CUSTOMER_SATISFACTION=r.CUSTOMER_SATISFACTION,o.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE=r.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE,o.YOUR_RATING=r.YOUR_RATING,o.WRITE_YOUR_OPINION=r.WRITE_YOUR_OPINION,o.SUBMIT=r.SUBMIT,o.THANK_YOU_FOR_YOUR_EVALUATION=r.THANK_YOU_FOR_YOUR_EVALUATION,o.YOUR_RATING_HAS_BEEN_RECEIVED=r.YOUR_RATING_HAS_BEEN_RECEIVED,o.CLOSE=r.CLOSE,o.PREV_CONVERSATIONS=r.PREV_CONVERSATIONS,o.YOU=r.YOU,o.SHOW_ALL_CONV=r.SHOW_ALL_CONV,o.START_A_CONVERSATION=r.START_A_CONVERSATION,o.NO_CONVERSATION=r.NO_CONVERSATION,o.SEE_PREVIOUS=r.SEE_PREVIOUS,o.WAITING_TIME_FOUND=r.WAITING_TIME_FOUND,o.WAITING_TIME_NOT_FOUND=r.WAITING_TIME_NOT_FOUND,o.CLOSED=r.CLOSED,o.LABEL_PREVIEW=r.LABEL_PREVIEW,o.LABEL_ERROR_FIELD_REQUIRED=r.LABEL_ERROR_FIELD_REQUIRED,o.welcomeTitle||(o.welcomeTitle=o.WELLCOME_TITLE),o.welcomeMsg||(o.welcomeMsg=o.WELLCOME_MSG)},function(r){n.logger.error("[TRANSLATOR-SERV]\xbb\xbb\xbb\xbb\xbb\xbb \xbb\xbb\xbb\xbb\xbb\xbb GET TRANSLATED LABELS - ERROR ",r)},function(){})},i.\u0275fac=function(n){return new(n||i)(e.LFG(Yt.sK),e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Sn=JSON.parse('{"LABEL_TU":"","LABEL_PLACEHOLDER":"type your message..","LABEL_START_NW_CONV":"New conversation","LABEL_FIRST_MSG":"Describe shortly your problem, you will be contacted by an agent.","LABEL_FIRST_MSG_NO_AGENTS":"\ud83e\udd14 All operators are offline at the moment. You can anyway describe your problem. It will be assigned to the support team who will answer you as soon as possible.","LABEL_SELECT_TOPIC":"Select a topic","LABEL_COMPLETE_FORM":"Complete the form to start a conversation with the next available agent.","LABEL_FIELD_NAME":"Name","LABEL_ERROR_FIELD_NAME":"Required field (minimum 5 characters).","LABEL_FIELD_EMAIL":"Email","LABEL_ERROR_FIELD_EMAIL":"Enter a valid email address.","LABEL_ERROR_FIELD_REQUIRED":"Required field","LABEL_WRITING":"is writing...","LABEL_SEND_NEW_MESSAGE":"Send a new message","AGENT_NOT_AVAILABLE":" Offline","AGENT_AVAILABLE":" Online","GUEST_LABEL":"Guest","ALL_AGENTS_OFFLINE_LABEL":"All operators are offline at the moment","LABEL_LOADING":"Loading...","CALLOUT_TITLE_PLACEHOLDER":"Need Help?","CALLOUT_MSG_PLACEHOLDER":"Click here and start chatting with us!","CUSTOMER_SATISFACTION":"Customer satisfaction","YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE":"your opinion on our customer service","DOWNLOAD_TRANSCRIPT":"Download transcript","BACK":"Back","CONTINUE":"Continue","YOUR_RATING":"your rating","WRITE_YOUR_OPINION":"Write your opinion ... (optional)","SUBMIT":"Submit","THANK_YOU_FOR_YOUR_EVALUATION":"Thank you for your evaluation","YOUR_RATING_HAS_BEEN_RECEIVED":"your rating has been received","ALERT_LEAVE_CHAT":"Do you want to leave the chat?","YES":"Yes","NO":"No","BUTTON_CLOSE_TO_ICON":"Minimize chat","BUTTON_EDIT_PROFILE":"Update profile","RATE_CHAT":"Rate chat","WELLCOME_TITLE":"Hi, welcome to Tiledesk \ud83d\udc4b","WELLCOME_MSG":"How can we help?","OPTIONS":"options","SOUND_OFF":"Sound off","SOUND_ON":"Sound on","LOGOUT":"Logout","CLOSE":"Close","RESTART":"Restart","PREV_CONVERSATIONS":"Your conversations","YOU":"You","SHOW_ALL_CONV":"show all","START_A_CONVERSATION":"Start a conversation","NO_CONVERSATION":"No conversation","SEE_PREVIOUS":"see previous","WAITING_TIME_FOUND":"The team typically replies in $reply_time","WAITING_TIME_NOT_FOUND":"The team will reply as soon as possible","CLOSED":"CLOSED","CLOSE_CHAT":"Close chat","MINIMIZE":"Minimize","MAXIMIZE":"Maximize","INFO_SUPPORT_USER_ADDED_SUBJECT":"you","INFO_SUPPORT_USER_ADDED_YOU_VERB":"have been added to ","INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined","INFO_SUPPORT_USER_ADDED_VERB":"the chat","INFO_SUPPORT_CHAT_REOPENED":"Chat reopened","INFO_SUPPORT_CHAT_CLOSED":"Chat closed","INFO_SUPPORT_LEAD_UPDATED":"Lead updated","INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group","INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"A new support request has been assigned to you","LABEL_PRECHAT_USER_FULLNAME":"Full name","LABEL_PRECHAT_USER_EMAIL":"Email","LABEL_PRECHAT_USER_EMAIL_ERROR":"Invalid email address","LABEL_PRECHAT_USER_PHONE":"Phone","LABEL_PRECHAT_USER_PHONE_ERROR":"Phone is required","LABEL_PRECHAT_FIRST_MESSAGE":"Your message for the support team","LABEL_PRECHAT_STATIC_TERMS_PRIVACY":"Before proceeding in the conversation please agree to our <a href=\'https://tiledesk.com/termsofservice/\' target=\'_blank\'>Terms</a> and <a href=\'https://tiledesk.com/privacy.html\' target=\'_blank\'>Privacy Policy</a>","LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY":"I agree","PRECHAT_REQUIRED_ERROR":"This field is required","LABEL_TODAY":"today","LABEL_TOMORROW":"yesterday","LABEL_LAST_ACCESS":"last access","LABEL_TO":"at","ARRAY_DAYS":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"SENT_AN_ATTACHMENT":"sent an attachment","SENT_AN_IMAGE":"sent an image","LABEL_PREVIEW":"Preview"}'),ut=function(){function i(o){this.translateService=o}return i.prototype.translateLanguage=function(o,n){return this.initialiseTranslation(o)},i.prototype.initialiseTranslation=function(o){var n=this,t=new Map;return o.forEach(function(r){n.translateService.get(r).subscribe(function(a){r===a&&Sn[r]&&(a=Sn[r]),t.set(r,a)})}),t},i.\u0275fac=function(n){return new(n||i)(e.LFG(Yt.sK))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),mt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),vt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Tt=function(){function i(o,n){this.conversationsHandlerService=o,this.archivedConversationsService=n,this.BSStart=new he.X(null),this.logger=Ce.getInstance()}return i.prototype.initialize=function(){this.handlers=[],this.openInfoConversation=!0,this.currentUser=null,this.logger.info("[CHAT MANAGER]**** init ****",this.handlers)},i.prototype.setTiledeskToken=function(o){this.tiledeskToken=o},i.prototype.getTiledeskToken=function(){return this.tiledeskToken},i.prototype.setCurrentUser=function(o){this.currentUser=o},i.prototype.getCurrentUser=function(){return this.currentUser},i.prototype.startApp=function(){this.BSStart.next(this.currentUser)},i.prototype.getOpenInfoConversation=function(){return this.openInfoConversation},i.prototype.dispose=function(){this.logger.debug("[CHAT MANAGER] 1 - setOffAllReferences"),this.handlers&&this.setOffAllReferences(),this.logger.debug("[CHAT MANAGER] 2 - disposeConversationsHandler"),this.conversationsHandlerService&&this.disposeConversationsHandler(),this.logger.debug("[CHAT MANAGER] 3 - disposeArchivedConversationsHandler"),this.archivedConversationsService&&this.disposeArchivedConversationsHandler(),this.logger.debug("[CHAT MANAGER] 4 - disposeContactsSynchronizer"),this.logger.debug("[CHAT MANAGER] OKK "),this.conversationsHandlerService=null,this.archivedConversationsService=null},i.prototype.goOffLine=function(){this.currentUser=null,this.logger.debug("[CHAT MANAGER] 1 - CANCELLO TUTTE LE REFERENCES"),this.dispose()},i.prototype.addConversationHandler=function(o){this.logger.debug("[CHAT MANAGER] -----\x3e addConversationHandler",this.handlers,o),this.handlers.push(o)},i.prototype.removeConversationHandler=function(o){this.logger.debug("[CHAT MANAGER] -----\x3e removeConversationHandler: ",o);var n=this.handlers.findIndex(function(t){return t.conversationWith===o});this.handlers.splice(n,1)},i.prototype.getConversationHandlerByConversationId=function(o){var n=null;return this.handlers.forEach(function(t){t.conversationWith!==o||(n=t)}),n},i.prototype.setOffAllReferences=function(){this.handlers.forEach(function(o){}),this.handlers=[]},i.prototype.setConversationsHandler=function(o){this.conversationsHandlerService=o},i.prototype.setArchivedConversationsHandler=function(o){this.archivedConversationsService=o},i.prototype.disposeConversationsHandler=function(){this.logger.debug("[CHAT MANAGER] 2 - this.conversationsHandler:: ",this.conversationsHandlerService),this.conversationsHandlerService.dispose()},i.prototype.disposeArchivedConversationsHandler=function(){this.logger.debug("[CHAT MANAGER] 3 - this.archivedConversationsService:: ",this.archivedConversationsService),this.archivedConversationsService.dispose()},i.\u0275fac=function(n){return new(n||i)(e.LFG(mt),e.LFG(vt))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i}(),Jt=function(){function i(o,n){this.http=o,this.appStorage=n,this.logger=Ce.getInstance()}return i.prototype.initialize=function(o,n){this.logger.debug("[TILEDESK-REQUEST-SERV] - initialize",n),this.SERVER_BASE_URL=o,this.URL_TILEDESK_CLOSE_REQUEST=this.SERVER_BASE_URL+n+"/requests/"},i.prototype.closeSupportGroup=function(o){var n=this;this.tiledeskToken=this.appStorage.getItem("tiledeskToken"),this.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup",o);var r={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:this.tiledeskToken})},u=this.URL_TILEDESK_CLOSE_REQUEST+o+"/closeg";return new Promise(function(y,j){n.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup URLLLL",u,r),n.http.put(u,null,r).subscribe(function(J){n.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup response",J),y("closed")},function(J){j(J)})})},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Ro=function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge){this.uid=o,this.email=n,this.firstname=t,this.lastname=r,this.fullname=a,this.imageurl=u,this.avatar=y,this.color=j,this.checked=J,this.online=ie,this.lastConnection=ue,this.decoded=ge}}();function bt(i){var o=["#E17076","#7BC862","#65aadd","#a695e7","#ee7aae","#6ec9cb","#faa774"],n=0;if(i){var t=i.charCodeAt(i.length-1);n=Math.round(t%o.length)}return o[n]}function _t(i){var o="";return i&&i.split(" ").forEach(function(t){t.trim().length>1&&o.length<3&&(o+=t.substring(0,1).toUpperCase()),1==t.trim().length&&(o+=t.substring(0,1).toUpperCase())}),o}var Pn=function(){function i(o,n){this.http=o,this.appStorage=n,this.logger=Ce.getInstance()}return i.prototype.initialize=function(o){this.logger.log("[TILEDESK-AUTH-SERV] - initialize serverBaseUrl",o),this.SERVER_BASE_URL=o,this.URL_TILEDESK_SIGNIN=this.SERVER_BASE_URL+"auth/signin",this.URL_TILEDESK_SIGNIN_ANONYMOUSLY=this.SERVER_BASE_URL+"auth/signinAnonymously",this.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN=this.SERVER_BASE_URL+"auth/signinWithCustomToken"},i.prototype.signInWithEmailAndPassword=function(o,n){var t=this;this.logger.debug("[TILEDESK-AUTH]-SERV] - signInWithEmailAndPassword",o,n);var r=new Se.WM;r.append("Accept","application/json"),r.append("Content-Type","application/json");var a={headers:r},u={email:o,password:n},y=this;return new Promise(function(j,J){t.http.post(t.URL_TILEDESK_SIGNIN,u,a).subscribe(function(ie){ie.success&&ie.token&&(y.tiledeskToken=ie.token,y.createCompleteUser(ie.user),y.appStorage.setItem("tiledeskToken",y.tiledeskToken),j(y.tiledeskToken))},function(ie){J(ie)})})},i.prototype.signInAnonymously=function(o){var n=this;this.logger.debug("[TILEDESK-AUTH] - signInAnonymously - projectID",o);var t=new Se.WM;t.append("Accept","application/json"),t.append("Content-Type","application/json");var r={headers:t},a={id_project:o},u=this;return new Promise(function(y,j){n.http.post(n.URL_TILEDESK_SIGNIN_ANONYMOUSLY,a,r).subscribe(function(J){J.success&&J.token&&(u.tiledeskToken=J.token,u.createCompleteUser(J.user),u.appStorage.setItem("tiledeskToken",u.tiledeskToken),y(u.tiledeskToken))},function(J){j(J)})})},i.prototype.signInWithCustomToken=function(o){var n=this,r={headers:new Se.WM({"Content-type":"application/json",Authorization:o})},a=this;return new Promise(function(u,y){n.http.post(n.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN,null,r).subscribe(function(j){j.success&&j.token&&(a.tiledeskToken=j.token,a.createCompleteUser(j.user),n.checkAndSetInStorageTiledeskToken(a.tiledeskToken),u(n.currentUser))},function(j){y(j)})})},i.prototype.logOut=function(){this.logger.debug("[TILEDESK-AUTH] logOut()"),this.appStorage.removeItem("tiledeskToken"),this.appStorage.removeItem("currentUser"),this.setCurrentUser(null)},i.prototype.createCompleteUser=function(o){var n=new Ro(o._id);try{var t=o._id,r=o.firstname?o.firstname:"",a=o.lastname?o.lastname:"",u=o.email?o.email:"",y=(r+" "+a).trim(),j=_t(y),J=bt(y);n.uid=t,n.email=u,n.firstname=r,n.lastname=a,n.fullname=y,n.avatar=j,n.color=J,this.currentUser=n,this.logger.debug("[TILEDESK-AUTH] - createCompleteUser member ",n),this.appStorage.setItem("currentUser",JSON.stringify(this.currentUser))}catch(ie){this.logger.error("[TILEDESK-AUTH]- createCompleteUser ERR ",ie)}},i.prototype.checkAndSetInStorageTiledeskToken=function(o){this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken tiledeskToken from request",o);var n=this.appStorage.getItem("tiledeskToken");this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken storedTiledeskToken ",n),n?n&&n!==o?(this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST BUT IS != FROM TOKEN - RUN SET "),this.appStorage.setItem("tiledeskToken",o)):n&&n===o&&this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST AND IS = TO TOKEN "):(this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken TOKEN DOES NOT EXIST - RUN SET "),this.appStorage.setItem("tiledeskToken",o))},i.prototype.getCurrentUser=function(){return this.currentUser},i.prototype.setCurrentUser=function(o){this.currentUser=o},i.prototype.getTiledeskToken=function(){return this.tiledeskToken},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),St=function(){function i(){this.DEFAULT_PERSISTENCE="NONE",this.DEFAULT_URL="https://api.tiledesk.com/v2/auth/"}return i.prototype.setPersistence=function(o){this.persistence=o},i.prototype.getPersistence=function(){return this.persistence?this.persistence:this.DEFAULT_PERSISTENCE},i.prototype.setBaseUrl=function(o){this.baseUrl=o},i.prototype.getBaseUrl=function(){return this.baseUrl?this.baseUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Ct=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),st=function(){function i(){this.DEFAULT_URL=ce.baseImageUrl}return i.prototype.setImageBaseUrl=function(o){this.baseImageUrl=o},i.prototype.getImageBaseUrl=function(){return this.baseImageUrl?this.baseImageUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),ht=function(){function i(){this.BSIsTyping=new he.X(null),this.BSSetTyping=new he.X(null)}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Pt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),pt=function(){function i(){this.DEFAULT_URL=ce.apiUrl}return i.prototype.setBaseUrl=function(o){this.baseUrl=o},i.prototype.getBaseUrl=function(){return this.baseUrl?this.baseUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}();function Lo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-home",10),e.NdJ("onNewConversation",function(){return e.CHM(n),e.oxw().onNewConversation()})("onConversationSelected",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)})("onOpenAllConvesations",function(){return e.CHM(n),e.oxw().onOpenAllConversation()})("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseWidget()})("onSignOut",function(){return e.CHM(n),e.oxw().onSignOut()})("onImageLoaded",function(a){return e.CHM(n),e.oxw().onImageLoaded(a)})("onConversationLoaded",function(a){return e.CHM(n),e.oxw().onConversationLoaded(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("hideSettings",t.g.hideSettings)("stylesMap",t.styleMapConversation)}}function No(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-list-all-conversations",11),e.NdJ("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseAllConversation()})("onConversationSelected",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("stylesMap",t.styleMapConversation)}}function Fo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-conversation",12),e.NdJ("onBackHome",function(){return e.CHM(n),e.oxw().onBackConversation()})("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseWidget()})("onSoundChange",function(a){return e.CHM(n),e.oxw().onSoundChange(a)})("onConversationClosed",function(a){return e.CHM(n),e.oxw().onConversationClosed(a)})("onSignOut",function(){return e.CHM(n),e.oxw().onMenuOptionSignOut()})("onNewConversationButtonClicked",function(a){return e.CHM(n),e.oxw().onNewConversationButtonClicked(a)})("onBeforeMessageSent",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerBeforeSendMessageEvent(a)})("onAfterSendMessage",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerAfterSendMessageEvent(a)})("onNewMessageCreated",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerOnMessageCreated(a)})("onNewConversationInit",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerOnNewConversationInit(a)})("onBeforeMessageRender",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerBeforeMessageRender(a)})("onAfterMessageRender",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerAfterMessageRender(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("senderId",t.g.senderId)("conversationId",t.g.recipientId)("isOpen",t.g.isOpen)("isConversationArchived",t.isConversationArchived)("stylesMap",t.styleMapConversation)}}function Bo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",13),e.TgZ(1,"chat-selection-department",14),e.NdJ("onBeforeDepartmentsFormRender",function(r){return e.CHM(n),e.oxw().triggerHandler.triggerOnbeforeDepartmentsFormRender(r)})("onClose",function(){return e.CHM(n),e.oxw().onCloseModalDepartment()})("onDepartmentSelected",function(r){return e.CHM(n),e.oxw().onDepartmentSelected(r)}),e.qZA(),e.qZA()}}function Uo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.TgZ(1,"chat-prechat-form",16),e.NdJ("onClosePage",function(){return e.CHM(n),e.oxw().onCloseModalPrechatForm()})("onCloseForm",function(){return e.CHM(n),e.oxw().onPrechatFormComplete()}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("stylesMap",t.styleMapConversation)}}function Zo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",17),e.TgZ(1,"chat-star-rating-widget",18),e.NdJ("onClosePage",function(){return e.CHM(n),e.oxw().onCloseModalRateChat()})("onCloseRate",function(){return e.CHM(n),e.oxw().onRateChatComplete()}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("recipientId",t.g.recipientId)("stylesMap",t.styleMapConversation)}}function Do(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-eyeeye-catcher-card",19),e.NdJ("onOpenChat",function(){return e.CHM(n),e.oxw().onOpenChatEyeEyeCatcherCard()})("onCloseEyeCatcherCard",function(r){return e.CHM(n),e.oxw().onCloseEyeCatcherCard(r)}),e.qZA()}}function Ho(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"chat-last-message",20),e.NdJ("onCloseMessagePreview",function(){return e.CHM(n),e.oxw().triggerHandler.triggerOnCloseMessagePreview()})("onSelectedConversation",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("conversation",t.lastConversation)("baseLocation",null==t.g||null==t.g.windowContext.tiledesk?null:t.g.windowContext.tiledesk.getBaseLocation())("stylesMap",t.styleMapConversation)}}function zo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-launcher-button",21),e.NdJ("onButtonClicked",function(r){return e.CHM(n),e.oxw().onOpenCloseWidget(r)}),e.qZA()}}var jo=function(i,o,n,t){return{"swing-in-bottom-fwd":i,"full-screen-mode":o,"c21-align-left":n,"c21-align-right":t}},qo=function(i,o,n,t){return{display:i,bottom:o,left:n,right:t}},Qt=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je){this.el=o,this.ngZone=n,this.g=t,this.triggerHandler=r,this.globalSettingsService=a,this.settingsSaverService=u,this.appConfigService=y,this.appStorageService=j,this.translatorService=J,this.translateService=ie,this.chatManager=ue,this.tiledeskRequestsService=ge,this.tiledeskAuthService=de,this.messagingAuthService=ve,this.conversationsHandlerService=Te,this.archivedConversationsService=ke,this.conversationHandlerBuilderService=Ae,this.imageRepoService=Be,this.typingService=Ze,this.presenceService=ze,this.uploadService=je,this.subscriptions=[],this.isTabVisible=!0,this.isOpenHome=!0,this.isOpenConversation=!1,this.isOpenAllConversation=!1,this.isOpenSelectionDepartment=!1,this.isOpenStartRating=!1,this.isConversationArchived=!1,this.isInitialized=!1,this.isSentMessage=!1,this.styleMapConversation=new Map,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.info("[APP-CONF]---------------- ngOnInit: APP.COMPONENT ---------------- "),this.initWidgetParamiters()},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.info("[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- "),this.ngZone.run(function(){var n=o,t=o.conversationsHandlerService.conversationChanged.subscribe(function(y){if(y)if(o.onImageLoaded(y),o.onConversationLoaded(y),y.recipient===o.g.senderId&&On(y))n.disposeWidget();else{if(y.sender!==o.g.senderId&&!xt(y)&&n.manageTabNotification(),!0===n.g.isOpen){if(n.g.setParameter("displayEyeCatcherCard","none"),o.logger.debug("[APP-COMP] obsChangeConversation ::: ",y),y.attributes&&"info"===y.attributes.subtype)return}else{n.lastConversation=y,n.g.isOpenNewMessage=!0,n.logger.debug("[APP-COMP] lastconversationnn",n.lastConversation);var j=n.conversationsHandlerService.countIsNew();n.g.setParameter("conversationsBadge",j)}n.triggerOnConversationUpdated(y)}else o.logger.debug("[APP-COMP] oBSconversationChanged null: errorrr")});o.subscriptions.push(t);var r=o.conversationsHandlerService.conversationAdded.subscribe(function(y){if(!0===n.g.isOpen&&y){if(n.g.setParameter("displayEyeCatcherCard","none"),n.triggerOnConversationUpdated(y),n.logger.debug("[APP-COMP] obsAddedConversation ::: ",y),y.attributes&&"info"===y.attributes.subtype)return;y.is_new&&n.manageTabNotification(),!1===o.g.isOpen&&(n.lastConversation=y,n.g.isOpenNewMessage=!0)}else{var j=n.conversationsHandlerService.countIsNew();n.g.setParameter("conversationsBadge",j)}y&&(o.onImageLoaded(y),o.onConversationLoaded(y))});o.subscriptions.push(r);var a=o.archivedConversationsService.archivedConversationAdded.subscribe(function(y){y&&(n.triggerOnConversationUpdated(y),o.onImageLoaded(y),o.onConversationLoaded(y))});o.subscriptions.push(a);var u=o.archivedConversationsService.archivedConversationRemoved.subscribe(function(y){y&&(o.isConversationArchived=!1,n.triggerOnConversationUpdated(y))});o.subscriptions.push(u)}),this.appStorageService.initialize(ce.storage_prefix,this.g.persistence,this.g.projectid),this.tiledeskAuthService.initialize(this.appConfigService.getConfig().apiUrl),this.tiledeskRequestsService.initialize(this.appConfigService.getConfig().apiUrl,this.g.projectid),this.messagingAuthService.initialize(),this.chatManager.initialize(),this.uploadService.initialize()},i.prototype.initWidgetParamiters=function(){var o=this,n=this,t=this.globalSettingsService.obsSettingsService.subscribe(function(r){r&&(o.logger.setLoggerConfig(o.g.isLogEnabled,o.g.logLevel),o.tabTitle=o.g.windowContext.window.document.title,o.appStorageService.initialize(ce.storage_prefix,o.g.persistence,o.g.projectid),o.logger.debug("[APP-COMP] check if token is passed throw url: ",o.g.jwt),o.g.jwt&&(o.logger.debug("[APP-COMP] ---------------- logging in with custom token from url ---------------- "),o.appStorageService.getItem("tiledeskToken")===o.g.jwt||o.appStorageService.setItem("tiledeskToken",o.g.jwt),o.g.tiledeskToken=o.g.jwt),o.translatorService.initI18n().then(function(u){o.logger.debug("[APP-COMP] \xbb\xbb\xbb\xbb APP-COMPONENT.TS initI18n result",u);var y=o.translatorService.getLanguage();xe.locale(y),o.translatorService.translate(o.g)}).then(function(){n.initAll(),n.triggerOnBeforeInit(),n.setAuthSubscription()}))});this.subscriptions.push(t),this.globalSettingsService.initWidgetParamiters(this.g,this.el),this.audio=new Audio,this.audio.src=this.g.baseLocation+"/assets/sounds/pling.mp3",this.audio.load()},i.prototype.initAll=function(){this.addComponentToWindow(this.ngZone),this.triggerHandler.setElement(this.el),this.triggerHandler.setWindowContext(this.g.windowContext);var o=this.setAttributesFromStorageService();o&&(this.g.attributes=o),this.setStyleMap(),this.settingsSaverService.initialize(),this.g.initialize(),this.removeFirebasewebsocketFromLocalStorage(),this.initLauncherButton(),this.triggerLoadParamsEvent()},i.prototype.setAuthSubscription=function(){var o=this;this.logger.debug("[APP-COMP] setLoginSubscription : ");var n=this,t=this.messagingAuthService.BSAuthStateChanged.subscribe(function(a){var u=o.appStorageService.getItem("tiledeskToken");u&&void 0!==u&&(n.g.tiledeskToken=u);var y=o.messagingAuthService.getToken();y&&void 0!==y&&(n.g.firebaseToken=y);var j=o.g.autoStart;if(n.stateLoggedUser=a,a&&"online"===a){var J=n.tiledeskAuthService.getCurrentUser();n.logger.info("[APP-COMP] ONLINE - LOGGED SUCCESSFULLY",J),n.g.setParameter("senderId",J.uid),n.g.setParameter("isLogged",!0),n.g.setParameter("attributes",n.setAttributesFromStorageService()),o.initConversationsHandler(o.g.tenant,n.g.senderId),n.g.singleConversation||n.startUI(),n.triggerOnAuthStateChanged(n.stateLoggedUser),n.logger.debug("[APP-COMP] 1 - IMPOSTO STATO CONNESSO UTENTE ",j),n.typingService.initialize(o.g.tenant),n.presenceService.initialize(o.g.tenant),n.presenceService.setPresence(J.uid),j&&!n.g.singleConversation&&n.showWidget()}else a&&"offline"===a&&(n.logger.info("[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: "),n.g.setParameter("isLogged",!1),n.hideWidget(),n.triggerOnAuthStateChanged(n.stateLoggedUser),j&&n.authenticate())});this.subscriptions.push(t);var r=this.messagingAuthService.BSSignOut.subscribe(function(a){!0===a&&(n.logger.debug("[APP-COMP] sono nel caso logout -1"),n.g.tiledeskToken=null,n.g.setParameter("isLogged",!1),n.g.setParameter("isOpenPrechatForm",!1),n.g.setParameter("userFullname",null),n.g.setParameter("userEmail",null),n.g.setAttributeParameter("userFullname",null),n.g.setAttributeParameter("userEmail",null),o.g.setAttributeParameter("preChatForm",null),o.g.setParameter("conversationsBadge",0),o.g.setParameter("recipientId",null,!1),n.hideWidget(),n.g.isLogout=!0,n.triggerOnAuthStateChanged("offline"))});this.subscriptions.push(r)},i.prototype.authenticate=function(){var o=this,n=this.g.tiledeskToken,t=this.appStorageService.getItem("currentUser");this.logger.debug("[APP-COMP] tiledesktokennn",n,t),n?(this.logger.debug("[APP-COMP] ---------------- 13 ---------------- "),this.logger.debug("[APP-COMP] ----------- sono gi\xe0 loggato ------- "),this.signInWithCustomToken(n)):(this.logger.debug("[APP-COMP] ---------------- 14 ---------------- "),this.logger.debug("[APP-COMP] authenticateFirebaseAnonymously"),this.tiledeskAuthService.signInAnonymously(this.g.projectid).then(function(r){o.messagingAuthService.createCustomToken(r);var a=o.tiledeskAuthService.getCurrentUser();if((a.firstname||a.lastname)&&!o.g.userFullname){var u=a.firstname+" "+a.lastname;o.g.setParameter("userFullname",u),o.g.setAttributeParameter("userFullname",u)}a.email&&!o.g.userEmail&&(o.g.setParameter("userEmail",a.email),o.g.setAttributeParameter("userEmail",a.email))}))},i.prototype.signInWithCustomToken=function(o){var n=this,t=this;return this.appStorageService.getItem("tiledeskToken")===o||this.appStorageService.removeItem("recipientId"),this.tiledeskAuthService.signInWithCustomToken(o).then(function(a){if(n.messagingAuthService.createCustomToken(o),n.logger.debug("[APP-COMP] signInWithCustomToken user::",a,n.g.userFullname),(a.firstname||a.lastname)&&!n.g.userFullname){var u=a.firstname+" "+a.lastname;n.g.setParameter("userFullname",u),n.g.setAttributeParameter("userFullname",u)}return a.email&&!n.g.userEmail&&(n.g.setParameter("userEmail",a.email),n.g.setAttributeParameter("userEmail",a.email)),Promise.resolve(a)}).catch(function(a){return n.logger.debug("[APP-COMP] signInWithCustomToken ERR ",a),t.signOut(),Promise.reject(a)})},i.prototype.signInAnonymous=function(){var o=this;return this.logger.debug("[APP-COMP] signInAnonymous"),this.tiledeskAuthService.signInAnonymously(this.g.projectid).then(function(n){o.messagingAuthService.createCustomToken(n);var t=o.tiledeskAuthService.getCurrentUser();if(t.firstname||t.lastname){var r=t.firstname+" "+t.lastname;o.g.setParameter("userFullname",r),o.g.setAttributeParameter("userFullname",r)}return t.email&&(o.g.setParameter("userEmail",t.email),o.g.setAttributeParameter("userEmail",t.email)),Promise.resolve(t)}).catch(function(n){return o.logger.error("[APP-COMP] signInAnonymous ERR",n),Promise.reject(n)})},i.prototype.startUI=function(){this.logger.debug("[APP-COMP] ============ startUI ===============");var o=this.g.departments,n=this.g.attributes,t=this.g.preChatForm;this.isOpenHome=!0,this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenSelectionDepartment=!1,this.isOpenAllConversation=!1;var r=this.appStorageService.getItem("recipientId");this.logger.debug("[APP-COMP] ============ idConversation ===============",r,this.g.recipientId),this.logger.debug("[APP-COMP] singleConversation conv da ...",this.g.recipientId),this.g.recipientId&&this.g.singleConversation?(this.logger.debug("[APP-COMP] singleConversation conv da API",this.g.recipientId),this.isOpenHome=!1,this.isOpenConversation=!0,this.isOpenSelectionDepartment=!1):!this.g.recipientId&&this.g.singleConversation?(this.logger.debug("[APP-COMP] singleConversation start new conv ",this.g.recipientId),this.isOpenHome=!1,this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.onNewConversation()):this.g.recipientId?(this.logger.debug("[APP-COMP] conv da urll",this.g.recipientId),this.g.isOpen&&(this.isOpenConversation=!0),this.g.setParameter("recipientId",this.g.recipientId),this.appStorageService.setItem("recipientId",this.g.recipientId)):r?(this.logger.debug("[APP-COMP] conv da storagee",r),this.g.isOpen&&(this.isOpenConversation=!0),this.g.recipientId=r,this.g.setParameter("recipientId",r)):this.g.startFromHome?(this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenSelectionDepartment=!1):!t||n&&n.userFullname&&n.userEmail?(this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,o.length>1&&null==!this.g.departmentID?this.isOpenSelectionDepartment=!0:(this.isOpenConversation=!1,!this.g.recipientId&&this.g.isOpen&&this.onNewConversation())):(this.g.setParameter("isOpenPrechatForm",!0),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,o.length>1&&null==this.g.departmentID&&(this.isOpenSelectionDepartment=!0)),this.triggerOnViewInit(),this.g.setParentBodyStyleMobile(this.g.isOpen,this.g.isMobile),this.g.setElementStyle(this.g.isOpen)},i.prototype.generateNewUidConversation=function(){return this.logger.debug("[APP-COMP] generateUidConversation **************: senderId= ",this.g.senderId),dn+this.g.projectid+"-"+(0,Ne.Z)().replace(/-/g,"")},i.prototype.startNewConversation=function(){this.logger.debug("[APP-COMP] AppComponent::startNewConversation");var o=this.generateNewUidConversation();this.g.setParameter("recipientId",o),this.appStorageService.setItem("recipientId",o),this.logger.debug("[APP-COMP] recipientId: ",this.g.recipientId),this.isConversationArchived=!1,this.triggerNewConversationEvent(o)},i.prototype.setAttributesFromStorageService=function(){var o={};try{o=JSON.parse(this.appStorageService.getItem("attributes"))}catch(J){this.logger.debug("[APP-COMP] > Error setAttributesFromStorageService:"+J)}var n=navigator.userAgent,t=this.g.projectid,r=this.g.userEmail,a=this.g.userFullname,u=this.g.senderId,y=this.g.BUILD_VERSION;!o&&null===o&&(o=this.g.attributes?this.g.attributes:{}),n&&(o.client=n),location.href&&(o.sourcePage=location.href),t&&(o.projectId=t),r&&(o.userEmail=r),a&&(o.userFullname=a),u&&(o.requester_id=u),y&&(o.widgetVer=y);try{o.payload=[],this.g.customAttributes&&(o.payload=this.g.customAttributes)}catch(J){this.logger.debug("[APP-COMP] > Error is handled payload: ",J)}try{var j=o.preChatForm;j&&j.userEmail&&(this.g.userEmail=j.userEmail),j&&j.userFullname&&(this.g.userFullname=j.userFullname)}catch(J){this.logger.debug("[APP-COMP] > Error is handled preChatForm: ",J)}return this.appStorageService.setItem("attributes",JSON.stringify(o)),o},i.prototype.initConversationsHandler=function(o,n){this.logger.debug("[APP-COMP] initialize: ListConversationsComponent");var r=this.translateService.translateLanguage(["YOU"]);this.listConversations=[],this.archivedConversations=[],this.logger.debug("[APP-COMP] senderId: ",n),this.logger.debug("[APP-COMP] tenant: ",o),this.conversationsHandlerService.initialize(o,n,r),this.archivedConversationsService.initialize(o,n,r),this.g.singleConversation&&this.g.isOpen?this.manageWidgetSingleConversation():this.g.singleConversation&&!this.g.isOpen&&this.showWidget(),this.conversationsHandlerService.subscribeToConversations(function(){}),this.archivedConversationsService.subscribeToConversations(function(){}),this.listConversations=this.conversationsHandlerService.conversations,this.archivedConversations=this.archivedConversationsService.archivedConversations,this.chatManager.setConversationsHandler(this.conversationsHandlerService),this.chatManager.setArchivedConversationsHandler(this.archivedConversationsService),this.logger.debug("[APP-COMP] this.listConversations.length",this.listConversations.length),this.logger.debug("[APP-COMP] this.listConversations appcomponent",this.listConversations,this.archivedConversations)},i.prototype.initConversationHandler=function(o){var n=this.g.tenant,r=this.translateService.translateLanguage(["INFO_SUPPORT_USER_ADDED_SUBJECT","INFO_SUPPORT_USER_ADDED_YOU_VERB","INFO_SUPPORT_USER_ADDED_COMPLEMENT","INFO_SUPPORT_USER_ADDED_VERB","INFO_SUPPORT_CHAT_REOPENED","INFO_SUPPORT_CHAT_CLOSED","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU","INFO_SUPPORT_LEAD_UPDATED","INFO_SUPPORT_MEMBER_LEFT_GROUP","LABEL_TODAY","LABEL_TOMORROW","LABEL_LOADING","LABEL_TO","ARRAY_DAYS"]),a={uid:this.g.senderId},u=this.g.recipientFullname,y=this.chatManager.getConversationHandlerByConversationId(o);if(this.logger.debug("[APP-COMP] DETTAGLIO CONV - handler **************",y,o),!y){var j=this.conversationHandlerBuilderService.build();j.initialize(o,u,a,n,r),this.logger.debug("[APP-COMP] DETTAGLIO CONV - NEW handler **************",j),this.chatManager.addConversationHandler(j),y=j}return y},i.prototype.initLauncherButton=function(){this.isInitialized=!0,this.marginBottom=+this.g.marginY+70},i.prototype.manageWidgetSingleConversation=function(){var o=this;if(this.g.recipientId)return this.appStorageService.setItem("recipientId",this.g.recipientId),void new Promise(function(n,t){o.startUI(),n("ok")}).then(function(n){o.showWidget()});this.conversationsHandlerService.getLastConversation(function(n,t){if(o.logger.debug("[APP-COMP] getConverationRESTApi: conversation from rest API --\x3e ",n),t&&o.logger.error("[APP-COMP] getConverationRESTApi: ERORR while retriving data",t),n){var r=n.uid;o.g.setParameter("recipientId",r),o.appStorageService.setItem("recipientId",r)}else o.logger.debug("[APP-COMP] getConverationRESTApi: NO active conversations");new Promise(function(a,u){o.startUI(),a("ok")}).then(function(a){o.showWidget()})})},i.prototype.signOut=function(){if(this.logger.debug("[APP-COMP] SIGNOUT"),!0===this.g.isLogged)return this.logger.debug("[APP-COMP] prima ero loggato allora mi sloggo!"),this.g.setIsOpen(!1),this.appStorageService.clear(),this.presenceService.removePresence(),this.tiledeskAuthService.logOut(),this.messagingAuthService.logout()},i.prototype.showWidget=function(){this.logger.debug("[APP-COMP] show widget--\x3e autoStart:",this.g.autoStart,"startHidden",this.g.startHidden,"isShown",this.g.isShown);var o=this.g.startHidden,n=this.g.windowContext.document.getElementById("tiledesk-container");n&&!1===o?(n.style.display="block",this.g.setParameter("isShown",!0,!0)):(this.g.startHidden=!1,this.g.setParameter("isShown",!1,!0))},i.prototype.hideWidget=function(){var o=this.g.windowContext.document.getElementById("tiledesk-container");o&&(o.style.display="none"),this.g.setParameter("isShown",!1,!0)},i.prototype.disposeWidget=function(){var o=this.g.windowContext.document.getElementById("tiledesk-container");o&&o.remove()},i.prototype.sendMessage=function(o){var t=o.senderId,r=o.senderFullname,a=o.message,u=o.type,y=o.metadata,j=o.recipientId,J=o.recipientFullname,ie=o.attributes,ge=o.channelType;this.logger.debug("[APP-COMP] sendMessage from window.tiledesk *********** ",o.tenant,t,r,a,u,y,j,J,ie,o.projectid,ge),this.initConversationHandler(j).sendMessage(a,u,y,j,J,t,r,ge,ie)},i.prototype.setPreChatForm=function(o){null!=o&&(this.g.setParameter("preChatForm",o),!0===o?this.appStorageService.setItem("preChatForm",o):this.appStorageService.removeItem("preChatForm"))},i.prototype.setPreChatFormJson=function(o){o&&this.g.setParameter("preChatFormJson",o),this.logger.debug("[APP-COMP] setPreChatFormJson from external",o)},i.prototype.getPreChatFormJson=function(){var o={};return this.g.preChatFormJson&&(o=this.g.preChatFormJson),this.logger.debug("[APP-COMP] getPreChatFormJson from external",o),o},i.prototype.setPrivacyPolicy=function(){this.g.privacyApproved=!0,this.g.setAttributeParameter("privacyApproved",this.g.privacyApproved),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes)),this.g.setParameter("preChatForm",!1),this.appStorageService.removeItem("preChatForm")},i.prototype.reInit=function(){this.tiledeskAuthService.getCurrentUser()?(this.tiledeskAuthService.logOut(),this.messagingAuthService.logout(),this.logger.debug("[APP-COMP] sono nel caso reinit -2"),this.g.setParameter("isLogged",!1),this.hideWidget(),this.appStorageService.removeItem("tiledeskToken"),this.g.isLogout=!0,!1!==this.g.autoStart&&(this.authenticate(),this.initAll()),this.appStorageService.clear()):this.logger.debug("[APP-COMP] reInit ma NON SONO LOGGATO!");var o=this.g.windowContext.document.getElementsByTagName("chat-root")[0];this.g.windowContext.document.getElementById("tiledesk-container").remove(),o.remove(),this.g.windowContext.initWidget()},i.prototype.restart=function(){this.hideWidget(),!1!==this.g.autoStart&&(this.authenticate(),this.initAll());var o=this.g.windowContext.document.getElementsByTagName("chat-root")[0];this.g.windowContext.document.getElementById("tiledesk-container").remove(),o.remove(),this.g.windowContext.initWidget()},i.prototype.logout=function(){return this.signOut()},i.prototype.showCallout=function(){!1===this.g.isOpen&&(this.eyeeyeCatcherCardComponent.openEyeCatcher(),this.g.setParameter("displayEyeCatcherCard","block"),this.triggerOnOpenEyeCatcherEvent())},i.prototype.f21_open=function(){var o=this.g.senderId;this.logger.debug("[APP-COMP] f21_open senderId: ",o),o&&(this.g.setParameter("displayEyeCatcherCard","none"),this.g.setIsOpen(!0),this.isInitialized=!0,this.appStorageService.setItem("isOpen","true"),this.triggerOnOpenEvent())},i.prototype.f21_close=function(){this.g.setIsOpen(!1),this.g.isOpenNewMessage=!1,this.appStorageService.setItem("isOpen","false"),this.triggerOnCloseEvent()},i.prototype._f21_open=function(){this.g.setParameter("displayEyeCatcherCard","none"),this.g.setIsOpen(!0),this.appStorageService.setItem("isOpen","true"),this.triggerOnOpenEvent()},i.prototype.setParameter=function(o){this.g.setParameter(o.key,o.value)},i.prototype.setAttributeParameter=function(o){this.g.setAttributeParameter(o.key,o.value)},i.prototype.removeFirebasewebsocketFromLocalStorage=function(){this.logger.debug("[APP-COMP] ---------------- A1 ---------------- "),rt()&&this.appStorageService.removeItem("firebase:previous_websocket_failure")},i.prototype.addComponentToWindow=function(o){var t=this.g.windowContext;t&&t.tiledesk&&(t.tiledesk.angularcomponent={component:this,ngZone:o},t.tiledesk.signInWithCustomToken=function(r){return o.run(function(){return t.tiledesk.angularcomponent.component.signInWithCustomToken(r)})},t.tiledesk.signInAnonymous=function(){return o.run(function(){return t.tiledesk.angularcomponent.component.signInAnonymous()})},t.tiledesk.show=function(){o.run(function(){t.tiledesk.angularcomponent.component.showWidget()})},t.tiledesk.hide=function(){o.run(function(){t.tiledesk.angularcomponent.component.hideWidget()})},t.tiledesk.dispose=function(){o.run(function(){t.tiledesk.angularcomponent.component.disposeWidget()})},t.tiledesk.close=function(){o.run(function(){t.tiledesk.angularcomponent.component.f21_close()})},t.tiledesk.open=function(){o.run(function(){t.tiledesk.angularcomponent.component.f21_open()})},t.tiledesk.setPreChatForm=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setPreChatForm(r)})},t.tiledesk.setPrivacyPolicy=function(){o.run(function(){t.tiledesk.angularcomponent.component.setPrivacyPolicy()})},t.tiledesk.sendMessage=function(r){var a,u,y,j,J=t.tiledesk.angularcomponent.component.g,ie=r.tenant?r.tenant:null,ue=r.senderId?r.senderId:null,ge=r.senderFullname?r.senderFullname:null,de=r.message?r.message:null,ve=r.type?r.type:null,Te=r.metadata?r.metadata:null,ke=r.recipientId?r.recipientId:null,Ae=r.recipientFullname?r.recipientFullname:null,Be=r.attributes?r.attributes:null,Ze=r.projectid?r.projectid:null,ze=r.channelType?r.channelType:null;ie||(ie=J.tenant),ue||(ue=J.senderId),ge||(ge=J.senderFullname),de||(de="hello"),ve||(ve="text"),Te||(Te=""),ke||(ke=J.recipientId),Ae||(Ae=J.recipientFullname),Ze||(Ze=J.projectId),(!ze||void 0===ze)&&(ze="group");var je=J.attributes,Ye={};if(je)try{for(var Ge=(0,_e.XA)(Object.entries(je)),qe=Ge.next();!qe.done;qe=Ge.next()){var ot=(0,_e.CR)(qe.value,2);Ye[ot[0]]=ot[1]}}catch(sn){a={error:sn}}finally{try{qe&&!qe.done&&(u=Ge.return)&&u.call(Ge)}finally{if(a)throw a.error}}if(Be)try{for(var et=(0,_e.XA)(Object.entries(Be)),wt=et.next();!wt.done;wt=et.next()){var oo=(0,_e.CR)(wt.value,2);Ye[oo[0]]=oo[1]}}catch(sn){y={error:sn}}finally{try{wt&&!wt.done&&(j=et.return)&&j.call(et)}finally{if(y)throw y.error}}o.run(function(){t.tiledesk.angularcomponent.component.sendMessage({tenant:ie,senderId:ue,senderFullname:ge,message:de,type:ve,metadata:Te,recipientId:ke,recipientFullname:Ae,attributes:Ye,projectid:Ze,channel_type:ze})})},t.tiledesk.sendSupportMessage=function(r){var a,u,y,j,J=t.tiledesk.angularcomponent.component.g,ie=r.message?r.message:null,ue=r.recipientId?r.recipientId:null,ge=r.recipientFullname?r.recipientFullname:null,de=r.type?r.type:null,ve=r.metadata?r.metadata:null,Te=r.attributes?r.attributes:null;ie||(ie="hello"),ue||(ue=J.recipientId),de||(de="text"),ve||(ve={});var ke=J.attributes,Ae={};if(ke)try{for(var Be=(0,_e.XA)(Object.entries(ke)),Ze=Be.next();!Ze.done;Ze=Be.next()){var ze=(0,_e.CR)(Ze.value,2);Ae[ze[0]]=ze[1]}}catch(tt){a={error:tt}}finally{try{Ze&&!Ze.done&&(u=Be.return)&&u.call(Be)}finally{if(a)throw a.error}}if(Te)try{for(var Ge=(0,_e.XA)(Object.entries(Te)),qe=Ge.next();!qe.done;qe=Ge.next()){var ot=(0,_e.CR)(qe.value,2);Ae[ot[0]]=ot[1]}}catch(tt){y={error:tt}}finally{try{qe&&!qe.done&&(j=Ge.return)&&j.call(Ge)}finally{if(y)throw y.error}}o.run(function(){t.tiledesk.angularcomponent.component.sendMessage({tenant:J.tenant,senderId:J.senderId,senderFullname:J.userFullname,message:ie,type:de,metadata:ve,recipientId:ue,recipientFullname:ge,attributes:Ae,projectid:J.projectid,channelType:J.channelType})})},t.tiledesk.reInit=function(){o.run(function(){t.tiledesk.angularcomponent.component.reInit()})},t.tiledesk.restart=function(){o.run(function(){t.tiledesk.angularcomponent.component.restart()})},t.tiledesk.logout=function(){return o.run(function(){return t.tiledesk.angularcomponent.component.logout()})},t.tiledesk.showCallout=function(){o.run(function(){t.tiledesk.angularcomponent.component.showCallout()})},t.tiledesk.setPreChatFormJson=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setPreChatFormJson(r)})},t.tiledesk.getPreChatFormJson=function(){var r={};return o.run(function(){r=t.tiledesk.angularcomponent.component.getPreChatFormJson()}),r},t.tiledesk.setParameter=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setParameter(r)})},t.tiledesk.setAttributeParameter=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setAttributeParameter(r)})})},i.prototype.visibilitychange=function(){document.hidden?this.isTabVisible=!1:(clearInterval(this.setIntervalTime),this.setIntervalTime=null,this.isTabVisible=!0,this.g.windowContext.window.document.title=this.tabTitle)},i.prototype.manageTabNotification=function(){if(!this.isTabVisible){var o=this.conversationsHandlerService.countIsNew();this.logger.debug("[APP-COMP] badgeNewConverstionNumber::",o),o>0||(o=1),this.g.windowContext.window.document.title="("+o+") "+this.tabTitle,clearInterval(this.setIntervalTime);var n=this;this.setIntervalTime=window.setInterval(function(){n.g.windowContext.window.document.title="("===n.g.windowContext.window.document.title.charAt(0)?n.tabTitle:"("+o+") "+n.tabTitle},1e3)}this.soundMessage()},i.prototype.soundMessage=function(){var o=this,n=this;this.g.soundEnabled&&(this.logger.debug("[APP-COMP] ****** soundMessage *****",this.audio),this.audio.pause(),this.audio.currentTime=0,clearTimeout(this.setTimeoutSound),this.setTimeoutSound=setTimeout(function(){n.audio.play().then(function(){o.logger.debug("[APP-COMP] ****** soundMessage played *****")}).catch(function(r){o.logger.debug("[APP-COMP] ***soundMessage error*",r)})},1e3))},i.prototype.onCloseWidget=function(){this.isOpenConversation=!1;var o=this.conversationsHandlerService.countIsNew();this.g.setParameter("conversationsBadge",o),this.logger.debug("[APP-COMP] widgetclosed:::",this.g.conversationsBadge,this.conversationsHandlerService.countIsNew()),this.f21_close()},i.prototype.onOpenCloseWidget=function(o){this.g.setParameter("displayEyeCatcherCard","none");var n=this.appStorageService.getItem("recipientId");this.g.setParameter("recipientId",n),this.logger.debug("[APP-COMP] openCloseWidget",n,this.g.isOpen,this.g.startFromHome),!1===this.g.isOpen?(n?(this.isOpenHome=!1,this.isOpenConversation=!0,this.startUI()):this.g.singleConversation?(this.isOpenHome=!1,this.g.setParameter("isOpenPrechatForm",!1),this.manageWidgetSingleConversation()):this.g.startFromHome?(this.isOpenHome=!0,this.isOpenConversation=!1):(this.isOpenHome=!1,this.isOpenConversation=!0,this.onNewConversation()),this.triggerOnOpenEvent()):this.triggerOnCloseEvent(),this.g.setIsOpen(!this.g.isOpen),this.appStorageService.setItem("isOpen",this.g.isOpen)},i.prototype.onDepartmentSelected=function(o){var n=this;o&&(this.logger.debug("[APP-COMP] onSelectDepartment: ",o),this.g.setParameter("departmentSelected",o),!1===this.g.isOpenPrechatForm&&(this.isOpenSelectionDepartment=!1,this.isOpenConversation=!0,setTimeout(function(){n.isOpenHome=!1},0),this.startNewConversation()))},i.prototype.onCloseModalDepartment=function(){this.g.singleConversation?this.onCloseWidget():(this.logger.debug("[APP-COMP] returnCloseModalDepartment"),this.isOpenHome=!0,this.isOpenSelectionDepartment=!1,this.isOpenConversation=!1)},i.prototype.onPrechatFormComplete=function(){this.logger.debug("[APP-COMP] onPrechatFormComplete"),this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),!1===this.g.isOpenPrechatForm&&!1===this.isOpenSelectionDepartment&&(this.isOpenConversation=!0,this.startNewConversation())},i.prototype.onCloseModalPrechatForm=function(){this.logger.debug("[APP-COMP] onCloseModalPrechatForm"),this.g.singleConversation?this.onCloseWidget():(this.isOpenHome=!0,this.isOpenSelectionDepartment=!1,this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.g.newConversationStart=!1)},i.prototype.onSoundChange=function(o){this.g.setParameter("soundEnabled",o)},i.prototype.onMenuOptionSignOut=function(){this.logger.debug("[APP-COMP] onMenuOptionSignOut"),this.signOut(),this.isOpenConversation=!1},i.prototype.onSelectedConversation=function(o){o&&(!1===this.g.isOpen&&this._f21_open(),o.channel_type===W?(this.g.setParameter("recipientId",o.sender),this.appStorageService.setItem("recipientId",o.sender)):(this.g.setParameter("recipientId",o.recipient),this.appStorageService.setItem("recipientId",o.recipient)),this.isOpenConversation=!0,this.isConversationArchived=!!o.archived&&o.archived,this.logger.debug("[APP-COMP] onSelectConversation in APP COMPONENT: ",o))},i.prototype.onNewConversation=function(){this.logger.debug("[APP-COMP] returnNewConversation in APP COMPONENT"),this.g.newConversationStart=!0;var o=this.g.preChatForm,n=this.g.attributes,t=this.g.departments;this.logger.debug("[APP-COMP] attributesssss",this.g.attributes,this.g.preChatForm),!o||n&&n.userFullname&&n.userEmail?(this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,t&&t.length>1&&null==this.g.departmentID?this.isOpenSelectionDepartment=!0:this.isOpenConversation=!0):(this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!0),this.isOpenSelectionDepartment=!1,t&&t.length>1&&null==this.g.departmentID&&(this.isOpenSelectionDepartment=!0)),this.logger.debug("[APP-COMP] isOpenPrechatForm",this.g.isOpenPrechatForm," isOpenSelectionDepartment:",this.isOpenSelectionDepartment),!1===this.g.isOpenPrechatForm&&!1===this.isOpenSelectionDepartment&&this.startNewConversation()},i.prototype.onOpenAllConversation=function(){this.isOpenHome=!0,this.isOpenConversation=!1,this.isOpenAllConversation=!0},i.prototype.onOpenChatEyeEyeCatcherCard=function(){this.f21_open()},i.prototype.onCloseEyeCatcherCard=function(o){!0===o?this.triggerOnOpenEyeCatcherEvent():this.triggerOnClosedEyeCatcherEvent()},i.prototype.onBackConversation=function(){this.logger.debug("[APP-COMP] onCloseConversation"),this.appStorageService.removeItem("recipientId"),this.g.setParameter("recipientId",null,!1),this.isOpenHome=!0,this.isOpenAllConversation=!1,this.isOpenConversation=!1},i.prototype.onConversationClosed=function(o){this.g.singleConversation||this.onBackConversation()},i.prototype.onNewConversationButtonClicked=function(o){this.logger.debug("[APP-COMP] onNewConversationButtonClicked"),this.isOpenConversation=!1,this.g.singleConversation&&(this.isOpenHome=!1),this.onNewConversation()},i.prototype.onCloseAllConversation=function(){var o=this;this.logger.debug("[APP-COMP] Close all conversation");var n=this.isOpenHome,t=this.isOpenConversation;this.isOpenHome=!1,this.isOpenConversation=!1,setTimeout(function(){o.isOpenHome=n,o.isOpenConversation=t,o.isOpenAllConversation=!1},200)},i.prototype.onAfterMessageSent=function(o){this.triggerHandler.triggerAfterSendMessageEvent(o),this.isSentMessage=!0},i.prototype.onImageLoaded=function(o){this.logger.debug("[APP-COMP] onLoadImage convvvv:::",o),o.image=this.imageRepoService.getImagePhotoUrl(o.sender)},i.prototype.onConversationLoaded=function(o){this.logger.debug("[APP-COMP] onConversationLoaded convvvv:::",o);var t=this.translateService.translateLanguage(["YOU","SENT_AN_IMAGE","SENT_AN_ATTACHMENT"]);if(o.sender===this.g.senderId){if(o.type===I){this.logger.log("[CONVS-LIST-PAGE] HAS SENT AN IMAGE");var r=o.last_message_text=t.get("SENT_AN_IMAGE");o.last_message_text=r}else if(o.type===$){this.logger.log("[CONVS-LIST-PAGE] HAS SENT FILE");var a=o.last_message_text=t.get("SENT_AN_ATTACHMENT");o.last_message_text=a}}else o.type===I?(this.logger.log("[CONVS-LIST-PAGE] HAS SENT AN IMAGE"),r=o.last_message_text=t.get("SENT_AN_IMAGE"),o.last_message_text=r):o.type===$&&(this.logger.log("[CONVS-LIST-PAGE] HAS SENT FILE"),a=o.last_message_text=t.get("SENT_AN_ATTACHMENT"),o.last_message_text=a)},i.prototype.onSignOut=function(){this.signOut()},i.prototype.onCloseModalRateChat=function(){!this.g.singleConversation&&this.g.nativeRating&&(this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.g.setParameter("isOpenStartRating",!1),this.onBackConversation())},i.prototype.onRateChatComplete=function(){!this.g.singleConversation&&this.g.nativeRating&&(this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.g.setParameter("isOpenStartRating",!1),this.onBackConversation())},i.prototype.triggerOnBeforeInit=function(){var o={global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnBeforeInit(o)},i.prototype.triggerOnViewInit=function(){var o={global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnViewInit(o)},i.prototype.triggerOnOpenEvent=function(){this.triggerHandler.triggerOnOpenEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnCloseEvent=function(){this.triggerHandler.triggerOnCloseEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnOpenEyeCatcherEvent=function(){this.triggerHandler.triggerOnOpenEyeCatcherEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnClosedEyeCatcherEvent=function(){this.triggerHandler.triggerOnClosedEyeCatcherEvent()},i.prototype.triggerOnAuthStateChanged=function(o){var n={event:o,isLogged:this.g.isLogged,user_id:this.g.senderId,global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnAuthStateChanged(n)},i.prototype.triggerNewConversationEvent=function(o){var n={global:this.g,default_settings:this.g.default_settings,newConvId:o,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerNewConversationEvent(n)},i.prototype.triggerLoadParamsEvent=function(){this.triggerHandler.triggerLoadParamsEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnConversationUpdated=function(o){this.triggerHandler.triggerOnConversationUpdated(o)},i.prototype.triggerOnCloseMessagePreview=function(){this.triggerHandler.triggerOnCloseMessagePreview()},i.prototype.setStyleMap=function(){this.styleMapConversation.set("foregroundColor",this.g.themeForegroundColor),this.styleMapConversation.set("themeColor",this.g.themeColor),this.styleMapConversation.set("colorGradient",this.g.colorGradient180),this.styleMapConversation.set("bubbleSentBackground",this.g.bubbleSentBackground),this.styleMapConversation.set("bubbleSentTextColor",this.g.bubbleSentTextColor),this.styleMapConversation.set("bubbleReceivedBackground",this.g.bubbleReceivedBackground),this.styleMapConversation.set("bubbleReceivedTextColor",this.g.bubbleReceivedTextColor),this.styleMapConversation.set("fontSize",this.g.fontSize),this.styleMapConversation.set("fontFamily",this.g.fontFamily),this.styleMapConversation.set("buttonFontSize",this.g.buttonFontSize),this.styleMapConversation.set("buttonBackgroundColor",this.g.buttonBackgroundColor),this.styleMapConversation.set("buttonTextColor",this.g.buttonTextColor),this.styleMapConversation.set("buttonHoverBackgroundColor",this.g.buttonHoverBackgroundColor),this.styleMapConversation.set("buttonHoverTextColor",this.g.buttonHoverTextColor),this.styleMapConversation.set("iconColor","#5f6368"),this.el.nativeElement.style.setProperty("--button-in-msg-background-color",this.g.bubbleSentBackground),this.el.nativeElement.style.setProperty("--button-in-msg-font-size",this.g.buttonFontSize)},i.prototype.ngOnDestroy=function(){this.logger.debug("[APP-COMP] this.subscriptions",this.subscriptions);var o=this.g.windowContext;o&&o.tiledesk&&(o.tiledesk.angularcomponent=null,this.g.windowContext=o),this.unsubscribe()},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.logger.debug("[APP-COMP] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq),e.Y36(e.R0b),e.Y36(Re),e.Y36(xn),e.Y36(En),e.Y36(Tn),e.Y36(Fe),e.Y36(He),e.Y36(Gt),e.Y36(ut),e.Y36(Tt),e.Y36(Jt),e.Y36(Pn),e.Y36(St),e.Y36(mt),e.Y36(vt),e.Y36(Ct),e.Y36(st),e.Y36(ht),e.Y36(Pt),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-root"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(yn,5),2&n)&&(e.iGM(r=e.CRH())&&(t.eyeeyeCatcherCardComponent=r.first))},hostBindings:function(n,t){1&n&&e.NdJ("visibilitychange",function(){return t.visibilitychange()},!1,e.evT)},decls:11,vars:23,consts:[["id","tiledesk-container","tabindex","9999"],["id","chat21-conversations",3,"ngClass","ngStyle"],["class","modal-page active",4,"ngIf"],["class","modal-page selection-department active",4,"ngIf"],["class","modal-page prechat-form active",4,"ngIf"],["class","modal-page star-rating-widget active",4,"ngIf"],[3,"onOpenChat","onCloseEyeCatcherCard",4,"ngIf"],[4,"ngIf"],[3,"onButtonClicked",4,"ngIf"],[1,"modal-page","active"],[3,"listConversations","archivedConversations","hideSettings","stylesMap","onNewConversation","onConversationSelected","onOpenAllConvesations","onCloseWidget","onSignOut","onImageLoaded","onConversationLoaded"],[3,"listConversations","archivedConversations","stylesMap","onCloseWidget","onConversationSelected"],[3,"senderId","conversationId","isOpen","isConversationArchived","stylesMap","onBackHome","onCloseWidget","onSoundChange","onConversationClosed","onSignOut","onNewConversationButtonClicked","onBeforeMessageSent","onAfterSendMessage","onNewMessageCreated","onNewConversationInit","onBeforeMessageRender","onAfterMessageRender"],[1,"modal-page","selection-department","active"],[3,"onBeforeDepartmentsFormRender","onClose","onDepartmentSelected"],[1,"modal-page","prechat-form","active"],[3,"stylesMap","onClosePage","onCloseForm"],[1,"modal-page","star-rating-widget","active"],[3,"recipientId","stylesMap","onClosePage","onCloseRate"],[3,"onOpenChat","onCloseEyeCatcherCard"],[3,"conversation","baseLocation","stylesMap","onCloseMessagePreview","onSelectedConversation"],[3,"onButtonClicked"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Lo,2,4,"div",2),e.YNc(3,No,2,3,"div",2),e.YNc(4,Fo,2,5,"div",2),e.YNc(5,Bo,2,0,"div",3),e.YNc(6,Uo,2,1,"div",4),e.YNc(7,Zo,2,2,"div",5),e.qZA(),e.YNc(8,Do,1,0,"chat-eyeeye-catcher-card",6),e.YNc(9,Ho,2,3,"div",7),e.YNc(10,zo,1,0,"chat-launcher-button",8),e.qZA()),2&n&&(e.ekj("active",t.g.isShown),e.xp6(1),e.Q6J("ngClass",e.l5B(13,jo,!0===t.g.isOpen,!0===t.g.fullscreenMode,"left"===t.g.align,"left"!==t.g.align))("ngStyle",e.l5B(18,qo,1==t.g.isOpen?"block":"none",t.g.marginY+"px","left"===t.g.align?t.g.marginX+"px":"","right"===t.g.align?t.g.marginX+"px":"")),e.xp6(1),e.Q6J("ngIf",t.isOpenHome&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenAllConversation&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenConversation&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenSelectionDepartment),e.xp6(1),e.Q6J("ngIf",t.g.isOpenPrechatForm&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.g.isOpenStartRating),e.xp6(1),e.Q6J("ngIf",t.g.senderId),e.xp6(1),e.Q6J("ngIf",!t.g.isOpen),e.xp6(1),e.Q6J("ngIf",t.isInitialized))},styles:['@import"https://fonts.googleapis.com/css?family=Google+Sans:200,400,800";@import"https://fonts.googleapis.com/css?family=Roboto:400,700,300|Material+Icons";@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,400;0,700;1,300;1,400";@-webkit-keyframes modal-active-in{0%{left:100%;opacity:0}to{background-color:$trasp-black;opacity:1;left:0px}}@keyframes modal-active-in{0%{left:100%;opacity:0}to{background-color:$trasp-black;opacity:1;left:0px}}@-webkit-keyframes modal-active-out{0%{left:0%;opacity:1;display:block}99%{display:block}to{opacity:0;left:100%;display:none}}@keyframes modal-active-out{0%{opacity:1;left:0px;display:block}99%{display:block}to{left:100%;opacity:0;display:none}}@-webkit-keyframes slide-out-right{0%{transform:translate(0);opacity:1}99%{transform:translate(1000px);opacity:0}to{transform:translate(1000px);opacity:0}}@keyframes slide-out-right{0%{transform:translate(0);opacity:1}99%{transform:translate(1000px);opacity:0}to{transform:translate(1000px);opacity:0}}@-webkit-keyframes rotate-scale-up{0%{transform:scale(1) rotate(0)}50%{transform:scale(1.6) rotate(180deg)}to{transform:scale(1) rotate(360deg)}}@keyframes rotate-scale-up{0%{transform:scale(1) rotate(0)}50%{transform:scale(1.6) rotate(180deg)}to{transform:scale(1) rotate(360deg)}}@-webkit-keyframes swirl-in-bck{0%{transform:rotate(540deg) scale(5);opacity:0}to{transform:rotate(0) scale(1);opacity:1}}@keyframes swirl-in-bck{0%{transform:rotate(540deg) scale(5);opacity:0}to{transform:rotate(0) scale(1);opacity:1}}@-webkit-keyframes jello-horizontal{0%{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}to{transform:scale(1)}}@keyframes jello-horizontal{0%{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}to{transform:scale(1)}}@-webkit-keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}@-webkit-keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@-webkit-keyframes swing-in-bottom-fwd{0%{transform:rotateX(100deg);transform-origin:bottom;opacity:0}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@keyframes swing-in-bottom-fwd{0%{transform:rotateX(100deg);transform-origin:bottom;opacity:0}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@keyframes fade{0%{transform:rotateX(0);transform-origin:bottom;opacity:0}50%{transform:rotateX(0);transform-origin:bottom;opacity:.5}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@-webkit-keyframes fade{0%{transform:rotateX(0);transform-origin:bottom;opacity:0}50%{transform:rotateX(0);transform-origin:bottom;opacity:.5}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@-webkit-keyframes heartbeat{0%{transform:scale(1);transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}10%{transform:scale(.91);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}17%{transform:scale(.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}33%{transform:scale(.87);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}45%{transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes heartbeat{0%{transform:scale(1);transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}10%{transform:scale(.91);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}17%{transform:scale(.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}33%{transform:scale(.87);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}45%{transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@-webkit-keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}@-webkit-keyframes fade-in-dw-up{0%{display:none;transform:translateY(50px);opacity:0}1%{display:block;transform:translateY(50px);opacity:0}to{display:block;transform:translateY(0);opacity:1}}@keyframes fade-in-dw-up{0%{display:none;transform:translateY(50px);opacity:0}1%{display:block;transform:translateY(50px);opacity:0}to{display:block;transform:translateY(0);opacity:1}}@-webkit-keyframes slide-in-right{0%{transform:translate(1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@keyframes slide-in-right{0%{transform:translate(1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-1000px);opacity:0}99%{-webkit-transform:translateX(0);opacity:1}to{-webkit-transform:translateX(0);opacity:1}}@keyframes slide-in-left{0%{transform:translate(-1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@-webkit-keyframes slideIn{0%{transform:translate(-900px)}to{transform:translate(0)}}@keyframes slideIn{0%{transform:translate(-900px)}to{transform:translate(0)}}.hvr-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-grow:hover,.hvr-grow:focus,.hvr-grow:active{transform:scale(1.1)}.hvr-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-shrink:hover,.hvr-shrink:focus,.hvr-shrink:active{transform:scale(.9)}@-webkit-keyframes hvr-pulse{25%{transform:scale(1.1)}75%{transform:scale(.9)}}@keyframes hvr-pulse{25%{transform:scale(1.1)}75%{transform:scale(.9)}}.hvr-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse:hover,.hvr-pulse:focus,.hvr-pulse:active{-webkit-animation-name:hvr-pulse;animation-name:hvr-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-pulse-grow{to{transform:scale(1.1)}}@keyframes hvr-pulse-grow{to{transform:scale(1.1)}}.hvr-pulse-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse-grow:hover,.hvr-pulse-grow:focus,.hvr-pulse-grow:active{-webkit-animation-name:hvr-pulse-grow;animation-name:hvr-pulse-grow;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-pulse-shrink{to{transform:scale(.9)}}@keyframes hvr-pulse-shrink{to{transform:scale(.9)}}.hvr-pulse-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse-shrink:hover,.hvr-pulse-shrink:focus,.hvr-pulse-shrink:active{-webkit-animation-name:hvr-pulse-shrink;animation-name:hvr-pulse-shrink;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-push{50%{transform:scale(.8)}to{transform:scale(1)}}@keyframes hvr-push{50%{transform:scale(.8)}to{transform:scale(1)}}.hvr-push{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-push:hover,.hvr-push:focus,.hvr-push:active{-webkit-animation-name:hvr-push;animation-name:hvr-push;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-pop{50%{transform:scale(1.2)}}@keyframes hvr-pop{50%{transform:scale(1.2)}}.hvr-pop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pop:hover,.hvr-pop:focus,.hvr-pop:active{-webkit-animation-name:hvr-pop;animation-name:hvr-pop;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-bounce-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.5s}.hvr-bounce-in:hover,.hvr-bounce-in:focus,.hvr-bounce-in:active{transform:scale(1.2);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-bounce-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.5s}.hvr-bounce-out:hover,.hvr-bounce-out:focus,.hvr-bounce-out:active{transform:scale(.8);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-rotate:hover,.hvr-rotate:focus,.hvr-rotate:active{transform:rotate(4deg)}.hvr-grow-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-grow-rotate:hover,.hvr-grow-rotate:focus,.hvr-grow-rotate:active{transform:scale(1.1) rotate(4deg)}.hvr-float{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-float:hover,.hvr-float:focus,.hvr-float:active{transform:translateY(-8px)}.hvr-sink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-sink:hover,.hvr-sink:focus,.hvr-sink:active{transform:translateY(8px)}@-webkit-keyframes hvr-bob{0%{transform:translateY(-8px)}50%{transform:translateY(-4px)}to{transform:translateY(-8px)}}@keyframes hvr-bob{0%{transform:translateY(-8px)}50%{transform:translateY(-4px)}to{transform:translateY(-8px)}}@-webkit-keyframes hvr-bob-float{to{transform:translateY(-8px)}}@keyframes hvr-bob-float{to{transform:translateY(-8px)}}.hvr-bob{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-bob:hover,.hvr-bob:focus,.hvr-bob:active{-webkit-animation-name:hvr-bob-float,hvr-bob;animation-name:hvr-bob-float,hvr-bob;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-hang{0%{transform:translateY(8px)}50%{transform:translateY(4px)}to{transform:translateY(8px)}}@keyframes hvr-hang{0%{transform:translateY(8px)}50%{transform:translateY(4px)}to{transform:translateY(8px)}}@-webkit-keyframes hvr-hang-sink{to{transform:translateY(8px)}}@keyframes hvr-hang-sink{to{transform:translateY(8px)}}.hvr-hang{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-hang:hover,.hvr-hang:focus,.hvr-hang:active{-webkit-animation-name:hvr-hang-sink,hvr-hang;animation-name:hvr-hang-sink,hvr-hang;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}.hvr-skew{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-skew:hover,.hvr-skew:focus,.hvr-skew:active{transform:skew(-10deg)}.hvr-skew-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transform-origin:0 100%}.hvr-skew-forward:hover,.hvr-skew-forward:focus,.hvr-skew-forward:active{transform:skew(-10deg)}.hvr-skew-backward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transform-origin:0 100%}.hvr-skew-backward:hover,.hvr-skew-backward:focus,.hvr-skew-backward:active{transform:skew(10deg)}@-webkit-keyframes hvr-wobble-vertical{16.65%{transform:translateY(8px)}33.3%{transform:translateY(-6px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}@keyframes hvr-wobble-vertical{16.65%{transform:translateY(8px)}33.3%{transform:translateY(-6px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}.hvr-wobble-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-vertical:hover,.hvr-wobble-vertical:focus,.hvr-wobble-vertical:active{-webkit-animation-name:hvr-wobble-vertical;animation-name:hvr-wobble-vertical;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-horizontal{16.65%{transform:translate(8px)}33.3%{transform:translate(-6px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}@keyframes hvr-wobble-horizontal{16.65%{transform:translate(8px)}33.3%{transform:translate(-6px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}.hvr-wobble-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-horizontal:hover,.hvr-wobble-horizontal:focus,.hvr-wobble-horizontal:active{-webkit-animation-name:hvr-wobble-horizontal;animation-name:hvr-wobble-horizontal;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-to-bottom-right{16.65%{transform:translate(8px,8px)}33.3%{transform:translate(-6px,-6px)}49.95%{transform:translate(4px,4px)}66.6%{transform:translate(-2px,-2px)}83.25%{transform:translate(1px,1px)}to{transform:translate(0)}}@keyframes hvr-wobble-to-bottom-right{16.65%{transform:translate(8px,8px)}33.3%{transform:translate(-6px,-6px)}49.95%{transform:translate(4px,4px)}66.6%{transform:translate(-2px,-2px)}83.25%{transform:translate(1px,1px)}to{transform:translate(0)}}.hvr-wobble-to-bottom-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-to-bottom-right:hover,.hvr-wobble-to-bottom-right:focus,.hvr-wobble-to-bottom-right:active{-webkit-animation-name:hvr-wobble-to-bottom-right;animation-name:hvr-wobble-to-bottom-right;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-to-top-right{16.65%{transform:translate(8px,-8px)}33.3%{transform:translate(-6px,6px)}49.95%{transform:translate(4px,-4px)}66.6%{transform:translate(-2px,2px)}83.25%{transform:translate(1px,-1px)}to{transform:translate(0)}}@keyframes hvr-wobble-to-top-right{16.65%{transform:translate(8px,-8px)}33.3%{transform:translate(-6px,6px)}49.95%{transform:translate(4px,-4px)}66.6%{transform:translate(-2px,2px)}83.25%{transform:translate(1px,-1px)}to{transform:translate(0)}}.hvr-wobble-to-top-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-to-top-right:hover,.hvr-wobble-to-top-right:focus,.hvr-wobble-to-top-right:active{-webkit-animation-name:hvr-wobble-to-top-right;animation-name:hvr-wobble-to-top-right;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-top{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-top{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transform-origin:0 100%}.hvr-wobble-top:hover,.hvr-wobble-top:focus,.hvr-wobble-top:active{-webkit-animation-name:hvr-wobble-top;animation-name:hvr-wobble-top;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-bottom{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-bottom{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transform-origin:100% 0}.hvr-wobble-bottom:hover,.hvr-wobble-bottom:focus,.hvr-wobble-bottom:active{-webkit-animation-name:hvr-wobble-bottom;animation-name:hvr-wobble-bottom;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-skew{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-skew{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-skew{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-skew:hover,.hvr-wobble-skew:focus,.hvr-wobble-skew:active{-webkit-animation-name:hvr-wobble-skew;animation-name:hvr-wobble-skew;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}@keyframes hvr-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}.hvr-buzz{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-buzz:hover,.hvr-buzz:focus,.hvr-buzz:active{-webkit-animation-name:hvr-buzz;animation-name:hvr-buzz;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}@keyframes hvr-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}.hvr-buzz-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-buzz-out:hover,.hvr-buzz-out:focus,.hvr-buzz-out:active{-webkit-animation-name:hvr-buzz-out;animation-name:hvr-buzz-out;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-forward:hover,.hvr-forward:focus,.hvr-forward:active{transform:translate(8px)}.hvr-backward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-backward:hover,.hvr-backward:focus,.hvr-backward:active{transform:translate(-8px)}.hvr-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);overflow:hidden;transition-duration:.3s;transition-property:color,background-color}.hvr-fade:hover,.hvr-fade:focus,.hvr-fade:active{background-color:#2098d1;color:#fff}@-webkit-keyframes hvr-back-pulse{50%{background-color:rgba(32,152,209,.75)}}@keyframes hvr-back-pulse{50%{background-color:rgba(32,152,209,.75)}}.hvr-back-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);overflow:hidden;transition-duration:.5s;transition-property:color,background-color}.hvr-back-pulse:hover,.hvr-back-pulse:focus,.hvr-back-pulse:active{-webkit-animation-name:hvr-back-pulse;animation-name:hvr-back-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:.5s;animation-delay:.5s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;background-color:#2098d1;color:#fff}.hvr-sweep-to-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:0 50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-right:hover,.hvr-sweep-to-right:focus,.hvr-sweep-to-right:active{color:#fff}.hvr-sweep-to-right:hover:before,.hvr-sweep-to-right:focus:before,.hvr-sweep-to-right:active:before{transform:scaleX(1)}.hvr-sweep-to-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:100% 50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-left:hover,.hvr-sweep-to-left:focus,.hvr-sweep-to-left:active{color:#fff}.hvr-sweep-to-left:hover:before,.hvr-sweep-to-left:focus:before,.hvr-sweep-to-left:active:before{transform:scaleX(1)}.hvr-sweep-to-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 0;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-bottom:hover,.hvr-sweep-to-bottom:focus,.hvr-sweep-to-bottom:active{color:#fff}.hvr-sweep-to-bottom:hover:before,.hvr-sweep-to-bottom:focus:before,.hvr-sweep-to-bottom:active:before{transform:scaleY(1)}.hvr-sweep-to-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 100%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-top:hover,.hvr-sweep-to-top:focus,.hvr-sweep-to-top:active{color:#fff}.hvr-sweep-to-top:hover:before,.hvr-sweep-to-top:focus:before,.hvr-sweep-to-top:active:before{transform:scaleY(1)}.hvr-bounce-to-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:0 50%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-right:hover,.hvr-bounce-to-right:focus,.hvr-bounce-to-right:active{color:#fff}.hvr-bounce-to-right:hover:before,.hvr-bounce-to-right:focus:before,.hvr-bounce-to-right:active:before{transform:scaleX(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:100% 50%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-left:hover,.hvr-bounce-to-left:focus,.hvr-bounce-to-left:active{color:#fff}.hvr-bounce-to-left:hover:before,.hvr-bounce-to-left:focus:before,.hvr-bounce-to-left:active:before{transform:scaleX(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 0;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-bottom:hover,.hvr-bounce-to-bottom:focus,.hvr-bounce-to-bottom:active{color:#fff}.hvr-bounce-to-bottom:hover:before,.hvr-bounce-to-bottom:focus:before,.hvr-bounce-to-bottom:active:before{transform:scaleY(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 100%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-top:hover,.hvr-bounce-to-top:focus,.hvr-bounce-to-top:active{color:#fff}.hvr-bounce-to-top:hover:before,.hvr-bounce-to-top:focus:before,.hvr-bounce-to-top:active:before{transform:scaleY(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-radial-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-radial-out:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;border-radius:100%;transform:scale(0);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-radial-out:hover,.hvr-radial-out:focus,.hvr-radial-out:active{color:#fff}.hvr-radial-out:hover:before,.hvr-radial-out:focus:before,.hvr-radial-out:active:before{transform:scale(2)}.hvr-radial-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-radial-in:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#e1e1e1;border-radius:100%;transform:scale(2);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-radial-in:hover,.hvr-radial-in:focus,.hvr-radial-in:active{color:#fff}.hvr-radial-in:hover:before,.hvr-radial-in:focus:before,.hvr-radial-in:active:before{transform:scale(0)}.hvr-rectangle-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-rectangle-in:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#e1e1e1;transform:scale(1);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-rectangle-in:hover,.hvr-rectangle-in:focus,.hvr-rectangle-in:active{color:#fff}.hvr-rectangle-in:hover:before,.hvr-rectangle-in:focus:before,.hvr-rectangle-in:active:before{transform:scale(0)}.hvr-rectangle-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-rectangle-out:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scale(0);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-rectangle-out:hover,.hvr-rectangle-out:focus,.hvr-rectangle-out:active{color:#fff}.hvr-rectangle-out:hover:before,.hvr-rectangle-out:focus:before,.hvr-rectangle-out:active:before{transform:scale(1)}.hvr-shutter-in-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-shutter-in-horizontal:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#e1e1e1;transform:scaleX(1);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-in-horizontal:hover,.hvr-shutter-in-horizontal:focus,.hvr-shutter-in-horizontal:active{color:#fff}.hvr-shutter-in-horizontal:hover:before,.hvr-shutter-in-horizontal:focus:before,.hvr-shutter-in-horizontal:active:before{transform:scaleX(0)}.hvr-shutter-out-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-shutter-out-horizontal:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#2098D1;transform:scaleX(0);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-out-horizontal:hover,.hvr-shutter-out-horizontal:focus,.hvr-shutter-out-horizontal:active{color:#fff}.hvr-shutter-out-horizontal:hover:before,.hvr-shutter-out-horizontal:focus:before,.hvr-shutter-out-horizontal:active:before{transform:scaleX(1)}.hvr-shutter-in-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-shutter-in-vertical:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#e1e1e1;transform:scaleY(1);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-in-vertical:hover,.hvr-shutter-in-vertical:focus,.hvr-shutter-in-vertical:active{color:#fff}.hvr-shutter-in-vertical:hover:before,.hvr-shutter-in-vertical:focus:before,.hvr-shutter-in-vertical:active:before{transform:scaleY(0)}.hvr-shutter-out-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-shutter-out-vertical:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#2098D1;transform:scaleY(0);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-out-vertical:hover,.hvr-shutter-out-vertical:focus,.hvr-shutter-out-vertical:active{color:#fff}.hvr-shutter-out-vertical:hover:before,.hvr-shutter-out-vertical:focus:before,.hvr-shutter-out-vertical:active:before{transform:scaleY(1)}.hvr-border-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow;box-shadow:inset 0 0 0 4px #e1e1e1,0 0 1px rgba(0,0,0,0)}.hvr-border-fade:hover,.hvr-border-fade:focus,.hvr-border-fade:active{box-shadow:inset 0 0 0 4px #2098d1,0 0 1px rgba(0,0,0,0)}.hvr-hollow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:background;box-shadow:inset 0 0 0 4px #e1e1e1,0 0 1px rgba(0,0,0,0)}.hvr-hollow:hover,.hvr-hollow:focus,.hvr-hollow:active{background:none}.hvr-trim{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-trim:before{content:"";position:absolute;border:white solid 4px;top:4px;left:4px;right:4px;bottom:4px;opacity:0;transition-duration:.3s;transition-property:opacity}.hvr-trim:hover:before,.hvr-trim:focus:before,.hvr-trim:active:before{opacity:1}@-webkit-keyframes hvr-ripple-out{to{top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0}}@keyframes hvr-ripple-out{to{top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0}}.hvr-ripple-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-ripple-out:before{content:"";position:absolute;border:#e1e1e1 solid 6px;top:0;right:0;bottom:0;left:0;-webkit-animation-duration:1s;animation-duration:1s}.hvr-ripple-out:hover:before,.hvr-ripple-out:focus:before,.hvr-ripple-out:active:before{-webkit-animation-name:hvr-ripple-out;animation-name:hvr-ripple-out}@-webkit-keyframes hvr-ripple-in{to{top:0;right:0;bottom:0;left:0;opacity:1}}@keyframes hvr-ripple-in{to{top:0;right:0;bottom:0;left:0;opacity:1}}.hvr-ripple-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-ripple-in:before{content:"";position:absolute;border:#e1e1e1 solid 4px;top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0;-webkit-animation-duration:1s;animation-duration:1s}.hvr-ripple-in:hover:before,.hvr-ripple-in:focus:before,.hvr-ripple-in:active:before{-webkit-animation-name:hvr-ripple-in;animation-name:hvr-ripple-in}.hvr-outline-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-outline-out:before{content:"";position:absolute;border:#e1e1e1 solid 4px;top:0;right:0;bottom:0;left:0;transition-duration:.3s;transition-property:top,right,bottom,left}.hvr-outline-out:hover:before,.hvr-outline-out:focus:before,.hvr-outline-out:active:before{top:-8px;right:-8px;bottom:-8px;left:-8px}.hvr-outline-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-outline-in:before{pointer-events:none;content:"";position:absolute;border:#e1e1e1 solid 4px;top:-16px;right:-16px;bottom:-16px;left:-16px;opacity:0;transition-duration:.3s;transition-property:top,right,bottom,left}.hvr-outline-in:hover:before,.hvr-outline-in:focus:before,.hvr-outline-in:active:before{top:-8px;right:-8px;bottom:-8px;left:-8px;opacity:1}.hvr-round-corners{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:border-radius}.hvr-round-corners:hover,.hvr-round-corners:focus,.hvr-round-corners:active{border-radius:1em}.hvr-underline-from-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-left:before{content:"";position:absolute;z-index:-1;left:0;right:100%;bottom:0;background:#2098D1;height:4px;transition-property:right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-left:hover:before,.hvr-underline-from-left:focus:before,.hvr-underline-from-left:active:before{right:0}.hvr-underline-from-center{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-center:before{content:"";position:absolute;z-index:-1;left:51%;right:51%;bottom:0;background:#2098D1;height:4px;transition-property:left,right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-center:hover:before,.hvr-underline-from-center:focus:before,.hvr-underline-from-center:active:before{left:0;right:0}.hvr-underline-from-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-right:before{content:"";position:absolute;z-index:-1;left:100%;right:0;bottom:0;background:#2098D1;height:4px;transition-property:left;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-right:hover:before,.hvr-underline-from-right:focus:before,.hvr-underline-from-right:active:before{left:0}.hvr-overline-from-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-left:before{content:"";position:absolute;z-index:-1;left:0;right:100%;top:0;background:#2098D1;height:4px;transition-property:right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-left:hover:before,.hvr-overline-from-left:focus:before,.hvr-overline-from-left:active:before{right:0}.hvr-overline-from-center{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-center:before{content:"";position:absolute;z-index:-1;left:51%;right:51%;top:0;background:#2098D1;height:4px;transition-property:left,right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-center:hover:before,.hvr-overline-from-center:focus:before,.hvr-overline-from-center:active:before{left:0;right:0}.hvr-overline-from-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-right:before{content:"";position:absolute;z-index:-1;left:100%;right:0;top:0;background:#2098D1;height:4px;transition-property:left;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-right:hover:before,.hvr-overline-from-right:focus:before,.hvr-overline-from-right:active:before{left:0}.hvr-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;top:0;bottom:0;border-color:#2098d1;border-style:solid;border-width:0;transition-property:border-width;transition-duration:.1s;transition-timing-function:ease-out}.hvr-reveal:hover:before,.hvr-reveal:focus:before,.hvr-reveal:active:before{transform:translateY(0);border-width:4px}.hvr-underline-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;bottom:0;background:#2098D1;height:4px;transform:translateY(4px);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-reveal:hover:before,.hvr-underline-reveal:focus:before,.hvr-underline-reveal:active:before{transform:translateY(0)}.hvr-overline-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;top:0;background:#2098D1;height:4px;transform:translateY(-4px);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-reveal:hover:before,.hvr-overline-reveal:focus:before,.hvr-overline-reveal:active:before{transform:translateY(0)}.hvr-glow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-glow:hover,.hvr-glow:focus,.hvr-glow:active{box-shadow:0 0 8px rgba(0,0,0,.6)}.hvr-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-shadow:hover,.hvr-shadow:focus,.hvr-shadow:active{box-shadow:0 10px 10px -10px rgba(0,0,0,.5)}.hvr-grow-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow,transform}.hvr-grow-shadow:hover,.hvr-grow-shadow:focus,.hvr-grow-shadow:active{box-shadow:0 10px 10px -10px rgba(0,0,0,.5);transform:scale(1.1)}.hvr-box-shadow-outset{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-box-shadow-outset:hover,.hvr-box-shadow-outset:focus,.hvr-box-shadow-outset:active{box-shadow:2px 2px 2px rgba(0,0,0,.6)}.hvr-box-shadow-inset{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow;box-shadow:inset 0 0 rgba(0,0,0,.6),0 0 1px rgba(0,0,0,0)}.hvr-box-shadow-inset:hover,.hvr-box-shadow-inset:focus,.hvr-box-shadow-inset:active{box-shadow:inset 2px 2px 2px rgba(0,0,0,.6),0 0 1px rgba(0,0,0,0)}.hvr-float-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-float-shadow:before{pointer-events:none;position:absolute;z-index:-1;content:"";top:100%;left:5%;height:10px;width:90%;opacity:0;background:radial-gradient(ellipse at center,rgba(0,0,0,.35) 0%,rgba(0,0,0,0) 80%);transition-duration:.3s;transition-property:transform,opacity}.hvr-float-shadow:hover,.hvr-float-shadow:focus,.hvr-float-shadow:active{transform:translateY(-5px)}.hvr-float-shadow:hover:before,.hvr-float-shadow:focus:before,.hvr-float-shadow:active:before{opacity:1;transform:translateY(5px)}.hvr-shadow-radial{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-shadow-radial:before,.hvr-shadow-radial:after{pointer-events:none;position:absolute;content:"";left:0;width:100%;box-sizing:border-box;background-repeat:no-repeat;height:5px;opacity:0;transition-duration:.3s;transition-property:opacity}.hvr-shadow-radial:before{bottom:100%;background:radial-gradient(ellipse at 50% 150%,rgba(0,0,0,.6) 0%,rgba(0,0,0,0) 80%)}.hvr-shadow-radial:after{top:100%;background:radial-gradient(ellipse at 50% -50%,rgba(0,0,0,.6) 0%,rgba(0,0,0,0) 80%)}.hvr-shadow-radial:hover:before,.hvr-shadow-radial:focus:before,.hvr-shadow-radial:active:before,.hvr-shadow-radial:hover:after,.hvr-shadow-radial:focus:after,.hvr-shadow-radial:active:after{opacity:1}.hvr-bubble-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-top:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;left:calc(50% - 10px);top:0;border-width:0 10px 10px 10px;border-color:transparent transparent #e1e1e1 transparent}.hvr-bubble-top:hover:before,.hvr-bubble-top:focus:before,.hvr-bubble-top:active:before{transform:translateY(-10px)}.hvr-bubble-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-right:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;top:calc(50% - 10px);right:0;border-width:10px 0 10px 10px;border-color:transparent transparent transparent #e1e1e1}.hvr-bubble-right:hover:before,.hvr-bubble-right:focus:before,.hvr-bubble-right:active:before{transform:translate(10px)}.hvr-bubble-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-bottom:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;left:calc(50% - 10px);bottom:0;border-width:10px 10px 0 10px;border-color:#e1e1e1 transparent transparent transparent}.hvr-bubble-bottom:hover:before,.hvr-bubble-bottom:focus:before,.hvr-bubble-bottom:active:before{transform:translateY(10px)}.hvr-bubble-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-left:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;top:calc(50% - 10px);left:0;border-width:10px 10px 10px 0;border-color:transparent #e1e1e1 transparent transparent}.hvr-bubble-left:hover:before,.hvr-bubble-left:focus:before,.hvr-bubble-left:active:before{transform:translate(-10px)}.hvr-bubble-float-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-top:before{position:absolute;z-index:-1;content:"";left:calc(50% - 10px);top:0;border-style:solid;border-width:0 10px 10px 10px;border-color:transparent transparent #e1e1e1 transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-top:hover,.hvr-bubble-float-top:focus,.hvr-bubble-float-top:active{transform:translateY(10px)}.hvr-bubble-float-top:hover:before,.hvr-bubble-float-top:focus:before,.hvr-bubble-float-top:active:before{transform:translateY(-10px)}.hvr-bubble-float-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-right:before{position:absolute;z-index:-1;top:calc(50% - 10px);right:0;content:"";border-style:solid;border-width:10px 0 10px 10px;border-color:transparent transparent transparent #e1e1e1;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-right:hover,.hvr-bubble-float-right:focus,.hvr-bubble-float-right:active{transform:translate(-10px)}.hvr-bubble-float-right:hover:before,.hvr-bubble-float-right:focus:before,.hvr-bubble-float-right:active:before{transform:translate(10px)}.hvr-bubble-float-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-bottom:before{position:absolute;z-index:-1;content:"";left:calc(50% - 10px);bottom:0;border-style:solid;border-width:10px 10px 0 10px;border-color:#e1e1e1 transparent transparent transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-bottom:hover,.hvr-bubble-float-bottom:focus,.hvr-bubble-float-bottom:active{transform:translateY(-10px)}.hvr-bubble-float-bottom:hover:before,.hvr-bubble-float-bottom:focus:before,.hvr-bubble-float-bottom:active:before{transform:translateY(10px)}.hvr-bubble-float-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-left:before{position:absolute;z-index:-1;content:"";top:calc(50% - 10px);left:0;border-style:solid;border-width:10px 10px 10px 0;border-color:transparent #e1e1e1 transparent transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-left:hover,.hvr-bubble-float-left:focus,.hvr-bubble-float-left:active{transform:translate(10px)}.hvr-bubble-float-left:hover:before,.hvr-bubble-float-left:focus:before,.hvr-bubble-float-left:active:before{transform:translate(-10px)}.hvr-icon-back{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.1s}.hvr-icon-back .hvr-icon{transform:translateZ(0);transition-duration:.1s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-back:hover .hvr-icon,.hvr-icon-back:focus .hvr-icon,.hvr-icon-back:active .hvr-icon{transform:translate(-4px)}.hvr-icon-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.1s}.hvr-icon-forward .hvr-icon{transform:translateZ(0);transition-duration:.1s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-forward:hover .hvr-icon,.hvr-icon-forward:focus .hvr-icon,.hvr-icon-forward:active .hvr-icon{transform:translate(4px)}@-webkit-keyframes hvr-icon-down{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(6px)}}@keyframes hvr-icon-down{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(6px)}}.hvr-icon-down{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-down .hvr-icon{transform:translateZ(0)}.hvr-icon-down:hover .hvr-icon,.hvr-icon-down:focus .hvr-icon,.hvr-icon-down:active .hvr-icon{-webkit-animation-name:hvr-icon-down;animation-name:hvr-icon-down;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes hvr-icon-up{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(-6px)}}@keyframes hvr-icon-up{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(-6px)}}.hvr-icon-up{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-up .hvr-icon{transform:translateZ(0)}.hvr-icon-up:hover .hvr-icon,.hvr-icon-up:focus .hvr-icon,.hvr-icon-up:active .hvr-icon{-webkit-animation-name:hvr-icon-up;animation-name:hvr-icon-up;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}.hvr-icon-spin{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-spin .hvr-icon{transition-duration:1s;transition-property:transform;transition-timing-function:ease-in-out}.hvr-icon-spin:hover .hvr-icon,.hvr-icon-spin:focus .hvr-icon,.hvr-icon-spin:active .hvr-icon{transform:rotate(360deg)}@-webkit-keyframes hvr-icon-drop{0%{opacity:0}50%{opacity:0;transform:translateY(-100%)}51%,to{opacity:1}}@keyframes hvr-icon-drop{0%{opacity:0}50%{opacity:0;transform:translateY(-100%)}51%,to{opacity:1}}.hvr-icon-drop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-drop .hvr-icon{transform:translateZ(0)}.hvr-icon-drop:hover .hvr-icon,.hvr-icon-drop:focus .hvr-icon,.hvr-icon-drop:active .hvr-icon{opacity:0;transition-duration:.3s;-webkit-animation-name:hvr-icon-drop;animation-name:hvr-icon-drop;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-delay:.3s;animation-delay:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-timing-function:cubic-bezier(.52,1.64,.37,.66);animation-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-icon-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-fade .hvr-icon{transform:translateZ(0);transition-duration:.5s;transition-property:color}.hvr-icon-fade:hover .hvr-icon,.hvr-icon-fade:focus .hvr-icon,.hvr-icon-fade:active .hvr-icon{color:#0f9e5e}@-webkit-keyframes hvr-icon-float-away{0%{opacity:1}to{opacity:0;transform:translateY(-1em)}}@keyframes hvr-icon-float-away{0%{opacity:1}to{opacity:0;transform:translateY(-1em)}}.hvr-icon-float-away{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-float-away .hvr-icon{transform:translateZ(0);-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.hvr-icon-float-away:hover .hvr-icon,.hvr-icon-float-away:focus .hvr-icon,.hvr-icon-float-away:active .hvr-icon{-webkit-animation-name:hvr-icon-float-away;animation-name:hvr-icon-float-away;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes hvr-icon-sink-away{0%{opacity:1}to{opacity:0;transform:translateY(1em)}}@keyframes hvr-icon-sink-away{0%{opacity:1}to{opacity:0;transform:translateY(1em)}}.hvr-icon-sink-away{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-sink-away .hvr-icon{transform:translateZ(0);-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.hvr-icon-sink-away:hover .hvr-icon,.hvr-icon-sink-away:focus .hvr-icon,.hvr-icon-sink-away:active .hvr-icon{-webkit-animation-name:hvr-icon-sink-away;animation-name:hvr-icon-sink-away;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}.hvr-icon-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-grow .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-grow:hover .hvr-icon,.hvr-icon-grow:focus .hvr-icon,.hvr-icon-grow:active .hvr-icon{transform:scale(1.3) translateZ(0)}.hvr-icon-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-shrink .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-shrink:hover .hvr-icon,.hvr-icon-shrink:focus .hvr-icon,.hvr-icon-shrink:active .hvr-icon{transform:scale(.8)}@-webkit-keyframes hvr-icon-pulse{25%{transform:scale(1.3)}75%{transform:scale(.8)}}@keyframes hvr-icon-pulse{25%{transform:scale(1.3)}75%{transform:scale(.8)}}.hvr-icon-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse:hover .hvr-icon,.hvr-icon-pulse:focus .hvr-icon,.hvr-icon-pulse:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse;animation-name:hvr-icon-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-icon-pulse-grow{to{transform:scale(1.3)}}@keyframes hvr-icon-pulse-grow{to{transform:scale(1.3)}}.hvr-icon-pulse-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse-grow .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse-grow:hover .hvr-icon,.hvr-icon-pulse-grow:focus .hvr-icon,.hvr-icon-pulse-grow:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse-grow;animation-name:hvr-icon-pulse-grow;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-icon-pulse-shrink{to{transform:scale(.8)}}@keyframes hvr-icon-pulse-shrink{to{transform:scale(.8)}}.hvr-icon-pulse-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse-shrink .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse-shrink:hover .hvr-icon,.hvr-icon-pulse-shrink:focus .hvr-icon,.hvr-icon-pulse-shrink:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse-shrink;animation-name:hvr-icon-pulse-shrink;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-icon-push{50%{transform:scale(.5)}}@keyframes hvr-icon-push{50%{transform:scale(.5)}}.hvr-icon-push{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-push .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-push:hover .hvr-icon,.hvr-icon-push:focus .hvr-icon,.hvr-icon-push:active .hvr-icon{-webkit-animation-name:hvr-icon-push;animation-name:hvr-icon-push;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-pop{50%{transform:scale(1.5)}}@keyframes hvr-icon-pop{50%{transform:scale(1.5)}}.hvr-icon-pop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-pop .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-pop:hover .hvr-icon,.hvr-icon-pop:focus .hvr-icon,.hvr-icon-pop:active .hvr-icon{-webkit-animation-name:hvr-icon-pop;animation-name:hvr-icon-pop;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-icon-bounce{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-bounce .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-bounce:hover .hvr-icon,.hvr-icon-bounce:focus .hvr-icon,.hvr-icon-bounce:active .hvr-icon{transform:scale(1.5);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-icon-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-rotate .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-rotate:hover .hvr-icon,.hvr-icon-rotate:focus .hvr-icon,.hvr-icon-rotate:active .hvr-icon{transform:rotate(20deg)}.hvr-icon-grow-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-grow-rotate .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-grow-rotate:hover .hvr-icon,.hvr-icon-grow-rotate:focus .hvr-icon,.hvr-icon-grow-rotate:active .hvr-icon{transform:scale(1.5) rotate(12deg)}.hvr-icon-float{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-float .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-float:hover .hvr-icon,.hvr-icon-float:focus .hvr-icon,.hvr-icon-float:active .hvr-icon{transform:translateY(-4px)}.hvr-icon-sink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-sink .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-sink:hover .hvr-icon,.hvr-icon-sink:focus .hvr-icon,.hvr-icon-sink:active .hvr-icon{transform:translateY(4px)}@-webkit-keyframes hvr-icon-bob{0%{transform:translateY(-6px)}50%{transform:translateY(-2px)}to{transform:translateY(-6px)}}@keyframes hvr-icon-bob{0%{transform:translateY(-6px)}50%{transform:translateY(-2px)}to{transform:translateY(-6px)}}@-webkit-keyframes hvr-icon-bob-float{to{transform:translateY(-6px)}}@keyframes hvr-icon-bob-float{to{transform:translateY(-6px)}}.hvr-icon-bob{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-bob .hvr-icon{transform:translateZ(0)}.hvr-icon-bob:hover .hvr-icon,.hvr-icon-bob:focus .hvr-icon,.hvr-icon-bob:active .hvr-icon{-webkit-animation-name:hvr-icon-bob-float,hvr-icon-bob;animation-name:hvr-icon-bob-float,hvr-icon-bob;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-icon-hang{0%{transform:translateY(6px)}50%{transform:translateY(2px)}to{transform:translateY(6px)}}@keyframes hvr-icon-hang{0%{transform:translateY(6px)}50%{transform:translateY(2px)}to{transform:translateY(6px)}}@-webkit-keyframes hvr-icon-hang-sink{to{transform:translateY(6px)}}@keyframes hvr-icon-hang-sink{to{transform:translateY(6px)}}.hvr-icon-hang{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-hang .hvr-icon{transform:translateZ(0)}.hvr-icon-hang:hover .hvr-icon,.hvr-icon-hang:focus .hvr-icon,.hvr-icon-hang:active .hvr-icon{-webkit-animation-name:hvr-icon-hang-sink,hvr-icon-hang;animation-name:hvr-icon-hang-sink,hvr-icon-hang;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-icon-wobble-horizontal{16.65%{transform:translate(6px)}33.3%{transform:translate(-5px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}@keyframes hvr-icon-wobble-horizontal{16.65%{transform:translate(6px)}33.3%{transform:translate(-5px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}.hvr-icon-wobble-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-wobble-horizontal .hvr-icon{transform:translateZ(0)}.hvr-icon-wobble-horizontal:hover .hvr-icon,.hvr-icon-wobble-horizontal:focus .hvr-icon,.hvr-icon-wobble-horizontal:active .hvr-icon{-webkit-animation-name:hvr-icon-wobble-horizontal;animation-name:hvr-icon-wobble-horizontal;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-wobble-vertical{16.65%{transform:translateY(6px)}33.3%{transform:translateY(-5px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}@keyframes hvr-icon-wobble-vertical{16.65%{transform:translateY(6px)}33.3%{transform:translateY(-5px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}.hvr-icon-wobble-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-wobble-vertical .hvr-icon{transform:translateZ(0)}.hvr-icon-wobble-vertical:hover .hvr-icon,.hvr-icon-wobble-vertical:focus .hvr-icon,.hvr-icon-wobble-vertical:active .hvr-icon{-webkit-animation-name:hvr-icon-wobble-vertical;animation-name:hvr-icon-wobble-vertical;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}@keyframes hvr-icon-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}.hvr-icon-buzz{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-buzz .hvr-icon{transform:translateZ(0)}.hvr-icon-buzz:hover .hvr-icon,.hvr-icon-buzz:focus .hvr-icon,.hvr-icon-buzz:active .hvr-icon{-webkit-animation-name:hvr-icon-buzz;animation-name:hvr-icon-buzz;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-icon-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}@keyframes hvr-icon-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}.hvr-icon-buzz-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-buzz-out .hvr-icon{transform:translateZ(0)}.hvr-icon-buzz-out:hover .hvr-icon,.hvr-icon-buzz-out:focus .hvr-icon,.hvr-icon-buzz-out:active .hvr-icon{-webkit-animation-name:hvr-icon-buzz-out;animation-name:hvr-icon-buzz-out;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-curl-top-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-top-left:before{pointer-events:none;position:absolute;content:"";height:0;width:0;top:0;left:0;background:white;background:linear-gradient(135deg,white 45%,#aaa 50%,#ccc 56%,white 80%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr="#ffffff",endColorstr="#000000");z-index:1000;box-shadow:1px 1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-top-left:hover:before,.hvr-curl-top-left:focus:before,.hvr-curl-top-left:active:before{width:25px;height:25px}.hvr-curl-top-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-top-right:before{pointer-events:none;position:absolute;content:"";height:0;width:0;top:0;right:0;background:white;background:linear-gradient(225deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:-1px 1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-top-right:hover:before,.hvr-curl-top-right:focus:before,.hvr-curl-top-right:active:before{width:25px;height:25px}.hvr-curl-bottom-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-bottom-right:before{pointer-events:none;position:absolute;content:"";height:0;width:0;bottom:0;right:0;background:white;background:linear-gradient(315deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:-1px -1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-bottom-right:hover:before,.hvr-curl-bottom-right:focus:before,.hvr-curl-bottom-right:active:before{width:25px;height:25px}.hvr-curl-bottom-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-bottom-left:before{pointer-events:none;position:absolute;content:"";height:0;width:0;bottom:0;left:0;background:white;background:linear-gradient(45deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:1px -1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-bottom-left:hover:before,.hvr-curl-bottom-left:focus:before,.hvr-curl-bottom-left:active:before{width:25px;height:25px}#tiledesk-container html{line-height:1.15;-webkit-text-size-adjust:100%}#tiledesk-container body{margin:0}#tiledesk-container main{display:block}#tiledesk-container h1{font-size:2em;margin:.67em 0}#tiledesk-container hr{box-sizing:content-box;height:0;overflow:visible}#tiledesk-container pre{font-family:monospace,monospace;font-size:1em}#tiledesk-container a{background-color:transparent}#tiledesk-container abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#tiledesk-container b,#tiledesk-container strong{font-weight:bolder}#tiledesk-container code,#tiledesk-container kbd,#tiledesk-container samp{font-family:monospace,monospace;font-size:1em}#tiledesk-container small{font-size:80%}#tiledesk-container sub,#tiledesk-container sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#tiledesk-container sub{bottom:-.25em}#tiledesk-container sup{top:-.5em}#tiledesk-container img{border-style:none;max-width:100%}#tiledesk-container button,#tiledesk-container input,#tiledesk-container optgroup,#tiledesk-container select,#tiledesk-container textarea{font-family:inherit;font-size:100%;line-height:1.15}#tiledesk-container button,#tiledesk-container input{overflow:visible}#tiledesk-container button,#tiledesk-container select{text-transform:none}#tiledesk-container button,#tiledesk-container [type=button],#tiledesk-container [type=reset],#tiledesk-container [type=submit]{-webkit-appearance:button}#tiledesk-container button::-moz-focus-inner,#tiledesk-container [type=button]::-moz-focus-inner,#tiledesk-container [type=reset]::-moz-focus-inner,#tiledesk-container [type=submit]::-moz-focus-inner{border-style:none;padding:0}#tiledesk-container button:-moz-focusring,#tiledesk-container [type=button]:-moz-focusring,#tiledesk-container [type=reset]:-moz-focusring,#tiledesk-container [type=submit]:-moz-focusring{outline:1px dotted ButtonText}#tiledesk-container fieldset{padding:.35em .75em .625em}#tiledesk-container legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}#tiledesk-container progress{vertical-align:baseline}#tiledesk-container textarea{overflow:auto}#tiledesk-container [type=checkbox],#tiledesk-container [type=radio]{box-sizing:border-box;padding:0}#tiledesk-container [type=number]::-webkit-inner-spin-button,#tiledesk-container [type=number]::-webkit-outer-spin-button{height:auto}#tiledesk-container [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#tiledesk-container [type=search]::-webkit-search-decoration{-webkit-appearance:none}#tiledesk-container ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#tiledesk-container details{display:block}#tiledesk-container summary{display:list-item}#tiledesk-container template{display:none}#tiledesk-container [hidden]{display:none}.emoji-mart,.emoji-mart *{box-sizing:border-box;line-height:1.15}.emoji-mart{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;font-size:16px;display:inline-block;color:#222427;border:1px solid #d9d9d9;border-radius:5px;background:#fff}.emoji-mart .emoji-mart-emoji{padding:6px}.emoji-mart-bar{border:0 solid #d9d9d9}.emoji-mart-bar:first-child{border-bottom-width:1px;border-top-left-radius:5px;border-top-right-radius:5px}.emoji-mart-bar:last-child{border-top-width:1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.emoji-mart-anchors{display:flex;flex-direction:row;justify-content:space-between;padding:0 6px;line-height:0}.emoji-mart-anchor{position:relative;display:block;flex:1 1 auto;color:#858585;text-align:center;padding:12px 4px;overflow:hidden;transition:color .1s ease-out;margin:0;box-shadow:none;background:none;border:none}.emoji-mart-anchor:focus{outline:0}.emoji-mart-anchor:hover,.emoji-mart-anchor:focus,.emoji-mart-anchor-selected{color:#464646}.emoji-mart-anchor-selected .emoji-mart-anchor-bar{bottom:0}.emoji-mart-anchor-bar{position:absolute;bottom:-3px;left:0;width:100%;height:3px;background-color:#464646}.emoji-mart-anchors i{display:inline-block;width:100%;max-width:22px}.emoji-mart-anchors svg,.emoji-mart-anchors img{fill:currentColor;height:18px;width:18px}.emoji-mart-scroll{overflow-y:scroll;height:270px;padding:0 6px 6px;will-change:transform}.emoji-mart-search{margin-top:6px;padding:0 6px;position:relative}.emoji-mart-search input{font-size:16px;display:block;width:100%;padding:5px 25px 6px 10px;border-radius:5px;border:1px solid #d9d9d9;outline:0}.emoji-mart-search input,.emoji-mart-search input::-webkit-search-decoration,.emoji-mart-search input::-webkit-search-cancel-button,.emoji-mart-search input::-webkit-search-results-button,.emoji-mart-search input::-webkit-search-results-decoration{-webkit-appearance:none}.emoji-mart-search-icon{position:absolute;top:3px;right:11px;z-index:2;padding:2px 5px 1px;border:none;background:none}.emoji-mart-category .emoji-mart-emoji span{z-index:1;position:relative;text-align:center;cursor:default}.emoji-mart-category .emoji-mart-emoji:hover:before{z-index:0;content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#f4f4f4;border-radius:100%}.emoji-mart-category-label{z-index:2;position:relative;position:-webkit-sticky;position:sticky;top:0}.emoji-mart-category-label span{display:block;width:100%;font-weight:500;padding:5px 6px;background-color:#fff;background-color:rgba(255,255,255,.95)}.emoji-mart-category-list{margin:0;padding:0}.emoji-mart-category-list li{list-style:none;margin:0;padding:0;display:inline-block}.emoji-mart-emoji{position:relative;display:inline-block;font-size:0;margin:0;padding:0;border:none;background:none;box-shadow:none}.emoji-mart-emoji-native{font-family:"Segoe UI Emoji","Segoe UI Symbol","Segoe UI","Apple Color Emoji","Twemoji Mozilla","Noto Color Emoji","Android Emoji"}.emoji-mart-no-results{font-size:14px;text-align:center;padding-top:70px;color:#858585}.emoji-mart-no-results .emoji-mart-category-label{display:none}.emoji-mart-no-results .emoji-mart-no-results-label{margin-top:.2em}.emoji-mart-no-results .emoji-mart-emoji:hover:before{content:none}.emoji-mart-preview{position:relative;height:70px}.emoji-mart-preview-emoji,.emoji-mart-preview-data,.emoji-mart-preview-skins{position:absolute;top:50%;transform:translateY(-50%)}.emoji-mart-preview-emoji{left:12px}.emoji-mart-preview-data{left:68px;right:12px;word-break:break-all}.emoji-mart-preview-skins{right:30px;text-align:right}.emoji-mart-preview-skins.custom{right:10px;text-align:right}.emoji-mart-preview-name{font-size:14px}.emoji-mart-preview-shortname{font-size:12px;color:#888}.emoji-mart-preview-shortname+.emoji-mart-preview-shortname,.emoji-mart-preview-shortname+.emoji-mart-preview-emoticon,.emoji-mart-preview-emoticon+.emoji-mart-preview-emoticon{margin-left:.5em}.emoji-mart-preview-emoticon{font-size:11px;color:#bbb}.emoji-mart-title span{display:inline-block;vertical-align:middle}.emoji-mart-title .emoji-mart-emoji{padding:0}.emoji-mart-title-label{color:#999a9c;font-size:26px;font-weight:300}.emoji-mart-skin-swatches{font-size:0;padding:2px 0;border:1px solid #d9d9d9;border-radius:12px;background-color:#fff}.emoji-mart-skin-swatches.custom{font-size:0;border:none;background-color:#fff}.emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch{width:16px;padding:0 2px}.emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch.selected:after{opacity:.75}.emoji-mart-skin-swatch{display:inline-block;width:0;vertical-align:middle;transition-property:width,padding;transition-duration:.125s;transition-timing-function:ease-out}.emoji-mart-skin-swatch:nth-child(1){transition-delay:0s}.emoji-mart-skin-swatch:nth-child(2){transition-delay:.03s}.emoji-mart-skin-swatch:nth-child(3){transition-delay:.06s}.emoji-mart-skin-swatch:nth-child(4){transition-delay:.09s}.emoji-mart-skin-swatch:nth-child(5){transition-delay:.12s}.emoji-mart-skin-swatch:nth-child(6){transition-delay:.15s}.emoji-mart-skin-swatch.selected{position:relative;width:16px;padding:0 2px}.emoji-mart-skin-swatch.selected:after{content:"";position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;background-color:#fff;border-radius:100%;pointer-events:none;opacity:0;transition:opacity .2s ease-out}.emoji-mart-skin-swatch.custom{display:inline-block;width:0;height:38px;overflow:hidden;vertical-align:middle;transition-property:width,height;transition-duration:.125s;transition-timing-function:ease-out;cursor:default}.emoji-mart-skin-swatch.custom.selected{position:relative;width:36px;height:38px;padding:0 2px 0 0}.emoji-mart-skin-swatch.custom.selected:after{content:"";width:0;height:0}.emoji-mart-skin-swatches.custom .emoji-mart-skin-swatch.custom:hover{background-color:#f4f4f4;border-radius:10%}.emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom{width:36px;height:38px;padding:0 2px 0 0}.emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom.selected:after{opacity:.75}.emoji-mart-skin-text.opened{display:inline-block;vertical-align:middle;text-align:left;color:#888;font-size:11px;padding:5px 2px;width:95px;height:40px;border-radius:10%;background-color:#fff}.emoji-mart-skin{display:inline-block;width:100%;padding-top:100%;max-width:12px;border-radius:100%}.emoji-mart-skin-tone-1{background-color:#ffc93a}.emoji-mart-skin-tone-2{background-color:#fadcbc}.emoji-mart-skin-tone-3{background-color:#e0bb95}.emoji-mart-skin-tone-4{background-color:#bf8f68}.emoji-mart-skin-tone-5{background-color:#9b643d}.emoji-mart-skin-tone-6{background-color:#594539}.emoji-mart-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.emoji-mart-dark{color:#fff;border-color:#555453;background-color:#222}.emoji-mart-dark .emoji-mart-bar{border-color:#555453}.emoji-mart-dark .emoji-mart-search input{color:#fff;border-color:#555453;background-color:#2f2f2f}.emoji-mart-dark .emoji-mart-search-icon svg{fill:#fff}.emoji-mart-dark .emoji-mart-category .emoji-mart-emoji:hover:before{background-color:#444}.emoji-mart-dark .emoji-mart-category-label span{background-color:#222;color:#fff}.emoji-mart-dark .emoji-mart-skin-swatches{border-color:#555453;background-color:#222}.emoji-mart-dark .emoji-mart-anchor:hover,.emoji-mart-dark .emoji-mart-anchor:focus,.emoji-mart-dark .emoji-mart-anchor-selected{color:#bfbfbf}input,select:focus,textarea{font-size:16px!important}:root{--button-in-msg-background-color: #2a6ac1;--button-in-msg-font-size: 15px}.chat-tooltip{font-family:"Roboto","Google Sans",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300}body{margin:0}:focus{outline:none!important}::-moz-focus-inner{border:0}.slide-in-right{-webkit-animation:slide-in-right .5s cubic-bezier(.895,.03,.685,.22) 0s both;animation:slide-in-right .5s cubic-bezier(.895,.03,.685,.22) 0s both}.slide-in-left{-webkit-animation:slideIn .5s cubic-bezier(.895,.03,.685,.22) 0s;animation:slideIn .5s cubic-bezier(.895,.03,.685,.22) 0s}.scale-in-center{display:block;opacity:1;-webkit-animation:scale-in-center .5s both;animation:scale-in-center .5s both}.jello-horizontal{-webkit-animation:jello-horizontal .9s 3s both;animation:jello-horizontal .9s 3s both}.swirl-in-bck{-webkit-animation:swirl-in-bck .65s ease-in .5s both;animation:swirl-in-bck .65s ease-in .5s both}.rotate-scale-up{-webkit-animation:rotate-scale-up .65s linear both;animation:rotate-scale-up .65s linear both}.rotate-center:hover{-webkit-animation:rotate-center .6s ease-in-out both;animation:rotate-center .6s ease-in-out both}.swing-in-bottom-fwd{-webkit-animation:fade .5s both;animation:fade .5s both}.heartbeat:hover{-webkit-animation:heartbeat 1.5s ease-in-out infinite both;animation:heartbeat 1.5s ease-in-out infinite both}.avatar-project{position:relative;padding:0;margin:0;height:70px;width:80px;line-height:52px}.avatar-project .avatar-placeholder{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;max-width:52px;text-align:center;font-size:20px;color:#fff;font-weight:500}.avatar-project .avatar-image{position:absolute;top:0;bottom:0;margin:0;left:0;width:100%;height:100%;max-height:100%;text-align:left;background-color:transparent;background-repeat:no-repeat;background-size:contain;background-attachment:scroll;background-attachment:initial;background-position:left;background-origin:content-box}textarea::-moz-placeholder{color:#aaa;font-weight:300}textarea:-ms-input-placeholder{color:#aaa;font-weight:300}textarea::placeholder{color:#aaa;font-weight:300}.msg_container .button-in-msg{color:#fff!important;background:#2a6ac1!important;background:var(--button-in-msg-background-color)!important;position:relative;max-width:300px;min-width:inherit;padding:8px 16px;cursor:auto;border:1px solid white;border-radius:20px!important;margin:3px;overflow:hidden;font-family:"Muli",sans-serif;font-size:15px;text-overflow:ellipsis;white-space:normal;letter-spacing:-.24px;-webkit-font-smoothing:antialiased}.msg_container .button-in-msg p{font-size:15px!important;font-size:var(--button-in-msg-font-size)!important;font-family:"Muli",sans-serif!important;font-weight:normal!important}chat-root{position:absolute;display:block;width:100%;height:100%}chat-root *:focus{outline:none}chat-root button{cursor:pointer}chat-root textarea,chat-root textarea:visited,chat-root textarea:focus,chat-root textarea:hover,chat-root textarea:active{line-height:20px!important;outline:none!important;box-shadow:none!important;border:0px solid rgba(0,0,0,.2)!important}chat-root .c21-button-clean{-webkit-appearance:initial;border:none;background-color:transparent;padding:0;margin:0}chat-root #tiledesk-container{position:absolute;width:100%;height:100%;font-family:"Roboto","Google Sans",Helvetica,Arial,sans-serif;font-size:10px;text-align:left;background-color:transparent;display:none;overflow:hidden}chat-root #tiledesk-container.active{display:block}chat-root #tiledesk-container a:link{color:#fff}chat-root #tiledesk-container a:visited{color:#fff}chat-root #tiledesk-container a:hover{color:#fff}chat-root #tiledesk-container a:active{color:#fff}chat-root #tiledesk-container #c21-app-list-conversations a:link,chat-root #tiledesk-container #c21-app-list-all-conversations a:link,chat-root #tiledesk-container #chat21-star-rating-widget a:link,chat-root #tiledesk-container #chat21-prechat-form a:link{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:visited,chat-root #tiledesk-container #c21-app-list-all-conversations a:visited,chat-root #tiledesk-container #chat21-star-rating-widget a:visited,chat-root #tiledesk-container #chat21-prechat-form a:visited{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:hover,chat-root #tiledesk-container #c21-app-list-all-conversations a:hover,chat-root #tiledesk-container #chat21-star-rating-widget a:hover,chat-root #tiledesk-container #chat21-prechat-form a:hover{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:active,chat-root #tiledesk-container #c21-app-list-all-conversations a:active,chat-root #tiledesk-container #chat21-star-rating-widget a:active,chat-root #tiledesk-container #chat21-prechat-form a:active{color:#3a3c4c}chat-root #tiledesk-container div.clear{all:unset;clear:both}chat-root #tiledesk-container .truncate{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}chat-root #tiledesk-container .truncate p{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-margin-before:0em;margin-block-start:0em;-webkit-margin-after:0em;margin-block-end:0em}chat-root #tiledesk-container .v-align-center{display:inline-flex;align-items:center;height:100%;float:left}chat-root #tiledesk-container .c21-align-left{left:0px}chat-root #tiledesk-container .c21-align-right{right:0px}chat-root #tiledesk-container .time{display:none;font-size:1em;color:#aaa;text-align:left;margin:-2px 0 0;padding:0 40px;background-color:transparent}chat-root #tiledesk-container .time.sender{text-align:right;margin-right:24px;padding:0}chat-root #tiledesk-container .msg_receive a{color:#62a8ea}chat-root #tiledesk-container img{max-width:230px}chat-root #tiledesk-container button.c21-button-primary{width:auto;height:40px;line-height:40px;margin:25px 0;padding:0 24px;opacity:1;text-align:center;font-size:1em;border-radius:40px;background-color:#2a6ac1;color:#fff;border:0px;cursor:pointer}chat-root #tiledesk-container button.c21-button-primary .c21-label-button{margin-left:8px;font-weight:400;font-size:.9em}chat-root #tiledesk-container button.c21-button-primary:hover,chat-root #tiledesk-container button.c21-button-primary:focus,chat-root #tiledesk-container button.c21-button-primary:active{opacity:.8}chat-root #tiledesk-container button.c21-button-link{font-weight:400;font-size:14px;color:#2a6ac1;text-decoration:none;background-color:transparent;border:1px solid transparent;cursor:pointer}chat-root #tiledesk-container button.c21-button-link:hover,chat-root #tiledesk-container button.c21-button-link:focus,chat-root #tiledesk-container button.c21-button-link:active{text-decoration:underline;outline:none}chat-root #tiledesk-container .c21-divBudge{position:absolute;top:0;width:auto;height:12px;min-width:12px;font-size:1em;line-height:1.2em;border-radius:50%;background-color:red;color:#fff;text-align:center;margin-top:-10px;display:inline-block;box-sizing:content-box;box-sizing:initial;padding:5px;left:0px}chat-root #tiledesk-container .c21-button{display:flex;cursor:pointer}chat-root #tiledesk-container .c21-close-button{position:absolute;width:35px;height:35px;top:0;right:0;margin:10px;z-index:10}chat-root #tiledesk-container .c21-close-button .c21-close-button-body{cursor:pointer;width:35px;height:35px;border-radius:8px;padding:0;margin:0;display:flex;align-items:center;-webkit-appearance:initial;border:none;background-color:rgba(0,0,0,0)}chat-root #tiledesk-container .c21-close-button .c21-close-button-body:hover{background-color:rgba(0,0,0,.4)}chat-root #tiledesk-container .c21-close-button .c21-close-button-body svg{margin:0 auto;fill:#fff}chat-root #tiledesk-container #chat21-spinner{display:none;width:70px;min-height:20px;margin:20px auto 0;text-align:center}chat-root #tiledesk-container #chat21-spinner.active{display:block}chat-root #tiledesk-container #chat21-spinner>div{width:12px;height:12px;background-color:#2a6ac1;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}chat-root #tiledesk-container #chat21-spinner .chat21-bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}chat-root #tiledesk-container #chat21-spinner .chat21-bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}chat-root #tiledesk-container #chat21-spinner span{display:block;margin:.5em 0 0;color:#1a1a1a;font-family:"Roboto",sans-serif;-webkit-animation:pulse 2s linear infinite;animation:pulse 2s linear infinite;text-align:center}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}chat-root #tiledesk-container #chat21-conversations{position:absolute;left:1px;right:1px;top:1px;bottom:1px;border-radius:16px;overflow:hidden;background-color:transparent;margin:0;padding:0}chat-root #tiledesk-container #chat21-conversations.full-screen-mode{width:100%;height:100%;right:0px;top:0px;left:0px;bottom:0px;border-radius:0;max-height:none}chat-root #tiledesk-container #chat21-conversations.isMobile{border-radius:0}chat-root #tiledesk-container #chat21-conversations.shadow{transition:box-shadow .8s ease-in;box-shadow:rgba(0,0,0,.16) 0 8px 36px}chat-root #tiledesk-container .chat21-fullscreen{width:100%;height:100%;right:0px;left:0px;bottom:0px;border-radius:0;max-height:none}chat-root #tiledesk-container .modal-page{position:absolute;height:100%;width:100%;z-index:1;background-color:transparent;opacity:0;display:none}chat-root #tiledesk-container .modal-page.active{display:inline-block;opacity:1}chat-root #tiledesk-container .modal-page.modal-slide-in-right{position:absolute;left:0px;opacity:1;display:inline-block;-webkit-animation-name:modal-active-in;-webkit-animation-duration:.3s;animation-name:modal-active-in;animation-duration:.3s}chat-root #tiledesk-container .modal-page.modal-slide-out-right{position:absolute;opacity:1;display:inline-block;-webkit-animation:slide-out-right .3s cubic-bezier(.55,.085,.68,.53) both;animation:slide-out-right .3s cubic-bezier(.55,.085,.68,.53) both}chat-root .c21-header{overflow:hidden;width:100%;height:52px;position:relative;margin:0;padding:0;color:#fff;z-index:10}chat-root .c21-header button:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:10%}chat-root .c21-header .c21-header-container{position:relative;height:52px;width:100%;margin:0 auto}chat-root .c21-header .c21-header-container .c21-header-content{position:absolute;top:0;left:0;width:100%;height:100%}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button{display:block;align-items:center;justify-content:center;text-align:center;width:35px;height:35px;margin:9px;padding:0;border-radius:8px;cursor:pointer}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-right{float:right}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-left{float:left}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-close{display:none}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button svg{height:20px;width:20px}chat-root .c21-header .c21-header-container .c21-header-content .c21-title{position:absolute;left:0;display:inline-block;width:calc(100% - 200px);height:1.6em;line-height:1.6em;padding:0;margin:10px 100px;text-align:center;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}chat-root .c21-body::-webkit-scrollbar{display:none}chat-root .c21-body{position:absolute;top:52px;bottom:0;left:0;right:0;padding:0;margin:0 auto;overflow:auto}chat-root .c21-body .c21-body-container{position:absolute;top:0;bottom:0;left:0;right:0;height:auto;width:auto}chat-root .c21-body .c21-body-container .c21-body-header{position:absolute;top:0;left:30px;right:30px;padding:10px 0;margin:0 auto;width:auto;height:auto;z-index:2}chat-root .c21-body .c21-body-container .c21-body-content{position:absolute;top:0;bottom:0;left:0;right:0;padding:0;margin:0 auto;height:auto}@media (max-width: 451px){chat-root #tiledesk-container .header-button.close{display:flex}}\n'],encapsulation:2}),i}(),kn=ye(39917),An=ye(79996),In=function(){function i(o,n,t){this.http=o,this.g=n,this.appConfigService=t,this.API_URL=t.getConfig().apiUrl}return i.prototype.getCurrent=function(o){var n=this.API_URL+o+"/publicanalytics/waiting/current",t=new Se.WM;return t.append("Content-Type","application/json"),this.http.get(n,{headers:t}).pipe((0,An.U)(function(r){return r}))},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),$e=ye(53717);function Vo(i,o){if(1&i&&e._UZ(0,"div",16,17),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.image+")")}}function Wo(i,o){if(1&i&&(e.TgZ(0,"div",18),e.O4$(),e.TgZ(1,"svg",19),e._UZ(2,"path",20),e._UZ(3,"path",21),e.qZA(),e.qZA()),2&i){var n=e.oxw().$implicit;e.ekj("not-read",null==n?null:n.is_new)}}function Yo(i,o){if(1&i&&(e.TgZ(0,"div",18),e.O4$(),e.TgZ(1,"svg",22),e._UZ(2,"path",23),e.qZA(),e.qZA()),2&i){var n=e.oxw().$implicit;e.ekj("not-read",n.is_new)}}var Go=function(i){return{"background-color":i}};function Jo(i,o){if(1&i&&(e.TgZ(0,"div",24),e._uU(1),e.qZA()),2&i){var n=e.oxw().$implicit,t=e.oxw();e.Q6J("ngStyle",e.VKq(2,Go,t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(n.badge)}}function Qo(i,o){if(1&i&&(e.TgZ(0,"div",25),e.TgZ(1,"button",26),e.O4$(),e.TgZ(2,"svg",27),e._UZ(3,"path",28),e._UZ(4,"path",29),e.TgZ(5,"title",30),e._uU(6),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(6),e.Oqu(n.translationMap.get("CLOSED"))}}var Ko=function(i){return{background:i}};function Xo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"button",2),e.NdJ("click",function(){var u=e.CHM(n).$implicit;return e.oxw().openConversationByID(u)}),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.TgZ(5,"span",6),e._uU(6),e.qZA(),e.YNc(7,Vo,2,2,"div",7),e.qZA(),e.qZA(),e.TgZ(8,"div",8),e.TgZ(9,"div",9),e._uU(10),e.ALo(11,"amTimeAgo"),e.qZA(),e.TgZ(12,"div",10),e._uU(13),e.qZA(),e.YNc(14,Wo,4,2,"div",11),e.YNc(15,Yo,3,2,"div",11),e.TgZ(16,"div",12),e._uU(17),e.qZA(),e.qZA(),e.YNc(18,Jo,2,4,"div",13),e.YNc(19,Qo,7,1,"div",14),e.qZA(),e._UZ(20,"div",15),e.qZA(),e.qZA()}if(2&i){var t=o.$implicit;e.xp6(4),e.Q6J("ngStyle",e.VKq(16,Ko,"linear-gradient(rgb(255,255,255) -125%, "+t.color+")")),e.xp6(2),e.Oqu(null==t?null:t.avatar),e.xp6(1),e.Q6J("ngIf",null==t?null:t.image),e.xp6(3),e.Oqu(e.lcZ(11,14,null==t?null:t.timestamp)),e.xp6(3),e.Oqu(null==t?null:t.sender_fullname),e.xp6(1),e.Q6J("ngIf","image"===(null==t?null:t.type)),e.xp6(1),e.Q6J("ngIf","image"!==t.type&&"text"!==t.type),e.xp6(1),e.ekj("not-read",t.is_new)("archived",t.archived),e.xp6(1),e.Oqu(t.last_message_text),e.xp6(1),e.Q6J("ngIf",t.is_new),e.xp6(1),e.Q6J("ngIf",t.archived)}}var Rn=function(){function i(o){this.iterableDiffers=o,this.onConversationSelected=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.convertMessage=Ft,this.setColorFromString=Ut,this.avatarPlaceholder=Bt,this.logger=Ce.getInstance(),this.empDifferMap=new Map,this.empMap=new Map,this.iterableDifferListConv=this.iterableDiffers.find([]).create(null)}return i.prototype.ngOnInit=function(){this.logger.debug("[LISTCONVERSATIONS] ngOnInit",this.listConversations)},i.prototype.ngOnChanges=function(o){},i.prototype.openConversationByID=function(o){this.logger.debug("[LISTCONVERSATIONS] openConversationByID: ",o),o&&(this.uidConvSelected=o.uid,this.onConversationSelected.emit(o))},i.prototype.ngAfterViewInit=function(){this.logger.debug("[LISTCONVERSATIONS] ---ngAfterViewInit---: listConversations ",this.listConversations)},i.prototype.ngDoCheck=function(){this.iterableDifferListConv.diff(this.listConversations)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.ZZ4))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-list-conversations"]],inputs:{listConversations:"listConversations",limit:"limit",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onConversationSelected:"onConversationSelected",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},features:[e.TTD],decls:3,vars:5,consts:[["id","c21-app-list-conversations"],[4,"ngFor","ngForOf"],["tabindex","1103",1,"c21-item-conversation",3,"click"],[1,"c21-body-conv"],[1,"c21-left-conv"],[1,"c21-ball",3,"ngStyle"],[1,"c21-ball-label"],["class","c21-avatar-image",3,"background-image",4,"ngIf"],[1,"c21-right-conv"],[1,"c21-last-time"],[1,"truncate","c21-name"],["class","c21-msg","style","float: left; margin-right: 5px;",3,"not-read",4,"ngIf"],[1,"truncate","c21-msg"],["class","c21-divBudge",3,"ngStyle",4,"ngIf"],["class","c21-icon-archived-chat",4,"ngIf"],[1,"clear"],[1,"c21-avatar-image"],["avatarImage",""],[1,"c21-msg",2,"float","left","margin-right","5px"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#000000","width","20px","height","20px","viewBox","0 0 24 24"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#000000","width","20px","height","20px","viewBox","0 0 24 24","transform","rotate(45)"],["d","M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"],[1,"c21-divBudge",3,"ngStyle"],[1,"c21-icon-archived-chat"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#aaaaaa","width","24px","height","24px","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0z"],["d","M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"],["id","altIconTitle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,Xo,21,18,"div",1),e.ALo(2,"slice"),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngForOf",e.Dn7(2,1,t.listConversations,0,t.limit)))},directives:[me.sg,me.PC,me.O5],pipes:[me.OU,$e.eG],styles:["[_nghost-%COMP%] .c21-msg[_ngcontent-%COMP%] >a>img{max-width:24%!important;vertical-align:middle}#c21-app-list-conversations[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:auto;font-size:10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;min-width:325;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{border-bottom:1px solid #eee;width:auto;text-align:left;padding:0 15px;position:relative;display:flex;align-items:center;height:60px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0;text-align:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:300;color:#8b8ea6;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:400;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .archived.c21-msg[_ngcontent-%COMP%]{margin-right:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:45px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:#2a6ac1;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-icon-archived-chat[_ngcontent-%COMP%]{border-radius:4px;position:absolute;right:0px;bottom:20px;margin-right:-5px;color:#858585;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center;color:#777}"]}),i}();function $o(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",10),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e.TgZ(1,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e._uU(2),e.qZA(),e.TgZ(3,"button",12),e.O4$(),e.TgZ(4,"svg",13),e._UZ(5,"path",14),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.hij("",t.g.SHOW_ALL_CONV," ")}}function ei(i,o){if(1&i&&(e.TgZ(0,"div"),e.TgZ(1,"div",8),e._uU(2),e.qZA(),e.YNc(3,$o,6,1,"div",9),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Oqu(n.g.PREV_CONVERSATIONS),e.xp6(1),e.Q6J("ngIf",1==n.g.showAllConversations)}}function ti(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",10),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e.TgZ(1,"div",15),e._uU(2),e.qZA(),e.O4$(),e.TgZ(3,"svg",16),e._UZ(4,"path",17),e._UZ(5,"path",18),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Oqu(t.g.SHOW_ALL_CONV)}}function ni(i,o){if(1&i&&(e.TgZ(0,"div"),e.TgZ(1,"div",8),e._uU(2),e.qZA(),e.YNc(3,ti,6,1,"div",9),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Oqu(n.g.NO_CONVERSATION),e.xp6(1),e.Q6J("ngIf",n.listConversations&&n.listConversations.length>0)}}function oi(i,o){if(1&i&&e._UZ(0,"div",25,26),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.imageurl+")")}}var Ln=function(i){return{"background-color":i}};function ii(i,o){if(1&i&&(e.TgZ(0,"div",21),e.TgZ(1,"div",22),e.TgZ(2,"span",23),e._uU(3),e.qZA(),e.YNc(4,oi,2,2,"div",24),e.qZA(),e.qZA()),2&i){var n=o.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(3,Ln,t.setColorFromString(n.firstname))),e.xp6(2),e.Oqu(t.avatarPlaceholder(n.firstname)),e.xp6(1),e.Q6J("ngIf",n.imageurl)}}function ri(i,o){if(1&i&&(e.TgZ(0,"div",19),e.YNc(1,ii,5,5,"div",20),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngForOf",n.availableAgents)}}function ai(i,o){if(1&i&&e._UZ(0,"div",25,26),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.imageurl+")")}}function si(i,o){if(1&i&&(e.TgZ(0,"div",35),e.TgZ(1,"div",22),e.TgZ(2,"span",23),e._uU(3),e.qZA(),e.YNc(4,ai,2,2,"div",24),e.qZA(),e.qZA()),2&i){var n=o.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(3,Ln,t.setColorFromString(n.firstname))),e.xp6(2),e.Oqu(t.avatarPlaceholder(n.firstname)),e.xp6(1),e.Q6J("ngIf",n.imageurl)}}var Nn=function(i,o,n){return{"background-color":i,"border-color":o,color:n}},Fn=function(){return{fill:"yellow"}},Bn=function(i){return{fill:i}};function li(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",27),e.YNc(1,si,5,5,"div",28),e.TgZ(2,"button",29,30),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(4,"span",31),e.O4$(),e.TgZ(5,"svg",32),e._UZ(6,"path",33),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"span",34),e._uU(8),e.qZA(),e._UZ(9,"div",3),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.availableAgents),e.xp6(1),e.Q6J("ngStyle",e.kEZ(5,Nn,t.g.themeColor,t.g.themeColor,t.g.themeForegroundColor)),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,Fn)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,Bn,t.g.themeForegroundColor)),e.xp6(2),e.hij(" ",t.g.LABEL_START_NW_CONV," ")}}function ci(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-list-conversations",38),e.NdJ("onConversationSelected",function(a){return e.CHM(n),e.oxw(2).onConversationSelectedFN(a)})("onImageLoaded",function(a){return e.CHM(n),e.oxw(2).onImageLoadedFN(a)})("onConversationLoaded",function(a){return e.CHM(n),e.oxw(2).onConversationLoadedFN(a)}),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("listConversations",t.listConversations)("limit",3)("stylesMap",t.stylesMap)("translationMap",t.translationMapConversation)}}function ui(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.YNc(1,ci,1,4,"chat-list-conversations",36),e.TgZ(2,"div",37),e.TgZ(3,"button",29,30),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(5,"span",31),e.O4$(),e.TgZ(6,"svg",32),e._UZ(7,"path",33),e.qZA(),e.qZA(),e.kcU(),e.TgZ(8,"span",34),e._uU(9),e.qZA(),e._UZ(10,"div",3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.listConversations&&t.listConversations.length>0),e.xp6(2),e.Q6J("ngStyle",e.kEZ(5,Nn,t.g.themeColor,t.g.themeColor,t.g.themeForegroundColor)),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,Fn)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,Bn,t.g.themeForegroundColor)),e.xp6(2),e.hij(" ",t.g.LABEL_START_NW_CONV," ")}}function hi(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER," ")}}function pi(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.WAITING_TIME_NOT_FOUND," ")}}function di(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.WAITING_TIME_NOT_FOUND)}}function gi(i,o){if(1&i&&(e.TgZ(0,"div",39),e.TgZ(1,"div",40),e.YNc(2,hi,2,1,"div",2),e.YNc(3,pi,2,1,"div",2),e.YNc(4,di,2,1,"div",2),e.qZA(),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Q6J("ngIf",n.waitingTime>=0&&!0===n.g.dynamicWaitTimeReply),e.xp6(1),e.Q6J("ngIf",n.waitingTime>=0&&!1===n.g.dynamicWaitTimeReply),e.xp6(1),e.Q6J("ngIf",-1==n.waitingTime)}}var fi=function(){function i(o,n,t,r,a,u){this.g=o,this.imageRepoService=n,this.chatManager=t,this.waitingService=r,this.translatorService=a,this.customTranslateService=u,this.onNewConversation=new e.vpe,this.onConversationSelected=new e.vpe,this.onOpenAllConvesations=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.subscriptions=[],this.convertMessage=Ft,this.setColorFromString=Ut,this.avatarPlaceholder=Bt,this.tenant="",this.themeColor="",this.themeForegroundColor="",this.availableAgents=[],this.langService=new kn.b,this.logger=Ce.getInstance(),this.humanizer=new kn.f(this.langService),this.humanizer.setOptions({round:!0}),this.initialize()}return i.prototype.ngOnInit=function(){this.logger.debug("[HOMECONVERSATIONS]---ngOnInit--- ",this.listConversations)},i.prototype.initTranslations=function(){this.translationMapConversation=this.customTranslateService.translateLanguage(["CLOSED"])},i.prototype.onConversationSelectedFN=function(o){o&&this.onConversationSelected.emit(o)},i.prototype.initialize=function(){var o=this;this.logger.debug("initialize: ListConversationsComponent"),this.initTranslations(),this.tenant=this.g.tenant,this.LABEL_START_NW_CONV=this.g.LABEL_START_NW_CONV,this.listConversations=[],this.archivedConversations=[],this.waitingTime=-1,this.availableAgents=this.g.availableAgents.slice(0,5),this.availableAgents.forEach(function(n){n.imageurl=o.imageRepoService.getImagePhotoUrl(n.id)}),this.logger.debug("[HOMECONVERSATIONS] tenant: ",this.tenant,this.availableAgents),this.logger.debug("[HOMECONVERSATIONS] this.listConversations.length",this.listConversations.length),this.logger.debug("[HOMECONVERSATIONS] this.listConversations",this.listConversations),this.showWaitingTime()},i.prototype.showWaitingTime=function(){var o=this,n=this,t=this.g.projectid;t&&this.waitingService.getCurrent(t).subscribe(function(r){if(n.logger.debug("[HOMECONVERSATIONS] response waiting",r),r&&r.length>0&&r[0].waiting_time_avg){var a=r[0].waiting_time_avg;n.waitingTime=a,n.logger.debug("[HOMECONVERSATIONS] that.waitingTime",n.waitingTime);var u=n.translatorService.getLanguage();n.humanWaitingTime=o.humanizer.humanize(a,{language:u}),o.g.WAITING_TIME_FOUND.includes("$reply_time")&&(o.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER=o.g.WAITING_TIME_FOUND.replace("$reply_time",n.humanWaitingTime))}})},i.prototype.checkShowAllConversation=function(){return!!(this.archivedConversations&&this.archivedConversations.length>0)||!!(this.listConversations&&this.listConversations.length>0)},i.prototype.openNewConversation=function(){this.onNewConversation.emit()},i.prototype.returnOpenAllConversation=function(){this.onOpenAllConvesations.emit()},i.prototype.onImageLoadedFN=function(o){this.onImageLoaded.emit(o)},i.prototype.onConversationLoadedFN=function(o){this.onConversationLoaded.emit(o)},i.prototype.openConversationByID=function(o){this.logger.debug("[HOMECONVERSATIONS] openConversationByID: ",o),o&&this.onConversationSelected.emit(o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[HOMECONVERSATIONS] ngOnDestroy list conv subscriptions",this.subscriptions),this.unsubscribe()},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.subListConversations=null,this.subArchivedConversations=null,this.logger.debug("[HOMECONVERSATIONS] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(st),e.Y36(Tt),e.Y36(In),e.Y36(Gt),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-home-conversations"]],inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",hideNewConversationButton:"hideNewConversationButton",stylesMap:"stylesMap"},outputs:{onNewConversation:"onNewConversation",onConversationSelected:"onConversationSelected",onOpenAllConvesations:"onOpenAllConvesations",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},decls:10,vars:6,consts:[["id","c21-app-list-conversations"],[1,"c21-header"],[4,"ngIf"],[1,"clear"],[1,"c21-body"],["style","margin: 20px 30px;",4,"ngIf"],["class","flex-container",4,"ngIf"],["class","c21-footer",4,"ngIf"],[1,"c21-title"],["class","c21-button",3,"click",4,"ngIf"],[1,"c21-button",3,"click"],[2,"display","inline-block","line-height","40px","margin-right","10px",3,"click"],["tabindex","1101","aria-label"," tutte le conversazioni",1,"c21-button-clean"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","20","height","20","viewBox","0 0 20 20",0,"xml","space","preserve",2,"enable-background","new 0 0 20 20"],["d","M1.9,15.4h16.2v-1.8H1.9V15.4z M1.9,10.9h16.2V9.1H1.9V10.9z M1.9,4.6v1.8h16.2V4.6H1.9z"],[2,"display","inline-block","line-height","40px","margin-right","10px"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0V0z"],["d","M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"],[2,"margin","20px 30px"],["class","c21-pallozzo",4,"ngFor","ngForOf"],[1,"c21-pallozzo"],[1,"c21-ball",3,"ngStyle"],[1,"c21-ball-label"],["class","c21-avatar-image",3,"background-image",4,"ngIf"],[1,"c21-avatar-image"],["avatarImage",""],[1,"flex-container"],["class","c21-pallozzo flex-inline-agent ",4,"ngFor","ngForOf"],["tabindex","1040","aflistconv","",1,"c21-button-primary",3,"ngStyle","click"],["aflistconv",""],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",3,"ngStyle"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],[1,"v-align-center","c21-label-button"],[1,"c21-pallozzo","flex-inline-agent"],[3,"listConversations","limit","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded",4,"ngIf"],[1,"c21-new-conversation"],[3,"listConversations","limit","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded"],[1,"c21-footer"],[1,"c21-waiting-time"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,ei,4,2,"div",2),e.YNc(3,ni,4,2,"div",2),e.qZA(),e._UZ(4,"div",3),e.TgZ(5,"div",4),e.YNc(6,ri,2,1,"div",5),e.YNc(7,li,10,12,"div",6),e.YNc(8,ui,11,12,"div",2),e.qZA(),e.YNc(9,gi,5,3,"div",7),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngIf",t.checkShowAllConversation()),e.xp6(1),e.Q6J("ngIf",!t.checkShowAllConversation()),e.xp6(3),e.Q6J("ngIf",(!t.listConversations||0==t.listConversations.length)&&!0===t.g.showAvailableAgents&&t.availableAgents&&t.availableAgents.length>1),e.xp6(1),e.Q6J("ngIf",(!t.listConversations||0==t.listConversations.length)&&t.availableAgents&&1===t.availableAgents.length&&!0===t.g.showAvailableAgents),e.xp6(1),e.Q6J("ngIf",t.availableAgents&&t.availableAgents.length>1||t.listConversations&&t.listConversations.length>0||t.availableAgents&&0===t.availableAgents.length),e.xp6(1),e.Q6J("ngIf",!0===t.g.showWaitTime))},directives:[me.O5,me.sg,me.PC,Rn],styles:["#c21-app-list-conversations[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:auto;font-size:10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{color:#5f6368;height:auto;position:relative;min-height:40px;display:block;font-weight:300;border-bottom:1px solid #f1f1f1;border-radius:0}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{font-size:1.4em;max-width:230px;line-height:normal;padding:14px 0 10px 24px;float:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%]{font-size:1.4em;margin:0;line-height:normal;padding:0 5px;float:right;fill:#2a6ac1}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:40px;height:40px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#5f6368}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:rgba(220,220,220,.4)!important}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:relative;display:inline-block;width:100%;height:auto;top:0px;font-size:1em;box-shadow:none;overflow:hidden;margin:0}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .flex-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-content:center;margin:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;min-width:344px;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{border-top:1px solid #eee;width:auto;text-align:left;margin:0 20px;position:relative;display:flex;align-items:center;height:80px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0;text-align:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:700;color:#3a3c4c;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:200;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-pallozzo[_ngcontent-%COMP%]{display:inline}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-pallozzo.flex-inline-agent[_ngcontent-%COMP%]{margin:auto 15px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-new-conversation[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;border-top:0px solid #eeeeee;display:flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-footer[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-footer[_ngcontent-%COMP%] .c21-waiting-time[_ngcontent-%COMP%]{font-size:1.3em;font-weight:200;padding:0 24px 10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:40px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:#2a6ac1;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{margin-left:8px;font-weight:400;font-size:1.2em}"]}),i}();function mi(i,o){if(1&i&&(e.TgZ(0,"div",15),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.userFullname)}}function vi(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",16),e._UZ(1,"path",17),e._UZ(2,"path",18),e.TgZ(3,"title",19),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(n.g.SOUND_OFF)}}function bi(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",16),e._UZ(1,"path",17),e._UZ(2,"path",20),e.TgZ(3,"title",19),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(n.g.SOUND_ON)}}function _i(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.SOUND_OFF,"")}}function Ci(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.SOUND_ON,"")}}function yi(i,o){if(1&i&&(e.O4$(),e.kcU(),e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(3);e.xp6(1),e.hij(" ",n.g.LOGOUT,"")}}function wi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).signOut()}),e.O4$(),e.TgZ(1,"svg",21),e._UZ(2,"path",17),e._UZ(3,"path",22),e.TgZ(4,"title",19),e._uU(5),e.qZA(),e.qZA(),e.YNc(6,yi,2,1,"span",11),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(t.g.LOGOUT),e.xp6(1),e.Q6J("ngIf",t.g.isLogged&&t.g.showLogoutOption)}}function Oi(i,o){if(1&i){var n=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"div",6),e.TgZ(1,"div",7),e.YNc(2,mi,2,1,"div",8),e.TgZ(3,"div",9),e.NdJ("click",function(){return e.CHM(n),e.oxw().toggleSound()}),e.YNc(4,vi,5,1,"svg",10),e.YNc(5,bi,5,1,"svg",10),e.YNc(6,_i,2,1,"span",11),e.YNc(7,Ci,2,1,"span",11),e.qZA(),e.YNc(8,wi,7,2,"div",12),e.TgZ(9,"div",13),e.TgZ(10,"span",14),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.g.signInWithCustomToken&&t.g.userFullname),e.xp6(2),e.Q6J("ngIf",!t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",!t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.isLogged&&t.g.showLogoutOption),e.xp6(3),e.hij(" ",t.g.BUILD_VERSION,"")}}var Mi=function(i){return{display:i}},xi=function(){function i(o){this.g=o,this.isHover=!1,this.onSignOut=new e.vpe}return i.prototype.ngOnInit=function(){this.themeColor50=Ie(this.g.themeColor,50)},i.prototype.f21_toggle_options=function(){this.g.setParameter("isOpenMenuOptions",!this.g.isOpenMenuOptions,!0)},i.prototype.toggleSound=function(){this.g.setParameter("soundEnabled",!this.g.soundEnabled,!0),this.g.setParameter("isOpenMenuOptions",!1,!0)},i.prototype.signOut=function(){this.g.setParameter("isOpenMenuOptions",!1,!0),this.onSignOut.emit()},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-menu-options"]],inputs:{isHover:"isHover"},outputs:{onSignOut:"onSignOut"},decls:7,vars:4,consts:[["id","c21-menu-options"],[1,"button-menu-options",3,"click","mouseover","mouseleave"],["xmlns","http://www.w3.org/2000/svg","enable-background","new 0 0 24 24","height","24px","width","24px","viewBox","0 0 24 24",3,"ngStyle"],["d","M0,0h24v24H0V0z","fill","none"],["d","M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"],["class","modal-menu-options",4,"ngIf"],[1,"modal-menu-options"],[1,""],["class","label-menu-welcome",4,"ngIf"],[1,"c21-button",3,"click"],["aria-labelledby","altIconTitle","class","icon-menu","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",4,"ngIf"],["class","label-menu-item",4,"ngIf"],["class","c21-button",3,"click",4,"ngIf"],[1,"c21-button","build_version_menu"],[1,"label-menu-item"],[1,"label-menu-welcome"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",1,"icon-menu"],["fill","none","d","M0 0h24v24H0V0z"],["d","M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"],["id","altIconTitle"],["d","M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24","aria-labelledby","altIconTitle",1,"icon-menu"],["d","M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.NdJ("click",function(){return t.f21_toggle_options()})("mouseover",function(){return t.isHover=!0})("mouseleave",function(){return t.isHover=!1}),e.O4$(),e.TgZ(2,"svg",2),e.TgZ(3,"g"),e._UZ(4,"path",3),e._UZ(5,"path",4),e.qZA(),e.qZA(),e.qZA(),e.YNc(6,Oi,12,7,"div",5),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.VKq(2,Mi,t.isHover||t.g.isOpenMenuOptions?"block":"none")),e.xp6(4),e.Q6J("ngIf",t.g.isOpenMenuOptions))},directives:[me.PC,me.O5],styles:["#c21-menu-options[_ngcontent-%COMP%] .modal-menu-options[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;bottom:40px;right:10px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;background-color:#fff;z-index:25;box-shadow:0 4px 15px rgba(0,0,0,.2),0 1px 2px rgba(0,0,0,.2)}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]{position:absolute;width:auto;line-height:12px;font-size:1em;font-weight:bold;color:#777;display:inline-block;align-items:center;margin:4px 20px;padding:0;cursor:pointer;width:22px;height:22px;right:0px}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#5f6368;display:none}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]:hover{border-radius:50%}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{display:block}.c21-button[_ngcontent-%COMP%]{cursor:pointer;margin:5px;padding:5px 10px;color:#777;display:flex}.c21-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;border-radius:6px;cursor:pointer}.build_version_menu[_ngcontent-%COMP%]{color:#aaa;justify-content:center;font-size:1em}.build_version_menu[_ngcontent-%COMP%]:hover{cursor:default;background-color:unset}.label-menu-welcome[_ngcontent-%COMP%]{cursor:default;font-weight:500;margin:10px 0;padding:0 10px}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;border:1px solid #d7d7d7;background-color:#fff;padding:10px 0}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center}.label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}.icon-menu[_ngcontent-%COMP%]{fill:#5f6368}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}"]}),i}(),Ei=["homeComponent"],Ti=["aflistconv"];function Si(i,o){if(1&i&&(e.TgZ(0,"div",26),e._UZ(1,"div",27,28),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Udp("background-image","url("+n.g.project.logoChat+")")}}function Pi(i,o){if(1&i&&(e.TgZ(0,"div",29),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Oqu(n.g.welcomeMsg)}}function ki(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-menu-options",30),e.NdJ("onSignOut",function(){return e.CHM(n),e.oxw().onSignOutFN()}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("isHover",t.hover)}}var Ai=function(i,o){return{color:i,"background-image":o}},Ii=function(i){return{display:i}},Ri=function(i){return{fill:i}},Li=function(){function i(o){this.g=o,this.onNewConversation=new e.vpe,this.onConversationSelected=new e.vpe,this.onOpenAllConvesations=new e.vpe,this.onCloseWidget=new e.vpe,this.onSignOut=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.hover=!1,this.convertColorToRGBA=Ie,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.debug("[HOME-COMP] ngOnInit")},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.debug("[HOME-COMP]---ngAfterViewInit--- "),!0===this.g.firstOpen&&(this.addAnimation(),this.g.firstOpen=!1),setTimeout(function(){o.aflistconv&&o.aflistconv.nativeElement.focus()},1e3)},i.prototype.onNewConversationFN=function(){this.removeAnimation(),this.onNewConversation.emit()},i.prototype.onOpenAllConversation=function(){this.removeAnimation(),this.onOpenAllConvesations.emit()},i.prototype.onConversationSelectedFN=function(o){o&&(this.removeAnimation(),this.onConversationSelected.emit(o))},i.prototype.onImageLoadedFN=function(o){this.onImageLoaded.emit(o)},i.prototype.onConversationLoadedFN=function(o){this.onConversationLoaded.emit(o)},i.prototype.f21_close=function(){this.addAnimation(),this.onCloseWidget.emit()},i.prototype.hideMenuOptions=function(){this.logger.debug("[HOME-COMP] hideMenuOptions"),this.g.setParameter("isOpenMenuOptions",!1,!0)},i.prototype.onSignOutFN=function(){this.onSignOut.emit()},i.prototype.addAnimation=function(){try{var o=this.element.nativeElement;o&&o.classList.add("start-animation")}catch(n){this.logger.error("[HOME-COMP] addAnimation > Error :"+n)}},i.prototype.removeAnimation=function(){try{var o=this.element.nativeElement;o&&o.classList.remove("start-animation")}catch(n){this.logger.error("[HOME-COMP] removeAnimation > Error :"+n)}},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-home"]],viewQuery:function(n,t){if(1&n&&(e.Gf(Ei,5),e.Gf(Ti,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.element=r.first),e.iGM(r=e.CRH())&&(t.aflistconv=r.first)}},inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",hideSettings:"hideSettings",hideNewConversationButton:"hideNewConversationButton",stylesMap:"stylesMap"},outputs:{onNewConversation:"onNewConversation",onConversationSelected:"onConversationSelected",onOpenAllConvesations:"onOpenAllConvesations",onCloseWidget:"onCloseWidget",onSignOut:"onSignOut",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},decls:28,vars:22,consts:[["id","chat21-home-component","tabindex","2002","onFocus","document.querySelector('[aflistconv]').focus()"],["homeComponent",""],[1,"c21-header",3,"ngStyle","click"],[1,"c21-header-container"],[1,"c21-header-button",3,"ngStyle"],[1,"c21-close-button"],["tabindex","2001","aria-label"," chiudi chat",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],[1,"c21-header-content"],["class","avatar-project","item-start","",4,"ngIf"],[1,"c21-text","fade-in-bottom"],[1,"c21-text-welcome"],["class","c21-text-intro",4,"ngIf"],[1,"c21-body",3,"click"],[1,"c21-body-content"],[1,"c21-cards"],[1,"c21-card-blank","fade-in-top"],[1,"c21-card","fade-in-top"],[3,"listConversations","archivedConversations","hideNewConversationButton","stylesMap","onNewConversation","onConversationSelected","onOpenAllConvesations","onImageLoaded","onConversationLoaded"],[1,"c21-footer","fade-in-bottom-footer"],["id","c21-powered-by",3,"mouseover","mouseleave"],["tabindex","-1",1,"c21-powered-by",3,"innerHTML"],[3,"isHover","onSignOut",4,"ngIf"],["item-start","",1,"avatar-project"],[1,"avatar-image"],["avatarImage",""],[1,"c21-text-intro"],[3,"isHover","onSignOut"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.NdJ("click",function(){return t.hideMenuOptions()}),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.f21_close()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.TgZ(10,"title",10),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",11),e.YNc(13,Si,3,2,"div",12),e.TgZ(14,"div",13),e.TgZ(15,"div",14),e._uU(16),e.qZA(),e.YNc(17,Pi,2,1,"div",15),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(18,"div",16),e.NdJ("click",function(){return t.hideMenuOptions()}),e.TgZ(19,"div",17),e.TgZ(20,"div",18),e._UZ(21,"div",19),e.TgZ(22,"div",20),e.TgZ(23,"chat-home-conversations",21),e.NdJ("onNewConversation",function(){return t.onNewConversationFN()})("onConversationSelected",function(a){return t.onConversationSelectedFN(a)})("onOpenAllConvesations",function(){return t.onOpenAllConversation()})("onImageLoaded",function(a){return t.onImageLoadedFN(a)})("onConversationLoaded",function(a){return t.onConversationLoadedFN(a)}),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(24,"div",22),e.TgZ(25,"div",23),e.NdJ("mouseover",function(){return t.hover=!0})("mouseleave",function(){return t.hover=!1}),e._UZ(26,"div",24),e.qZA(),e.YNc(27,ki,1,1,"chat-menu-options",25),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(15,Ai,t.g.themeForegroundColor,t.g.colorGradient)),e.xp6(2),e.Q6J("ngStyle",e.VKq(18,Ii,t.g.hideHeaderCloseButton?"none":"block")),e.xp6(3),e.Q6J("ngStyle",e.VKq(20,Ri,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.BUTTON_CLOSE_TO_ICON),e.xp6(2),e.Q6J("ngIf","nologo"!==t.g.project.logoChat),e.xp6(3),e.Oqu(null==t.g?null:t.g.welcomeTitle),e.xp6(1),e.Q6J("ngIf",t.g.welcomeMsg),e.xp6(2),e.ekj("nologo","nologo"===t.g.project.logoChat),e.xp6(4),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("hideNewConversationButton",t.hideNewConversationButton)("stylesMap",t.stylesMap),e.xp6(3),e.Q6J("innerHTML",t.g.poweredBy,e.oJD),e.xp6(1),e.Q6J("ngIf",!t.hideSettings))},directives:[me.PC,me.O5,fi,xi],styles:['#chat21-home-component{position:absolute;width:100%;height:100%}#chat21-home-component.start-animation .fade-in-top{-webkit-animation:fade-in-top .5s cubic-bezier(.39,.575,.565,1) .3s both;animation:fade-in-top .5s cubic-bezier(.39,.575,.565,1) .3s both}#chat21-home-component.start-animation .fade-in-bottom{-webkit-animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s;animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s}#chat21-home-component .c21-header{position:absolute;width:100%;height:500px;border-radius:0 0 16px 16px;overflow:hidden;margin:0;padding:0}#chat21-home-component .c21-header .c21-header-container{padding:0;margin:0;width:100%;height:100%;position:absolute}#chat21-home-component .c21-header .c21-header-container .c21-header-button{display:block;width:100%;height:70px;position:absolute;margin:0}#chat21-home-component .c21-header .c21-header-container .flex-container{display:flex;align-items:stretch;margin:30px 40px 0;width:auto;height:auto}#chat21-home-component .c21-header .c21-header-container .flex-container .avatar-project{width:22%}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text{font-family:"Google Sans"}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text .c21-text-welcome{overflow:hidden;line-height:1.2em;max-height:2.4em;font-weight:400;font-size:3em;margin-bottom:10px}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text .c21-text-intro{display:inline-block;font-size:1.4em;font-weight:300;line-height:1.2em;max-height:2.4em}#chat21-home-component .c21-header .c21-header-container .c21-header-content{margin:55px 40px 0;width:auto;height:auto;display:flex;align-items:stretch}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-logo{position:relative;width:auto;height:70px;margin-bottom:20px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-logo img{max-width:100%;max-height:100%;margin:auto 0;display:block}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text{font-family:"Roboto";margin:0 0 0 15px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text .c21-text-welcome{overflow:hidden;line-height:1.4em;max-height:3em;font-weight:200;font-size:2.5em;margin-bottom:15px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text .c21-text-intro{display:inline-block;font-size:1.7em;font-weight:600;line-height:1.2em;max-height:2.4em}#chat21-home-component .c21-body{position:absolute;width:100%;height:calc(100% - 30px);padding:0;margin:0;overflow:auto;background-color:#fff;top:0;box-shadow:none}#chat21-home-component .c21-body .c21-body-content{position:relative;padding:180px 25px 20px;margin:0}#chat21-home-component .c21-body .c21-body-content.nologo{padding:180px 10px 20px}#chat21-home-component .c21-body .c21-body-content .c21-cards .c21-card-blank{width:0;height:0;position:absolute;margin:-8px 16px;border-radius:0;z-index:40;border-style:solid;border-width:0px 15px 15px 15px;border-color:transparent transparent #ffffff transparent}#chat21-home-component .c21-body .c21-body-content .c21-cards .c21-card{position:relative;margin-bottom:20px;background-color:#fff;border-radius:16px;font-size:1.4em;line-height:1.4;color:#1a1a1a;overflow:hidden;-webkit-box-shadow:0 4px 15px 0 rgba(0,0,0,.2),0 1px 2px 0 rgba(0,0,0,.2);z-index:20;text-align:left}#chat21-home-component .c21-footer{position:absolute;width:100%;height:40px;bottom:0px;display:flex;background-color:#fff;z-index:20}#chat21-home-component .c21-footer#c21-powered-by{display:block!important}#chat21-home-component .c21-footer .c21-powered-by{height:40px;text-align:center;padding:0;position:absolute;color:#aaa;top:0;left:20px;display:flex;align-items:center}#chat21-home-component .c21-footer .c21-powered-by a{text-decoration:none;cursor:pointer;display:inline-block;color:#aaa;font-size:1.1em;font-weight:500;line-height:22px;font-family:Mulish,sans-serif;letter-spacing:-.24px;-webkit-font-smoothing:antialiased}#chat21-home-component .c21-footer .c21-powered-by a span{display:inline-block;position:relative;top:2px}#chat21-home-component .c21-footer .c21-powered-by a img{width:80px;height:auto;max-height:40px;position:relative;vertical-align:middle;-o-object-fit:contain;object-fit:contain}#chat21-home-component .c21-footer .c21-powered-by b{font-weight:bolder}#chat21-home-component .c21-footer .build_version{display:none;font-size:1em;color:#aaa;position:absolute;bottom:0px;right:40px;line-height:30px}#chat21-home-component .c21-footer #c21-powered-by{width:calc(100% - 40px)}#chat21-home-component .c21-footer #c21-powered-by:hover div.build_version{display:block}@media (max-width: 451px){#tiledesk-container .c21-header-button.close{display:flex}}\n'],encapsulation:2}),i}(),Ni=["afallconv"],Fi=function(i,o){return{color:i,"background-image":o}},Un=function(i){return{fill:i}},Bi=function(i){return{color:i}},Ui=function(){function i(o,n,t){this.g=o,this.iterableDiffers=n,this.customTranslateService=t,this.onConversationSelected=new e.vpe,this.onCloseWidget=new e.vpe,this.convertMessage=Ft,this.subscriptions=[],this.logger=Ce.getInstance(),this.iterableDifferListConv=this.iterableDiffers.find([]).create(null),this.iterableDifferListArchivedConv=this.iterableDiffers.find([]).create(null)}return i.prototype.ngOnInit=function(){this.initialize()},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afallconv&&o.afallconv.nativeElement.focus()},1e3)},i.prototype.ngDoCheck=function(){var o=this.iterableDifferListConv.diff(this.listConversations),n=this.iterableDifferListArchivedConv.diff(this.archivedConversations);(o||n)&&this.concatAndOrderArray()},i.prototype.initTranslations=function(){this.translationMapConversation=this.customTranslateService.translateLanguage(["CLOSED"])},i.prototype.initialize=function(){this.logger.debug("[LISTALLCONVERSATIONS] initialize"),this.initTranslations(),this.LABEL_START_NW_CONV=this.g.LABEL_START_NW_CONV,this.allConversations=[],this.logger.debug("[LISTALLCONVERSATIONS] listconversations",this.listConversations,this.archivedConversations),this.concatAndOrderArray()},i.prototype.concatAndOrderArray=function(){var o,n,t;if(this.listConversations&&this.listConversations.length>0?t=this.archivedConversations&&this.archivedConversations.length>0?this.listConversations.concat(this.archivedConversations):this.listConversations:this.archivedConversations&&this.archivedConversations.length>0&&(t=this.archivedConversations),t){var r=[],a=new Map;try{for(var u=(0,_e.XA)(t),y=u.next();!y.done;y=u.next()){var j=y.value;a.has(j.uid)||(a.set(j.uid,!0),r.push(j))}}catch(J){o={error:J}}finally{try{y&&!y.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}this.allConversations=r,this.allConversations.sort(function(i,o){return void 0===o&&(o="asc"),function(n,t){if(!n.hasOwnProperty(i)||!t.hasOwnProperty(i))return 0;var r="string"==typeof n[i]?n[i].toUpperCase():n[i],a="string"==typeof t[i]?t[i].toUpperCase():t[i],u=0;return r>a?u=1:r<a&&(u=-1),"desc"===o?-1*u:u}}("timestamp","desc")),this.logger.debug("[LISTALLCONVERSATIONS] concatAndOrderArray ",this.allConversations)}},i.prototype.returnClosePage=function(){this.onCloseWidget.emit()},i.prototype.onConversationSelectedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] openConversationByID: ",o),o&&this.onConversationSelected.emit(o)},i.prototype.onImageLoadedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] onImageLoadedFN",o)},i.prototype.onConversationLoadedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] onImageLoadedFN",o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[LISTALLCONVERSATIONS] ngOnDestroy ->list conv subscriptions",this.subscriptions)},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.allConversations=[],this.listConversations=[],this.archivedConversations=[]},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(e.ZZ4),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-list-all-conversations"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ni,5),2&n)&&(e.iGM(r=e.CRH())&&(t.afallconv=r.first))},inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",stylesMap:"stylesMap"},outputs:{onConversationSelected:"onConversationSelected",onCloseWidget:"onCloseWidget"},decls:21,vars:19,consts:[["id","c21-app-list-all-conversations"],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],[1,"c21-header-button","c21-right","c21-close"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["tabindex","1310","aria-label","indietro",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],["tabindex","1311","onFocus","document.querySelector('[start-focus]').focus()",1,"c21-body"],[3,"listConversations","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.O4$(),e.TgZ(5,"svg",5),e._UZ(6,"path",6),e._UZ(7,"path",7),e.TgZ(8,"title",8),e._uU(9),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"button",9),e.NdJ("click",function(){return t.returnClosePage()}),e.O4$(),e.TgZ(11,"svg",5),e._UZ(12,"path",6),e._UZ(13,"path",10),e.TgZ(14,"title",8),e._uU(15),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(16,"div",11),e.TgZ(17,"div",12),e._uU(18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"div",13),e.TgZ(20,"chat-list-conversations",14),e.NdJ("onConversationSelected",function(a){return t.onConversationSelectedFN(a)})("onImageLoaded",function(a){return t.onImageLoadedFN(a)})("onConversationLoaded",function(a){return t.onConversationLoadedFN(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngStyle",e.WLB(10,Fi,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(4),e.Q6J("ngStyle",e.VKq(13,Un,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.BUTTON_CLOSE_TO_ICON),e.xp6(2),e.Q6J("ngStyle",e.VKq(15,Un,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.PREV_CONVERSATIONS),e.xp6(1),e.Q6J("ngStyle",e.VKq(17,Bi,t.g.themeForegroundColor)),e.xp6(2),e.Oqu(t.g.project.widgetTitle),e.xp6(2),e.Q6J("listConversations",t.allConversations)("stylesMap",t.stylesMap)("translationMap",t.translationMapConversation))},directives:[me.PC,Rn],styles:["#c21-app-list-all-conversations[_ngcontent-%COMP%]{display:block;height:auto;font-size:10px;background-color:#fff;width:100%;height:100%;position:relative;margin:0;padding:0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px;position:relative;margin:0;padding:0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;font-size:1em;line-height:40px;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{position:relative;height:52px;width:100%;margin:0 auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;bottom:3px;width:100%;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-pallozzo[_ngcontent-%COMP%]{display:inline}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:calc(100% - 52px);top:0px;font-size:1em;box-shadow:none;overflow:auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;border-bottom:1px solid #eeeeee;background-color:#fff;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{width:auto;margin:0 24px;position:relative;display:flex;align-items:center;height:80px;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:14px;color:#fff;font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:2px 0 0;background-repeat:no-repeat;background-position:center;background-size:cover}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:700;color:#3a3c4c;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:200;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:40px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:red;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-lablel-close[_ngcontent-%COMP%]{border:1px solid #e2e2e2;background-color:#ececec;padding:4px;border-radius:4px;position:absolute;right:0px;bottom:2px;margin-right:-10px;color:#858585;font-weight:500}"]}),i}(),Zi=function(){return function(o){this.createdAt=new Date,this.file=o}}(),Oe=ye(31041),Zn=ye(51868),Di=["chat21_file"],Dn=function(i,o,n){return{"background-color":i,"border-color":o,color:n}};function Hi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).onContinueConversation()}),e.TgZ(1,"span",11),e._uU(2),e.qZA(),e._UZ(3,"div",12),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("ngStyle",e.kEZ(2,Dn,t.stylesMap.get("themeColor"),t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.hij(" ",null==t.translationMap?null:t.translationMap.get("CONTINUE")," ")}}var zi=function(){return{fill:"yellow"}},ji=function(i){return{fill:i}};function qi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",5),e.TgZ(1,"button",6,7),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(3,"span",8),e.O4$(),e.TgZ(4,"svg",9),e._UZ(5,"path",10),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",11),e._uU(7),e.qZA(),e._UZ(8,"div",12),e.qZA(),e.YNc(9,Hi,4,6,"button",13),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.kEZ(5,Dn,t.stylesMap.get("themeColor"),t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,zi)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,ji,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.hij(" ",null==t.translationMap?null:t.translationMap.get("LABEL_START_NW_CONV")," "),e.xp6(2),e.Q6J("ngIf",t.showContinueConversationButton)}}function Vi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.TgZ(1,"textarea",16,17),e.NdJ("ngModelChange",function(a){return e.CHM(n),e.oxw().textInputTextArea=a})("ngModelChange",function(){return e.CHM(n),e.oxw().onTextAreaChange()})("keypress",function(a){return e.CHM(n),e.oxw().onkeypress(a)})("keydown",function(a){return e.CHM(n),e.oxw().onkeydown(a)})("paste",function(a){return e.CHM(n),e.oxw().onPaste(a)}),e._uU(3),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.ekj("disabled",!(!t.isConversationArchived&&!t.hideTextReply)||null),e.xp6(1),e.Q6J("ngModel",t.textInputTextArea),e.uIk("disabled",!!t.hideTextReply||null)("placeholder",t.footerMessagePlaceholder?t.footerMessagePlaceholder:null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER")),e.xp6(2),e.hij(' \x3c!-- placeholder="',null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER"),'"> --\x3e\n ')}}var Wi=function(){return{display:"block",height:"1px",width:"1px",overflow:"hidden"}};function Yi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"label",29),e.TgZ(1,"span",8),e.O4$(),e.TgZ(2,"svg",30),e._UZ(3,"path",31),e.qZA(),e.qZA(),e.kcU(),e.TgZ(4,"input",32,33),e.NdJ("change",function(a){return e.CHM(n),e.oxw(2).detectFiles(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.ekj("active",!t.isFilePendingToUpload&&!t.hideTextReply),e.xp6(4),e.Q6J("accept",t.fileUploadAccept)("ngStyle",e.DdM(5,Wi)),e.uIk("disabled",!!(t.isFilePendingToUpload||t.isConversationArchived||t.hideTextReply)||null)}}function Gi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",null,18),e.YNc(2,Yi,6,6,"label",19),e.TgZ(3,"div",20),e.NdJ("click",function(a){return e.CHM(n),e.oxw().onSendPressed(a)}),e.TgZ(4,"span",8),e.O4$(),e.TgZ(5,"svg",21),e._UZ(6,"path",22),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"label",23),e.NdJ("click",function(){return e.CHM(n),e.oxw().onEmojiiPickerClicked()}),e.TgZ(8,"span",8),e.O4$(),e.TgZ(9,"svg",24),e._UZ(10,"path",25),e._UZ(11,"circle",26),e._UZ(12,"circle",27),e._UZ(13,"path",28),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",1==t.showAttachmentButton),e.xp6(1),e.ekj("active",t.textInputTextArea&&!t.hideTextReply),e.xp6(4),e.ekj("active",!t.isFilePendingToUpload&&!t.hideTextReply)}}function Ji(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"emoji-mart",34),e.NdJ("emojiSelect",function(a){return e.CHM(n),e.oxw().addEmoji(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("showPreview",t.emojiiOptions.showPreview)("color",null==t.stylesMap?null:t.stylesMap.get("themeColor"))("perLine",t.emojiiOptions.emojiPerLine)("totalFrequentLines",t.emojiiOptions.totalFrequentLines)("enableSearch",t.emojiiOptions.enableSearch)("darkMode",t.emojiiOptions.darkMode)("include",t.emojiiOptions.include)}}var Hn=function(){function i(o,n,t,r){this.g=o,this.chatManager=n,this.typingService=t,this.uploadService=r,this.onEmojiiPickerShow=new e.vpe,this.onBeforeMessageSent=new e.vpe,this.onAfterSendMessage=new e.vpe,this.onChangeTextArea=new e.vpe,this.onAttachmentFileButtonClicked=new e.vpe,this.onNewConversationButtonClicked=new e.vpe,this.onBackButton=new e.vpe,this.isFilePendingToUpload=!1,this.arrayFilesLoad=[],this.isFileSelected=!1,this.HEIGHT_DEFAULT="20px",this.showEmojiPicker=!1,this.emojiiOptions={emojiPerLine:9,totalFrequentLines:1,showPreview:!1,darkMode:!1,enableSearch:!1,include:["recent","people","nature","activity"]},this.convertColorToRGBA=Ie,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){o.conversationWith&&void 0!==o.conversationWith.currentValue&&(this.conversationHandlerService=this.chatManager.getConversationHandlerByConversationId(this.conversationWith)),o.hideTextReply&&void 0!==o.hideTextReply.currentValue&&this.restoreTextArea()},i.prototype.ngAfterViewInit=function(){this.logger.debug("[CONV-FOOTER] --------ngAfterViewInit: conversation-footer-------- "),this.showEmojiPicker=!0},i.prototype.detectFiles=function(o){if(this.logger.debug("[CONV-FOOTER] detectFiles: ",o),o){this.selectedFiles=o.target.files,this.logger.debug("[CONV-FOOTER] AppComponent:detectFiles::selectedFiles",this.selectedFiles),this.isFilePendingToUpload=null!=this.selectedFiles,this.logger.debug("[CONV-FOOTER] AppComponent:detectFiles::selectedFiles::isFilePendingToUpload",this.isFilePendingToUpload),this.logger.debug("[CONV-FOOTER] fileChange: ",o.target.files),this.isFilePendingToUpload=!(o.target.files.length<=0);var n=this;if(o.target.files&&o.target.files[0]){var t=o.target.files[0].name,r=o.target.files[0].type,a=new FileReader;n.logger.debug("[CONV-FOOTER] OK preload: ",t,r,a),a.addEventListener("load",function(){if(n.logger.debug("[CONV-FOOTER] addEventListener load",a.result),n.isFileSelected=!0,r.startsWith("image")&&!r.includes("svg")){var u=new Image;n.logger.debug("[CONV-FOOTER] onload ",u),u.src=a.result.toString(),u.title=t,u.onload=function(){n.logger.debug("[CONV-FOOTER] onload image");var J=(new Date).getTime().toString(36);n.arrayFilesLoad[0]={uid:J,file:u,type:r},n.logger.debug("[CONV-FOOTER] OK: ",n.arrayFilesLoad[0]),n.loadFile()}}else{n.logger.debug("[CONV-FOOTER] onload file");var y={src:a.result.toString(),title:t},j=(new Date).getTime().toString(36);n.arrayFilesLoad[0]={uid:j,file:y,type:r},n.logger.debug("[CONV-FOOTER] OK: ",n.arrayFilesLoad[0]),n.loadFile()}},!1),o.target.files[0]&&(a.readAsDataURL(o.target.files[0]),n.logger.debug("[CONV-FOOTER] reader-result: ",o.target.files[0]))}}},i.prototype.loadFile=function(){if(this.logger.debug("[CONV-FOOTER] that.fileXLoad: ",this.arrayFilesLoad),this.arrayFilesLoad[0]&&this.arrayFilesLoad[0].file){var o=this.arrayFilesLoad[0].file,n=this.arrayFilesLoad[0].uid,t=this.arrayFilesLoad[0].type;this.logger.debug("[CONV-FOOTER] that.fileXLoad: ",t);var r;r=t.startsWith("image")&&!t.includes("svg")?{name:o.title,src:o.src,width:o.width,height:o.height,type:t,uid:n}:{name:o.title,src:o.src,type:t,uid:n},this.logger.debug("[CONV-FOOTER] metadata -------\x3e ",r);var a=this.selectedFiles.item(0);this.onAttachmentFileButtonClicked.emit({attachments:[{metadata:r,file:a}],message:this.textInputTextArea}),this.restoreTextArea(),this.chat21_file.nativeElement.value=""}},i.prototype.uploadSingle=function(o,n,t){var r=this;document.getElementById("chat21-start-upload-doc").disabled=!0,r.logger.debug("[CONV-FOOTER] AppComponent::uploadSingle::",o,n);var u=new Zi(n);this.uploadService.upload(this.senderId,u).then(function(y){r.logger.debug("[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL",y),r.logger.debug("[CONV-FOOTER] Successfully uploaded file and got download link - "+y),o.src=y;var j=B,J="["+o.name+"]("+o.src+")";o.type.startsWith("image")&&!o.type.includes("svg")?(j=I,J=t):o.type.startsWith("image")&&o.type.includes("svg")||!o.type.startsWith("image")?(j=$,J=J+"\n"+t):o.type.startsWith("image")||(j=$,J=J+"\n"+t),r.sendMessage(J,j,o),r.chat21_file.nativeElement.value="",r.isFilePendingToUpload=!1}).catch(function(y){r.logger.error("[CONV-FOOTER] uploadSingle:: Failed to upload file and get link - "+y),r.isFilePendingToUpload=!1}),r.logger.debug("[CONV-FOOTER] reader-result: ",n)},i.prototype.sendMessage=function(o,n,t,r){var a,u,y,j;if(t=t||"",this.onEmojiiPickerShow.emit(!1),this.logger.debug("[CONV-FOOTER] SEND MESSAGE: ",o,n,t,r),o&&""!==o.trim()||n===I||n===$){var J=this.translationMap.get("GUEST_LABEL"),ie=this.attributes,ue={};if(ie)try{for(var ge=(0,_e.XA)(Object.entries(ie)),de=ge.next();!de.done;de=ge.next()){var ve=(0,_e.CR)(de.value,2);ue[ve[0]]=ve[1]}}catch(et){a={error:et}}finally{try{de&&!de.done&&(u=ge.return)&&u.call(ge)}finally{if(a)throw a.error}}if(r)try{for(var Ae=(0,_e.XA)(Object.entries(r)),Be=Ae.next();!Be.done;Be=Ae.next()){var Ze=(0,_e.CR)(Be.value,2);ue[Ze[0]]=Ze[1]}}catch(et){y={error:et}}finally{try{Be&&!Be.done&&(j=Ae.return)&&j.call(Ae)}finally{if(y)throw y.error}}var ze=this.senderId,je=this.projectid,Ye=this.channelType,ot=this.conversationWith;J=this.userFullname||this.userEmail||(ue&&ue.userFullname?ue.userFullname:this.translationMap.get("GUEST_LABEL")),this.onBeforeMessageSent.emit({senderFullname:J,text:o,type:n,metadata:t,conversationWith:ot,recipientFullname:J,attributes:ue,projectid:je,channelType:Ye});var tt=this.conversationHandlerService.sendMessage(o,n,t,ot,J,ze,J,Ye,ue);this.onAfterSendMessage.emit(tt);try{var dt=document.getElementById("chat21-main-message-context");dt.value="",dt.style.height=this.HEIGHT_DEFAULT}catch(et){this.logger.error("[CONV-FOOTER] > Error :"+et)}this.restoreTextArea()}},i.prototype.restoreTextArea=function(){this.resizeInputField();var o=document.getElementById("chat21-main-message-context");this.textInputTextArea="",o&&(o.value="",o.placeholder=this.translationMap.get("LABEL_PLACEHOLDER"),o.style.height>this.HEIGHT_DEFAULT&&document.getElementById("chat21-button-send").style.removeProperty("right"),this.logger.debug("[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea::textArea:","restored")),this.setFocusOnId("chat21-main-message-context")},i.prototype.resizeInputField=function(){try{var o=document.getElementById("chat21-main-message-context");o&&(o.style.height="100%"),o&&"\n"===o.value?(o.value="",o.style.height=this.HEIGHT_DEFAULT):o&&o.scrollHeight>o.offsetHeight?(o.style.height=o.scrollHeight+2+"px",o.style.minHeight=this.HEIGHT_DEFAULT):o&&(o.style.height=this.HEIGHT_DEFAULT),this.onChangeTextArea.emit({textAreaEl:o,minHeightDefault:this.HEIGHT_DEFAULT})}catch(n){this.logger.error("[CONV-FOOTER] > Error :"+n)}},i.prototype.onTextAreaChange=function(){this.resizeInputField(),this.setWritingMessages(this.textInputTextArea)},i.prototype.onSendPressed=function(o){this.logger.debug("[CONV-FOOTER] onSendPressed:event",o),o.preventDefault(),this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:",this.isFilePendingToUpload),this.isFilePendingToUpload?(this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed","is a file"),this.loadFile(),this.isFilePendingToUpload=!1,this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:",this.isFilePendingToUpload)):this.textInputTextArea&&this.textInputTextArea.length>0&&(this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed","is a message"),""!==this.textInputTextArea.trim()&&this.sendMessage(this.textInputTextArea,B))},i.prototype.onEmojiiPickerClicked=function(){this.onEmojiiPickerShow.emit(!this.isEmojiiPickerShow)},i.prototype.addEmoji=function(o){this.onEmojiiPickerShow.emit(!1),this.textInputTextArea=this.textInputTextArea.trimStart()+o.emoji.native+" ",this.setFocusOnId("chat21-main-message-context")},i.prototype.openNewConversation=function(){this.onNewConversationButtonClicked.emit()},i.prototype.onContinueConversation=function(){this.hideTextAreaContent=!1,this.onBackButton.emit(!1),this.restoreTextArea()},i.prototype.onBackButtonFN=function(){this.onBackButton.emit(!1)},i.prototype.setFocusOnId=function(o){this.isMobile||setTimeout(function(){var n=document.getElementById(o);n&&(n.setAttribute("value"," "),n.focus())},500)},i.prototype.removeFocusOnId=function(o){var n=document.getElementById(o);n&&n.blur()},i.prototype.setWritingMessages=function(o){this.typingService.setTyping(this.conversationWith,o,this.senderId,this.userFullname)},i.prototype.onkeypress=function(o){var n=o.which||o.keyCode;this.textInputTextArea=document.getElementById("chat21-main-message-context").value,13===n?this.textInputTextArea&&""!==this.textInputTextArea.trim()&&this.sendMessage(this.textInputTextArea,B):9===n&&o.preventDefault()},i.prototype.onkeydown=function(o){(o.metaKey||o.shiftKey||o.altKey||o.ctrlKey)&&13===(o.which||o.keyCode)&&(o.preventDefault(),this.textInputTextArea+="\r\n",this.resizeInputField())},i.prototype.onPaste=function(o){var n,t;this.resizeInputField();var r=(o.clipboardData||o.originalEvent.clipboardData).items,a=null;this.logger.debug("[CONV-FOOTER] onPaste items ",r);try{for(var u=(0,_e.XA)(r),y=u.next();!y.done;y=u.next()){var j=y.value;if(this.logger.debug("[CONV-FOOTER] onPaste item ",j),this.logger.debug("[CONV-FOOTER] onPaste item.type ",j.type),j.type.startsWith("image")){try{this.restoreTextArea()}catch(ie){this.logger.error("[CONV-FOOTER] onPaste - error while restoring textArea:",ie)}this.logger.debug("[CONV-FOOTER] onPaste item.type",j.type),a=j.getAsFile();var J={target:new ClipboardEvent("").clipboardData||new DataTransfer};J.target.items.add(new File([a],a.name,{type:a.type})),this.logger.debug("[CONV-FOOTER] onPaste data",J),this.logger.debug("[CONV-FOOTER] onPaste file ",a),this.detectFiles(J)}}}catch(ie){n={error:ie}}finally{try{y&&!y.done&&(t=u.return)&&t.call(u)}finally{if(n)throw n.error}}},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Tt),e.Y36(ht),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-footer"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Di,5),2&n)&&(e.iGM(r=e.CRH())&&(t.chat21_file=r.first))},inputs:{conversationWith:"conversationWith",attributes:"attributes",senderId:"senderId",tenant:"tenant",projectid:"projectid",channelType:"channelType",userFullname:"userFullname",userEmail:"userEmail",showAttachmentButton:"showAttachmentButton",showContinueConversationButton:"showContinueConversationButton",isConversationArchived:"isConversationArchived",hideTextAreaContent:"hideTextAreaContent",hideTextReply:"hideTextReply",isMobile:"isMobile",isEmojiiPickerShow:"isEmojiiPickerShow",footerMessagePlaceholder:"footerMessagePlaceholder",fileUploadAccept:"fileUploadAccept",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onEmojiiPickerShow:"onEmojiiPickerShow",onBeforeMessageSent:"onBeforeMessageSent",onAfterSendMessage:"onAfterSendMessage",onChangeTextArea:"onChangeTextArea",onAttachmentFileButtonClicked:"onAttachmentFileButtonClicked",onNewConversationButtonClicked:"onNewConversationButtonClicked",onBackButton:"onBackButton"},features:[e.TTD],decls:5,vars:6,consts:[["id","floating-container","class","fade-in-bottom","start-focus-chat21-conversation-component","",4,"ngIf"],["class","visible-text-area",3,"disabled",4,"ngIf"],[4,"ngIf"],[1,"emoji-container"],["id","emoji-mart","class","emoji-mart",3,"showPreview","color","perLine","totalFrequentLines","enableSearch","darkMode","include","emojiSelect",4,"ngIf"],["id","floating-container","start-focus-chat21-conversation-component","",1,"fade-in-bottom"],["tabindex","1040","aflistconv","",1,"c21-button-primary",3,"ngStyle","click"],["aflistconv",""],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",3,"ngStyle"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],[1,"v-align-center","c21-label-button"],[1,"clear"],["tabindex","1040","class","c21-button-primary",3,"ngStyle","click",4,"ngIf"],["tabindex","1040",1,"c21-button-primary",3,"ngStyle","click"],[1,"visible-text-area"],["start-focus-chat21-conversation-component","","inputTextArea","","tabindex","1501","aria-labelledby","altTextArea","rows","1","id","chat21-main-message-context",1,"f21textarea","c21-button-clean",3,"ngModel","ngModelChange","keypress","keydown","paste"],["textbox",""],["div_attached",""],["tabindex","1502","aria-label","allegati","for","chat21-file","class","chat21-textarea-button","id","chat21-start-upload-doc",3,"active",4,"ngIf"],["tabindex","-1","id","chat21-button-send",1,"chat21-textarea-button",3,"click"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","height","24","width","24","viewBox","0 0 24 24",0,"xml","space","preserve",2,"enable-background","new 0 0 24 24"],["d","M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"],["tabindex","1504","aria-label","emojii","for","chat21-emojii","id","chat21-emoticon-picker",1,"chat21-textarea-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 28 28"],["d","M0 0h24v24H0V0z","fill","none"],["cx","15.5","cy","9.5","r","1.5"],["cx","8.5","cy","9.5","r","1.5"],["d","M12 16c-1.48 0-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5s4.32-1.45 5.12-3.5h-1.67c-.7 1.19-1.97 2-3.45 2zm-.01-14C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"],["tabindex","1502","aria-label","allegati","for","chat21-file","id","chat21-start-upload-doc",1,"chat21-textarea-button"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 28 28","transform","rotate(45)"],["d","M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"],["tabindex","1503","type","file","aria-label","seleziona allegato","name","chat21-file","id","chat21-file",1,"inputfile",3,"accept","ngStyle","change"],["chat21_file",""],["id","emoji-mart",1,"emoji-mart",3,"showPreview","color","perLine","totalFrequentLines","enableSearch","darkMode","include","emojiSelect"]],template:function(n,t){1&n&&(e.YNc(0,qi,10,12,"div",0),e.YNc(1,Vi,4,6,"div",1),e.YNc(2,Gi,14,5,"div",2),e.TgZ(3,"div",3),e.YNc(4,Ji,1,7,"emoji-mart",4),e.qZA()),2&n&&(e.Q6J("ngIf",t.hideTextAreaContent),e.xp6(1),e.Q6J("ngIf",!t.hideTextAreaContent),e.xp6(1),e.Q6J("ngIf",!t.hideTextAreaContent),e.xp6(1),e.Udp("visibility",t.isEmojiiPickerShow?"visible":"hidden"),e.xp6(1),e.Q6J("ngIf",t.showEmojiPicker))},directives:[me.O5,me.PC,Oe.Fj,Oe.JJ,Oe.On,Zn.qP],styles:[".visible-text-area[_ngcontent-%COMP%]{pointer-events:auto;border-radius:16px;background-color:#f6f7fb}.visible-text-area.disabled[_ngcontent-%COMP%]{background-color:#e8e9ed}.chat21-textarea-button[_ngcontent-%COMP%]{fill:#5f6368;pointer-events:auto}#button[_ngcontent-%COMP%]{position:absolute;bottom:12px;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:1}#button.chat-open[_ngcontent-%COMP%]:not(.sidebar){right:5px;left:auto;background-color:#fff}#button[_ngcontent-%COMP%]:not(.sidebar) .buttonWave[_ngcontent-%COMP%]{position:absolute;z-index:-1;width:60px;height:60px}#button-body[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:28px;border-color:transparent;display:inherit;align-items:center;justify-content:center;pointer-events:initial;transition:all .2s ease-in-out 0s;position:relative;box-shadow:rgba(3,6,12,.5) 0 4px 10px}#chat21-buttonToBottom[_ngcontent-%COMP%]{display:flex;position:relative;margin-right:-25px;margin-top:-40px;float:right;width:30px;height:30px;border-radius:50%;z-index:1;cursor:pointer;background-color:#fff;border:1px solid rgba(191,191,191,.2);text-align:center}#chat21-buttonToBottom[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin:auto;fill:#aaa}#chat21-buttonToBottom[_ngcontent-%COMP%]:hover{background-color:#2a6ac1;opacity:1!important;transition:all .45s ease-in-out!important;-moz-transition:all .45s ease-in-out!important;-webkit-transition:all .45s ease-in-out!important;border:1px solid #ffffff}#chat21-buttonToBottom[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{fill:#fff}textarea[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]:visited, textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:hover, textarea[_ngcontent-%COMP%]:active{all:unset}#chat21-main-message-context[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;resize:horizontal;overflow-y:auto;box-sizing:border-box;color:#1a1a1a;min-width:100%;outline:0;resize:none;font-size:1.4em;line-height:1.4em;font-weight:300;max-height:110px;min-height:auto;height:20px;padding:0 12px;margin:10px 0;border:none}#chat21-main-message-context[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#chat21-main-message-context[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#chat21-main-message-context[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}.chat21-textarea-button[_ngcontent-%COMP%]{position:absolute;display:block;height:56px;bottom:22px;opacity:.3;cursor:auto;cursor:initial}.chat21-textarea-button.active[_ngcontent-%COMP%]{opacity:1;cursor:pointer}.chat21-textarea-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:50%}.chat21-back-button[_ngcontent-%COMP%]{position:absolute;display:block;height:56px;cursor:pointer}.chat21-back-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:50%}#chat21-button-send[_ngcontent-%COMP%]{right:8px;bottom:0}#chat21-file[_ngcontent-%COMP%]{left:8px;bottom:0}#chat21-emoticon-picker[_ngcontent-%COMP%]{left:36px;bottom:0}#chat21-start-upload-doc[_ngcontent-%COMP%], #chat21-start-mic[_ngcontent-%COMP%]{left:8px;bottom:0}#chat21-back-button[_ngcontent-%COMP%]{left:8px;bottom:0}#floating-container[_ngcontent-%COMP%]{width:100%;border-top:0px solid #eeeeee;display:inline-flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top;text-align:center}#floating-container[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{margin-left:8px;font-weight:400;font-size:1.2em}#floating-container[_ngcontent-%COMP%] .c21-button-primary[_ngcontent-%COMP%]{height:36px;margin:5px 3px}#floating-container[_ngcontent-%COMP%] .c21-waiting-time[_ngcontent-%COMP%]{font-size:1.3em;font-weight:200;padding:0 24px 5px}.fade-in-bottom[_ngcontent-%COMP%]{-webkit-animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s;animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s}.emoji-container[_ngcontent-%COMP%]{height:312px;position:absolute;overflow:hidden;width:93%;bottom:100%;z-index:10;left:10px;box-shadow:0 -15px 20px -13px rgba(0,0,0,.38);-webkit-box-shadow:0px -15px 20px -13px rgba(0,0,0,.38)}.emoji-mart[_ngcontent-%COMP%]{position:absolute;border:none;margin:-2px -2px 0}"]}),i}();function Qi(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij("",n.nameUserTypingNow," ")}}function Ki(i,o){if(1&i&&(e.TgZ(0,"div",2),e.YNc(1,Qi,2,1,"span",3),e._uU(2),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngIf",n.nameUserTypingNow),e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("LABEL_WRITING"),"\n")}}function Xi(i,o){1&i&&(e.TgZ(0,"div",4),e._UZ(1,"div",5),e._UZ(2,"div",6),e._UZ(3,"div",7),e.qZA())}var zn=function(){function i(o){this.elementRef=o,this.typingLocation="content"}return i.prototype.ngOnInit=function(){this.elementRef.nativeElement.style.setProperty("--bubbleReceivedBackgroundColor",this.color)},i.prototype.ngOnDestroy=function(){},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["user-typing"]],inputs:{typingLocation:"typingLocation",translationMap:"translationMap",color:"color",idUserTypingNow:"idUserTypingNow",nameUserTypingNow:"nameUserTypingNow"},decls:2,vars:2,consts:[["class","tile-typing-now",4,"ngIf"],["class","spinner",4,"ngIf"],[1,"tile-typing-now"],[4,"ngIf"],[1,"spinner"],[1,"bounce1"],[1,"bounce2"],[1,"bounce3"]],template:function(n,t){1&n&&(e.YNc(0,Ki,3,2,"div",0),e.YNc(1,Xi,4,0,"div",1)),2&n&&(e.Q6J("ngIf","header"===t.typingLocation),e.xp6(1),e.Q6J("ngIf","content"===t.typingLocation))},directives:[me.O5],styles:["[_ngcontent-%COMP%]:root{--bubbleReceivedBackgroundColor: $blue;--foregroundColor: $bck-msg-sent}.tile-typing-now[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:$bck-msg-sent;color:var(--foregroundColor)}#tile-spinner[_ngcontent-%COMP%]{position:relative;left:0;top:0;margin:0}#tile-spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:6px;height:6px;background-color:var(--basic-blue)}.spinner[_ngcontent-%COMP%]{margin:15px 10px;width:70px;min-height:20px;display:block}.spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:9px;height:9px;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}.spinner[_ngcontent-%COMP%] .bounce1[_ngcontent-%COMP%]{-webkit-animation-delay:-.32s;animation-delay:-.32s;background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor)}.spinner[_ngcontent-%COMP%] .bounce2[_ngcontent-%COMP%]{-webkit-animation-delay:-.16s;animation-delay:-.16s;background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor);opacity:.4}.spinner[_ngcontent-%COMP%] .bounce3[_ngcontent-%COMP%]{background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor);opacity:.6}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}"]}),i}(),$i=ye(82051),jn=function(i,o){return{width:i,height:o}};function er(i,o){if(1&i&&e._UZ(0,"div",4),2&i){var n=e.oxw();e.Q6J("ngStyle",e.WLB(1,jn,n.width,n.height))}}function tr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Oqu(n.tooltipMessage)}}var nr=function(i){return{isLoadingImage:i}},qn=function(){function i(){this.onElementRendered=new e.vpe,this.loading=!0,this.tooltipOptions={"show-delay":0,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.popupUrl=Ht}return i.prototype.ngOnInit=function(){},i.prototype.onLoaded=function(o){this.loading=!1,this.onElementRendered.emit({element:"image",status:!0})},i.prototype.downloadImage=function(o,n){console.log("Image COMP - IMAGE URL ",o),console.log("Image COMP - IMAGE FILENAME ",n),n||(n=decodeURIComponent(decodeURIComponent(o).split("/").pop())),(0,$i.saveAs)(o,n)},i.prototype.onClickImage=function(){},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-image"]],inputs:{metadata:"metadata",width:"width",height:"height"},outputs:{onElementRendered:"onElementRendered"},decls:5,vars:9,consts:[[1,"c21-img-container"],["class","loader",3,"ngStyle",4,"ngIf"],[1,"message-contentX","message-content-imageX",3,"ngClass","ngStyle","src","load","click"],["timeTooltipRight",""],[1,"loader",3,"ngStyle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,er,1,4,"div",1),e.TgZ(2,"img",2),e.NdJ("load",function(a){return t.onLoaded(a)})("click",function(){return t.downloadImage(t.metadata.src,t.metadata.name)}),e.qZA(),e.YNc(3,tr,2,1,"ng-template",null,3,e.W1O),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngIf",t.loading),e.xp6(1),e.Q6J("ngClass",e.VKq(4,nr,t.loading))("ngStyle",e.WLB(6,jn,t.width,t.height))("src",t.metadata.src,e.LSH))},directives:[me.O5,me.mk,me.PC],styles:["[_nghost-%COMP%]{--borderRadius: 8px}img[_ngcontent-%COMP%]{border-radius:var(--borderRadius);margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover;transition:transform .3s ease-in-out 0s}.c21-img-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}.c21-img-container[_ngcontent-%COMP%]{text-align:center;width:100%;overflow:hidden;border-radius:var(--borderRadius)}.demo-content[_ngcontent-%COMP%]{position:relative}.isLoadingImage[_ngcontent-%COMP%]{display:none}.loader[_ngcontent-%COMP%]{float:left;z-index:1000;border-radius:var(--borderRadius);background-image:linear-gradient(90deg,transparent 0px,#e8e8e8 40px,transparent 80px);background-size:600px;-webkit-animation:shine-loader 1.6s infinite linear;animation:shine-loader 1.6s infinite linear}@-webkit-keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}@keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}"]}),i}(),or=function(i,o){return{width:i,height:o}};function ir(i,o){if(1&i&&e._UZ(0,"div",3),2&i){var n=e.oxw();e.Q6J("ngStyle",e.WLB(1,or,n.width,n.height))}}var rr=function(i,o){return{"max-width":"100%",width:i,height:o}},ar=function(i){return{isLoadingImage:i}},sr=function(){function i(o){this.sanitizer=o,this.onElementRendered=new e.vpe,this.url=null,this.loading=!0}return i.prototype.ngOnInit=function(){this.metadata&&this.metadata.src&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(this.metadata.src))},i.prototype.ngOnDestroy=function(){this.url=null},i.prototype.onLoaded=function(o){this.loading=!1,this.onElementRendered.emit({element:"frame",status:!0})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-frame"]],inputs:{metadata:"metadata",width:"width",height:"height"},outputs:{onElementRendered:"onElementRendered"},decls:3,vars:9,consts:[[3,"ngStyle"],["class","loader",3,"ngStyle",4,"ngIf"],["allowfullscreen","","width","100%","height","100%",3,"ngClass","src","load"],[1,"loader",3,"ngStyle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,ir,1,4,"div",1),e.TgZ(2,"iframe",2),e.NdJ("load",function(a){return t.onLoaded(a)}),e.qZA(),e.qZA()),2&n&&(e.Q6J("ngStyle",e.WLB(4,rr,t.width,t.height)),e.xp6(1),e.Q6J("ngIf",t.loading),e.xp6(1),e.Q6J("ngClass",e.VKq(7,ar,t.loading))("src",t.url,e.uOi))},directives:[me.PC,me.O5,me.mk],styles:["[_nghost-%COMP%]{--borderRadius: 8px}.loader[_ngcontent-%COMP%]{float:left;z-index:1000;border-radius:var(--borderRadius);background-image:linear-gradient(90deg,transparent 0px,#e8e8e8 40px,transparent 80px);background-size:600px;-webkit-animation:shine-loader 1.6s infinite linear;animation:shine-loader 1.6s infinite linear}.isLoadingImage[_ngcontent-%COMP%]{display:none}iframe[_ngcontent-%COMP%]{border:none;border-radius:var(--borderRadius)}@-webkit-keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}@keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}"]}),i}(),Kt=ye(95166),kt=ye(4765),Xt=function(){function i(){}return i.prototype.transform=function(o){var n=new kt.TU.Renderer;return n.link=function(r,a,u){return kt.TU.Renderer.prototype.link.call(this,r,a,u).replace("<a",'<a target="_blank" ')},kt.TU.setOptions({renderer:n}),o&&o.length>0?(0,kt.TU)(o):o},i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=e.Yjl({name:"marked",type:i,pure:!0}),i}(),Vn=function(){function i(){}return i.prototype.transform=function(o,n){return(o=function(i){return i.replace(/[\n\r]/g,"<br>")}(o=function(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}(o))).trim()},i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=e.Yjl({name:"htmlEntitiesEncode",type:i,pure:!0}),i}(),lr=function(){function i(){this.htmlEnabled=!1,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe}return i.prototype.ngOnInit=function(){},i.prototype.printMessage=function(o,n,t){var r={messageEl:n,component:t};this.onBeforeMessageRender.emit(r);var a=o;return this.onAfterMessageRender.emit(r),a},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-text"]],inputs:{text:"text",htmlEnabled:"htmlEnabled",color:"color",fontSize:"fontSize",fontFamily:"fontFamily"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender"},decls:4,vars:9,consts:[[1,"message_innerhtml","marked",3,"innerHTML"],["messageEl",""]],template:function(n,t){if(1&n&&(e._UZ(0,"p",0,1),e.ALo(2,"marked"),e.ALo(3,"htmlEntitiesEncode")),2&n){var r=e.MAs(1);e.Udp("color",t.color)("font-size",t.fontSize),e.Q6J("innerHTML",e.lcZ(2,5,e.lcZ(3,7,t.printMessage(t.text,r,t))),e.oJD)}},pipes:[Xt,Vn],styles:[".message_innerhtml[_ngcontent-%COMP%]{margin:0}.message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}p[_ngcontent-%COMP%]{font-size:1.4em;margin:0;padding:14px;line-height:1.4em;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}"]}),i}(),cr=function(){function i(o){this.sanitizer=o}return i.prototype.transform=function(o,n){return this.sanitizer.bypassSecurityTrustHtml(o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7,16))},i.\u0275pipe=e.Yjl({name:"safeHtml",type:i,pure:!0}),i}(),ur=["htmlCode"],hr=function(){function i(o){this.elementRef=o}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.style.setProperty("--buttonFontSize",this.fontSize),this.themeColor&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.themeColor),this.foregroundColor&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.foregroundColor)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-html"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(ur,5),2&n)&&(e.iGM(r=e.CRH())&&(t.container=r.first))},inputs:{htmlText:"htmlText",fontSize:"fontSize",themeColor:"themeColor",foregroundColor:"foregroundColor"},features:[e.TTD],decls:3,vars:3,consts:[["id","htmlCode",3,"innerHTML"],["htmlCode",""]],template:function(n,t){1&n&&(e._UZ(0,"div",0,1),e.ALo(2,"safeHtml")),2&n&&e.Q6J("innerHTML",e.lcZ(2,1,t.htmlText),e.oJD)},pipes:[cr],styles:['[_ngcontent-%COMP%]:root{--themeColor: #2a6ac1;--foregroundColor: #ffffff;--buttonFontSize: 15px} .button-html{padding:8px 16px!important;position:relative;max-width:300px;min-width:inherit;cursor:pointer!important;border:1px solid #2a6ac1;border:1px solid var(--themeColor);border-radius:20px;margin:3px;background:transparent;overflow:hidden;font-family:"Muli",sans-serif!important;font-size:15px!important;font-size:var(--buttonFontSize)!important;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:#2a6ac1;color:var(--themeColor);line-height:16px} .url{transition:background-color .6s ease} .url .icon-button-action{position:absolute;top:-1px;right:1px} .url .icon-button-action svg{fill:#2a6ac1;fill:var(--themeColor)} .url .icon-button-action-self{position:absolute;right:1px} .url .icon-button-action-self svg{fill:#2a6ac1;fill:var(--themeColor)} .url:focus, .url:hover{color:#fff;background:#2a6ac1;background:var(--themeColor)} .url:focus .icon-button-action svg, .url:focus .icon-button-action-self svg, .url:hover .icon-button-action svg, .url:hover .icon-button-action-self svg{fill:#fff} .url:active{font-size:20px} .text-html{font-size:1.4em;margin:0;padding:8px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}']}),i}(),pr=function(i){return{margin:i}};function dr(i,o){if(1&i&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.Udp("color",n.convertColorToRGBA(n.fontColor,65)),e.Q6J("ngStyle",e.VKq(4,pr,n.isImage(n.message)||n.isFrame(n.message)?"10px 16px 8px 16px":"10px 8px 0px 8px")),e.xp6(1),e.hij(" ",null==n.message?null:n.message.sender_fullname," ")}}function gr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-image",5),e.NdJ("onElementRendered",function(a){return e.CHM(n),e.oxw().onElementRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.message.metadata)("width",null==t.sizeImage?null:t.sizeImage.width)("height",null==t.sizeImage?null:t.sizeImage.height)}}function fr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-frame",5),e.NdJ("onElementRendered",function(a){return e.CHM(n),e.oxw().onElementRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.message.metadata)("width",null==t.sizeImage?null:t.sizeImage.width)("height",null==t.sizeImage?null:t.sizeImage.height)}}function mr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"amTimeAgo"),e.ALo(3,"amDateFormat"),e.ALo(4,"amLocal"),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.AsE("",e.lcZ(2,2,n.message.timestamp)," (",e.xi3(3,4,e.lcZ(4,7,n.message.timestamp),"L HH:mm:ss"),")")}}function vr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-text",10),e.NdJ("onBeforeMessageRender",function(a){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(a)})("onAfterMessageRender",function(a){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(a)}),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("text",null==t.message?null:t.message.text)("color",t.fontColor)("fontSize",t.fontSize)("fontFamily",t.fontFamily)}}function br(i,o){if(1&i&&e._UZ(0,"chat-html",11),2&i){var n=e.oxw(2);e.Q6J("htmlText",null==n.message?null:n.message.text)("fontSize",n.stylesMap.get("buttonFontSize"))("themeColor",n.stylesMap.get("themeColor"))("foregroundColor",n.stylesMap.get("foregroundColor"))}}function _r(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",6),e.NdJ("click",function(u){return e.CHM(n),e.oxw().handleTooltipEvents(u)}),e.YNc(1,mr,5,9,"ng-template",null,7,e.W1O),e.YNc(3,vr,1,4,"chat-text",8),e.YNc(4,br,1,4,"chat-html",9),e.qZA()}if(2&i){var t=e.MAs(2),r=e.oxw();e.Q6J("tooltip",t)("options",r.tooltipOptions),e.xp6(3),e.Q6J("ngIf","html"!==(null==r.message?null:r.message.type)),e.xp6(1),e.Q6J("ngIf","html"===(null==r.message?null:r.message.type))}}var Cr=function(i){return{padding:i}},yr=function(){function i(o){this.sanitizer=o,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onElementRendered=new e.vpe,this.isImage=qt,this.isFile=So,this.isFrame=wn,this.convertColorToRGBA=Ie,this.messageType=Xe,this.MESSAGE_TYPE_MINE=V,this.MESSAGE_TYPE_OTHERS=Q,this.tooltipOptions={"show-delay":500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(){this.message&&this.message.metadata&&"object"==typeof this.message.metadata&&(this.sizeImage=this.getMetadataSize(this.message.metadata))},i.prototype.getMetadataSize=function(o){var n={width:o.width,height:o.height};if(o.width&&o.width<We)if(o.width<=55){var t=o.width/o.height;n.width=130,n.height=130/t}else o.width>55&&(n.width=o.width,n.height=o.height);else o.width&&o.width>We&&(t=o.width/o.height,n.width=We,n.height=We/t);return n},i.prototype.handleTooltipEvents=function(o){var n=this;setTimeout(function(){try{var r=document.getElementsByClassName("chat-tooltip");if(r){var a=r[0];a.classList.contains("tooltip-show")||a.classList.add("tooltip-show"),setTimeout(function(){a.classList.contains("tooltip-show")&&a.classList.remove("tooltip-show")},n.tooltipOptions.hideDelayAfterClick)}}catch(u){n.logger.error("[BUBBLE-MESSAGE] handleTooltipEvents >>>> Error :"+u)}},this.tooltipOptions.showDelay)},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit({message:this.message,sanitizer:this.sanitizer,messageEl:o.messageEl,component:o.component})},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit({message:this.message,sanitizer:this.sanitizer,messageEl:o.messageEl,component:o.component})},i.prototype.onElementRenderedFN=function(o){this.onElementRendered.emit({element:o.element,status:o.status})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-bubble-message"]],inputs:{message:"message",isSameSender:"isSameSender",fontColor:"fontColor",fontSize:"fontSize",fontFamily:"fontFamily",stylesMap:"stylesMap"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onElementRendered:"onElementRendered"},features:[e.TTD],decls:6,vars:7,consts:[[1,"messages","primary-color",3,"ngStyle"],["class","message_sender_fullname",3,"color","ngStyle",4,"ngIf"],[3,"metadata","width","height","onElementRendered",4,"ngIf"],["placement","left","contentType","template",3,"tooltip","options","click",4,"ngIf"],[1,"message_sender_fullname",3,"ngStyle"],[3,"metadata","width","height","onElementRendered"],["placement","left","contentType","template",3,"tooltip","options","click"],["timeTooltipLeft",""],[3,"text","color","fontSize","fontFamily","onBeforeMessageRender","onAfterMessageRender",4,"ngIf"],[3,"htmlText","fontSize","themeColor","foregroundColor",4,"ngIf"],[3,"text","color","fontSize","fontFamily","onBeforeMessageRender","onAfterMessageRender"],[3,"htmlText","fontSize","themeColor","foregroundColor"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div"),e.YNc(2,dr,2,6,"div",1),e.YNc(3,gr,1,3,"chat-image",2),e.YNc(4,fr,1,3,"chat-frame",2),e.YNc(5,_r,5,4,"div",3),e.qZA(),e.qZA()),2&n&&(e.Q6J("ngStyle",e.VKq(5,Cr,t.isImage(t.message)||t.isFrame(t.message)?"0 0px":"0 8px")),e.xp6(2),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_OTHERS,t.message)&&!t.isSameSender),e.xp6(1),e.Q6J("ngIf",t.isImage(t.message)),e.xp6(1),e.Q6J("ngIf",t.isFrame(t.message)),e.xp6(1),e.Q6J("ngIf",null==t.message?null:t.message.text))},directives:[me.PC,me.O5,qn,sr,Kt.i9,lr,hr],pipes:[$e.eG,$e.Ek,$e.Bs],styles:[".messages[_ngcontent-%COMP%]{border-radius:20px;padding:0;word-wrap:break-word}.messages[_ngcontent-%COMP%] .message_sender_fullname[_ngcontent-%COMP%]{font-size:12px;font-weight:600}.messages[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:20px;padding:3px;margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover}.messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{margin:0}.messages[_ngcontent-%COMP%] .message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}"]}),i}();function wr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",6),e._UZ(8,"path",7),e._UZ(9,"path",8),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function Or(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function Mr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function xr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",10),e.qZA(),e.qZA(),e.qZA(),e.qZA())}var Er=function(){function i(){this.MSG_STATUS_SENT=100,this.MSG_STATUS_SENT_SERVER=150,this.MSG_STATUS_RETURN_RECEIPT=250}return i.prototype.ngOnInit=function(){},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-return-receipt"]],inputs:{status:"status"},decls:5,vars:4,consts:[[1,"status-message"],["class","icon",4,"ngIf"],[1,"icon"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 18 18"],["id","Livello_2","data-name","Livello 2"],["id","Livello_1-2","data-name","Livello 1"],["d","M9,1.5A7.5,7.5,0,1,0,16.5,9,7.5,7.5,0,0,0,9,1.5ZM9,15a6,6,0,1,1,6-6A6,6,0,0,1,9,15Z"],["d","M0,0H18V18H0Z",1,"cls-1"],["d","M9.38,5.25H8.25v4.5l3.94,2.36.56-.92-3.37-2Z"],["d","M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"],["d","M13.5,5.25,12.44,4.19,7.69,8.95,8.74,10Zm3.18-1.06L8.74,12.13,5.61,9,4.55,10.06l4.19,4.19,9-9ZM.31,10.06,4.5,14.25l1.06-1.06L1.37,9Z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,wr,10,0,"div",1),e.YNc(2,Or,9,0,"div",1),e.YNc(3,Mr,9,0,"div",1),e.YNc(4,xr,9,0,"div",1),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngIf",!t.status),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_SENT),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_SENT_SERVER),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_RETURN_RECEIPT))},directives:[me.O5],styles:[".status-message[_ngcontent-%COMP%]{width:16px;height:16px;margin-left:4px}.status-message[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:13px;height:13px;background-repeat:no-repeat;background-position:center;background-size:cover;overflow-x:hidden}.status-message[_ngcontent-%COMP%] .c21-ico-schedule[_ngcontent-%COMP%]{background-image:url(f21ico-schedule.svg)}.status-message[_ngcontent-%COMP%] .c21-ico-done[_ngcontent-%COMP%]{background-image:url(f21ico-done.svg)}.status-message[_ngcontent-%COMP%] .c21-ico-done_all[_ngcontent-%COMP%]{background-image:url(f21ico-done_all.svg)}"]}),i}();function Tr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"img",3),e.NdJ("error",function(a){return e.CHM(n),e.oxw().onBotImgError(a)})("load",function(a){return e.CHM(n),e.oxw().onLoadedBot(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("src",t.url,e.LSH)}}function Sr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"img",3),e.NdJ("error",function(a){return e.CHM(n),e.oxw().onHumanImgError(a)})("load",function(a){return e.CHM(n),e.oxw().onLoadedHuman(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("src",t.url,e.LSH)}}var Wn=function(){function i(o){this.imageRepoService=o}return i.prototype.ngOnInit=function(){var o=this;if(this.senderID){-1!==this.senderID.indexOf("bot_")||this.senderFullname.toLowerCase().includes("bot")?this.url=this.baseLocation+"/assets/images/tommy_bot_tiledesk.svg":-1==this.senderID.indexOf("bot_")&&(this.url=this.baseLocation+"/assets/images/chat_human_avatar.svg");var n=this.imageRepoService.getImagePhotoUrl(this.senderID);this.checkImageExists(n,function(t){t&&(o.url=n)})}},i.prototype.onBotImgError=function(o){o.target.src=this.baseLocation+"/assets/images/tommy_bot_tiledesk.svg"},i.prototype.onHumanImgError=function(o){o.target.src=this.baseLocation+"/assets/images/chat_human_avatar.svg"},i.prototype.onLoadedBot=function(o){},i.prototype.onLoadedHuman=function(o){},i.prototype.checkImageExists=function(o,n){var t=new Image;t.onload=function(){n(!0)},t.onerror=function(){n(!1)},t.src=o},i.\u0275fac=function(n){return new(n||i)(e.Y36(st))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-avatar-image"]],inputs:{senderID:"senderID",senderFullname:"senderFullname",baseLocation:"baseLocation"},decls:4,vars:2,consts:[[1,"c21-icon-avatar"],[1,"c21-avatar-image","profile_image"],[3,"src","error","load",4,"ngIf"],[3,"src","error","load"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Tr,1,1,"img",2),e.YNc(3,Sr,1,1,"img",2),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngIf",-1!==(null==t.senderID?null:t.senderID.indexOf("bot_"))||t.senderFullname.toLowerCase().includes("bot")),e.xp6(1),e.Q6J("ngIf",-1===(null==t.senderID?null:t.senderID.indexOf("bot_"))&&!t.senderFullname.toLowerCase().includes("bot")))},directives:[me.O5],styles:[".c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%;display:flex;align-items:center;justify-content:center}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}.c21-pallozzo[_ngcontent-%COMP%]{display:inline}.c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}.c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}.c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}"]}),i}();function Pr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"amTimeAgo"),e.ALo(3,"amDateFormat"),e.ALo(4,"amLocal"),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.AsE("",e.lcZ(2,2,n.message.timestamp)," (",e.xi3(3,4,e.lcZ(4,7,n.message.timestamp),"L HH:mm:ss"),")")}}var kr=function(){function i(){this.logger=Ce.getInstance(),this.tooltipOptions={"show-delay":500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200}}return i.prototype.ngOnInit=function(){this.logger.debug("[INFO-COMP] message ",this.message),this.message&&this.message.text&&(this.message.text=this.message.text.replace(/<br\s*[\/]?>/gi,"\n"),this.logger.debug("[INFO-COMP] message .text ",this.message.text))},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-info-message"]],inputs:{message:"message"},decls:14,vars:5,consts:[[1,"info-container"],[1,"spinner"],[1,"bounce3"],[1,"bounce2"],[1,"bounce1"],["placement","left","contentType","template",1,"base_info",3,"innerHTML","options","tooltip"],["timeTooltipLeft",""]],template:function(n,t){if(1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"div",2),e._UZ(3,"div",3),e._UZ(4,"div",4),e.qZA(),e.TgZ(5,"div"),e._UZ(6,"span",5),e.ALo(7,"marked"),e.YNc(8,Pr,5,9,"ng-template",null,6,e.W1O),e.qZA(),e.TgZ(10,"div",1),e._UZ(11,"div",4),e._UZ(12,"div",3),e._UZ(13,"div",2),e.qZA(),e.qZA()),2&n){var r=e.MAs(9);e.xp6(6),e.Q6J("innerHTML",e.lcZ(7,3,null==t.message?null:t.message.text),e.oJD)("options",t.tooltipOptions)("tooltip",r)}},directives:[Kt.i9],pipes:[Xt,$e.eG,$e.Ek,$e.Bs],styles:[".info-container[_ngcontent-%COMP%]{display:flex;align-content:center;justify-content:center;padding:4px 0 2px}.base_info[_ngcontent-%COMP%]{border-radius:14px;padding:6px 10px;display:inline-block;background:rgba(24,119,242,.1);font-size:10px;color:#666;margin-left:5px;margin-right:5px}.base_info[_ngcontent-%COMP%] >p{margin-top:0!important;margin-bottom:0!important}.spinner[_ngcontent-%COMP%]{width:45px;min-height:100%;margin:auto 0}.spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:10px;height:10px;background-color:#333;border-radius:100%;display:inline-block;margin:0 2px}.spinner[_ngcontent-%COMP%] .bounce1[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1)}.spinner[_ngcontent-%COMP%] .bounce2[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1);opacity:.6}.spinner[_ngcontent-%COMP%] .bounce3[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1);opacity:.4}"]}),i}(),Ar=function(i){return{disabled:i}},Ir=function(){function i(o){this.elementRef=o,this.onButtonClicked=new e.vpe,this.type="text"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonText=function(){this.onButtonClicked.emit({target:this,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-text-button-attachment"]],inputs:{button:"button",isConversationArchived:"isConversationArchived",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:2,vars:5,consts:[[1,"button-in-msg","text",3,"ngClass","title","click","mouseover","mouseout"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.actionButtonText()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e._uU(1),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.Q6J("ngClass",e.VKq(3,Ar,t.isConversationArchived)),e.xp6(1),e.hij(" ",null==t.button?null:t.button.value,"\n"))},directives:[me.mk],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.text[_ngcontent-%COMP%]{transition:background-color .6s ease}.text[_ngcontent-%COMP%]:focus, .text[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.text[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .text[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#1a1a1a}.disabled[_ngcontent-%COMP%]{pointer-events:none}']}),i}();function Rr(i,o){1&i&&(e.TgZ(0,"span",4),e.O4$(),e.TgZ(1,"svg",5),e._UZ(2,"path",6),e._UZ(3,"path",7),e.qZA(),e.qZA())}function Lr(i,o){1&i&&(e.TgZ(0,"span",8),e.O4$(),e.TgZ(1,"svg",9),e._UZ(2,"path",6),e._UZ(3,"path",7),e.qZA(),e.qZA())}var Nr=function(){function i(o){this.elementRef=o,this.onButtonClicked=new e.vpe,this.type="url"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonUrl=function(){this.button&&this.button.link&&""!==this.button.link&&this.onButtonClicked.emit({target:this,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-link-button-attachment"]],inputs:{button:"button",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:5,vars:4,consts:[[1,"button-in-msg","url",3,"title","click","mouseover","mouseout"],["class","icon-button-action",4,"ngIf"],["class","icon-button-action-self",4,"ngIf"],[1,"clear"],[1,"icon-button-action"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","black","width","18px","height","18px",2,"transform","rotateZ(45deg)"],["d","M0 0h24v24H0z","fill","none"],["d","M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"],[1,"icon-button-action-self"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","black","width","18px","height","18px",2,"transform","rotateZ(90deg)"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.actionButtonUrl()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e.YNc(1,Rr,4,0,"span",1),e.YNc(2,Lr,4,0,"span",2),e._uU(3),e._UZ(4,"div",3),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.xp6(1),e.Q6J("ngIf","self"!==(null==t.button?null:t.button.target)),e.xp6(1),e.Q6J("ngIf","self"===(null==t.button?null:t.button.target)),e.xp6(1),e.hij(" ",null==t.button?null:t.button.value," "))},directives:[me.O5],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.url[_ngcontent-%COMP%]{transition:background-color .6s ease}.url[_ngcontent-%COMP%] .icon-button-action[_ngcontent-%COMP%]{position:absolute;top:-1px;right:1px}.url[_ngcontent-%COMP%] .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--textColor)}.url[_ngcontent-%COMP%] .icon-button-action-self[_ngcontent-%COMP%]{position:absolute;right:1px}.url[_ngcontent-%COMP%] .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--textColor)}.url[_ngcontent-%COMP%]:focus, .url[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.url[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:focus .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:hover .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--hoverTextColor)}']}),i}(),Fr=function(i){return{disabled:i}},Br=function(){function i(o){this.elementRef=o,this.isConversationArchived=!0,this.onButtonClicked=new e.vpe,this.type="action"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonAction=function(){if(this.button&&this.button.action&&""!==this.button.action){var o=this.elementRef.nativeElement.querySelector(".action");o&&(o.classList.contains("active")||o.classList.add("active"),setTimeout(function(){o.classList.contains("active")&&o.classList.remove("active")},400)),this.onButtonClicked.emit({target:this,currentTarget:this})}},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-action-button-attachment"]],inputs:{button:"button",isConversationArchived:"isConversationArchived",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:3,vars:5,consts:[["id","actionButton",1,"button-in-msg","action",3,"ngClass","title","click","mouseover","mouseout"],["actionButton",""]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.NdJ("click",function(){return t.actionButtonAction()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e._uU(2),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.Q6J("ngClass",e.VKq(3,Fr,t.isConversationArchived)),e.xp6(2),e.hij(" ",null==t.button?null:t.button.value,"\n"))},directives:[me.mk],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.action[_ngcontent-%COMP%]{background:var(--backgroundColor);transition:background-color .6s ease}.action[_ngcontent-%COMP%]:focus, .action[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.action[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .action[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--hoverTextColor)}.action[_ngcontent-%COMP%]:after{content:"";position:absolute;width:0;height:0;top:50%;left:50%;transform-style:flat;transform:translate(-50%,-50%);background:rgba(255,255,255,.2);border-radius:100%;transition:width .5s ease,height .5s ease}.action.active[_ngcontent-%COMP%]:after{width:200px;height:200px}.disabled[_ngcontent-%COMP%]{pointer-events:none}']}),i}();function Ur(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-text-button-attachment",6),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("isConversationArchived",r.isConversationArchived)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Zr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-link-button-attachment",7),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Dr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-action-button-attachment",6),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("isConversationArchived",r.isConversationArchived)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Hr(i,o){if(1&i&&(e.TgZ(0,"span",3),e.YNc(1,Ur,1,7,"chat-text-button-attachment",4),e.YNc(2,Zr,1,6,"chat-link-button-attachment",5),e.YNc(3,Dr,1,7,"chat-action-button-attachment",4),e.qZA()),2&i){var n=o.$implicit,t=e.oxw();e.xp6(1),e.Q6J("ngIf","text"===n.type&&!0===t.isLastMessage),e.xp6(1),e.Q6J("ngIf","url"===n.type),e.xp6(1),e.Q6J("ngIf","action"===n.type&&!0===t.isLastMessage)}}var zr=function(){function i(){this.onAttachmentButtonClicked=new e.vpe,this.onElementRendered=new e.vpe}return i.prototype.ngOnInit=function(){this.getAttachmentButton()},i.prototype.getAttachmentButton=function(){if(this.message&&this.message.attributes&&this.message.attributes.attachment){try{this.type=this.message.attributes.attachment.type}catch(o){return}try{this.buttons=this.message.attributes.attachment.buttons}catch(o){return}}},i.prototype.ngAfterViewInit=function(){this.onElementRendered.emit({element:"attachment",status:!0})},i.prototype.returnOnAttachmentButtonClicked=function(o){o&&o.target&&this.onAttachmentButtonClicked.emit({target:o.target,message:this.message,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-message-attachment"]],inputs:{message:"message",isConversationArchived:"isConversationArchived",isLastMessage:"isLastMessage",stylesMap:"stylesMap"},outputs:{onAttachmentButtonClicked:"onAttachmentButtonClicked",onElementRendered:"onElementRendered"},decls:3,vars:1,consts:[["id","buttons-in-message"],[1,"buttons-wrapper"],["class","div-button",4,"ngFor","ngForOf"],[1,"div-button"],["class","div-button",3,"button","isConversationArchived","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked",4,"ngIf"],["class","div-button",3,"button","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked",4,"ngIf"],[1,"div-button",3,"button","isConversationArchived","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked"],[1,"div-button",3,"button","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Hr,4,3,"span",2),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngForOf",t.buttons))},directives:[me.sg,me.O5,Ir,Nr,Br],styles:["#buttons-in-message[_ngcontent-%COMP%]{text-align:right;display:block;margin-right:16px;height:auto;width:85%;float:right}#buttons-in-message[_ngcontent-%COMP%] .buttons-wrapper[_ngcontent-%COMP%]{margin-top:0;display:flex;flex-wrap:wrap;justify-content:flex-end;width:100%;border:none}#buttons-in-message[_ngcontent-%COMP%] .div-button[_ngcontent-%COMP%]{display:inline-block}#buttons-in-message[_ngcontent-%COMP%] .div-button[_ngcontent-%COMP%] .button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important}#buttons-in-message.align-left[_ngcontent-%COMP%]{text-align:left;margin:4px 50px}"]}),i}(),jr=["scrollMe"];function qr(i,o){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"user-typing",12),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("color",null==n.stylesMap?null:n.stylesMap.get("iconColor"))("translationMap",n.translationMap)("idUserTypingNow",n.idUserTypingNow)("nameUserTypingNow",n.nameUserTypingNow)}}var Yn=function(i,o){return{background:i,color:o}},Vr=function(i){return{"button-in-msg":i}};function Wr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.TgZ(1,"chat-bubble-message",20),e.NdJ("onBeforeMessageRender",function(u){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(u)})("onAfterMessageRender",function(u){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(u)})("onElementRendered",function(u){return e.CHM(n),e.oxw(2).onElementRenderedFN(u)}),e.qZA(),e._UZ(2,"chat-return-receipt",21),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.xp6(1),e.ekj("no-background",(r.isImage(t)||r.isFrame(t))&&""===(null==t?null:t.text.trim()))("emoticon",r.isEmojii(null==t?null:t.text)),e.Q6J("ngStyle",e.WLB(12,Yn,r.stylesMap.get("bubbleSentBackground"),r.stylesMap.get("bubbleSentTextColor")))("ngClass",e.VKq(15,Vr,(null==t?null:t.metadata)&&(null==t||null==t.metadata?null:t.metadata.button)))("message",t)("fontColor",r.stylesMap.get("bubbleSentTextColor"))("fontSize",r.stylesMap.get("fontSize"))("fontFamily",r.stylesMap.get("fontFamily"))("stylesMap",r.stylesMap),e.xp6(1),e.Q6J("status",null==t?null:t.status)}}var $t=function(){return{"slide-in-left":!1}};function Yr(i,o){if(1&i&&e._UZ(0,"chat-avatar-image",25),2&i){var n=e.oxw(2).$implicit,t=e.oxw();e.Q6J("ngClass",e.DdM(4,$t))("senderID",null==n?null:n.sender)("senderFullname",null==n?null:n.sender_fullname)("baseLocation",t.baseLocation)}}function Gr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",22),e.YNc(1,Yr,1,5,"chat-avatar-image",23),e.TgZ(2,"chat-bubble-message",24),e.NdJ("onBeforeMessageRender",function(j){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(j)})("onAfterMessageRender",function(j){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(j)})("onElementRendered",function(j){return e.CHM(n),e.oxw(2).onElementRenderedFN(j)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(),r=t.$implicit,a=t.index,u=e.oxw();e.xp6(1),e.Q6J("ngIf",!u.isSameSender(null==r?null:r.sender,a)),e.xp6(1),e.Udp("margin-left",u.isSameSender(null==r?null:r.sender,a)?"50px":null),e.ekj("no-background",(u.isImage(r)||u.isFrame(r))&&""===(null==r?null:r.text.trim()))("emoticon",u.isEmojii(null==r?null:r.text)),e.Q6J("ngClass",e.DdM(15,$t))("ngStyle",e.WLB(16,Yn,u.stylesMap.get("bubbleReceivedBackground"),u.stylesMap.get("bubbleReceivedTextColor")))("isSameSender",u.isSameSender(null==r?null:r.sender,a))("message",r)("fontColor",u.stylesMap.get("bubbleReceivedTextColor"))("fontSize",u.stylesMap.get("fontSize"))("fontFamily",u.stylesMap.get("fontFamily"))("stylesMap",u.stylesMap)}}function Jr(i,o){if(1&i&&(e.TgZ(0,"div",26),e._UZ(1,"chat-info-message",27),e.qZA()),2&i){var n=e.oxw().$implicit;e.xp6(1),e.Q6J("message",n)}}function Qr(i,o){if(1&i&&(e.TgZ(0,"time",null,28),e._uU(2),e.ALo(3,"amTimeAgo"),e.qZA()),2&i){var n=e.oxw().$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,null==n?null:n.timestamp)," ")}}function Kr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",29),e.TgZ(1,"chat-message-attachment",30),e.NdJ("onElementRendered",function(u){return e.CHM(n),e.oxw(2).onElementRenderedFN(u)})("onAttachmentButtonClicked",function(u){return e.CHM(n),e.oxw(2).onAttachmentButtonClickedFN(u)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("ngClass",e.DdM(5,$t)),e.xp6(1),e.Q6J("message",t)("isConversationArchived",r.isConversationArchived)("isLastMessage",r.isLastMessage(null==t?null:t.uid))("stylesMap",r.stylesMap)}}var Xr=function(i){return{sender:i}};function $r(i,o){if(1&i&&(e.TgZ(0,"div",13),e.YNc(1,Wr,3,17,"div",14),e.YNc(2,Gr,3,19,"div",15),e.YNc(3,Jr,2,1,"div",16),e.TgZ(4,"div",17),e.YNc(5,Qr,4,3,"time",3),e.qZA(),e.YNc(6,Kr,2,6,"div",18),e.qZA()),2&i){var n=o.$implicit,t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_MINE,n)),e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_OTHERS,n)),e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_INFO,n)),e.xp6(1),e.Q6J("ngClass",e.VKq(6,Xr,(null==n?null:n.sender)==t.senderId)),e.xp6(1),e.Q6J("ngIf",""!==(null==n?null:n.sender)&&"{.sv: timestamp}"!==(null==n?null:n.timestamp)),e.xp6(1),e.Q6J("ngIf",(null==n?null:n.attributes)&&(null==n||null==n.attributes?null:n.attributes.attachment))}}var ea=function(i){return{"background-color":i}},ta=function(i){return{"background-color":i,opacity:.4}},na=function(i){return{"background-color":i,opacity:.6}};function oa(i,o){if(1&i&&(e.TgZ(0,"div",31),e.TgZ(1,"div",32),e._UZ(2,"div",33),e._UZ(3,"div",34),e._UZ(4,"div",35),e.qZA(),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Q6J("ngStyle",e.VKq(3,ea,n.stylesMap.get("iconColor"))),e.xp6(1),e.Q6J("ngStyle",e.VKq(5,ta,n.stylesMap.get("iconColor"))),e.xp6(1),e.Q6J("ngStyle",e.VKq(7,na,n.stylesMap.get("iconColor")))}}function ia(i,o){if(1&i&&e._UZ(0,"chat-avatar-image",39),2&i){var n=e.oxw(2);e.Q6J("senderID",n.idUserTypingNow)("senderFullname",n.nameUserTypingNow)("baseLocation",n.baseLocation)}}var ra=function(i){return{userTypingNowExist:i}};function aa(i,o){if(1&i&&(e.TgZ(0,"div",36),e.YNc(1,ia,1,3,"chat-avatar-image",37),e._UZ(2,"user-typing",38),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngIf",n.idUserTypingNow),e.xp6(1),e.Q6J("ngClass",e.VKq(6,ra,!n.idUserTypingNow))("color",null==n.stylesMap?null:n.stylesMap.get("iconColor"))("translationMap",n.translationMap)("idUserTypingNow",n.idUserTypingNow)("nameUserTypingNow",n.nameUserTypingNow)}}var Gn=function(){function i(o,n,t){this.cdref=o,this.elementRef=n,this.uploadService=t,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onMenuOptionShow=new e.vpe,this.onEmojiiPickerShow=new e.vpe,this.onAttachmentButtonClicked=new e.vpe,this.onScrollContent=new e.vpe,this.startScroll=!0,this.idDivScroll="c21-contentScroll",this.isScrolling=!1,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.isPopupUrl=po,this.popupUrl=Ht,this.MSG_STATUS_SENT=100,this.MSG_STATUS_SENT_SERVER=150,this.MSG_STATUS_RETURN_RECEIPT=250,this.isMine=Vt,this.isInfo=xt,this.messageType=Xe,this.isEmojii=Po,this.isImage=qt,this.isFrame=wn,this.MESSAGE_TYPE_INFO=N,this.MESSAGE_TYPE_MINE=V,this.MESSAGE_TYPE_OTHERS=Q,this.tooltipOptions={"show-delay":1500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.urlBOTImage="https://s3.eu-west-1.amazonaws.com/tiledesk-widget/dev/2.0.4-beta.7/assets/images/avatar_bot_tiledesk.svg",this.showUploadProgress=!1,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.listenToUploadFileProgress()},i.prototype.ngAfterContentChecked=function(){this.cdref.detectChanges()},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("bubbleSentTextColor")&&this.elementRef.nativeElement.querySelector(".c21-body").style.setProperty("--textColorSent",this.stylesMap.get("bubbleSentTextColor")),this.stylesMap&&this.stylesMap.get("bubbleReceivedTextColor")&&this.elementRef.nativeElement.querySelector(".c21-body").style.setProperty("--textColorReceive",this.stylesMap.get("bubbleReceivedTextColor"))},i.prototype.getMetadataSize=function(o){void 0===o.width&&(o.width="100%"),void 0===o.height&&(o.height=We);var n={width:o.width,height:o.height};if(o.width&&o.width>We){var t=o.width/o.height;n.width=We,n.height=We/t}return n},i.prototype.listenToUploadFileProgress=function(){var o=this;this.uploadService.BSStateUpload.subscribe(function(n){o.logger.debug("[CONV-CONTENT] BSStateUpload",n),n&&(o.showUploadProgress=100!==n.upload&&!isNaN(n.upload),o.uploadProgress=n.upload,o.fileType="file",o.scrollToBottom())})},i.prototype.onScroll=function(o){if(this.startScroll=!1,this.scrollMe){var t=this.checkContentScrollPosition(this.scrollMe.nativeElement);this.onScrollContent.emit(!!t)}},i.prototype.checkContentScrollPosition=function(o){return o||(o=this.scrollMe.nativeElement),o.scrollHeight-o.scrollTop<=o.clientHeight+40?(this.logger.debug("[CONV-CONTENT] - SONO ALLA FINE"),!0):(this.logger.debug("[CONV-CONTENT] - NON SONO ALLA FINE"),!1)},i.prototype.scrollToBottom=function(o){var n=this;try{n.isScrolling=!0;var t=document.getElementById(n.idDivScroll);setTimeout(function(){!0===n.isIE||!0===o||!0===n.firstScroll?t.parentElement.classList.add("withoutAnimation"):t.parentElement.classList.remove("withoutAnimation"),t.parentElement.scrollTop=t.scrollHeight,t.style.opacity="1",n.firstScroll=!1},0)}catch(r){this.logger.error("[CONV-CONTENT] scrollToBottom > Error :"+r)}n.isScrolling=!1},i.prototype.isLastMessage=function(o){return o===this.messages[this.messages.length-1].uid},i.prototype.isSameSender=function(o,n){return!(!o||!this.messages[n-1]||o!==this.messages[n-1].sender)},i.prototype.isFirstMessage=function(o,n){return!(!o||0!=n||!this.messages[n]||this.messages[n]===o)},i.prototype.hideOutsideElements=function(){this.onMenuOptionShow.emit(!1),this.onEmojiiPickerShow.emit(!1)},i.prototype.onAttachmentButtonClickedFN=function(o){this.onAttachmentButtonClicked.emit(o)},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit(o)},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit(o)},i.prototype.onElementRenderedFN=function(o){o.status&&this.scrollMe&&(this.checkContentScrollPosition(this.scrollMe.nativeElement),this.scrollToBottom())},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.sBO),e.Y36(e.SBq),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-content"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(jr,5),2&n)&&(e.iGM(r=e.CRH())&&(t.scrollMe=r.first))},inputs:{messages:"messages",senderId:"senderId",baseLocation:"baseLocation",isConversationArchived:"isConversationArchived",isTypings:"isTypings",idUserTypingNow:"idUserTypingNow",nameUserTypingNow:"nameUserTypingNow",typingLocation:"typingLocation",fullscreenMode:"fullscreenMode",translationMap:"translationMap",stylesMap:"stylesMap"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onMenuOptionShow:"onMenuOptionShow",onEmojiiPickerShow:"onEmojiiPickerShow",onAttachmentButtonClicked:"onAttachmentButtonClicked",onScrollContent:"onScrollContent"},features:[e.TTD],decls:12,vars:5,consts:[[1,"c21-body",3,"click"],[1,"c21-body-container"],["tabindex","1520","aria-label"," messaggi della conversazione: ",1,"c21-body-content"],[4,"ngIf"],["id","chat21-sheet-content",1,"chat21-sheet-content"],[1,"chat21-conversation-parts-container"],["id","scroll-me",3,"scroll"],["scrollMe",""],[1,"c21-contentScroll",3,"id"],["tabindex","1521","class","rowMsg",4,"ngFor","ngForOf"],["class","msg_container base_sent",4,"ngIf"],["class","msg_container base_receive",4,"ngIf"],[1,"loading",3,"color","translationMap","idUserTypingNow","nameUserTypingNow"],["tabindex","1521",1,"rowMsg"],["role","messaggio","class","msg_container base_sent",4,"ngIf"],["role","messaggio","class","msg_container base_receive",4,"ngIf"],["class","msg_info_container",4,"ngIf"],[1,"time","slide-in-left",3,"ngClass"],["class","attachment_container",3,"ngClass",4,"ngIf"],["role","messaggio",1,"msg_container","base_sent"],[1,"messages","msg_sent",3,"ngStyle","ngClass","message","fontColor","fontSize","fontFamily","stylesMap","onBeforeMessageRender","onAfterMessageRender","onElementRendered"],[3,"status"],["role","messaggio",1,"msg_container","base_receive"],[3,"ngClass","senderID","senderFullname","baseLocation",4,"ngIf"],[1,"messages","msg_receive",3,"ngClass","ngStyle","isSameSender","message","fontColor","fontSize","fontFamily","stylesMap","onBeforeMessageRender","onAfterMessageRender","onElementRendered"],[3,"ngClass","senderID","senderFullname","baseLocation"],[1,"msg_info_container"],[1,"messages",3,"message"],["timeTooltip",""],[1,"attachment_container",3,"ngClass"],[2,"height","100%","display","block",3,"message","isConversationArchived","isLastMessage","stylesMap","onElementRendered","onAttachmentButtonClicked"],[1,"msg_container","base_sent"],["id","chat21-spinner",1,"chat21-spinner","active",2,"margin","0px 6px 0px"],[1,"chat21-bounce1",3,"ngStyle"],[1,"chat21-bounce2",3,"ngStyle"],[1,"chat21-bounce3",3,"ngStyle"],[1,"msg_container","base_receive"],["class","slide-in-left",3,"senderID","senderFullname","baseLocation",4,"ngIf"],[3,"ngClass","color","translationMap","idUserTypingNow","nameUserTypingNow"],[1,"slide-in-left",3,"senderID","senderFullname","baseLocation"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.hideOutsideElements()}),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.YNc(3,qr,2,4,"span",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"div",6,7),e.NdJ("scroll",function(a){return t.onScroll(a)}),e.TgZ(8,"div",8),e.YNc(9,$r,7,8,"div",9),e.YNc(10,oa,5,9,"div",10),e.YNc(11,aa,3,8,"div",11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(3),e.Q6J("ngIf",t.messages&&0===t.messages.length),e.xp6(5),e.s9C("id",t.idDivScroll),e.xp6(1),e.Q6J("ngForOf",t.messages),e.xp6(1),e.Q6J("ngIf",t.showUploadProgress),e.xp6(1),e.Q6J("ngIf",t.isTypings&&"content"===t.typingLocation))},directives:[me.O5,me.sg,zn,me.mk,yr,me.PC,Er,Wn,kr,zr],pipes:[$e.eG],styles:['#scroll-me[_ngcontent-%COMP%]{scroll-behavior:smooth}#scroll-me.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}[_nghost-%COMP%]{--textColorSent: #ffffff;--textColorReceive: #1a1a1a}[_nghost-%COMP%] .base_receive[_ngcontent-%COMP%] .msg_receive[_ngcontent-%COMP%] >div>div>div>chat-text a{color:var(--textColorReceive)!important}[_nghost-%COMP%] .base_sent[_ngcontent-%COMP%] .msg_sent[_ngcontent-%COMP%] >div>div>div>chat-text a{color:var(--textColorSent)!important}[_nghost-%COMP%] .userTypingNowExist[_ngcontent-%COMP%] >div.spinner{margin:15px 50px}[_nghost-%COMP%] .loading[_ngcontent-%COMP%] >div.spinner{margin:25px 50px}.c21-body[_ngcontent-%COMP%]{position:fixed}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .chat21-header-modal-select[_ngcontent-%COMP%]{font-family:"Google Sans",sans-serif!important;padding:0;background-color:rgba(185,185,185,.13);margin:8px;line-height:1.2em;color:#616161;font-size:15px;text-align:center;word-wrap:break-word;border-radius:8px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .chat21-header-modal-select-more-of-one-dept[_ngcontent-%COMP%]{position:relative;height:auto;padding:10px;margin:30px 0 0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%]{position:absolute;top:0;right:0;left:0;bottom:56px;overflow:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .time[_ngcontent-%COMP%]{margin-bottom:20px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #c21-contentScroll[_ngcontent-%COMP%]{position:absolute;left:0px;right:0px;padding:10px;opacity:0;transition:opacity .5s;transition-timing-function:ease-in}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.1);background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:6px!important;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0);background-color:rgba(0,0,0,.25)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;top:0;right:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#d3d6dc}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .msg_container[_ngcontent-%COMP%]{overflow:hidden;display:flex;width:100%}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .attachment_container[_ngcontent-%COMP%]{display:flex;align-content:center;justify-content:flex-end}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .msg_info_container[_ngcontent-%COMP%]{text-align:center;padding:0 0 6px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%]{border-radius:20px;padding:0;word-wrap:break-word}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1.4em;margin:0;padding:14px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:8px;padding:3px;margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_info[_ngcontent-%COMP%]{border-radius:8px;border:1px solid #C9E4F6;padding-left:4px;padding-right:4px;display:inline-block;background:#C9E4F6;font-size:.85em}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%]{align-items:flex-end;justify-content:flex-end;padding:2px 0 4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .msg_sent[_ngcontent-%COMP%]{background-color:#62a8ea;color:#fff;margin-right:0;margin-left:4px;max-width:calc(100% - 30px);min-width:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:8px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .no-background[_ngcontent-%COMP%]{background:transparent!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%]{background:transparent!important;font-size:4em;margin:-15px 0 0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:0;margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%]{width:16px;height:16px;margin-left:4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:13px;height:13px;background-repeat:no-repeat;background-position:center;background-size:cover;overflow-x:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-schedule[_ngcontent-%COMP%]{background-image:url(f21ico-schedule.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-done[_ngcontent-%COMP%]{background-image:url(f21ico-done.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-done_all[_ngcontent-%COMP%]{background-image:url(f21ico-done_all.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%]{padding:2px 0 4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%]{position:relative;border-radius:50%;width:28px;height:28px;margin-right:6px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%] .profile_image[_ngcontent-%COMP%]{position:relative;width:25px;height:25px;border-radius:50%;overflow:hidden;background-color:#fff;border:1px solid #e2e2e2}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%] .profile_image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .msg_receive[_ngcontent-%COMP%]{background-color:#f7f7f7;color:#1a1a1a;max-width:calc(100% - 70px);min-width:14px;margin:auto 20px auto 10px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:auto}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .no-background[_ngcontent-%COMP%]{background:transparent!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%]{background-color:transparent!important;font-size:4em;margin:-15px 20px -10px 10px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:0;margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .message_sender_fullname[_ngcontent-%COMP%]{font-size:12px;color:#5f6368;margin:0 auto 4px}.c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}']}),i}(),sa=function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je){this.uid=o,this.attributes=n,this.channel_type=t,this.conversation_with_fullname=r,this.conversation_with=a,this.recipient=u,this.recipient_fullname=y,this.image=j,this.is_new=J,this.last_message_text=ie,this.text=ue,this.sender=ge,this.senderAuthInfo=de,this.sender_fullname=ve,this.status=Te,this.timestamp=ke,this.selected=Ae,this.color=Be,this.avatar=Ze,this.archived=ze,this.type=je}}(),lt=ye(25416),la=ye(55959),en=function(){function i(o,n,t){if(this.http=o,this.g=n,this.appConfigService=t,this.logger=Ce.getInstance(),this.API_URL=this.appConfigService.getConfig().apiUrl,!this.API_URL)throw new Error("apiUrl is not defined");this.obsCloseConversation=new he.X(null)}return i.prototype.httpSendRate=function(o,n){var t=this.g.tiledeskToken,r=this.g.projectid,a=this.g.recipientId;if(o&&t&&r&&a){var u=new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:t}),y=this.API_URL+r+"/requests/"+a+"/rating";this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e url: ",y);var j={rating:o,rating_message:n};return this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e options: ",u),this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e body: ",JSON.stringify(j)),this.http.patch(y,JSON.stringify(j),{headers:u}).pipe((0,An.U)(function(J){return J.json()}))}},i.prototype.setOsservable=function(o){this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e setOsservable: ",o),this.obsCloseConversation.next(o)},i.prototype._dowloadTranscript=function(o){this.g.windowContext.open(this.API_URL+"public/requests/"+o+"/messages-user.html","_blank")},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}();function ca(i,o){if(1&i&&e._UZ(0,"user-typing",17),2&i){var n=e.oxw();e.Q6J("color",null==n.stylesMap?null:n.stylesMap.get("foregroundColor"))("translationMap",n.translationMap)("nameUserTypingNow",n.nameUserTypingNow)("typingLocation",n.typingLocation)}}function ua(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",23),e._UZ(1,"path",5),e._UZ(2,"path",24),e.TgZ(3,"title",7),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(null==n.translationMap?null:n.translationMap.get("SOUND_OFF"))}}function ha(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",23),e._UZ(1,"path",5),e._UZ(2,"path",25),e.TgZ(3,"title",7),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(null==n.translationMap?null:n.translationMap.get("SOUND_ON"))}}function pa(i,o){if(1&i&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("SOUND_OFF"),"")}}function da(i,o){if(1&i&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("SOUND_ON"),"")}}function ga(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.O4$(),e.TgZ(1,"svg",27),e._UZ(2,"path",5),e._UZ(3,"path",28),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("DOWNLOAD_TRANSCRIPT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("DOWNLOAD_TRANSCRIPT"))}}function fa(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).closeChat()}),e.O4$(),e.TgZ(1,"svg",29),e._UZ(2,"path",30),e._UZ(3,"rect",31),e._UZ(4,"path",32),e.TgZ(5,"title",7),e._uU(6),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"span",26),e._uU(8),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(6),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE_CHAT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE_CHAT"))}}function ma(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).restartChat()}),e.O4$(),e.TgZ(1,"svg",33),e._UZ(2,"path",34),e._UZ(3,"path",35),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("RESTART")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("RESTART"))}}function va(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).signOut()}),e.O4$(),e.TgZ(1,"svg",36),e._UZ(2,"path",5),e._UZ(3,"path",37),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("LOGOUT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("LOGOUT"))}}function ba(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",18),e.TgZ(1,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw().toggleSound()}),e.YNc(2,ua,5,1,"svg",20),e.YNc(3,ha,5,1,"svg",20),e.YNc(4,pa,2,1,"span",21),e.YNc(5,da,2,1,"span",21),e.qZA(),e.YNc(6,ga,8,2,"div",22),e.YNc(7,fa,9,2,"div",22),e.YNc(8,ma,8,2,"div",22),e.YNc(9,va,8,2,"div",22),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.soundEnabled),e.xp6(1),e.Q6J("ngIf",!t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.isTrascriptDownloadEnabled),e.xp6(1),e.Q6J("ngIf",!t.hideCloseConversationOptionMenu),e.xp6(1),e.Q6J("ngIf",!t.hideRestartConversationOptionsMenu),e.xp6(1),e.Q6J("ngIf",!t.hideSignOutOptionMenu)}}var _a=function(i){return{"background-image":i}},tn=function(i){return{display:i}},nn=function(i){return{fill:i}},Ca=function(i){return{color:i}},ya=function(){function i(o,n){this.g=o,this.appConfigService=n,this.onBack=new e.vpe,this.onCloseWidget=new e.vpe,this.onSoundChange=new e.vpe,this.onCloseChat=new e.vpe,this.onRestartChat=new e.vpe,this.onWidgetHeightChange=new e.vpe,this.onSignOut=new e.vpe,this.onMenuOptionShow=new e.vpe,this.convertColorToRGBA=Ie,this.isButtonsDisabled=!0,this.isDirect=!1,this.subscriptions=[],this.membersConversation=["SYSTEM"],this.heightStatus="min",this.logger=Ce.getInstance(),this.API_URL=this.appConfigService.getConfig().apiUrl}return i.prototype.ngOnInit=function(){this.logger.debug("[CONV-HEADER] ngOnInit: conversation-header COMPONENT ",this.translationMap),this.membersConversation.push(this.senderId)},i.prototype.ngOnChanges=function(o){o.idConversation&&void 0!==o.idConversation.currentValue&&this.logger.debug("[CONV-HEADER] onChanges -- Conversation-header.component-> start initializeTyping()",this.idConversation)},i.prototype.ngAfterViewInit=function(){this.logger.debug("[CONV-HEADER] --------ngAfterViewInit: conversation-header-------- "),this.isButtonsDisabled=!1,this.setSubscriptions()},i.prototype.setSubscriptions=function(){},i.prototype.returnHome=function(){this.onBack.emit()},i.prototype.closeChat=function(){this.onCloseChat.emit()},i.prototype.restartChat=function(){this.onRestartChat.emit(),this.onMenuOptionShow.emit(!1)},i.prototype.closeWidget=function(){this.onCloseWidget.emit()},i.prototype.dowloadTranscript=function(){this.windowContext.open(this.API_URL+"public/requests/"+this.idConversation+"/messages-user.html","_blank"),this.onMenuOptionShow.emit(!1)},i.prototype.toggleSound=function(){this.onMenuOptionShow.emit(!1),this.onSoundChange.emit(!this.soundEnabled)},i.prototype.signOut=function(){this.onSignOut.emit(!0)},i.prototype.toggleMenu=function(){this.onMenuOptionShow.emit(!this.isMenuShow)},i.prototype.maximizeMinimize=function(o){this.heightStatus=o,this.onWidgetHeightChange.emit(o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[CONV-HEADER] ngOnDestroy ------------------\x3e this.subscriptions",this.subscriptions),this.unsubescribeAll()},i.prototype.unsubescribeAll=function(){var o=this;this.logger.debug("[CONV-HEADER] unsubescribeAll: ",this.subscriptions),this.subscriptions.forEach(function(n){o.logger.debug("[CONV-HEADER] unsubescribe: ",n),n.value.unsubscribe()}),this.subscriptions.length=0,this.subscriptions=[]},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Fe))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-header"]],inputs:{idConversation:"idConversation",senderId:"senderId",soundEnabled:"soundEnabled",isMenuShow:"isMenuShow",isTypings:"isTypings",nameUserTypingNow:"nameUserTypingNow",typingLocation:"typingLocation",isTrascriptDownloadEnabled:"isTrascriptDownloadEnabled",hideCloseConversationOptionMenu:"hideCloseConversationOptionMenu",hideRestartConversationOptionsMenu:"hideRestartConversationOptionsMenu",hideHeaderCloseButton:"hideHeaderCloseButton",hideHeaderBackButton:"hideHeaderBackButton",hideHeaderConversationOptionsMenu:"hideHeaderConversationOptionsMenu",hideSignOutOptionMenu:"hideSignOutOptionMenu",windowContext:"windowContext",stylesMap:"stylesMap",translationMap:"translationMap",widgetTitle:"widgetTitle"},outputs:{onBack:"onBack",onCloseWidget:"onCloseWidget",onSoundChange:"onSoundChange",onCloseChat:"onCloseChat",onRestartChat:"onRestartChat",onWidgetHeightChange:"onWidgetHeightChange",onSignOut:"onSignOut",onMenuOptionShow:"onMenuOptionShow"},features:[e.TTD],decls:26,vars:33,consts:[[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean",3,"ngStyle","click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["tabindex","-1",1,"c21-header-button","c21-right","c21-button-clean",3,"ngStyle","click"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24",3,"ngStyle"],["d","M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"],["tabindex","1530","aria-label"," indietro ",1,"c21-header-button","c21-left","c21-button-clean",3,"ngStyle","click"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],[3,"color","translationMap","nameUserTypingNow","typingLocation",4,"ngIf"],["id","c21-options-menu",4,"ngIf"],[3,"color","translationMap","nameUserTypingNow","typingLocation"],["id","c21-options-menu"],[1,"c21-header-button","c21-right",3,"click"],["aria-labelledby","altIconTitle","class","icon-menu","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",4,"ngIf"],["class","label-menu-item",4,"ngIf"],["class","c21-header-button c21-right",3,"click",4,"ngIf"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",1,"icon-menu"],["d","M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"],["d","M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"],[1,"label-menu-item"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",1,"icon-menu"],["d","M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"],["role","img","id","archive","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 512 512",1,"icon-menu"],["d","M80 152v256a40.12 40.12 0 0040 40h272a40.12 40.12 0 0040-40V152","stroke-linecap","round","stroke-linejoin","round","stroke-width","50px","fill","none"],["x","48","y","64","width","416","height","80","rx","28","ry","28","stroke-linejoin","round","stroke-width","50px","fill","none"],["stroke-linecap","round","stroke-linejoin","round","d","M320 304l-64 64-64-64M256 345.89V224","stroke-width","50px","fill","none"],["role","img","id","refresh","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 20 20",1,"icon-menu"],["d","M9.6,18.2c0.6,0,1-0.7,1-1.5s-0.5-1.5-1-1.5H6c-0.6,0-1-0.7-1-1.5V7.8h1c0.4,0,0.8-0.4,1-0.9c0.2-0.6,0.1-1.2-0.2-1.6 l-2.1-3c-0.4-0.6-1.1-0.6-1.5,0l-2.1,3C0.9,5.7,0.8,6.3,1,6.9s0.5,0.9,1,0.9h1v5.9c0,2.5,1.4,4.4,3.1,4.4H9.6z"],["d","M10.5,1.8c-0.5,0-1,0.7-1,1.5s0.4,1.5,1,1.5h3.5c0.5,0,1,0.7,1,1.5v5.9h-1c-0.4,0-0.8,0.4-0.9,0.9s-0.1,1.2,0.2,1.6l2,3 c0.4,0.6,1,0.6,1.4,0l2-3c0.3-0.4,0.4-1.1,0.2-1.6c-0.2-0.6-0.5-0.9-0.9-0.9h-1V6.3c0-2.5-1.3-4.4-3-4.4H10.5z"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24","aria-labelledby","altIconTitle",1,"icon-menu"],["d","M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"button",3),e.NdJ("click",function(){return t.closeWidget()}),e.O4$(),e.TgZ(4,"svg",4),e._UZ(5,"path",5),e._UZ(6,"path",6),e.TgZ(7,"title",7),e._uU(8),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(9,"button",8),e.NdJ("click",function(){return t.toggleMenu()}),e.O4$(),e.TgZ(10,"svg",9),e._UZ(11,"path",5),e._UZ(12,"path",10),e.TgZ(13,"title",7),e._uU(14),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(15,"button",11),e.NdJ("click",function(){return t.returnHome()}),e.O4$(),e.TgZ(16,"svg",4),e._UZ(17,"path",5),e._UZ(18,"path",12),e.TgZ(19,"title",7),e._uU(20),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(21,"div",13),e.TgZ(22,"div",14),e._uU(23),e.qZA(),e.qZA(),e.YNc(24,ca,1,4,"user-typing",15),e.qZA(),e.qZA(),e.qZA(),e.YNc(25,ba,10,8,"div",16)),2&n&&(e.Q6J("ngStyle",e.VKq(17,_a,null==t.stylesMap?null:t.stylesMap.get("colorGradient"))),e.xp6(3),e.Q6J("ngStyle",e.VKq(19,tn,t.hideHeaderCloseButton?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(21,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("BUTTON_CLOSE_TO_ICON")),e.xp6(1),e.Q6J("ngStyle",e.VKq(23,tn,t.hideHeaderConversationOptionsMenu?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(25,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("OPTIONS")),e.xp6(1),e.Q6J("ngStyle",e.VKq(27,tn,t.hideHeaderBackButton?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(29,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("PREV_CONVERSATIONS")),e.xp6(1),e.Q6J("ngStyle",e.VKq(31,Ca,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Oqu(t.widgetTitle),e.xp6(1),e.Q6J("ngIf",t.isTypings&&"header"===t.typingLocation),e.xp6(1),e.Q6J("ngIf",t.isMenuShow))},directives:[me.PC,me.O5,zn],styles:[".c21-header[_ngcontent-%COMP%]{position:fixed;left:0px;right:0px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;color:#2a6ac1;box-shadow:0 4px 15px rgba(0,0,0,.2),0 1px 2px rgba(0,0,0,.2);background-color:#fff}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{margin:5px;padding:5px 10px;display:flex;align-items:center;color:#777}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;border-radius:6px;cursor:pointer}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}#c21-options-menu[_ngcontent-%COMP%] .icon-menu[_ngcontent-%COMP%]{fill:#5f6368}#c21-options-menu[_ngcontent-%COMP%] .icon-menu#archive[_ngcontent-%COMP%]{stroke:#5f6368}"]}),i}(),wa=["iframe"],Jn=function(i){return{fill:i}};function Oa(i,o){if(1&i){var n=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnOpenExternal()}),e.O4$(),e.TgZ(1,"svg",3),e._UZ(2,"path",15),e._UZ(3,"path",16),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.VKq(1,Jn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor")))}}function Ma(i,o){1&i&&(e.TgZ(0,"div",17),e._UZ(1,"div"),e._UZ(2,"div"),e._UZ(3,"div"),e._UZ(4,"div"),e._UZ(5,"div"),e._UZ(6,"div"),e._UZ(7,"div"),e._UZ(8,"div"),e.qZA())}var xa=function(i){return{"background-image":i}},Ea=function(i){return{color:i}},Ta=function(){function i(o){this.sanitizer=o,this.onOpenExternal=new e.vpe,this.onClose=new e.vpe,this.isOpen="open",this.hideSpinner=!1,this.logger=Ce.getInstance(),this.convertColorToRGBA=Ie}return i.prototype.ngOnInit=function(){this.button&&this.button.link&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(this.button.link))},i.prototype.ngAfterViewInit=function(){this.logger.debug("[INTERNALFRAME] ngAfterViewInit",this.iframe.nativeElement.contentDocument||this.iframe.nativeElement.contentWindow,this.iframe.nativeElement.contentWindow,this.iframe.nativeElement.contentWindow.history)},i.prototype.ngOnDestroy=function(){this.url=null,this.hideSpinner=!1},i.prototype.returnClose=function(){this.isOpen="closed",this.onClose.emit()},i.prototype.returnOpenExternal=function(){this.onOpenExternal.emit(this.button)},i.prototype.onIframeLoaded=function(o){this.hideSpinner=!0},i.prototype.onError=function(o){this.logger.error("[INTERNALFRAME] onError ",o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-internal-frame"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(wa,5),2&n)&&(e.iGM(r=e.CRH())&&(t.iframe=r.first))},inputs:{button:"button",openExternalLinkButton:"openExternalLinkButton",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onOpenExternal:"onOpenExternal",onClose:"onClose"},decls:16,vars:15,consts:[[1,"c21-iframe-container"],[1,"c21-iframe-header","c21-header",3,"ngStyle"],["tabindex","1530",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],["id","altIconTitle"],["tabindex","1530","class","c21-header-button c21-right c21-button-clean",3,"click",4,"ngIf"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],[1,"c21-iframe"],["class","lds-roller",4,"ngIf"],["id","contentFrame","allowfullscreen","","title","","width","100%","height","100%",2,"border","none",3,"src","load","error"],["iframe",""],["tabindex","1530",1,"c21-header-button","c21-right","c21-button-clean",3,"click"],["d","M0 0h24v24H0z","fill","none"],["d","M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"],[1,"lds-roller"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return t.returnClose()}),e.O4$(),e.TgZ(3,"svg",3),e._UZ(4,"path",4),e._UZ(5,"path",5),e.TgZ(6,"title",6),e._uU(7),e.qZA(),e.qZA(),e.qZA(),e.YNc(8,Oa,4,3,"button",7),e.kcU(),e.TgZ(9,"div",8),e.TgZ(10,"div",9),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",10),e.YNc(13,Ma,9,0,"div",11),e.TgZ(14,"iframe",12,13),e.NdJ("load",function(a){return t.onIframeLoaded(a)})("error",function(a){return t.onError(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.Q6J("@enterAnimation",void 0),e.xp6(1),e.Q6J("ngStyle",e.VKq(9,xa,null==t.stylesMap?null:t.stylesMap.get("colorGradient"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(11,Jn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE")),e.xp6(1),e.Q6J("ngIf",t.openExternalLinkButton),e.xp6(1),e.Q6J("ngStyle",e.VKq(13,Ea,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Oqu(null==t.button?null:t.button.value),e.xp6(2),e.Q6J("ngIf",!t.hideSpinner),e.xp6(1),e.Q6J("src",t.url,e.uOi))},directives:[me.PC,me.O5],styles:['.c21-iframe-container[_ngcontent-%COMP%]{max-width:100%;height:100%;width:100%;position:fixed;background-color:#fff;z-index:10}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%]{left:0px;right:0px}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{display:block;align-items:center;text-align:center;width:40px;height:40px;margin:6px;padding:0;cursor:pointer}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-right[_ngcontent-%COMP%]{float:right}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-left[_ngcontent-%COMP%]{float:left}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-close[_ngcontent-%COMP%]{display:none}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:20px;width:20px;margin:10px}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe[_ngcontent-%COMP%]{height:calc(100% - 40px)}.lds-roller[_ngcontent-%COMP%]{position:relative;width:80px;height:80px;margin:30px auto}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{-webkit-animation:lds-roller 1.2s cubic-bezier(.5,0,.5,1) infinite;animation:lds-roller 1.2s cubic-bezier(.5,0,.5,1) infinite;transform-origin:40px 40px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:after{content:" ";display:block;position:absolute;width:7px;height:7px;border-radius:50%;background:#1e60b5;margin:-4px 0 0 -4px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(1){-webkit-animation-delay:-36ms;animation-delay:-36ms}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(1):after{top:63px;left:63px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(2){-webkit-animation-delay:-72ms;animation-delay:-72ms}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(2):after{top:68px;left:56px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(3){-webkit-animation-delay:-.108s;animation-delay:-.108s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(3):after{top:71px;left:48px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(4){-webkit-animation-delay:-.144s;animation-delay:-.144s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(4):after{top:72px;left:40px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(5){-webkit-animation-delay:-.18s;animation-delay:-.18s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(5):after{top:71px;left:32px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(6){-webkit-animation-delay:-.216s;animation-delay:-.216s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(6):after{top:68px;left:24px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(7){-webkit-animation-delay:-.252s;animation-delay:-.252s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(7):after{top:63px;left:17px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(8){-webkit-animation-delay:-.288s;animation-delay:-.288s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(8):after{top:56px;left:12px}@-webkit-keyframes lds-roller{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes lds-roller{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],data:{animation:[(0,we.X$)("enterAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"translateX(100%)",opacity:0}),(0,we.jt)("400ms",(0,we.oB)({transform:"translateX(0)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"translateX(0)",opacity:1}),(0,we.jt)("400ms",(0,we.oB)({transform:"translateX(100%)",opacity:0}))])])]}}),i}(),Sa=["divPreview"];function Pa(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-image",25),e.NdJ("onImageRendered",function(a){return e.CHM(n),e.oxw().onImageRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.fileSelected)("width",null==t.fileSelected?null:t.fileSelected.width)("height",null==t.fileSelected?null:t.fileSelected.height)}}var ka=function(i){return{display:i}},Aa=function(i){return{fill:i}},Ia=function(){function i(o){this.sanitizer=o,this.onSendAttachment=new e.vpe,this.onCloseModalPreview=new e.vpe,this.hideHeaderCloseButton=!1,this.arrayFiles=[],this.isFilePendingToLoad=!1,this.HEIGHT_DEFAULT="20px",this.currentHeight=0,this.startScroll=!0,this.idDivScroll="c21-contentScroll-preview",this.isScrolling=!1,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.log("[LOADER-PREVIEW-PAGE] Hello!",this.textInputTextArea),this.setFocusOnId("chat21-main-message-context-preview");for(var o=0;o<this.attachments.length;o++)this.logger.log("[LOADER-PREVIEW-PAGE] ngOnInit",this.attachments[o]),this.readAsDataURL(this.attachments[o])},i.prototype.getMetadataSize=function(o){var n=230;void 0===o.width&&(o.width=n),void 0===o.height&&(o.height=n);var r={width:o.width,height:o.height};if(o.width&&o.width>n){var a=o.width/o.height;r.width=o.width=n,r.height=o.height=n/a}else if(o.width&&o.width<=55){a=o.width/o.height;r.width=130,r.height=130/a}return o.height&&o.height>150&&(r.width=150/(a=o.height/o.width),r.height=150),r},i.prototype.readAsDataURL=function(o){this.logger.log("[LOADER-PREVIEW-PAGE] readAsDataURL file",o),o.file.type.startsWith("image")&&!o.file.type.includes("svg")?(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE IMAGE - IMAGE ",o),this.fileSelected||(this.fileSelected=Object.assign({},this.attachments[0].metadata),this.fileSelected=Object.assign(this.fileSelected,this.getMetadataSize(this.fileSelected)))):o.file.type.startsWith("image")&&o.file.type.includes("svg")?(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE SVG - SVG ",o),o.metadata.src=this.sanitizer.bypassSecurityTrustUrl(o.metadata.src),this.fileSelected||(this.fileSelected=Object.assign({},this.attachments[0].metadata),this.fileSelected=Object.assign(this.fileSelected,this.getMetadataSize(this.fileSelected)))):o.file.type.startsWith("image")||(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE ",o),this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE TYPE",o.file.type),this.file_extension=o.file.name.substring(o.file.name.lastIndexOf(".")+1,o.file.name.length)||o.file.name,this.createFile(o))},i.prototype.createFile=function(o){return(0,_e.mG)(this,void 0,void 0,function(){var n,r,a,u,y=this;return(0,_e.Jh)(this,function(j){switch(j.label){case 0:return n=this,[4,fetch(n.baseLocation+"/assets/images/file-alt-solid.png")];case 1:return[4,j.sent().blob()];case 2:return r=j.sent(),a=new File([r],o.file.name),this.logger.log("[LOADER-PREVIEW-PAGE] - createFile file - file",a),(u=new FileReader).onloadend=function(){var J=new Image;y.logger.debug("[LOADER-PREVIEW-PAGE] onload ",J),J.src=u.result.toString(),J.title=o.file.name,J.onload=function(){var ie={name:J.title,src:n.sanitizer.bypassSecurityTrustUrl(J.src),width:80,height:106,type:o.metadata.type,uid:o.metadata.uid};n.logger.debug("[LOADER-PREVIEW-PAGE] OK: ",ie),n.arrayFiles.push({metadata:ie}),n.fileSelected||(n.fileSelected=Object.assign({},ie))}},u.readAsDataURL(a),[2]}})})},i.prototype.onTextAreaChange=function(){this.resizeInputField(),this.resizeModalHeight()},i.prototype.setFocusOnId=function(o){setTimeout(function(){var n=document.getElementById(o);n&&(n.setAttribute("value"," "),n.focus())},500)},i.prototype.resizeInputField=function(){try{var o=document.getElementById("chat21-main-message-context-preview");o.style.height="100%","\n"===o.value?(o.value="",o.style.height=this.HEIGHT_DEFAULT):o.scrollHeight>o.offsetHeight?(o.style.height=o.scrollHeight+2+"px",o.style.minHeight=this.HEIGHT_DEFAULT):o.style.height=this.HEIGHT_DEFAULT}catch(n){this.logger.error("[LOADER-PREVIEW-PAGE] > Error :"+n)}},i.prototype.resizeModalHeight=function(){try{var o=document.getElementById("chat21-main-message-context-preview"),n=+o.style.height.substring(0,o.style.height.length-2);n>20&&n<110?this.scrollMe.nativeElement.style.height="calc(39% + "+(n-20)+"px":n<=20&&(this.scrollMe.nativeElement.style.height="39%")}catch(t){this.logger.error("[LOADER-PREVIEW-PAGE] > Error :"+t)}},i.prototype.restoreTextArea=function(){this.resizeInputField();var o=document.getElementById("chat21-main-message-context-preview");this.textInputTextArea="",o?(o.value="",o.placeholder=this.translationMap.get("LABEL_PLACEHOLDER"),this.logger.debug("[LOADER-PREVIEW-PAGE] AppComponent:restoreTextArea::restoreTextArea::textArea:","restored")):this.logger.error("[LOADER-PREVIEW-PAGE] restoreTextArea::textArea:","not restored"),this.setFocusOnId("chat21-main-message-context-preview")},i.prototype.onkeypress=function(o){var n=o.which||o.keyCode;this.textInputTextArea=document.getElementById("chat21-main-message-context-preview").value,13===n?this.textInputTextArea&&""!==this.textInputTextArea.trim()&&(this.onSendAttachment.emit(this.textInputTextArea),this.restoreTextArea()):9===n&&o.preventDefault()},i.prototype.onkeydown=function(o){27===(o.which||o.keyCode)&&this.onClickClose()},i.prototype.onPaste=function(o){this.resizeInputField(),this.logger.debug("[LOADER-PREVIEW] onPaste",o)},i.prototype.onClickClose=function(){this.logger.debug("[LOADER-PREVIEW] onCLose"),this.onCloseModalPreview.emit()},i.prototype.onSendPressed=function(o){this.logger.debug("[LOADER-PREVIEW] onSendPressed",o),this.onSendAttachment.emit(this.textInputTextArea)},i.prototype.onImageRenderedFN=function(o){this.isFilePendingToLoad=!1},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-attachment-preview"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Sa,5),2&n)&&(e.iGM(r=e.CRH())&&(t.scrollMe=r.first))},inputs:{textInputTextArea:"textInputTextArea",attachments:"attachments",baseLocation:"baseLocation",translationMap:"translationMap",stylesMap:"stylesMap"},outputs:{onSendAttachment:"onSendAttachment",onCloseModalPreview:"onCloseModalPreview"},decls:29,vars:13,consts:[["id","c21-preview"],["id","divPreview",1,"modal-preview-image"],["divPreview",""],[1,"c21-header"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean",3,"ngStyle","click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["id","scroll-me-preview",1,"c21-content"],["scrollMePreview",""],[3,"metadata","width","height","onImageRendered",4,"ngIf"],["id","img-preview-file-extension"],["id","c21-footer"],[1,"visible-text-area"],["start-focus-chat21-conversation-preview-component","","inputTextArea","","tabindex","1502","aria-labelledby","altTextArea","rows","1","id","chat21-main-message-context-preview",1,"f21textarea","c21-button-clean",3,"ngModel","placeholder","ngModelChange","keypress","keydown","paste"],["textbox",""],["tabindex","-1","id","chat21-button-send",1,"chat21-textarea-button",3,"click"],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24",0,"xml","space","preserve",2,"enable-background","new 0 0 24 24"],["d","M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"],["id","testFocus","tabindex","1599","onFocus","document.querySelector('[start-focus-chat21-conversation-preview-component]').focus()"],["id","altTextArea",2,"display","none"],[3,"metadata","width","height","onImageRendered"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1,2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.onClickClose()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.TgZ(10,"title",10),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",11,12),e.YNc(14,Pa,1,3,"chat-image",13),e.TgZ(15,"div",14),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",15),e.TgZ(18,"div",16),e.TgZ(19,"textarea",17,18),e.NdJ("ngModelChange",function(a){return t.textInputTextArea=a})("ngModelChange",function(){return t.onTextAreaChange()})("keypress",function(a){return t.onkeypress(a)})("keydown",function(a){return t.onkeydown(a)})("paste",function(a){return t.onPaste(a)}),e._uU(21," "),e.qZA(),e.qZA(),e.TgZ(22,"div",19),e.NdJ("click",function(a){return t.onSendPressed(a)}),e.TgZ(23,"span",20),e.O4$(),e.TgZ(24,"svg",21),e._UZ(25,"path",22),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e._UZ(26,"span",23),e.TgZ(27,"span",24),e._uU(28,"scrivi la tua domanda"),e.qZA()),2&n&&(e.xp6(6),e.Q6J("ngStyle",e.VKq(9,ka,t.hideHeaderCloseButton?"none":"flex")),e.xp6(1),e.Q6J("ngStyle",e.VKq(11,Aa,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE")),e.xp6(3),e.Q6J("ngIf",t.fileSelected),e.xp6(2),e.hij("",t.file_extension," "),e.xp6(3),e.s9C("placeholder",null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER")),e.Q6J("ngModel",t.textInputTextArea),e.xp6(3),e.ekj("active",!t.isFilePendingToLoad))},directives:[me.PC,me.O5,Oe.Fj,Oe.JJ,Oe.On,qn],styles:["[_nghost-%COMP%] .c21-content[_ngcontent-%COMP%] >chat-image div{margin:2px auto!important}#c21-preview[_ngcontent-%COMP%]{--margin-top: 200px;--margin-left: 50px;--margin-right: 50px;--header-height: 40px;--modal-height: 240px;--modal-width: 80%;--content-height: 160px;--border-radius: 16px;background-color:rgba(0,0,0,.4);height:100%;width:100%;position:absolute;z-index:25}#c21-preview[_ngcontent-%COMP%] .modal-preview-image[_ngcontent-%COMP%]{width:auto;height:auto;min-height:var(--modal-height);min-width:100px;max-width:80%;border-radius:var(--border-radius);font-size:1.2em;line-height:normal;overflow:hidden;background-color:#fff;z-index:25;margin:auto;margin-top:var(--margin-top)}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{height:calc(var(--header-height));width:var(--modal-width);position:fixed;top:var(--margin-top)}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{height:calc(var(--header-height))}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;display:inline-block;width:auto;height:40px;padding:0;margin:0 10px;font-size:1em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{margin:6px;width:30px;height:30px}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%]{position:fixed;top:calc(var(--margin-top) + var(--header-height));width:var(--modal-width);height:var(--content-height);display:flex;justify-content:center;align-items:center}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #c21-contentScroll-preview[_ngcontent-%COMP%]{position:absolute;left:0px;right:10px;padding:10px;opacity:0;transition:opacity .5s;transition-timing-function:ease-in}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;top:0;right:0}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]{scroll-behavior:smooth}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #img-preview-file-extension[_ngcontent-%COMP%]{text-align:center;position:absolute;text-transform:uppercase;color:#fff;bottom:30px;font-weight:500}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%]{position:fixed;top:calc(var(--margin-top) + var(--header-height) + var(--content-height));width:var(--modal-width);border-radius:var(--border-radius);background:white;--heigth: calc( var(--modal-height) - var(--header-height) - var(--content-height));--paddingTopBottom: 8px;display:flex;grid-gap:5px;gap:5px;padding:var(--paddingTopBottom) 10px;box-sizing:border-box}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;resize:horizontal;overflow-y:auto;box-sizing:border-box;color:#1a1a1a;min-width:100%;outline:0;resize:none;font-size:1.4em;line-height:1.4em;font-weight:300;max-height:110px;min-height:auto;height:20px;padding:0 12px;margin:10px 0;border:none}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{position:absolute;display:block;bottom:22px;height:var(--heigth);opacity:.3;cursor:auto;cursor:initial}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button.active[_ngcontent-%COMP%]{opacity:1;cursor:pointer}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-button-send[_ngcontent-%COMP%]{right:8px;bottom:var(--paddingTopBottom)}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .visible-text-area[_ngcontent-%COMP%]{pointer-events:auto;border-radius:10px;background-color:#f6f7fb;-webkit-box-flex:1;width:88%}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{pointer-events:auto}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{fill:#5f6368;pointer-events:auto}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:visited, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:hover, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:active{all:unset}"]}),i}(),Ra=["afConversationComponent"];function La(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-internal-frame",9),e.NdJ("onOpenExternal",function(a){return e.CHM(n),e.oxw().onOpenExternalFrame(a)})("onClose",function(a){return e.CHM(n),e.oxw().onCloseInternalFrame(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("button",t.buttonClicked)("openExternalLinkButton",null==t.g?null:t.g.openExternalLinkButton)("translationMap",t.translationMapHeader)("stylesMap",t.stylesMap)}}function Na(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-conversation-attachment-preview",10),e.NdJ("onSendAttachment",function(a){return e.CHM(n),e.oxw().onSendAttachment(a)})("onCloseModalPreview",function(){return e.CHM(n),e.oxw().onCloseModalPreview()}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("textInputTextArea",t.textInputTextArea)("attachments",t.attachments)("baseLocation",null==t.g?null:t.g.baseLocation)("translationMap",t.translationMapPreview)("stylesMap",t.stylesMap)}}function Fa(i,o){if(1&i&&(e.O4$(),e.kcU(),e.TgZ(0,"div",16),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.messagesBadgeCount)}}function Ba(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw().scrollToBottom()}),e.O4$(),e.TgZ(1,"svg",12),e._UZ(2,"path",13),e._UZ(3,"path",14),e.qZA(),e.YNc(4,Fa,2,1,"div",15),e.qZA()}if(2&i){var t=e.oxw();e.xp6(4),e.Q6J("ngIf",0!=t.messagesBadgeCount)}}var Ua=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de){this.g=o,this.starRatingWidgetService=n,this.sanitizer=t,this.appComponent=r,this.appStorageService=a,this.conversationHandlerBuilderService=u,this.appConfigService=y,this.customTranslateService=j,this.chatManager=J,this.typingService=ie,this.tiledeskRequestService=ue,this.changeDetectorRef=ge,this.elementRef=de,this.onBackHome=new e.vpe,this.onCloseWidget=new e.vpe,this.onSoundChange=new e.vpe,this.onConversationClosed=new e.vpe,this.onSignOut=new e.vpe,this.onBeforeMessageSent=new e.vpe,this.onAfterSendMessage=new e.vpe,this.onNewConversationInit=new e.vpe,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onNewMessageCreated=new e.vpe,this.onNewConversationButtonClicked=new e.vpe,this.isMenuShow=!1,this.isEmojiiPickerShow=!1,this.isButtonsDisabled=!0,this.hideFooterTextReply=!1,this.hideTextAreaContent=!1,this.footerMessagePlaceholder="",this.isTrascriptDownloadEnabled=!1,this.showContinueConversationButton=!1,this.isScrolling=!1,this.idDivScroll="c21-contentScroll",this.showBadgeScroollToBottom=!1,this.messagesBadgeCount=0,this.isFileSelected=!1,this.isOpenAttachmentPreview=!1,this.isPopupUrl=gn,this.popupUrl=Ht,this.messages=[],this.CLIENT_BROWSER=navigator.userAgent,this.subscriptions=[],this.unsubscribe$=new la.xQ,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.tooltipOptions={"show-delay":1500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.isTypings=!1,this.isDirect=!1,this.membersConversation=["SYSTEM"],this.isButtonUrl=!1,this.logger=Ce.getInstance()}return i.prototype.onResize=function(o){this.logger.debug("[CONV-COMP] resize event",o)},i.prototype.ngOnInit=function(){this.logger.debug("[CONV-COMP] ngOnInit: ",this.senderId),this.showMessageWelcome=!1,this.translations()},i.prototype.translations=function(){this.translationMapHeader=this.customTranslateService.translateLanguage(["LABEL_LAST_ACCESS","LABEL_WRITING","BUTTON_CLOSE_TO_ICON","OPTIONS","PREV_CONVERSATIONS","SOUND_OFF","SOUND_ON","DOWNLOAD_TRANSCRIPT","BACK","CLOSE","MAXIMIZE","MINIMIZE","CLOSE_CHAT","RESTART","LOGOUT"]),this.translationMapFooter=this.customTranslateService.translateLanguage(["LABEL_PLACEHOLDER","GUEST_LABEL","LABEL_START_NW_CONV","CONTINUE"]),this.translationMapContent=this.customTranslateService.translateLanguage(["INFO_SUPPORT_USER_ADDED_SUBJECT","INFO_SUPPORT_USER_ADDED_YOU_VERB","INFO_SUPPORT_USER_ADDED_COMPLEMENT","INFO_SUPPORT_USER_ADDED_VERB","INFO_SUPPORT_CHAT_REOPENED","INFO_SUPPORT_CHAT_CLOSED","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU","INFO_SUPPORT_LEAD_UPDATED","INFO_SUPPORT_MEMBER_LEFT_GROUP","LABEL_TODAY","LABEL_TOMORROW","LABEL_LOADING","LABEL_TO","ARRAY_DAYS"]),this.translationMapPreview=this.customTranslateService.translateLanguage(["BACK","CLOSE","LABEL_PLACEHOLDER","LABEL_PREVIEW"])},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.debug("[CONV-COMP] --------ngAfterViewInit: conversation-------- "),setTimeout(function(){o.initAll(),!0===o.g.newConversationStart&&(o.onNewConversationComponentInit(),o.g.newConversationStart=!1),o.setSubscriptions(),o.afConversationComponent&&o.afConversationComponent.nativeElement.focus(),o.isButtonsDisabled=!1},300)},i.prototype.ngAfterViewChecked=function(){this.changeDetectorRef.detectChanges()},i.prototype.ngOnChanges=function(o){this.logger.debug("[CONV-COMP] onChagnges",o),this.stylesMap&&(this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))),o&&o.conversationId&&void 0!==o.conversationId.previousValue&&o.conversationId.previousValue!==o.conversationId.currentValue&&(this.logger.debug("[CONV-COMP] UID CHANGESSSS",o.conversationId),this.ngOnDestroy(),this.ngOnInit(),this.ngAfterViewInit())},i.prototype.updateConversationBadge=function(){if(this.logger.debug("[CONV-COMP] updateConversationBadge",this.conversationId,this.isConversationArchived),this.isConversationArchived&&this.conversationId&&this.archivedConversationsHandlerService&&this.archivedConversationsHandlerService.setConversationRead(this.conversationId),!this.isConversationArchived&&this.conversationId&&this.conversationsHandlerService){this.conversationsHandlerService.setConversationRead(this.conversationId);var o=this.conversationsHandlerService.countIsNew();this.g.setParameter("conversationsBadge",o)}},i.prototype.initAll=function(){var o=this;this.logger.debug("[CONV-COMP] ------ 2: setConversation ------ "),this.setConversation(),this.logger.debug("[CONV-COMP] ------ 3: connectConversation ------ "),this.initConversationHandler(),this.logger.debug("[CONV-COMP] ------ 4: initializeChatManager ------ "),this.logger.debug("[CONV-COMP] ------ 6: getConversationDetail ------ ",this.conversationId),this.getConversationDetail(function(n){o.logger.debug("[CONV-COMP] ------ 6: updateConversationbage ------ "),o.updateConversationBadge()}),this.g.customAttributes&&this.updateUserInfo(this.g.customAttributes),this.logger.debug("[CONV-COMP] ------ 7: initializeTyping()",this.conversationId),this.initializeTyping()},i.prototype.getConversationDetail=function(o){var n=this;this.logger.debug("[CONV-COMP] getConversationDetail: isConversationArchived???",this.isConversationArchived,this.conversationWith),this.conversationsHandlerService.getConversationDetail(this.conversationWith,function(t){n.logger.debug("[CONV-COMP] getConversationDetail: conversationsHandlerService ",n.conversationWith,t,n.isConversationArchived),t&&(n.conversation=t,n.isConversationArchived=!1,o(n.isConversationArchived)),t||(n.logger.debug("[CONV-COMP] getConversationDetail: conv not exist --\x3e search in archived list",n.isConversationArchived,n.conversationWith),n.archivedConversationsHandlerService.getConversationDetail(n.conversationWith,function(r){if(n.logger.debug("[CONV-COMP] getConversationDetail: archivedConversationsHandlerService",n.conversationWith,r,n.isConversationArchived),r){n.conversation=r,n.isConversationArchived=!0;var a=function(i,o){var n=xe(i),t=xe(o),r=xe.duration(t.diff(n));return{days:r.asDays(),hours:r.asHours(),minutes:r.asMinutes()}}(n.conversation.timestamp,Date.now());n.showContinueConversationButton=a.hours<n.g.continueConversationBeforeTime,o(n.isConversationArchived)}else r||o(null)}))})},i.prototype.setConversation=function(){var o=this.g.recipientId,n=this.g.channelType;this.logger.debug("[CONV-COMP] setConversation recipientId::: ",o,n),o||this.g.setParameter("recipientId",this.setRecipientId()),n||this.g.setParameter("channelType",this.setChannelType()),this.conversationWith=o,this.logger.debug("[CONV-COMP] setConversation conversation::: ",this.conversation),this.conversation||(this.conversation=new sa(o,this.g.attributes,n,this.g.recipientFullname,this.conversationWith,o,this.g.recipientFullname,"",!0,"","",this.senderId,"",this.g.userFullname,"0","",!0,"","",!1,"text"))},i.prototype.setRecipientId=function(){var o;return(o=this.appStorageService.getItem(this.senderId))||(o=dn+this.g.projectid+"-"+(0,Ne.Z)().replace(/-/g,""),this.logger.debug("[CONV-COMP] recipitent",o)),o},i.prototype.setChannelType=function(){var o="group",n=this.g.projectid;return this.g.recipientId&&-1!==this.g.recipientId.indexOf("group")?o="group":n||(o="direct"),o},i.prototype.initConversationHandler=function(){var o=this.g.tenant;this.messages=[];var n={uid:this.senderId},t=this.g.recipientFullname;this.logger.debug("[CONV-COMP] initconversation NEWWW",n,t,o),this.showMessageWelcome=!1;var r=this.chatManager.getConversationHandlerByConversationId(this.conversationWith);if(this.logger.debug("[CONV-COMP] DETTAGLIO CONV - handler **************",r,this.conversationWith),r)this.logger.debug("[CONV-COMP] NON ENTRO ***",this.conversationHandlerService,r),this.conversationHandlerService=r,this.messages=this.conversationHandlerService.messages;else{this.conversationHandlerService=this.conversationHandlerBuilderService.build(),this.conversationHandlerService.initialize(this.conversationWith,t,n,o,this.translationMapContent,this.g.showInfoMessage),this.conversationHandlerService.connect(),this.logger.debug("[CONV-COMP] DETTAGLIO CONV - NEW handler **************",this.conversationHandlerService),this.messages=this.conversationHandlerService.messages,this.sendFirstMessagePreChatForm(),this.logger.debug("[CONV-COMP] DETTAGLIO CONV - messages **************",this.messages),this.chatManager.addConversationHandler(this.conversationHandlerService);var a=this;setTimeout(function(){(!a.messages||0===a.messages.length)&&(a.showMessageWelcome=!0,a.logger.debug("[CONV-COMP] setTimeout ***",a.showMessageWelcome))},8e3)}this.logger.debug("[CONV-COMP] CONVERSATION MESSAGES "+this.messages),this.conversationsHandlerService=this.chatManager.conversationsHandlerService,this.archivedConversationsHandlerService=this.chatManager.archivedConversationsService},i.prototype.sendFirstMessagePreChatForm=function(){var o=this;setTimeout(function(){o.messages&&0===o.messages.length&&(o.logger.debug("[CONV-COMP] sendFirstMessage: messages + attributes ",o.messages,o.g.attributes),o.g.attributes&&o.g.attributes.preChatForm&&o.g.attributes.preChatForm.firstMessage)&&o.conversationFooter.sendMessage(o.g.attributes.preChatForm.firstMessage,Nt,o.g.attributes)},1e3)},i.prototype.initializeTyping=function(){this.logger.debug("[CONV-COMP] membersconversation",this.membersConversation),this.membersConversation.push(this.senderId),this.typingService.isTyping(this.conversationId,this.senderId,this.isDirect)},i.prototype.subscribeTypings=function(o){var n=this;try{var t=o.uidUserTypingNow,r=o.waitTime;this.nameUserTypingNow=null,this.idUserTypingNow=null,o.nameUserTypingNow&&(this.nameUserTypingNow=o.nameUserTypingNow),o.uidUserTypingNow&&(this.idUserTypingNow=o.uidUserTypingNow),this.logger.debug("[CONV-COMP] subscribeTypings data:",o),!this.membersConversation.includes(t)&&t&&(this.isTypings=!0,setTimeout(function(){n.conversationContent.scrollToBottom()},0),this.setTimeoutWritingMessages=setTimeout(function(){n.isTypings=!1},r))}catch(u){this.logger.error("[CONV-COMP] error: ",u)}},i.prototype.initiTimeout=function(o){var n=this;this.setTimeoutWritingMessages=setTimeout(function(){n.isTypings=!1},o)},i.prototype.resetTimeout=function(){this.isTypings=!1,this.setTimeoutWritingMessages=null,clearTimeout(this.setTimeoutWritingMessages)},i.prototype.setSubscriptions=function(){var t,r,o=this,n=this;r="starRating",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.starRatingWidgetService.setOsservable(!1),this.logger.debug("[CONV-COMP] setSubscriptions!!!! StartRating",this.starRatingWidgetService.obsCloseConversation.value),t=this.starRatingWidgetService.obsCloseConversation.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(u){o.logger.debug("[CONV-COMP] startratingggg",u),n.g.setParameter("isOpenStartRating",u),!1===u?o.logger.debug("[CONV-COMP] NOT OPEN StartRating **"):!0===u&&o.logger.debug("[CONV-COMP] OPEN StartRating **")}),this.subscriptions.push({key:r,value:t})),r="messageAdded",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageAdded *****",this.conversationHandlerService),t=this.conversationHandlerService.messageAdded.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageAdded *****",y),y&&(n.newMessageAdded(y),o.onNewMessageCreated.emit(y),o.checkMessagesLegntForTranscriptDownloadMenuOption(),o.resetTimeout())}),this.subscriptions.push({key:r,value:t})),r="conversationsRemoved",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.chatManager.conversationsHandlerService.conversationRemoved.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DATAIL conversationsRemoved *****",y,o.conversationWith,o.isConversationArchived),y&&y.uid===o.conversationWith&&(o.isConversationArchived=!0,o.g.nativeRating&&o.starRatingWidgetService.setOsservable(!0),o.g.nativeRating||o.onConversationClosed.emit(y.uid))}),this.subscriptions.push({key:r,value:t})),r="conversationsChanged",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.chatManager.conversationsHandlerService.conversationChanged.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DATAIL conversationsChanged *****",y,o.conversationWith,o.isConversationArchived),y&&y.recipient===o.g.senderId&&On(y)||!y||y.sender===o.senderId||n.conversationContent.checkContentScrollPosition()&&y.is_new&&(o.logger.debug("[CONV-COMP] updateConversationBadge..."),n.updateConversationBadge())}),this.subscriptions.push({key:r,value:t})),r="messageWait",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageWait *****",this.conversationHandlerService),t=this.conversationHandlerService.messageWait.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageWait *****",y),y&&y.waitTime&&0!==y.waitTime&&o.conversationId===y.uid&&n.subscribeTypings(y)}),this.subscriptions.push({key:r,value:t})),r="messageInfo",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageInfo *****",this.conversationHandlerService),t=this.conversationHandlerService.messageInfo.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageInfo *****",y),y&&o.updateLeadInfo(y)}),this.subscriptions.push({key:r,value:t})),r="conversationTyping",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.typingService.BSIsTyping.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** BSIsTyping *****",y),y&&o.conversationId===y.uid&&n.subscribeTypings(y)}),this.subscriptions.push({key:r,value:t}))},i.prototype.checkMessagesLegntForTranscriptDownloadMenuOption=function(){this.messages.length>1&&this.g.allowTranscriptDownload&&(this.isTrascriptDownloadEnabled=!0)},i.prototype.newMessageAdded=function(o){var n=this,t=n.senderId;o.sender===t?(n.logger.debug("[CONV-COMP] *A1-------"),setTimeout(function(){n.conversationContent.scrollToBottom()},200)):o.sender!==t&&(n.conversationContent.checkContentScrollPosition()?(n.logger.debug("[CONV-COMP] *A2-------"),setTimeout(function(){n.conversationContent.scrollToBottom()},200)):(n.logger.debug("[CONV-COMP] *A3-------"),n.messagesBadgeCount++),o.attributes&&o.attributes.disableInputMessage?this.hideFooterTextReply=o.attributes.disableInputMessage:o.attributes&&!o.attributes.disableInputMessage&&(this.hideFooterTextReply=!1),this.footerMessagePlaceholder=o.attributes&&o.attributes.inputMessagePlaceholder?o.attributes.inputMessagePlaceholder:"")},i.prototype.updateLeadInfo=function(o){if(o.attributes&&o.attributes.updateUserFullname){var n=o.attributes.updateUserFullname;this.logger.debug("[CONV-COMP] newMessageAdded --\x3e updateUserFullname",n),this.g.setAttributeParameter("userFullname",n),this.g.setParameter("userFullname",n),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))}if(o.attributes&&o.attributes.updateUserEmail){var t=o.attributes.updateUserEmail;this.logger.debug("[CONV-COMP] newMessageAdded --\x3e userEmail",t),this.g.setAttributeParameter("userEmail",t),this.g.setParameter("userEmail",t),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))}},i.prototype.updateUserInfo=function(o){if(o&&o.userFullname){var n=o.userFullname;this.logger.debug("[CONV-COMP] updateUserInfo --\x3e userFullname",n),this.g.setAttributeParameter("userFullname",n),this.g.setParameter("userFullname",n)}if(o&&o.userEmail){var t=o.userEmail;this.logger.debug("[CONV-COMP] updateUserInfo --\x3e userEmail",t),this.g.setAttributeParameter("userEmail",t),this.g.setParameter("userEmail",t)}this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))},i.prototype.scrollToBottom=function(){this.conversationContent.scrollToBottom()},i.prototype.onBackHomeFN=function(){this.onBackHome.emit()},i.prototype.onCloseWidgetFN=function(){this.onCloseWidget.emit()},i.prototype.onSoundChangeFN=function(o){this.onSoundChange.emit(o)},i.prototype.onCloseChat=function(o){var n=this;this.logger.debug("[CONV-COMP] close chat with uid ",this.conversation.uid),this.tiledeskRequestService.closeSupportGroup(this.conversation.uid).then(function(t){"closed"===t&&(n.isMenuShow=!1,n.logger.debug("[CONV-COMP] chat closed successfully with uid ",n.conversation.uid))}).catch(function(t){n.logger.error("[CONV-COMP] ERROR while closing chat with id: ",n.conversation.uid,t)})},i.prototype.onRestartChat=function(o){this.hideTextAreaContent=!0},i.prototype.onWidgetHeightChange=function(o){var n=this.g.windowContext.window.document.getElementById("tiledeskdiv");"max"===o?n.style.maxHeight="unset":"min"===o&&(n.style.maxHeight="620px"),this.isMenuShow=!1},i.prototype.onSignOutFN=function(o){this.onSignOut.emit(!0)},i.prototype.onMenuOption=function(o){this.isMenuShow=o,this.conversationFooter.removeFocusOnId("chat21-main-message-context")},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit(o)},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit(o)},i.prototype.onAttachmentButtonClicked=function(o){if(this.logger.debug("[CONV-COMP] eventbutton",o),o&&o.target.type)switch(o.target.type){case"url":try{this.openLink(o.target.button)}catch(r){this.logger.error("[CONV-COMP] url > Error :"+r)}return;case"action":try{this.actionButton(o.target.button)}catch(r){this.logger.error("[CONV-COMP] action > Error :"+r)}return!1;case"text":try{this.conversationFooter.sendMessage(o.target.button.value,Nt,{button:!0})}catch(r){this.logger.error("[CONV-COMP] text > Error :"+r)}default:return}},i.prototype.onScrollContent=function(o){this.showBadgeScroollToBottom=!o,this.logger.debug("[CONV-COMP] scroool eventtt",o),this.showBadgeScroollToBottom||(this.messagesBadgeCount=0,this.updateConversationBadge())},i.prototype.onOpenExternalFrame=function(o){window.open(o.link,"_blank")},i.prototype.onCloseInternalFrame=function(o){this.isButtonUrl=!1,this.buttonClicked=null,this.restoreDefaultWidgetSize()},i.prototype.onSendAttachment=function(o){this.isOpenAttachmentPreview=!1,this.conversationFooter.uploadSingle(this.attachments[0].metadata,this.attachments[0].file,o)},i.prototype.onCloseModalPreview=function(){this.isOpenAttachmentPreview=!1,this.conversationFooter.isFilePendingToUpload=!1,this.logger.debug("[CONV-COMP] onCloseModalPreview::::",this.isOpenAttachmentPreview,this.conversationFooter)},i.prototype.onEmojiiPickerShow=function(o){this.isEmojiiPickerShow=o},i.prototype.onBeforeMessangeSentFN=function(o){this.onBeforeMessageSent.emit(o)},i.prototype.onAfterSendMessageFN=function(o){this.onAfterSendMessage.emit(o)},i.prototype.onChangeTextArea=function(o){if(o&&o.textAreaEl){var n=this.conversationContent.scrollMe,t=+o.textAreaEl.style.height.substring(0,o.textAreaEl.style.height.length-2);t>20&&t<110?(n.nativeElement.style.height="calc(100% - "+(t-20)+"px",this.scrollToBottom()):t<=20&&(n.nativeElement.style.height="100%")}},i.prototype.onAttachmentFileButtonClicked=function(o){this.logger.debug("[CONV-COMP] onAttachmentButtonClicked::::",o),this.attachments=o.attachments,this.textInputTextArea=o.message,this.logger.debug("[CONV-COMP] onAttachmentButtonClicked::::",this.textInputTextArea),this.isOpenAttachmentPreview=!0},i.prototype.onNewConversationButtonClickedFN=function(o){this.logger.debug("[CONV-COMP] floating onNewConversationButtonClicked"),this.onNewConversationButtonClicked.emit()},i.prototype.onBackButton=function(o){this.hideTextAreaContent=o;try{document.getElementById("chat21-footer").classList.remove("maximize-width")}catch(t){this.logger.error("[CONV-COMP] onBackButton > Error :"+t)}},i.prototype.openInputFiles=function(){alert("ok"),document.getElementById("chat21-file")&&(document.getElementById("chat21-file").style.display="block")},i.prototype.ngOnDestroy=function(){this.logger.debug("[CONV-COMP] ngOnDestroy ------------------\x3e this.subscriptions",this.subscriptions),this.isConversationArchived=!1,this.hideTextAreaContent=!1,this.conversationFooter.textInputTextArea="",this.hideFooterTextReply=!1,this.footerMessagePlaceholder="",this.unsubscribe()},i.prototype.unsubscribe=function(){this.logger.debug("[CONV-COMP] ******* unsubscribe *******"),this.unsubscribe$.next(),this.unsubscribe$.complete(),this.chatManager.conversationsHandlerService.conversationRemoved.next(null),this.conversationHandlerService.messageWait.next(null),this.typingService.BSIsTyping.next(null),this.subscriptions.forEach(function(o){o.value.unsubscribe()}),this.subscriptions=[],this.subscriptions.length=0,this.logger.debug("[CONV-COMP]this.subscriptions",this.subscriptions)},i.prototype.onIncreaseWith=function(){try{this.g.windowContext.window.document.getElementById("tiledeskdiv").classList.add("increaseSize"),document.getElementById("chat21-conversations").style.borderRadius="16px"}catch(t){this.logger.error("[CONV-COMP] onIncreaseWith > Error :"+t)}},i.prototype.restoreDefaultWidgetSize=function(){try{var o=this.g.windowContext.window.document.getElementById("tiledeskdiv");o.classList.remove("increaseSize"),o.classList.remove("decreaseSize")}catch(n){this.logger.error("[CONV-COMP] restoreDefaultWidgetSize > Error :"+n)}},i.prototype.openLink=function(o){var n=o.link?o.link:"",t=o.target?o.target:"";"self"===t?(this.isButtonUrl=!0,this.buttonClicked=o):"parent"===t?window.open(n,"_parent"):window.open(n,"_blank")},i.prototype.actionButton=function(o){this.conversationFooter.sendMessage(o.value?o.value:"",Nt,null,{action:o.action?o.action:"",subtype:o.show_echo?"":"info"}),this.logger.debug("[CONV-COMP] > action :")},i.prototype.onNewConversationComponentInit=function(){this.logger.debug("[CONV-COMP] ------- onNewConversationComponentInit ------- "),this.setConversation();var o=this.conversationWith,n=this.g.default_settings,t=this.appConfigService.getConfig();this.onNewConversationInit.emit({global:this.g,default_settings:n,newConvId:o,appConfigs:t})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(en),e.Y36(Le.H7),e.Y36(Qt),e.Y36(He),e.Y36(Ct),e.Y36(Fe),e.Y36(ut),e.Y36(Tt),e.Y36(ht),e.Y36(Jt),e.Y36(e.sBO),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation"]],viewQuery:function(n,t){if(1&n&&(e.Gf(Ra,5),e.Gf(Hn,5),e.Gf(Gn,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.afConversationComponent=r.first),e.iGM(r=e.CRH())&&(t.conversationFooter=r.first),e.iGM(r=e.CRH())&&(t.conversationContent=r.first)}},hostBindings:function(n,t){1&n&&e.NdJ("resize",function(a){return t.onResize(a)},!1,e.Jf7)},inputs:{conversationId:"conversationId",stylesMap:"stylesMap",isOpen:"isOpen",senderId:"senderId",isConversationArchived:"isConversationArchived"},outputs:{onBackHome:"onBackHome",onCloseWidget:"onCloseWidget",onSoundChange:"onSoundChange",onConversationClosed:"onConversationClosed",onSignOut:"onSignOut",onBeforeMessageSent:"onBeforeMessageSent",onAfterSendMessage:"onAfterSendMessage",onNewConversationInit:"onNewConversationInit",onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onNewMessageCreated:"onNewMessageCreated",onNewConversationButtonClicked:"onNewConversationButtonClicked"},features:[e.TTD],decls:9,vars:53,consts:[["id","chat21-conversation-component","tabindex","1500","aria-modal","true"],["afConversationComponent",""],[3,"idConversation","senderId","soundEnabled","isTrascriptDownloadEnabled","hideHeaderCloseButton","hideHeaderBackButton","hideCloseConversationOptionMenu","hideRestartConversationOptionsMenu","hideHeaderConversationOptionsMenu","hideSignOutOptionMenu","stylesMap","translationMap","widgetTitle","windowContext","isMenuShow","isTypings","nameUserTypingNow","typingLocation","onBack","onCloseWidget","onSoundChange","onCloseChat","onRestartChat","onWidgetHeightChange","onSignOut","onMenuOptionShow"],[3,"messages","senderId","baseLocation","isConversationArchived","isTypings","idUserTypingNow","nameUserTypingNow","typingLocation","fullscreenMode","translationMap","stylesMap","onBeforeMessageRender","onAfterMessageRender","onAttachmentButtonClicked","onScrollContent","onMenuOptionShow","onEmojiiPickerShow"],[3,"button","openExternalLinkButton","translationMap","stylesMap","onOpenExternal","onClose",4,"ngIf"],[3,"textInputTextArea","attachments","baseLocation","translationMap","stylesMap","onSendAttachment","onCloseModalPreview",4,"ngIf"],["id","chat21-footer"],["id","chat21-buttonToBottom",3,"click",4,"ngIf"],[3,"conversationWith","attributes","senderId","tenant","projectid","channelType","userFullname","userEmail","showContinueConversationButton","showAttachmentButton","hideTextAreaContent","isConversationArchived","hideTextReply","isMobile","isEmojiiPickerShow","footerMessagePlaceholder","fileUploadAccept","stylesMap","translationMap","onEmojiiPickerShow","onBeforeMessageSent","onAfterSendMessage","onChangeTextArea","onAttachmentFileButtonClicked","onNewConversationButtonClicked","onBackButton"],[3,"button","openExternalLinkButton","translationMap","stylesMap","onOpenExternal","onClose"],[3,"textInputTextArea","attachments","baseLocation","translationMap","stylesMap","onSendAttachment","onCloseModalPreview"],["id","chat21-buttonToBottom",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24"],["opacity",".87","fill","none","d","M24 24H0V0h24v24z"],["d","M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"],["id","chat21-divBudge","class","c21-divBudge",4,"ngIf"],["id","chat21-divBudge",1,"c21-divBudge"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"chat-conversation-header",2),e.NdJ("onBack",function(){return t.onBackHomeFN()})("onCloseWidget",function(){return t.onCloseWidgetFN()})("onSoundChange",function(a){return t.onSoundChangeFN(a)})("onCloseChat",function(a){return t.onCloseChat(a)})("onRestartChat",function(a){return t.onRestartChat(a)})("onWidgetHeightChange",function(a){return t.onWidgetHeightChange(a)})("onSignOut",function(a){return t.onSignOutFN(a)})("onMenuOptionShow",function(a){return t.onMenuOption(a)}),e.qZA(),e.TgZ(3,"chat-conversation-content",3),e.NdJ("onBeforeMessageRender",function(a){return t.onBeforeMessageRenderFN(a)})("onAfterMessageRender",function(a){return t.onAfterMessageRenderFN(a)})("onAttachmentButtonClicked",function(a){return t.onAttachmentButtonClicked(a)})("onScrollContent",function(a){return t.onScrollContent(a)})("onMenuOptionShow",function(a){return t.onMenuOption(a)})("onEmojiiPickerShow",function(a){return t.onEmojiiPickerShow(a)}),e.qZA(),e.YNc(4,La,1,4,"chat-internal-frame",4),e.YNc(5,Na,1,5,"chat-conversation-attachment-preview",5),e.TgZ(6,"div",6),e.YNc(7,Ba,5,1,"div",7),e.TgZ(8,"chat-conversation-footer",8),e.NdJ("onEmojiiPickerShow",function(a){return t.onEmojiiPickerShow(a)})("onBeforeMessageSent",function(a){return t.onBeforeMessangeSentFN(a)})("onAfterSendMessage",function(a){return t.onAfterSendMessageFN(a)})("onChangeTextArea",function(a){return t.onChangeTextArea(a)})("onAttachmentFileButtonClicked",function(a){return t.onAttachmentFileButtonClicked(a)})("onNewConversationButtonClicked",function(a){return t.onNewConversationButtonClickedFN(a)})("onBackButton",function(a){return t.onBackButton(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("idConversation",t.conversationWith)("senderId",t.senderId)("soundEnabled",null==t.g?null:t.g.soundEnabled)("isTrascriptDownloadEnabled",t.isTrascriptDownloadEnabled)("hideHeaderCloseButton",null==t.g?null:t.g.hideHeaderCloseButton)("hideHeaderBackButton",null==t.g?null:t.g.singleConversation)("hideCloseConversationOptionMenu",t.isConversationArchived||(null==t.g?null:t.g.hideCloseConversationOptionMenu))("hideRestartConversationOptionsMenu",!(null!=t.g&&t.g.singleConversation)&&!t.hideTextAreaContent||(null==t.g?null:t.g.hideRestartConversationOptionsMenu))("hideHeaderConversationOptionsMenu",null==t.g?null:t.g.hideHeaderConversationOptionsMenu)("hideSignOutOptionMenu",!(null!=t.g&&t.g.singleConversation&&null!=t.g&&t.g.showLogoutOption))("stylesMap",t.stylesMap)("translationMap",t.translationMapHeader)("widgetTitle",null==t.g||null==t.g.project?null:t.g.project.widgetTitle)("windowContext",null==t.g?null:t.g.windowContext)("isMenuShow",t.isMenuShow)("isTypings",t.isTypings)("nameUserTypingNow",t.nameUserTypingNow)("typingLocation",null==t.g?null:t.g.typingLocation),e.xp6(1),e.Q6J("messages",t.messages)("senderId",t.senderId)("baseLocation",null==t.g||null==t.g.windowContext.tiledesk?null:t.g.windowContext.tiledesk.getBaseLocation())("isConversationArchived",t.isConversationArchived)("isTypings",t.isTypings)("idUserTypingNow",t.idUserTypingNow)("nameUserTypingNow",t.nameUserTypingNow)("typingLocation",null==t.g?null:t.g.typingLocation)("fullscreenMode",null==t.g?null:t.g.fullscreenMode)("translationMap",t.translationMapContent)("stylesMap",t.stylesMap),e.xp6(1),e.Q6J("ngIf",t.isButtonUrl),e.xp6(1),e.Q6J("ngIf",t.isOpenAttachmentPreview),e.xp6(1),e.ekj("maximize-width",(null==t.g?null:t.g.singleConversation)&&t.hideTextAreaContent||t.isConversationArchived&&!(null!=t.g&&t.g.allowReopen)),e.xp6(1),e.Q6J("ngIf",t.showBadgeScroollToBottom),e.xp6(1),e.Q6J("conversationWith",t.conversationWith)("attributes",null==t.g?null:t.g.attributes)("senderId",t.senderId)("tenant",null==t.g?null:t.g.tenant)("projectid",null==t.g?null:t.g.projectid)("channelType",null==t.g?null:t.g.channelType)("userFullname",null==t.g?null:t.g.userFullname)("userEmail",null==t.g?null:t.g.userEmail)("showContinueConversationButton",(null==t.g?null:t.g.singleConversation)&&t.showContinueConversationButton)("showAttachmentButton",null==t.g?null:t.g.showAttachmentButton)("hideTextAreaContent",(null==t.g?null:t.g.singleConversation)&&t.hideTextAreaContent||t.isConversationArchived&&!(null!=t.g&&t.g.allowReopen))("isConversationArchived",t.isConversationArchived)("hideTextReply",t.hideFooterTextReply)("isMobile",null==t.g?null:t.g.isMobile)("isEmojiiPickerShow",t.isEmojiiPickerShow)("footerMessagePlaceholder",t.footerMessagePlaceholder)("fileUploadAccept",null==t.appConfigService?null:t.appConfigService.getConfig().fileUploadAccept)("stylesMap",t.stylesMap)("translationMap",t.translationMapFooter))},directives:[ya,Gn,me.O5,Hn,Ta,Ia],styles:["[_nghost-%COMP%]{--themeColor: $bck-msg-sent;--foregroundColor: $col-msg-sent}#scroll-me[_ngcontent-%COMP%]{scroll-behavior:smooth}#scroll-me.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}#chat21-conversation-component[_ngcontent-%COMP%]{position:absolute;background-color:#fff;width:100%;height:100%;top:0px;left:0px;right:0px;bottom:0px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#chat21-conversation-component[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{position:fixed;left:0px;right:0px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}#chat21-conversation-component[_ngcontent-%COMP%] .rowMsg[_ngcontent-%COMP%]{position:relative;height:auto;display:block}#chat21-conversation-component[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:fixed}#chat21-footer[_ngcontent-%COMP%]{position:fixed;bottom:0px;left:0px;right:0px;margin:0;padding:8px 45px 8px 70px;background:white;min-height:40px}#chat21-footer.maximize-width[_ngcontent-%COMP%]{padding:8px 0}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]{display:flex;position:relative;margin-right:-25px;margin-top:-40px;float:right;width:30px;height:30px;border-radius:50%;z-index:1;cursor:pointer;background-color:#fff;border:1px solid rgba(191,191,191,.2);text-align:center}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin:auto;fill:#aaa}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]:hover{background-color:var(--themeColor);opacity:1!important;transition:all .45s ease-in-out!important;-moz-transition:all .45s ease-in-out!important;-webkit-transition:all .45s ease-in-out!important;border:1px solid var(--foregroundColor)}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{fill:var(--foregroundColor)}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;border:1px solid #d7d7d7;background-color:#fff;padding:10px 0}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;cursor:pointer}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}@media (max-width: 451px){#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-button.c21-close[_ngcontent-%COMP%]{display:flex}}"]}),i}(),Za=ye(42265),Da=["div_input"];function Ha(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",null==n.translationErrorLabelMap?null:n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}function za(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",null==n.element?null:n.element.errorLabel," ")}}var ja=function(i){return{"is-empty":i}},qa=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.onKeyEnterPressed=new e.vpe,this.inputType="text"}return i.prototype.ngOnInit=function(){var o=this;this.form=this.rootFormGroup.control,this.form&&this.form.controls&&this.form.controls[this.controlName]&&this.form.controls[this.controlName].valueChanges.subscribe(function(n){o.hasSubmitted=!1,o.setFormStyle()})},i.prototype.ngOnChanges=function(o){this.controlName&&(this.controlName.toLowerCase().includes("email")||this.controlName.toLowerCase().includes("e-mail"))&&(this.inputType="email"),this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onFocusOut=function(){this.input.nativeElement.classList.remove("is-focused")},i.prototype.onFocus=function(){this.input.nativeElement.classList.add("is-focused")},i.prototype.onEnterPressed=function(o){this.onKeyEnterPressed.emit(o)},i.prototype.setFormStyle=function(){this.form.controls[this.controlName].hasError("pattern")||this.form.controls[this.controlName].hasError("required")||this.form.controls[this.controlName].invalid?(this.input.nativeElement.classList.add("form-danger"),this.input.nativeElement.classList.remove("form-success")):this.form.controls[this.controlName].valid&&(this.input.nativeElement.classList.remove("form-danger"),this.input.nativeElement.classList.add("form-success"))},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-text"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Da,5),2&n)&&(e.iGM(r=e.CRH())&&(t.input=r.first))},inputs:{element:"element",controlName:"controlName",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:8,vars:12,consts:[[3,"formGroup"],["id","div_input",1,"form-group","label-floating",3,"ngClass"],["div_input",""],[1,"control-label"],[1,"form-control",3,"formControlName","type","tabIndex","keydown.enter","focus","focusout"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1,2),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.TgZ(5,"input",4),e.NdJ("keydown.enter",function(a){return t.onEnterPressed(a)})("focus",function(){return t.onFocus()})("focusout",function(){return t.onFocusOut()}),e.qZA(),e.qZA(),e.YNc(6,Ha,2,1,"div",5),e.YNc(7,za,2,1,"div",5),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(1),e.Q6J("ngClass",e.VKq(10,ja,!(null!=t.form&&t.form.controls[t.element.name].value))),e.xp6(3),e.hij(" ",null==t.element?null:t.element.text," "),e.xp6(1),e.ekj("errors",(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&t.hasSubmitted),e.Q6J("formControlName",null==t.element?null:t.element.name)("type",t.inputType)("tabIndex",null==t.element?null:t.element.tabIndex),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].hasError("required"))),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].hasError("pattern"))&&(null==t.element?null:t.element.errorLabel)))},directives:[Oe._Y,Oe.JL,Oe.sg,me.mk,Oe.Fj,Oe.JJ,Oe.u,me.O5],styles:["[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1}.c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;height:36px;display:inline-flex}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}input[type=text].errors[_ngcontent-%COMP%]{color:red}.text-danger[_ngcontent-%COMP%]{color:red;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}.form-group[_ngcontent-%COMP%]{position:relative;padding-bottom:0;margin:35px 0 0}.form-group[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{font-size:11px;line-height:1.07142857;color:#b3b6b8;font-weight:400;margin:16px 0 0}input[_ngcontent-%COMP%]{border:0;background-image:none;background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:#f6f7fb;transition:background 0s ease-out;float:none;box-shadow:none;border-radius:16px;font-weight:400;height:48px;padding:16px;font-size:14px;line-height:1.42857143;display:block;width:100%;color:#555}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:.3s ease all}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{will-change:left,top,contents}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-2px;left:16px;font-size:14px;line-height:1.42857}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-40px;left:0;font-size:16px;line-height:1.07143;color:#9b9b9c}.form-group.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-28px;left:0;font-size:11px;line-height:1.07143}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-11px;font-size:11px;line-height:1.5}.form-group.form-group-sm.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-5px;font-size:18px;line-height:1.33333}.form-group.form-group-lg.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.is-focused[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{outline:none;background-image:linear-gradient(var(--themeColor),var(--themeColor)),linear-gradient(#D2D2D2,#D2D2D2);background-size:100% 2px,100% 1px;box-shadow:none;transition-duration:.3s}.form-group.is-focused.form-info[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#00bcd4,#00bcd4),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-success[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#4caf50,#4caf50),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-warning[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#ff9800,#ff9800),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-danger[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#f44336,#f44336),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-rose[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#e91e63,#e91e63),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-white[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#FFFFFF,#FFFFFF),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-black[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#555555,#555555),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{color:#aaa}.form-group.is-focused[_ngcontent-%COMP%] select.form-control[_ngcontent-%COMP%]{box-shadow:none;border-color:#d2d2d2}select.form-control[multiple][_ngcontent-%COMP%], .form-group.is-focused[_ngcontent-%COMP%] select.form-control[multiple][_ngcontent-%COMP%]{height:85px}"]}),i}(),Va=function(){function i(o){this.rootFormGroup=o}return i.prototype.ngOnInit=function(){this.form=this.rootFormGroup.control},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-label"]],inputs:{element:"element",controlName:"controlName",hasSubmitted:"hasSubmitted"},decls:2,vars:2,consts:[[1,"c21-header-label"],[1,"c21-form-message-field",3,"innerHTML","tabIndex"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"label",1),e.qZA()),2&n&&(e.xp6(1),e.Q6J("innerHTML",null==t.element?null:t.element.text,e.oJD)("tabIndex",null==t.element?null:t.element.tabIndex))},styles:[".c21-header-label[_ngcontent-%COMP%]{padding:10px 0;position:relative;left:0;right:0}.c21-header-label[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}"]}),i}();function Wa(i,o){if(1&i&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}var Ya=function(i){return{errors:i}},Ga=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.onKeyEnterPressed=new e.vpe}return i.prototype.ngOnInit=function(){this.form=this.rootFormGroup.control},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onEnterPressed=function(o){this.onKeyEnterPressed.emit(o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-checkbox"]],inputs:{element:"element",controlName:"controlName",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:6,vars:9,consts:[[3,"formGroup"],[1,"c21-body-header-checkbox"],["type","checkbox",1,"form-check-input","errors",3,"formControlName","checked","tabIndex","ngClass","keydown.enter"],[1,"c21-form-message-field"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1),e.TgZ(2,"input",2),e.NdJ("keydown.enter",function(a){return t.onEnterPressed(a)}),e.qZA(),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.YNc(5,Wa,2,1,"div",4),e.qZA(),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(2),e.Q6J("formControlName",null==t.element?null:t.element.name)("checked",null==t.element?null:t.element.value)("tabIndex",null==t.element?null:t.element.tabIndex)("ngClass",e.VKq(7,Ya,t.hasSubmitted&&t.form.controls[null==t.element?null:t.element.name].errors)),e.xp6(2),e.Oqu(null==t.element?null:t.element.text),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&t.form.get(null==t.element?null:t.element.name).errors))},directives:[Oe._Y,Oe.JL,Oe.sg,Oe.Wl,Oe.JJ,Oe.u,me.mk,me.O5],styles:['[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1;--backgroundUnchecked: #ffff;--dangerError: #ff0000}.c21-body-header-checkbox[_ngcontent-%COMP%]{--dangerError: #ff0000;position:relative;left:0;right:0}.c21-body-header-checkbox[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}input[type=radio][_ngcontent-%COMP%], input[type=checkbox][_ngcontent-%COMP%]{height:16px;width:16px;vertical-align:middle;margin:0 .4em .4em 0;border:1px solid var(--themeColor);border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none;transition:box-shadow .2s}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):hover, input[type=checkbox][_ngcontent-%COMP%]:not(:checked):focus{border-width:2px;background-color:#fff;border-radius:4px;box-shadow:0 2px 5px rgba(0,0,0,.25);cursor:pointer;padding:15px 25px;transition:all .1s ease-in}input[type=radio][_ngcontent-%COMP%]:active:not(:disabled), input[type=checkbox][_ngcontent-%COMP%]:active:not(:disabled){border-width:2px}input[type=radio][_ngcontent-%COMP%]:focus, input[type=checkbox][_ngcontent-%COMP%]:focus{outline:none}input[type=radio][_ngcontent-%COMP%]:checked, input[type=checkbox][_ngcontent-%COMP%]:checked{background-color:var(--themeColor);-webkit-animation:shrink-bounce .2s cubic-bezier(.4,0,.23,1);animation:shrink-bounce .2s cubic-bezier(.4,0,.23,1)}input[type=radio][_ngcontent-%COMP%]:checked:before{display:block;height:.4em;width:.4em;position:relative;left:.4em;top:.4em;background:var(--backgroundUnchecked);border-radius:100%;content:""}input[type=checkbox][_ngcontent-%COMP%]:checked:before{content:"";display:block;width:4px;height:10px;border:solid var(--foregroundColor);color:var(--foregroundColor);border-width:0 3px 3px 0;transform:rotate(45deg);margin-left:0;margin-top:-5px;transform-origin:0% 100%;background-color:transparent;-webkit-animation:rippleOn .2s;animation:rippleOn .2s}input[type=checkbox][_ngcontent-%COMP%]:checked:after{border:solid var(--backgroundUnchecked);background-color:var(--themeColor);-webkit-animation:rippleOn .2s forwards;animation:rippleOn .2s forwards}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):before{-webkit-animation:rippleOff .2s;animation:rippleOff .2s}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):after{-webkit-animation:rippleOff .2s;animation:rippleOff .2s}input[_ngcontent-%COMP%]:disabled{opacity:.6;background:rgba(0,0,0,.1);box-shadow:none}input[_ngcontent-%COMP%]:disabled + label[_ngcontent-%COMP%]{opacity:.6;cursor:default;-webkit-user-select:none}input[type=checkbox].errors[_ngcontent-%COMP%]{border:2px solid var(--dangerError)}.text-danger[_ngcontent-%COMP%]{color:var(--dangerError);font-size:1em;min-height:20px;background-color:var(--backgroundUnchecked);margin:0 10px}@-webkit-keyframes rippleOn{0%{opacity:0}50%{opacity:.3}to{opacity:0}}@keyframes rippleOn{0%{opacity:0}50%{opacity:.3}to{opacity:0}}@-webkit-keyframes rippleOff{0%{opacity:0}50%{opacity:.2}to{opacity:0}}@keyframes rippleOff{0%{opacity:0}50%{opacity:.2}to{opacity:0}}']}),i}(),Ja=["div_input"];function Qa(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}function Ka(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.element.errorLabel," ")}}var Xa=function(i){return{"is-empty":i}},$a=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.rows=3,this.onKeyEnterPressed=new e.vpe}return i.prototype.ngOnInit=function(){var o=this;this.form=this.rootFormGroup.control,this.form&&this.form.controls&&this.form.controls[this.controlName]&&this.form.controls[this.controlName].valueChanges.subscribe(function(n){o.hasSubmitted=!1,o.setFormStyle()})},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onFocusOut=function(){this.input.nativeElement.classList.remove("is-focused")},i.prototype.onFocus=function(){this.input.nativeElement.classList.add("is-focused")},i.prototype.onEnterPressed=function(o){o.preventDefault(),this.onKeyEnterPressed.emit(o)},i.prototype.onkeydown=function(o){(o.metaKey||o.shiftKey||o.altKey||o.ctrlKey)&&13===(o.which||o.keyCode)&&(o.preventDefault(),this.form.controls[this.controlName].patchValue(this.form.controls[this.controlName].value+"\r\n"))},i.prototype.setFormStyle=function(){this.form.controls[this.controlName].hasError("pattern")||this.form.controls[this.controlName].hasError("required")||this.form.controls[this.controlName].invalid?(this.input.nativeElement.classList.add("form-danger"),this.input.nativeElement.classList.remove("form-success")):this.form.controls[this.controlName].valid&&(this.input.nativeElement.classList.remove("form-danger"),this.input.nativeElement.classList.add("form-success"))},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-textarea"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ja,5),2&n)&&(e.iGM(r=e.CRH())&&(t.input=r.first))},inputs:{element:"element",controlName:"controlName",rows:"rows",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:9,vars:10,consts:[[3,"formGroup"],["id","div_input",1,"form-group","label-floating",3,"ngClass"],["div_input",""],[1,"control-label"],["type","text",1,"form-control",3,"formControlName","rows","tabIndex","keydown","keydown.enter","focus","focusout"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1,2),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.TgZ(5,"textarea",4),e.NdJ("keydown",function(a){return t.onkeydown(a)})("keydown.enter",function(a){return t.onEnterPressed(a)})("focus",function(){return t.onFocus()})("focusout",function(){return t.onFocusOut()}),e._uU(6," "),e.qZA(),e.qZA(),e.YNc(7,Qa,2,1,"div",5),e.YNc(8,Ka,2,1,"div",5),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(1),e.Q6J("ngClass",e.VKq(8,Xa,!(null!=t.form&&null!=t.form.controls[t.element.name]&&t.form.controls[t.element.name].value))),e.xp6(3),e.hij(" ",null==t.element?null:t.element.text," "),e.xp6(1),e.Q6J("formControlName",null==t.element?null:t.element.name)("rows",t.rows)("tabIndex",null==t.element?null:t.element.tabIndex),e.xp6(2),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[t.element.name].errors)&&(null==t.form?null:t.form.controls[t.element.name].hasError("required"))),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[t.element.name].errors)&&(null==t.form?null:t.form.controls[t.element.name].hasError("pattern"))&&(null==t.element?null:t.element.errorLabel)))},directives:[Oe._Y,Oe.JL,Oe.sg,me.mk,Oe.Fj,Oe.JJ,Oe.u,me.O5],styles:["[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1}.c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;display:inline-flex}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:active, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:hover, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:visited{background-image:linear-gradient(#3ea9f5,#3ea9f5),linear-gradient(#d2d2d2,#d2d2d2);background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:rgba(0,0,0,0);transition:background 0s ease-out}textarea[type=text].errors[_ngcontent-%COMP%]{border-bottom:2px solid red;color:red}.text-danger[_ngcontent-%COMP%]{color:red;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}.form-group[_ngcontent-%COMP%]{position:relative;padding-bottom:0;margin:35px 0 0}.form-group[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{font-size:11px;line-height:1.07142857;color:#b3b6b8;font-weight:400;margin:16px 0 0}textarea[_ngcontent-%COMP%]{border:0;background-image:none;background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:#f6f7fb;transition:background 0s ease-out;float:none;box-shadow:none;border-radius:16px;font-weight:400;padding:16px;font-size:14px;line-height:1.42857143;display:block;width:100%;color:#555;resize:vertical}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:.3s ease all}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{will-change:left,top,contents}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-2px;left:16px;font-size:14px;line-height:1.42857}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-40px;left:0;font-size:16px;line-height:1.07143;color:#9b9b9c}.form-group.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-28px;left:0;font-size:11px;line-height:1.07143}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-11px;font-size:11px;line-height:1.5}.form-group.form-group-sm.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-5px;font-size:18px;line-height:1.33333}.form-group.form-group-lg.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.is-focused[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{outline:none;background-image:linear-gradient(var(--themeColor),var(--themeColor)),linear-gradient(#D2D2D2,#D2D2D2);background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-size:100% 2px,100% 1px;transition-duration:.3s;width:100%}.form-group.is-focused.form-info[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#00bcd4,#00bcd4),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-success[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#4caf50,#4caf50),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-warning[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#ff9800,#ff9800),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-danger[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#f44336,#f44336),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-rose[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#e91e63,#e91e63),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-white[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#FFFFFF,#FFFFFF),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-black[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#555555,#555555),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{color:#aaa}.form-group.is-focused[_ngcontent-%COMP%] select.form-control[_ngcontent-%COMP%]{box-shadow:none;border-color:#d2d2d2}"]}),i}();function es(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-text",13),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function ts(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-label",14),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("hasSubmitted",r.submitted)}}function ns(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-checkbox",13),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function os(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-textarea",15),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("rows",null==t?null:t.rows)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function is(i,o){if(1&i&&(e.TgZ(0,"span"),e.YNc(1,es,1,5,"chat-form-text",10),e.YNc(2,ts,1,3,"chat-form-label",11),e.YNc(3,ns,1,5,"chat-form-checkbox",10),e.YNc(4,os,1,6,"chat-form-textarea",12),e.qZA()),2&i){var n=o.$implicit;e.xp6(1),e.Q6J("ngIf","text"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","static"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","checkbox"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","textarea"===(null==n?null:n.type))}}var rs=function(i,o,n){return{"background-color":i,"border-color":o,color:n}},as=function(i){return{fill:i}},ss=function(){function i(o,n){this.formBuilder=o,this.customTranslateService=n,this.onSubmitForm=new e.vpe,this.onErrorRenderForm=new e.vpe,this.submitted=!1,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.translationErrorLabelMap=this.customTranslateService.translateLanguage(["LABEL_ERROR_FIELD_REQUIRED","PRECHAT_REQUIRED_ERROR"]),this.translationMap=this.customTranslateService.translateLanguage(["LABEL_START_NW_CONV"]),this.logger.debug("[FORM-BUILDER] ngOnChanges: preChatFormJson ----\x3e",this.formArray),this.logger.debug("[FORM-BUILDER] ngOnChanges: preChatForm completed ----\x3e",this.preChatFormGroupCustom)},i.prototype.ngOnChanges=function(o){this.formArray&&(this.browserLang=navigator.language,this.preChatFormGroupCustom=this.buildFormGroup(this.formArray),this.formArray=this.setTranslations(this.formArray),this.subscribeToFormChanges())},i.prototype.buildFormGroup=function(o){var n=this,t={},r=!1;return o.forEach(function(u,y){if(u.tabIndex=1411+y,n.lastTabIndex=1411+y+1,u.label||(u.label=u.name),u.type=u.type?u.type.toLowerCase():"text",!u.type||"text"!==u.type&&"textarea"!==u.type){if("checkbox"!==u.type){if("static"===u.type)return;return n.logger.error("[FORM-BUILDER] ERROR while rendering field --\x3e RESTORE DEFAULT"),void(r=!0)}j=[],J=!1,u.mandatory&&j.push(Oe.kI.required,Oe.kI.requiredTrue),u.value&&(J="true"===u.value||!0===u.value),t[u.name]=new Oe.NI(J,Oe.kI.compose(j))}else{var j=[],J=null;u.mandatory&&j.push(Oe.kI.required),u.regex&&j.push(Oe.kI.pattern(new RegExp(function(i){var o=i;return"/"!==i.substring(0,1)&&(o="/"+i),"/"!==i.substring(i.length-1,i.length)&&(o+="/"),o}(u.regex).slice(1,-1)))),u.value&&(J=u.value),t[u.name]=new Oe.NI(J,Oe.kI.compose(j))}}),r&&(this.logger.error("[FORM-BUILDER] ERROR while rendering field --\x3e restoreDefault",t={}),this.onErrorRenderForm.emit()),this.formBuilder.group(t)},i.prototype.setTranslations=function(o){var n=this;return o.forEach(function(t){if("object"==typeof t.label){var r=n.getAcceptLanguage(t.label);n.logger.debug("[FORM-BUILDER] setTranslations acceptedLanguage for element.label:",t,r),t.text=t.label[r]}else"string"==typeof t.label&&(t.text=n.customTranslateService.translateLanguage([t.label]).get(t.label));"object"==typeof t.errorLabel?(r=n.getAcceptLanguage(t.errorLabel),n.logger.debug("[FORM-BUILDER] setTranslations acceptedLanguage for element.errorLabel:",t,r),t.errorLabel=t.errorLabel[r]):"string"==typeof t.errorLabel&&(t.errorLabel=n.customTranslateService.translateLanguage([t.errorLabel]).get(t.errorLabel))}),this.formArray},i.prototype.getAcceptLanguage=function(o){var n="",t="";o&&o.default&&(t="default"),navigator.languages.forEach(function(a){n+=a+","});var r=Za.e(Object.keys(o),n);return r&&(t=r),t},i.prototype.subscribeToFormChanges=function(){var o=this;this.preChatFormGroupCustom&&this.preChatFormGroupCustom.valueChanges.subscribe(function(n){o.submitted=!1})},i.prototype.onSubmitPreChatForm=function(){this.submitted=!0,this.logger.debug("[FORM-BUILDER] onSubmitPreChatForm",this.preChatFormGroupCustom),this.preChatFormGroupCustom.valid&&this.onSubmitForm.emit(this.preChatFormGroupCustom.value)},i.prototype.onEnterButtonPressed=function(o){this.logger.debug("[FORM-BUILDER] onEnterButtonPressed event",o),this.onSubmitPreChatForm()},i.prototype.onResetForm=function(){this.submitted=!1,this.preChatFormGroupCustom.reset()},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.qu),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-builder"]],inputs:{formArray:"formArray",isOpenPrechatForm:"isOpenPrechatForm",stylesMap:"stylesMap"},outputs:{onSubmitForm:"onSubmitForm",onErrorRenderForm:"onErrorRenderForm"},features:[e.TTD],decls:12,vars:12,consts:[["id","chat21-form-container",3,"formGroup"],[4,"ngFor","ngForOf"],[1,"c21-new-conversation"],[1,"c21-button-primary",3,"tabindex","ngStyle","click","keydown.enter"],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],["d","M0 0h24v24H0z","fill","none"],[1,"v-align-center","c21-label-button"],[1,"clear"],[3,"element","controlName","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","rows","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed"],[3,"element","controlName","hasSubmitted","onKeyEnterPressed"],[3,"element","controlName","rows","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed"]],template:function(n,t){1&n&&(e.TgZ(0,"div"),e.TgZ(1,"form",0),e.YNc(2,is,5,4,"span",1),e.qZA(),e.TgZ(3,"div",2),e.TgZ(4,"button",3),e.NdJ("click",function(){return t.onSubmitPreChatForm()})("keydown.enter",function(a){return t.onEnterButtonPressed(a)}),e.TgZ(5,"span",4),e.O4$(),e.TgZ(6,"svg",5),e._UZ(7,"path",6),e._UZ(8,"path",7),e.qZA(),e.qZA(),e.kcU(),e.TgZ(9,"span",8),e._uU(10),e.qZA(),e._UZ(11,"div",9),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("formGroup",t.preChatFormGroupCustom),e.xp6(1),e.Q6J("ngForOf",t.formArray),e.xp6(2),e.Q6J("tabindex",t.lastTabIndex)("ngStyle",e.kEZ(6,rs,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.Q6J("ngStyle",e.VKq(10,as,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.hij(" ",null==t.translationMap?null:t.translationMap.get("LABEL_START_NW_CONV")," "))},directives:[Oe._Y,Oe.JL,Oe.sg,me.sg,me.PC,me.O5,qa,Va,Ga,$a],styles:[".c21-label-button[_ngcontent-%COMP%]{font-size:1.2em!important}.c21-new-conversation[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;border-top:0px solid #eeeeee;display:flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top}.c21-new-conversation[_ngcontent-%COMP%] button.c21-button-primary[_ngcontent-%COMP%]{margin:10px 0}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;height:36px;display:inline-flex}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding:11px 10px 8px;color:#616161;font-size:1.3em;font-weight:300;line-height:1.2em;box-shadow:none}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input.errors[_ngcontent-%COMP%]{border:1px solid red}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}"]}),i}(),ls=["afPrechatFormComponent"],cs=["privacyInputField"],us=function(i,o){return{color:i,"background-image":o}},hs=function(i){return{fill:i}},ps=function(i){return{color:i}},ds=function(){function i(o,n,t){this.g=o,this.formBuilder=n,this.appStorageService=t,this.onClosePage=new e.vpe,this.onCloseForm=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.initialize()},i.prototype.initialize=function(){},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afPrechatFormComponent&&o.afPrechatFormComponent.nativeElement.focus()},1e3)},i.prototype.openNewConversation=function(){if(this.g.attributes){var o=this.g.attributes;if(this.privacyInputField&&!1===this.privacyInputField.nativeElement.checked){this.g.privacyApproved=!1;var n=window.document.getElementById("span-checkmark");return void(n&&n.classList.add("unchecked"))}this.privacyInputField&&!0===this.privacyInputField.nativeElement.checked&&(this.g.privacyApproved=!0),this.g.setAttributeParameter("privacyApproved",this.g.privacyApproved),this.g.setAttributeParameter("userFullname",this.userFullname),this.g.setAttributeParameter("userEmail",this.userEmail),this.g.setParameter("userFullname",this.userFullname),this.g.setParameter("userEmail",this.userEmail),this.appStorageService.setItem("attributes",JSON.stringify(o)),this.onCloseForm.emit()}},i.prototype.returnClosePage=function(){this.onClosePage.emit()},i.prototype.onSubmitForm=function(o){this.logger.debug("[PRE-CHAT-FORM] onSubmitForm:",o),this.g.attributes&&(o.hasOwnProperty("userFullname")&&(this.g.setAttributeParameter("userFullname",o.userFullname),this.g.setParameter("userFullname",o.userFullname)),o.hasOwnProperty("userEmail")&&(this.g.setAttributeParameter("userEmail",o.userEmail),this.g.setParameter("userEmail",o.userEmail)),this.g.attributes.preChatForm=o,this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes)),this.onCloseForm.emit())},i.prototype.onErrorRenderForm=function(){this.logger.debug("[PRE-CHAT-FORM] onErrorRenderForm: RESTORE DEFAULT JSON"),this.g.setParameter("preChatFormJson",[{name:"userFullname",type:"text",mandatory:!0,label:"LABEL_FIELD_NAME"},{name:"userEmail",type:"text",mandatory:!0,regex:"/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/",label:"LABEL_FIELD_EMAIL",errorLabel:"LABEL_ERROR_FIELD_EMAIL"}])},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Oe.qu),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-prechat-form"]],viewQuery:function(n,t){if(1&n&&(e.Gf(ls,5),e.Gf(cs,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.afPrechatFormComponent=r.first),e.iGM(r=e.CRH())&&(t.privacyInputField=r.first)}},inputs:{stylesMap:"stylesMap"},outputs:{onClosePage:"onClosePage",onCloseForm:"onCloseForm"},decls:20,vars:14,consts:[["id","chat21-prechat-form","tabindex","1400","aria-modal","true","onFocus","document.querySelector('[start-focus-chat21-prechat-form]').focus()"],["afPrechatFormComponent",""],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-button"],[1,"c21-close-button","c21-small"],["tabindex","1490","aria-label"," chiudi pannello",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"c21-header-content"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-header"],["start-focus-chat21-prechat-form","","tabindex","1410",1,"c21-form-message-field"],[1,"c21-body-content"],[3,"formArray","isOpenPrechatForm","stylesMap","onSubmitForm","onErrorRenderForm"],["tabindex","1499","onFocus","document.querySelector('[start-focus-chat21-prechat-form]').focus()"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.returnClosePage()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"div",10),e._UZ(11,"div",11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",12),e.TgZ(13,"div",13),e.TgZ(14,"div",14),e.TgZ(15,"div",15),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",16),e.TgZ(18,"chat-form-builder",17),e.NdJ("onSubmitForm",function(a){return t.onSubmitForm(a)})("onErrorRenderForm",function(){return t.onErrorRenderForm()}),e.qZA(),e.qZA(),e.qZA(),e._UZ(19,"span",18),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(7,us,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(5),e.Q6J("ngStyle",e.VKq(10,hs,t.g.themeForegroundColor)),e.xp6(4),e.Q6J("ngStyle",e.VKq(12,ps,t.g.themeForegroundColor)),e.xp6(5),e.Oqu(t.g.LABEL_COMPLETE_FORM),e.xp6(2),e.Q6J("formArray",t.g.preChatFormJson)("isOpenPrechatForm",t.g.isOpenPrechatForm)("stylesMap",t.stylesMap))},directives:[me.PC,ss],styles:['#chat21-prechat-form[_ngcontent-%COMP%]{background-color:#fff;width:100%;height:100%}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:100%;margin:0 auto}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{width:auto;height:auto;top:6px;left:40px;right:40px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{display:inline-block;width:100%;height:auto;padding:0;margin:10px 0;text-align:center;font-size:1.6em;line-height:normal}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{padding:0;margin:20px auto}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{padding:10px 25px;position:relative;left:0;right:0}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:10px 30px;position:relative}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{font-size:1.2em}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%]{padding:0 0 30px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{background-color:#fff;overflow:hidden;position:relative;height:36px;margin:10px 10px 0}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%]{color:#a94442;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;width:100%;display:inline-flex}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding:11px 10px 8px;color:#616161;font-size:1.3em;font-weight:300;line-height:1.2em;box-shadow:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;padding:35px;font-size:12px;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:22px;position:absolute;top:30px;left:10px;opacity:0;cursor:pointer;height:18px;width:18px}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{position:absolute;top:30;left:10;height:18px;width:18px;background-color:#eee;border:solid white;cursor:pointer}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark.unchecked[_ngcontent-%COMP%]{box-shadow:0 0 0 1px red}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%]:hover input[_ngcontent-%COMP%] ~ .checkmark[_ngcontent-%COMP%]{background-color:#ccc}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]{background-color:#2196f3}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute;display:none}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]:after{display:block}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{left:5px;top:2px;width:5px;height:8px;border:solid white;border-width:0 3px 3px 0;transform:rotate(45deg)}']}),i}();function gs(i,o){1&i&&(e.TgZ(0,"div"),e._uU(1,"here is ignored"),e.qZA())}function fs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"p",22),e.NdJ("click",function(){e.CHM(n);var a=e.oxw(3);return a.popupUrl(a.g.windowContext,a.conversation.last_message_text,"windowName")}),e._uU(1),e.qZA()}if(2&i){var t=e.oxw(3);e.xp6(1),e.hij("",t.strip_tags(t.conversation.last_message_text)," ")}}function ms(i,o){if(1&i&&(e._UZ(0,"p",23),e.ALo(1,"marked"),e.ALo(2,"htmlEntitiesEncode")),2&i){var n=e.oxw(3);e.Q6J("innerHTML",e.lcZ(1,1,e.lcZ(2,3,n.conversation.last_message_text)),e.oJD)}}function vs(i,o){if(1&i&&(e.TgZ(0,"div",18),e.YNc(1,gs,2,0,"div",19),e.YNc(2,fs,2,1,"ng-template",null,20,e.W1O),e.YNc(4,ms,3,5,"ng-template",null,21,e.W1O),e.qZA()),2&i){var n=e.MAs(3),t=e.MAs(5),r=e.oxw(2);e.xp6(1),e.Q6J("ngIf",r.isPopupUrl(r.conversation.last_message_text))("ngIfThen",n)("ngIfElse",t)}}function bs(i,o){if(1&i&&(e.TgZ(0,"time"),e._uU(1),e.ALo(2,"amTimeAgo"),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij("",e.lcZ(2,1,n.conversation.timestamp)," ")}}function _s(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"div",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.NdJ("click",function(){e.CHM(n);var a=e.oxw();return a.openConversationByID(a.conversation)}),e.TgZ(5,"span"),e._uU(6,"View more"),e.qZA(),e.qZA(),e.TgZ(7,"div",6),e.NdJ("click",function(){return e.CHM(n),e.oxw().closeMessagePreview()}),e.TgZ(8,"span"),e.O4$(),e.TgZ(9,"svg",7),e._UZ(10,"path",8),e._UZ(11,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",10),e.NdJ("click",function(){e.CHM(n);var a=e.oxw();return a.openConversationByID(a.conversation)}),e.TgZ(13,"div",11),e._uU(14),e.qZA(),e.YNc(15,vs,6,3,"div",12),e.TgZ(16,"div",13),e.YNc(17,bs,3,3,"time",14),e.qZA(),e.TgZ(18,"div",15),e.TgZ(19,"div",16),e._UZ(20,"chat-avatar-image",17),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(14),e.Oqu(t.conversation.sender_fullname),e.xp6(1),e.Q6J("ngIf","text"==t.conversation.type),e.xp6(2),e.Q6J("ngIf","{.sv: timestamp}"!==t.conversation.timestamp),e.xp6(3),e.Q6J("senderID",t.conversation.sender)("senderFullname",t.conversation.sender_fullname)("baseLocation",t.baseLocation)}}var Cs=function(){function i(o,n){this.imageRepoService=o,this.g=n,this.onCloseMessagePreview=new e.vpe,this.onSelectedConversation=new e.vpe,this.subscriptions=[],this.isPopupUrl=gn,this.popupUrl=so,this.strip_tags=lo,this.isImage=qt,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngAfterViewInit=function(){},i.prototype.ngOnChanges=function(o){this.logger.debug("[LASTMESSAGE] onChanges",o),this.conversation&&(this.conversation.image=this.imageRepoService.getImagePhotoUrl(this.conversation.sender))},i.prototype.getMetadataSize=function(o){void 0===o.width&&(o.width=We),void 0===o.height&&(o.height=We);var n={width:o.width,height:o.height};if(o.width&&o.width>We){var t=o.width/o.height;n.width=We,n.height=We/t}return n},i.prototype.onAttachmentButtonClicked=function(o){this.logger.debug("[LASTMESSAGE] onAttachmentButtonClicked",o)},i.prototype.openConversationByID=function(o){this.logger.debug("[LASTMESSAGE] openConversationByID: ",o),this.conversation=null,this.g.isOpenNewMessage=!1,o&&this.onSelectedConversation.emit(o)},i.prototype.closeMessagePreview=function(){this.conversation=null,this.g.isOpenNewMessage=!1,this.onCloseMessagePreview.emit()},i.prototype.ngOnDestroy=function(){this.conversation=null,this.g.isOpenNewMessage=!1},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.logger.debug("[LASTMESSAGE] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(st),e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-last-message"]],inputs:{conversation:"conversation",baseLocation:"baseLocation",stylesMap:"stylesMap"},outputs:{onCloseMessagePreview:"onCloseMessagePreview",onSelectedConversation:"onSelectedConversation"},features:[e.TTD],decls:1,vars:1,consts:[["id","messagePreview",4,"ngIf"],["id","messagePreview"],["role","messaggio","id","new_message"],[1,"headerPreviewMessage"],[1,"boxButtons"],["role","button","tabindex","0",1,"buttonMore",3,"click"],["aria-label","Dismiss","role","button","tabindex","0",1,"buttonClose",3,"click"],["aria-labelledby","altIconTitle","height","20px","role","img","viewBox","0 0 24 24","width","20px","xmlns","http://www.w3.org/2000/svg",2,"fill","rgb(255, 255, 255)"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"previewNewMessagge",3,"click"],["role","messaggio",1,"c21-text","message_sender_fullname"],["class","c21-box-text",4,"ngIf"],[1,"c21-time","c21-text"],[4,"ngIf"],[1,"c21-icon-avatar"],[1,"c21-avatar-image","profile_image"],[1,"slide-in-left",3,"senderID","senderFullname","baseLocation"],[1,"c21-box-text"],[4,"ngIf","ngIfThen","ngIfElse"],["contentPopup",""],["contentNewTab",""],[1,"c21-link",3,"click"],[1,"c21-text","overflow4Lines",3,"innerHTML"]],template:function(n,t){1&n&&e.YNc(0,_s,21,6,"div",0),2&n&&e.Q6J("ngIf",t.conversation&&t.g.isOpenNewMessage)},directives:[me.O5,Wn],pipes:[Xt,Vn,$e.eG],styles:['[_nghost-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] >chat-avatar-image .c21-icon-avatar{height:32px;width:32px;min-width:32px;min-height:32px}[_nghost-%COMP%] .slide-in-left[_ngcontent-%COMP%] >chat-message-attachment>#buttons-in-message>span>chat-text-button-attachment .button-in-msg{font-size:13px;padding:5px 10px!important}#messagePreview[_ngcontent-%COMP%]{position:relative;width:320px;max-height:200px;height:100%;padding:0 10px 10px;background-color:transparent;font-family:"Helvetica Neue","Apple Color Emoji",Helvetica,Arial,sans-serif;font-size:100%;font-style:normal;letter-spacing:normal;font-stretch:normal;font-weight:normal;text-align:left;-moz-text-align-last:auto;text-align-last:auto;-moz-text-align-last:initial;text-align-last:initial;text-indent:0px;text-shadow:none;text-transform:none;box-sizing:content-box;-webkit-font-smoothing:antialiased;line-height:1;font-feature-settings:normal;font-variant:normal}#new_message[_ngcontent-%COMP%]:hover .boxButtons[_ngcontent-%COMP%]{display:block;-webkit-animation:fade-in-dw-up .3s ease-in 0s;animation:fade-in-dw-up .3s ease-in 0s}.previewNewMessagge[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;background-color:#fff;box-shadow:rgba(35,47,53,.09) 0 2px 8px;clear:both;margin-left:45px;margin-bottom:8px;border-radius:5px 5px 5px 0;padding:4;font-size:14px}.previewNewMessagge[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:0px;left:-5px;width:0px;height:0px;border-style:solid;border-width:0px 0px 13px 5px;border-color:transparent transparent white}.c21-text.message_sender_fullname[_ngcontent-%COMP%]{font-size:13px;padding:0 10;margin:4 0;clear:both;color:#686868}.c21-box-text[_ngcontent-%COMP%]{max-height:110;overflow-y:auto}.c21-text[_ngcontent-%COMP%]{font-size:14px;color:#000;padding:0 10;margin:0;line-height:1.4;word-break:break-word}.overflow4Lines[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}.c21-img[_ngcontent-%COMP%]{margin-left:5px;width:120px}.c21-text.c21-time[_ngcontent-%COMP%]{font-size:13px;padding:0 10;clear:both;color:#737376}.c21-link[_ngcontent-%COMP%]{text-decoration:underline;padding:8px;cursor:pointer}.c21-icon-avatar[_ngcontent-%COMP%]{position:absolute;width:32px;height:32px;bottom:0px;left:-40px;box-shadow:rgba(35,47,53,.09) 0 2px 8px;border-radius:100%;border:1px solid #eee;overflow:hidden}.c21-avatar-image[_ngcontent-%COMP%]{width:32px;height:32px;display:block;position:absolute}.c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%}.headerPreviewMessage[_ngcontent-%COMP%]{position:relative;height:40;margin:10 0 0 50}.boxButtons[_ngcontent-%COMP%]{display:none}.buttonClose[_ngcontent-%COMP%]{transform:translateY(0);opacity:1;position:absolute;top:0px;right:0px;transition:all .12s ease-out 80ms}.buttonMore[_ngcontent-%COMP%]{transform:translateY(0);opacity:1;display:inline-block;transition:all .12s ease-out 80ms;text-align:center}.buttonMore[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;background-color:#67788f;color:#fff;font-size:13px;height:32px;line-height:32px;cursor:pointer;border-radius:16px;background-position:center center;padding:0 20px}.buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:32px;height:32px;padding:0}.buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{padding:6}#new_message[_ngcontent-%COMP%]{position:absolute;left:0;right:10;bottom:0}']}),i}(),yt=function(i){return{fill:i}};function ys(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){return e.CHM(n),e.oxw().prevStep()}),e.O4$(),e.TgZ(1,"svg",11),e._UZ(2,"path",12),e._UZ(3,"path",13),e.TgZ(4,"title",14),e._uU(5),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.VKq(2,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.BACK)}}var on=function(i){return{color:i}};function ws(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",38),e.TgZ(1,"div",39),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.TgZ(2,"span",40),e._uU(3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Q6J("ngStyle",e.VKq(2,on,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(t.g.DOWNLOAD_TRANSCRIPT)}}var At=function(i,o,n){return{"background-color":i,"border-color":o,color:n}};function Os(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.YNc(1,ws,4,4,"div",16),e._UZ(2,"div",17),e.TgZ(3,"div",18),e.TgZ(4,"div",19),e._uU(5),e.qZA(),e.TgZ(6,"fieldset",20),e._UZ(7,"input",21),e.TgZ(8,"label",22),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(1)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(1)}),e.O4$(),e.TgZ(9,"svg",23),e._UZ(10,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(11,"input",25),e.TgZ(12,"label",26),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(2)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(2)}),e.O4$(),e.TgZ(13,"svg",23),e._UZ(14,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(15,"input",27),e.TgZ(16,"label",28),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(3)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(3)}),e.O4$(),e.TgZ(17,"svg",23),e._UZ(18,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(19,"input",29),e.TgZ(20,"label",30),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(4)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(4)}),e.O4$(),e.TgZ(21,"svg",23),e._UZ(22,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(23,"input",31),e.TgZ(24,"label",32),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(5)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(5)}),e.O4$(),e.TgZ(25,"svg",23),e._UZ(26,"path",24),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e._UZ(27,"div",17),e.TgZ(28,"button",33),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(29,"span",34),e.O4$(),e.TgZ(30,"svg",35),e._UZ(31,"path",12),e._UZ(32,"path",36),e.TgZ(33,"title",14),e._uU(34),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(35,"span",37),e._uU(36),e.qZA(),e._UZ(37,"div",17),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.g.allowTranscriptDownload),e.xp6(4),e.Oqu(t.g.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE),e.xp6(1),e.uIk("disabled",t.g.isOpenStartRating?null:""),e.xp6(3),e.ekj("active",t.mouseRate>=1),e.xp6(4),e.ekj("active",t.mouseRate>=2),e.xp6(4),e.ekj("active",t.mouseRate>=3),e.xp6(4),e.ekj("active",t.mouseRate>=4),e.xp6(4),e.ekj("active",t.mouseRate>=5),e.xp6(3),e.Q6J("ngStyle",e.kEZ(17,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(21,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," ")}}function Ms(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e._UZ(1,"div",17),e.TgZ(2,"div",41),e.TgZ(3,"textarea",42,43),e._uU(5),e.qZA(),e._UZ(6,"div",17),e.TgZ(7,"button",44),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(8,"span",34),e.O4$(),e.TgZ(9,"svg",35),e._UZ(10,"path",12),e._UZ(11,"path",36),e.TgZ(12,"title",14),e._uU(13),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(14,"span",37),e._uU(15),e.qZA(),e._UZ(16,"div",17),e.qZA(),e.TgZ(17,"button",45),e.NdJ("click",function(){return e.CHM(n),e.oxw().sendRate()}),e.TgZ(18,"span",34),e.O4$(),e.TgZ(19,"svg",35),e._UZ(20,"path",46),e._UZ(21,"path",47),e.TgZ(22,"title",14),e._uU(23),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(24,"span",37),e._uU(25),e.qZA(),e._UZ(26,"div",17),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(3),e.s9C("placeholder",t.g.WRITE_YOUR_OPINION),e.xp6(2),e.Oqu(t.message),e.xp6(2),e.Q6J("ngStyle",e.kEZ(10,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(14,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," "),e.xp6(2),e.Q6J("ngStyle",e.kEZ(16,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(20,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.SUBMIT),e.xp6(2),e.hij(" ",t.g.SUBMIT," ")}}function xs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",38),e.TgZ(1,"div",39),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.TgZ(2,"span",40),e._uU(3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Q6J("ngStyle",e.VKq(2,on,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(t.g.DOWNLOAD_TRANSCRIPT)}}function Es(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.YNc(1,xs,4,4,"div",16),e._UZ(2,"div",17),e.TgZ(3,"div",41),e.TgZ(4,"div",48),e._uU(5),e.qZA(),e.TgZ(6,"div",19),e._uU(7),e.qZA(),e.qZA(),e.TgZ(8,"button",44),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(9,"span",34),e.O4$(),e.TgZ(10,"svg",35),e._UZ(11,"path",12),e._UZ(12,"path",36),e.TgZ(13,"title",14),e._uU(14),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(15,"span",37),e._uU(16),e.qZA(),e._UZ(17,"div",17),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.g.allowTranscriptDownload),e.xp6(4),e.Oqu(t.g.THANK_YOU_FOR_YOUR_EVALUATION),e.xp6(2),e.Oqu(t.g.YOUR_RATING_HAS_BEEN_RECEIVED),e.xp6(1),e.Q6J("ngStyle",e.kEZ(7,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(11,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," ")}}var Ts=function(i,o){return{color:i,"background-image":o}},Ss=function(){function i(o,n){this.starRatingWidgetService=o,this.g=n,this.onClosePage=new e.vpe,this.onCloseRate=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.step=0},i.prototype.dowloadTranscript=function(){this.starRatingWidgetService._dowloadTranscript(this.recipientId)},i.prototype.openRate=function(o){var n=this;this.rate=o,setTimeout(function(){n.step=1},300)},i.prototype.mouseOverRate=function(o){this.mouseRate=o},i.prototype.nextStep=function(){this.step=this.step+1},i.prototype.prevStep=function(){this.step=this.step-1},i.prototype.sendRate=function(){this.message=document.getElementById("chat21-message-rate-context").value,this.logger.debug("[STAR-RATING_COMP] sendRate!!!::",this.message);var o=this;this.starRatingWidgetService.httpSendRate(this.rate,this.message).subscribe(function(n){o.logger.debug("[STAR-RATING_COMP] OK sender",n),o.nextStep()},function(n){o.nextStep()},function(){})},i.prototype.ngOnDestroy=function(){this.step=0},i.prototype.returnClosePage=function(){this.logger.debug("[STAR-RATING_COMP] closePage: ",this.mouseRate,this.step,this.rate),this.rate&&0!==this.rate&&this.step<2?this.sendRate():this.step=0,this.starRatingWidgetService.setOsservable(!1),this.onClosePage.emit()},i.\u0275fac=function(n){return new(n||i)(e.Y36(en),e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-star-rating-widget"]],inputs:{recipientId:"recipientId",stylesMap:"stylesMap"},outputs:{onClosePage:"onClosePage",onCloseRate:"onCloseRate"},decls:14,vars:12,consts:[["id","chat21-star-rating-widget"],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","1417","aria-label"," indietro ","class","c21-header-button c21-left c21-button-clean",3,"click",4,"ngIf"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-content"],["class","step-rate",4,"ngIf"],["tabindex","1417","aria-label"," indietro ",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],["id","altIconTitle"],[1,"step-rate"],["class","c21-modal-content","style","text-align: right; margin: 0px 20px 30px 10px;",4,"ngIf"],[1,"clear"],[1,"c21-modal-content"],[1,"default-text"],[1,"chat21-rating"],["type","radio","id","star1","name","rating","value","1",1,"c21-input-star"],["for","star1","title","scarso - 1 star",1,"full","c21-button",3,"mouseover","mouseleave","click"],["width","30px","height","30px","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 576 512",1,"star"],["d","M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"],["type","radio","id","star2","name","rating","value","2",1,"c21-input-star"],["for","star2","title","sufficiente - 2 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star3","name","rating","value","3",1,"c21-input-star"],["for","star3","title","buono - 3 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star4","name","rating","value","4",1,"c21-input-star"],["for","star4","title","ottimo - 4 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star5","name","rating","value","5",1,"c21-input-star"],["for","star5","title","eccellente - 5 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["tabindex","1414",1,"c21-button-primary",3,"ngStyle","click"],[1,"v-align-center"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24",3,"ngStyle"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"v-align-center","c21-label-button"],[1,"c21-modal-content",2,"text-align","right","margin","0px 20px 30px 10px"],[1,"c21-link",3,"click"],[3,"ngStyle"],[1,"c21-step-content"],["rows","1","id","chat21-message-rate-context",1,"textarea-rate",3,"placeholder"],["textbox",""],["tabindex","1415",1,"c21-button-primary",3,"ngStyle","click"],["tabindex","1416",1,"c21-button-primary",3,"ngStyle","click"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"],["d","M0 0h24v24H0z","fill","none"],[1,"default-title"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.YNc(4,ys,6,4,"button",4),e.TgZ(5,"div",5),e.TgZ(6,"span"),e._uU(7),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",6),e.TgZ(9,"div",7),e.TgZ(10,"div",8),e.YNc(11,Os,38,23,"div",9),e.YNc(12,Ms,27,22,"div",9),e.YNc(13,Es,18,13,"div",9),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngStyle",e.WLB(7,Ts,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(3),e.Q6J("ngIf",t.step>0&&2!=t.step),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,on,t.g.themeForegroundColor)),e.xp6(2),e.Oqu(t.g.CUSTOMER_SATISFACTION),e.xp6(4),e.Q6J("ngIf",0==t.step),e.xp6(1),e.Q6J("ngIf",1==t.step),e.xp6(1),e.Q6J("ngIf",2==t.step))},directives:[me.PC,me.O5],styles:['#chat21-star-rating-widget[_ngcontent-%COMP%]{background-color:#fff;width:100%;height:100%;font-size:10px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{z-index:1}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:45px;right:45px;display:inline-block;width:auto;height:1.6em;line-height:1.6em;padding:0;margin:13px 0;text-align:center;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{overflow:hidden}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{padding:10px 30px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:10px 0}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .default-title[_ngcontent-%COMP%]{font-size:2em;font-family:"Roboto";color:#1a1a1a}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .default-text[_ngcontent-%COMP%]{font-size:1.4em;font-family:"Roboto";color:#1a1a1a;margin:0 0 4px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%]{text-align:center;position:relative;margin:10px 0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%]{border:none;width:190px;min-height:30px;margin:20px auto;font-size:1.6em;padding:0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] input.c21-input-star[_ngcontent-%COMP%]{border:0;width:1px;height:1px;overflow:hidden;position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);opacity:0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]{position:relative;display:inline;float:none;color:#c8c8c8}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:before{margin:5px;display:inline-block;font-size:24px;color:#ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] input.c21-input-star[_ngcontent-%COMP%]:checked ~ label.c21-button[_ngcontent-%COMP%]:before{color:#ffc107}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:hover ~ label.c21-button[_ngcontent-%COMP%]:before{color:#ffdb70}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:hover:before{color:#ffc107}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] .chat21-stars[_ngcontent-%COMP%]{padding:0;position:absolute;text-align:right;display:block;top:0px;right:40px;width:70px;line-height:20px;fill:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star[_ngcontent-%COMP%]{fill:#efefef}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star[_ngcontent-%COMP%]:hover{fill:gold;stroke-width:15px;transform:rotate(-15deg) scale(1.3)}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star.active[_ngcontent-%COMP%]{fill:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] .fa-star[_ngcontent-%COMP%]:before{margin:0;font-size:1em;display:inline-block;color:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]{margin:0 auto 10px;border:hidden;overflow-x:hidden;overflow-y:visible;box-sizing:border-box;padding:10px;color:#1a1a1a;width:calc(100% - 40px);height:110px;resize:none;font-size:13px;border-radius:16px;background-color:#fafafa;text-align:left;font-weight:300}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-step-content[_ngcontent-%COMP%]{margin:10px 0 20px;position:relative}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-button-primary[_ngcontent-%COMP%]{font-size:1.4em;border:1px solid;margin:0 10px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-link[_ngcontent-%COMP%]{cursor:pointer;font-size:14px}#chat21-star-rating-widget[_ngcontent-%COMP%] a.c21-link[_ngcontent-%COMP%]:visited, #chat21-star-rating-widget[_ngcontent-%COMP%] a.c21-link[_ngcontent-%COMP%]:link{color:#2a6ac1}',".star.active[_ngcontent-%COMP%]{\n fill:#FFD700;\n}\nsvg.star[_ngcontent-%COMP%]{\n fill: #efefef;\n}\nsvg.star[_ngcontent-%COMP%]:hover{\n fill: #FFD700;\n}"]}),i}(),Ps=["aflauncherbutton"];function ks(i,o){if(1&i&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.conversationsBadge)}}var As=function(i){return{width:"100%",height:"100%",margin:"auto","border-radius":i}};function Is(i,o){if(1&i&&e._UZ(0,"img",11),2&i){var n=e.oxw(3);e.Q6J("src",n.g.baloonImage,e.LSH)("ngStyle",e.VKq(2,As,n.g.baloonShape))}}var Rs=function(i,o){return{fill:i,display:o}};function Ls(i,o){if(1&i&&(e.TgZ(0,"div",6),e.YNc(1,Is,1,4,"img",7),e.O4$(),e.TgZ(2,"svg",8),e._UZ(3,"path",9),e._UZ(4,"path",10),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.Q6J("@enterBubbleAnimation",void 0),e.xp6(1),e.Q6J("ngIf",""!==n.g.baloonImage),e.xp6(1),e.Q6J("ngStyle",e.WLB(3,Rs,n.g.themeForegroundColor,""===n.g.baloonImage?"":"none"))}}var Ns=function(i){return{fill:i}};function Fs(i,o){if(1&i&&(e.TgZ(0,"div",6),e.O4$(),e.TgZ(1,"svg",8),e._UZ(2,"path",9),e._UZ(3,"path",12),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.Q6J("@enterCloseAnimation",void 0),e.xp6(1),e.Q6J("ngStyle",e.VKq(2,Ns,n.g.themeForegroundColor))}}var Bs=function(i,o){return{"c21-align-left":i,"c21-align-right":o}},Us=function(i,o,n,t,r,a,u){return{"background-color":i,bottom:o,left:n,right:t,width:r,height:a,"border-radius":u}};function Zs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",1,2),e.NdJ("click",function(){return e.CHM(n),e.oxw().openCloseWidget()}),e.YNc(2,ks,2,1,"div",3),e.YNc(3,Ls,5,6,"div",4),e.YNc(4,Fs,4,4,"div",4),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("ngClass",e.WLB(5,Bs,"left"===t.g.align,"left"!==t.g.align))("ngStyle",e.Hh0(8,Us,t.g.baloonImage?null:t.g.themeColor,t.g.marginY+"px!important","left"===t.g.align?t.g.marginX+"px!important":"","right"===t.g.align?t.g.marginX+"px!important":"",t.g.launcherWidth,t.g.launcherHeight,t.g.baloonShape)),e.xp6(2),e.Q6J("ngIf",t.g.conversationsBadge>0),e.xp6(1),e.Q6J("ngIf",!t.g.isOpen),e.xp6(1),e.Q6J("ngIf",t.g.isOpen)}}var Ds=function(){function i(o,n){this.g=o,this.appStorageService=n,this.onButtonClicked=new e.vpe}return i.prototype.ngOnInit=function(){},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){!o.g.isOpen&&o.aflauncherbutton&&(o.aflauncherbutton.nativeElement.style["box-shadow"]="0px 4px 20px "+Ie(o.g.themeColor,50))},0)},i.prototype.openCloseWidget=function(){!0===this.g.isLogged&&this.onButtonClicked.emit(this.g.isOpen)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-launcher-button"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ps,5),2&n)&&(e.iGM(r=e.CRH())&&(t.aflauncherbutton=r.first))},outputs:{onButtonClicked:"onButtonClicked"},decls:1,vars:1,consts:[["aflauncherbutton","","id","c21-launcher-button","class","c21-button-clean scale-in-center","tabindex","1000","aria-label"," apri chat",3,"ngClass","ngStyle","click",4,"ngIf"],["aflauncherbutton","","id","c21-launcher-button","tabindex","1000","aria-label"," apri chat",1,"c21-button-clean","scale-in-center",3,"ngClass","ngStyle","click"],["aflauncherbutton",""],["class","c21-divBudge",4,"ngIf"],["class","launcher-button rotate-center",4,"ngIf"],[1,"c21-divBudge"],[1,"launcher-button","rotate-center"],[3,"src","ngStyle",4,"ngIf"],["role","img","xmlns","http://www.w3.org/2000/svg","width","100%","height","100%","viewBox","0 0 90 90",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M33.57,31A4.58,4.58,0,0,0,29,35.57V58.3a1.94,1.94,0,0,0,3.32,1.38l3-3a.29.29,0,0,1,.21-.09H56.43A4.58,4.58,0,0,0,61,52V35.57A4.58,4.58,0,0,0,56.43,31Z"],[3,"src","ngStyle"],["d","M54.92,37.08l-2-2L45,43l-7.92-7.92-2,2L43,45l-7.92,7.92,2,2L45,47l7.92,7.92,2-2L47,45Z",1,"cls-1"]],template:function(n,t){1&n&&e.YNc(0,Zs,5,16,"button",0),2&n&&e.Q6J("ngIf",1==t.g.isLogged&&0==t.g.isOpen)},directives:[me.O5,me.mk,me.PC],styles:["#c21-launcher-button[_ngcontent-%COMP%]{position:fixed;bottom:0px;cursor:pointer;display:block;margin:20px;z-index:1;box-shadow:rgba(0,18,46,.16) 0 0 16px}#c21-launcher-button[_ngcontent-%COMP%] .launcher-button[_ngcontent-%COMP%]{width:100%;height:100%;padding:0;margin:0;display:flex}.c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:0;width:16px;height:16px;min-width:12px;font-size:1.2em;line-height:16px;border-radius:50%;background-color:red;color:#fff;font-weight:bold;padding:5px;text-align:center;margin-top:-10px;display:inline-block}@media (max-width: 451px){#c21-launcher-button.c21-align-right[_ngcontent-%COMP%]{right:0}#c21-launcher-button.c21-align-left[_ngcontent-%COMP%]{left:0}}"],data:{animation:[(0,we.X$)("enterCloseAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"rotate(-90deg)",opacity:1}),(0,we.jt)("450ms ease-out",(0,we.oB)({transform:"rotate(0deg)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"scale(1)",opacity:1}),(0,we.jt)("200ms ease-in",(0,we.oB)({transform:"scale(0.5)",opacity:0}))])]),(0,we.X$)("enterBubbleAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"scale(0.5)",opacity:0}),(0,we.jt)("200ms ease-out",(0,we.oB)({transform:"scale(1)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"scale(1)",opacity:1}),(0,we.jt)("200ms ease-in",(0,we.oB)({transform:"scale(0.5)",opacity:0}))])])]}}),i}(),Hs=["afSelectionDepartment"];function zs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"li"),e.TgZ(1,"button",20),e.NdJ("click",function(){var y=e.CHM(n).$implicit;return e.oxw().onSelectDepartment(y)}),e.TgZ(2,"span",21),e._uU(3),e.qZA(),e.TgZ(4,"span",22),e._uU(5),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=o.$implicit,r=o.index;e.xp6(3),e.Oqu(r+1),e.xp6(2),e.Oqu(null==t?null:t.name)}}var js=function(i,o){return{color:i,"background-image":o}},qs=function(i){return{color:i}},Vs=function(){function i(o,n,t){this.elementRef=o,this.g=n,this.appStorageService=t,this.onDepartmentSelected=new e.vpe,this.onClose=new e.vpe,this.onOpen=new e.vpe,this.onBeforeDepartmentsFormRender=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.debug("[SELECT-DEP] ngOnInit"),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--backgroundColor",this.g.themeForegroundColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--textColor",this.g.themeColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--hoverBackgroundColor",this.g.themeColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--hoverTextColor",this.g.themeForegroundColor),this.g.departments&&this.g.departments.length>0&&(this.g.windowContext&&this.g.windowContext.tiledesk&&this.g.windowContext.tiledesk.beforeDepartmentsFormRender?(this.departments=this.g.departments,this.departments=this.g.windowContext.tiledesk.beforeDepartmentsFormRender(this.g.departments)):(this.departments=JSON.parse(JSON.stringify(this.g.departments)),this.triggerOnbeforeDepartmentsFormRender()))},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afSelectionDepartment&&o.afSelectionDepartment.nativeElement.focus()},1e3)},i.prototype.setDepartment=function(o){if(this.g.setParameter("departmentSelected",o),this.g.attributes){var n=this.g.attributes;this.g.setAttributeParameter("departmentId",o._id),this.g.setAttributeParameter("departmentName",o.name),this.appStorageService.setItem("attributes",JSON.stringify(n)),this.logger.debug("[SELECT-DEP] setDepartment: attributes",JSON.stringify(n))}},i.prototype.onSelectDepartment=function(o){this.logger.debug("[SELECT-DEP] onSelectDepartment: ",o),this.setDepartment(o),this.onDepartmentSelected.emit(o)},i.prototype.openPage=function(){this.logger.debug("[SELECT-DEP] openPage "),this.onOpen.emit()},i.prototype.closePage=function(){this.logger.debug("[SELECT-DEP] closePage"),this.onClose.emit()},i.prototype.cancelPage=function(){this.logger.debug("[SELECT-DEP] cancelPage"),this.g.newConversationStart=!1,this.onClose.emit()},i.prototype.triggerOnbeforeDepartmentsFormRender=function(){this.onBeforeDepartmentsFormRender.emit(this.departments)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq),e.Y36(Re),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-selection-department"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Hs,5),2&n)&&(e.iGM(r=e.CRH())&&(t.afSelectionDepartment=r.first))},outputs:{onDepartmentSelected:"onDepartmentSelected",onClose:"onClose",onOpen:"onOpen",onBeforeDepartmentsFormRender:"onBeforeDepartmentsFormRender"},decls:21,vars:9,consts:[["id","chat21-selection-department","tabindex","1200","aria-modal","true","onFocus","document.querySelector('[start-focus-chat21-selection-department]').focus()"],["afSelectionDepartment",""],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-button"],["role","button",1,"c21-close-button","c21-small"],["tabindex","1210","aria-label"," chiudi pannello",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"c21-header-content"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-header"],["start-focus-chat21-selection-department","","tabindex","1201",1,"c21-message-field"],["tabindex","211","onFocus","document.querySelector('[start-focus]').focus()",1,"c21-body-content"],[1,"chat21-content-modal-select"],[4,"ngFor","ngForOf"],["tabindex","1299","onFocus","document.querySelector('[start-focus-chat21-selection-department]').focus()",2,"height","0px"],["tabindex","1202",1,"c21-button-department","c21-button-clean",3,"click"],[1,"chat21-badge"],[1,"chat21-name-list"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.closePage()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"div",10),e._UZ(11,"div",11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",12),e.TgZ(13,"div",13),e.TgZ(14,"div",14),e.TgZ(15,"div",15),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",16),e.TgZ(18,"ul",17),e.YNc(19,zs,6,2,"li",18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e._UZ(20,"span",19),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(4,js,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(9),e.Q6J("ngStyle",e.VKq(7,qs,t.g.themeForegroundColor)),e.xp6(5),e.Oqu(t.g.LABEL_SELECT_TOPIC),e.xp6(3),e.Q6J("ngForOf",t.departments))},directives:[me.PC,me.sg],styles:["#chat21-selection-department[_ngcontent-%COMP%]{--backgroundColor: #f7f7f7;--textColor: #2a6ac1;--hoverBackgroundColor: #2a6ac1;--hoverTextColor: #f7f7f7;background-color:#fff;width:100%;height:100%}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:100%;margin:0 auto}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{width:100%;height:auto;padding:0 40px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{display:inline-block;width:100%;height:auto;padding:0;text-align:center;font-size:1.8em;line-height:normal}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding-left:16px;padding-right:16px;grid-gap:10px;gap:10px}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{position:relative;top:0;bottom:0;left:0;right:0;padding:20px 30px 0}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#aaa;font-size:1.6em;text-align:center;word-wrap:break-word}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:0 0 40px;position:relative;width:100%}.chat21-content-modal-select[_ngcontent-%COMP%]{margin:0 0 2em;list-style-type:none;padding:0;height:auto;overflow-y:auto;display:flex;flex-direction:column;grid-gap:12px;gap:12px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{cursor:pointer;position:relative;margin:0;padding:20px 16px;font-size:1.4em;text-align:left;color:var(--textColor);border:1px solid var(--textColor);line-height:normal;display:block;border-radius:10px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] .c21-button-department[_ngcontent-%COMP%]{width:100%;text-align:left;display:flex;grid-gap:12px;gap:12px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover{background-color:var(--hoverBackgroundColor);border-radius:10px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover .chat21-name-list[_ngcontent-%COMP%]{color:var(--hoverTextColor)}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover .chat21-badge[_ngcontent-%COMP%]{color:var(--hoverBackgroundColor);background-color:var(--hoverTextColor)}.chat21-content-modal-select[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{position:relative}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-badge[_ngcontent-%COMP%]{box-sizing:content-box;box-sizing:initial;display:flex;justify-content:center;align-items:center;font-size:12px;padding:0;line-height:24px;height:24px;width:24px;border-radius:50%;margin:0 10px 0 0;text-align:center;font-weight:500;color:var(--backgroundColor);background-color:var(--textColor)}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-name-list[_ngcontent-%COMP%]{font-size:18px;font-weight:500;line-height:24px;color:#7d87a4}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-title[_ngcontent-%COMP%]{margin-left:10px;font-weight:normal;font-weight:initial;line-height:normal}"]}),i}(),Ws=ye(26136),It=ye(60680),Gs=function(i){function o(n){var t=i.call(this)||this;return t.logger=n,t.logLevel=le.ERROR,t.isLogEnabled=!0,t}return(0,_e.ZT)(o,i),o.prototype.setLoggerConfig=function(n,t){this.isLogEnabled=n,"string"==typeof t?this.logLevel=le[t.toUpperCase()]:console.error("logLevel is not a string. See the chat21-ionic README.md")},o.prototype.error=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.ERROR&&(t=this.logger).error.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.warn=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.WARN&&(t=this.logger).warn.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.info=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.INFO&&(t=this.logger).info.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.debug=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.DEBUG&&(t=this.logger).debug.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.log=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.DEBUG&&(t=this.logger).log.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.\u0275fac=function(t){return new(t||o)(e.LFG(It.Kf))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}()),rn=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Me=ye(41858),Qn=function(){function i(){}return i.initFirebase=function(o){if(!i.firebaseInit){if(!o||"CHANGEIT"===o.apiKey)throw new Error("Firebase config is not defined. Please create your widget-config.json. See the Chat21-Web_widget Installation Page");i.firebaseInit=Me.Z.initializeApp(o)}return i.firebaseInit},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Js=(ye(8995),ye(73993),ye(77420),function(i){function o(n){var t=i.call(this)||this;return t.http=n,t.BSAuthStateChanged=new he.X(null),t.BSSignOut=new he.X(null),t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.SERVER_BASE_URL=this.getBaseUrl(),this.URL_TILEDESK_CREATE_CUSTOM_TOKEN=this.SERVER_BASE_URL+"chat21/firebase/auth/createCustomToken",this.logger.debug("[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ",this.URL_TILEDESK_CREATE_CUSTOM_TOKEN),this.onAuthStateChanged()},o.prototype.getToken=function(){return this.firebaseToken},o.prototype.onAuthStateChanged=function(){var n=this,t=this;Me.Z.auth().onAuthStateChanged(function(r){n.logger.debug("[FIREBASEAuthSERVICE] onAuthStateChanged",r),r?(n.logger.debug("[FIREBASEAuthSERVICE] 2 - PUBLISH ONLINE to chat-manager"),t.BSAuthStateChanged.next("online")):(n.logger.debug("[FIREBASEAuthSERVICE] 1 - PUBLISH OFFLINE to chat-manager"),t.BSAuthStateChanged.next("offline"))})},o.prototype.signInFirebaseWithCustomToken=function(n){var a,t=this,r=this;switch(this.getPersistence()){case"SESSION":a=Me.Z.auth.Auth.Persistence.SESSION;break;case"LOCAL":a=Me.Z.auth.Auth.Persistence.LOCAL;break;case"NONE":default:a=Me.Z.auth.Auth.Persistence.NONE}return Me.Z.auth().setPersistence(a).then(function(){return(0,_e.mG)(t,void 0,void 0,function(){var u=this;return(0,_e.Jh)(this,function(y){return[2,Me.Z.auth().signInWithCustomToken(n).then(function(){return(0,_e.mG)(u,void 0,void 0,function(){return(0,_e.Jh)(this,function(j){return[2]})})}).catch(function(j){r.logger.error("[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ",j)})]})})}).catch(function(u){r.logger.error("[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ",u)})},o.prototype.createUserWithEmailAndPassword=function(n,t){var r=this;return Me.Z.auth().createUserWithEmailAndPassword(n,t).then(function(a){return r.logger.debug("[FIREBASEAuthSERVICE] CRATE USER WITH EMAIL: ",n," & PSW: ",t),a}).catch(function(a){return r.logger.error("[FIREBASEAuthSERVICE] createUserWithEmailAndPassword error: ",a.message),a})},o.prototype.sendPasswordResetEmail=function(n){var t=this;return Me.Z.auth().sendPasswordResetEmail(n).then(function(){t.logger.debug("[FIREBASEAuthSERVICE] firebase-send-password-reset-email")}).catch(function(r){t.logger.error("[FIREBASEAuthSERVICE] sendPasswordResetEmail error: ",r)})},o.prototype.signOut=function(){var n=this;return new Promise(function(t,r){Me.Z.auth().signOut().then(function(){n.logger.debug("[FIREBASEAuthSERVICE] firebase-sign-out"),n.BSSignOut.next(!0),t(!0)}).catch(function(a){t(!1),n.logger.error("[FIREBASEAuthSERVICE] signOut error: ",a)})})},o.prototype.delete=function(){var n=this;Me.Z.auth().currentUser.delete().then(function(){n.logger.debug("[FIREBASEAuthSERVICE] firebase-current-user-delete")}).catch(function(t){n.logger.error("[FIREBASEAuthSERVICE] delete error: ",t)})},o.prototype.createCustomToken=function(n){var t=new Se.WM({"Content-type":"application/json",Authorization:n}),u=this;this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN,{},{headers:t,responseType:"text"}).subscribe(function(y){u.firebaseToken=y,u.signInFirebaseWithCustomToken(y)},function(y){u.logger.error("[FIREBASEAuthSERVICE] createFirebaseCustomToken ERR ",y)})},o.prototype.logout=function(){return this.logger.debug("[FIREBASEAuthSERVICE] logout"),this.signOut()},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(St)),Qs=function(i){function o(n,t){var r=i.call(this)||this;return r.http=n,r.appConfig=t,r.BSConversationDetail=new he.X(null),r.conversationAdded=new he.X(null),r.conversationChanged=new he.X(null),r.conversationChangedDetailed=new he.X(null),r.conversationRemoved=new he.X(null),r.conversations=[],r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.conversations=[],this.isConversationClosingMap=new Map,this.BASE_URL=this.appConfig.getConfig().firebaseConfig.chat21ApiUrl,this.BASE_URL_DATABASE=this.appConfig.getConfig().firebaseConfig.databaseURL},o.prototype.subscribeToConversations=function(n){var t=this,r=Mt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEConversationsHandlerSERVICE] SubscribeToConversations conversations::ACTIVE urlNodeFirebase",r),this.ref=Me.Z.database().ref(r).orderByChild("timestamp").limitToLast(200),this.ref.on("child_changed",function(a){t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)}),this.ref.on("child_added",function(a){t.added(a)}),setTimeout(function(){n()},2e3)},o.prototype.getLastConversation=function(n){var t=this;this.getFirebaseToken(function(r,a){if(t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi idToken",a),t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi error",r),a){var u={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json"})},y=Mt(t.tenant,t.loggedUserId);t.http.get(t.BASE_URL_DATABASE+y+".json?auth="+a+'&orderBy="timestamp"&limitToLast=1',u).subscribe(function(ie){if(t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi - RES",ie),ie){var ue=ie[Object.keys(ie)[0]];ue.uid=Object.keys(ie)[0];var ge=t.completeConversation(ue);n(ge,null)}else ie||n(null,null)},function(ie){t.logger.error("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi ERROR ",ie),n(null,"error")},function(){t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi * COMPLETE *")})}else n(null,"error")})},o.prototype.countIsNew=function(){var n=0;return this.conversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.setConversationRead=function(n){var t=Mt(this.tenant,this.loggedUserId)+"/"+n;Me.Z.database().ref(t).update({"/is_new":!1})},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){var t=this;this.setClosingConversation(n,!0);var r=Ue(this.conversations,n);this.deleteConversation(n,function(a){t.logger.debug("[FIREBASEConversationsHandlerSERVICE] ARCHIVE-CONV",a),"success"===a?r>-1&&t.conversations.splice(r,1):"error"===a&&t.setClosingConversation(n,!1)})},o.prototype.deleteConversation=function(n,t){var r=this;this.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV conversationId",n),this.getFirebaseToken(function(a,u){if(r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV idToken",u),r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV error",a),u){var y={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+u})};r.http.delete(r.BASE_URL+"/api/"+r.tenant+"/conversations/"+n,y).subscribe(function(J){r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV - RES",J),t("success")},function(J){r.logger.error("[FIREBASEConversationsHandlerSERVICE] DELETE CONV ERROR ",J),t("error")},function(){r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV * COMPLETE *")})}else t("error")})},o.prototype.getFirebaseToken=function(n){var t=Me.Z.auth().currentUser;this.logger.debug(" // firebase current user ",t),t&&t.getIdToken(!0).then(function(r){n(null,r)}).catch(function(r){n(r,null)})},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.conversations.find(function(j){return j.uid===n});if(this.logger.debug("[FIREBASEConversationsHandlerSERVICE] conversations *****: ",this.conversations),this.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationDetail *****: ",a),a)t(a);else{var u=Mt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEConversationsHandlerSERVICE] conversationDetail urlNodeFirebase *****",u);var y=Me.Z.database().ref(u);this.subscribe=y.on("value",function(j){var J=j.child("/"+n);if(J.exists()){var ie=J.val();if(r.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationDetail conversation exist",J.val(),J.key),J&&J.key&&ie){ie.uid=J.key;var ue=r.completeConversation(ie);t(ue||null)}}else r.logger.log("[FIREBASEConversationsHandlerSERVICE] getConversationDetail conversation NOT exist",n),t(null)})}},o.prototype.dispose=function(){this.conversations=[],this.uidConvSelected="",this.logger.debug("[FIREBASEConversationsHandlerSERVICE] DISPOSE::: ",this.ref)},o.prototype.conversationGenerate=function(n){var t=n.val();t.uid=n.key;var r=this.completeConversation(t);if(this.isValidConversation(r)){this.setClosingConversation(n.key,!1);var a=Ue(this.conversations,r.uid);return a>-1?this.conversations.splice(a,1,r):this.conversations.splice(0,0,r),this.conversations.sort(at("timestamp","desc")),!0}return!1},o.prototype.added=function(n){if(this.conversationGenerate(n)){var t=Ue(this.conversations,n.key);t>-1&&this.conversationAdded.next(this.conversations[t])}else this.logger.error("[FIREBASEConversationsHandlerSERVICE]ADDED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.changed=function(n){var t=this.conversations[Ue(this.conversations,n.key)];if(this.conversationGenerate(n)){var r=Ue(this.conversations,n.key);if(r>-1){var a=this.conversations[r];this.conversationChanged.next(a),this.conversationChangedDetailed.next({value:a,previousValue:t})}}else this.logger.error("[FIREBASEConversationsHandlerSERVICE]CHANGED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.conversations,n.key);if(t>-1){var r=this.conversations[t];this.conversations.splice(t,1),this.conversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.completeConversation=function(n){this.logger.debug("[FIREBASEConversationsHandlerSERVICE] completeConversation --\x3e conv from firebase",n),n.selected=!1,(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return n.sender===this.loggedUserId?(r=n.recipient,t=n.recipient_fullname,n.sender_fullname=this.translationMap.get("YOU")):Cn(n)&&(r=n.recipient,t=n.recipient_fullname),n.conversation_with=r,n.conversation_with_fullname=t,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n,10)/1e3)},o.prototype.isValidConversation=function(n){return!!(this.isValidField(n.uid)&&this.isValidField(n.is_new)&&this.isValidField(n.last_message_text)&&this.isValidField(n.recipient)&&this.isValidField(n.recipient_fullname)&&this.isValidField(n.sender)&&this.isValidField(n.sender_fullname)&&this.isValidField(n.status)&&this.isValidField(n.timestamp)&&this.isValidField(n.channel_type))},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(Fe))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(mt),Ks=function(i){function o(){var n=i.call(this)||this;return n.archivedConversationAdded=new he.X(null),n.archivedConversationChanged=new he.X(null),n.archivedConversationRemoved=new he.X(null),n.archivedConversations=[],n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.archivedConversations=[],this.isConversationClosingMap=new Map},o.prototype.subscribeToConversations=function(n){var t=this,r=Zt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations conversations::ARCHIVED urlNodeFirebase",r),this.ref=Me.Z.database().ref(r).orderByChild("timestamp").limitToLast(200),this.ref.on("child_changed",function(a){t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)}),this.ref.on("child_added",function(a){t.added(a)}),setTimeout(function(){n()},2e3)},o.prototype.countIsNew=function(){var n=0;return this.archivedConversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.setConversationRead=function(n){var t=Zt(this.tenant,this.loggedUserId)+"/"+n;Me.Z.database().ref(t).update({"/is_new":!1})},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.archivedConversations.find(function(j){return j.uid===n});if(this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations getConversationDetail::ARCHIVED *****: ",a),a)t(a);else{var u=Zt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] urlNodeFirebase conversationDetail *****",u,n);var y=Me.Z.database().ref(u);this.subscribe=y.on("value",function(j){var J=j.child("/"+n);if(J.exists()){var ie=J.val();if(r.logger.log("[FIREBASEArchivedConversationsHandlerSERVICE] getConversationDetail archived conversation exist",ie),J&&J.key&&ie){ie.uid=J.key;var ue=r.completeConversation(ie);t(ue||null)}}else r.logger.log("[FIREBASEArchivedConversationsHandlerSERVICE] getConversationDetail archived conversation NOT exist",n),t(null)})}},o.prototype.dispose=function(){this.archivedConversations=[],this.uidConvSelected="",this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] DISPOSE::: ",this.ref)},o.prototype.conversationGenerate=function(n){var t=n.val();t.uid=n.key;var r=this.completeConversation(t);if(this.isValidConversation(r)){this.setClosingConversation(n.key,!1);var a=Ue(this.archivedConversations,r.uid);return a>-1?this.archivedConversations.splice(a,1,r):this.archivedConversations.splice(0,0,r),this.archivedConversations.sort(at("timestamp","desc")),!0}return!1},o.prototype.added=function(n){if(this.conversationGenerate(n)){var t=Ue(this.archivedConversations,n.key);t>-1&&this.archivedConversationAdded.next(this.archivedConversations[t])}else this.logger.error("[FIREBASEArchivedConversationsHandlerSERVICE] ADDED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.changed=function(n){if(this.conversationGenerate(n)){var t=Ue(this.archivedConversations,n.key);t>-1&&this.archivedConversationChanged.next(this.archivedConversations[t])}else this.logger.error("[FIREBASEArchivedConversationsHandlerSERVICE] CHANGED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.archivedConversations,n.key);if(t>-1){var r=this.archivedConversations[t];this.archivedConversations.splice(t,1),this.archivedConversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.completeConversation=function(n){n.selected=!1,(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return n.sender===this.loggedUserId?(r=n.recipient,t=n.recipient_fullname,n.sender_fullname=this.translationMap.get("YOU")):Cn(n)&&(r=n.recipient,t=n.recipient_fullname),n.conversation_with=r,n.conversation_with_fullname=t,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.archived=!0,n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n,10)/1e3)},o.prototype.isValidConversation=function(n){return!!(this.isValidField(n.uid)&&this.isValidField(n.is_new)&&this.isValidField(n.last_message_text)&&this.isValidField(n.recipient)&&this.isValidField(n.recipient_fullname)&&this.isValidField(n.sender)&&this.isValidField(n.sender_fullname)&&this.isValidField(n.status)&&this.isValidField(n.timestamp)&&this.isValidField(n.channel_type))},o.prototype.isValidField=function(n){return null!=n},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(vt),Kn=(ye(95132),function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te){this.uid=o,this.language=n,this.recipient=t,this.recipient_fullname=r,this.sender=a,this.sender_fullname=u,this.status=y,this.metadata=j,this.text=J,this.timestamp=ie,this.type=ue,this.attributes=ge,this.channel_type=de,this.isSender=ve,this.emoticon=Te}}()),Xn=function(i){function o(n){var t=i.call(this)||this;return t.skipInfoMessage=n,t.messageAdded=new he.X(null),t.messageChanged=new he.X(null),t.messageRemoved=new he.X(null),t.messageWait=new he.X(null),t.messageInfo=new he.X(null),t.startTime=new Date,t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r,a,u,y){this.logger.debug("[FIREBASEConversationHandlerSERVICE] initWithRecipient",n,t,r,a,u),this.recipientId=n,this.recipientFullname=t,this.loggedUser=r,r&&(this.senderId=r.uid),this.tenant=a,this.translationMap=u,this.listSubsriptions=[],this.CLIENT_BROWSER=navigator.userAgent,this.conversationWith=n,this.messages=[],this.showInfoMessage=y},o.prototype.connect=function(){var n=this,t=this;this.urlNodeFirebase=function(i,o){return"/apps/"+i+"/users/"+o+"/messages/"}(this.tenant,this.loggedUser.uid),this.urlNodeFirebase=this.urlNodeFirebase+this.conversationWith,this.logger.debug("[FIREBASEConversationHandlerSERVICE] urlNodeFirebase *****",this.urlNodeFirebase);var r=Me.Z.database().ref(this.urlNodeFirebase);this.ref=r.orderByChild("timestamp").limitToLast(100),this.ref.on("child_added",function(a){t.logger.debug("[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_added: ",a.val());var u=a.val();u.uid=a.key,u.attributes&&u.attributes.commands?(n.logger.debug("[FIREBASEConversationHandlerSERVICE] splitted message::::",u),t.addCommandMessage(u)):(n.logger.debug("[FIREBASEConversationHandlerSERVICE] NOT splitted message::::",u),t.addedNew(u))}),this.ref.on("child_changed",function(a){t.logger.debug("[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_changed: ",a.val()),t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)})},o.prototype.sendMessage=function(n,t,r,a,u,y,j,J,ie){(!J||"undefined"===J)&&(J=W);var ge=Me.Z.database().ref(this.urlNodeFirebase),de=document.documentElement.lang,ve=u,ke=new Kn("",de,a,ve,y,j,0,r,n,Me.Z.database.ServerValue.TIMESTAMP,t,ie,J,!0);return ge.push({language:de,recipient:a,recipient_fullname:ve,sender:y,sender_fullname:j,status:0,metadata:r,text:n,timestamp:Me.Z.database.ServerValue.TIMESTAMP,type:t,attributes:ie,channel_type:J}),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e messages: ",this.messages),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e senderFullname: ",j),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e sender: ",y),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e SEND MESSAGE: ",n,J),ke},o.prototype.dispose=function(){},o.prototype.added=function(n){var t=this.messageGenerate(n);Xe(N,t)||(this.addRepalceMessageInArray(n.key,t),this.messageAdded.next(t))},o.prototype.addedNew=function(n){var t=this.messageCommandGenerate(n);if(this.isValidMessage(t)){var r=Xe(N,t);if(r&&this.messageInfo.next(t),r&&Et(t,this.showInfoMessage))return;if(r&&!Et(t,this.showInfoMessage)&&!Mn(t,this.loggedUser))return;this.addRepalceMessageInArray(t.uid,t),this.messageAdded.next(t)}else this.logger.error("[FIREBASEConversationHandlerSERVICE] ADDED::message with uid: ",t.uid,"is not valid")},o.prototype.changed=function(n){var t=this.messageGenerate(n);if(this.isValidMessage(t)){if(Xe(N,t)||t.attributes&&t.attributes.commands)return;this.addRepalceMessageInArray(n.key,t),this.messageChanged.next(t)}else this.logger.error("[FIREBASEConversationHandlerSERVICE] CHANGED::message with uid: ",t.uid,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.messages,n.key);t>-1&&(this.messages.splice(t,1),this.messageRemoved.next(n.key))},o.prototype.messageGenerate=function(n){var t=n.val();return t.uid=n.key,t.text=t.text.trim(),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.messageCommandGenerate=function(n){var t=n;return t.text&&(t.text=t.text.trim()),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.addRepalceMessageInArray=function(n,t){var r=Ue(this.messages,n);r>-1?this.messages.splice(r,1,t):this.messages.splice(0,0,t),this.messages.sort(at("timestamp","asc")),this.setStatusMessage(t,this.conversationWith)},o.prototype.translateInfoSupportMessages=function(n){var t=this.translationMap.get("INFO_SUPPORT_USER_ADDED_SUBJECT"),r=this.translationMap.get("INFO_SUPPORT_USER_ADDED_YOU_VERB"),a=this.translationMap.get("INFO_SUPPORT_USER_ADDED_COMPLEMENT"),u=this.translationMap.get("INFO_SUPPORT_USER_ADDED_VERB"),y=this.translationMap.get("INFO_SUPPORT_CHAT_REOPENED"),j=this.translationMap.get("INFO_SUPPORT_CHAT_CLOSED"),J=this.translationMap.get("INFO_SUPPORT_LEAD_UPDATED"),ie=this.translationMap.get("INFO_SUPPORT_MEMBER_LEFT_GROUP"),ue=this.translationMap.get("INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU");if(n.attributes.messagelabel&&n.attributes.messagelabel.parameters&&n.attributes.messagelabel.key===H){var ge=void 0,de=void 0,ve=void 0;n.attributes.messagelabel.parameters.member_id===this.loggedUser.uid?(ge=t,de=r,ve=a):n.attributes.messagelabel.parameters.fullname?(ge=n.attributes.messagelabel.parameters.fullname,de=u,ve=a):(ge=n.attributes.messagelabel.parameters.member_id,de=u,ve=a),n.text=ge+" "+de+" "+ve}else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===x)n.text=y;else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===D)n.text=j;else if(n.attributes&&n.attributes.messagelabel&&n.attributes.messagelabel.key===l&&"system"===n.sender){var Te=n.text.split(":")[1];void 0!==Te&&(n.text=ue+": "+Te)}else n.attributes.messagelabel&&n.attributes.messagelabel.key===te?n.text=J:n.attributes.messagelabel&&n.attributes.messagelabel.key===ee&&(ge=void 0,n.text=(ge=n.attributes.messagelabel.parameters.fullname?n.attributes.messagelabel.parameters.fullname:n.attributes.messagelabel.parameters.member_id)+" "+ie)},o.prototype.setStatusMessage=function(n,t){if(this.logger.debug("[FIREBASEConversationHandlerSERVICE] update statusss",n),n.status<_){var r=n.uid;if(n.attributes.commands&&(r=n.attributes.parentUid),n.sender!==this.loggedUser.uid&&n.status<_){var a=this.urlNodeFirebase+"/"+r;this.logger.debug("[FIREBASEConversationHandlerSERVICE] update message status",a),Me.Z.database().ref(a).update({status:_})}}},o.prototype.isSender=function(n,t){return!!t&&n===t},o.prototype.unsubscribe=function(n){var t=this;this.listSubsriptions.forEach(function(r){if(t.logger.debug("[FIREBASEConversationHandlerSERVICE] unsubscribe: ",r.uid,n),r.uid===n)return t.logger.debug("[FIREBASEConversationHandlerSERVICE] unsubscribe: ",r.uid,n),void r.unsubscribe(n,null)})},o.prototype.addCommandMessage=function(n){var t=this,r=n.attributes.commands,a=0;!function u(y){if("message"===y.type){if(t.logger.debug('[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e type="message"',y,a),a>=2){if(r[a-1].time||(r[a-1].time=1e3),y.message.timestamp=r[a-2].message.timestamp+r[a-1].time,!Wt(t.startTime.getTime(),n.timestamp)){var j=n.timestamp;r[a-2]&&(j=r[a-2].message.timestamp),y.message.timestamp=j+100,r[a+1]&&(r[a+1].time=0)}}else y.message.timestamp=n.timestamp,Wt(t.startTime.getTime(),n.timestamp)||r[a+1]&&(r[a+1].time=0);t.generateMessageObject(n,y.message,function(){(a+=1)<r.length?u(r[a]):t.logger.debug("[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e last command executed (wait), exit")})}else"wait"===y.type&&(t.logger.debug('[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e type="wait"',y,a,r.length),Wt(t.startTime.getTime(),n.timestamp)&&t.messageWait.next({uid:t.conversationWith,uidUserTypingNow:n.sender,nameUserTypingNow:n.sender_fullname,waitTime:y.time,command:y}),setTimeout(function(){(a+=1)<r.length?u(r[a]):t.logger.debug("[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e last command executed (send message), exit")},y.time))}(r[0])},o.prototype.generateMessageObject=function(n,t,r){var a=n.uid;t.uid=(0,Ne.Z)(),t.text&&(t.text=t.text.trim()),t.language=n.language,t.recipient=n.recipient,t.recipient_fullname=n.recipient_fullname,t.sender=n.sender,t.sender_fullname=n.sender_fullname,t.channel_type=n.channel_type,t.status=n.status,t.isSender=n.isSender,t.attributes?t.attributes.commands=!0:t.attributes={commands:!0},t.attributes.parentUid=a,this.addedNew(t),r()},o.prototype.isValidMessage=function(n){return!0},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG("skipMessage"))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(rn),Xs=function(i){function o(){return i.call(this)||this}return(0,_e.ZT)(o,i),o.prototype.build=function(){return new Xn(!1)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Ct),$s=function(){return function(o,n,t,r){this.uid=o,this.timestamp=n,this.message=t,this.name=r}}(),el=function(i){function o(){var n=i.call(this)||this;return n.BSIsTyping=new he.X(null),n.BSSetTyping=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[FIREBASETypingSERVICE] initialize - tenant ",this.tenant),this.urlNodeTypings="/apps/"+this.tenant+"/typings/"},o.prototype.isTyping=function(n,t,r){var a=this,y=this.urlNodeTypings+n;r&&(y=this.urlNodeTypings+t+"/"+n),this.logger.debug("[FIREBASETypingSERVICE] urlTyping: ",y),this.ref=Me.Z.database().ref(y),this.ref.on("child_changed",function(j){var J=j.val();a.logger.debug("[FIREBASETypingSERVICE] child_changed: ",J),a.BSIsTyping.next({uid:n,uidUserTypingNow:J.uid,nameUserTypingNow:J.name,waitTime:2e3})})},o.prototype.setTyping=function(n,t,r,a){var u=this;clearTimeout(this.setTimeoutWritingMessages),this.setTimeoutWritingMessages=setTimeout(function(){var j=u.urlNodeTypings+n+"/"+r;u.logger.debug("[FIREBASETypingSERVICE] setWritingMessages:",j,a);var ie=new $s(r,Me.Z.database.ServerValue.TIMESTAMP,t,a);Me.Z.database().ref(j).set(ie,function(ue){ue?u.logger.error("[FIREBASETypingSERVICE] setTyping error",ue):u.BSSetTyping.next({uid:n,typing:ie})})},500)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(ht),tl=function(i){function o(){var n=i.call(this)||this;return n.BSIsOnline=new he.X(null),n.BSLastOnline=new he.X(null),n.logger=Ce.getInstance(),n.online_member=[],n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[FIREBASEPresenceSERVICE] initialize this.tenant",this.tenant),this.urlNodePresence="/apps/"+this.tenant+"/presence/"},o.prototype.userIsOnline=function(n){var t=this,r=new he.X(null),a=this.urlNodePresence+n+"/connections";this.logger.debug("[FIREBASEPresenceSERVICE] userIsOnline: ",a);var u=Me.Z.database().ref().child(a);return u.off(),u.on("value",function(y){t.logger.debug("[FIREBASEPresenceSERVICE] CONVERSATION-DETAIL group detail userIsOnline id user",n,"- child.val: ",y.val()),y.val()?(t.BSIsOnline.next({uid:n,isOnline:!0}),r.next({uid:n,isOnline:!0})):(t.BSIsOnline.next({uid:n,isOnline:!1}),r.next({uid:n,isOnline:!1}))}),r},o.prototype.lastOnlineForUser=function(n){var t=this;this.logger.debug("[FIREBASEPresenceSERVICE] lastOnlineForUser",n),this.referenceLastOnlineForUser(n).on("value",function(u){u.val()?t.BSLastOnline.next({uid:n,lastOnline:u.val()}):t.BSLastOnline.next({uid:n,lastOnline:null})})},o.prototype.setPresence=function(n){var t=this;this.onlineConnectionsRef=this.referenceOnlineForUser(n),this.lastOnlineConnectionsRef=this.referenceLastOnlineForUser(n),Me.Z.database().ref("/.info/connected").on("value",function(u){if(t.logger.debug("[FIREBASEPresenceSERVICE] self.deviceConnectionRef: ",u.val()),u.val())if(t.onlineConnectionsRef){t.keyConnectionRef=t.onlineConnectionsRef.push(!0),t.keyConnectionRef.onDisconnect().remove();var j=(new Date).valueOf();t.lastOnlineConnectionsRef.onDisconnect().set(j)}else t.logger.error("[FIREBASEPresenceSERVICE] setPresence --\x3e This is an error. self.deviceConnectionRef already set. Cannot be set again.")})},o.prototype.removePresence=function(){if(this.onlineConnectionsRef){var t=(new Date).valueOf();this.lastOnlineConnectionsRef.set(t),this.onlineConnectionsRef.off(),this.onlineConnectionsRef.remove(),this.logger.debug("[FIREBASEPresenceSERVICE] goOffline onlineConnectionsRef",this.onlineConnectionsRef)}},o.prototype.referenceLastOnlineForUser=function(n){var t=this.urlNodePresence+n+"/lastOnline";return Me.Z.database().ref().child(t)},o.prototype.referenceOnlineForUser=function(n){var t=this.urlNodePresence+n+"/connections";return Me.Z.database().ref().child(t)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Pt),nl=function(i){function o(n){var t=i.call(this)||this;return t.http=n,t.urlStorageBucket=ce.firebaseConfig.storageBucket+"/o/profiles%2F",t}return(0,_e.ZT)(o,i),o.prototype.getImagePhotoUrl=function(n){this.baseImageURL=this.getImageBaseUrl();var a="/o/profiles%2F"+(n&&n.includes("bot_")?n.slice(4):n)+"%2Fthumb_photo.jpg?alt=media";return this.baseImageURL+Me.Z.storage().ref().bucket+a},o.prototype.checkImageExists=function(n,t){console.log("urllll",n),this.http.get(n,{responseType:"blob"}).subscribe(function(r){t(!0)},function(r){console.log("ressssssss errorr",r),t(!1)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(st),ol=function(i){function o(){var n=i.call(this)||this;return n.BSStateUpload=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.logger.debug("[FIREBASEUploadSERVICE] initialize")},o.prototype.upload=function(n,t){var r=this,u="/public/images/"+n+"/"+this.createGuid()+"/"+t.file.name;this.logger.debug("[FIREBASEUploadSERVICE] pushUpload ",u,t.file);var y=Me.Z.storage().ref();this.logger.debug("[FIREBASEUploadSERVICE] storageRef",y);var j=y.child(u);this.logger.debug("[FIREBASEUploadSERVICE] mountainsRef ",j);var ie=j.put(t.file,{name:t.file.name,contentType:t.file.type,contentDisposition:"attachment; filename="+t.file.name});return new Promise(function(ue,ge){ie.on("state_changed",function(ve){var Te=ve.bytesTransferred/ve.totalBytes*100;switch(r.logger.debug("[FIREBASEUploadSERVICE] Upload is "+Te+"% done"),r.BSStateUpload.next({upload:Te,type:t.file.type}),ve.state){case Me.Z.storage.TaskState.PAUSED:r.logger.debug("[FIREBASEUploadSERVICE] Upload is paused");break;case Me.Z.storage.TaskState.RUNNING:r.logger.debug("[FIREBASEUploadSERVICE] Upload is running")}},function(de){ge(de)},function(){r.logger.debug("[FIREBASEUploadSERVICE] Upload is complete",t),ue(ie.snapshot.ref.getDownloadURL())})})},o.prototype.createGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(pt),il=ye(75134),rl=ye(47289),al=ye(23268),an="/clientadded",Rt="/clientupdated",$n="/clientdeleted",eo="onMessageUpdatedForConversation",to="onMessageAddedForConversation",sl=function(){function i(o){if((0,il.Z)(this,i),this.client=null,this.reconnections=0,this.client_id=this.uuidv4(),this.log=!!o.log,o&&o.MQTTendpoint)if(o.MQTTendpoint.startsWith("/")){var t;this.log&&console.log("MQTTendpoint relative url"),t="mqtt:",t+="//"+window.location.host,this.endpoint=t+=o.MQTTendpoint}else this.endpoint=o.MQTTendpoint;else this.endpoint="ws://34.253.207.0:15675/ws";this.APIendpoint=o.APIendpoint,this.appid=o.appId,this.log&&console.log("final endpoint:",this.endpoint),this.user_id=null,this.jwt=null,this.last_handler=0,this.onConversationAddedCallbacks=new Map,this.onConversationUpdatedCallbacks=new Map,this.onConversationDeletedCallbacks=new Map,this.onArchivedConversationAddedCallbacks=new Map,this.onArchivedConversationDeletedCallbacks=new Map,this.onMessageAddedCallbacks=new Map,this.onMessageUpdatedCallbacks=new Map,this.onGroupUpdatedCallbacks=new Map,this.callbackHandlers=new Map,this.on_message_handler=null,this.topic_inbox=null,this.connected=!1}return(0,rl.Z)(i,[{key:"subscribeToMyConversations",value:function(n){var t=this;this.topic_inbox="apps/tilechat/users/"+this.user_id+"/#",this.log&&console.log("subscribing to:",this.user_id,"topic",this.topic_inbox),this.client.subscribe(this.topic_inbox,function(r){r&&console.error("An error occurred while subscribing user",t.user_id,"on topic:",t.topic_inbox,"Error:",r),t.log&&console.log("subscribed to:",t.topic_inbox," with err",r),n()})}},{key:"sendMessage",value:function(n,t,r,a,u,y,j,J,ie){var ue="apps/".concat(this.appid,"/outgoing/users/").concat(this.user_id,"/messages/").concat(r,"/outgoing"),ge={text:n,type:t,recipient_fullname:a,sender_fullname:u,attributes:y,metadata:j,channel_type:J},de=JSON.stringify(ge);this.client.publish(ue,de,null,function(ve){ie(ve,ge)})}},{key:"basicMessageBuilder",value:function(n,t,r,a,u,y,j){return{text:n,type:t,recipient_fullname:r,sender_fullname:a,attributes:u,metadata:y,channel_type:j}}},{key:"sendMessageRaw",value:function(n,t,r){var a="apps/".concat(this.appid,"/outgoing/users/").concat(this.user_id,"/messages/").concat(t,"/outgoing");this.log&&console.log("dest_topic:",a);var u=JSON.stringify(n);this.client.publish(a,u,null,function(y){r(y,n)})}},{key:"updateMessageStatus",value:function(n,t,r,a){this.log&&console.log("updating recipient_id:",n,"on conversWith",t,"status",r);var u="apps/".concat(this.appid,"/users/").concat(this.user_id,"/messages/").concat(t,"/").concat(n,"/update");this.log&&console.log("update dest_topic:",u);var y={status:r},j=JSON.stringify(y);this.log&&console.log("payload:",j),this.client.publish(u,j,null,function(J){a&&a(J,y)})}},{key:"updateConversationIsNew",value:function(n,t,r){this.log&&console.log("updating conversation with:",n,"is_new",t);var a="apps/".concat(this.appid,"/users/").concat(this.user_id,"/conversations/").concat(n,"/update");this.log&&console.log("update dest_topic:",a);var y=JSON.stringify({is_new:t});this.log&&console.log("payload:",y),this.client.publish(a,y,null,function(j){r&&r(j)})}},{key:"groupCreate",value:function(n,t,r,a){this.log&&console.log("creating group:",n,"id",t,"members",r);var u="".concat(this.APIendpoint,"/").concat(this.appid,"/groups");this.log&&console.log("creating group...",u),i.myrequest({url:u,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{group_name:n,group_id:t,group_members:r},method:"POST"},function(j,J,ie){j?a(j,null):ie&&a&&a(null,ie)},this.log)}},{key:"groupData",value:function(n,t){var r="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n);i.myrequest({url:r,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},method:"GET"},function(u,y,j){u?t(u,null):j&&t&&t(null,j)},this.log)}},{key:"groupLeave",value:function(n,t,r){this.log&&console.log("leaving group:",n);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members/").concat(t);this.log&&console.log("leaving group:",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},method:"DELETE"},function(y,j,J){y?r(y,null):r&&r(null,J)},this.log)}},{key:"groupJoin",value:function(n,t,r){this.log&&console.log("leaving group:",n);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members");this.log&&console.log("joining group:",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{member_id:t},method:"POST"},function(y,j,J){y?r(y,null):r&&r(null,J)},this.log)}},{key:"groupSetMembers",value:function(n,t,r){this.log&&console.log("setting group members of",n,"members",t);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members");this.log&&console.log("setting group members...",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{members:t},method:"PUT"},function(y,j,J){y?r(y,null):J&&r&&r(null,J)},this.log)}},{key:"saveInstance",value:function(n,t,r){this.log&&console.log("saving instance_id:",n,"data",t);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/instances/").concat(n);this.log&&console.log("saving instance..."),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:t,method:"POST"},function(y,j,J){y?r(y,null):J&&r&&r(null,J)},this.log)}},{key:"archiveConversation",value:function(n,t){this.log&&console.log("archiving conversation with:",n);var r="apps/tilechat/users/"+this.user_id+"/conversations/"+n+"/archive";this.log&&console.log("archive dest_topic:",r);var a=JSON.stringify({});this.client.publish(r,a,null,function(u){t&&t(u)})}},{key:"onConversationAdded",value:function(n){return this.last_handler++,this.onConversationAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onConversationUpdated",value:function(n){return this.last_handler++,this.onConversationUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onConversationDeleted",value:function(n){return this.last_handler++,this.onConversationDeletedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onArchivedConversationAdded",value:function(n){return this.last_handler++,this.onArchivedConversationAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onArchivedConversationDeleted",value:function(n){return this.last_handler++,this.onArchivedConversationDeletedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onMessageAdded",value:function(n){return this.last_handler++,this.onMessageAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onMessageAddedInConversation",value:function(n,t){return this.last_handler++,this.callbackHandlers.set(this.last_handler,{type:to,conversWith:n,callback:t}),this.last_handler}},{key:"onMessageUpdatedInConversation",value:function(n,t){return this.last_handler++,this.callbackHandlers.set(this.last_handler,{type:eo,conversWith:n,callback:t}),this.last_handler}},{key:"onMessageUpdated",value:function(n){return this.last_handler+=1,this.onMessageUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onGroupUpdated",value:function(n){return this.last_handler+=1,this.onGroupUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"removeOnMessageAddedHandler",value:function(n){this.onMessageAddedCallbacks.delete(n)}},{key:"removeOnGroupUpdatedHandler",value:function(n){this.onGroupUpdatedCallbacks.delete(n)}},{key:"start",value:function(n){var t=this;if(this.on_message_handler)return this.log&&console.log("this.on_message_handler already subscribed. Reconnected num",this.reconnections),void callbsubscribedCallbackack();this.subscribeToMyConversations(function(){t.on_message_handler=t.client.on("message",function(r,a){t.log&&console.log("topic:"+r+"\nmessage payload:"+a);var u=t.parseTopic(r);if(u){var y=u.conversWith;try{var j=JSON.parse(a.toString());if(t.onConversationUpdatedCallbacks&&r.includes("/conversations/")&&r.endsWith(Rt)&&(t.log&&console.log("conversation updated! /conversations/, topic:",r),t.onConversationUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)})),t.onConversationDeletedCallbacks&&r.includes("/conversations/")&&r.endsWith($n)&&(t.log&&console.log("conversation deleted! /conversations/, topic:",r,a.toString()),t.onConversationDeletedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)})),t.onArchivedConversationAddedCallbacks&&r.includes("/archived_conversations/")&&r.endsWith(an)&&t.onArchivedConversationAddedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.onArchivedConversationDeletedCallbacks&&r.includes("/archived_conversations/")&&r.endsWith($n)&&t.onArchivedConversationDeletedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),r.includes("/messages/")&&r.endsWith(an)){t.onMessageAddedCallbacks&&t.onMessageAddedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)});var J=!0;j.attributes&&0==j.attributes.updateconversation&&(J=!1),J&&t.onConversationAddedCallbacks&&t.onConversationAddedCallbacks.forEach(function(ie,ue,ge){j.is_new=!0;var de=JSON.stringify(j);ie(JSON.parse(de),u)})}t.onMessageUpdatedCallbacks&&r.includes("/messages/")&&r.endsWith(Rt)&&t.onMessageUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.onGroupUpdatedCallbacks&&r.includes("/groups/")&&r.endsWith(Rt)&&t.onGroupUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.callbackHandlers.forEach(function(ie,ue,ge){var de=ie,ve=de.type;r.includes("/messages/")&&r.endsWith(an)&&(t.log&&console.log("/messages/_CLIENTADDED"),ve===to&&y===de.conversWith&&(t.log&&console.log("/messages/_CLIENTADDED on: ",y),de.callback(JSON.parse(a.toString()),u))),r.includes("/messages/")&&r.endsWith(Rt)&&(t.log&&console.log("/messages/_CLIENTUPDATED"),ve===eo&&y===de.conversWith&&(t.log&&console.log("/messages/_CLIENTUPDATED on: ",y),de.callback(JSON.parse(a.toString()),u)))})}catch(ie){console.error("ERROR:",ie)}}else t.log&&console.log("Invalid message topic:",r)}),n()})}},{key:"parseTopic",value:function(n){var t=n.split("/");return t.length>=7?{conversWith:t[5]}:null}},{key:"lastArchivedConversations",value:function(n){var t="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/archived_conversations");this.log&&console.log("getting last archived conversations...",t);var r=new XMLHttpRequest;r.open("GET",t,!0),r.setRequestHeader("authorization",this.jwt),r.onreadystatechange=function(){if(n&&4==r.readyState&&200==r.status&&r.responseText)try{var a=JSON.parse(r.responseText);n(null,a.result)}catch(u){console.error("parsing json ERROR",u),n(u,null)}},r.send(null)}},{key:"lastConversations",value:function(n,t){var r=n?"/archived":"",a="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/conversations")+r;this.log&&console.log("getting last convs...",a);var u=new XMLHttpRequest;u.open("GET",a,!0),u.setRequestHeader("authorization",this.jwt),u.onreadystatechange=function(){if(t&&4==u.readyState&&200==u.status&&u.responseText)try{var y=JSON.parse(u.responseText);t(null,y.result)}catch(j){console.error("parsing json ERROR",j),t(j,null)}},u.send(null)}},{key:"conversationDetail",value:function(n,t){this.log&&console.log("conversationDetail(). searching on user:",this.user_id," - conversWith:",n),this.crossConversationDetail(n,!1,t)}},{key:"archivedConversationDetail",value:function(n,t){this.log&&console.log("archivedConversationDetail(). searching on user:",this.user_id," - conversWith:",n),this.crossConversationDetail(n,!0,t)}},{key:"crossConversationDetail",value:function(n,t,r){var a=this;this.log&&console.log("searching on user:",this.user_id," - conv of conversWith:",n," - archived:",t);var u="conversations";t&&(u="archived_conversations");var y="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/").concat(u,"/").concat(n);this.log&&(console.log("getting conversation detail:",y),console.log("conversWith:",n)),i.myrequest({url:y,headers:{Authorization:this.jwt},method:"GET"},function(J,ie,ue){a.log&&console.log("JSON...",ue),ue&&ue.result&&Array.isArray(ue.result)&&1==ue.result.length?r(null,ue.result[0]):r(null,null)},this.log)}},{key:"lastMessages",value:function(n,t){var r=this.APIendpoint+"/"+this.appid+"/"+this.user_id+"/conversations/"+n+"/messages",a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("authorization",this.jwt),a.onreadystatechange=function(){if(t&&4==a.readyState&&200==a.status&&a.responseText)try{var u=JSON.parse(a.responseText);t(null,u.result)}catch(y){console.error("parsing json messages ERROR",y),t(y,null)}},a.send(null)}},{key:"connect",value:function(n,t,r){var a=this;this.user_id=n,this.jwt=t,this.log&&(console.log("connecting user_id:",n),console.log("using jwt token:",t)),this.client&&this.client.end();var u="apps/tilechat/users/"+this.user_id+"/presence/"+this.client_id,y={keepalive:10,reconnectPeriod:1e3,will:{topic:u,payload:'{"disconnected":true}',qos:1,retain:!0},clientId:this.client_id,username:"JWT",password:t,rejectUnauthorized:!1};this.log&&console.log("starting mqtt connection with LWT on:",u,this.endpoint),this.client=al.connect(this.endpoint,y),this.client.on("connect",function(){a.log&&console.log("Chat client connected. User:"+n),a.connected||(a.log&&console.log("Chat client first connection for:"+n),a.connected=!0,a.start(function(){r()}))}),this.client.on("reconnect",function(){a.log&&console.log("Chat client reconnect event")}),this.client.on("close",function(){a.log&&console.log("Chat client close event")}),this.client.on("offline",function(){a.log&&console.log("Chat client offline event")}),this.client.on("error",function(j){console.error("Chat client error event",j)})}},{key:"close",value:function(n){var t=this;this.topic_inbox&&this.client.unsubscribe(this.topic_inbox,function(r){t.log&&console.log("unsubscribed from",t.topic_inbox),t.client.end(function(){t.connected=!1,t.onConversationAddedCallbacks=new Map,t.onConversationUpdatedCallbacks=new Map,t.onConversationDeletedCallbacks=new Map,t.onArchivedConversationAddedCallbacks=new Map,t.onArchivedConversationDeletedCallbacks=new Map,t.onMessageAddedCallbacks=new Map,t.onMessageUpdatedCallbacks=new Map,t.onGroupUpdatedCallbacks=new Map,t.callbackHandlers=new Map,t.on_message_handler=null,t.topic_inbox=null,n&&n()})})}},{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"==n?t:3&t|8).toString(16)})}}],[{key:"myrequest",value:function(n,t,r){r&&console.log("HTTP Request:",n);var a=new XMLHttpRequest;a.open(n.method,n.url,!0),Object.keys(n.headers).forEach(function(u){a.setRequestHeader(u,n.headers[u])}),a.onreadystatechange=function(){if(t&&4==a.readyState&&200==a.status&&a.responseText)try{var u=JSON.parse(a.responseText);t(null,null,u)}catch(y){console.error("parsing json ERROR",y),t(y,null)}},a.send("POST"===n.method?JSON.stringify(n.data):null)}}]),i}(),Je=function(){function i(){}return Object.defineProperty(i.prototype,"config",{get:function(){return this._config},set:function(o){this._config=o},enumerable:!1,configurable:!0}),i.prototype.initChat=function(){if(!this._config||"CHANGEIT"===this._config.appId)throw new Error("chat21Config is not defined. Please setup your environment");this.chatClient?console.log("Did you try again to create a Chat21Client istance?"):this.chatClient=new sl(this._config)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),cl=function(i){function o(n,t,r){var a=i.call(this)||this;return a.http=n,a.chat21Service=t,a.appStorage=r,a.BSAuthStateChanged=new he.X(null),a.BSSignOut=new he.X(null),a.logger=Ce.getInstance(),a}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.SERVER_BASE_URL=this.getBaseUrl(),this.URL_TILEDESK_CREATE_CUSTOM_TOKEN=this.SERVER_BASE_URL+"chat21/native/auth/createCustomToken",this.logger.log("[MQTTAuthService] initialize "),this.onAuthStateChanged()},o.prototype.logout=function(){var n=this;return this.logger.log("[MQTTAuthService] logout: closing mqtt connection..."),new Promise(function(t,r){n.chat21Service.chatClient.close(function(){n.currentUser=null,n.logger.debug("[MQTTAuthService] logout: mqtt connection closed. user removed. OK"),n.BSSignOut.next(!0),n.BSAuthStateChanged.next("offline"),t(!0)})})},o.prototype.getUser=function(){return this.currentUser},o.prototype.getToken=function(){return this.logger.debug("[MQTTAuthService]::getToken"),this.token},o.prototype.onAuthStateChanged=function(){this.logger.debug("UserService::onAuthStateChanged"),this.BSAuthStateChanged.next("offline"),this.logger.debug("STORAGE CHANGED: added listner")},o.prototype.createCustomToken=function(n){this.connectWithCustomToken(n)},o.prototype.connectWithCustomToken=function(n){var t=this,r=new Se.WM({"Content-type":"application/json",Authorization:n});this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN,{},{headers:r,responseType:"text"}).subscribe(function(y){t.logger.debug("[MQTTAuthService] connectWithCustomToken: **** data",y);var j=JSON.parse(y);t.connectMQTT(j)},function(y){t.logger.error(y)})},o.prototype.connectMQTT=function(n){var t=this;this.logger.debug("[MQTTAuthService] connectMQTT: **** credentials:",n),this.chat21Service.chatClient.connect(n.userid,n.token,function(){t.logger.debug("[MQTTAuthService] connectMQTT: Chat connected."),t.BSAuthStateChanged.next("online")})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(Je),e.LFG(He))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(St),ul=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t.BSConversationDetail=new he.X(null),t.conversationAdded=new he.X(null),t.conversationChanged=new he.X(null),t.conversationChangedDetailed=new he.X(null),t.conversationRemoved=new he.X(null),t.conversations=[],t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.logger.debug("[MQTTConversationsHandler] initialize"),this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.conversations=[],this.isConversationClosingMap=new Map},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.conversations.find(function(u){return u.conversation_with===n});this.logger.log("[MQTTConversationsHandler] getConversationDetail found locally? *****: ",a),a?t(a):(this.logger.log("[MQTTConversationsHandler] getConversationDetail Not found locally, remote.getConversationDetail *****: ",a),this.chat21Service.chatClient.conversationDetail(n,function(u,y){r.logger.log("[MQTTConversationsHandler] getConversationDetail --REMOTE CONV IS OBJ:",y),y?t&&t(r.completeConversation(y)):t&&t(null)}))},o.prototype.setConversationRead=function(n){var t=this;this.logger.debug("[MQTTConversationsHandler] setConversationRead..."),this.chat21Service.chatClient.updateConversationIsNew(n,!1,function(r){r?t.logger.error("[MQTTConversationsHandler]setConversationRead: false. An error occurred",r):t.logger.debug("[MQTTConversationsHandler]setConversationRead: false. Ok")})},o.prototype.subscribeToConversations=function(n){var t=this;this.logger.debug("[MQTTConversationsHandler] connecting MQTT conversations handler"),this.chat21Service.chatClient.onConversationAdded(function(r){var a=t.completeConversation(r);t.logger.log("onConversationAdded completed:",a),t.searchIndexInArrayForConversationWith(t.conversations,a.conversation_with)>-1?(t.logger.log("[MQTTConversationsHandler] Added conv -> Changed!"),t.changed(a)):(t.logger.log("[MQTTConversationsHandler]Added conv -> Added!"),t.added(a))}),this.chat21Service.chatClient.onConversationUpdated(function(r,a){t.logger.debug("[MQTTConversationsHandler] conversation updated:",JSON.stringify(r)),t.changed(r)}),this.chat21Service.chatClient.onConversationDeleted(function(r,a){t.logger.debug("[MQTTConversationsHandler] conversation deleted:",r,a),t.removed({uid:a.conversWith})}),this.chat21Service.chatClient.lastConversations(!1,function(r,a){t.logger.debug("[MQTTConversationsHandler] Last conversations",a,"err",r),r||(a.forEach(function(u){t.added(u)}),n())})},o.prototype.getLastConversation=function(n){this.chat21Service.chatClient.lastConversations(!1,function(t,r){console.log("Last conversations",r,"err",t),t?n(null,t):n(r&&r.length>0?r[0]:null,null)})},o.prototype.added=function(n){this.logger.debug("[MQTTConversationsHandler] NEW CONV childSnapshot",n);var t=this.completeConversation(n);if(this.isValidConversation(t)){this.setClosingConversation(t.conversation_with,!1),this.logger.debug("[MQTTConversationsHandler] conversations:",t.uid,this.conversations);var r=this.searchIndexInArrayForConversationWith(this.conversations,t.conversation_with);console.log("NUOVA CONVER;.uid2"+t.uid),r>-1?(this.logger.debug("[MQTTConversationsHandler] TROVATO"),this.conversations.splice(r,1,t)):(this.logger.debug("[MQTTConversationsHandler] NON TROVATO"),this.conversations.splice(0,0,t)),this.logger.debug("[MQTTConversationsHandler] NUOVA CONVER;.uid3"+t.uid),this.conversations.sort(at("timestamp","desc")),this.logger.debug("[MQTTConversationsHandler] TUTTE:",this.conversations),this.conversationAdded.next(t)}else this.logger.error("[MQTTConversationsHandler] ChatConversationsHandler::added::conversations with conversationId: ",t.conversation_with,"is not valid")},o.prototype.searchIndexInArrayForConversationWith=function(n,t){return n.findIndex(function(r){return r.conversation_with===t})},o.prototype.changed=function(n){this.logger.debug("[MQTTConversationsHandler] Conversation changed:",n),n.conversation_with||(n.conversation_with=n.conversWith);var t=Ue(this.conversations,n.conversation_with);t>-1&&(this.updateConversationWithSnapshot(this.conversations[t],n),this.logger.debug("[MQTTConversationsHandler] conversationchanged.isnew",JSON.stringify(n)),this.conversations.sort(at("timestamp","desc")),this.conversations.splice(t,1,this.conversations[t]),this.conversationChanged.next(this.conversations[t]))},o.prototype.updateConversationWithSnapshot=function(n,t){var r=this;this.logger.debug("[MQTTConversationsHandler] updating conv",n,"with snap",t),Object.keys(t).forEach(function(a){"is_new"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.is_new=t[a]),"text"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.last_message_text=t[a],n.text=t[a]),"recipient"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.recipient=t[a]),"recipient_fullname"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.recipient_fullname=t[a]),"sender"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.sender=t[a]),"sender_fullname"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.sender_fullname=t[a]),"attributes"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.attributes=t[a]),"timestamp"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.timestamp=t[a]),"status"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.status=r.setStatusConversation(n.sender,n.uid)),"type"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.type=t[a])})},o.prototype.removed=function(n){var t=Ue(this.conversations,n.uid);if(t>-1){var r=this.conversations[t];this.conversations.splice(t,1),this.logger.debug("[MQTTConversationsHandler] conversationRemoved::",r),this.conversationRemoved.next(r)}this.deleteClosingConversation(n.uid)},o.prototype.dispose=function(){this.conversations.length=0,this.conversations=[],this.uidConvSelected=""},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){this.chat21Service.chatClient.archiveConversation(n)},o.prototype.completeConversation=function(n){(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return(n.sender===this.loggedUserId||this.isGroup(n))&&(r=n.recipient,t=n.recipient_fullname,n.last_message_text=n.last_message_text),n.conversation_with_fullname=t,n.conversation_with=r,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.last_message_text||(n.last_message_text=n.text),n.uid=n.conversation_with,n.uid===this.uidConvSelected&&(n.is_new=!1),n.sender===this.loggedUserId&&(n.is_new=!1),n},o.prototype.isGroup=function(n){return!(!n.recipient||!n.recipient.startsWith("group-")&&!n.recipient.startsWith("support-group"))},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n)/1e3)},o.prototype.countIsNew=function(){var n=0;return this.conversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.isValidConversation=function(n){return this.logger.debug("[MQTTConversationsHandler] checking uid of",n),this.logger.debug("[MQTTConversationsHandler] conversation.uid",n.uid),this.logger.debug("[MQTTConversationsHandler] channel_type is:",n.channel_type),this.isValidField(n.uid)?this.isValidField(n.last_message_text)?this.isValidField(n.recipient)?this.isValidField(n.recipient_fullname)?this.isValidField(n.sender)?this.isValidField(n.sender_fullname)?this.isValidField(n.status)?this.isValidField(n.timestamp)?!!this.isValidField(n.channel_type)||(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "channel_type is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "timestamp is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "status is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender_fullname is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient_fullname is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "last_message_text is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "uid is not valid" '),!1)},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(mt),hl=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t.archivedConversationAdded=new he.X(null),t.archivedConversationChanged=new he.X(null),t.archivedConversationRemoved=new he.X(null),t.archivedConversations=[],t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.logger.debug("[MQTTArchivedConversationsHandler] initialize"),this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.archivedConversations=[],this.isConversationClosingMap=new Map},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.archivedConversations.find(function(u){return u.conversation_with===n});this.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail found locally? *****: ",a),a?(console.log("found!"),t(a)):(this.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail Not found locally, remote.getConversationDetail *****: ",a),this.chat21Service.chatClient.archivedConversationDetail(n,function(u,y){r.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail --REMOTE CONV IS OBJ:",y),y?t&&t(r.completeConversation(y)):t&&t(null)}))},o.prototype.setConversationRead=function(n){},o.prototype.subscribeToConversations=function(n){var t=this;this.logger.debug("[MQTTArchivedConversationsHandler] connecting MQTT conversations handler"),this.chat21Service.chatClient.onArchivedConversationAdded(function(r){t.logger.log("[MQTTArchivedConversationsHandler] Added conv ->",r.text),t.added(r)}),this.chat21Service.chatClient.onArchivedConversationDeleted(function(r){t.logger.debug("[MQTTArchivedConversationsHandler] conversation deleted:",r),t.removed(r)}),this.chat21Service.chatClient.lastConversations(!0,function(r,a){t.logger.debug("[MQTTArchivedConversationsHandler] Last conversations",a,"err",r),r||(a.forEach(function(u){t.added(u)}),n())})},o.prototype.added=function(n){this.logger.debug("[MQTTArchivedConversationsHandler] NEW CONV childSnapshot",n);var t=this.completeConversation(n);if(t.uid=t.conversation_with,this.isValidConversation(t)){this.setClosingConversation(t.conversation_with,!1),this.logger.debug("[MQTTArchivedConversationsHandler] conversations:",t.uid,this.archivedConversations);var r=this.searchIndexInArrayForConversationWith(this.archivedConversations,t.conversation_with);console.log("NUOVA CONVER;.uid2"+t.uid),r>-1?(this.logger.debug("[MQTTArchivedConversationsHandler] TROVATO"),this.archivedConversations.splice(r,1,t)):(this.logger.debug("[MQTTArchivedConversationsHandler] NON TROVATO"),this.archivedConversations.splice(0,0,t)),this.logger.debug("[MQTTArchivedConversationsHandler] NUOVA CONVER;.uid3"+t.uid),this.archivedConversations.sort(at("timestamp","desc")),this.logger.debug("[MQTTArchivedConversationsHandler] TUTTE:",this.archivedConversations),this.archivedConversationChanged.next(t),this.archivedConversationAdded.next(t)}else this.logger.error("[MQTTArchivedConversationsHandler] ChatConversationsHandler::added::conversations with conversationId: ",t.conversation_with,"is not valid")},o.prototype.searchIndexInArrayForConversationWith=function(n,t){return n.findIndex(function(r){return r.conversation_with===t})},o.prototype.removed=function(n){var t=Ue(this.archivedConversations,n.key);if(t>-1){var r=this.archivedConversations[t];this.archivedConversations.splice(t,1),this.archivedConversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.dispose=function(){this.archivedConversations=[],this.archivedConversations.length=0,this.uidConvSelected=""},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){},o.prototype.completeConversation=function(n){(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return(n.sender===this.loggedUserId||"group"===n.channel_type)&&(r=n.recipient,t=n.recipient_fullname,n.last_message_text=n.last_message_text),n.conversation_with_fullname=t,n.conversation_with=r,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.last_message_text||(n.last_message_text=n.text),n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n)/1e3)},o.prototype.countIsNew=function(){var n=0;return this.archivedConversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.isValidConversation=function(n){return this.logger.debug("[MQTTArchivedConversationsHandler] checking uid of",n),this.logger.debug("[MQTTArchivedConversationsHandler] conversation.uid",n.uid),this.logger.debug("[MQTTArchivedConversationsHandler] channel_type is:",n.channel_type),this.isValidField(n.uid)?this.isValidField(n.last_message_text)?this.isValidField(n.recipient)?this.isValidField(n.recipient_fullname)?this.isValidField(n.sender)?this.isValidField(n.sender_fullname)?this.isValidField(n.status)?this.isValidField(n.timestamp)?!!this.isValidField(n.channel_type)||(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "channel_type is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "timestamp is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "status is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender_fullname is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient_fullname is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "last_message_text is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "uid is not valid" '),!1)},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(vt),no=function(i){function o(n,t){var r=i.call(this)||this;return r.chat21Service=n,r.skipInfoMessage=t,r.messageAdded=new he.X(null),r.messageChanged=new he.X(null),r.messageRemoved=new he.X(null),r.messageWait=new he.X(null),r.messageInfo=new he.X(null),r.lastDate="",r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r,a,u,y){this.logger.log("[MQTTConversationHandler] initWithRecipient:",a),this.recipientId=n,this.recipientFullname=t,this.loggedUser=r,r&&(this.senderId=r.uid),this.tenant=a,this.translationMap=u,this.listSubsriptions=[],this.CLIENT_BROWSER=navigator.userAgent,this.conversationWith=n,this.messages=[],this.showInfoMessage=y},o.prototype.connect=function(){var n=this;this.logger.log("[MQTTConversationHandler] connecting conversation handler..."),null!=this.conversationWith?(this.chat21Service.chatClient.lastMessages(this.conversationWith,function(a,u){a||u.forEach(function(y){n.addedMessage(y)})}),this.chat21Service.chatClient.onMessageAddedInConversation(this.conversationWith,function(a,u){n.logger.log("[MQTTConversationHandler] message added:",a,"on topic:",u),n.addedMessage(a)}),this.chat21Service.chatClient.onMessageUpdatedInConversation(this.conversationWith,function(a,u){n.logger.log("[MQTTConversationHandler] message updated:",a,"on topic:",u),n.updatedMessageStatus(a)})):this.logger.error("[MQTTConversationHandler] cant connect invalid this.conversationWith",this.conversationWith)},o.prototype.isGroup=function(n){return n.indexOf("group-")>=0},o.prototype.sendMessage=function(n,t,r,a,u,y,j,J,ie){var ue=this;(!J||"undefined"===J)&&(J=W),this.logger.log("[MQTTConversationHandler] Senderfullname",j);var de=document.documentElement.lang,ve=u,Te=a;return ie.lang=de,this.chat21Service.chatClient.sendMessage(n,t,Te,ve,j,ie,r,J,function(ke,Ae){ke?(Ae.status="-100",ue.logger.log("[MQTTConversationHandler] ERROR",ke)):Ae.status="150"}),new Kn("",de,a,ve,y,j,0,r,n,Date.now(),t,this.attributes,J,!1)},o.prototype.dispose=function(){},o.prototype.addedMessage=function(n){var t=this.messageGenerate(n);t.uid=t.message_id;var r=Xe(N,t);if(r&&this.messageInfo.next(t),(!r||!Et(t,this.showInfoMessage))&&(!r||Et(t,this.showInfoMessage)||Mn(t,this.loggedUser))){t.headerDate=null;var a=function(i,o){var n=new Date(o),t=new Date,r="";if(t.getFullYear()!==n.getFullYear()){var a=n.getMonth()+1;r=n.getDay()+"/"+a+"/"+n.getFullYear()}else t.getMonth()!==n.getMonth()?(a=n.getMonth()+1,r=n.getDay()+"/"+a+"/"+n.getFullYear()):r=t.getDay()===n.getDay()||t.getDay()-n.getDay()==1?xe().calendar(o).split(" ")[0].toLocaleLowerCase():function(i,o){return i.get("ARRAY_DAYS")[o]}(i,n.getDay());return r}(this.translationMap,t.timestamp);a!==this.lastDate&&(this.lastDate=a,t.headerDate=a),this.logger.log("[MQTTConversationHandler] adding message:"+JSON.stringify(t)),this.addReplaceMessageInArray(t.uid,t),this.updateMessageStatusReceived(t),this.messageAdded.next(t)}},o.prototype.updatedMessageStatus=function(n){if(!Xe(N,n)){this.logger.log("[MQTTConversationHandler] updating message with patch",n);var t=Ue(this.messages,n.message_id);if(t>-1){var r=this.messages[t];r&&(r.status=n.status,this.logger.log("[MQTTConversationHandler] message found and patched (replacing)",r),this.addReplaceMessageInArray(r.uid,r),this.messageChanged.next(r))}}},o.prototype.removed=function(n){var t=Ue(this.messages,n.key);t>-1&&(this.messages.splice(t,1),this.messageRemoved.next(n.key))},o.prototype.messageGenerate=function(n){this.logger.log("[MQTTConversationHandler] childSnapshot >"+JSON.stringify(n));var t=n;return t.uid=n.key,t.text=t.text.trim(),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),this.logger.log("[MQTTConversationHandler] ****>msg.sender:"+t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.addReplaceMessageInArray=function(n,t){var r=Ue(this.messages,n);r>-1?this.messages.splice(r,1,t):this.messages.splice(0,0,t),this.messages.sort(at("timestamp","asc"))},o.prototype.translateInfoSupportMessages=function(n){var t=this.translationMap.get("INFO_SUPPORT_USER_ADDED_SUBJECT"),r=this.translationMap.get("INFO_SUPPORT_USER_ADDED_YOU_VERB"),a=this.translationMap.get("INFO_SUPPORT_USER_ADDED_COMPLEMENT"),u=this.translationMap.get("INFO_SUPPORT_USER_ADDED_VERB"),y=this.translationMap.get("INFO_SUPPORT_CHAT_REOPENED"),j=this.translationMap.get("INFO_SUPPORT_CHAT_CLOSED"),J=this.translationMap.get("INFO_SUPPORT_LEAD_UPDATED"),ie=this.translationMap.get("INFO_SUPPORT_MEMBER_LEFT_GROUP"),ue=this.translationMap.get("INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU");if(n.attributes.messagelabel&&n.attributes.messagelabel.parameters&&n.attributes.messagelabel.key===H){var ge=void 0,de=void 0,ve=void 0;n.attributes.messagelabel.parameters.member_id===this.loggedUser.uid?(ge=t,de=r,ve=a):n.attributes.messagelabel.parameters.fullname?(ge=n.attributes.messagelabel.parameters.fullname,de=u,ve=a):(ge=n.attributes.messagelabel.parameters.member_id,de=u,ve=a),n.text=ge+" "+de+" "+ve}else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===x)n.text=y;else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===D)n.text=j;else if(n.attributes&&n.attributes.messagelabel&&n.attributes.messagelabel.key===l&&"system"===n.sender){var Te=n.text.split(":")[1];void 0!==Te&&(n.text=ue+": "+Te)}else n.attributes.messagelabel&&n.attributes.messagelabel.key===te?n.text=J:n.attributes.messagelabel&&n.attributes.messagelabel.key===ee&&(ge=void 0,n.text=(ge=n.attributes.messagelabel.parameters.fullname?n.attributes.messagelabel.parameters.fullname:n.attributes.messagelabel.parameters.member_id)+" "+ie)},o.prototype.updateMessageStatusReceived=function(n){this.logger.log("[MQTTConversationHandler] updateMessageStatusReceived",n),n.status<_&&(this.logger.log("[MQTTConversationHandler] status ",n.status," < (RECEIVED:200)",_),n.sender!==this.loggedUser.uid&&n.status<_&&(this.logger.log("[MQTTConversationHandler] updating message with status received"),this.chat21Service.chatClient.updateMessageStatus(n.message_id,this.conversationWith,_,null)))},o.prototype.isSender=function(n,t){return!!t&&n===t},o.prototype.unsubscribe=function(n){var t=this;this.logger.log("[MQTTConversationHandler] unsubscribe: ",n),this.listSubsriptions.forEach(function(r){t.logger.log("[MQTTConversationHandler] unsubscribe: ",r.uid,n),r.uid!==n||r.unsubscribe(n,null)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je),e.LFG("skipMessage"))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(rn),pl=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t}return(0,_e.ZT)(o,i),o.prototype.build=function(){return new no(this.chat21Service,!0)},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(Ct),dl=function(i){function o(){var n=i.call(this)||this;return n.BSIsTyping=new he.X(null),n.BSSetTyping=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[MQTT-TYPING] initialize this.tenant",this.tenant),this.urlNodeTypings="/apps/"+this.tenant+"/typings/"},o.prototype.isTyping=function(n,t){},o.prototype.setTyping=function(n,t,r,a){},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(ht),gl=function(i){function o(){var n=i.call(this)||this;return n.BSIsOnline=new he.X(null),n.BSLastOnline=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[MQTT-PRESENCE] initialize this.tenant",this.tenant),this.urlNodePresence="/apps/"+this.tenant+"/presence/"},o.prototype.userIsOnline=function(n){return this.BSIsOnline},o.prototype.lastOnlineForUser=function(n){},o.prototype.setPresence=function(n){},o.prototype.removePresence=function(){},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Pt),fl=function(i){function o(n){var t=i.call(this)||this;return t.http=n,t}return(0,_e.ZT)(o,i),o.prototype.getImagePhotoUrl=function(n){this.baseImageURL=this.getImageBaseUrl()+"images";var t;return t=n.includes("bot_")?n.slice(4):n,this.baseImageURL+"?path=uploads/users/"+t+"/images/photo.jpg"},o.prototype.checkImageExists=function(n,t){this.http.get(n).subscribe(function(r){t(!0)},function(r){console.log("errorrrrrr",n,r),t(!1)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(st),ml=function(i){function o(n,t){var r=i.call(this)||this;return r.http=n,r.appStorage=t,r.BSStateUpload=new he.X(null),r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.logger.debug("[NATIVE UPLOAD] initialize"),this.URL_TILEDESK_FILE=this.getBaseUrl()+"files",this.URL_TILEDESK_IMAGES=this.getBaseUrl()+"images",this.tiledeskToken=this.appStorage.getItem("tiledeskToken")},o.prototype.upload=function(n,t){var r=this;this.logger.debug("[NATIVE UPLOAD] - upload new image/file ... upload",t);var u={headers:new Se.WM({Authorization:this.tiledeskToken})},y=new FormData;y.append("file",t.file);var j=this;if(t.file.type.startsWith("image")&&!t.file.type.includes("svg")){this.logger.debug("[NATIVE UPLOAD] - upload new image");var J=this.URL_TILEDESK_IMAGES+"/users";return new Promise(function(ue,ge){j.http.post(J,y,u).subscribe(function(de){ue(r.URL_TILEDESK_IMAGES+"?path="+de.filename)},function(de){ge(de)})})}this.logger.debug("[NATIVE UPLOAD] - upload new file");var ie=this.URL_TILEDESK_FILE+"/users";return new Promise(function(ue,ge){j.http.post(ie,y,u).subscribe(function(de){var ve=r.URL_TILEDESK_FILE+"/download?path="+encodeURI(de.filename);t.file.type.includes("pdf")&&(ve=r.URL_TILEDESK_FILE+"?path="+encodeURI(de.filename)),ue(ve)},function(de){r.logger.error("[NATIVE UPLOAD] - ERROR upload new file ",de),ge(de)})})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(He))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(pt),vl=function(i){function o(){var n=null!==i&&i.apply(this,arguments)||this;return n.storagePrefix=z,n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.storagePrefix=n,this.projectID=r,this.persistence=t},o.prototype.getItem=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] getItem >Error :",a)}return this.getValueForKey(t+this.projectID+"_"+n)},o.prototype.setItem=function(n,t){var r;try{r=this.storagePrefix+"_"}catch(u){this.logger.error("[LocalSessionStorage] setItem > Error :",u)}this.saveValueForKey(r+this.projectID+"_"+n,t)},o.prototype.getItemWithoutProjectID=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] getItemWithoutProjectID > Error :",a)}return this.getValueForKey(t+n)},o.prototype.setItemWithoutProjectID=function(n,t){this.removeItem(n);var r=z;try{r=this.storagePrefix+"_"}catch(u){this.logger.error("[LocalSessionStorage] setItemWithoutProjectID > Error :",u)}this.saveValueForKey(r+n,t)},o.prototype.removeItem=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] removeItem > Error :",a)}return this.removeItemForKey(t+this.projectID+"_"+n)},o.prototype.clear=function(){var n;try{n=this.storagePrefix+"_"}catch(y){this.logger.error("[LocalSessionStorage] clear > Error :",y)}for(var t=n+this.projectID,r=[],a=0;a<localStorage.length;a++){var u=localStorage.key(a);-1!==u.indexOf(t)&&r.push(u)}for(a=0;a<r.length;a++)this.removeItemForKey(r[a])},o.prototype.getValueForKey=function(n){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.getItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.getItem(n):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.getItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.prototype.saveValueForKey=function(n,t){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.setItem(n,t):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.setItem(n,t):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.setItem(n,t):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.prototype.removeItemForKey=function(n){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.removeItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.removeItem(n):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.removeItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.\u0275fac=function(){var n;return function(r){return(n||(n=e.n5z(o)))(r||o)}}(),o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(He),bl=function(i,o){return function(){var n=new Gs(o);if(Ce.setInstance(n),ce.remoteConfig)return i.loadAppConfig()}};function _l(i,o,n,t){var a,r=o.getConfig();return r.chatEngine===De?(n.config=r.chat21Config,n.initChat(),(a=new cl(i,n,t)).setBaseUrl(o.getConfig().apiUrl),a):(Qn.initFirebase(r.firebaseConfig),(a=new Js(i)).setBaseUrl(r.apiUrl),a)}function Cl(i,o,n){return n.getConfig().chatEngine===De?new ul(i):new Qs(o,n)}function yl(i,o){return o.getConfig().chatEngine===De?new hl(i):new Ks}function wl(i,o){return o.getConfig().chatEngine===De?new pl(i):new Xs}function Ol(i,o){return o.getConfig().chatEngine===De?new no(i,!0):new Xn(!0)}function Ml(i){return i.getConfig().chatEngine===De?new dl:new el}function xl(i){return i.getConfig().chatEngine===De?new gl:new tl}function El(i,o){var n=i.getConfig();if("native"===n.uploadEngine)return(t=new fl(o)).setImageBaseUrl(n.baseImageUrl),t;var t=new nl(o);return Qn.initFirebase(n.firebaseConfig),t.setImageBaseUrl(n.baseImageUrl),t}function Tl(i,o,n){var t=o.getConfig();if("native"===t.uploadEngine){var r=new ml(i,n);return r.setBaseUrl(t.apiUrl),r}return new ol}var Sl=function(){function i(){}return i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=e.oAB({type:i,bootstrap:[Qt]}),i.\u0275inj=e.cJS({providers:[Fe,Je,Re,En,Tn,en,{provide:e.ip1,useFactory:bl,multi:!0,deps:[Fe,It.Kf]},{provide:He,useClass:vl},{provide:St,useFactory:_l,deps:[Se.eN,Fe,Je,He]},{provide:mt,useFactory:Cl,deps:[Je,Se.eN,Fe]},{provide:vt,useFactory:yl,deps:[Je,Fe]},{provide:Ct,useFactory:wl,deps:[Je,Fe]},{provide:rn,useFactory:Ol,deps:[Je,Fe]},{provide:st,useFactory:El,deps:[Fe,Se.eN]},{provide:Pt,useFactory:xl,deps:[Fe]},{provide:ht,useFactory:Ml,deps:[Fe]},{provide:pt,useFactory:Tl,deps:[Se.eN,Fe,He]},Pn,Jt,Gt,ut,xn,In],imports:[[Le.b2,Ws.PW,Se.JF,Oe.u5,Oe.UX,$e._G,Kt.z8,Zn.bd,Yt.aw.forRoot({}),It.f9.forRoot({level:It._z.DEBUG,enableSourceMaps:!1,disableFileDetails:!0,colorScheme:["purple","yellow","gray","gray","red","red","red"]})]]}),i}();e.B6R(Qt,[me.mk,me.PC,me.O5,Li,Ui,Ua,Vs,ds,Ss,yn,Cs,Ds],[]),ce.production&&(0,e.G48)(),Le.q6().bootstrapModule(Sl).catch(function(i){return console.error(i)})},46700:function(Ve,Qe,ye){var Le={"./af":90776,"./af.js":90776,"./ar":67634,"./ar-dz":42758,"./ar-dz.js":42758,"./ar-kw":64980,"./ar-kw.js":64980,"./ar-ly":9602,"./ar-ly.js":9602,"./ar-ma":52500,"./ar-ma.js":52500,"./ar-sa":36909,"./ar-sa.js":36909,"./ar-tn":92735,"./ar-tn.js":92735,"./ar.js":67634,"./az":27798,"./az.js":27798,"./be":29949,"./be.js":29949,"./bg":44590,"./bg.js":44590,"./bm":15938,"./bm.js":15938,"./bn":60595,"./bn-bd":51942,"./bn-bd.js":51942,"./bn.js":60595,"./bo":4756,"./bo.js":4756,"./br":17277,"./br.js":17277,"./bs":4166,"./bs.js":4166,"./ca":13943,"./ca.js":13943,"./cs":53474,"./cs.js":53474,"./cv":92218,"./cv.js":92218,"./cy":21061,"./cy.js":21061,"./da":82743,"./da.js":82743,"./de":31899,"./de-at":28580,"./de-at.js":28580,"./de-ch":3264,"./de-ch.js":3264,"./de.js":31899,"./dv":98784,"./dv.js":98784,"./el":54654,"./el.js":54654,"./en-au":56277,"./en-au.js":56277,"./en-ca":76896,"./en-ca.js":76896,"./en-gb":71609,"./en-gb.js":71609,"./en-ie":24557,"./en-ie.js":24557,"./en-il":15836,"./en-il.js":15836,"./en-in":30262,"./en-in.js":30262,"./en-nz":43586,"./en-nz.js":43586,"./en-sg":38965,"./en-sg.js":38965,"./eo":62777,"./eo.js":62777,"./es":63357,"./es-do":3128,"./es-do.js":3128,"./es-mx":69179,"./es-mx.js":69179,"./es-us":83256,"./es-us.js":83256,"./es.js":63357,"./et":2654,"./et.js":2654,"./eu":57287,"./eu.js":57287,"./fa":73875,"./fa.js":73875,"./fi":73431,"./fi.js":73431,"./fil":39606,"./fil.js":39606,"./fo":41781,"./fo.js":41781,"./fr":61717,"./fr-ca":11539,"./fr-ca.js":11539,"./fr-ch":19847,"./fr-ch.js":19847,"./fr.js":61717,"./fy":42250,"./fy.js":42250,"./ga":47665,"./ga.js":47665,"./gd":85214,"./gd.js":85214,"./gl":36154,"./gl.js":36154,"./gom-deva":68222,"./gom-deva.js":68222,"./gom-latn":18518,"./gom-latn.js":18518,"./gu":89221,"./gu.js":89221,"./he":64743,"./he.js":64743,"./hi":77339,"./hi.js":77339,"./hr":13224,"./hr.js":13224,"./hu":50856,"./hu.js":50856,"./hy-am":76855,"./hy-am.js":76855,"./id":2190,"./id.js":2190,"./is":53887,"./is.js":53887,"./it":19270,"./it-ch":85890,"./it-ch.js":85890,"./it.js":19270,"./ja":46595,"./ja.js":46595,"./jv":93081,"./jv.js":93081,"./ka":27477,"./ka.js":27477,"./kk":13978,"./kk.js":13978,"./km":19205,"./km.js":19205,"./kn":60025,"./kn.js":60025,"./ko":50427,"./ko.js":50427,"./ku":79089,"./ku.js":79089,"./ky":19314,"./ky.js":19314,"./lb":23136,"./lb.js":23136,"./lo":29115,"./lo.js":29115,"./lt":27087,"./lt.js":27087,"./lv":95683,"./lv.js":95683,"./me":79454,"./me.js":79454,"./mi":35507,"./mi.js":35507,"./mk":98466,"./mk.js":98466,"./ml":82933,"./ml.js":82933,"./mn":19477,"./mn.js":19477,"./mr":43597,"./mr.js":43597,"./ms":85529,"./ms-my":99965,"./ms-my.js":99965,"./ms.js":85529,"./mt":30259,"./mt.js":30259,"./my":88061,"./my.js":88061,"./nb":72618,"./nb.js":72618,"./ne":28452,"./ne.js":28452,"./nl":1885,"./nl-be":60413,"./nl-be.js":60413,"./nl.js":1885,"./nn":45107,"./nn.js":45107,"./oc-lnc":71763,"./oc-lnc.js":71763,"./pa-in":702,"./pa-in.js":702,"./pl":31711,"./pl.js":31711,"./pt":10594,"./pt-br":58238,"./pt-br.js":58238,"./pt.js":10594,"./ro":74681,"./ro.js":74681,"./ru":16201,"./ru.js":16201,"./sd":62912,"./sd.js":62912,"./se":6002,"./se.js":6002,"./si":67942,"./si.js":67942,"./sk":25577,"./sk.js":25577,"./sl":41775,"./sl.js":41775,"./sq":36823,"./sq.js":36823,"./sr":59038,"./sr-cyrl":83848,"./sr-cyrl.js":83848,"./sr.js":59038,"./ss":96173,"./ss.js":96173,"./sv":5788,"./sv.js":5788,"./sw":76882,"./sw.js":76882,"./ta":82678,"./ta.js":82678,"./te":82797,"./te.js":82797,"./tet":52447,"./tet.js":52447,"./tg":31335,"./tg.js":31335,"./th":68667,"./th.js":68667,"./tk":9222,"./tk.js":9222,"./tl-ph":99914,"./tl-ph.js":99914,"./tlh":71389,"./tlh.js":71389,"./tr":3578,"./tr.js":3578,"./tzl":36969,"./tzl.js":36969,"./tzm":76509,"./tzm-latn":690,"./tzm-latn.js":690,"./tzm.js":76509,"./ug-cn":20055,"./ug-cn.js":20055,"./uk":22452,"./uk.js":22452,"./ur":91151,"./ur.js":91151,"./uz":31555,"./uz-latn":46547,"./uz-latn.js":46547,"./uz.js":31555,"./vi":16541,"./vi.js":16541,"./x-pseudo":42401,"./x-pseudo.js":42401,"./yo":2341,"./yo.js":2341,"./zh-cn":80619,"./zh-cn.js":80619,"./zh-hk":67058,"./zh-hk.js":67058,"./zh-mo":89141,"./zh-mo.js":89141,"./zh-tw":22782,"./zh-tw.js":22782};function e(De){var nt=_e(De);return ye(nt)}function _e(De){if(!ye.o(Le,De)){var nt=new Error("Cannot find module '"+De+"'");throw nt.code="MODULE_NOT_FOUND",nt}return Le[De]}e.keys=function(){return Object.keys(Le)},e.resolve=_e,Ve.exports=e,e.id=46700},4147:function(Ve){"use strict";Ve.exports={i8:"5.0.46-rc.4"}}},function(Ve){Ve.O(0,[736],function(){return Ve(Ve.s=27565)}),Ve.O()}]);
|
|
1
|
+
(self.webpackChunk_chat21_chat21_web_widget=self.webpackChunk_chat21_chat21_web_widget||[]).push([[179],{98255:function(Ve){function Qe(ye){return Promise.resolve().then(function(){var Le=new Error("Cannot find module '"+ye+"'");throw Le.code="MODULE_NOT_FOUND",Le})}Qe.keys=function(){return[]},Qe.resolve=Qe,Qe.id=98255,Ve.exports=Qe},23268:function(Ve,Qe,ye){var Le=ye(35554).default,e=ye(75725).default,_e=ye(73560).default,De=ye(71556).default,nt=ye(47934).default,gt=ye(59545).default;Ve.exports=function L(X,K,g){function b(d,_){if(!K[d]){if(!X[d]){if(C)return C(d,!0);var M=new Error("Cannot find module '"+d+"'");throw M.code="MODULE_NOT_FOUND",M}var T=K[d]={exports:{}};X[d][0].call(T.exports,function(E){return b(X[d][1][E]||E)},T,T.exports,L,X,K,g)}return K[d].exports}for(var C=void 0,f=0;f<g.length;f++)b(g[f]);return b}({1:[function(L,X,K){(function(g,b){"use strict";var C=L("events").EventEmitter,f=L("./store"),d=L("mqtt-packet"),_=L("readable-stream").Writable,m=L("inherits"),M=L("reinterval"),T=L("./validations"),E=L("xtend"),h=L("debug")("mqttjs:client"),p=g?g.nextTick:function(Z){setTimeout(Z,0)},O=b.setImmediate||function(Z){p(Z)},A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},P=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],R={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function B(Z,U,W){h("sendPacket :: packet: %O",U),h("sendPacket :: emitting `packetsend`"),Z.emit("packetsend",U),h("sendPacket :: writing to stream");var S=d.writeToStream(U,Z.stream,Z.options);h("sendPacket :: writeToStream result %s",S),!S&&W?(h("sendPacket :: handle events on `drain` once through callback."),Z.stream.once("drain",W)):W&&(h("sendPacket :: invoking cb"),W())}function I(Z,U,W,S){h("storeAndSend :: store packet with cmd %s to outgoingStore",U.cmd),Z.outgoingStore.put(U,function(q){if(q)return W&&W(q);S(),B(Z,U,W)})}function $(Z){h("nop ::",Z)}function F(Z,U){var W,S=this;if(!(this instanceof F))return new F(Z,U);for(W in this.options=U||{},A)this.options[W]=void 0===this.options[W]?A[W]:U[W];h("MqttClient :: options.protocol",U.protocol),h("MqttClient :: options.protocolVersion",U.protocolVersion),h("MqttClient :: options.username",U.username),h("MqttClient :: options.keepalive",U.keepalive),h("MqttClient :: options.reconnectPeriod",U.reconnectPeriod),h("MqttClient :: options.rejectUnauthorized",U.rejectUnauthorized),this.options.clientId="string"==typeof U.clientId?U.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),h("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===U.protocolVersion&&U.customHandleAcks?U.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=Z,this.outgoingStore=U.outgoingStore||new f,this.incomingStore=U.incomingStore||new f,this.queueQoSZero=void 0===U.queueQoSZero||U.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this._firstConnection=!0,this.on("connect",function(){var q=this.queue;h("connect :: sending queued packets"),function G(){var oe,re=q.shift();h("deliver :: entry %o",re),re&&(h("deliver :: call _sendPacket for %o",oe=re.packet),S._sendPacket(oe,function(se){re.cb&&re.cb(se),G()}))}()}),this.on("close",function(){h("close :: connected set to `false`"),this.connected=!1,h("close :: clearing connackTimer"),clearTimeout(this.connackTimer),h("close :: clearing ping timer"),null!==S.pingTimer&&(S.pingTimer.clear(),S.pingTimer=null),h("close :: calling _setupReconnect"),this._setupReconnect()}),C.call(this),h("MqttClient :: setting up stream"),this._setupStream()}m(F,C),F.prototype._setupStream=function(){var U,Z=this,W=this,S=new _,q=d.parser(this.options),G=null,re=[];function oe(){if(re.length)p(se);else{var Y=G;G=null,Y()}}function se(){h("work :: getting next packet in queue");var Y=re.shift();if(Y)h("work :: packet pulled from queue"),W._handlePacket(Y,oe);else{h("work :: no packets in queue");var N=G;G=null,h("work :: done flag is %s",!!N),N&&N()}}if(h("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),h("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),q.on("packet",function(Y){h("parser :: on packet push to packets array."),re.push(Y)}),S._write=function(Y,N,V){G=V,h("writable stream :: parsing buffer"),q.parse(Y),se()},h("_setupStream :: pipe stream to writable stream"),this.stream.pipe(S),this.stream.on("error",function(Y){h("streamErrorHandler :: error",Y.message),P.includes(Y.code)?(h("streamErrorHandler :: emitting error"),W.emit("error",Y)):$(Y)}),this.stream.on("close",function(){var Y;h("(%s)stream :: on close",W.options.clientId),(Y=W.outgoing)&&(h("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(Y).forEach(function(N){Y[N].volatile&&"function"==typeof Y[N].cb&&(Y[N].cb(new Error("Connection closed")),delete Y[N])})),h("stream: emit close to MqttClient"),W.emit("close")}),h("_setupStream: sending packet `connect`"),(U=Object.create(this.options)).cmd="connect",B(this,U),q.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return W.end(function(){return Z.emit("error",new Error("Packet has no Authentication Method"))}),this;this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket&&B(this,E({cmd:"auth",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){h("!!connectTimeout hit!! Calling _cleanUp with force `true`"),W._cleanUp(!0)},this.options.connectTimeout)},F.prototype._handlePacket=function(Z,U){var W=this.options;if(5===W.protocolVersion&&W.properties&&W.properties.maximumPacketSize&&W.properties.maximumPacketSize<Z.length)return this.emit("error",new Error("exceeding packets size "+Z.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(h("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",Z),Z.cmd){case"publish":this._handlePublish(Z,U);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(Z),U();break;case"pubrel":this._handlePubrel(Z,U);break;case"connack":this._handleConnack(Z),U();break;case"pingresp":this._handlePingresp(Z),U();break;case"disconnect":this._handleDisconnect(Z),U()}},F.prototype._checkDisconnecting=function(Z){return this.disconnecting&&(Z?Z(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},F.prototype.publish=function(Z,U,W,S){var q;h("publish :: message `%s` to topic `%s`",U,Z);var G=this.options;if("function"==typeof W&&(S=W,W=null),W=E({qos:0,retain:!1,dup:!1},W),this._checkDisconnecting(S))return this;switch(q={cmd:"publish",topic:Z,payload:U,qos:W.qos,retain:W.retain,messageId:this._nextId(),dup:W.dup},5===G.protocolVersion&&(q.properties=W.properties,(!G.properties&&q.properties&&q.properties.topicAlias||W.properties&&G.properties&&(W.properties.topicAlias&&G.properties.topicAliasMaximum&&W.properties.topicAlias>G.properties.topicAliasMaximum||!G.properties.topicAliasMaximum&&W.properties.topicAlias))&&delete q.properties.topicAlias),h("publish :: qos",W.qos),W.qos){case 1:case 2:this.outgoing[q.messageId]={volatile:!1,cb:S||$},this._storeProcessing?(h("_storeProcessing enabled"),this._packetIdsDuringStoreProcessing[q.messageId]=!1,this._storePacket(q,void 0,W.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,void 0,W.cbStorePut));break;default:this._storeProcessing?(h("_storeProcessing enabled"),this._storePacket(q,S,W.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",q.cmd),this._sendPacket(q,S,W.cbStorePut))}return this},F.prototype.subscribe=function(){for(var Z,U=new Array(arguments.length),W=0;W<arguments.length;W++)U[W]=arguments[W];var S,q=[],G=U.shift(),re=G.resubscribe,oe=U.pop()||$,se=U.pop(),Y=this,N=this.options.protocolVersion;if(delete G.resubscribe,"string"==typeof G&&(G=[G]),"function"!=typeof oe&&(se=oe,oe=$),null!==(S=T.validateTopics(G)))return O(oe,new Error("Invalid topic "+S)),this;if(this._checkDisconnecting(oe))return h("subscribe: discconecting true"),this;var V={qos:0};if(5===N&&(V.nl=!1,V.rap=!1,V.rh=0),se=E(V,se),Array.isArray(G)?G.forEach(function(v){if(h("subscribe: array topic %s",v),!Y._resubscribeTopics.hasOwnProperty(v)||Y._resubscribeTopics[v].qos<se.qos||re){var x={topic:v,qos:se.qos};5===N&&(x.nl=se.nl,x.rap=se.rap,x.rh=se.rh,x.properties=se.properties),h("subscribe: pushing topic `%s` and qos `%s` to subs list",x.topic,x.qos),q.push(x)}}):Object.keys(G).forEach(function(v){if(h("subscribe: object topic %s",v),!Y._resubscribeTopics.hasOwnProperty(v)||Y._resubscribeTopics[v].qos<G[v].qos||re){var x={topic:v,qos:G[v].qos};5===N&&(x.nl=G[v].nl,x.rap=G[v].rap,x.rh=G[v].rh,x.properties=se.properties),h("subscribe: pushing `%s` to subs list",x),q.push(x)}}),Z={cmd:"subscribe",subscriptions:q,qos:1,retain:!1,dup:!1,messageId:this._nextId()},se.properties&&(Z.properties=se.properties),q.length){if(this.options.resubscribe){h("subscribe :: resubscribe true");var Q=[];q.forEach(function(v){if(Y.options.reconnectPeriod>0){var x={qos:v.qos};5===N&&(x.nl=v.nl||!1,x.rap=v.rap||!1,x.rh=v.rh||0,x.properties=v.properties),Y._resubscribeTopics[v.topic]=x,Q.push(v.topic)}}),Y.messageIdToTopic[Z.messageId]=Q}return this.outgoing[Z.messageId]={volatile:!0,cb:function(x,D){if(!x)for(var H=D.granted,ee=0;ee<H.length;ee+=1)q[ee].qos=H[ee];oe(x,q)}},h("subscribe :: call _sendPacket"),this._sendPacket(Z),this}oe(null,[])},F.prototype.unsubscribe=function(){for(var Z={cmd:"unsubscribe",qos:1,messageId:this._nextId()},U=this,W=new Array(arguments.length),S=0;S<arguments.length;S++)W[S]=arguments[S];var q=W.shift(),G=W.pop()||$,re=W.pop();return"string"==typeof q&&(q=[q]),"function"!=typeof G&&(re=G,G=$),this._checkDisconnecting(G)||("string"==typeof q?Z.unsubscriptions=[q]:Array.isArray(q)&&(Z.unsubscriptions=q),this.options.resubscribe&&Z.unsubscriptions.forEach(function(oe){delete U._resubscribeTopics[oe]}),"object"==typeof re&&re.properties&&(Z.properties=re.properties),this.outgoing[Z.messageId]={volatile:!0,cb:G},h("unsubscribe: call _sendPacket"),this._sendPacket(Z)),this},F.prototype.end=function(Z,U,W){var S=this;function q(){h("end :: (%s) :: finish :: calling _cleanUp with force %s",S.options.clientId,Z),S._cleanUp(Z,function(){h("end :: finish :: calling process.nextTick on closeStores"),p(function(){h("end :: closeStores: closing incoming and outgoing stores"),S.disconnected=!0,S.incomingStore.close(function(G){S.outgoingStore.close(function(re){if(h("end :: closeStores: emitting end"),S.emit("end"),W){var oe=G||re;h("end :: closeStores: invoking callback with args"),W(oe)}})}),S._deferredReconnect&&S._deferredReconnect()}.bind(S))},U)}return h("end :: (%s)",this.options.clientId),null!=Z&&"boolean"==typeof Z||(W=U||$,U=Z,Z=!1,"object"!=typeof U&&(W=U,U=null,"function"!=typeof W&&(W=$))),"object"!=typeof U&&(W=U,U=null),h("end :: cb? %s",!!W),W=W||$,this.disconnecting?(W(),this):(this._clearReconnect(),this.disconnecting=!0,!Z&&Object.keys(this.outgoing).length>0?(h("end :: (%s) :: calling finish in 10ms once outgoing is empty",S.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,q,10))):(h("end :: (%s) :: immediately calling finish",S.options.clientId),q()),this)},F.prototype.removeOutgoingMessage=function(Z){var U=this.outgoing[Z]?this.outgoing[Z].cb:null;return delete this.outgoing[Z],this.outgoingStore.del({messageId:Z},function(){U(new Error("Message removed"))}),this},F.prototype.reconnect=function(Z){h("client reconnect");var U=this,W=function(){Z?(U.options.incomingStore=Z.incomingStore,U.options.outgoingStore=Z.outgoingStore):(U.options.incomingStore=null,U.options.outgoingStore=null),U.incomingStore=U.options.incomingStore||new f,U.outgoingStore=U.options.outgoingStore||new f,U.disconnecting=!1,U.disconnected=!1,U._deferredReconnect=null,U._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=W:W(),this},F.prototype._reconnect=function(){var Z=this;h("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(function(){Z._setupStream()}),h("client already connected. disconnecting first.")):(h("_reconnect: calling _setupStream"),this._setupStream())},F.prototype._setupReconnect=function(){var Z=this;!Z.disconnecting&&!Z.reconnectTimer&&Z.options.reconnectPeriod>0?(this.reconnecting||(h("_setupReconnect :: emit `offline` state"),this.emit("offline"),h("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),h("_setupReconnect :: setting reconnectTimer for %d ms",Z.options.reconnectPeriod),Z.reconnectTimer=setInterval(function(){h("reconnectTimer :: reconnect triggered!"),Z._reconnect()},Z.options.reconnectPeriod)):h("_setupReconnect :: doing nothing...")},F.prototype._clearReconnect=function(){h("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},F.prototype._cleanUp=function(Z,U){var W,S=arguments[2];if(U&&(h("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",U)),h("_cleanUp :: forced? %s",Z),Z)0===this.options.reconnectPeriod&&this.options.clean&&(W=this.outgoing)&&(h("flush: queue exists? %b",!!W),Object.keys(W).forEach(function(G){"function"==typeof W[G].cb&&(W[G].cb(new Error("Connection closed")),delete W[G])})),h("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{var q=E({cmd:"disconnect"},S);h("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(q,O.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(h("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(h("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),U&&!this.connected&&(h("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",U),U())},F.prototype._sendPacket=function(Z,U,W){if(h("_sendPacket :: (%s) :: start",this.options.clientId),W=W||$,!this.connected)return h("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(Z,U,W);switch(this._shiftPingInterval(),Z.cmd){case"publish":break;case"pubrel":return void I(this,Z,U,W);default:return void B(this,Z,U)}switch(Z.qos){case 2:case 1:I(this,Z,U,W);break;case 0:default:B(this,Z,U)}h("_sendPacket :: (%s) :: end",this.options.clientId)},F.prototype._storePacket=function(Z,U,W){h("_storePacket :: packet: %o",Z),h("_storePacket :: cb? %s",!!U),W=W||$,0===(Z.qos||0)&&this.queueQoSZero||"publish"!==Z.cmd?this.queue.push({packet:Z,cb:U}):Z.qos>0?(U=this.outgoing[Z.messageId]?this.outgoing[Z.messageId].cb:null,this.outgoingStore.put(Z,function(S){if(S)return U&&U(S);W()})):U&&U(new Error("No connection to broker"))},F.prototype._setupPingTimer=function(){h("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);var Z=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=M(function(){Z._checkPing()},1e3*this.options.keepalive))},F.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},F.prototype._checkPing=function(){h("_checkPing :: checking ping..."),this.pingResp?(h("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(h("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},F.prototype._handlePingresp=function(){this.pingResp=!0},F.prototype._handleConnack=function(Z){h("_handleConnack");var U=this.options,W=5===U.protocolVersion?Z.reasonCode:Z.returnCode;if(clearTimeout(this.connackTimer),Z.properties&&(Z.properties.topicAliasMaximum&&(U.properties||(U.properties={}),U.properties.topicAliasMaximum=Z.properties.topicAliasMaximum),Z.properties.serverKeepAlive&&U.keepalive&&(U.keepalive=Z.properties.serverKeepAlive,this._shiftPingInterval()),Z.properties.maximumPacketSize&&(U.properties||(U.properties={}),U.properties.maximumPacketSize=Z.properties.maximumPacketSize)),0===W)this.reconnecting=!1,this._onConnect(Z);else if(W>0){var S=new Error("Connection refused: "+R[W]);S.code=W,this.emit("error",S)}},F.prototype._handlePublish=function(Z,U){h("_handlePublish: packet %o",Z),U=void 0!==U?U:$;var W=Z.topic.toString(),S=Z.payload,q=Z.qos,G=Z.messageId,re=this,oe=this.options,se=[0,16,128,131,135,144,145,151,153];switch(h("_handlePublish: qos %d",q),q){case 2:oe.customHandleAcks(W,S,Z,function(Y,N){return Y instanceof Error||(N=Y,Y=null),Y?re.emit("error",Y):-1===se.indexOf(N)?re.emit("error",new Error("Wrong reason code for pubrec")):void(N?re._sendPacket({cmd:"pubrec",messageId:G,reasonCode:N},U):re.incomingStore.put(Z,function(){re._sendPacket({cmd:"pubrec",messageId:G},U)}))});break;case 1:oe.customHandleAcks(W,S,Z,function(Y,N){return Y instanceof Error||(N=Y,Y=null),Y?re.emit("error",Y):-1===se.indexOf(N)?re.emit("error",new Error("Wrong reason code for puback")):(N||re.emit("message",W,S,Z),void re.handleMessage(Z,function(V){if(V)return U&&U(V);re._sendPacket({cmd:"puback",messageId:G,reasonCode:N},U)}))});break;case 0:this.emit("message",W,S,Z),this.handleMessage(Z,U);break;default:h("_handlePublish: unknown QoS. Doing nothing.")}},F.prototype.handleMessage=function(Z,U){U()},F.prototype._handleAck=function(Z){var U,W=Z.messageId,S=Z.cmd,q=null,G=this.outgoing[W]?this.outgoing[W].cb:null,re=this;if(G){switch(h("_handleAck :: packet type",S),S){case"pubcomp":case"puback":var oe=Z.reasonCode;oe&&oe>0&&16!==oe&&((U=new Error("Publish error: "+R[oe])).code=oe,G(U,Z)),delete this.outgoing[W],this.outgoingStore.del(Z,G);break;case"pubrec":q={cmd:"pubrel",qos:2,messageId:W};var se=Z.reasonCode;se&&se>0&&16!==se?((U=new Error("Publish error: "+R[se])).code=se,G(U,Z)):this._sendPacket(q);break;case"suback":delete this.outgoing[W];for(var Y=0;Y<Z.granted.length;Y++)if(0!=(128&Z.granted[Y])){var N=this.messageIdToTopic[W];N&&N.forEach(function(V){delete re._resubscribeTopics[V]})}G(null,Z);break;case"unsuback":delete this.outgoing[W],G(null);break;default:re.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else h("_handleAck :: Server sent an ack in error. Ignoring.")},F.prototype._handlePubrel=function(Z,U){h("handling pubrel packet"),U=void 0!==U?U:$;var W=this,S={cmd:"pubcomp",messageId:Z.messageId};W.incomingStore.get(Z,function(q,G){q?W._sendPacket(S,U):(W.emit("message",G.topic,G.payload,G),W.handleMessage(G,function(re){if(re)return U(re);W.incomingStore.del(G,$),W._sendPacket(S,U)}))})},F.prototype._handleDisconnect=function(Z){this.emit("disconnect",Z)},F.prototype._nextId=function(){var Z=this.nextId++;return 65536===this.nextId&&(this.nextId=1),Z},F.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},F.prototype._resubscribe=function(Z){h("_resubscribe");var U=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!Z.sessionPresent)&&U.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){h("_resubscribe: protocolVersion 5");for(var W=0;W<U.length;W++){var S={};S[U[W]]=this._resubscribeTopics[U[W]],S.resubscribe=!0,this.subscribe(S,{properties:S[U[W]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},F.prototype._onConnect=function(Z){if(this.disconnected)this.emit("connect",Z);else{var U=this;this._setupPingTimer(),this._resubscribe(Z),this.connected=!0,function W(){var S=U.outgoingStore.createStream();function q(){U._storeProcessing=!1,U._packetIdsDuringStoreProcessing={}}function G(){S.destroy(),S=null,q()}U.once("close",G),S.on("error",function(re){q(),U.removeListener("close",G),U.emit("error",re)}),S.on("end",function(){var re=!0;for(var oe in U._packetIdsDuringStoreProcessing)if(!U._packetIdsDuringStoreProcessing[oe]){re=!1;break}re?(q(),U.removeListener("close",G),U.emit("connect",Z)):W()}),function re(){if(S){U._storeProcessing=!0;var oe,se=S.read(1);se?U._packetIdsDuringStoreProcessing[se.messageId]?re():U.disconnecting||U.reconnectTimer?S.destroy&&S.destroy():(oe=U.outgoing[se.messageId]?U.outgoing[se.messageId].cb:null,U.outgoing[se.messageId]={volatile:!1,cb:function(N,V){oe&&oe(N,V),re()}},U._packetIdsDuringStoreProcessing[se.messageId]=!0,U._sendPacket(se)):S.once("readable",re)}}()}()}},X.exports=F}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./store":7,"./validations":8,_process:44,debug:14,events:27,inherits:29,"mqtt-packet":34,"readable-stream":63,reinterval:64,xtend:74}],2:[function(L,X,K){(function(g){"use strict";var b,C,f,d=L("readable-stream").Transform,_=L("duplexify"),m=!1;X.exports=function(M,T){if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");var p,E="MQIsdp"===T.protocolId&&3===T.protocolVersion?"mqttv3.1":"mqtt";(p=T).hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={});var h=function(p,O){var A="alis"===p.protocol?"wss":"ws",P=A+"://"+p.hostname+p.path;return p.port&&80!==p.port&&443!==p.port&&(P=A+"://"+p.hostname+":"+p.port+p.path),"function"==typeof p.transformWsUrl&&(P=p.transformWsUrl(P,p,O)),P}(T,M);return(b=T.my).connectSocket({url:h,protocols:E}),C=function(){var p=new d;return p._write=function(O,A,P){b.sendSocketMessage({data:O.buffer,success:function(){P()},fail:function(){P(new Error)}})},p._flush=function(O){b.closeSocket({success:function(){O()}})},p}(),f=_.obj(),m||(m=!0,b.onSocketOpen(function(){f.setReadable(C),f.setWritable(C),f.emit("connect")}),b.onSocketMessage(function(p){if("string"==typeof p.data){var O=g.from(p.data,"base64");C.push(O)}else{var A=new FileReader;A.addEventListener("load",function(){var P=A.result;P=P instanceof ArrayBuffer?g.from(P):g.from(P,"utf8"),C.push(P)}),A.readAsArrayBuffer(p.data)}}),b.onSocketClose(function(){f.end(),f.destroy()}),b.onSocketError(function(p){f.destroy(p)})),f}}).call(this,L("buffer").Buffer)},{buffer:12,duplexify:16,"readable-stream":63}],3:[function(L,X,K){"use strict";var g=L("net"),b=L("debug")("mqttjs:tcp");X.exports=function(C,f){var d,_;return f.port=f.port||1883,f.hostname=f.hostname||f.host||"localhost",b("port %d and host %s",d=f.port,_=f.hostname),g.createConnection(d,_)}},{debug:14,net:11}],4:[function(L,X,K){"use strict";var g=L("tls"),b=L("debug")("mqttjs:tls");X.exports=function(C,f){var d;function _(m){f.rejectUnauthorized&&C.emit("error",m),d.end()}return f.port=f.port||8883,f.host=f.hostname||f.host||"localhost",f.servername=f.host,f.rejectUnauthorized=!1!==f.rejectUnauthorized,delete f.path,b("port %d host %s rejectUnauthorized %b",f.port,f.host,f.rejectUnauthorized),(d=g.connect(f)).on("secureConnect",function(){f.rejectUnauthorized&&!d.authorized?d.emit("error",new Error("TLS not authorized")):d.removeListener("error",_)}),d.on("error",_),d}},{debug:14,tls:11}],5:[function(L,X,K){(function(g,b){"use strict";var C=L("ws"),f=L("debug")("mqttjs:ws"),d=L("duplexify"),_=L("readable-stream").Transform,m=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],M=void 0!==g&&"browser"===g.title||"function"==typeof ye;function T(h,p){var O=h.protocol+"://"+h.hostname+":"+h.port+h.path;return"function"==typeof h.transformWsUrl&&(O=h.transformWsUrl(O,h,p)),O}function E(h){var p=h;return h.hostname||(p.hostname="localhost"),h.port||(p.port="wss"===h.protocol?443:80),h.path||(p.path="/"),h.wsOptions||(p.wsOptions={}),M||"wss"!==h.protocol||m.forEach(function(O){h.hasOwnProperty(O)&&!h.wsOptions.hasOwnProperty(O)&&(p.wsOptions[O]=h[O])}),p}X.exports=M?function(h,p){var O;f("browserStreamBuilder");var G,re,oe,se,A=function(q){var G=E(q);if(G.hostname||(G.hostname=G.host),!G.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");var re=new URL(document.URL);G.hostname=re.hostname,G.port||(G.port=re.port)}return void 0===G.objectMode&&(G.objectMode=!(!0===G.binary||void 0===G.binary)),G}(p).browserBufferSize||524288,P=p.browserBufferTimeout||1e3,R=!p.objectMode,B=(re="MQIsdp"===(G=p).protocolId&&3===G.protocolVersion?"mqttv3.1":"mqtt",oe=T(G,h),(se=new WebSocket(oe,[re])).binaryType="arraybuffer",se),I=function(q,G,re){var oe=new _({objectModeMode:q.objectMode});return oe._write=function q(G,re,oe){B.bufferedAmount>A&&setTimeout(q,P,G,re,oe),R&&"string"==typeof G&&(G=b.from(G,"utf8"));try{B.send(G)}catch(se){return oe(se)}oe()},oe._flush=function(q){B.close(),q()},oe}(p);p.objectMode||(I._writev=S),I.on("close",function(){B.close()});var $=void 0===B.addEventListener;function F(){O.setReadable(I),O.setWritable(I),O.emit("connect")}function Z(){O.end(),O.destroy()}function U(q){O.destroy(q)}function W(q){var G=q.data;G=G instanceof ArrayBuffer?b.from(G):b.from(G,"utf8"),I.push(G)}function S(q,G){for(var re=new Array(q.length),oe=0;oe<q.length;oe++)re[oe]="string"==typeof q[oe].chunk?b.from(q[oe],"utf8"):q[oe].chunk;this._write(b.concat(re),"binary",G)}return B.readyState===B.OPEN?O=I:(O=O=d(void 0,void 0,p),p.objectMode||(O._writev=S),$?B.addEventListener("open",F):B.onopen=F),O.socket=B,$?(B.addEventListener("close",Z),B.addEventListener("error",U),B.addEventListener("message",W)):(B.onclose=Z,B.onerror=U,B.onmessage=W),O}:function(h,p){f("streamBuilder");var O=E(p),A=T(O,h),P=function(B,I,$){f("createWebSocket"),f("protocol: "+$.protocolId+" "+$.protocolVersion);var F="MQIsdp"===$.protocolId&&3===$.protocolVersion?"mqttv3.1":"mqtt";return f("creating new Websocket for url: "+I+" and protocol: "+F),new C(I,[F],$.wsOptions)}(0,A,O),R=C.createWebSocketStream(P,O.wsOptions);return R.url=A,R}}).call(this,L("_process"),L("buffer").Buffer)},{_process:44,buffer:12,debug:14,duplexify:16,"readable-stream":63,ws:73}],6:[function(L,X,K){(function(g){"use strict";var b,C,f,d=L("readable-stream").Transform,_=L("duplexify");X.exports=function(m,M){if(M.hostname=M.hostname||M.host,!M.hostname)throw new Error("Could not determine host. Specify host manually.");var p,T="MQIsdp"===M.protocolId&&3===M.protocolVersion?"mqttv3.1":"mqtt";(p=M).hostname||(p.hostname="localhost"),p.path||(p.path="/"),p.wsOptions||(p.wsOptions={});var E=function(p,O){var A="wxs"===p.protocol?"wss":"ws",P=A+"://"+p.hostname+p.path;return p.port&&80!==p.port&&443!==p.port&&(P=A+"://"+p.hostname+":"+p.port+p.path),"function"==typeof p.transformWsUrl&&(P=p.transformWsUrl(P,p,O)),P}(M,m);b=wx.connectSocket({url:E,protocols:[T]}),C=function(){var p=new d;return p._write=function(O,A,P){b.send({data:O.buffer,success:function(){P()},fail:function(B){P(new Error(B))}})},p._flush=function(O){b.close({success:function(){O()}})},p}(),(f=_.obj())._destroy=function(p,O){b.close({success:function(){O&&O(p)}})};var h=f.destroy;return f.destroy=function(){f.destroy=h;var p=this;setTimeout(function(){b.close({fail:function(){p._destroy(new Error)}})},0)}.bind(f),b.onOpen(function(){f.setReadable(C),f.setWritable(C),f.emit("connect")}),b.onMessage(function(p){var O=p.data;O=O instanceof ArrayBuffer?g.from(O):g.from(O,"utf8"),C.push(O)}),b.onClose(function(){f.end(),f.destroy()}),b.onError(function(p){f.destroy(new Error(p.errMsg))}),f}}).call(this,L("buffer").Buffer)},{buffer:12,duplexify:16,"readable-stream":63}],7:[function(L,X,K){"use strict";var g=L("xtend"),b=L("readable-stream").Readable,C={objectMode:!0},f={clean:!0};function d(_){if(!(this instanceof d))return new d(_);this.options=_||{},this.options=g(f,_),this._inflights=new Map}d.prototype.put=function(_,m){return this._inflights.set(_.messageId,_),m&&m(),this},d.prototype.createStream=function(){var _=new b(C),m=!1,M=[],T=0;return this._inflights.forEach(function(E,h){M.push(E)}),_._read=function(){this.push(!m&&T<M.length?M[T++]:null)},_.destroy=function(){if(!m){var E=this;m=!0,setTimeout(function(){E.emit("close")},0)}},_},d.prototype.del=function(_,m){return(_=this._inflights.get(_.messageId))?(this._inflights.delete(_.messageId),m(null,_)):m&&m(new Error("missing packet")),this},d.prototype.get=function(_,m){return(_=this._inflights.get(_.messageId))?m(null,_):m&&m(new Error("missing packet")),this},d.prototype.close=function(_){this.options.clean&&(this._inflights=null),_&&_()},X.exports=d},{"readable-stream":63,xtend:74}],8:[function(L,X,K){"use strict";function g(b){for(var C=b.split("/"),f=0;f<C.length;f++)if("+"!==C[f]){if("#"===C[f])return f===C.length-1;if(-1!==C[f].indexOf("+")||-1!==C[f].indexOf("#"))return!1}return!0}X.exports={validateTopics:function(C){if(0===C.length)return"empty_topic_list";for(var f=0;f<C.length;f++)if(!g(C[f]))return C[f];return null}}},{}],9:[function(L,X,K){(function(g){"use strict";var b=L("../client"),C=L("../store"),f=L("url"),d=L("xtend"),_=L("debug")("mqttjs"),m={};function M(T,E){if(_("connecting to an MQTT broker..."),"object"!=typeof T||E||(E=T,T=null),E=E||{},T){var h=f.parse(T,!0);if(null!=h.port&&(h.port=Number(h.port)),null===(E=d(h,E)).protocol)throw new Error("Missing protocol");E.protocol=E.protocol.replace(/:$/,"")}if((A=E).auth&&((P=A.auth.match(/^(.+):(.+)$/))?(A.username=P[1],A.password=P[2]):A.username=A.auth),E.query&&"string"==typeof E.query.clientId&&(E.clientId=E.query.clientId),E.cert&&E.key){if(!E.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(E.protocol))switch(E.protocol){case"mqtt":E.protocol="mqtts";break;case"ws":E.protocol="wss";break;case"wx":E.protocol="wxs";break;case"ali":E.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+E.protocol+'"!')}}var A,P;if(!m[E.protocol]){var p=-1!==["mqtts","wss"].indexOf(E.protocol);E.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(A,P){return(!p||P%2!=0)&&"function"==typeof m[A]})[0]}if(!1===E.clean&&!E.clientId)throw new Error("Missing clientId for unclean clients");E.protocol&&(E.defaultProtocol=E.protocol);var O=new b(function(A){return E.servers&&(A._reconnectCount&&A._reconnectCount!==E.servers.length||(A._reconnectCount=0),E.host=E.servers[A._reconnectCount].host,E.port=E.servers[A._reconnectCount].port,E.protocol=E.servers[A._reconnectCount].protocol?E.servers[A._reconnectCount].protocol:E.defaultProtocol,E.hostname=E.host,A._reconnectCount++),_("calling streambuilder for",E.protocol),m[E.protocol](A,E)},E);return O.on("error",function(){}),O}void 0!==g&&"browser"!==g.title||"function"!=typeof ye?(m.mqtt=L("./tcp"),m.tcp=L("./tcp"),m.ssl=L("./tls"),m.tls=L("./tls"),m.mqtts=L("./tls")):(m.wx=L("./wx"),m.wxs=L("./wx"),m.ali=L("./ali"),m.alis=L("./ali")),m.ws=L("./ws"),m.wss=L("./ws"),X.exports=M,X.exports.connect=M,X.exports.MqttClient=b,X.exports.Store=C}).call(this,L("_process"))},{"../client":1,"../store":7,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:44,debug:14,url:69,xtend:74}],10:[function(L,X,K){"use strict";K.byteLength=function(T){var E=m(T),p=E[1];return 3*(E[0]+p)/4-p},K.toByteArray=function(T){var E,h,F,p=m(T),O=p[0],A=p[1],P=new C(3*(O+(F=A))/4-F),R=0,B=A>0?O-4:O;for(h=0;h<B;h+=4)E=b[T.charCodeAt(h)]<<18|b[T.charCodeAt(h+1)]<<12|b[T.charCodeAt(h+2)]<<6|b[T.charCodeAt(h+3)],P[R++]=E>>16&255,P[R++]=E>>8&255,P[R++]=255&E;return 2===A&&(E=b[T.charCodeAt(h)]<<2|b[T.charCodeAt(h+1)]>>4,P[R++]=255&E),1===A&&(E=b[T.charCodeAt(h)]<<10|b[T.charCodeAt(h+1)]<<4|b[T.charCodeAt(h+2)]>>2,P[R++]=E>>8&255,P[R++]=255&E),P},K.fromByteArray=function(T){for(var E,h=T.length,p=h%3,O=[],A=0,P=h-p;A<P;A+=16383)O.push(M(T,A,A+16383>P?P:A+16383));return 1===p?O.push(g[(E=T[h-1])>>2]+g[E<<4&63]+"=="):2===p&&O.push(g[(E=(T[h-2]<<8)+T[h-1])>>10]+g[E>>4&63]+g[E<<2&63]+"="),O.join("")};for(var g=[],b=[],C="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,_=f.length;d<_;++d)g[d]=f[d],b[f.charCodeAt(d)]=d;function m(T){var E=T.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=T.indexOf("=");return-1===h&&(h=E),[h,h===E?0:4-h%4]}function M(T,E,h){for(var O,A=[],P=E;P<h;P+=3)A.push(g[(O=(T[P]<<16&16711680)+(T[P+1]<<8&65280)+(255&T[P+2]))>>18&63]+g[O>>12&63]+g[O>>6&63]+g[63&O]);return A.join("")}b["-".charCodeAt(0)]=62,b["_".charCodeAt(0)]=63},{}],11:[function(L,X,K){},{}],12:[function(L,X,K){(function(g){"use strict";var b=L("base64-js"),C=L("ieee754");K.Buffer=g,K.SlowBuffer=function(l){return+l!=l&&(l=0),g.alloc(+l)},K.INSPECT_MAX_BYTES=50;var f=2147483647;function d(l){if(l>f)throw new RangeError('The value "'+l+'" is invalid for option "size"');var s=new Uint8Array(l);return s.__proto__=g.prototype,s}function g(l,s,c){if("number"==typeof l){if("string"==typeof s)throw new TypeError('The "string" argument must be of type string. Received type number');return M(l)}return _(l,s,c)}function _(l,s,c){if("string"==typeof l)return function(z,ne){if("string"==typeof ne&&""!==ne||(ne="utf8"),!g.isEncoding(ne))throw new TypeError("Unknown encoding: "+ne);var ae=0|h(z,ne),fe=d(ae),le=fe.write(z,ne);return le!==ae&&(fe=fe.slice(0,le)),fe}(l,s);if(ArrayBuffer.isView(l))return T(l);if(null==l)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(ee(l,ArrayBuffer)||l&&ee(l.buffer,ArrayBuffer))return function(z,ne,ae){if(ne<0||z.byteLength<ne)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<ne+(ae||0))throw new RangeError('"length" is outside of buffer bounds');var fe;return(fe=void 0===ne&&void 0===ae?new Uint8Array(z):void 0===ae?new Uint8Array(z,ne):new Uint8Array(z,ne,ae)).__proto__=g.prototype,fe}(l,s,c);if("number"==typeof l)throw new TypeError('The "value" argument must not be of type number. Received type number');var w=l.valueOf&&l.valueOf();if(null!=w&&w!==l)return g.from(w,s,c);var k=function(z){if(g.isBuffer(z)){var ne=0|E(z.length),ae=d(ne);return 0===ae.length||z.copy(ae,0,0,ne),ae}return void 0!==z.length?"number"!=typeof z.length||te(z.length)?d(0):T(z):"Buffer"===z.type&&Array.isArray(z.data)?T(z.data):void 0}(l);if(k)return k;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof l[Symbol.toPrimitive])return g.from(l[Symbol.toPrimitive]("string"),s,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}function m(l){if("number"!=typeof l)throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function M(l){return m(l),d(l<0?0:0|E(l))}function T(l){for(var s=l.length<0?0:0|E(l.length),c=d(s),w=0;w<s;w+=1)c[w]=255&l[w];return c}function E(l){if(l>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|l}function h(l,s){if(g.isBuffer(l))return l.length;if(ArrayBuffer.isView(l)||ee(l,ArrayBuffer))return l.byteLength;if("string"!=typeof l)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof l);var c=l.length,w=arguments.length>2&&!0===arguments[2];if(!w&&0===c)return 0;for(var k=!1;;)switch(s){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return x(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return D(l).length;default:if(k)return w?-1:x(l).length;s=(""+s).toLowerCase(),k=!0}}function p(l,s,c){var w=l[s];l[s]=l[c],l[c]=w}function O(l,s,c,w,k){if(0===l.length)return-1;if("string"==typeof c?(w=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),te(c=+c)&&(c=k?0:l.length-1),c<0&&(c=l.length+c),c>=l.length){if(k)return-1;c=l.length-1}else if(c<0){if(!k)return-1;c=0}if("string"==typeof s&&(s=g.from(s,w)),g.isBuffer(s))return 0===s.length?-1:A(l,s,c,w,k);if("number"==typeof s)return s&=255,"function"==typeof Uint8Array.prototype.indexOf?k?Uint8Array.prototype.indexOf.call(l,s,c):Uint8Array.prototype.lastIndexOf.call(l,s,c):A(l,[s],c,w,k);throw new TypeError("val must be string, number or Buffer")}function A(l,s,c,w,k){var z,ne=1,ae=l.length,fe=s.length;if(void 0!==w&&("ucs2"===(w=String(w).toLowerCase())||"ucs-2"===w||"utf16le"===w||"utf-16le"===w)){if(l.length<2||s.length<2)return-1;ne=2,ae/=2,fe/=2,c/=2}function le(we,Ce){return 1===ne?we[Ce]:we.readUInt16BE(Ce*ne)}if(k){var ce=-1;for(z=c;z<ae;z++)if(le(l,z)===le(s,-1===ce?0:z-ce)){if(-1===ce&&(ce=z),z-ce+1===fe)return ce*ne}else-1!==ce&&(z-=z-ce),ce=-1}else for(c+fe>ae&&(c=ae-fe),z=c;z>=0;z--){for(var xe=!0,Ne=0;Ne<fe;Ne++)if(le(l,z+Ne)!==le(s,Ne)){xe=!1;break}if(xe)return z}return-1}function P(l,s,c,w){c=Number(c)||0;var k=l.length-c;w?(w=Number(w))>k&&(w=k):w=k;var z=s.length;w>z/2&&(w=z/2);for(var ne=0;ne<w;++ne){var ae=parseInt(s.substr(2*ne,2),16);if(te(ae))return ne;l[c+ne]=ae}return ne}function R(l,s,c,w){return H(x(s,l.length-c),l,c,w)}function B(l,s,c,w){return H(function(k){for(var z=[],ne=0;ne<k.length;++ne)z.push(255&k.charCodeAt(ne));return z}(s),l,c,w)}function I(l,s,c,w){return B(l,s,c,w)}function $(l,s,c,w){return H(D(s),l,c,w)}function F(l,s,c,w){return H(function(k,z){for(var ne,ae,le=[],ce=0;ce<k.length&&!((z-=2)<0);++ce)ae=(ne=k.charCodeAt(ce))>>8,le.push(ne%256),le.push(ae);return le}(s,l.length-c),l,c,w)}function Z(l,s,c){return b.fromByteArray(0===s&&c===l.length?l:l.slice(s,c))}function U(l,s,c){c=Math.min(l.length,c);for(var w=[],k=s;k<c;){var z,ne,ae,fe,le=l[k],ce=null,xe=le>239?4:le>223?3:le>191?2:1;if(k+xe<=c)switch(xe){case 1:le<128&&(ce=le);break;case 2:128==(192&(z=l[k+1]))&&(fe=(31&le)<<6|63&z)>127&&(ce=fe);break;case 3:ne=l[k+2],128==(192&(z=l[k+1]))&&128==(192&ne)&&(fe=(15&le)<<12|(63&z)<<6|63&ne)>2047&&(fe<55296||fe>57343)&&(ce=fe);break;case 4:ne=l[k+2],ae=l[k+3],128==(192&(z=l[k+1]))&&128==(192&ne)&&128==(192&ae)&&(fe=(15&le)<<18|(63&z)<<12|(63&ne)<<6|63&ae)>65535&&fe<1114112&&(ce=fe)}null===ce?(ce=65533,xe=1):ce>65535&&(w.push((ce-=65536)>>>10&1023|55296),ce=56320|1023&ce),w.push(ce),k+=xe}return function(Ne){var we=Ne.length;if(we<=W)return String.fromCharCode.apply(String,Ne);for(var Ce="",he=0;he<we;)Ce+=String.fromCharCode.apply(String,Ne.slice(he,he+=W));return Ce}(w)}K.kMaxLength=f,(g.TYPED_ARRAY_SUPPORT=function(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===l.foo()}catch(s){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192,g.from=function(l,s,c){return _(l,s,c)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array,g.alloc=function(l,s,c){return k=s,z=c,m(w=l),w<=0?d(w):void 0!==k?"string"==typeof z?d(w).fill(k,z):d(w).fill(k):d(w);var w,k,z},g.allocUnsafe=function(l){return M(l)},g.allocUnsafeSlow=function(l){return M(l)},g.isBuffer=function(l){return null!=l&&!0===l._isBuffer&&l!==g.prototype},g.compare=function(l,s){if(ee(l,Uint8Array)&&(l=g.from(l,l.offset,l.byteLength)),ee(s,Uint8Array)&&(s=g.from(s,s.offset,s.byteLength)),!g.isBuffer(l)||!g.isBuffer(s))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===s)return 0;for(var c=l.length,w=s.length,k=0,z=Math.min(c,w);k<z;++k)if(l[k]!==s[k]){c=l[k],w=s[k];break}return c<w?-1:w<c?1:0},g.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},g.concat=function(l,s){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(0===l.length)return g.alloc(0);var c;if(void 0===s)for(s=0,c=0;c<l.length;++c)s+=l[c].length;var w=g.allocUnsafe(s),k=0;for(c=0;c<l.length;++c){var z=l[c];if(ee(z,Uint8Array)&&(z=g.from(z)),!g.isBuffer(z))throw new TypeError('"list" argument must be an Array of Buffers');z.copy(w,k),k+=z.length}return w},g.byteLength=h,g.prototype._isBuffer=!0,g.prototype.swap16=function(){var l=this.length;if(l%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var s=0;s<l;s+=2)p(this,s,s+1);return this},g.prototype.swap32=function(){var l=this.length;if(l%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var s=0;s<l;s+=4)p(this,s,s+3),p(this,s+1,s+2);return this},g.prototype.swap64=function(){var l=this.length;if(l%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var s=0;s<l;s+=8)p(this,s,s+7),p(this,s+1,s+6),p(this,s+2,s+5),p(this,s+3,s+4);return this},g.prototype.toLocaleString=g.prototype.toString=function(){var l=this.length;return 0===l?"":0===arguments.length?U(this,0,l):function(s,c,w){var k=!1;if((void 0===c||c<0)&&(c=0),c>this.length||((void 0===w||w>this.length)&&(w=this.length),w<=0)||(w>>>=0)<=(c>>>=0))return"";for(s||(s="utf8");;)switch(s){case"hex":return G(this,c,w);case"utf8":case"utf-8":return U(this,c,w);case"ascii":return S(this,c,w);case"latin1":case"binary":return q(this,c,w);case"base64":return Z(this,c,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,c,w);default:if(k)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),k=!0}}.apply(this,arguments)},g.prototype.equals=function(l){if(!g.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l||0===g.compare(this,l)},g.prototype.inspect=function(){var l="",s=K.INSPECT_MAX_BYTES;return l=this.toString("hex",0,s).replace(/(.{2})/g,"$1 ").trim(),this.length>s&&(l+=" ... "),"<Buffer "+l+">"},g.prototype.compare=function(l,s,c,w,k){if(ee(l,Uint8Array)&&(l=g.from(l,l.offset,l.byteLength)),!g.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(void 0===s&&(s=0),void 0===c&&(c=l?l.length:0),void 0===w&&(w=0),void 0===k&&(k=this.length),s<0||c>l.length||w<0||k>this.length)throw new RangeError("out of range index");if(w>=k&&s>=c)return 0;if(w>=k)return-1;if(s>=c)return 1;if(this===l)return 0;for(var z=(k>>>=0)-(w>>>=0),ne=(c>>>=0)-(s>>>=0),ae=Math.min(z,ne),fe=this.slice(w,k),le=l.slice(s,c),ce=0;ce<ae;++ce)if(fe[ce]!==le[ce]){z=fe[ce],ne=le[ce];break}return z<ne?-1:ne<z?1:0},g.prototype.includes=function(l,s,c){return-1!==this.indexOf(l,s,c)},g.prototype.indexOf=function(l,s,c){return O(this,l,s,c,!0)},g.prototype.lastIndexOf=function(l,s,c){return O(this,l,s,c,!1)},g.prototype.write=function(l,s,c,w){if(void 0===s)w="utf8",c=this.length,s=0;else if(void 0===c&&"string"==typeof s)w=s,c=this.length,s=0;else{if(!isFinite(s))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");s>>>=0,isFinite(c)?(c>>>=0,void 0===w&&(w="utf8")):(w=c,c=void 0)}var k=this.length-s;if((void 0===c||c>k)&&(c=k),l.length>0&&(c<0||s<0)||s>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");for(var z=!1;;)switch(w){case"hex":return P(this,l,s,c);case"utf8":case"utf-8":return R(this,l,s,c);case"ascii":return B(this,l,s,c);case"latin1":case"binary":return I(this,l,s,c);case"base64":return $(this,l,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,l,s,c);default:if(z)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),z=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var W=4096;function S(l,s,c){var w="";c=Math.min(l.length,c);for(var k=s;k<c;++k)w+=String.fromCharCode(127&l[k]);return w}function q(l,s,c){var w="";c=Math.min(l.length,c);for(var k=s;k<c;++k)w+=String.fromCharCode(l[k]);return w}function G(l,s,c){var w=l.length;(!s||s<0)&&(s=0),(!c||c<0||c>w)&&(c=w);for(var k="",z=s;z<c;++z)k+=v(l[z]);return k}function re(l,s,c){for(var w=l.slice(s,c),k="",z=0;z<w.length;z+=2)k+=String.fromCharCode(w[z]+256*w[z+1]);return k}function oe(l,s,c){if(l%1!=0||l<0)throw new RangeError("offset is not uint");if(l+s>c)throw new RangeError("Trying to access beyond buffer length")}function se(l,s,c,w,k,z){if(!g.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(s>k||s<z)throw new RangeError('"value" argument is out of bounds');if(c+w>l.length)throw new RangeError("Index out of range")}function Y(l,s,c,w,k,z){if(c+w>l.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function N(l,s,c,w,k){return s=+s,c>>>=0,k||Y(l,0,c,4),C.write(l,s,c,w,23,4),c+4}function V(l,s,c,w,k){return s=+s,c>>>=0,k||Y(l,0,c,8),C.write(l,s,c,w,52,8),c+8}g.prototype.slice=function(l,s){var c=this.length;(l=~~l)<0?(l+=c)<0&&(l=0):l>c&&(l=c),(s=void 0===s?c:~~s)<0?(s+=c)<0&&(s=0):s>c&&(s=c),s<l&&(s=l);var w=this.subarray(l,s);return w.__proto__=g.prototype,w},g.prototype.readUIntLE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l],k=1,z=0;++z<s&&(k*=256);)w+=this[l+z]*k;return w},g.prototype.readUIntBE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l+--s],k=1;s>0&&(k*=256);)w+=this[l+--s]*k;return w},g.prototype.readUInt8=function(l,s){return l>>>=0,s||oe(l,1,this.length),this[l]},g.prototype.readUInt16LE=function(l,s){return l>>>=0,s||oe(l,2,this.length),this[l]|this[l+1]<<8},g.prototype.readUInt16BE=function(l,s){return l>>>=0,s||oe(l,2,this.length),this[l]<<8|this[l+1]},g.prototype.readUInt32LE=function(l,s){return l>>>=0,s||oe(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+16777216*this[l+3]},g.prototype.readUInt32BE=function(l,s){return l>>>=0,s||oe(l,4,this.length),16777216*this[l]+(this[l+1]<<16|this[l+2]<<8|this[l+3])},g.prototype.readIntLE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=this[l],k=1,z=0;++z<s&&(k*=256);)w+=this[l+z]*k;return w>=(k*=128)&&(w-=Math.pow(2,8*s)),w},g.prototype.readIntBE=function(l,s,c){l>>>=0,s>>>=0,c||oe(l,s,this.length);for(var w=s,k=1,z=this[l+--w];w>0&&(k*=256);)z+=this[l+--w]*k;return z>=(k*=128)&&(z-=Math.pow(2,8*s)),z},g.prototype.readInt8=function(l,s){return l>>>=0,s||oe(l,1,this.length),128&this[l]?-1*(255-this[l]+1):this[l]},g.prototype.readInt16LE=function(l,s){l>>>=0,s||oe(l,2,this.length);var c=this[l]|this[l+1]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt16BE=function(l,s){l>>>=0,s||oe(l,2,this.length);var c=this[l+1]|this[l]<<8;return 32768&c?4294901760|c:c},g.prototype.readInt32LE=function(l,s){return l>>>=0,s||oe(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},g.prototype.readInt32BE=function(l,s){return l>>>=0,s||oe(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},g.prototype.readFloatLE=function(l,s){return l>>>=0,s||oe(l,4,this.length),C.read(this,l,!0,23,4)},g.prototype.readFloatBE=function(l,s){return l>>>=0,s||oe(l,4,this.length),C.read(this,l,!1,23,4)},g.prototype.readDoubleLE=function(l,s){return l>>>=0,s||oe(l,8,this.length),C.read(this,l,!0,52,8)},g.prototype.readDoubleBE=function(l,s){return l>>>=0,s||oe(l,8,this.length),C.read(this,l,!1,52,8)},g.prototype.writeUIntLE=function(l,s,c,w){l=+l,s>>>=0,c>>>=0,w||se(this,l,s,c,Math.pow(2,8*c)-1,0);var k=1,z=0;for(this[s]=255&l;++z<c&&(k*=256);)this[s+z]=l/k&255;return s+c},g.prototype.writeUIntBE=function(l,s,c,w){l=+l,s>>>=0,c>>>=0,w||se(this,l,s,c,Math.pow(2,8*c)-1,0);var k=c-1,z=1;for(this[s+k]=255&l;--k>=0&&(z*=256);)this[s+k]=l/z&255;return s+c},g.prototype.writeUInt8=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,1,255,0),this[s]=255&l,s+1},g.prototype.writeUInt16LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,65535,0),this[s]=255&l,this[s+1]=l>>>8,s+2},g.prototype.writeUInt16BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,65535,0),this[s]=l>>>8,this[s+1]=255&l,s+2},g.prototype.writeUInt32LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,4294967295,0),this[s+3]=l>>>24,this[s+2]=l>>>16,this[s+1]=l>>>8,this[s]=255&l,s+4},g.prototype.writeUInt32BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,4294967295,0),this[s]=l>>>24,this[s+1]=l>>>16,this[s+2]=l>>>8,this[s+3]=255&l,s+4},g.prototype.writeIntLE=function(l,s,c,w){if(l=+l,s>>>=0,!w){var k=Math.pow(2,8*c-1);se(this,l,s,c,k-1,-k)}var z=0,ne=1,ae=0;for(this[s]=255&l;++z<c&&(ne*=256);)l<0&&0===ae&&0!==this[s+z-1]&&(ae=1),this[s+z]=(l/ne>>0)-ae&255;return s+c},g.prototype.writeIntBE=function(l,s,c,w){if(l=+l,s>>>=0,!w){var k=Math.pow(2,8*c-1);se(this,l,s,c,k-1,-k)}var z=c-1,ne=1,ae=0;for(this[s+z]=255&l;--z>=0&&(ne*=256);)l<0&&0===ae&&0!==this[s+z+1]&&(ae=1),this[s+z]=(l/ne>>0)-ae&255;return s+c},g.prototype.writeInt8=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,1,127,-128),l<0&&(l=255+l+1),this[s]=255&l,s+1},g.prototype.writeInt16LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,32767,-32768),this[s]=255&l,this[s+1]=l>>>8,s+2},g.prototype.writeInt16BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,2,32767,-32768),this[s]=l>>>8,this[s+1]=255&l,s+2},g.prototype.writeInt32LE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,2147483647,-2147483648),this[s]=255&l,this[s+1]=l>>>8,this[s+2]=l>>>16,this[s+3]=l>>>24,s+4},g.prototype.writeInt32BE=function(l,s,c){return l=+l,s>>>=0,c||se(this,l,s,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[s]=l>>>24,this[s+1]=l>>>16,this[s+2]=l>>>8,this[s+3]=255&l,s+4},g.prototype.writeFloatLE=function(l,s,c){return N(this,l,s,!0,c)},g.prototype.writeFloatBE=function(l,s,c){return N(this,l,s,!1,c)},g.prototype.writeDoubleLE=function(l,s,c){return V(this,l,s,!0,c)},g.prototype.writeDoubleBE=function(l,s,c){return V(this,l,s,!1,c)},g.prototype.copy=function(l,s,c,w){if(!g.isBuffer(l))throw new TypeError("argument should be a Buffer");if(c||(c=0),w||0===w||(w=this.length),s>=l.length&&(s=l.length),s||(s=0),w>0&&w<c&&(w=c),w===c||0===l.length||0===this.length)return 0;if(s<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),l.length-s<w-c&&(w=l.length-s+c);var k=w-c;if(this===l&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(s,c,w);else if(this===l&&c<s&&s<w)for(var z=k-1;z>=0;--z)l[z+s]=this[z+c];else Uint8Array.prototype.set.call(l,this.subarray(c,w),s);return k},g.prototype.fill=function(l,s,c,w){if("string"==typeof l){if("string"==typeof s?(w=s,s=0,c=this.length):"string"==typeof c&&(w=c,c=this.length),void 0!==w&&"string"!=typeof w)throw new TypeError("encoding must be a string");if("string"==typeof w&&!g.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(1===l.length){var k=l.charCodeAt(0);("utf8"===w&&k<128||"latin1"===w)&&(l=k)}}else"number"==typeof l&&(l&=255);if(s<0||this.length<s||this.length<c)throw new RangeError("Out of range index");if(c<=s)return this;var z;if(s>>>=0,c=void 0===c?this.length:c>>>0,l||(l=0),"number"==typeof l)for(z=s;z<c;++z)this[z]=l;else{var ne=g.isBuffer(l)?l:g.from(l,w),ae=ne.length;if(0===ae)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(z=0;z<c-s;++z)this[z+s]=ne[z%ae]}return this};var Q=/[^+/0-9A-Za-z-_]/g;function v(l){return l<16?"0"+l.toString(16):l.toString(16)}function x(l,s){var c;s=s||1/0;for(var w=l.length,k=null,z=[],ne=0;ne<w;++ne){if((c=l.charCodeAt(ne))>55295&&c<57344){if(!k){if(c>56319){(s-=3)>-1&&z.push(239,191,189);continue}if(ne+1===w){(s-=3)>-1&&z.push(239,191,189);continue}k=c;continue}if(c<56320){(s-=3)>-1&&z.push(239,191,189),k=c;continue}c=65536+(k-55296<<10|c-56320)}else k&&(s-=3)>-1&&z.push(239,191,189);if(k=null,c<128){if((s-=1)<0)break;z.push(c)}else if(c<2048){if((s-=2)<0)break;z.push(c>>6|192,63&c|128)}else if(c<65536){if((s-=3)<0)break;z.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((s-=4)<0)break;z.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return z}function D(l){return b.toByteArray(function(s){if((s=(s=s.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;s.length%4!=0;)s+="=";return s}(l))}function H(l,s,c,w){for(var k=0;k<w&&!(k+c>=s.length||k>=l.length);++k)s[k+c]=l[k];return k}function ee(l,s){return l instanceof s||null!=l&&null!=l.constructor&&null!=l.constructor.name&&l.constructor.name===s.name}function te(l){return l!=l}}).call(this,L("buffer").Buffer)},{"base64-js":10,buffer:12,ieee754:28}],13:[function(L,X,K){(function(g){function b(C){return Object.prototype.toString.call(C)}K.isArray=function(C){return Array.isArray?Array.isArray(C):"[object Array]"===b(C)},K.isBoolean=function(C){return"boolean"==typeof C},K.isNull=function(C){return null===C},K.isNullOrUndefined=function(C){return null==C},K.isNumber=function(C){return"number"==typeof C},K.isString=function(C){return"string"==typeof C},K.isSymbol=function(C){return"symbol"==typeof C},K.isUndefined=function(C){return void 0===C},K.isRegExp=function(C){return"[object RegExp]"===b(C)},K.isObject=function(C){return"object"==typeof C&&null!==C},K.isDate=function(C){return"[object Date]"===b(C)},K.isError=function(C){return"[object Error]"===b(C)||C instanceof Error},K.isFunction=function(C){return"function"==typeof C},K.isPrimitive=function(C){return null===C||"boolean"==typeof C||"number"==typeof C||"string"==typeof C||"symbol"==typeof C||void 0===C},K.isBuffer=g.isBuffer}).call(this,{isBuffer:L("../../is-buffer/index.js")})},{"../../is-buffer/index.js":30}],14:[function(L,X,K){(function(g){K.log=function(){var C;return"object"==typeof console&&console.log&&(C=console).log.apply(C,arguments)},K.formatArgs=function(C){if(C[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+C[0]+(this.useColors?"%c ":" ")+"+"+X.exports.humanize(this.diff),this.useColors){var f="color: "+this.color;C.splice(1,0,f,"color: inherit");var d=0,_=0;C[0].replace(/%[a-zA-Z%]/g,function(m){"%%"!==m&&"%c"===m&&(_=++d)}),C.splice(_,0,f)}},K.save=function(C){try{C?K.storage.setItem("debug",C):K.storage.removeItem("debug")}catch(f){}},K.load=function(){var C;try{C=K.storage.getItem("debug")}catch(f){}return!C&&void 0!==g&&"env"in g&&(C=g.env.DEBUG),C},K.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},K.storage=function(){try{return localStorage}catch(C){}}(),K.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],X.exports=L("./common")(K),X.exports.formatters.j=function(C){try{return JSON.stringify(C)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}}).call(this,L("_process"))},{"./common":15,_process:44}],15:[function(L,X,K){X.exports=function(g){function b(m){for(var M=0,T=0;T<m.length;T++)M=(M<<5)-M+m.charCodeAt(T),M|=0;return C.colors[Math.abs(M)%C.colors.length]}function C(m){var M;function T(){for(var E=arguments.length,h=new Array(E),p=0;p<E;p++)h[p]=arguments[p];if(T.enabled){var O=T,A=Number(new Date);O.diff=A-(M||A),O.prev=M,O.curr=A,M=A,h[0]=C.coerce(h[0]),"string"!=typeof h[0]&&h.unshift("%O");var R=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,function(B,I){if("%%"===B)return B;R++;var $=C.formatters[I];return"function"==typeof $&&(B=$.call(O,h[R]),h.splice(R,1),R--),B}),C.formatArgs.call(O,h),(O.log||C.log).apply(O,h)}}return T.namespace=m,T.enabled=C.enabled(m),T.useColors=C.useColors(),T.color=b(m),T.destroy=f,T.extend=d,"function"==typeof C.init&&C.init(T),C.instances.push(T),T}function f(){var m=C.instances.indexOf(this);return-1!==m&&(C.instances.splice(m,1),!0)}function d(m,M){var T=C(this.namespace+(void 0===M?":":M)+m);return T.log=this.log,T}function _(m){return m.toString().substring(2,m.toString().length-2).replace(/\.\*\?$/,"*")}return C.debug=C,C.default=C,C.coerce=function(m){return m instanceof Error?m.stack||m.message:m},C.disable=function(){var m=[].concat(gt(C.names.map(_)),gt(C.skips.map(_).map(function(M){return"-"+M}))).join(",");return C.enable(""),m},C.enable=function(m){var M;C.save(m),C.names=[],C.skips=[];var T=("string"==typeof m?m:"").split(/[\s,]+/),E=T.length;for(M=0;M<E;M++)T[M]&&("-"===(m=T[M].replace(/\*/g,".*?"))[0]?C.skips.push(new RegExp("^"+m.substr(1)+"$")):C.names.push(new RegExp("^"+m+"$")));for(M=0;M<C.instances.length;M++){var h=C.instances[M];h.enabled=C.enabled(h.namespace)}},C.enabled=function(m){if("*"===m[m.length-1])return!0;var M,T;for(M=0,T=C.skips.length;M<T;M++)if(C.skips[M].test(m))return!1;for(M=0,T=C.names.length;M<T;M++)if(C.names[M].test(m))return!0;return!1},C.humanize=L("ms"),Object.keys(g).forEach(function(m){C[m]=g[m]}),C.instances=[],C.names=[],C.skips=[],C.formatters={},C.selectColor=b,C.enable(C.load()),C}},{ms:41}],16:[function(L,X,K){(function(g,b){var C=L("readable-stream"),f=L("end-of-stream"),d=L("inherits"),_=L("stream-shift"),m=b.from&&b.from!==Uint8Array.from?b.from([0]):new b([0]),M=function(p,O){p._corked?p.once("uncork",O):O()},T=function(p,O){return function(A){var P;A?(P=p)._autoDestroy&&P.destroy("premature close"===A.message?null:A):O&&!p._ended&&p.end()}},E=function h(p,O,A){if(!(this instanceof h))return new h(p,O,A);C.Duplex.call(this,A),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!A||!1!==A.autoDestroy,this._forwardDestroy=!A||!1!==A.destroy,this._forwardEnd=!A||!1!==A.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,p&&this.setWritable(p),O&&this.setReadable(O)};d(E,C.Duplex),E.obj=function(h,p,O){return O||(O={}),O.objectMode=!0,O.highWaterMark=16,new E(h,p,O)},E.prototype.cork=function(){1==++this._corked&&this.emit("cork")},E.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},E.prototype.setWritable=function(h){if(this._unwrite&&this._unwrite(),this.destroyed)h&&h.destroy&&h.destroy();else if(null!==h&&!1!==h){var p=this,O=f(h,{writable:!0,readable:!1},T(this,this._forwardEnd)),A=function(){var R=p._ondrain;p._ondrain=null,R&&R()};this._unwrite&&g.nextTick(A),this._writable=h,this._writable.on("drain",A),this._unwrite=function(){p._writable.removeListener("drain",A),O()},this.uncork()}else this.end()},E.prototype.setReadable=function(h){if(this._unread&&this._unread(),this.destroyed)h&&h.destroy&&h.destroy();else{if(null===h||!1===h)return this.push(null),void this.resume();var p,O=this,A=f(h,{writable:!1,readable:!0},T(this)),P=function(){O._forward()},R=function(){O.push(null)};this._drained=!0,this._readable=h,this._readable2=h._readableState?h:(p=h,new C.Readable({objectMode:!0,highWaterMark:16}).wrap(p)),this._readable2.on("readable",P),this._readable2.on("end",R),this._unread=function(){O._readable2.removeListener("readable",P),O._readable2.removeListener("end",R),A()},this._forward()}},E.prototype._read=function(){this._drained=!0,this._forward()},E.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var h;for(this._forwarding=!0;this._drained&&null!==(h=_(this._readable2));)this.destroyed||(this._drained=this.push(h));this._forwarding=!1}},E.prototype.destroy=function(h){if(!this.destroyed){this.destroyed=!0;var p=this;g.nextTick(function(){p._destroy(h)})}},E.prototype._destroy=function(h){if(h){var p=this._ondrain;this._ondrain=null,p?p(h):this.emit("error",h)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},E.prototype._write=function(h,p,O){return this.destroyed?O():this._corked?M(this,this._write.bind(this,h,p,O)):h===m?this._finish(O):this._writable?void(!1===this._writable.write(h)?this._ondrain=O:O()):O()},E.prototype._finish=function(h){var p=this;this.emit("preend"),M(this,function(){var O,A;A=function(){!1===p._writableState.prefinished&&(p._writableState.prefinished=!0),p.emit("prefinish"),M(p,h)},(O=p._forwardEnd&&p._writable)?O._writableState&&O._writableState.finished?A():O._writableState?O.end(A):(O.end(),A()):A()})},E.prototype.end=function(h,p,O){return"function"==typeof h?this.end(null,null,h):"function"==typeof p?this.end(h,null,p):(this._ended=!0,h&&this.write(h),this._writableState.ending||this.write(m),C.Writable.prototype.end.call(this,O))},X.exports=E}).call(this,L("_process"),L("buffer").Buffer)},{_process:44,buffer:12,"end-of-stream":26,inherits:29,"readable-stream":25,"stream-shift":66}],17:[function(L,X,K){"use strict";var g=L("process-nextick-args"),b=Object.keys||function(p){var O=[];for(var A in p)O.push(A);return O};X.exports=T;var C=Object.create(L("core-util-is"));C.inherits=L("inherits");var f=L("./_stream_readable"),d=L("./_stream_writable");C.inherits(T,f);for(var _=b(d.prototype),m=0;m<_.length;m++){var M=_[m];T.prototype[M]||(T.prototype[M]=d.prototype[M])}function T(p){if(!(this instanceof T))return new T(p);f.call(this,p),d.call(this,p),p&&!1===p.readable&&(this.readable=!1),p&&!1===p.writable&&(this.writable=!1),this.allowHalfOpen=!0,p&&!1===p.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",E)}function E(){this.allowHalfOpen||this._writableState.ended||g.nextTick(h,this)}function h(p){p.end()}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(T.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(O){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=O,this._writableState.destroyed=O)}}),T.prototype._destroy=function(p,O){this.push(null),this.end(),g.nextTick(O,p)}},{"./_stream_readable":19,"./_stream_writable":21,"core-util-is":13,inherits:29,"process-nextick-args":43}],18:[function(L,X,K){"use strict";X.exports=C;var g=L("./_stream_transform"),b=Object.create(L("core-util-is"));function C(f){if(!(this instanceof C))return new C(f);g.call(this,f)}b.inherits=L("inherits"),b.inherits(C,g),C.prototype._transform=function(f,d,_){_(null,f)}},{"./_stream_transform":20,"core-util-is":13,inherits:29}],19:[function(L,X,K){(function(g,b){"use strict";var C=L("process-nextick-args");X.exports=I;var f,d=L("isarray");I.ReadableState=B,L("events");var _=function(x,D){return x.listeners(D).length},m=L("./internal/streams/stream"),M=L("safe-buffer").Buffer,T=b.Uint8Array||function(){},E=Object.create(L("core-util-is"));E.inherits=L("inherits");var h=L("util"),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var O,A=L("./internal/streams/BufferList"),P=L("./internal/streams/destroy");E.inherits(I,m);var R=["error","close","destroy","pause","resume"];function B(v,x){var D=x instanceof(f=f||L("./_stream_duplex"));this.objectMode=!!(v=v||{}).objectMode,D&&(this.objectMode=this.objectMode||!!v.readableObjectMode);var H=v.highWaterMark,ee=v.readableHighWaterMark;this.highWaterMark=H||0===H?H:D&&(ee||0===ee)?ee:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=v.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,v.encoding&&(O||(O=L("string_decoder/").StringDecoder),this.decoder=new O(v.encoding),this.encoding=v.encoding)}function I(v){if(f=f||L("./_stream_duplex"),!(this instanceof I))return new I(v);this._readableState=new B(v,this),this.readable=!0,v&&("function"==typeof v.read&&(this._read=v.read),"function"==typeof v.destroy&&(this._destroy=v.destroy)),m.call(this)}function $(v,x,D,H,ee){var te,s,c,w,k,l=v._readableState;return null===x?(l.reading=!1,function(s,c){if(!c.ended){if(c.decoder){var w=c.decoder.end();w&&w.length&&(c.buffer.push(w),c.length+=c.objectMode?1:w.length)}c.ended=!0,W(s)}}(v,l)):(ee||(s=l,M.isBuffer(k=c=x)||k instanceof T||"string"==typeof c||void 0===c||s.objectMode||(w=new TypeError("Invalid non-string/buffer chunk")),te=w),te?v.emit("error",te):l.objectMode||x&&x.length>0?("string"==typeof x||l.objectMode||Object.getPrototypeOf(x)===M.prototype||(x=function(s){return M.from(s)}(x)),H?l.endEmitted?v.emit("error",new Error("stream.unshift() after end event")):F(v,l,x,!0):l.ended?v.emit("error",new Error("stream.push() after EOF")):(l.reading=!1,l.decoder&&!D?(x=l.decoder.write(x),l.objectMode||0!==x.length?F(v,l,x,!1):q(v,l)):F(v,l,x,!1))):H||(l.reading=!1)),function(s){return!s.ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}(l)}function F(v,x,D,H){x.flowing&&0===x.length&&!x.sync?(v.emit("data",D),v.read(0)):(x.length+=x.objectMode?1:D.length,H?x.buffer.unshift(D):x.buffer.push(D),x.needReadable&&W(v)),q(v,x)}Object.defineProperty(I.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),I.prototype.destroy=P.destroy,I.prototype._undestroy=P.undestroy,I.prototype._destroy=function(v,x){this.push(null),x(v)},I.prototype.push=function(v,x){var D,H=this._readableState;return H.objectMode?D=!0:"string"==typeof v&&((x=x||H.defaultEncoding)!==H.encoding&&(v=M.from(v,x),x=""),D=!0),$(this,v,x,!1,D)},I.prototype.unshift=function(v){return $(this,v,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(v){return O||(O=L("string_decoder/").StringDecoder),this._readableState.decoder=new O(v),this._readableState.encoding=v,this};var Z=8388608;function U(v,x){return v<=0||0===x.length&&x.ended?0:x.objectMode?1:v!=v?x.flowing&&x.length?x.buffer.head.data.length:x.length:(v>x.highWaterMark&&(x.highWaterMark=((D=v)>=Z?D=Z:(D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++),D)),v<=x.length?v:x.ended?x.length:(x.needReadable=!0,0));var D}function W(v){var x=v._readableState;x.needReadable=!1,x.emittedReadable||(p("emitReadable",x.flowing),x.emittedReadable=!0,x.sync?C.nextTick(S,v):S(v))}function S(v){p("emit readable"),v.emit("readable"),se(v)}function q(v,x){x.readingMore||(x.readingMore=!0,C.nextTick(G,v,x))}function G(v,x){for(var D=x.length;!x.reading&&!x.flowing&&!x.ended&&x.length<x.highWaterMark&&(p("maybeReadMore read 0"),v.read(0),D!==x.length);)D=x.length;x.readingMore=!1}function re(v){p("readable nexttick read 0"),v.read(0)}function oe(v,x){x.reading||(p("resume read 0"),v.read(0)),x.resumeScheduled=!1,x.awaitDrain=0,v.emit("resume"),se(v),x.flowing&&!x.reading&&v.read(0)}function se(v){var x=v._readableState;for(p("flow",x.flowing);x.flowing&&null!==v.read(););}function Y(v,x){return 0===x.length?null:(x.objectMode?D=x.buffer.shift():!v||v>=x.length?(D=x.decoder?x.buffer.join(""):1===x.buffer.length?x.buffer.head.data:x.buffer.concat(x.length),x.buffer.clear()):(te=x.decoder,(H=v)<(ee=x.buffer).head.data.length?(l=ee.head.data.slice(0,H),ee.head.data=ee.head.data.slice(H)):l=H===ee.head.data.length?ee.shift():te?function(s,c){var w=c.head,k=1,z=w.data;for(s-=z.length;w=w.next;){var ne=w.data,ae=s>ne.length?ne.length:s;if(z+=ae===ne.length?ne:ne.slice(0,s),0==(s-=ae)){ae===ne.length?(++k,c.head=w.next?w.next:c.tail=null):(c.head=w,w.data=ne.slice(ae));break}++k}return c.length-=k,z}(H,ee):function(s,c){var w=M.allocUnsafe(s),k=c.head,z=1;for(k.data.copy(w),s-=k.data.length;k=k.next;){var ne=k.data,ae=s>ne.length?ne.length:s;if(ne.copy(w,w.length-s,0,ae),0==(s-=ae)){ae===ne.length?(++z,c.head=k.next?k.next:c.tail=null):(c.head=k,k.data=ne.slice(ae));break}++z}return c.length-=z,w}(H,ee),D=l),D);var H,ee,te,l,D}function N(v){var x=v._readableState;if(x.length>0)throw new Error('"endReadable()" called on non-empty stream');x.endEmitted||(x.ended=!0,C.nextTick(V,x,v))}function V(v,x){v.endEmitted||0!==v.length||(v.endEmitted=!0,x.readable=!1,x.emit("end"))}function Q(v,x){for(var D=0,H=v.length;D<H;D++)if(v[D]===x)return D;return-1}I.prototype.read=function(v){p("read",v),v=parseInt(v,10);var x=this._readableState,D=v;if(0!==v&&(x.emittedReadable=!1),0===v&&x.needReadable&&(x.length>=x.highWaterMark||x.ended))return p("read: emitReadable",x.length,x.ended),0===x.length&&x.ended?N(this):W(this),null;if(0===(v=U(v,x))&&x.ended)return 0===x.length&&N(this),null;var H,ee=x.needReadable;return p("need readable",ee),(0===x.length||x.length-v<x.highWaterMark)&&p("length less than watermark",ee=!0),x.ended||x.reading?p("reading or ended",ee=!1):ee&&(p("do read"),x.reading=!0,x.sync=!0,0===x.length&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(v=U(D,x))),null===(H=v>0?Y(v,x):null)?(x.needReadable=!0,v=0):x.length-=v,0===x.length&&(x.ended||(x.needReadable=!0),D!==v&&x.ended&&N(this)),null!==H&&this.emit("data",H),H},I.prototype._read=function(v){this.emit("error",new Error("_read() is not implemented"))},I.prototype.pipe=function(v,x){var D=this,H=this._readableState;switch(H.pipesCount){case 0:H.pipes=v;break;case 1:H.pipes=[H.pipes,v];break;default:H.pipes.push(v)}H.pipesCount+=1,p("pipe count=%d opts=%j",H.pipesCount,x);var ee=x&&!1===x.end||v===g.stdout||v===g.stderr?fe:l;function l(){p("onend"),v.end()}H.endEmitted?C.nextTick(ee):D.once("end",ee),v.on("unpipe",function te(le,ce){p("onunpipe"),le===D&&ce&&!1===ce.hasUnpiped&&(ce.hasUnpiped=!0,p("cleanup"),v.removeListener("close",ne),v.removeListener("finish",ae),v.removeListener("drain",s),v.removeListener("error",z),v.removeListener("unpipe",te),D.removeListener("end",l),D.removeListener("end",fe),D.removeListener("data",k),c=!0,!H.awaitDrain||v._writableState&&!v._writableState.needDrain||s())});var le,s=(le=D,function(){var ce=le._readableState;p("pipeOnDrain",ce.awaitDrain),ce.awaitDrain&&ce.awaitDrain--,0===ce.awaitDrain&&_(le,"data")&&(ce.flowing=!0,se(le))});v.on("drain",s);var c=!1,w=!1;function k(le){p("ondata"),w=!1,!1!==v.write(le)||w||((1===H.pipesCount&&H.pipes===v||H.pipesCount>1&&-1!==Q(H.pipes,v))&&!c&&(p("false write response, pause",D._readableState.awaitDrain),D._readableState.awaitDrain++,w=!0),D.pause())}function z(le){p("onerror",le),fe(),v.removeListener("error",z),0===_(v,"error")&&v.emit("error",le)}function ne(){v.removeListener("finish",ae),fe()}function ae(){p("onfinish"),v.removeListener("close",ne),fe()}function fe(){p("unpipe"),D.unpipe(v)}return D.on("data",k),function(le,ce,xe){if("function"==typeof le.prependListener)return le.prependListener(ce,xe);le._events&&le._events[ce]?d(le._events[ce])?le._events[ce].unshift(xe):le._events[ce]=[xe,le._events[ce]]:le.on(ce,xe)}(v,"error",z),v.once("close",ne),v.once("finish",ae),v.emit("pipe",D),H.flowing||(p("pipe resume"),D.resume()),v},I.prototype.unpipe=function(v){var x=this._readableState,D={hasUnpiped:!1};if(0===x.pipesCount)return this;if(1===x.pipesCount)return v&&v!==x.pipes||(v||(v=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,v&&v.emit("unpipe",this,D)),this;if(!v){var H=x.pipes,ee=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var te=0;te<ee;te++)H[te].emit("unpipe",this,D);return this}var l=Q(x.pipes,v);return-1===l||(x.pipes.splice(l,1),x.pipesCount-=1,1===x.pipesCount&&(x.pipes=x.pipes[0]),v.emit("unpipe",this,D)),this},I.prototype.addListener=I.prototype.on=function(v,x){var D=m.prototype.on.call(this,v,x);if("data"===v)!1!==this._readableState.flowing&&this.resume();else if("readable"===v){var H=this._readableState;H.endEmitted||H.readableListening||(H.readableListening=H.needReadable=!0,H.emittedReadable=!1,H.reading?H.length&&W(this):C.nextTick(re,this))}return D},I.prototype.resume=function(){var D,v=this._readableState;return v.flowing||(p("resume"),v.flowing=!0,this,(D=v).resumeScheduled||(D.resumeScheduled=!0,C.nextTick(oe,this,D))),this},I.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},I.prototype.wrap=function(v){var x=this,D=this._readableState,H=!1;for(var ee in v.on("end",function(){if(p("wrapped end"),D.decoder&&!D.ended){var l=D.decoder.end();l&&l.length&&x.push(l)}x.push(null)}),v.on("data",function(l){p("wrapped data"),D.decoder&&(l=D.decoder.write(l)),(!D.objectMode||null!=l)&&(D.objectMode||l&&l.length)&&(x.push(l)||(H=!0,v.pause()))}),v)void 0===this[ee]&&"function"==typeof v[ee]&&(this[ee]=function(l){return function(){return v[l].apply(v,arguments)}}(ee));for(var te=0;te<R.length;te++)v.on(R[te],this.emit.bind(this,R[te]));return this._read=function(l){p("wrapped _read",l),H&&(H=!1,v.resume())},this},Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),I._fromList=Y}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":17,"./internal/streams/BufferList":22,"./internal/streams/destroy":23,"./internal/streams/stream":24,_process:44,"core-util-is":13,events:27,inherits:29,isarray:31,"process-nextick-args":43,"safe-buffer":65,"string_decoder/":67,util:11}],20:[function(L,X,K){"use strict";X.exports=C;var g=L("./_stream_duplex"),b=Object.create(L("core-util-is"));function C(_){if(!(this instanceof C))return new C(_);g.call(this,_),this._transformState={afterTransform:function(m,M){var T=this._transformState;T.transforming=!1;var E=T.writecb;if(!E)return this.emit("error",new Error("write callback called multiple times"));T.writechunk=null,T.writecb=null,null!=M&&this.push(M),E(m);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,_&&("function"==typeof _.transform&&(this._transform=_.transform),"function"==typeof _.flush&&(this._flush=_.flush)),this.on("prefinish",f)}function f(){var _=this;"function"==typeof this._flush?this._flush(function(m,M){d(_,m,M)}):d(this,null,null)}function d(_,m,M){if(m)return _.emit("error",m);if(null!=M&&_.push(M),_._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(_._transformState.transforming)throw new Error("Calling transform done when still transforming");return _.push(null)}b.inherits=L("inherits"),b.inherits(C,g),C.prototype.push=function(_,m){return this._transformState.needTransform=!1,g.prototype.push.call(this,_,m)},C.prototype._transform=function(_,m,M){throw new Error("_transform() is not implemented")},C.prototype._write=function(_,m,M){var T=this._transformState;if(T.writecb=M,T.writechunk=_,T.writeencoding=m,!T.transforming){var E=this._readableState;(T.needTransform||E.needReadable||E.length<E.highWaterMark)&&this._read(E.highWaterMark)}},C.prototype._read=function(_){var m=this._transformState;null!==m.writechunk&&m.writecb&&!m.transforming?(m.transforming=!0,this._transform(m.writechunk,m.writeencoding,m.afterTransform)):m.needTransform=!0},C.prototype._destroy=function(_,m){var M=this;g.prototype._destroy.call(this,_,function(T){m(T),M.emit("close")})}},{"./_stream_duplex":17,"core-util-is":13,inherits:29}],21:[function(L,X,K){(function(g,b,C){"use strict";var f=L("process-nextick-args");function d(S){var q=this;this.next=null,this.entry=null,this.finish=function(){!function(G,re,oe){var se=G.entry;for(G.entry=null;se;){var Y=se.callback;re.pendingcb--,Y(undefined),se=se.next}re.corkedRequestsFree?re.corkedRequestsFree.next=G:re.corkedRequestsFree=G}(q,S)}}X.exports=B;var _,m=!g.browser&&["v0.10","v0.9."].indexOf(g.version.slice(0,5))>-1?C:f.nextTick;B.WritableState=R;var M=Object.create(L("core-util-is"));M.inherits=L("inherits");var O,T={deprecate:L("util-deprecate")},E=L("./internal/streams/stream"),h=L("safe-buffer").Buffer,p=b.Uint8Array||function(){},A=L("./internal/streams/destroy");function P(){}function R(S,q){_=_||L("./_stream_duplex");var G=q instanceof _;this.objectMode=!!(S=S||{}).objectMode,G&&(this.objectMode=this.objectMode||!!S.writableObjectMode);var re=S.highWaterMark,oe=S.writableHighWaterMark;this.highWaterMark=re||0===re?re:G&&(oe||0===oe)?oe:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===S.decodeStrings),this.defaultEncoding=S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(N){!function(V,Q){var ee,v=V._writableState,x=v.sync,D=v.writecb;if((ee=v).writing=!1,ee.writecb=null,ee.length-=ee.writelen,ee.writelen=0,Q)!function(ee,te,l,s,c){--te.pendingcb,l?(f.nextTick(c,s),f.nextTick(W,ee,te),ee._writableState.errorEmitted=!0,ee.emit("error",s)):(c(s),ee._writableState.errorEmitted=!0,ee.emit("error",s),W(ee,te))}(V,v,x,Q,D);else{var H=Z(v);H||v.corked||v.bufferProcessing||!v.bufferedRequest||F(V,v),x?m($,V,v,H,D):$(V,v,H,D)}}(q,N)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}function B(S){if(_=_||L("./_stream_duplex"),!(O.call(B,this)||this instanceof _))return new B(S);this._writableState=new R(S,this),this.writable=!0,S&&("function"==typeof S.write&&(this._write=S.write),"function"==typeof S.writev&&(this._writev=S.writev),"function"==typeof S.destroy&&(this._destroy=S.destroy),"function"==typeof S.final&&(this._final=S.final)),E.call(this)}function I(S,q,G,re,oe,se,Y){q.writelen=re,q.writecb=Y,q.writing=!0,q.sync=!0,G?S._writev(oe,q.onwrite):S._write(oe,se,q.onwrite),q.sync=!1}function $(S,q,G,re){var oe,se;G||(oe=S,0===(se=q).length&&se.needDrain&&(se.needDrain=!1,oe.emit("drain"))),q.pendingcb--,re(),W(S,q)}function F(S,q){q.bufferProcessing=!0;var G=q.bufferedRequest;if(S._writev&&G&&G.next){var oe=new Array(q.bufferedRequestCount),se=q.corkedRequestsFree;se.entry=G;for(var Y=0,N=!0;G;)oe[Y]=G,G.isBuf||(N=!1),G=G.next,Y+=1;oe.allBuffers=N,I(S,q,!0,q.length,oe,"",se.finish),q.pendingcb++,q.lastBufferedRequest=null,se.next?(q.corkedRequestsFree=se.next,se.next=null):q.corkedRequestsFree=new d(q),q.bufferedRequestCount=0}else{for(;G;){var V=G.chunk;if(I(S,q,!1,q.objectMode?1:V.length,V,G.encoding,G.callback),G=G.next,q.bufferedRequestCount--,q.writing)break}null===G&&(q.lastBufferedRequest=null)}q.bufferedRequest=G,q.bufferProcessing=!1}function Z(S){return S.ending&&0===S.length&&null===S.bufferedRequest&&!S.finished&&!S.writing}function U(S,q){S._final(function(G){q.pendingcb--,G&&S.emit("error",G),q.prefinished=!0,S.emit("prefinish"),W(S,q)})}function W(S,q){var re,oe,G=Z(q);return G&&(re=S,(oe=q).prefinished||oe.finalCalled||("function"==typeof re._final?(oe.pendingcb++,oe.finalCalled=!0,f.nextTick(U,re,oe)):(oe.prefinished=!0,re.emit("prefinish"))),0===q.pendingcb&&(q.finished=!0,S.emit("finish"))),G}M.inherits(B,E),R.prototype.getBuffer=function(){for(var S=this.bufferedRequest,q=[];S;)q.push(S),S=S.next;return q},function(){try{Object.defineProperty(R.prototype,"buffer",{get:T.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(S){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(O=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(q){return!!O.call(this,q)||this===B&&q&&q._writableState instanceof R}})):O=function(q){return q instanceof this},B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},B.prototype.write=function(S,q,G){var re,N,V,Q,oe=this._writableState,se=!1,Y=!oe.objectMode&&(h.isBuffer(re=S)||re instanceof p);return Y&&!h.isBuffer(S)&&(S=h.from(S)),"function"==typeof q&&(G=q,q=null),Y?q="buffer":q||(q=oe.defaultEncoding),"function"!=typeof G&&(G=P),oe.ended?(N=this,V=G,Q=new Error("write after end"),N.emit("error",Q),f.nextTick(V,Q)):(Y||function(N,V,Q,v){var x=!0,D=!1;return null===Q?D=new TypeError("May not write null values to stream"):"string"==typeof Q||void 0===Q||V.objectMode||(D=new TypeError("Invalid non-string/buffer chunk")),D&&(N.emit("error",D),f.nextTick(v,D),x=!1),x}(this,oe,S,G))&&(oe.pendingcb++,se=function(N,V,Q,v,x,D){if(!Q){var H=(c=v,(s=V).objectMode||!1===s.decodeStrings||"string"!=typeof c||(c=h.from(c,x)),c);v!==H&&(Q=!0,x="buffer",v=H)}var s,c,ee=V.objectMode?1:v.length;V.length+=ee;var te=V.length<V.highWaterMark;if(te||(V.needDrain=!0),V.writing||V.corked){var l=V.lastBufferedRequest;V.lastBufferedRequest={chunk:v,encoding:x,isBuf:Q,callback:D,next:null},l?l.next=V.lastBufferedRequest:V.bufferedRequest=V.lastBufferedRequest,V.bufferedRequestCount+=1}else I(N,V,!1,ee,v,x,D);return te}(this,oe,Y,S,q,G)),se},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var S=this._writableState;S.corked&&(S.corked--,S.writing||S.corked||S.finished||S.bufferProcessing||!S.bufferedRequest||F(this,S))},B.prototype.setDefaultEncoding=function(S){if("string"==typeof S&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(S,q,G){G(new Error("_write() is not implemented"))},B.prototype._writev=null,B.prototype.end=function(S,q,G){var se,Y,re=this._writableState;"function"==typeof S?(G=S,S=null,q=null):"function"==typeof q&&(G=q,q=null),null!=S&&this.write(S,q),re.corked&&(re.corked=1,this.uncork()),re.ending||re.finished||(this,Y=G,(se=re).ending=!0,W(this,se),Y&&(se.finished?f.nextTick(Y):this.once("finish",Y)),se.ended=!0,this.writable=!1)},Object.defineProperty(B.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(q){this._writableState&&(this._writableState.destroyed=q)}}),B.prototype.destroy=A.destroy,B.prototype._undestroy=A.undestroy,B.prototype._destroy=function(S,q){this.end(),q(S)}}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},L("timers").setImmediate)},{"./_stream_duplex":17,"./internal/streams/destroy":23,"./internal/streams/stream":24,_process:44,"core-util-is":13,inherits:29,"process-nextick-args":43,"safe-buffer":65,timers:68,"util-deprecate":71}],22:[function(L,X,K){"use strict";var g=L("safe-buffer").Buffer,b=L("util");X.exports=function(){function C(){(function(f,d){if(!(f instanceof d))throw new TypeError("Cannot call a class as a function")})(this,C),this.head=null,this.tail=null,this.length=0}return C.prototype.push=function(f){var d={data:f,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length},C.prototype.unshift=function(f){var d={data:f,next:this.head};0===this.length&&(this.tail=d),this.head=d,++this.length},C.prototype.shift=function(){if(0!==this.length){var f=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,f}},C.prototype.clear=function(){this.head=this.tail=null,this.length=0},C.prototype.join=function(f){if(0===this.length)return"";for(var d=this.head,_=""+d.data;d=d.next;)_+=f+d.data;return _},C.prototype.concat=function(f){if(0===this.length)return g.alloc(0);if(1===this.length)return this.head.data;for(var M=g.allocUnsafe(f>>>0),T=this.head,E=0;T;)T.data.copy(M,E),E+=T.data.length,T=T.next;return M},C}(),b&&b.inspect&&b.inspect.custom&&(X.exports.prototype[b.inspect.custom]=function(){var C=b.inspect({length:this.length});return this.constructor.name+" "+C})},{"safe-buffer":65,util:11}],23:[function(L,X,K){"use strict";var g=L("process-nextick-args");function b(C,f){C.emit("error",f)}X.exports={destroy:function(f,d){var _=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(d?d(f):!f||this._writableState&&this._writableState.errorEmitted||g.nextTick(b,this,f),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(T){!d&&T?(g.nextTick(b,_,T),_._writableState&&(_._writableState.errorEmitted=!0)):d&&d(T)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":43}],24:[function(L,X,K){X.exports=L("events").EventEmitter},{events:27}],25:[function(L,X,K){(K=X.exports=L("./lib/_stream_readable.js")).Stream=K,K.Readable=K,K.Writable=L("./lib/_stream_writable.js"),K.Duplex=L("./lib/_stream_duplex.js"),K.Transform=L("./lib/_stream_transform.js"),K.PassThrough=L("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":17,"./lib/_stream_passthrough.js":18,"./lib/_stream_readable.js":19,"./lib/_stream_transform.js":20,"./lib/_stream_writable.js":21}],26:[function(L,X,K){(function(g){var b=L("once"),C=function(){};X.exports=function d(_,m,M){if("function"==typeof m)return d(_,null,m);m||(m={}),M=b(M||C);var U,T=_._writableState,E=_._readableState,h=m.readable||!1!==m.readable&&_.readable,p=m.writable||!1!==m.writable&&_.writable,O=!1,A=function(){_.writable||P()},P=function(){p=!1,h||M.call(_)},R=function(){h=!1,p||M.call(_)},B=function(W){M.call(_,W?new Error("exited with error code: "+W):null)},I=function(W){M.call(_,W)},$=function(){g.nextTick(F)},F=function(){if(!O)return(!h||E&&E.ended&&!E.destroyed)&&(!p||T&&T.ended&&!T.destroyed)?void 0:M.call(_,new Error("premature close"))},Z=function(){_.req.on("finish",P)};return(U=_).setHeader&&"function"==typeof U.abort?(_.on("complete",P),_.on("abort",$),_.req?Z():_.on("request",Z)):p&&!T&&(_.on("end",A),_.on("close",A)),function(U){return U.stdio&&Array.isArray(U.stdio)&&3===U.stdio.length}(_)&&_.on("exit",B),_.on("end",R),_.on("finish",P),!1!==m.error&&_.on("error",I),_.on("close",$),function(){O=!0,_.removeListener("complete",P),_.removeListener("abort",$),_.removeListener("request",Z),_.req&&_.req.removeListener("finish",P),_.removeListener("end",A),_.removeListener("close",A),_.removeListener("finish",P),_.removeListener("exit",B),_.removeListener("end",R),_.removeListener("error",I),_.removeListener("close",$)}}}).call(this,L("_process"))},{_process:44,once:42}],27:[function(L,X,K){var g=Object.create||function(P){var R=function(){};return R.prototype=P,new R},b=Object.keys||function(P){var R=[];for(var B in P)Object.prototype.hasOwnProperty.call(P,B)&&R.push(B);return B},C=Function.prototype.bind||function(P){var R=this;return function(){return R.apply(P,arguments)}};function f(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=g(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}X.exports=f,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._maxListeners=void 0;var d,_=10;try{var m={};Object.defineProperty&&Object.defineProperty(m,"x",{value:0}),d=0===m.x}catch(P){d=!1}function M(P){return void 0===P._maxListeners?f.defaultMaxListeners:P._maxListeners}function T(P,R,B,I){var $,F,Z;if("function"!=typeof B)throw new TypeError('"listener" argument must be a function');if((F=P._events)?(F.newListener&&(P.emit("newListener",R,B.listener?B.listener:B),F=P._events),Z=F[R]):(F=P._events=g(null),P._eventsCount=0),Z){if("function"==typeof Z?Z=F[R]=I?[B,Z]:[Z,B]:I?Z.unshift(B):Z.push(B),!Z.warned&&($=M(P))&&$>0&&Z.length>$){Z.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+Z.length+' "'+String(R)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');U.name="MaxListenersExceededWarning",U.emitter=P,U.type=R,U.count=Z.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",U.name,U.message)}}else Z=F[R]=B,++P._eventsCount;return P}function E(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var P=new Array(arguments.length),R=0;R<P.length;++R)P[R]=arguments[R];this.listener.apply(this.target,P)}}function h(P,R,B){var I={fired:!1,wrapFn:void 0,target:P,type:R,listener:B},$=C.call(E,I);return $.listener=B,I.wrapFn=$,$}function p(P,R,B){var I=P._events;if(!I)return[];var $=I[R];return $?"function"==typeof $?B?[$.listener||$]:[$]:B?function(F){for(var Z=new Array(F.length),U=0;U<Z.length;++U)Z[U]=F[U].listener||F[U];return Z}($):A($,$.length):[]}function O(P){var R=this._events;if(R){var B=R[P];if("function"==typeof B)return 1;if(B)return B.length}return 0}function A(P,R){for(var B=new Array(R),I=0;I<R;++I)B[I]=P[I];return B}d?Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return _},set:function(R){if("number"!=typeof R||R<0||R!=R)throw new TypeError('"defaultMaxListeners" must be a positive number');_=R}}):f.defaultMaxListeners=_,f.prototype.setMaxListeners=function(P){if("number"!=typeof P||P<0||isNaN(P))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=P,this},f.prototype.getMaxListeners=function(){return M(this)},f.prototype.emit=function(P){var R,B,I,$,F,Z,U="error"===P;if(Z=this._events)U=U&&null==Z.error;else if(!U)return!1;if(U){if(arguments.length>1&&(R=arguments[1]),R instanceof Error)throw R;var W=new Error('Unhandled "error" event. ('+R+")");throw W.context=R,W}if(!(B=Z[P]))return!1;var S="function"==typeof B;switch(I=arguments.length){case 1:!function(q,G,re){if(G)q.call(re);else for(var oe=q.length,se=A(q,oe),Y=0;Y<oe;++Y)se[Y].call(re)}(B,S,this);break;case 2:!function(q,G,re,oe){if(G)q.call(re,oe);else for(var se=q.length,Y=A(q,se),N=0;N<se;++N)Y[N].call(re,oe)}(B,S,this,arguments[1]);break;case 3:!function(q,G,re,oe,se){if(G)q.call(re,oe,se);else for(var Y=q.length,N=A(q,Y),V=0;V<Y;++V)N[V].call(re,oe,se)}(B,S,this,arguments[1],arguments[2]);break;case 4:!function(q,G,re,oe,se,Y){if(G)q.call(re,oe,se,Y);else for(var N=q.length,V=A(q,N),Q=0;Q<N;++Q)V[Q].call(re,oe,se,Y)}(B,S,this,arguments[1],arguments[2],arguments[3]);break;default:for($=new Array(I-1),F=1;F<I;F++)$[F-1]=arguments[F];!function(q,G,re,oe){if(G)q.apply(re,oe);else for(var se=q.length,Y=A(q,se),N=0;N<se;++N)Y[N].apply(re,oe)}(B,S,this,$)}return!0},f.prototype.on=f.prototype.addListener=function(P,R){return T(this,P,R,!1)},f.prototype.prependListener=function(P,R){return T(this,P,R,!0)},f.prototype.once=function(P,R){if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');return this.on(P,h(this,P,R)),this},f.prototype.prependOnceListener=function(P,R){if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');return this.prependListener(P,h(this,P,R)),this},f.prototype.removeListener=function(P,R){var B,I,$,F,Z;if("function"!=typeof R)throw new TypeError('"listener" argument must be a function');if(!(I=this._events))return this;if(!(B=I[P]))return this;if(B===R||B.listener===R)0==--this._eventsCount?this._events=g(null):(delete I[P],I.removeListener&&this.emit("removeListener",P,B.listener||R));else if("function"!=typeof B){for($=-1,F=B.length-1;F>=0;F--)if(B[F]===R||B[F].listener===R){Z=B[F].listener,$=F;break}if($<0)return this;0===$?B.shift():function(U,W){for(var S=W,q=S+1,G=U.length;q<G;S+=1,q+=1)U[S]=U[q];U.pop()}(B,$),1===B.length&&(I[P]=B[0]),I.removeListener&&this.emit("removeListener",P,Z||R)}return this},f.prototype.removeAllListeners=function(P){var R,B,I;if(!(B=this._events))return this;if(!B.removeListener)return 0===arguments.length?(this._events=g(null),this._eventsCount=0):B[P]&&(0==--this._eventsCount?this._events=g(null):delete B[P]),this;if(0===arguments.length){var $,F=b(B);for(I=0;I<F.length;++I)"removeListener"!==($=F[I])&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=g(null),this._eventsCount=0,this}if("function"==typeof(R=B[P]))this.removeListener(P,R);else if(R)for(I=R.length-1;I>=0;I--)this.removeListener(P,R[I]);return this},f.prototype.listeners=function(P){return p(this,P,!0)},f.prototype.rawListeners=function(P){return p(this,P,!1)},f.listenerCount=function(P,R){return"function"==typeof P.listenerCount?P.listenerCount(R):O.call(P,R)},f.prototype.listenerCount=O,f.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],28:[function(L,X,K){K.read=function(g,b,C,f,d){var _,m,M=8*d-f-1,T=(1<<M)-1,E=T>>1,h=-7,p=C?d-1:0,O=C?-1:1,A=g[b+p];for(p+=O,_=A&(1<<-h)-1,A>>=-h,h+=M;h>0;_=256*_+g[b+p],p+=O,h-=8);for(m=_&(1<<-h)-1,_>>=-h,h+=f;h>0;m=256*m+g[b+p],p+=O,h-=8);if(0===_)_=1-E;else{if(_===T)return m?NaN:1/0*(A?-1:1);m+=Math.pow(2,f),_-=E}return(A?-1:1)*m*Math.pow(2,_-f)},K.write=function(g,b,C,f,d,_){var m,M,T,E=8*_-d-1,h=(1<<E)-1,p=h>>1,O=23===d?Math.pow(2,-24)-Math.pow(2,-77):0,A=f?0:_-1,P=f?1:-1,R=b<0||0===b&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(M=isNaN(b)?1:0,m=h):(m=Math.floor(Math.log(b)/Math.LN2),b*(T=Math.pow(2,-m))<1&&(m--,T*=2),(b+=m+p>=1?O/T:O*Math.pow(2,1-p))*T>=2&&(m++,T/=2),m+p>=h?(M=0,m=h):m+p>=1?(M=(b*T-1)*Math.pow(2,d),m+=p):(M=b*Math.pow(2,p-1)*Math.pow(2,d),m=0));d>=8;g[C+A]=255&M,A+=P,M/=256,d-=8);for(m=m<<d|M,E+=d;E>0;g[C+A]=255&m,A+=P,m/=256,E-=8);g[C+A-P]|=128*R}},{}],29:[function(L,X,K){X.exports="function"==typeof Object.create?function(g,b){b&&(g.super_=b,g.prototype=Object.create(b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}))}:function(g,b){if(b){g.super_=b;var C=function(){};C.prototype=b.prototype,g.prototype=new C,g.prototype.constructor=g}}},{}],30:[function(L,X,K){function g(b){return!!b.constructor&&"function"==typeof b.constructor.isBuffer&&b.constructor.isBuffer(b)}X.exports=function(b){return null!=b&&(g(b)||"function"==typeof(C=b).readFloatLE&&"function"==typeof C.slice&&g(C.slice(0,0))||!!b._isBuffer);var C}},{}],31:[function(L,X,K){var g={}.toString;X.exports=Array.isArray||function(b){return"[object Array]"==g.call(b)}},{}],32:[function(L,X,K){(function(g){var b=X.exports;for(var C in b.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},b.codes={},b.types)b.codes[b.types[C]]=C;for(var d in b.CMD_SHIFT=4,b.CMD_MASK=240,b.DUP_MASK=8,b.QOS_MASK=3,b.QOS_SHIFT=1,b.RETAIN_MASK=1,b.VARBYTEINT_MASK=127,b.VARBYTEINT_FIN_MASK=128,b.SESSIONPRESENT_MASK=1,b.SESSIONPRESENT_HEADER=g.from([b.SESSIONPRESENT_MASK]),b.CONNACK_HEADER=g.from([b.codes.connack<<b.CMD_SHIFT]),b.USERNAME_MASK=128,b.PASSWORD_MASK=64,b.WILL_RETAIN_MASK=32,b.WILL_QOS_MASK=24,b.WILL_QOS_SHIFT=3,b.WILL_FLAG_MASK=4,b.CLEAN_SESSION_MASK=2,b.CONNECT_HEADER=g.from([b.codes.connect<<b.CMD_SHIFT]),b.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},b.propertiesCodes={},b.properties)b.propertiesCodes[b.properties[d]]=d;function m(M){return[0,1,2].map(function(T){return[0,1].map(function(E){return[0,1].map(function(h){var p=g.alloc(1);return p.writeUInt8(b.codes[M]<<b.CMD_SHIFT|(E?b.DUP_MASK:0)|T<<b.QOS_SHIFT|h,0,!0),p})})})}b.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},b.PUBLISH_HEADER=m("publish"),b.SUBSCRIBE_HEADER=m("subscribe"),b.SUBSCRIBE_OPTIONS_QOS_MASK=3,b.SUBSCRIBE_OPTIONS_NL_MASK=1,b.SUBSCRIBE_OPTIONS_NL_SHIFT=2,b.SUBSCRIBE_OPTIONS_RAP_MASK=1,b.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,b.SUBSCRIBE_OPTIONS_RH_MASK=3,b.SUBSCRIBE_OPTIONS_RH_SHIFT=4,b.SUBSCRIBE_OPTIONS_RH=[0,16,32],b.SUBSCRIBE_OPTIONS_NL=4,b.SUBSCRIBE_OPTIONS_RAP=8,b.SUBSCRIBE_OPTIONS_QOS=[0,1,2],b.UNSUBSCRIBE_HEADER=m("unsubscribe"),b.ACKS={unsuback:m("unsuback"),puback:m("puback"),pubcomp:m("pubcomp"),pubrel:m("pubrel"),pubrec:m("pubrec")},b.SUBACK_HEADER=g.from([b.codes.suback<<b.CMD_SHIFT]),b.VERSION3=g.from([3]),b.VERSION4=g.from([4]),b.VERSION5=g.from([5]),b.QOS=[0,1,2].map(function(M){return g.from([M])}),b.EMPTY={pingreq:g.from([b.codes.pingreq<<4,0]),pingresp:g.from([b.codes.pingresp<<4,0]),disconnect:g.from([b.codes.disconnect<<4,0])}}).call(this,L("buffer").Buffer)},{buffer:12}],33:[function(L,X,K){(function(g){var b=L("./writeToStream"),f=function(d){"use strict";De(m,d);var _=nt(m);function m(){var M;return e(this,m),(M=_.call(this))._array=new Array(20),M._i=0,M}return _e(m,[{key:"write",value:function(T){return this._array[this._i++]=T,!0}},{key:"concat",value:function(){var p,T=0,E=new Array(this._array.length),h=this._array,O=0;for(p=0;p<h.length&&void 0!==h[p];p++)E[p]="string"!=typeof h[p]?h[p].length:g.byteLength(h[p]),T+=E[p];var A=g.allocUnsafe(T);for(p=0;p<h.length&&void 0!==h[p];p++)"string"!=typeof h[p]?(h[p].copy(A,O),O+=E[p]):(A.write(h[p],O),O+=E[p]);return A}}]),m}(L("events"));X.exports=function(d,_){var m=new f;return b(d,m,_),m.concat()}}).call(this,L("buffer").Buffer)},{"./writeToStream":40,buffer:12,events:27}],34:[function(L,X,K){K.parser=L("./parser").parser,K.generate=L("./generate"),K.writeToStream=L("./writeToStream")},{"./generate":33,"./parser":39,"./writeToStream":40}],35:[function(L,X,K){"use strict";var b=L("buffer").Buffer,C=Symbol.for("BufferList");function f(d){if(!(this instanceof f))return new f(d);f._init.call(this,d)}f._init=function(d){Object.defineProperty(this,C,{value:!0}),this._bufs=[],this.length=0,d&&this.append(d)},f.prototype._new=function(d){return new f(d)},f.prototype._offset=function(d){if(0===d)return[0,0];for(var _=0,m=0;m<this._bufs.length;m++){var M=_+this._bufs[m].length;if(d<M||m===this._bufs.length-1)return[m,d-_];_=M}},f.prototype._reverseOffset=function(d){for(var _=d[0],m=d[1],M=0;M<_;M++)m+=this._bufs[M].length;return m},f.prototype.get=function(d){if(!(d>this.length||d<0)){var _=this._offset(d);return this._bufs[_[0]][_[1]]}},f.prototype.slice=function(d,_){return"number"==typeof d&&d<0&&(d+=this.length),"number"==typeof _&&_<0&&(_+=this.length),this.copy(null,0,d,_)},f.prototype.copy=function(d,_,m,M){if(("number"!=typeof m||m<0)&&(m=0),("number"!=typeof M||M>this.length)&&(M=this.length),m>=this.length||M<=0)return d||b.alloc(0);var T=!!d,E=this._offset(m),h=M-m,p=h,O=T&&_||0,A=E[1];if(0===m&&M===this.length){if(!T)return 1===this._bufs.length?this._bufs[0]:b.concat(this._bufs,this.length);for(var P=0;P<this._bufs.length;P++)this._bufs[P].copy(d,O),O+=this._bufs[P].length;return d}if(p<=this._bufs[E[0]].length-A)return T?this._bufs[E[0]].copy(d,_,A,A+p):this._bufs[E[0]].slice(A,A+p);T||(d=b.allocUnsafe(h));for(var R=E[0];R<this._bufs.length;R++){var B=this._bufs[R].length-A;if(!(p>B)){this._bufs[R].copy(d,O,A,A+p),O+=B;break}this._bufs[R].copy(d,O,A),O+=B,p-=B,A&&(A=0)}return d.length>O?d.slice(0,O):d},f.prototype.shallowSlice=function(d,_){if((d=d||0)<0&&(d+=this.length),(_="number"!=typeof _?this.length:_)<0&&(_+=this.length),d===_)return this._new();var m=this._offset(d),M=this._offset(_),T=this._bufs.slice(m[0],M[0]+1);return 0===M[1]?T.pop():T[T.length-1]=T[T.length-1].slice(0,M[1]),0!==m[1]&&(T[0]=T[0].slice(m[1])),this._new(T)},f.prototype.toString=function(d,_,m){return this.slice(_,m).toString(d)},f.prototype.consume=function(d){if(d=Math.trunc(d),Number.isNaN(d)||d<=0)return this;for(;this._bufs.length;){if(!(d>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(d),this.length-=d;break}d-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},f.prototype.duplicate=function(){for(var d=this._new(),_=0;_<this._bufs.length;_++)d.append(this._bufs[_]);return d},f.prototype.append=function(d){if(null==d)return this;if(d.buffer)this._appendBuffer(b.from(d.buffer,d.byteOffset,d.byteLength));else if(Array.isArray(d))for(var _=0;_<d.length;_++)this.append(d[_]);else if(this._isBufferList(d))for(var m=0;m<d._bufs.length;m++)this.append(d._bufs[m]);else"number"==typeof d&&(d=d.toString()),this._appendBuffer(b.from(d));return this},f.prototype._appendBuffer=function(d){this._bufs.push(d),this.length+=d.length},f.prototype.indexOf=function(d,_,m){if(void 0===m&&"string"==typeof _&&(m=_,_=void 0),"function"==typeof d||Array.isArray(d))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof d?d=b.from([d]):"string"==typeof d?d=b.from(d,m):this._isBufferList(d)?d=d.slice():Array.isArray(d.buffer)?d=b.from(d.buffer,d.byteOffset,d.byteLength):b.isBuffer(d)||(d=b.from(d)),_=Number(_||0),isNaN(_)&&(_=0),_<0&&(_=this.length+_),_<0&&(_=0),0===d.length)return _>this.length?this.length:_;for(var M=this._offset(_),T=M[0],E=M[1];T<this._bufs.length;T++){for(var h=this._bufs[T];E<h.length;)if(h.length-E>=d.length){var p=h.indexOf(d,E);if(-1!==p)return this._reverseOffset([T,p]);E=h.length-d.length+1}else{var O=this._reverseOffset([T,E]);if(this._match(O,d))return O;E++}E=0}return-1},f.prototype._match=function(d,_){if(this.length-d<_.length)return!1;for(var m=0;m<_.length;m++)if(this.get(d+m)!==_[m])return!1;return!0},function(){var d={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(var _ in d)!function(m){f.prototype[m]=null===d[m]?function(M,T){return this.slice(M,M+T)[m](0,T)}:function(M){return this.slice(M,M+d[m])[m](0)}}(_)}(),f.prototype._isBufferList=function(d){return d instanceof f||f.isBufferList(d)},f.isBufferList=function(d){return null!=d&&d[C]},X.exports=f},{buffer:12}],36:[function(L,X,K){"use strict";var g=L("readable-stream").Duplex,b=L("inherits"),C=L("./BufferList");function f(d){if(!(this instanceof f))return new f(d);if("function"==typeof d){this._callback=d;var _=function(m){this._callback&&(this._callback(m),this._callback=null)}.bind(this);this.on("pipe",function(m){m.on("error",_)}),this.on("unpipe",function(m){m.removeListener("error",_)}),d=null}C._init.call(this,d),g.call(this)}b(f,g),Object.assign(f.prototype,C.prototype),f.prototype._new=function(d){return new f(d)},f.prototype._write=function(d,_,m){this._appendBuffer(d),"function"==typeof m&&m()},f.prototype._read=function(d){if(!this.length)return this.push(null);d=Math.min(d,this.length),this.push(this.slice(0,d)),this.consume(d)},f.prototype.end=function(d){g.prototype.end.call(this,d),this._callback&&(this._callback(null,this.slice()),this._callback=null)},f.prototype._destroy=function(d,_){this._bufs.length=0,this.length=0,_(d)},f.prototype._isBufferList=function(d){return d instanceof f||d instanceof C||f.isBufferList(d)},f.isBufferList=C.isBufferList,X.exports=f,X.exports.BufferListStream=f,X.exports.BufferList=C},{"./BufferList":35,inherits:29,"readable-stream":63}],37:[function(L,X,K){(function(g){var C={},f=g.isBuffer(g.from([1,2]).subarray(0,1));function d(_){var m=g.allocUnsafe(2);return m.writeUInt8(_>>8,0),m.writeUInt8(255&_,1),m}X.exports={cache:C,generateCache:function(){for(var m=0;m<65536;m++)C[m]=d(m)},generateNumber:d,genBufVariableByteInt:function(m){var M=0,T=0,E=g.allocUnsafe(4);do{M=m%128|0,(m=m/128|0)>0&&(M|=128),E.writeUInt8(M,T++)}while(m>0&&T<4);return m>0&&(T=0),f?E.subarray(0,T):E.slice(0,T)},generate4ByteBuffer:function(m){var M=g.allocUnsafe(4);return M.writeUInt32BE(m,0),M}}}).call(this,L("buffer").Buffer)},{buffer:12}],38:[function(L,X,K){X.exports=function(){"use strict";return _e(function g(){e(this,g),this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null})}()},{}],39:[function(L,X,K){var g=L("bl"),b=L("events"),C=L("./packet"),f=L("./constants"),d=L("debug")("mqtt-packet:parser");X.exports=function(m){"use strict";De(T,m);var M=nt(T);function T(){var E;return e(this,T),(E=M.call(this)).parser=E.constructor.parser,E}return _e(T,[{key:"_resetState",value:function(){d("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new C,this.error=null,this._list=g(),this._stateCounter=0}},{key:"parse",value:function(h){for(this.error&&this._resetState(),this._list.append(h),d("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,d("parse: state complete. _stateCounter is now: %d",this._stateCounter),d("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return d("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}},{key:"_parseHeader",value:function(){var h=this._list.readUInt8(0);return this.packet.cmd=f.types[h>>f.CMD_SHIFT],this.packet.retain=0!=(h&f.RETAIN_MASK),this.packet.qos=h>>f.QOS_SHIFT&f.QOS_MASK,this.packet.dup=0!=(h&f.DUP_MASK),d("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}},{key:"_parseLength",value:function(){var h=this._parseVarByteNum(!0);return h?(this.packet.length=h.value,this._list.consume(h.bytes)):this._emitError(new Error("Invalid length")),d("_parseLength %d",h.value),!!h}},{key:"_parsePayload",value:function(){d("_parsePayload: payload %O",this._list);var h=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}h=!0}return d("_parsePayload complete result: %s",h),h}},{key:"_parseConnect",value:function(){var h,p,O,A;d("_parseConnect");var P={},R=this.packet,B=this._parseString();if(null===B)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==B&&"MQIsdp"!==B)return this._emitError(new Error("Invalid protocolId"));if(R.protocolId=B,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(R.protocolVersion=this._list.readUInt8(this._pos),3!==R.protocolVersion&&4!==R.protocolVersion&&5!==R.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(P.username=this._list.readUInt8(this._pos)&f.USERNAME_MASK,P.password=this._list.readUInt8(this._pos)&f.PASSWORD_MASK,P.will=this._list.readUInt8(this._pos)&f.WILL_FLAG_MASK,P.will&&(R.will={},R.will.retain=0!=(this._list.readUInt8(this._pos)&f.WILL_RETAIN_MASK),R.will.qos=(this._list.readUInt8(this._pos)&f.WILL_QOS_MASK)>>f.WILL_QOS_SHIFT),R.clean=0!=(this._list.readUInt8(this._pos)&f.CLEAN_SESSION_MASK),this._pos++,R.keepalive=this._parseNum(),-1===R.keepalive)return this._emitError(new Error("Packet too short"));if(5===R.protocolVersion){var I=this._parseProperties();Object.getOwnPropertyNames(I).length&&(R.properties=I)}var $=this._parseString();if(null===$)return this._emitError(new Error("Packet too short"));if(R.clientId=$,d("_parseConnect: packet.clientId: %s",R.clientId),P.will){if(5===R.protocolVersion){var F=this._parseProperties();Object.getOwnPropertyNames(F).length&&(R.will.properties=F)}if(null===(h=this._parseString()))return this._emitError(new Error("Cannot parse will topic"));if(R.will.topic=h,d("_parseConnect: packet.will.topic: %s",R.will.topic),null===(p=this._parseBuffer()))return this._emitError(new Error("Cannot parse will payload"));R.will.payload=p,d("_parseConnect: packet.will.paylaod: %s",R.will.payload)}if(P.username){if(null===(A=this._parseString()))return this._emitError(new Error("Cannot parse username"));R.username=A,d("_parseConnect: packet.username: %s",R.username)}if(P.password){if(null===(O=this._parseBuffer()))return this._emitError(new Error("Cannot parse password"));R.password=O}return this.settings=R,d("_parseConnect: complete"),R}},{key:"_parseConnack",value:function(){d("_parseConnack");var h=this.packet;if(this._list.length<2)return null;if(h.sessionPresent=!!(this._list.readUInt8(this._pos++)&f.SESSIONPRESENT_MASK),5===this.settings.protocolVersion?h.reasonCode=this._list.readUInt8(this._pos++):h.returnCode=this._list.readUInt8(this._pos++),-1===h.returnCode||-1===h.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}d("_parseConnack: complete")}},{key:"_parsePublish",value:function(){d("_parsePublish");var h=this.packet;if(h.topic=this._parseString(),null===h.topic)return this._emitError(new Error("Cannot parse topic"));if(!(h.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}h.payload=this._list.slice(this._pos,h.length),d("_parsePublish: payload from buffer list: %o",h.payload)}}},{key:"_parseSubscribe",value:function(){d("_parseSubscribe");var p,O,A,P,R,I,h=this.packet;if(1!==h.qos)return this._emitError(new Error("Wrong subscribe header"));if(h.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var $=this._parseProperties();Object.getOwnPropertyNames($).length&&(h.properties=$)}for(;this._pos<h.length;){if(null===(p=this._parseString()))return this._emitError(new Error("Cannot parse topic"));if(this._pos>=h.length)return this._emitError(new Error("Malformed Subscribe Payload"));A=(O=this._parseByte())&f.SUBSCRIBE_OPTIONS_QOS_MASK,R=0!=(O>>f.SUBSCRIBE_OPTIONS_RAP_SHIFT&f.SUBSCRIBE_OPTIONS_RAP_MASK),P=O>>f.SUBSCRIBE_OPTIONS_RH_SHIFT&f.SUBSCRIBE_OPTIONS_RH_MASK,I={topic:p,qos:A},5===this.settings.protocolVersion&&(I.nl=0!=(O>>f.SUBSCRIBE_OPTIONS_NL_SHIFT&f.SUBSCRIBE_OPTIONS_NL_MASK),I.rap=R,I.rh=P),d("_parseSubscribe: push subscription `%s` to subscription",I),h.subscriptions.push(I)}}}},{key:"_parseSuback",value:function(){d("_parseSuback");var h=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}},{key:"_parseUnsubscribe",value:function(){d("_parseUnsubscribe");var h=this.packet;if(h.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}for(;this._pos<h.length;){var O=this._parseString();if(null===O)return this._emitError(new Error("Cannot parse topic"));d("_parseUnsubscribe: push topic `%s` to unsubscriptions",O),h.unsubscriptions.push(O)}}}},{key:"_parseUnsuback",value:function(){d("_parseUnsuback");var h=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){var p=this._parseProperties();for(Object.getOwnPropertyNames(p).length&&(h.properties=p),h.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}},{key:"_parseConfirmation",value:function(){d("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);var h=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(h.length>2&&(h.reasonCode=this._parseByte(),d("_parseConfirmation: packet.reasonCode `%d`",h.reasonCode)),h.length>3)){var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}return!0}},{key:"_parseDisconnect",value:function(){var h=this.packet;if(d("_parseDisconnect"),5===this.settings.protocolVersion){h.reasonCode=this._parseByte();var p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(h.properties=p)}return d("_parseDisconnect result: true"),!0}},{key:"_parseAuth",value:function(){d("_parseAuth");var h=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));h.reasonCode=this._parseByte();var p=this._parseProperties();return Object.getOwnPropertyNames(p).length&&(h.properties=p),d("_parseAuth: result: true"),!0}},{key:"_parseMessageId",value:function(){var h=this.packet;return h.messageId=this._parseNum(),null===h.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(d("_parseMessageId: packet.messageId %d",h.messageId),!0)}},{key:"_parseString",value:function(h){var p=this._parseNum(),O=p+this._pos;if(-1===p||O>this._list.length||O>this.packet.length)return null;var A=this._list.toString("utf8",this._pos,O);return this._pos+=p,d("_parseString: result: %s",A),A}},{key:"_parseStringPair",value:function(){return d("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}},{key:"_parseBuffer",value:function(){var h=this._parseNum(),p=h+this._pos;if(-1===h||p>this._list.length||p>this.packet.length)return null;var O=this._list.slice(this._pos,p);return this._pos+=h,d("_parseBuffer: result: %o",O),O}},{key:"_parseNum",value:function(){if(this._list.length-this._pos<2)return-1;var h=this._list.readUInt16BE(this._pos);return this._pos+=2,d("_parseNum: result: %s",h),h}},{key:"_parse4ByteNum",value:function(){if(this._list.length-this._pos<4)return-1;var h=this._list.readUInt32BE(this._pos);return this._pos+=4,d("_parse4ByteNum: result: %s",h),h}},{key:"_parseVarByteNum",value:function(h){d("_parseVarByteNum");for(var p,O=0,A=1,P=0,R=!1,B=this._pos?this._pos:0;O<5;){if(P+=A*((p=this._list.readUInt8(B+O++))&f.VARBYTEINT_MASK),A*=128,0==(p&f.VARBYTEINT_FIN_MASK)){R=!0;break}if(this._list.length<=O)break}return B&&(this._pos+=O),d("_parseVarByteNum: result: %o",R=!!R&&(h?{bytes:O,value:P}:P)),R}},{key:"_parseByte",value:function(){var h=this._list.readUInt8(this._pos);return this._pos++,d("_parseByte: result: %o",h),h}},{key:"_parseByType",value:function(h){switch(d("_parseByType: type: %s",h),h){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}},{key:"_parseProperties",value:function(){d("_parseProperties");for(var h=this._parseVarByteNum(),p=this._pos+h,O={};this._pos<p;){var A=this._parseByte(),P=f.propertiesCodes[A];if(!P)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==P)O[P]?(Array.isArray(O[P])||(O[P]=[O[P]]),O[P].push(this._parseByType(f.propertiesTypes[P]))):O[P]=this._parseByType(f.propertiesTypes[P]);else{O[P]||(O[P]=Object.create(null));var R=this._parseByType(f.propertiesTypes[P]);O[P][R.name]?(Array.isArray(O[P][R.name])||(O[P][R.name]=[O[P][R.name]]),O[P][R.name].push(R.value)):O[P][R.name]=R.value}}return O}},{key:"_newPacket",value:function(){return d("_newPacket"),this.packet&&(this._list.consume(this.packet.length),d("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),d("_newPacket: new packet"),this.packet=new C,this._pos=0,!0}},{key:"_emitError",value:function(h){d("_emitError"),this.error=h,this.emit("error",h)}}],[{key:"parser",value:function(h){return this instanceof T?(this.settings=h||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new T).parser(h)}}]),T}(b)},{"./constants":32,"./packet":38,bl:36,debug:14,events:27}],40:[function(L,X,K){(function(g){var b=L("./constants"),C=g.allocUnsafe(0),f=g.from([0]),d=L("./numbers"),_=L("process-nextick-args").nextTick,m=L("debug")("mqtt-packet:writeToStream"),M=d.cache,T=d.generateNumber,E=d.generateCache,h=d.genBufVariableByteInt,p=d.generate4ByteBuffer,O=Z,A=!0;function P(Y,N,V){switch(m("generate called"),N.cork&&(N.cork(),_(R,N)),A&&(A=!1,E()),m("generate: packet.cmd: %s",Y.cmd),Y.cmd){case"connect":return function(Q,v,x){var D=Q||{},H=D.protocolId||"MQTT",ee=D.protocolVersion||4,te=D.will,l=D.clean,s=D.keepalive||0,c=D.clientId||"",w=D.username,k=D.password,z=D.properties;void 0===l&&(l=!0);var ne=0;if(!H||"string"!=typeof H&&!g.isBuffer(H))return v.emit("error",new Error("Invalid protocolId")),!1;if(ne+=H.length+2,3!==ee&&4!==ee&&5!==ee)return v.emit("error",new Error("Invalid protocol version")),!1;if(ne+=1,"string"!=typeof c&&!g.isBuffer(c)||!c&&4!==ee||!c&&!l){if(ee<4)return v.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return v.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else ne+=c.length+2;if("number"!=typeof s||s<0||s>65535||s%1!=0)return v.emit("error",new Error("Invalid keepalive")),!1;if(ne+=2,ne+=1,5===ee){var ae=S(v,z);if(!ae)return!1;ne+=ae.length}if(te){if("object"!=typeof te)return v.emit("error",new Error("Invalid will")),!1;if(!te.topic||"string"!=typeof te.topic)return v.emit("error",new Error("Invalid will topic")),!1;if(ne+=g.byteLength(te.topic)+2,ne+=2,te.payload){if(!(te.payload.length>=0))return v.emit("error",new Error("Invalid will payload")),!1;ne+="string"==typeof te.payload?g.byteLength(te.payload):te.payload.length}var fe={};if(5===ee){if(!(fe=S(v,te.properties)))return!1;ne+=fe.length}}var le=!1;if(null!=w){if(!se(w))return v.emit("error",new Error("Invalid username")),!1;le=!0,ne+=g.byteLength(w)+2}if(null!=k){if(!le)return v.emit("error",new Error("Username is required to use password")),!1;if(!se(k))return v.emit("error",new Error("Invalid password")),!1;ne+=oe(k)+2}v.write(b.CONNECT_HEADER),I(v,ne),W(v,H),v.write(4===ee?b.VERSION4:5===ee?b.VERSION5:b.VERSION3);var ce=0;return ce|=null!=w?b.USERNAME_MASK:0,ce|=null!=k?b.PASSWORD_MASK:0,ce|=te&&te.retain?b.WILL_RETAIN_MASK:0,ce|=te&&te.qos?te.qos<<b.WILL_QOS_SHIFT:0,ce|=te?b.WILL_FLAG_MASK:0,v.write(g.from([ce|=l?b.CLEAN_SESSION_MASK:0])),O(v,s),5===ee&&ae.write(),W(v,c),te&&(5===ee&&fe.write(),$(v,te.topic),W(v,te.payload)),null!=w&&W(v,w),null!=k&&W(v,k),!0}(Y,N);case"connack":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=5===D?H.reasonCode:H.returnCode,te=H.properties,l=2;if("number"!=typeof ee)return v.emit("error",new Error("Invalid return code")),!1;var s=null;if(5===D){if(!(s=S(v,te)))return!1;l+=s.length}return v.write(b.CONNACK_HEADER),I(v,l),v.write(H.sessionPresent?b.SESSIONPRESENT_HEADER:f),v.write(g.from([ee])),null!=s&&s.write(),!0}(Y,N,V);case"publish":return function(Q,v,x){m("publish: packet: %o",Q);var D=x?x.protocolVersion:4,H=Q||{},ee=H.qos||0,te=H.retain?b.RETAIN_MASK:0,l=H.topic,s=H.payload||C,c=H.messageId,w=H.properties,k=0;if("string"==typeof l)k+=g.byteLength(l)+2;else{if(!g.isBuffer(l))return v.emit("error",new Error("Invalid topic")),!1;k+=l.length+2}if(g.isBuffer(s)?k+=s.length:k+=g.byteLength(s),ee&&"number"!=typeof c)return v.emit("error",new Error("Invalid messageId")),!1;ee&&(k+=2);var z=null;if(5===D){if(!(z=S(v,w)))return!1;k+=z.length}return v.write(b.PUBLISH_HEADER[ee][H.dup?1:0][te?1:0]),I(v,k),O(v,oe(l)),v.write(l),ee>0&&O(v,c),null!=z&&z.write(),m("publish: payload: %o",s),v.write(s)}(Y,N,V);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.cmd||"puback",te=H.messageId,l=H.dup&&"pubrel"===ee?b.DUP_MASK:0,s=0,c=H.reasonCode,w=H.properties,k=5===D?3:2;if("pubrel"===ee&&(s=1),"number"!=typeof te)return v.emit("error",new Error("Invalid messageId")),!1;var z=null;if(5===D&&"object"==typeof w){if(!(z=q(v,w,x,k)))return!1;k+=z.length}return v.write(b.ACKS[ee][s][l][0]),I(v,k),O(v,te),5===D&&v.write(g.from([c])),null!==z&&z.write(),!0}(Y,N,V);case"subscribe":return function(Q,v,x){m("subscribe: packet: ");var D=x?x.protocolVersion:4,H=Q||{},ee=H.dup?b.DUP_MASK:0,te=H.messageId,l=H.subscriptions,s=H.properties,c=0;if("number"!=typeof te)return v.emit("error",new Error("Invalid messageId")),!1;c+=2;var w=null;if(5===D){if(!(w=S(v,s)))return!1;c+=w.length}if("object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid subscriptions")),!1;for(var k=0;k<l.length;k+=1){var z=l[k].topic,ne=l[k].qos;if("string"!=typeof z)return v.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof ne)return v.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===D){if("boolean"!=typeof(l[k].nl||!1))return v.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(l[k].rap||!1))return v.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;var le=l[k].rh||0;if("number"!=typeof le||le>2)return v.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=g.byteLength(z)+2+1}m("subscribe: writing to stream: %o",b.SUBSCRIBE_HEADER),v.write(b.SUBSCRIBE_HEADER[1][ee?1:0][0]),I(v,c),O(v,te),null!==w&&w.write();var Ne,ce=!0,xe=Le(l);try{for(xe.s();!(Ne=xe.n()).done;){var we=Ne.value,he=we.qos,Pe=+we.nl,it=+we.rap,Lt=we.rh,ct=void 0;$(v,we.topic),ct=b.SUBSCRIBE_OPTIONS_QOS[he],5===D&&(ct|=Pe?b.SUBSCRIBE_OPTIONS_NL:0,ct|=it?b.SUBSCRIBE_OPTIONS_RAP:0,ct|=Lt?b.SUBSCRIBE_OPTIONS_RH[Lt]:0),ce=v.write(g.from([ct]))}}catch(ln){xe.e(ln)}finally{xe.f()}return ce}(Y,N,V);case"suback":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.granted,l=H.properties,s=0;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(s+=2,"object"!=typeof te||!te.length)return v.emit("error",new Error("Invalid qos vector")),!1;for(var c=0;c<te.length;c+=1){if("number"!=typeof te[c])return v.emit("error",new Error("Invalid qos vector")),!1;s+=1}var w=null;if(5===D){if(!(w=q(v,l,x,s)))return!1;s+=w.length}return v.write(b.SUBACK_HEADER),I(v,s),O(v,ee),null!==w&&w.write(),v.write(g.from(te))}(Y,N,V);case"unsubscribe":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.dup?b.DUP_MASK:0,l=H.unsubscriptions,s=H.properties,c=0;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid unsubscriptions")),!1;for(var w=0;w<l.length;w+=1){if("string"!=typeof l[w])return v.emit("error",new Error("Invalid unsubscriptions")),!1;c+=g.byteLength(l[w])+2}var k=null;if(5===D){if(!(k=S(v,s)))return!1;c+=k.length}v.write(b.UNSUBSCRIBE_HEADER[1][te?1:0][0]),I(v,c),O(v,ee),null!==k&&k.write();for(var z=!0,ne=0;ne<l.length;ne++)z=$(v,l[ne]);return z}(Y,N,V);case"unsuback":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.messageId,te=H.dup?b.DUP_MASK:0,l=H.granted,s=H.properties,c=H.cmd,w=2;if("number"!=typeof ee)return v.emit("error",new Error("Invalid messageId")),!1;if(5===D){if("object"!=typeof l||!l.length)return v.emit("error",new Error("Invalid qos vector")),!1;for(var k=0;k<l.length;k+=1){if("number"!=typeof l[k])return v.emit("error",new Error("Invalid qos vector")),!1;w+=1}}var z=null;if(5===D){if(!(z=q(v,s,x,w)))return!1;w+=z.length}return v.write(b.ACKS[c][0][te][0]),I(v,w),O(v,ee),null!==z&&z.write(),5===D&&v.write(g.from(l)),!0}(Y,N,V);case"pingreq":case"pingresp":return N.write(b.EMPTY[Y.cmd]);case"disconnect":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.reasonCode,l=5===D?1:0,s=null;if(5===D){if(!(s=q(v,H.properties,x,l)))return!1;l+=s.length}return v.write(g.from([b.codes.disconnect<<4])),I(v,l),5===D&&v.write(g.from([ee])),null!==s&&s.write(),!0}(Y,N,V);case"auth":return function(Q,v,x){var D=x?x.protocolVersion:4,H=Q||{},ee=H.reasonCode,te=H.properties,l=5===D?1:0;5!==D&&v.emit("error",new Error("Invalid mqtt version for auth packet"));var s=q(v,te,x,l);return!!s&&(l+=s.length,v.write(g.from([b.codes.auth<<4])),I(v,l),v.write(g.from([ee])),null!==s&&s.write(),!0)}(Y,N,V);default:return N.emit("error",new Error("Unknown command")),!1}}function R(Y){Y.uncork()}Object.defineProperty(P,"cacheNumbers",{get:function(){return O===Z},set:function(N){N?(M&&0!==Object.keys(M).length||(A=!0),O=Z):(A=!1,O=U)}});var B={};function I(Y,N){var V=B[N];V||(V=h(N),N<16384&&(B[N]=V)),m("writeVarByteInt: writing to stream: %o",V),Y.write(V)}function $(Y,N){var V=g.byteLength(N);return O(Y,V),m("writeString: %s",N),Y.write(N,"utf8")}function F(Y,N,V){$(Y,N),$(Y,V)}function Z(Y,N){return m("writeNumberCached: number: %d",N),m("writeNumberCached: %o",M[N]),Y.write(M[N])}function U(Y,N){var V=T(N);return m("writeNumberGenerated: %o",V),Y.write(V)}function W(Y,N){"string"==typeof N?$(Y,N):N?(O(Y,N.length),Y.write(N)):O(Y,0)}function S(Y,N){if("object"!=typeof N||null!=N.length)return{length:1,write:function(){re(Y,{},0)}};var V=0;function Q(te,l){var s=0;switch(b.propertiesTypes[te]){case"byte":if("boolean"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=2;break;case"int8":if("number"!=typeof l||l<0||l>255)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=2;break;case"binary":if(l&&null===l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=1+g.byteLength(l)+2;break;case"int16":if("number"!=typeof l||l<0||l>65535)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=3;break;case"int32":if("number"!=typeof l||l<0||l>4294967295)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=5;break;case"var":if("number"!=typeof l||l<0||l>268435455)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=1+g.byteLength(h(l));break;case"string":if("string"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=3+g.byteLength(l.toString());break;case"pair":if("object"!=typeof l)return Y.emit("error",new Error("Invalid ".concat(te,": ").concat(l))),!1;s+=Object.getOwnPropertyNames(l).reduce(function(c,w){var k=l[w];return Array.isArray(k)?c+=k.reduce(function(z,ne){return z+(3+g.byteLength(w.toString())+2+g.byteLength(ne.toString()))},0):c+=3+g.byteLength(w.toString())+2+g.byteLength(l[w].toString()),c},0);break;default:return Y.emit("error",new Error("Invalid property ".concat(te,": ").concat(l))),!1}return s}if(N)for(var v in N){var x=0,D=0,H=N[v];if(Array.isArray(H))for(var ee=0;ee<H.length;ee++){if(!(D=Q(v,H[ee])))return!1;x+=D}else{if(!(D=Q(v,H)))return!1;x=D}if(!x)return!1;V+=x}return{length:g.byteLength(h(V))+V,write:function(){re(Y,N,V)}}}function q(Y,N,V,Q){var v=["reasonString","userProperties"],x=V&&V.properties&&V.properties.maximumPacketSize?V.properties.maximumPacketSize:0,D=S(Y,N);if(x)for(;Q+D.length>x;){var H=v.shift();if(!H||!N[H])return!1;delete N[H],D=S(Y,N)}return D}function G(Y,N,V){switch(b.propertiesTypes[N]){case"byte":Y.write(g.from([b.properties[N]])),Y.write(g.from([+V]));break;case"int8":Y.write(g.from([b.properties[N]])),Y.write(g.from([V]));break;case"binary":Y.write(g.from([b.properties[N]])),W(Y,V);break;case"int16":Y.write(g.from([b.properties[N]])),O(Y,V);break;case"int32":Y.write(g.from([b.properties[N]])),Q=Y,x=p(V),m("write4ByteNumber: %o",x),Q.write(x);break;case"var":Y.write(g.from([b.properties[N]])),I(Y,V);break;case"string":Y.write(g.from([b.properties[N]])),$(Y,V);break;case"pair":Object.getOwnPropertyNames(V).forEach(function(Q){var v=V[Q];Array.isArray(v)?v.forEach(function(x){Y.write(g.from([b.properties[N]])),F(Y,Q.toString(),x.toString())}):(Y.write(g.from([b.properties[N]])),F(Y,Q.toString(),v.toString()))});break;default:return Y.emit("error",new Error("Invalid property ".concat(N," value: ").concat(V))),!1}var Q,x}function re(Y,N,V){for(var Q in I(Y,V),N)if(Object.prototype.hasOwnProperty.call(N,Q)&&null!==N[Q]){var v=N[Q];if(Array.isArray(v))for(var x=0;x<v.length;x++)G(Y,Q,v[x]);else G(Y,Q,v)}}function oe(Y){return Y?Y instanceof g?Y.length:g.byteLength(Y):0}function se(Y){return"string"==typeof Y||Y instanceof g}X.exports=P}).call(this,L("buffer").Buffer)},{"./constants":32,"./numbers":37,buffer:12,debug:14,"process-nextick-args":43}],41:[function(L,X,K){var g=1e3,b=60*g,C=60*b,f=24*C;function m(M,T,E,h){var p=T>=1.5*E;return Math.round(M/E)+" "+h+(p?"s":"")}X.exports=function(M,T){T=T||{};var h,p,E=typeof M;if("string"===E&&M.length>0)return function(h){if(!((h=String(h)).length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(p){var O=parseFloat(p[1]);switch((p[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*O;case"weeks":case"week":case"w":return 6048e5*O;case"days":case"day":case"d":return O*f;case"hours":case"hour":case"hrs":case"hr":case"h":return O*C;case"minutes":case"minute":case"mins":case"min":case"m":return O*b;case"seconds":case"second":case"secs":case"sec":case"s":return O*g;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return O;default:return}}}}(M);if("number"===E&&isFinite(M))return T.long?(h=M,(p=Math.abs(h))>=f?m(h,p,f,"day"):p>=C?m(h,p,C,"hour"):p>=b?m(h,p,b,"minute"):p>=g?m(h,p,g,"second"):h+" ms"):function(h){var p=Math.abs(h);return p>=f?Math.round(h/f)+"d":p>=C?Math.round(h/C)+"h":p>=b?Math.round(h/b)+"m":p>=g?Math.round(h/g)+"s":h+"ms"}(M);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(M))}},{}],42:[function(L,X,K){var g=L("wrappy");function b(f){var d=function _(){return _.called?_.value:(_.called=!0,_.value=f.apply(this,arguments))};return d.called=!1,d}function C(f){var d=function m(){if(m.called)throw new Error(m.onceError);return m.called=!0,m.value=f.apply(this,arguments)};return d.onceError=(f.name||"Function wrapped with `once`")+" shouldn't be called more than once",d.called=!1,d}X.exports=g(b),X.exports.strict=g(C),b.proto=b(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return b(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return C(this)},configurable:!0})})},{wrappy:72}],43:[function(L,X,K){(function(g){"use strict";X.exports=void 0===g||!g.version||0===g.version.indexOf("v0.")||0===g.version.indexOf("v1.")&&0!==g.version.indexOf("v1.8.")?{nextTick:function(C,f,d,_){if("function"!=typeof C)throw new TypeError('"callback" argument must be a function');var m,M,T=arguments.length;switch(T){case 0:case 1:return g.nextTick(C);case 2:return g.nextTick(function(){C.call(null,f)});case 3:return g.nextTick(function(){C.call(null,f,d)});case 4:return g.nextTick(function(){C.call(null,f,d,_)});default:for(m=new Array(T-1),M=0;M<m.length;)m[M++]=arguments[M];return g.nextTick(function(){C.apply(null,m)})}}}:g}).call(this,L("_process"))},{_process:44}],44:[function(L,X,K){var g,b,C=X.exports={};function f(){throw new Error("setTimeout has not been defined")}function d(){throw new Error("clearTimeout has not been defined")}function _(P){if(g===setTimeout)return setTimeout(P,0);if((g===f||!g)&&setTimeout)return g=setTimeout,setTimeout(P,0);try{return g(P,0)}catch(R){try{return g.call(null,P,0)}catch(B){return g.call(this,P,0)}}}!function(){try{g="function"==typeof setTimeout?setTimeout:f}catch(P){g=f}try{b="function"==typeof clearTimeout?clearTimeout:d}catch(P){b=d}}();var m,M=[],T=!1,E=-1;function h(){T&&m&&(T=!1,m.length?M=m.concat(M):E=-1,M.length&&p())}function p(){if(!T){var P=_(h);T=!0;for(var R=M.length;R;){for(m=M,M=[];++E<R;)m&&m[E].run();E=-1,R=M.length}m=null,T=!1,function(B){if(b===clearTimeout)return clearTimeout(B);if((b===d||!b)&&clearTimeout)return b=clearTimeout,clearTimeout(B);try{b(B)}catch(I){try{return b.call(null,B)}catch($){return b.call(this,B)}}}(P)}}function O(P,R){this.fun=P,this.array=R}function A(){}C.nextTick=function(P){var R=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)R[B-1]=arguments[B];M.push(new O(P,R)),1!==M.length||T||_(p)},O.prototype.run=function(){this.fun.apply(null,this.array)},C.title="browser",C.browser=!0,C.env={},C.argv=[],C.version="",C.versions={},C.on=A,C.addListener=A,C.once=A,C.off=A,C.removeListener=A,C.removeAllListeners=A,C.emit=A,C.prependListener=A,C.prependOnceListener=A,C.listeners=function(P){return[]},C.binding=function(P){throw new Error("process.binding is not supported")},C.cwd=function(){return"/"},C.chdir=function(P){throw new Error("process.chdir is not supported")},C.umask=function(){return 0}},{}],45:[function(L,X,K){(function(g){!function(b){var C="object"==typeof K&&K&&!K.nodeType&&K,f="object"==typeof X&&X&&!X.nodeType&&X,d="object"==typeof g&&g;d.global!==d&&d.window!==d&&d.self!==d||(b=d);var _,m,M=2147483647,T=36,B=/^xn--/,I=/[^\x20-\x7E]/,$=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=Math.floor,W=String.fromCharCode;function S(Q){throw new RangeError(F[Q])}function q(Q,v){for(var x=Q.length,D=[];x--;)D[x]=v(Q[x]);return D}function G(Q,v){var x=Q.split("@"),D="";return x.length>1&&(D=x[0]+"@",Q=x[1]),D+q((Q=Q.replace($,".")).split("."),v).join(".")}function re(Q){for(var v,x,D=[],H=0,ee=Q.length;H<ee;)(v=Q.charCodeAt(H++))>=55296&&v<=56319&&H<ee?56320==(64512&(x=Q.charCodeAt(H++)))?D.push(((1023&v)<<10)+(1023&x)+65536):(D.push(v),H--):D.push(v);return D}function oe(Q){return q(Q,function(v){var x="";return v>65535&&(x+=W((v-=65536)>>>10&1023|55296),v=56320|1023&v),x+W(v)}).join("")}function se(Q,v){return Q+22+75*(Q<26)-((0!=v)<<5)}function Y(Q,v,x){var D=0;for(Q=x?U(Q/700):Q>>1,Q+=U(Q/v);Q>455;D+=T)Q=U(Q/35);return U(D+36*Q/(Q+38))}function N(Q){var v,x,D,H,ee,te,l,s,c,w,k,z=[],ne=Q.length,ae=0,fe=128,le=72;for((x=Q.lastIndexOf("-"))<0&&(x=0),D=0;D<x;++D)Q.charCodeAt(D)>=128&&S("not-basic"),z.push(Q.charCodeAt(D));for(H=x>0?x+1:0;H<ne;){for(ee=ae,te=1,l=T;H>=ne&&S("invalid-input"),((s=(k=Q.charCodeAt(H++))-48<10?k-22:k-65<26?k-65:k-97<26?k-97:T)>=T||s>U((M-ae)/te))&&S("overflow"),ae+=s*te,!(s<(c=l<=le?1:l>=le+26?26:l-le));l+=T)te>U(M/(w=T-c))&&S("overflow"),te*=w;le=Y(ae-ee,v=z.length+1,0==ee),U(ae/v)>M-fe&&S("overflow"),fe+=U(ae/v),ae%=v,z.splice(ae++,0,fe)}return oe(z)}function V(Q){var v,x,D,H,ee,te,l,s,c,w,k,z,ne,ae,fe,le=[];for(z=(Q=re(Q)).length,v=128,x=0,ee=72,te=0;te<z;++te)(k=Q[te])<128&&le.push(W(k));for(D=H=le.length,H&&le.push("-");D<z;){for(l=M,te=0;te<z;++te)(k=Q[te])>=v&&k<l&&(l=k);for(l-v>U((M-x)/(ne=D+1))&&S("overflow"),x+=(l-v)*ne,v=l,te=0;te<z;++te)if((k=Q[te])<v&&++x>M&&S("overflow"),k==v){for(s=x,c=T;!(s<(w=c<=ee?1:c>=ee+26?26:c-ee));c+=T)le.push(W(se(w+(fe=s-w)%(ae=T-w),0))),s=U(fe/ae);le.push(W(se(s,0))),ee=Y(x,ne,D==H),x=0,++D}++x,++v}return le.join("")}if(_={version:"1.4.1",ucs2:{decode:re,encode:oe},decode:N,encode:V,toASCII:function(v){return G(v,function(x){return I.test(x)?"xn--"+V(x):x})},toUnicode:function(v){return G(v,function(x){return B.test(x)?N(x.slice(4).toLowerCase()):x})}},C&&f)if(X.exports==C)f.exports=_;else for(m in _)_.hasOwnProperty(m)&&(C[m]=_[m]);else b.punycode=_}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],46:[function(L,X,K){"use strict";function g(C,f){return Object.prototype.hasOwnProperty.call(C,f)}X.exports=function(C,f,d,_){d=d||"=";var m={};if("string"!=typeof C||0===C.length)return m;var M=/\+/g;C=C.split(f=f||"&");var T=1e3;_&&"number"==typeof _.maxKeys&&(T=_.maxKeys);var E=C.length;T>0&&E>T&&(E=T);for(var h=0;h<E;++h){var p,O,A,P,R=C[h].replace(M,"%20"),B=R.indexOf(d);B>=0?(p=R.substr(0,B),O=R.substr(B+1)):(p=R,O=""),A=decodeURIComponent(p),P=decodeURIComponent(O),g(m,A)?b(m[A])?m[A].push(P):m[A]=[m[A],P]:m[A]=P}return m};var b=Array.isArray||function(C){return"[object Array]"===Object.prototype.toString.call(C)}},{}],47:[function(L,X,K){"use strict";var g=function(_){switch(typeof _){case"string":return _;case"boolean":return _?"true":"false";case"number":return isFinite(_)?_:"";default:return""}};X.exports=function(d,_,m,M){return _=_||"&",m=m||"=",null===d&&(d=void 0),"object"==typeof d?C(f(d),function(T){var E=encodeURIComponent(g(T))+m;return b(d[T])?C(d[T],function(h){return E+encodeURIComponent(g(h))}).join(_):E+encodeURIComponent(g(d[T]))}).join(_):M?encodeURIComponent(g(M))+m+encodeURIComponent(g(d)):""};var b=Array.isArray||function(d){return"[object Array]"===Object.prototype.toString.call(d)};function C(d,_){if(d.map)return d.map(_);for(var m=[],M=0;M<d.length;M++)m.push(_(d[M],M));return m}var f=Object.keys||function(d){var _=[];for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&_.push(m);return _}},{}],48:[function(L,X,K){"use strict";K.decode=K.parse=L("./decode"),K.encode=K.stringify=L("./encode")},{"./decode":46,"./encode":47}],49:[function(L,X,K){"use strict";var g={};function b(f,d,_){_||(_=Error);var m=function(M){var T,E;function h(p,O,A){return M.call(this,"string"==typeof d?d:d(p,O,A))||this}return E=M,(T=h).prototype=Object.create(E.prototype),T.prototype.constructor=T,T.__proto__=E,h}(_);m.prototype.name=_.name,m.prototype.code=f,g[f]=m}function C(f,d){if(Array.isArray(f)){var _=f.length;return f=f.map(function(m){return String(m)}),_>2?"one of ".concat(d," ").concat(f.slice(0,_-1).join(", "),", or ")+f[_-1]:2===_?"one of ".concat(d," ").concat(f[0]," or ").concat(f[1]):"of ".concat(d," ").concat(f[0])}return"of ".concat(d," ").concat(String(f))}b("ERR_INVALID_OPT_VALUE",function(f,d){return'The value "'+d+'" is invalid for option "'+f+'"'},TypeError),b("ERR_INVALID_ARG_TYPE",function(f,d,_){var m,E,p,A;if("string"==typeof d&&"not "===d.substr(0,"not ".length)?(m="must not be",d=d.replace(/^not /,"")):m="must be",p=f,(void 0===A||A>p.length)&&(A=p.length)," argument"===p.substring(A-" argument".length,A))E="The ".concat(f," ").concat(m," ").concat(C(d,"type"));else{var h=function(p,O,A){return"number"!=typeof A&&(A=0),!(A+".".length>p.length)&&-1!==p.indexOf(".",A)}(f)?"property":"argument";E='The "'.concat(f,'" ').concat(h," ").concat(m," ").concat(C(d,"type"))}return E+". Received type ".concat(typeof _)},TypeError),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),b("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),b("ERR_STREAM_PREMATURE_CLOSE","Premature close"),b("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),b("ERR_STREAM_WRITE_AFTER_END","write after end"),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),X.exports.codes=g},{}],50:[function(L,X,K){(function(g){"use strict";var b=Object.keys||function(h){var p=[];for(var O in h)p.push(O);return p};X.exports=M;var C=L("./_stream_readable"),f=L("./_stream_writable");L("inherits")(M,C);for(var d=b(f.prototype),_=0;_<d.length;_++){var m=d[_];M.prototype[m]||(M.prototype[m]=f.prototype[m])}function M(h){if(!(this instanceof M))return new M(h);C.call(this,h),f.call(this,h),this.allowHalfOpen=!0,h&&(!1===h.readable&&(this.readable=!1),!1===h.writable&&(this.writable=!1),!1===h.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",T)))}function T(){this._writableState.ended||g.nextTick(E,this)}function E(h){h.end()}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(p){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}})}).call(this,L("_process"))},{"./_stream_readable":52,"./_stream_writable":54,_process:44,inherits:29}],51:[function(L,X,K){"use strict";X.exports=b;var g=L("./_stream_transform");function b(C){if(!(this instanceof b))return new b(C);g.call(this,C)}L("inherits")(b,g),b.prototype._transform=function(C,f,d){d(null,C)}},{"./_stream_transform":53,inherits:29}],52:[function(L,X,K){(function(g,b){"use strict";var C;X.exports=S,S.ReadableState=W,L("events");var M,f=function(c,w){return c.listeners(w).length},d=L("./internal/streams/stream"),_=L("buffer").Buffer,m=b.Uint8Array||function(){},T=L("util");M=T&&T.debuglog?T.debuglog("stream"):function(){};var E,h,p,O=L("./internal/streams/buffer_list"),A=L("./internal/streams/destroy"),P=L("./internal/streams/state").getHighWaterMark,R=L("../errors").codes,B=R.ERR_INVALID_ARG_TYPE,I=R.ERR_STREAM_PUSH_AFTER_EOF,$=R.ERR_METHOD_NOT_IMPLEMENTED,F=R.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;L("inherits")(S,d);var Z=A.errorOrDestroy,U=["error","close","destroy","pause","resume"];function W(s,c,w){C=C||L("./_stream_duplex"),"boolean"!=typeof w&&(w=c instanceof C),this.objectMode=!!(s=s||{}).objectMode,w&&(this.objectMode=this.objectMode||!!s.readableObjectMode),this.highWaterMark=P(this,s,"readableHighWaterMark",w),this.buffer=new O,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==s.emitClose,this.autoDestroy=!!s.autoDestroy,this.destroyed=!1,this.defaultEncoding=s.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,s.encoding&&(E||(E=L("string_decoder/").StringDecoder),this.decoder=new E(s.encoding),this.encoding=s.encoding)}function S(s){if(C=C||L("./_stream_duplex"),!(this instanceof S))return new S(s);this._readableState=new W(s,this,this instanceof C),this.readable=!0,s&&("function"==typeof s.read&&(this._read=s.read),"function"==typeof s.destroy&&(this._destroy=s.destroy)),d.call(this)}function q(s,c,w,k,z){M("readableAddChunk",c);var ne,fe,le,ce,xe,ae=s._readableState;if(null===c)ae.reading=!1,function(fe,le){if(M("onEofChunk"),!le.ended){if(le.decoder){var ce=le.decoder.end();ce&&ce.length&&(le.buffer.push(ce),le.length+=le.objectMode?1:ce.length)}le.ended=!0,le.sync?se(fe):(le.needReadable=!1,le.emittedReadable||(le.emittedReadable=!0,Y(fe)))}}(s,ae);else if(z||(fe=ae,_.isBuffer(xe=le=c)||xe instanceof m||"string"==typeof le||void 0===le||fe.objectMode||(ce=new B("chunk",["string","Buffer","Uint8Array"],le)),ne=ce),ne)Z(s,ne);else if(ae.objectMode||c&&c.length>0)if("string"==typeof c||ae.objectMode||Object.getPrototypeOf(c)===_.prototype||(c=function(fe){return _.from(fe)}(c)),k)ae.endEmitted?Z(s,new F):G(s,ae,c,!0);else if(ae.ended)Z(s,new I);else{if(ae.destroyed)return!1;ae.reading=!1,ae.decoder&&!w?(c=ae.decoder.write(c),ae.objectMode||0!==c.length?G(s,ae,c,!1):N(s,ae)):G(s,ae,c,!1)}else k||(ae.reading=!1,N(s,ae));return!ae.ended&&(ae.length<ae.highWaterMark||0===ae.length)}function G(s,c,w,k){c.flowing&&0===c.length&&!c.sync?(c.awaitDrain=0,s.emit("data",w)):(c.length+=c.objectMode?1:w.length,k?c.buffer.unshift(w):c.buffer.push(w),c.needReadable&&se(s)),N(s,c)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(c){this._readableState&&(this._readableState.destroyed=c)}}),S.prototype.destroy=A.destroy,S.prototype._undestroy=A.undestroy,S.prototype._destroy=function(s,c){c(s)},S.prototype.push=function(s,c){var w,k=this._readableState;return k.objectMode?w=!0:"string"==typeof s&&((c=c||k.defaultEncoding)!==k.encoding&&(s=_.from(s,c),c=""),w=!0),q(this,s,c,!1,w)},S.prototype.unshift=function(s){return q(this,s,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(s){E||(E=L("string_decoder/").StringDecoder);var c=new E(s);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;for(var w=this._readableState.buffer.head,k="";null!==w;)k+=c.write(w.data),w=w.next;return this._readableState.buffer.clear(),""!==k&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var re=1073741824;function oe(s,c){return s<=0||0===c.length&&c.ended?0:c.objectMode?1:s!=s?c.flowing&&c.length?c.buffer.head.data.length:c.length:(s>c.highWaterMark&&(c.highWaterMark=((w=s)>=re?w=re:(w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++),w)),s<=c.length?s:c.ended?c.length:(c.needReadable=!0,0));var w}function se(s){var c=s._readableState;M("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,c.emittedReadable||(M("emitReadable",c.flowing),c.emittedReadable=!0,g.nextTick(Y,s))}function Y(s){var c=s._readableState;M("emitReadable_",c.destroyed,c.length,c.ended),c.destroyed||!c.length&&!c.ended||(s.emit("readable"),c.emittedReadable=!1),c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,D(s)}function N(s,c){c.readingMore||(c.readingMore=!0,g.nextTick(V,s,c))}function V(s,c){for(;!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&0===c.length);){var w=c.length;if(M("maybeReadMore read 0"),s.read(0),w===c.length)break}c.readingMore=!1}function Q(s){var c=s._readableState;c.readableListening=s.listenerCount("readable")>0,c.resumeScheduled&&!c.paused?c.flowing=!0:s.listenerCount("data")>0&&s.resume()}function v(s){M("readable nexttick read 0"),s.read(0)}function x(s,c){M("resume",c.reading),c.reading||s.read(0),c.resumeScheduled=!1,s.emit("resume"),D(s),c.flowing&&!c.reading&&s.read(0)}function D(s){var c=s._readableState;for(M("flow",c.flowing);c.flowing&&null!==s.read(););}function H(s,c){return 0===c.length?null:(c.objectMode?w=c.buffer.shift():!s||s>=c.length?(w=c.decoder?c.buffer.join(""):1===c.buffer.length?c.buffer.first():c.buffer.concat(c.length),c.buffer.clear()):w=c.buffer.consume(s,c.decoder),w);var w}function ee(s){var c=s._readableState;M("endReadable",c.endEmitted),c.endEmitted||(c.ended=!0,g.nextTick(te,c,s))}function te(s,c){if(M("endReadableNT",s.endEmitted,s.length),!s.endEmitted&&0===s.length&&(s.endEmitted=!0,c.readable=!1,c.emit("end"),s.autoDestroy)){var w=c._writableState;(!w||w.autoDestroy&&w.finished)&&c.destroy()}}function l(s,c){for(var w=0,k=s.length;w<k;w++)if(s[w]===c)return w;return-1}S.prototype.read=function(s){M("read",s),s=parseInt(s,10);var c=this._readableState,w=s;if(0!==s&&(c.emittedReadable=!1),0===s&&c.needReadable&&((0!==c.highWaterMark?c.length>=c.highWaterMark:c.length>0)||c.ended))return M("read: emitReadable",c.length,c.ended),0===c.length&&c.ended?ee(this):se(this),null;if(0===(s=oe(s,c))&&c.ended)return 0===c.length&&ee(this),null;var k,z=c.needReadable;return M("need readable",z),(0===c.length||c.length-s<c.highWaterMark)&&M("length less than watermark",z=!0),c.ended||c.reading?M("reading or ended",z=!1):z&&(M("do read"),c.reading=!0,c.sync=!0,0===c.length&&(c.needReadable=!0),this._read(c.highWaterMark),c.sync=!1,c.reading||(s=oe(w,c))),null===(k=s>0?H(s,c):null)?(c.needReadable=c.length<=c.highWaterMark,s=0):(c.length-=s,c.awaitDrain=0),0===c.length&&(c.ended||(c.needReadable=!0),w!==s&&c.ended&&ee(this)),null!==k&&this.emit("data",k),k},S.prototype._read=function(s){Z(this,new $("_read()"))},S.prototype.pipe=function(s,c){var w=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=s;break;case 1:k.pipes=[k.pipes,s];break;default:k.pipes.push(s)}k.pipesCount+=1,M("pipe count=%d opts=%j",k.pipesCount,c);var z=c&&!1===c.end||s===g.stdout||s===g.stderr?Ce:ae;function ae(){M("onend"),s.end()}k.endEmitted?g.nextTick(z):w.once("end",z),s.on("unpipe",function ne(he,Pe){M("onunpipe"),he===w&&Pe&&!1===Pe.hasUnpiped&&(Pe.hasUnpiped=!0,M("cleanup"),s.removeListener("close",Ne),s.removeListener("finish",we),s.removeListener("drain",fe),s.removeListener("error",xe),s.removeListener("unpipe",ne),w.removeListener("end",ae),w.removeListener("end",Ce),w.removeListener("data",ce),le=!0,!k.awaitDrain||s._writableState&&!s._writableState.needDrain||fe())});var he,fe=(he=w,function(){var Pe=he._readableState;M("pipeOnDrain",Pe.awaitDrain),Pe.awaitDrain&&Pe.awaitDrain--,0===Pe.awaitDrain&&f(he,"data")&&(Pe.flowing=!0,D(he))});s.on("drain",fe);var le=!1;function ce(he){M("ondata");var Pe=s.write(he);M("dest.write",Pe),!1===Pe&&((1===k.pipesCount&&k.pipes===s||k.pipesCount>1&&-1!==l(k.pipes,s))&&!le&&(M("false write response, pause",k.awaitDrain),k.awaitDrain++),w.pause())}function xe(he){M("onerror",he),Ce(),s.removeListener("error",xe),0===f(s,"error")&&Z(s,he)}function Ne(){s.removeListener("finish",we),Ce()}function we(){M("onfinish"),s.removeListener("close",Ne),Ce()}function Ce(){M("unpipe"),w.unpipe(s)}return w.on("data",ce),function(he,Pe,it){if("function"==typeof he.prependListener)return he.prependListener(Pe,it);he._events&&he._events[Pe]?Array.isArray(he._events[Pe])?he._events[Pe].unshift(it):he._events[Pe]=[it,he._events[Pe]]:he.on(Pe,it)}(s,"error",xe),s.once("close",Ne),s.once("finish",we),s.emit("pipe",w),k.flowing||(M("pipe resume"),w.resume()),s},S.prototype.unpipe=function(s){var c=this._readableState,w={hasUnpiped:!1};if(0===c.pipesCount)return this;if(1===c.pipesCount)return s&&s!==c.pipes||(s||(s=c.pipes),c.pipes=null,c.pipesCount=0,c.flowing=!1,s&&s.emit("unpipe",this,w)),this;if(!s){var k=c.pipes,z=c.pipesCount;c.pipes=null,c.pipesCount=0,c.flowing=!1;for(var ne=0;ne<z;ne++)k[ne].emit("unpipe",this,{hasUnpiped:!1});return this}var ae=l(c.pipes,s);return-1===ae||(c.pipes.splice(ae,1),c.pipesCount-=1,1===c.pipesCount&&(c.pipes=c.pipes[0]),s.emit("unpipe",this,w)),this},S.prototype.addListener=S.prototype.on=function(s,c){var w=d.prototype.on.call(this,s,c),k=this._readableState;return"data"===s?(k.readableListening=this.listenerCount("readable")>0,!1!==k.flowing&&this.resume()):"readable"===s&&(k.endEmitted||k.readableListening||(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,M("on readable",k.length,k.reading),k.length?se(this):k.reading||g.nextTick(v,this))),w},S.prototype.removeListener=function(s,c){var w=d.prototype.removeListener.call(this,s,c);return"readable"===s&&g.nextTick(Q,this),w},S.prototype.removeAllListeners=function(s){var c=d.prototype.removeAllListeners.apply(this,arguments);return"readable"!==s&&void 0!==s||g.nextTick(Q,this),c},S.prototype.resume=function(){var w,s=this._readableState;return s.flowing||(M("resume"),s.flowing=!s.readableListening,this,(w=s).resumeScheduled||(w.resumeScheduled=!0,g.nextTick(x,this,w))),s.paused=!1,this},S.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(s){var c=this,w=this._readableState,k=!1;for(var z in s.on("end",function(){if(M("wrapped end"),w.decoder&&!w.ended){var ae=w.decoder.end();ae&&ae.length&&c.push(ae)}c.push(null)}),s.on("data",function(ae){M("wrapped data"),w.decoder&&(ae=w.decoder.write(ae)),(!w.objectMode||null!=ae)&&(w.objectMode||ae&&ae.length)&&(c.push(ae)||(k=!0,s.pause()))}),s)void 0===this[z]&&"function"==typeof s[z]&&(this[z]=function(ae){return function(){return s[ae].apply(s,arguments)}}(z));for(var ne=0;ne<U.length;ne++)s.on(U[ne],this.emit.bind(this,U[ne]));return this._read=function(ae){M("wrapped _read",ae),k&&(k=!1,s.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=L("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}}),S._fromList=H,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(s,c){return void 0===p&&(p=L("./internal/streams/from")),p(S,s,c)})}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":49,"./_stream_duplex":50,"./internal/streams/async_iterator":55,"./internal/streams/buffer_list":56,"./internal/streams/destroy":57,"./internal/streams/from":59,"./internal/streams/state":61,"./internal/streams/stream":62,_process:44,buffer:12,events:27,inherits:29,"string_decoder/":67,util:11}],53:[function(L,X,K){"use strict";X.exports=m;var g=L("../errors").codes,b=g.ERR_METHOD_NOT_IMPLEMENTED,C=g.ERR_MULTIPLE_CALLBACK,f=g.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=g.ERR_TRANSFORM_WITH_LENGTH_0,_=L("./_stream_duplex");function m(E){if(!(this instanceof m))return new m(E);_.call(this,E),this._transformState={afterTransform:function(h,p){var O=this._transformState;O.transforming=!1;var A=O.writecb;if(null===A)return this.emit("error",new C);O.writechunk=null,O.writecb=null,null!=p&&this.push(p),A(h);var P=this._readableState;P.reading=!1,(P.needReadable||P.length<P.highWaterMark)&&this._read(P.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,E&&("function"==typeof E.transform&&(this._transform=E.transform),"function"==typeof E.flush&&(this._flush=E.flush)),this.on("prefinish",M)}function M(){var E=this;"function"!=typeof this._flush||this._readableState.destroyed?T(this,null,null):this._flush(function(h,p){T(E,h,p)})}function T(E,h,p){if(h)return E.emit("error",h);if(null!=p&&E.push(p),E._writableState.length)throw new d;if(E._transformState.transforming)throw new f;return E.push(null)}L("inherits")(m,_),m.prototype.push=function(E,h){return this._transformState.needTransform=!1,_.prototype.push.call(this,E,h)},m.prototype._transform=function(E,h,p){p(new b("_transform()"))},m.prototype._write=function(E,h,p){var O=this._transformState;if(O.writecb=p,O.writechunk=E,O.writeencoding=h,!O.transforming){var A=this._readableState;(O.needTransform||A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}},m.prototype._read=function(E){var h=this._transformState;null===h.writechunk||h.transforming?h.needTransform=!0:(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform))},m.prototype._destroy=function(E,h){_.prototype._destroy.call(this,E,function(p){h(p)})}},{"../errors":49,"./_stream_duplex":50,inherits:29}],54:[function(L,X,K){(function(g,b){"use strict";function C(N){var V=this;this.next=null,this.entry=null,this.finish=function(){!function(Q,v,x){var D=Q.entry;for(Q.entry=null;D;){var H=D.callback;v.pendingcb--,H(undefined),D=D.next}v.corkedRequestsFree.next=Q}(V,N)}}var f;X.exports=S,S.WritableState=W;var T,d={deprecate:L("util-deprecate")},_=L("./internal/streams/stream"),m=L("buffer").Buffer,M=b.Uint8Array||function(){},E=L("./internal/streams/destroy"),h=L("./internal/streams/state").getHighWaterMark,p=L("../errors").codes,O=p.ERR_INVALID_ARG_TYPE,A=p.ERR_METHOD_NOT_IMPLEMENTED,P=p.ERR_MULTIPLE_CALLBACK,R=p.ERR_STREAM_CANNOT_PIPE,B=p.ERR_STREAM_DESTROYED,I=p.ERR_STREAM_NULL_VALUES,$=p.ERR_STREAM_WRITE_AFTER_END,F=p.ERR_UNKNOWN_ENCODING,Z=E.errorOrDestroy;function U(){}function W(N,V,Q){f=f||L("./_stream_duplex"),"boolean"!=typeof Q&&(Q=V instanceof f),this.objectMode=!!(N=N||{}).objectMode,Q&&(this.objectMode=this.objectMode||!!N.writableObjectMode),this.highWaterMark=h(this,N,"writableHighWaterMark",Q),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===N.decodeStrings),this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(x){!function(D,H){var c,ee=D._writableState,te=ee.sync,l=ee.writecb;if("function"!=typeof l)throw new P;if((c=ee).writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0,H)!function(c,w,k,z,ne){--w.pendingcb,k?(g.nextTick(ne,z),g.nextTick(Y,c,w),c._writableState.errorEmitted=!0,Z(c,z)):(ne(z),c._writableState.errorEmitted=!0,Z(c,z),Y(c,w))}(D,ee,te,H,l);else{var s=oe(ee)||D.destroyed;s||ee.corked||ee.bufferProcessing||!ee.bufferedRequest||re(D,ee),te?g.nextTick(G,D,ee,s,l):G(D,ee,s,l)}}(V,x)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==N.emitClose,this.autoDestroy=!!N.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new C(this)}function S(N){var V=this instanceof(f=f||L("./_stream_duplex"));if(!V&&!T.call(S,this))return new S(N);this._writableState=new W(N,this,V),this.writable=!0,N&&("function"==typeof N.write&&(this._write=N.write),"function"==typeof N.writev&&(this._writev=N.writev),"function"==typeof N.destroy&&(this._destroy=N.destroy),"function"==typeof N.final&&(this._final=N.final)),_.call(this)}function q(N,V,Q,v,x,D,H){V.writelen=v,V.writecb=H,V.writing=!0,V.sync=!0,V.destroyed?V.onwrite(new B("write")):Q?N._writev(x,V.onwrite):N._write(x,D,V.onwrite),V.sync=!1}function G(N,V,Q,v){var x,D;Q||(x=N,0===(D=V).length&&D.needDrain&&(D.needDrain=!1,x.emit("drain"))),V.pendingcb--,v(),Y(N,V)}function re(N,V){V.bufferProcessing=!0;var Q=V.bufferedRequest;if(N._writev&&Q&&Q.next){var x=new Array(V.bufferedRequestCount),D=V.corkedRequestsFree;D.entry=Q;for(var H=0,ee=!0;Q;)x[H]=Q,Q.isBuf||(ee=!1),Q=Q.next,H+=1;x.allBuffers=ee,q(N,V,!0,V.length,x,"",D.finish),V.pendingcb++,V.lastBufferedRequest=null,D.next?(V.corkedRequestsFree=D.next,D.next=null):V.corkedRequestsFree=new C(V),V.bufferedRequestCount=0}else{for(;Q;){var te=Q.chunk;if(q(N,V,!1,V.objectMode?1:te.length,te,Q.encoding,Q.callback),Q=Q.next,V.bufferedRequestCount--,V.writing)break}null===Q&&(V.lastBufferedRequest=null)}V.bufferedRequest=Q,V.bufferProcessing=!1}function oe(N){return N.ending&&0===N.length&&null===N.bufferedRequest&&!N.finished&&!N.writing}function se(N,V){N._final(function(Q){V.pendingcb--,Q&&Z(N,Q),V.prefinished=!0,N.emit("prefinish"),Y(N,V)})}function Y(N,V){var x,D,Q=oe(V);if(Q&&(x=N,(D=V).prefinished||D.finalCalled||("function"!=typeof x._final||D.destroyed?(D.prefinished=!0,x.emit("prefinish")):(D.pendingcb++,D.finalCalled=!0,g.nextTick(se,x,D))),0===V.pendingcb&&(V.finished=!0,N.emit("finish"),V.autoDestroy))){var v=N._readableState;(!v||v.autoDestroy&&v.endEmitted)&&N.destroy()}return Q}L("inherits")(S,_),W.prototype.getBuffer=function(){for(var N=this.bufferedRequest,V=[];N;)V.push(N),N=N.next;return V},function(){try{Object.defineProperty(W.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(N){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(V){return!!T.call(this,V)||this===S&&V&&V._writableState instanceof W}})):T=function(V){return V instanceof this},S.prototype.pipe=function(){Z(this,new R)},S.prototype.write=function(N,V,Q){var v,ee,te,l,x=this._writableState,D=!1,H=!x.objectMode&&(m.isBuffer(v=N)||v instanceof M);return H&&!m.isBuffer(N)&&(N=m.from(N)),"function"==typeof V&&(Q=V,V=null),H?V="buffer":V||(V=x.defaultEncoding),"function"!=typeof Q&&(Q=U),x.ending?(ee=this,te=Q,l=new $,Z(ee,l),g.nextTick(te,l)):(H||function(ee,te,l,s){var c;return null===l?c=new I:"string"==typeof l||te.objectMode||(c=new O("chunk",["string","Buffer"],l)),!c||(Z(ee,c),g.nextTick(s,c),!1)}(this,x,N,Q))&&(x.pendingcb++,D=function(ee,te,l,s,c,w){if(!l){var k=(le=s,(fe=te).objectMode||!1===fe.decodeStrings||"string"!=typeof le||(le=m.from(le,c)),le);s!==k&&(l=!0,c="buffer",s=k)}var fe,le,z=te.objectMode?1:s.length;te.length+=z;var ne=te.length<te.highWaterMark;if(ne||(te.needDrain=!0),te.writing||te.corked){var ae=te.lastBufferedRequest;te.lastBufferedRequest={chunk:s,encoding:c,isBuf:l,callback:w,next:null},ae?ae.next=te.lastBufferedRequest:te.bufferedRequest=te.lastBufferedRequest,te.bufferedRequestCount+=1}else q(ee,te,!1,z,s,c,w);return ne}(this,x,H,N,V,Q)),D},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,N.writing||N.corked||N.bufferProcessing||!N.bufferedRequest||re(this,N))},S.prototype.setDefaultEncoding=function(N){if("string"==typeof N&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new F(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(N,V,Q){Q(new A("_write()"))},S.prototype._writev=null,S.prototype.end=function(N,V,Q){var x,D,H,v=this._writableState;return"function"==typeof N?(Q=N,N=null,V=null):"function"==typeof V&&(Q=V,V=null),null!=N&&this.write(N,V),v.corked&&(v.corked=1,this.uncork()),v.ending||(x=this,H=Q,(D=v).ending=!0,Y(x,D),H&&(D.finished?g.nextTick(H):x.once("finish",H)),D.ended=!0,x.writable=!1),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),S.prototype.destroy=E.destroy,S.prototype._undestroy=E.undestroy,S.prototype._destroy=function(N,V){V(N)}}).call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":49,"./_stream_duplex":50,"./internal/streams/destroy":57,"./internal/streams/state":61,"./internal/streams/stream":62,_process:44,buffer:12,inherits:29,"util-deprecate":71}],55:[function(L,X,K){(function(g){"use strict";var b;function C(R,B,I){return B in R?Object.defineProperty(R,B,{value:I,enumerable:!0,configurable:!0,writable:!0}):R[B]=I,R}var f=L("./end-of-stream"),d=Symbol("lastResolve"),_=Symbol("lastReject"),m=Symbol("error"),M=Symbol("ended"),T=Symbol("lastPromise"),E=Symbol("handlePromise"),h=Symbol("stream");function p(R,B){return{value:R,done:B}}function O(R){var B=R[d];if(null!==B){var I=R[h].read();null!==I&&(R[T]=null,R[d]=null,R[_]=null,B(p(I,!1)))}}var A=Object.getPrototypeOf(function(){}),P=Object.setPrototypeOf((C(b={get stream(){return this[h]},next:function(){var B=this,I=this[m];if(null!==I)return Promise.reject(I);if(this[M])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(U,W){g.nextTick(function(){B[m]?W(B[m]):U(p(void 0,!0))})});var $,U,W,F=this[T];if(F)$=new Promise((U=F,W=this,function(S,q){U.then(function(){W[M]?S(p(void 0,!0)):W[E](S,q)},q)}));else{var Z=this[h].read();if(null!==Z)return Promise.resolve(p(Z,!1));$=new Promise(this[E])}return this[T]=$,$}},Symbol.asyncIterator,function(){return this}),C(b,"return",function(){var R=this;return new Promise(function(B,I){R[h].destroy(null,function($){$?I($):B(p(void 0,!0))})})}),b),A);X.exports=function(R){var B,I=Object.create(P,(C(B={},h,{value:R,writable:!0}),C(B,d,{value:null,writable:!0}),C(B,_,{value:null,writable:!0}),C(B,m,{value:null,writable:!0}),C(B,M,{value:R._readableState.endEmitted,writable:!0}),C(B,E,{value:function(F,Z){var U=I[h].read();U?(I[T]=null,I[d]=null,I[_]=null,F(p(U,!1))):(I[d]=F,I[_]=Z)},writable:!0}),B));return I[T]=null,f(R,function($){if($&&"ERR_STREAM_PREMATURE_CLOSE"!==$.code){var F=I[_];return null!==F&&(I[T]=null,I[d]=null,I[_]=null,F($)),void(I[m]=$)}var Z=I[d];null!==Z&&(I[T]=null,I[d]=null,I[_]=null,Z(p(void 0,!0))),I[M]=!0}),R.on("readable",function($){g.nextTick(O,$)}.bind(null,I)),I}}).call(this,L("_process"))},{"./end-of-stream":58,_process:44}],56:[function(L,X,K){"use strict";function g(m,M){var T=Object.keys(m);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(m);M&&(E=E.filter(function(h){return Object.getOwnPropertyDescriptor(m,h).enumerable})),T.push.apply(T,E)}return T}function b(m,M,T){return M in m?Object.defineProperty(m,M,{value:T,enumerable:!0,configurable:!0,writable:!0}):m[M]=T,m}function C(m,M){for(var T=0;T<M.length;T++){var E=M[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(m,E.key,E)}}var f=L("buffer").Buffer,d=L("util").inspect,_=d&&d.custom||"inspect";X.exports=function(){function m(){(function(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")})(this,m),this.head=null,this.tail=null,this.length=0}var M,T;return M=m,(T=[{key:"push",value:function(p){var O={data:p,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(p){var O={data:p,next:this.head};0===this.length&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(0!==this.length){var p=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(0===this.length)return"";for(var O=this.head,A=""+O.data;O=O.next;)A+=p+O.data;return A}},{key:"concat",value:function(p){if(0===this.length)return f.alloc(0);for(var R=f.allocUnsafe(p>>>0),B=this.head,I=0;B;)f.prototype.copy.call(B.data,R,I),I+=B.data.length,B=B.next;return R}},{key:"consume",value:function(p,O){var A;return p<this.head.data.length?(A=this.head.data.slice(0,p),this.head.data=this.head.data.slice(p)):A=p===this.head.data.length?this.shift():O?this._getString(p):this._getBuffer(p),A}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(p){var O=this.head,A=1,P=O.data;for(p-=P.length;O=O.next;){var R=O.data,B=p>R.length?R.length:p;if(P+=B===R.length?R:R.slice(0,p),0==(p-=B)){B===R.length?(++A,this.head=O.next?O.next:this.tail=null):(this.head=O,O.data=R.slice(B));break}++A}return this.length-=A,P}},{key:"_getBuffer",value:function(p){var O=f.allocUnsafe(p),A=this.head,P=1;for(A.data.copy(O),p-=A.data.length;A=A.next;){var R=A.data,B=p>R.length?R.length:p;if(R.copy(O,O.length-p,0,B),0==(p-=B)){B===R.length?(++P,this.head=A.next?A.next:this.tail=null):(this.head=A,A.data=R.slice(B));break}++P}return this.length-=P,O}},{key:_,value:function(p,O){return d(this,function(A){for(var P=1;P<arguments.length;P++){var R=null!=arguments[P]?arguments[P]:{};P%2?g(Object(R),!0).forEach(function(B){b(A,B,R[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(R)):g(Object(R)).forEach(function(B){Object.defineProperty(A,B,Object.getOwnPropertyDescriptor(R,B))})}return A}({},O,{depth:0,customInspect:!1}))}}])&&C(M.prototype,T),m}()},{buffer:12,util:11}],57:[function(L,X,K){(function(g){"use strict";function b(d,_){f(d,_),C(d)}function C(d){d._writableState&&!d._writableState.emitClose||d._readableState&&!d._readableState.emitClose||d.emit("close")}function f(d,_){d.emit("error",_)}X.exports={destroy:function(_,m){var M=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(m?m(_):_&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,g.nextTick(f,this,_)):g.nextTick(f,this,_)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(_||null,function(h){!m&&h?M._writableState?M._writableState.errorEmitted?g.nextTick(C,M):(M._writableState.errorEmitted=!0,g.nextTick(b,M,h)):g.nextTick(b,M,h):m?(g.nextTick(C,M),m(h)):g.nextTick(C,M)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(_,m){var M=_._readableState,T=_._writableState;M&&M.autoDestroy||T&&T.autoDestroy?_.destroy(m):_.emit("error",m)}}}).call(this,L("_process"))},{_process:44}],58:[function(L,X,K){"use strict";var g=L("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function b(){}X.exports=function C(f,d,_){if("function"==typeof d)return C(f,null,d);var B,I;d||(d={}),B=_||b,I=!1,_=function(){if(!I){I=!0;for(var $=arguments.length,F=new Array($),Z=0;Z<$;Z++)F[Z]=arguments[Z];B.apply(this,F)}};var m=d.readable||!1!==d.readable&&f.readable,M=d.writable||!1!==d.writable&&f.writable,T=function(){f.writable||h()},E=f._writableState&&f._writableState.finished,h=function(){M=!1,E=!0,m||_.call(f)},p=f._readableState&&f._readableState.endEmitted,O=function(){m=!1,p=!0,M||_.call(f)},A=function(I){_.call(f,I)},P=function(){var I;return m&&!p?(f._readableState&&f._readableState.ended||(I=new g),_.call(f,I)):M&&!E?(f._writableState&&f._writableState.ended||(I=new g),_.call(f,I)):void 0},R=function(){f.req.on("finish",h)};return function(B){return B.setHeader&&"function"==typeof B.abort}(f)?(f.on("complete",h),f.on("abort",P),f.req?R():f.on("request",R)):M&&!f._writableState&&(f.on("end",T),f.on("close",T)),f.on("end",O),f.on("finish",h),!1!==d.error&&f.on("error",A),f.on("close",P),function(){f.removeListener("complete",h),f.removeListener("abort",P),f.removeListener("request",R),f.req&&f.req.removeListener("finish",h),f.removeListener("end",T),f.removeListener("close",T),f.removeListener("finish",h),f.removeListener("end",O),f.removeListener("error",A),f.removeListener("close",P)}}},{"../../../errors":49}],59:[function(L,X,K){X.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],60:[function(L,X,K){"use strict";var g,b=L("../../../errors").codes,C=b.ERR_MISSING_ARGS,f=b.ERR_STREAM_DESTROYED;function d(M){if(M)throw M}function _(M){M()}function m(M,T){return M.pipe(T)}X.exports=function(){for(var M=arguments.length,T=new Array(M),E=0;E<M;E++)T[E]=arguments[E];var h,A,p=(A=T).length?"function"!=typeof A[A.length-1]?d:A.pop():d;if(Array.isArray(T[0])&&(T=T[0]),T.length<2)throw new C("streams");var O=T.map(function(A,P){var R=P<T.length-1;return function(B,I,$,F){var W,S;W=F,S=!1,F=function(){S||(S=!0,W.apply(void 0,arguments))};var Z=!1;B.on("close",function(){Z=!0}),void 0===g&&(g=L("./end-of-stream")),g(B,{readable:I,writable:$},function(W){if(W)return F(W);Z=!0,F()});var U=!1;return function(W){if(!Z&&!U)return U=!0,function(S){return S.setHeader&&"function"==typeof S.abort}(B)?B.abort():"function"==typeof B.destroy?B.destroy():void F(W||new f("pipe"))}}(A,R,P>0,function(B){h||(h=B),B&&O.forEach(_),R||(O.forEach(_),p(h))})});return T.reduce(m)}},{"../../../errors":49,"./end-of-stream":58}],61:[function(L,X,K){"use strict";var g=L("../../../errors").codes.ERR_INVALID_OPT_VALUE;X.exports={getHighWaterMark:function(C,f,d,_){var M,m=null!=(M=f).highWaterMark?M.highWaterMark:_?M[d]:null;if(null!=m){if(!isFinite(m)||Math.floor(m)!==m||m<0)throw new g(_?d:"highWaterMark",m);return Math.floor(m)}return C.objectMode?16:16384}}},{"../../../errors":49}],62:[function(L,X,K){arguments[4][24][0].apply(K,arguments)},{dup:24,events:27}],63:[function(L,X,K){(K=X.exports=L("./lib/_stream_readable.js")).Stream=K,K.Readable=K,K.Writable=L("./lib/_stream_writable.js"),K.Duplex=L("./lib/_stream_duplex.js"),K.Transform=L("./lib/_stream_transform.js"),K.PassThrough=L("./lib/_stream_passthrough.js"),K.finished=L("./lib/internal/streams/end-of-stream.js"),K.pipeline=L("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":50,"./lib/_stream_passthrough.js":51,"./lib/_stream_readable.js":52,"./lib/_stream_transform.js":53,"./lib/_stream_writable.js":54,"./lib/internal/streams/end-of-stream.js":58,"./lib/internal/streams/pipeline.js":60}],64:[function(L,X,K){"use strict";X.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var g;if(arguments.length>0){g=new Array(arguments.length-2);for(var b=0;b<g.length;b++)g[b]=arguments[b+2]}return new function(C,f,d){var _=this;this._callback=C,this._args=d,this._interval=setInterval(C,f,this._args),this.reschedule=function(m){m||(m=_._interval),_._interval&&clearInterval(_._interval),_._interval=setInterval(_._callback,m,_._args)},this.clear=function(){_._interval&&(clearInterval(_._interval),_._interval=void 0)},this.destroy=function(){_._interval&&clearInterval(_._interval),_._callback=void 0,_._interval=void 0,_._args=void 0}}(arguments[0],arguments[1],g)}},{}],65:[function(L,X,K){var g=L("buffer"),b=g.Buffer;function C(d,_){for(var m in d)_[m]=d[m]}function f(d,_,m){return b(d,_,m)}b.from&&b.alloc&&b.allocUnsafe&&b.allocUnsafeSlow?X.exports=g:(C(g,K),K.Buffer=f),C(b,f),f.from=function(d,_,m){if("number"==typeof d)throw new TypeError("Argument must not be a number");return b(d,_,m)},f.alloc=function(d,_,m){if("number"!=typeof d)throw new TypeError("Argument must be a number");var M=b(d);return void 0!==_?"string"==typeof m?M.fill(_,m):M.fill(_):M.fill(0),M},f.allocUnsafe=function(d){if("number"!=typeof d)throw new TypeError("Argument must be a number");return b(d)},f.allocUnsafeSlow=function(d){if("number"!=typeof d)throw new TypeError("Argument must be a number");return g.SlowBuffer(d)}},{buffer:12}],66:[function(L,X,K){X.exports=function(g){var C,b=g._readableState;return b?b.objectMode||"number"==typeof g._duplexState?g.read():g.read((C=b).buffer.length?C.buffer.head?C.buffer.head.data.length:C.buffer[0].length:C.length):null}},{}],67:[function(L,X,K){"use strict";var g=L("safe-buffer").Buffer,b=g.isEncoding||function(p){switch((p=""+p)&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function C(p){var O;switch(this.encoding=function(A){var P=function(R){if(!R)return"utf8";for(var B;;)switch(R){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return R;default:if(B)return;R=(""+R).toLowerCase(),B=!0}}(A);if("string"!=typeof P&&(g.isEncoding===b||!b(A)))throw new Error("Unknown encoding: "+A);return P||A}(p),this.encoding){case"utf16le":this.text=_,this.end=m,O=4;break;case"utf8":this.fillLast=d,O=4;break;case"base64":this.text=M,this.end=T,O=3;break;default:return this.write=E,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(O)}function f(p){return p<=127?0:p>>5==6?2:p>>4==14?3:p>>3==30?4:p>>6==2?-1:-2}function d(p){var O=this.lastTotal-this.lastNeed,A=function(P,R,B){if(128!=(192&R[0]))return P.lastNeed=0,"\ufffd";if(P.lastNeed>1&&R.length>1){if(128!=(192&R[1]))return P.lastNeed=1,"\ufffd";if(P.lastNeed>2&&R.length>2&&128!=(192&R[2]))return P.lastNeed=2,"\ufffd"}}(this,p);return void 0!==A?A:this.lastNeed<=p.length?(p.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(p.copy(this.lastChar,O,0,p.length),void(this.lastNeed-=p.length))}function _(p,O){if((p.length-O)%2==0){var A=p.toString("utf16le",O);if(A){var P=A.charCodeAt(A.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",O,p.length-1)}function m(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):O}function M(p,O){var A=(p.length-O)%3;return 0===A?p.toString("base64",O):(this.lastNeed=3-A,this.lastTotal=3,1===A?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",O,p.length-A))}function T(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function E(p){return p.toString(this.encoding)}function h(p){return p&&p.length?this.write(p):""}K.StringDecoder=C,C.prototype.write=function(p){if(0===p.length)return"";var O,A;if(this.lastNeed){if(void 0===(O=this.fillLast(p)))return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A<p.length?O?O+this.text(p,A):this.text(p,A):O||""},C.prototype.end=function(p){var O=p&&p.length?this.write(p):"";return this.lastNeed?O+"\ufffd":O},C.prototype.text=function(p,O){var A=function(R,B,I){var $=B.length-1;if($<I)return 0;var F=f(B[$]);return F>=0?(F>0&&(R.lastNeed=F-1),F):--$<I||-2===F?0:(F=f(B[$]))>=0?(F>0&&(R.lastNeed=F-2),F):--$<I||-2===F?0:(F=f(B[$]))>=0?(F>0&&(2===F?F=0:R.lastNeed=F-3),F):0}(this,p,O);if(!this.lastNeed)return p.toString("utf8",O);this.lastTotal=A;var P=p.length-(A-this.lastNeed);return p.copy(this.lastChar,0,P),p.toString("utf8",O,P)},C.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length}},{"safe-buffer":65}],68:[function(L,X,K){(function(g,b){var C=L("process/browser.js").nextTick,f=Function.prototype.apply,d=Array.prototype.slice,_={},m=0;function M(T,E){this._id=T,this._clearFn=E}K.setTimeout=function(){return new M(f.call(setTimeout,window,arguments),clearTimeout)},K.setInterval=function(){return new M(f.call(setInterval,window,arguments),clearInterval)},K.clearTimeout=K.clearInterval=function(T){T.close()},M.prototype.unref=M.prototype.ref=function(){},M.prototype.close=function(){this._clearFn.call(window,this._id)},K.enroll=function(T,E){clearTimeout(T._idleTimeoutId),T._idleTimeout=E},K.unenroll=function(T){clearTimeout(T._idleTimeoutId),T._idleTimeout=-1},K._unrefActive=K.active=function(T){clearTimeout(T._idleTimeoutId);var E=T._idleTimeout;E>=0&&(T._idleTimeoutId=setTimeout(function(){T._onTimeout&&T._onTimeout()},E))},K.setImmediate="function"==typeof g?g:function(T){var E=m++,h=!(arguments.length<2)&&d.call(arguments,1);return _[E]=!0,C(function(){_[E]&&(h?T.apply(null,h):T.call(null),K.clearImmediate(E))}),E},K.clearImmediate="function"==typeof b?b:function(T){delete _[T]}}).call(this,L("timers").setImmediate,L("timers").clearImmediate)},{"process/browser.js":44,timers:68}],69:[function(L,X,K){"use strict";var g=L("punycode"),b=L("./util");function C(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}K.parse=B,K.resolve=function(I,$){return B(I,!1,!0).resolve($)},K.resolveObject=function(I,$){return I?B(I,!1,!0).resolveObject($):$},K.format=function(I){return b.isString(I)&&(I=B(I)),I instanceof C?I.format():C.prototype.format.call(I)},K.Url=C;var f=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,_=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,m=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),M=["'"].concat(m),T=["%","/","?",";","#"].concat(M),E=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=L("querystring");function B(I,$,F){if(I&&b.isObject(I)&&I instanceof C)return I;var Z=new C;return Z.parse(I,$,F),Z}C.prototype.parse=function(I,$,F){if(!b.isString(I))throw new TypeError("Parameter 'url' must be a string, not "+typeof I);var Z=I.indexOf("?"),U=-1!==Z&&Z<I.indexOf("#")?"?":"#",W=I.split(U);W[0]=W[0].replace(/\\/g,"/");var S=I=W.join(U);if(S=S.trim(),!F&&1===I.split("#").length){var q=_.exec(S);if(q)return this.path=S,this.href=S,this.pathname=q[1],q[2]?(this.search=q[2],this.query=$?R.parse(this.search.substr(1)):this.search.substr(1)):$&&(this.search="",this.query={}),this}var G=f.exec(S);if(G){var re=(G=G[0]).toLowerCase();this.protocol=re,S=S.substr(G.length)}if(F||G||S.match(/^\/\/[^@\/]+@[^@\/]+/)){var oe="//"===S.substr(0,2);!oe||G&&A[G]||(S=S.substr(2),this.slashes=!0)}if(!A[G]&&(oe||G&&!P[G])){for(var se,Y,N=-1,V=0;V<E.length;V++)-1!==(Q=S.indexOf(E[V]))&&(-1===N||Q<N)&&(N=Q);for(-1!==(Y=-1===N?S.lastIndexOf("@"):S.lastIndexOf("@",N))&&(se=S.slice(0,Y),S=S.slice(Y+1),this.auth=decodeURIComponent(se)),N=-1,V=0;V<T.length;V++){var Q;-1!==(Q=S.indexOf(T[V]))&&(-1===N||Q<N)&&(N=Q)}-1===N&&(N=S.length),this.host=S.slice(0,N),S=S.slice(N),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var x=this.hostname.split(/\./),D=(V=0,x.length);V<D;V++){var H=x[V];if(H&&!H.match(h)){for(var ee="",te=0,l=H.length;te<l;te++)H.charCodeAt(te)>127?ee+="x":ee+=H[te];if(!ee.match(h)){var s=x.slice(0,V),c=x.slice(V+1),w=H.match(p);w&&(s.push(w[1]),c.unshift(w[2])),c.length&&(S="/"+c.join(".")+S),this.hostname=s.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),v||(this.hostname=g.toASCII(this.hostname));var k=this.port?":"+this.port:"";this.host=(this.hostname||"")+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==S[0]&&(S="/"+S))}if(!O[re])for(V=0,D=M.length;V<D;V++){var ne=M[V];if(-1!==S.indexOf(ne)){var ae=encodeURIComponent(ne);ae===ne&&(ae=escape(ne)),S=S.split(ne).join(ae)}}var fe=S.indexOf("#");-1!==fe&&(this.hash=S.substr(fe),S=S.slice(0,fe));var le=S.indexOf("?");return-1!==le?(this.search=S.substr(le),this.query=S.substr(le+1),$&&(this.query=R.parse(this.query)),S=S.slice(0,le)):$&&(this.search="",this.query={}),S&&(this.pathname=S),P[re]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(this.path=(k=this.pathname||"")+(this.search||"")),this.href=this.format(),this},C.prototype.format=function(){var I=this.auth||"";I&&(I=(I=encodeURIComponent(I)).replace(/%3A/i,":"),I+="@");var $=this.protocol||"",F=this.pathname||"",Z=this.hash||"",U=!1,W="";this.host?U=I+this.host:this.hostname&&(U=I+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(U+=":"+this.port)),this.query&&b.isObject(this.query)&&Object.keys(this.query).length&&(W=R.stringify(this.query));var S=this.search||W&&"?"+W||"";return $&&":"!==$.substr(-1)&&($+=":"),this.slashes||(!$||P[$])&&!1!==U?(U="//"+(U||""),F&&"/"!==F.charAt(0)&&(F="/"+F)):U||(U=""),Z&&"#"!==Z.charAt(0)&&(Z="#"+Z),S&&"?"!==S.charAt(0)&&(S="?"+S),$+U+(F=F.replace(/[?#]/g,function(q){return encodeURIComponent(q)}))+(S=S.replace("#","%23"))+Z},C.prototype.resolve=function(I){return this.resolveObject(B(I,!1,!0)).format()},C.prototype.resolveObject=function(I){if(b.isString(I)){var $=new C;$.parse(I,!1,!0),I=$}for(var F=new C,Z=Object.keys(this),U=0;U<Z.length;U++){var W=Z[U];F[W]=this[W]}if(F.hash=I.hash,""===I.href)return F.href=F.format(),F;if(I.slashes&&!I.protocol){for(var S=Object.keys(I),q=0;q<S.length;q++){var G=S[q];"protocol"!==G&&(F[G]=I[G])}return P[F.protocol]&&F.hostname&&!F.pathname&&(F.path=F.pathname="/"),F.href=F.format(),F}if(I.protocol&&I.protocol!==F.protocol){if(!P[I.protocol]){for(var re=Object.keys(I),oe=0;oe<re.length;oe++){var se=re[oe];F[se]=I[se]}return F.href=F.format(),F}if(F.protocol=I.protocol,I.host||A[I.protocol])F.pathname=I.pathname;else{for(var Y=(I.pathname||"").split("/");Y.length&&!(I.host=Y.shift()););I.host||(I.host=""),I.hostname||(I.hostname=""),""!==Y[0]&&Y.unshift(""),Y.length<2&&Y.unshift(""),F.pathname=Y.join("/")}return F.search=I.search,F.query=I.query,F.host=I.host||"",F.auth=I.auth,F.hostname=I.hostname||I.host,F.port=I.port,(F.pathname||F.search)&&(F.path=(F.pathname||"")+(F.search||"")),F.slashes=F.slashes||I.slashes,F.href=F.format(),F}var Q=F.pathname&&"/"===F.pathname.charAt(0),v=I.host||I.pathname&&"/"===I.pathname.charAt(0),x=v||Q||F.host&&I.pathname,D=x,H=F.pathname&&F.pathname.split("/")||[],ee=(Y=I.pathname&&I.pathname.split("/")||[],F.protocol&&!P[F.protocol]);if(ee&&(F.hostname="",F.port=null,F.host&&(""===H[0]?H[0]=F.host:H.unshift(F.host)),F.host="",I.protocol&&(I.hostname=null,I.port=null,I.host&&(""===Y[0]?Y[0]=I.host:Y.unshift(I.host)),I.host=null),x=x&&(""===Y[0]||""===H[0])),v)F.host=I.host||""===I.host?I.host:F.host,F.hostname=I.hostname||""===I.hostname?I.hostname:F.hostname,F.search=I.search,F.query=I.query,H=Y;else if(Y.length)H||(H=[]),H.pop(),H=H.concat(Y),F.search=I.search,F.query=I.query;else if(!b.isNullOrUndefined(I.search))return ee&&(F.hostname=F.host=H.shift(),(w=!!(F.host&&F.host.indexOf("@")>0)&&F.host.split("@"))&&(F.auth=w.shift(),F.host=F.hostname=w.shift())),F.search=I.search,F.query=I.query,b.isNull(F.pathname)&&b.isNull(F.search)||(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.href=F.format(),F;if(!H.length)return F.pathname=null,F.path=F.search?"/"+F.search:null,F.href=F.format(),F;for(var te=H.slice(-1)[0],l=(F.host||I.host||H.length>1)&&("."===te||".."===te)||""===te,s=0,c=H.length;c>=0;c--)"."===(te=H[c])?H.splice(c,1):".."===te?(H.splice(c,1),s++):s&&(H.splice(c,1),s--);if(!x&&!D)for(;s--;s)H.unshift("..");!x||""===H[0]||H[0]&&"/"===H[0].charAt(0)||H.unshift(""),l&&"/"!==H.join("/").substr(-1)&&H.push("");var w,k=""===H[0]||H[0]&&"/"===H[0].charAt(0);return ee&&(F.hostname=F.host=k?"":H.length?H.shift():"",(w=!!(F.host&&F.host.indexOf("@")>0)&&F.host.split("@"))&&(F.auth=w.shift(),F.host=F.hostname=w.shift())),(x=x||F.host&&H.length)&&!k&&H.unshift(""),H.length?F.pathname=H.join("/"):(F.pathname=null,F.path=null),b.isNull(F.pathname)&&b.isNull(F.search)||(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.auth=I.auth||F.auth,F.slashes=F.slashes||I.slashes,F.href=F.format(),F},C.prototype.parseHost=function(){var I=this.host,$=d.exec(I);$&&(":"!==($=$[0])&&(this.port=$.substr(1)),I=I.substr(0,I.length-$.length)),I&&(this.hostname=I)}},{"./util":70,punycode:45,querystring:48}],70:[function(L,X,K){"use strict";X.exports={isString:function(b){return"string"==typeof b},isObject:function(b){return"object"==typeof b&&null!==b},isNull:function(b){return null===b},isNullOrUndefined:function(b){return null==b}}},{}],71:[function(L,X,K){(function(g){function b(C){try{if(!g.localStorage)return!1}catch(d){return!1}var f=g.localStorage[C];return null!=f&&"true"===String(f).toLowerCase()}X.exports=function(C,f){if(b("noDeprecation"))return C;var d=!1;return function(){if(!d){if(b("throwDeprecation"))throw new Error(f);b("traceDeprecation")?console.trace(f):console.warn(f),d=!0}return C.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],72:[function(L,X,K){X.exports=function g(b,C){if(b&&C)return g(b)(C);if("function"!=typeof b)throw new TypeError("need wrapper function");return Object.keys(b).forEach(function(d){f[d]=b[d]}),f;function f(){for(var d=new Array(arguments.length),_=0;_<d.length;_++)d[_]=arguments[_];var m=b.apply(this,d),M=d[d.length-1];return"function"==typeof m&&m!==M&&Object.keys(M).forEach(function(T){m[T]=M[T]}),m}}},{}],73:[function(L,X,K){"use strict";X.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],74:[function(L,X,K){X.exports=function(){for(var b={},C=0;C<arguments.length;C++){var f=arguments[C];for(var d in f)g.call(f,d)&&(b[d]=f[d])}return b};var g=Object.prototype.hasOwnProperty},{}]},{},[9])(9)},27565:function(Ve,Qe,ye){"use strict";var Le=ye(99624),e=ye(63150),_e=ye(64762),De="mqtt",_=200,B="text",I="image",$="file",W="direct",N="INFO",V="MINE",Q="OTHERS",x="CHAT_REOPENED",D="CHAT_CLOSED",H="MEMBER_JOINED_GROUP",ee="MEMBER_LEFT_GROUP",te="LEAD_UPDATED",l="TOUCHING_OPERATOR",z="tiledesk_widget_",le={ERROR:0,WARN:1,INFO:2,DEBUG:3},ce={production:!0,version:ye(4147).i8,remoteConfig:!1,remoteConfigUrl:"/widget-config.json",loadRemoteTranslations:!0,remoteTranslationsUrl:"https://api.tiledesk.com/v2/",chatEngine:"firebase",uploadEngine:"firebase",fileUploadAccept:"*/*",logLevel:"ERROR",firebaseConfig:{apiKey:"AIzaSyDKfdKrlD7AYcbQ-U-xxgV-b3FUQ4xt7NM",authDomain:"tiledesk-prod-v2.firebaseapp.com",databaseURL:"https://tiledesk-prod-v2.firebaseio.com",projectId:"tiledesk-prod-v2",storageBucket:"tiledesk-prod-v2.appspot.com",messagingSenderId:"92907897826",appId:"1:92907897826:web:f255664014a7cc14ee2fbb",tenant:"tilechat"},chat21Config:{appId:"tilechat",MQTTendpoint:"mqtt://localhost:15675/ws",APIendpoint:"http://localhost:8004/api"},apiUrl:"https://api.tiledesk.com/v2/",baseImageUrl:"https://firebasestorage.googleapis.com/v0/b/",dashboardUrl:"https://console.tiledesk.com/v2/dashboard/",defaultLang:"en",storage_prefix:"widget_sv5",authPersistence:"LOCAL",supportMode:!0,enbedJs:!0},xe=ye(29609),Ne=ye(84232),we=ye(99713),Ce=function(){function i(){}return i.getInstance=function(){return i.instance},i.setInstance=function(o){i.instance=o},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),he=ye(78512),Pe=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je,Ye){this.id=o,this.activeOperatingHours=n,this.channels=t,this.name=r,this.createdAt=a,this.createdBy=u,this.isActiveSubscription=y,this.profile=j,this.agents=J,this.trialDays=ie,this.type=ue,this.status=ge,this.trialDaysLeft=de,this.trialExpired=ve,this.updatedAt=Te,this.versions=ke,this.widgetTitle=Ae,this.logoChat=Be,this.avatar=Ze,this.color=ze,this.welcomeTitle=je,this.welcomeMsg=Ye}return i.prototype.initialize=function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke){this.id=o,this.activeOperatingHours=n,this.channels=t,this.name=r,this.createdAt=a,this.createdBy=u,this.isActiveSubscription=y,this.profile=j,this.agents=J,this.trialDays=ie,this.type=ue,this.status=ge,this.trialDaysLeft=de,this.trialExpired=ve,this.updatedAt=Te,this.versions=ke},i.prototype.customization=function(o,n,t,r,a,u){this.widgetTitle=o,this.logoChat=n,this.avatar=t,this.color=r,this.welcomeTitle=a,this.welcomeMsg=u},i}(),Nt=(ye(19270),ye(21266),"text"),dn="support-group-",We=230;function Ft(i){return i&&(i=function(i){return(i=(i=(i=(i=i.replace(/&/g,"&")).replace(/>/g,">")).replace(/</g,"<")).replace(/"/g,""")).replace(/'/g,"'")}(i)),i}function gn(i){try{var o=i.split("popup=")[1];return!!o&&!!o.startsWith("true")}catch(n){return!1}}function so(i,o,n){var t=this.strip_tags(o),u=screen.width/2-300,y=screen.height/2-300,j=i.open(t,"_blank","fullscreen=1, titlebar=0, toolbar=no, location=0, status=0, menubar=0, scrollbars=0, resizable=0, width=600, height=600, top="+y+", left="+u);i.focus&&j.focus()}function lo(i){return i.replace(/<.*?>/g,"").trim()}function Bt(i){var o="";return i&&i.split(" ").forEach(function(t){t.trim().length>1&&o.length<3&&(o+=t.substring(0,1).toUpperCase())}),o}function Ut(i){var o=["#fba76f","#80d066","#73cdd0","#ecd074","#6fb1e4","#f98bae"],n=0;if(i){var t=i.charCodeAt(i.length-1);n=Math.round(t%o.length)}return o[n]}function mn(i){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(i.navigator.userAgent)}function Ee(i,o){var n=i;if(i&&i.indexOf("#")>-1)i=i.replace("#",""),n="rgba("+parseInt(i.substring(0,2),16)+","+parseInt(i.substring(2,4),16)+","+parseInt(i.substring(4,6),16)+","+o/100+")";else if(i&&i.indexOf("rgba")>-1)n="rgba("+(u=i.split(","))[0].substring(5)+","+u[1]+","+u[2]+","+o/100+")";else if(i&&i.indexOf("rgb(")>-1){var u;n="rgba("+(u=i.split(","))[0].substring(4)+","+u[1]+","+u[2].substring(0,u[2].length-1)+","+o/100+")"}return n}function pe(i,o){var n=i.location.href;o=o.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+o+"(=([^&]*)|&|$)").exec(n);return r?r[2]?"false"===r[2]||"0"===r[2]?"false":decodeURIComponent(r[2].replace(/\+/g," ")):"true":null}function be(i){var o=i;if("string"!=typeof i)return o;if(i)switch(o.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case null:return!1;default:return o}}function Mt(i,o){return"/apps/"+i+"/users/"+o+"/conversations"}function Zt(i,o){return"/apps/"+i+"/users/"+o+"/archived_conversations"}function rt(){try{return"localStorage"in window&&null!==window.localStorage}catch(i){return console.log("supports_html5_storage > Error :"+i),!1}}function Dt(){try{return"sessionStorage"in window&&null!==window.sessionStorage}catch(i){return console.log("supports_html5_session > Error :"+i),!1}}function Ue(i,o){return i.findIndex(function(n){return n.uid===o})}function po(i){try{var o=i.split("popup=")[1];return!!o&&!!o.startsWith("true")}catch(n){return!1}}function Ht(i,o,n){var t=function(i){return i.replace(/<.*?>/g,"").trim()}(o),u=screen.width/2-300,y=screen.height/2-300,j=i.open(t,"_blank","fullscreen=1, titlebar=0, toolbar=no, location=0, status=0, menubar=0, scrollbars=0, resizable=0, width=600, height=600, top="+y+", left="+u);i.focus&&j.focus()}function Ie(i,o){var n=i;if(i&&i.indexOf("#")>-1)i=i.replace("#",""),n="rgba("+parseInt(i.substring(0,2),16)+","+parseInt(i.substring(2,4),16)+","+parseInt(i.substring(4,6),16)+","+o/100+")";else if(i&&i.indexOf("rgba")>-1)n="rgba("+(u=i.split(","))[0].substring(5)+","+u[1]+","+u[2]+","+o/100+")";else if(i&&i.indexOf("rgb(")>-1){var u;n="rgba("+(u=i.split(","))[0].substring(4)+","+u[1]+","+u[2].substring(0,u[2].length-1)+","+o/100+")"}return n}function at(i,o){return void 0===o&&(o="asc"),function(n,t){if(!n.hasOwnProperty(i)||!t.hasOwnProperty(i))return 0;var r="string"==typeof n[i]?n[i].toUpperCase():n[i],a="string"==typeof t[i]?t[i].toUpperCase():t[i],u=0;return r>a?u=1:r<a&&(u=-1),"desc"===o?-1*u:u}}function ft(i){return xe.locale(window.navigator.language),xe.unix(i).fromNow()}function Cn(i){return!(!i||!i.recipient||!i.recipient.startsWith("group-")&&!i.recipient.startsWith("support-group"))}function Ke(i,o){var n,t,r;if(i.includes("rgb")&&(i=function(i){var n,u="";return(n=/^rgb\(\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*\)$/.exec(i))&&(u="#"+(16777216+(jt(n[1],n[2])<<16)+(jt(n[3],n[4])<<8)+jt(n[5],n[6])).toString(16).slice(1)),u}(i)),0===i.indexOf("#")&&(i=i.slice(1)),3===i.length&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),6!==i.length)throw new Error("Invalid HEX color.");return n=parseInt(i.slice(0,2),16),t=parseInt(i.slice(2,4),16),r=parseInt(i.slice(4,6),16),o?.299*n+.587*t+.114*r>186?"#000000":"#FFFFFF":(n=(255-n).toString(16),t=(255-t).toString(16),r=(255-r).toString(16),"#"+zt(n,2)+zt(t,2)+zt(r,2))}function zt(i,o){return o=o||2,(new Array(o).join("0")+i).slice(-o)}function jt(i,o){var n=Math.max(0,parseInt(i,10));return o?Math.floor(255*Math.min(100,n)/100):Math.min(255,n)}var Re=function(){function i(){this.obsObjChanged=new he.X(null),this.obsIsOpen=new he.X(null),this.BASE_LOCATION="https://widget.tiledesk.com/v2",this.POWERED_BY='<a tabindex="-1" target="_blank" href="http://www.tiledesk.com/"><img src="https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-logo_new_gray.svg"/></a>',this.DEFAULT_LOGO_CHAT="/assets/images/tiledesk_logo_white_small.svg",this.WIDGET_TITLE="Tiledesk",this.convertColorToRGBA=Ie,this.project=new Pe,this.availableAgents=[],this.isLogout=!1,this.availableAgentsStatus=!1,this.firstOpen=!0,this.departmentID=null,this.privacyApproved=!1,this.startedAt=new Date}return i.prototype.initDefafultParameters=function(){this.globalsParameters={},this.filterSystemMsg=!0;var o=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(o=window.parent);var n=pe(window,"windowcontext");null!==n&&"window.parent"===n&&(o=window.parent),this.windowContext=o,this.baseLocation=this.BASE_LOCATION,this.autoStart=!0,this.startHidden=!1,this.isShown=!0,this.isOpen=!1,this.startFromHome=!0,this.isOpenPrechatForm=!0,this.isOpenStartRating=!1,this.projectid="",this.preChatForm=!1,this.align="",this.calloutTimer=-1,this.calloutTitle="",this.calloutMsg="",this.calloutStaus=!0,this.userFullname="",this.userEmail="",this.widgetTitle="",this.dynamicWaitTimeReply=!0,this.hideHeaderCloseButton=!1,this.fullscreenMode=!1,this.themeColor=Ie("#2a6ac1",100),this.themeColorOpacity=100,this.themeForegroundColor=Ie("#ffffff",100),this.allowTranscriptDownload=!1,this.poweredBy=this.POWERED_BY,this.logoChat=this.BASE_LOCATION+this.DEFAULT_LOGO_CHAT,this.marginX="20px",this.marginY="20px",this.mobileMarginX="0px",this.mobileMarginY="0px",this.launcherWidth="60px",this.launcherHeight="60px",this.baloonImage="",this.baloonShape="50%",this.isLogEnabled=!1,this.openExternalLinkButton=!0,this.hideHeaderConversationOptionsMenu=!1,this.hideCloseConversationOptionMenu=!1,this.hideRestartConversationOptionsMenu=!1,this.hideSettings=!1,this.filterByRequester=!1,this.persistence="local",this.preChatFormJson=[{name:"userFullname",type:"text",mandatory:!0,label:"LABEL_FIELD_NAME"},{name:"userEmail",type:"text",mandatory:!0,regex:"/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/",label:"LABEL_FIELD_EMAIL",errorLabel:"LABEL_ERROR_FIELD_EMAIL"}],this.bubbleSentBackground=Ie("#2a6ac1",100),this.bubbleSentTextColor=Ie("#ffffff",100),this.bubbleReceivedBackground=Ie("#f0f2f7",100),this.bubbleReceivedTextColor=Ie("#06132b",100),this.fontSize="1.4em",this.fontFamily="'Roboto','Google Sans', Helvetica, Arial, sans-serif'",this.buttonFontSize="15px",this.buttonBackgroundColor=Ie("#ffffff",100),this.buttonTextColor=Ie("#2a6ac1",100),this.buttonHoverBackgroundColor=Ie("#2a6ac1",100),this.buttonHoverTextColor=Ie("#ffffff",100),this.singleConversation=!1,this.nativeRating=!0,this.showInfoMessage="MEMBER_JOINED_GROUP".split(",").map(function(t){return t.trim()}),this.typingLocation="content",this.allowReopen=!1,this.continueConversationBeforeTime=48,this.participants=[],this.showWaitTime=!0,this.showAvailableAgents=!0,this.showLogoutOption=!1,this.offline_msg=this.LABEL_FIRST_MSG_NO_AGENTS,this.online_msg=this.LABEL_FIRST_MSG,this.isOpenNewMessage=!1,this.showAttachmentButton=!0,this.showAllConversations=!0,this.tenant=ce.firebaseConfig.tenant,this.channelType="group",this.default_settings={},this.isMobile=!1,this.isLogged=!1,this.BUILD_VERSION="v."+ce.version,this.filterSystemMsg=!0,this.soundEnabled=!0,this.conversationsBadge=0,this.isOpenMenuOptions=!1,this.signInWithCustomToken=!1,this.displayEyeCatcherCard="none",this.supportMode=!0,this.newConversationStart=!0},i.prototype.initialize=function(){this.createDefaultSettingsObject(),this.setParameter("isMobile",mn(this.windowContext)),this.setParameter("attributes",this.attributes),this.setProjectParameters()},i.prototype.setProjectParameters=function(){var o=this.project.name;this.widgetTitle&&""!==this.widgetTitle&&(o=this.widgetTitle),this.project.customization(o,this.logoChat,Bt(o),Ut(o),this.welcomeTitle,this.welcomeMsg)},i.prototype.createDefaultSettingsObject=function(){this.default_settings={align:this.align,allowReopen:this.allowReopen,allowTranscriptDownload:this.allowTranscriptDownload,autoStart:this.autoStart,baloonShape:this.baloonShape,baloonImage:this.baloonImage,bubbleSentBackground:this.bubbleSentBackground,bubbleSentTextColor:this.bubbleSentTextColor,bubbleReceivedBackground:this.bubbleReceivedBackground,bubbleReceivedTextColor:this.bubbleReceivedTextColor,buttonBackgroundColor:this.buttonBackgroundColor,buttonTextColor:this.buttonTextColor,buttonFontSize:this.buttonFontSize,buttonHoverBackgroundColor:this.buttonHoverBackgroundColor,buttonHoverTextColor:this.buttonHoverTextColor,calloutTitle:this.calloutTitle,calloutMsg:this.calloutMsg,calloutTimer:this.calloutTimer,calloutStaus:this.calloutStaus,channelType:this.channelType,dynamicWaitTimeReply:this.dynamicWaitTimeReply,fontSize:this.fontSize,fontFamily:this.fontFamily,fullscreenMode:this.fullscreenMode,filterByRequester:this.filterByRequester,hideHeaderConversationOptionsMenu:this.hideHeaderConversationOptionsMenu,hideHeaderCloseButton:this.hideHeaderCloseButton,hideCloseConversationOptionMenu:this.hideCloseConversationOptionMenu,hideRestartConversationOptionsMenu:this.hideRestartConversationOptionsMenu,hideSettings:this.hideSettings,isLogEnabled:this.isLogEnabled,isOpen:this.isOpen,isShown:this.isShown,jwt:this.jwt,logLevel:this.logLevel,logoChat:this.logoChat,lang:this.lang,lancherWidth:this.launcherWidth,lancherHeight:this.launcherHeight,marginX:this.marginX,marginY:this.marginY,mobileMarginX:this.mobileMarginX,mobileMarginY:this.mobileMarginY,nativeRating:this.nativeRating,openExternalLinkButton:this.openExternalLinkButton,participants:this.participants,persistence:this.persistence,poweredBy:this.poweredBy,preChatForm:this.preChatForm,preChatFormJson:this.preChatFormJson,projectid:this.projectid,recipientId:this.recipientId,singleConversation:this.singleConversation,showInfoMessage:this.showInfoMessage,showAllConversations:this.showAllConversations,showWaitTime:this.showWaitTime,showAvailableAgents:this.showAvailableAgents,showLogoutOption:this.showLogoutOption,showAttachmentButton:this.showAttachmentButton,soundEnabled:this.soundEnabled,startHidden:this.startHidden,startFromHome:this.startFromHome,tenant:this.tenant,themeColor:this.themeColor,themeColorOpacity:this.themeColorOpacity,themeForegroundColor:this.themeForegroundColor,typingLocation:this.typingLocation,userEmail:this.userEmail,userFullname:this.userFullname,widgetTitle:this.widgetTitle,welcomeMsg:this.welcomeMsg,welcomeTitle:this.welcomeTitle}},i.prototype.setColorWithGradient=function(){this.colorGradient="linear-gradient("+this.themeColor+", "+Ie(this.themeColor,this.themeColorOpacity)+")",this.colorGradient180="linear-gradient( 180grad, "+this.themeColor+", "+Ie(this.themeColor,this.themeColorOpacity)+")",this.bubbleSentBackground="linear-gradient( 135grad, "+this.bubbleSentBackground+", "+Ie(this.bubbleSentBackground,80)+")"},i.prototype.setParentBodyStyleMobile=function(o,n){o&&n?(window.parent.document.body.style.height="0",window.parent.document.body.style.width="100%",window.parent.document.body.style.overflowY="hidden",window.parent.document.body.style.position="fixed"):!o&&n&&(window.parent.document.body.style.removeProperty("height"),window.parent.document.body.style.removeProperty("width"),window.parent.document.body.style.removeProperty("overflow-y"),window.parent.document.body.style.removeProperty("position"))},i.prototype.setElementStyle=function(o){var n=this.windowContext.document.getElementById("tiledeskdiv"),t=document.getElementById("chat21-conversations");o&&n?setTimeout(function(){n.classList.add("shadow"),t.classList.add("shadow")},1e3):!o&&n&&(n.classList.remove("shadow"),t.classList.remove("shadow")),o&&this.isMobile&&t?t.classList.add("isMobile"):!o&&t&&t.classList.remove("isMobile")},i.prototype.setIsOpen=function(o){this.isOpen=o,this.setParentBodyStyleMobile(o,this.isMobile),this.setElementStyle(o),this.obsIsOpen.next(o)},i.prototype.setParameter=function(o,n,t){this[o]=n,!0===t&&this.obsObjChanged.next({key:o,val:n})},i.prototype.setAttributeParameter=function(o,n){this.attributes[o]=n,this.setParameter("attributes",this.attributes,!0)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)},providedIn:"root"}),i}(),me=ye(61116);function wo(i,o){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.emoticon)}}function Oo(i,o){if(1&i&&(e.TgZ(0,"p",17),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.calloutMsg," ")}}function Mo(i,o){if(1&i&&(e.TgZ(0,"p",17),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.CALLOUT_MSG_PLACEHOLDER," ")}}var xo=function(i,o){return{"c21-align-left":i,"c21-align-right":o}},Eo=function(i,o,n,t){return{display:i,bottom:o,left:n,right:t}};function To(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",1),e.NdJ("mouseenter",function(){return e.CHM(n),e.oxw().mouseEnter()})("mouseleave",function(){return e.CHM(n),e.oxw().mouseLeave()}),e.TgZ(1,"div",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.NdJ("click",function(){return e.CHM(n),e.oxw().closeEyeCatcherCard()}),e.O4$(),e.TgZ(4,"svg",5),e._UZ(5,"path",6),e._UZ(6,"path",7),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"div",8),e.NdJ("click",function(){return e.CHM(n),e.oxw().openChatFromEyeCatcherCard()}),e.TgZ(8,"div",9),e.YNc(9,wo,2,1,"span",10),e.qZA(),e.qZA(),e.TgZ(10,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw().openChatFromEyeCatcherCard()}),e.TgZ(11,"div",12),e.TgZ(12,"p",13),e._uU(13),e.qZA(),e.YNc(14,Oo,2,1,"p",14),e.YNc(15,Mo,2,1,"ng-template",null,15,e.W1O),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.MAs(16),r=e.oxw();e.ekj("mobile",r.g.isMobile),e.Q6J("ngClass",e.WLB(9,xo,"left"===r.g.align,"left"!==r.g.align))("ngStyle",e.l5B(12,Eo,r.g.displayEyeCatcherCard,r.g.marginY+"px","left"===r.g.align?r.g.marginX+"px":"","right"===r.g.align?r.g.marginX+"px":"")),e.xp6(8),e.Q6J("@rotatedState",r.state),e.xp6(1),e.Q6J("ngIf",r.emoticon),e.xp6(4),e.Oqu(r.title),e.xp6(1),e.Q6J("ngIf",""!==r.g.calloutMsg)("ngIfElse",t)}}var yn=function(){function i(o){this.g=o,this.onOpenChat=new e.vpe,this.onCloseEyeCatcherCard=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.state="default",this.g.setParameter("displayEyeCatcherCard","none"),this.displayEyeCatcherCardCloseBtnWrapper="none",this.displayEyeCatcherCardCloseBtnIsMobileWrapper="none",this.displayEyeCatcherCardCloseBtn="none",this.openIfCallOutTimer()},i.prototype.openIfCallOutTimer=function(){var o=this,n=this.g.calloutTimer;n>=0&&setTimeout(function(){o.openEyeCatcher()},1e3*n)},i.prototype.openEyeCatcher=function(){this.checkIsEmoji();var o=this.g.isOpen;this.logger.debug("[EYEEYE-CATCHER-CARD] openEyeCatcher: calloutStaus ---------\x3e ",this.g.calloutStaus),!1===o&&this.g.calloutStaus?(this.onCloseEyeCatcherCard.emit(!0),this.g.setParameter("displayEyeCatcherCard","block"),this.displayEyeCatcherCardCloseBtnWrapper="block",this.displayEyeCatcherCardCloseBtnIsMobileWrapper="block"):this.logger.debug("[EYEEYE-CATCHER-CARD] openEyeCatcher: \xbb\xbb\xbb\xbb\xbb\xbb\xbb CALLING OPEN-EYE-CATCHER BUT NOT DISPLAY THE CARD BECAUSE THE CHAT IS ALREADY OPEN ")},i.prototype.checkIsEmoji=function(){var o=this.g.CALLOUT_TITLE_PLACEHOLDER.trim();this.g.calloutTitle&&""!==this.g.calloutTitle&&(o=this.g.calloutTitle.trim()),this.title=o;for(var r,t=ye(81126)();r=t.exec(o);){var a=r[0];this.logger.debug("[EYEEYE-CATCHER-CARD]--\x3e match",r),0===o.indexOf(a)&&(this.title=o.replace(a,""),this.emoticon=a);break}},i.prototype.openChatFromEyeCatcherCard=function(){this.g.setParameter("displayEyeCatcherCard","none"),this.onOpenChat.emit()},i.prototype.mouseEnter=function(){},i.prototype.mouseLeave=function(){},i.prototype.closeEyeCatcherCard=function(){this.onCloseEyeCatcherCard.emit(!1),this.g.setParameter("displayEyeCatcherCard","none"),this.g.setParameter("calloutStaus",!1,!0),this.displayEyeCatcherCardCloseBtnWrapper="none"},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-eyeeye-catcher-card"]],outputs:{onOpenChat:"onOpenChat",onCloseEyeCatcherCard:"onCloseEyeCatcherCard"},decls:1,vars:1,consts:[["class","eye-catcher-card scale-in-center",3,"mobile","ngClass","ngStyle","mouseenter","mouseleave",4,"ngIf"],[1,"eye-catcher-card","scale-in-center",3,"ngClass","ngStyle","mouseenter","mouseleave"],[1,"eye-catcher_row"],[1,"eye-catcher-card-close-btn-wrapper"],[1,"eye-catcher-card-close-btn",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","white","width","24px","height","24px",1,"eye-catcher-card-close-btn-img"],["d","M0 0h24v24H0V0z","fill","none"],["d","M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"],[1,"eye-catcher_column","ec_left",3,"click"],[1,"eye-catcher-card-emoticons-wrapper"],["class","chat21-card-emoticons",4,"ngIf"],[1,"eye-catcher_column","ec_right",3,"click"],[1,"eye-catcher-card-text-wrapper"],[1,"eye-catcher-card-title"],["class","eye-catcher-card-msg",4,"ngIf","ngIfElse"],["calloutMsg_placeholder",""],[1,"chat21-card-emoticons"],[1,"eye-catcher-card-msg"]],template:function(n,t){1&n&&e.YNc(0,To,17,17,"div",0),2&n&&e.Q6J("ngIf",!t.g.isOpenNewMessage)},directives:[me.O5,me.mk,me.PC],styles:['.eye-catcher_column[_ngcontent-%COMP%]{float:left}.ec_right[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.eye-catcher_row[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.eye-catcher-card-emoticons-wrapper[_ngcontent-%COMP%]{text-align:center}.eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{z-index:1;height:40px;width:40px;position:absolute;top:-14px;display:none}.eye-catcher-card-close-btn[_ngcontent-%COMP%]{z-index:2;background-color:#5d6c80;width:24px;height:24px;border-radius:50%;position:relative;left:0px;right:0px;cursor:pointer;float:right;margin:4px;box-shadow:0 2px 8px rgba(35,47,53,.1)}.eye-catcher-card-close-btn-img[_ngcontent-%COMP%]{fill:#fff;width:18px;height:18px;margin:calc(50% - 9px)}.eye-catcher-card-close-btn-img-is-mobile-wrapper[_ngcontent-%COMP%]{z-index:1;position:absolute;right:-1px;top:-39px;right:-14px;cursor:pointer}.eye-catcher-card-close-btn-img-is-mobile[_ngcontent-%COMP%]{width:40px;position:relative;max-width:none}.eye-catcher-card[_ngcontent-%COMP%]{position:absolute;z-index:1;bottom:0px;cursor:pointer;background-color:#fff;border:0px solid #dedfde;box-shadow:rgba(35,47,53,.09) 0 2px 8px;width:300px;height:70px;border-radius:35px}.eye-catcher-card[_ngcontent-%COMP%] .eye-catcher_row[_ngcontent-%COMP%]{width:100%;height:100%;position:absolute}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%]{margin:16px 14px 15px 16px;padding-left:70px}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{right:0px}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .ec_left[_ngcontent-%COMP%]{width:40px;height:auto;margin:20px 4px 16px 0;overflow:hidden;position:absolute;top:0;right:0}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .ec_right[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 40px);height:100%;padding:0;vertical-align:middle;display:inline-table;position:absolute;top:0;left:0}.eye-catcher-card.c21-align-left[_ngcontent-%COMP%] .eye-catcher_row[_ngcontent-%COMP%]{width:calc(100% - 70px)}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%]{margin:16px 14px 15px 16px;padding-right:70px}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{left:-14px}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .ec_left[_ngcontent-%COMP%]{width:40px;height:auto;margin:18px 3px;overflow:hidden;position:absolute;top:0;left:0}.eye-catcher-card.c21-align-right[_ngcontent-%COMP%] .ec_right[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 115px);height:100%;padding:0;vertical-align:middle;display:inline-table;position:absolute;top:0;left:46px}.eye-catcher-card[_ngcontent-%COMP%]:hover .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{display:block}.eye-catcher-card-text-wrapper[_ngcontent-%COMP%]{width:100%;height:auto;vertical-align:middle;font-family:"Helvetica Neue","Apple Color Emoji",Helvetica,Arial,sans-serif;font-weight:normal;word-wrap:break-word;margin:0;position:absolute;line-height:normal;top:50%;transform:translateY(-50%)}.eye-catcher-card-title[_ngcontent-%COMP%]{font-size:15px;color:#3b3c40;display:block;margin:0;padding:0 0 4px}.eye-catcher-card-msg[_ngcontent-%COMP%]{letter-spacing:1px;font-size:13px;color:#7b7b7b;display:block;padding:0;margin:0;line-height:normal;width:100%}.eye-catcher-card-img-wrapper[_ngcontent-%COMP%]{border:1px solid #dedfde;border-radius:100px;height:65px;width:65px}.eye-catcher-card[_ngcontent-%COMP%] .chat21-card-img[_ngcontent-%COMP%]{position:relative;bottom:14px;right:15px;width:95px;max-width:none}.chat21-card-emoticons[_ngcontent-%COMP%]{font-size:26px}.eye-catcher-card.mobile[_ngcontent-%COMP%]{max-width:calc(100% - 100px)}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-img-wrapper[_ngcontent-%COMP%]{border:1px solid #dedfde;border-radius:100px;height:65px;width:65px}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn[_ngcontent-%COMP%]{background-color:#fcfcfc;width:30px;height:30px;margin:4px -4px;box-shadow:0 2px 8px rgba(35,47,53,.2)}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn-wrapper[_ngcontent-%COMP%]{display:block}.eye-catcher-card.mobile[_ngcontent-%COMP%] .eye-catcher-card-close-btn-img[_ngcontent-%COMP%]{fill:#5d6c80}'],data:{animation:[(0,we.X$)("rotatedState",[])]}}),i}();function qt(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"image"===i.type)}function wn(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"frame"===i.type)}function So(i){return!!(i&&i.type&&i.metadata&&i.metadata.src&&"file"===i.type)}function xt(i){return!(!i||!i.attributes||"info"!==i.attributes.subtype&&"info/support"!==i.attributes.subtype)}function On(i){return!!(i&&i.attributes&&"info"===i.attributes.subtype&&i.attributes.messagelabel&&"USER_BANNED"===i.attributes.messagelabel.key)}function Vt(i){return!(!i||!i.isSender)}function Xe(i,o){return"DATE"===i?!(!o.headerDate||""===o.headerDate):i===N?xt(o):i===V?Vt(o):i===Q?!1===xt(o)&&!1===Vt(o):void 0}function Po(i){try{if(!i)return!1;var o=i.replace(new RegExp("[\0-\u1eeff]","g"),""),n=i.replace(new RegExp("[\n\rs]+|( )+","g"),"");return""!==o&&""!=n&&o.length===n.length&&o.length<=2}catch(t){return!1}}function Wt(i,o){return o>i}function Mn(i,o){return!(!(i&&i.attributes&&i.attributes.messagelabel&&"MEMBER_JOINED_GROUP"===i.attributes.messagelabel.key&&i.attributes.messagelabel.parameters.member_id!==o.uid)||i.attributes.messagelabel.parameters.member_id.includes("bot")||i.attributes.messagelabel.parameters.member_id.includes("system"))||!!(i&&i.attributes&&i.attributes.messagelabel&&"MEMBER_JOINED_GROUP"!==i.attributes.messagelabel.key)}function Et(i,o){return!(i&&i.attributes&&i.attributes.messagelabel&&o.includes(i.attributes.messagelabel.key))}var xn=function(){function i(){this.logger=Ce.getInstance()}return i.prototype.setElement=function(o){this.el=o},i.prototype.setWindowContext=function(o){this.windowContext=o},i.prototype.triggerBeforeSendMessageEvent=function(o){this.logger.debug(" ---------------- triggerBeforeSendMessageEvent ---------------- ",o);try{var n=new CustomEvent("onBeforeMessageSend",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerAfterSendMessageEvent=function(o){this.logger.debug(" ---------------- triggerAfterSendMessageEvent ---------------- ",o);try{var n=new CustomEvent("onAfterMessageSend",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnNewConversationInit=function(o){this.logger.debug(" ---------------- triggerOnNewConversationComponentInit ---------------- ",o);var n=new CustomEvent("onNewConversationComponentInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerBeforeMessageRender=function(o){try{var n=new CustomEvent("beforeMessageRender",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerAfterMessageRender=function(o){try{var n=new CustomEvent("afterMessageRender",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnMessageCreated=function(o){this.logger.debug(" ---------------- triggerOnMessageCreated ---------------- ",o);var n=new CustomEvent("onMessageCreated",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnViewInit=function(o){this.logger.debug(" ---------------- triggerOnInit ---------------- ",o);var n=new CustomEvent("onInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnOpenEvent=function(o){this.logger.debug(" ---------------- triggerOnOpenEvent ---------------- ",o);var n=new CustomEvent("onOpen",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnCloseEvent=function(o){this.logger.debug(" ---------------- triggerOnCloseEvent ---------------- ",o);var n=new CustomEvent("onClose",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnOpenEyeCatcherEvent=function(o){this.logger.debug(" ---------------- triggerOnOpenEyeCatcherEvent ---------------- ",o);var n=new CustomEvent("onOpenEyeCatcher",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnClosedEyeCatcherEvent=function(){this.logger.debug(" ---------------- triggerOnClosedEyeCatcherEvent ---------------- ");var o=new CustomEvent("onClosedEyeCatcher",{detail:{}}),n=this.windowContext;n.tiledesk&&n.tiledesk.tiledeskroot?(n.tiledesk.tiledeskroot.dispatchEvent(o),this.windowContext=n):this.el.nativeElement.dispatchEvent(o)},i.prototype.triggerOnLoggedIn=function(o){this.logger.debug(" ---------------- triggerOnLoggedIn ---------------- ",o);var n=new CustomEvent("onLoggedIn",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnLoggedOut=function(o){this.logger.debug(" ---------------- triggerOnLoggedOut ---------------- ",o);var n=new CustomEvent("onLoggedOut",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnAuthStateChanged=function(o){this.logger.debug(" ---------------- triggerOnAuthStateChanged ---------------- ",o);var n=new CustomEvent("onAuthStateChanged",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerNewConversationEvent=function(o){this.logger.debug(" ---------------- triggerNewConversationEvent ---------------- ",o);var n=new CustomEvent("onNewConversation",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerLoadParamsEvent=function(o){this.logger.debug(" ---------------- triggerOnLoadParamsEvent ---------------- ",o);var n=new CustomEvent("onLoadParams",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnBeforeInit=function(o){this.logger.debug(" ---------------- triggerOnBeforeInitEvent ---------------- ",o);var n=new CustomEvent("onBeforeInit",{detail:o}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerOnConversationUpdated=function(o){this.logger.debug(" ---------------- triggerOnConversationUpdated ---------------- ",o);try{var n=new CustomEvent("onConversationUpdated",{detail:{conversation:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.prototype.triggerOnCloseMessagePreview=function(){this.logger.debug(" ---------------- triggerOnCloseMessagePreview ---------------- ");try{var o=new CustomEvent("onCloseMessagePreview",{detail:{}}),n=this.windowContext;n.tiledesk&&n.tiledesk.tiledeskroot?(n.tiledesk.tiledeskroot.dispatchEvent(o),this.windowContext=n):this.el.nativeElement.dispatchEvent(o)}catch(t){this.logger.error("[TRIGGER-HANDLER] > Error:"+t)}},i.prototype.triggerOnbeforeDepartmentsFormRender=function(o){this.logger.debug(" ---------------- triggerOnbeforeDepartmentsFormRender ---------------- ");var n=new CustomEvent("onBeforeDepartmentsFormRender",{detail:{departments:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot?(t.tiledesk.tiledeskroot.dispatchEvent(n),this.windowContext=t):this.el.nativeElement.dispatchEvent(n)},i.prototype.triggerGetImageUrlThumb=function(o){this.logger.debug(" ---------------- getImageUrlThumb ---------------- ");try{var n=new CustomEvent("getImageUrlThumb",{detail:{message:o}}),t=this.windowContext;t.tiledesk&&t.tiledesk.tiledeskroot&&t.tiledesk.tiledeskroot.dispatchEvent(n)}catch(r){this.logger.error("[TRIGGER-HANDLER] > Error:"+r)}},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Se=ye(42693),ko=ye(96791),He=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Fe=function(){function i(o,n){this.http=o,this.g=n,this.appConfig=ce}return i.prototype.loadAppConfig=function(){var o=this.appConfig.remoteConfigUrl;if(!this.appConfig.remoteConfigUrl.startsWith("http")){var n=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(n=window.parent);var t=function(i,o){var n=window.location.href;o=o.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+o+"(=([^&#]*)|&|#|$)").exec(n);return r?r[2]?"false"===r[2]||"0"===r[2]?"false":decodeURIComponent(r[2].replace(/\+/g," ")):"true":null}(0,"windowcontext");if(null!==t&&"window.parent"===t&&(n=window.parent),!n.tiledesk)return;var r=n.tiledesk.getBaseLocation();void 0!==r&&(this.g.baseLocation=r,o=this.g.baseLocation+this.appConfig.remoteConfigUrl)}var a=this;return this.http.get(o).toPromise().then(function(u){a.appConfig=u}).catch(function(u){console.error("error loadAppConfig",u)})},i.prototype.getConfig=function(){return this.appConfig},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i}(),En=function(){function i(o,n,t){this.http=o,this.appStorageService=n,this.appConfigService=t,this.logger=Ce.getInstance(),this.obsSettingsService=new he.X(null)}return i.prototype.initWidgetParamiters=function(o,n){var r,t=this;this.globals=o,this.el=n,this.globals.initDefafultParameters();try{r=this.setProjectId()}catch(a){return void this.logger.error("[GLOBAL-SET] > Error :"+a)}this.setMainParametersFromSettings(o),this.globals.tenant=this.appConfigService.getConfig().firebaseConfig.tenant,this.globals.logLevel=this.appConfigService.getConfig().logLevel,this.globals.persistence=this.appConfigService.getConfig().authPersistence,this.getProjectParametersById(r).subscribe(function(a){var u=a.project;u&&t.globals.project.initialize(u.id,u.activeOperatingHours,u.channels,u.name,u.createdAt,u.createdBy,u.isActiveSubscription,u.profile,u.agents,u.trialDays,u.type,u.status,u.trialDaysLeft,u.trialExpired,u.updatedAt,u.versions),t.setParameters(a)},function(a){t.setParameters(null)},function(){})},i.prototype.setProjectId=function(){try{(o=this.globals.windowContext.tiledeskSettings.projectid)&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 1 > Error :"+n)}try{(o=this.el.nativeElement.getAttribute("projectid"))&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 2 > Error :"+n)}try{var o;(o=pe(this.globals.windowContext,"tiledesk_projectid"))&&(this.globals.projectid=o)}catch(n){this.logger.error("[GLOBAL-SET] setProjectId 3 > Error :"+n)}return this.globals.projectid},i.prototype.setMainParametersFromSettings=function(o){var n;try{var t=this.globals.windowContext.tiledesk.getBaseLocation();this.logger.debug("[GLOBAL-SET] 1 > baseLocation: ",t),void 0!==t&&(this.globals.baseLocation=t)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings baseLocation > Error :",ie)}try{n=this.globals.windowContext.tiledeskSettings}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings tiledeskSettings > Error :",ie)}try{var r=n.persistence;void 0!==r&&(this.globals.persistence=r)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings persistence > Error :",ie)}try{var a=n.filterByRequester;this.logger.debug("[GLOBAL-SET] setMainParametersFromSettings > filterByRequester: ",a),void 0!==a&&(this.globals.filterByRequester=!0===a)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings filterByRequester > Error :",ie)}try{var u=n.isLogEnabled;void 0!==u&&(this.globals.isLogEnabled=!0===u)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings isLogEnabled > Error :",ie)}try{var y=n.departmentID;void 0!==y&&(this.globals.departmentID=y)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings departmentID > Error :",ie)}try{var j=n.showAttachmentButton;void 0!==j&&(this.globals.showAttachmentButton=!0===j)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings showAttachmentButton > Error :",ie)}try{var J=n.showAllConversations;void 0!==J&&(this.globals.showAllConversations=!0===J)}catch(ie){this.logger.error("[GLOBAL-SET] setMainParametersFromSettings showAllConversations > Error :",ie)}},i.prototype.setParameters=function(o){this.logger.debug("[GLOBAL-SET] ***** setParameters ***** ",o),null!==o&&this.setVariablesFromService(this.globals,o),this.setVariableFromStorage(this.globals),this.setVariablesFromSettings(this.globals),this.setVariablesFromAttributeHtml(this.globals,this.el),this.setVariablesFromUrlParameters(this.globals),this.setDepartmentFromExternal(),this.globals.setColorWithGradient(),this.setCssIframe(),this.logger.debug("[GLOBAL-SET] ***** END SET PARAMETERS *****"),this.obsSettingsService.next(!0)},i.prototype.setCssIframe=function(){this.globals.setParameter("isMobile",mn(this.globals.windowContext));var o=this.globals.windowContext.document.getElementById("tiledeskdiv");o&&("left"===this.globals.align?(o.classList.add("align-left"),o.style.left=this.globals.isMobile?this.globals.mobileMarginX:this.globals.marginX):(o.classList.add("align-right"),o.style.right=this.globals.isMobile?this.globals.mobileMarginX:this.globals.marginX),o.style.bottom=this.globals.isMobile?this.globals.mobileMarginY:this.globals.marginY,!0===this.globals.fullscreenMode&&(o.style.left=0,o.style.right=0,o.style.top=0,o.style.bottom=0,o.style.width="100%",o.style.height="100%",o.style.maxHeight="none",o.style.maxWidth="none"))},i.prototype.setVariablesFromService=function(o,n){var t,r;this.logger.debug("[GLOBAL-SET] > setVariablesFromService :",n),this.globals=o;try{var a=n.departments;void 0!==a&&this.initDepartments(a)}catch(ve){this.initDepartments(null),this.logger.error("[GLOBAL-SET] setVariablesFromService > Error is departments: ",ve)}try{var u=n.user_available;void 0!==u&&(this.logger.debug("[GLOBAL-SET] setVariablesFromService > user_available ::::",u),this.setAvailableAgentsStatus(u))}catch(ve){this.setAvailableAgentsStatus(null),this.logger.error("[GLOBAL-SET] setVariablesFromService > Error is departments: ",ve)}try{var y=n.project.widget;if(void 0!==y)try{for(var j=(0,_e.XA)(Object.keys(y)),J=j.next();!J.done;J=j.next()){var ie=J.value;"align"===ie&&"left"===y[ie]?(o.windowContext.document.getElementById("tiledeskdiv").style.left="0!important",o.align="left"):"align"===ie&&"right"===y[ie]&&(o.windowContext.document.getElementById("tiledeskdiv").style.right="0!important",o.align="right"),y.hasOwnProperty("calloutTimer")&&(o.calloutTimer=y.calloutTimer),y.hasOwnProperty("dynamicWaitTimeReply")&&(o.dynamicWaitTimeReply=be(y.dynamicWaitTimeReply)),y.hasOwnProperty("logoChat")&&(o.logoChat=y.logoChat),y.hasOwnProperty("preChatForm")&&(o.preChatForm=y.preChatForm),y.hasOwnProperty("preChatFormCustomFieldsEnabled")&&y.hasOwnProperty("preChatFormJson")&&(o.preChatFormJson=y.preChatFormJson),y.hasOwnProperty("themeColor")&&(o.themeColor=y.themeColor,o.bubbleSentBackground=y.themeColor,o.bubbleSentTextColor=Ke(y.themeColor,!0),o.buttonTextColor=y.themeColor,o.buttonHoverBackgroundColor=y.themeColor),y.hasOwnProperty("themeColorOpacity")&&(o.themeColorOpacity=y.themeColorOpacity),y.hasOwnProperty("themeForegroundColor")&&(o.themeForegroundColor=y.themeForegroundColor),y.hasOwnProperty("nativeRating")&&(o.nativeRating=y.nativeRating),y.hasOwnProperty("poweredBy")&&(o.poweredBy=y.poweredBy),y.hasOwnProperty("baloonImage")&&(o.baloonImage=y.baloonImage),y.hasOwnProperty("allowReopen")&&(o.allowReopen=y.allowReopen,o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),y.hasOwnProperty("singleConversation")&&(o.singleConversation=y.singleConversation),y.hasOwnProperty("themeColorOpacity")&&(o.themeColorOpacity=y.themeColorOpacity)}}catch(ve){t={error:ve}}finally{try{J&&!J.done&&(r=j.return)&&r.call(j)}finally{if(t)throw t.error}}}catch(ve){this.logger.error("[GLOBAL-SET] setVariablesFromService widget > Error :",ve)}try{var de=n.ip.split(",").shift();this.globals.attributes||(this.globals.attributes={}),this.globals.attributes.ipAddress=de,this.globals.setAttributeParameter("ipAddress",de),this.logger.debug("[GLOBAL-SET] setVariablesFromService > ipAddress :",de)}catch(ve){this.logger.error("[GLOBAL-SET] setVariablesFromService > ipAddress > Error :",ve)}this.appStorageService.setItem("attributes",JSON.stringify(this.globals.attributes))},i.prototype.setVariablesFromSettings=function(o){var n=o.windowContext;if(n.tiledesk){var t=n.tiledesk.getBaseLocation();void 0!==t&&(o.baseLocation=t);var r,a=n.tiledeskSettings;void 0!==(r=a.tenant)&&(o.tenant=r),void 0!==(r=a.recipientId)&&(o.recipientId=r),void 0!==(r=a.widgetTitle)&&(o.widgetTitle=r),void 0!==(r=a.userEmail)&&(o.userEmail=r),void 0!==(r=a.userFullname)&&(o.userFullname=r),void 0!==(r=a.preChatForm)&&(o.preChatForm=!0===r),void 0!==(r=a.isOpen)&&(o.isOpen=!0===r),void 0!==(r=a.open)&&(o.isOpen=!0===r),void 0!==(r=a.channelType)&&(o.channelType=r),r=a.lang,ko.XAE&&(o.lang=r),void 0!==(r=a.align)&&(o.align=r),void 0!==(r=a.marginX)&&(o.marginX=r),void 0!==(r=a.marginY)&&(o.marginY=r),void 0!==(r=a.mobileMarginX)&&(o.mobileMarginX=r),void 0!==(r=a.mobileMarginY)&&(o.mobileMarginY=r),void 0!==(r=a.launcherWidth)&&(o.launcherWidth=r),void 0!==(r=a.launcherHeight)&&(o.launcherHeight=r),void 0!==(r=a.baloonImage)&&(o.baloonImage=r),void 0!==(r=a.baloonShape)&&(o.baloonShape=r),void 0!==(r=a.calloutTimer)&&(o.calloutTimer=r),void 0!==(r=a.calloutTitle)&&(o.calloutTitle=r),void 0!==(r=a.calloutMsg)&&(o.calloutMsg=r),void 0!==(r=a.fullscreenMode)&&(o.fullscreenMode=r),void 0!==(r=a.hideHeaderCloseButton)&&(o.hideHeaderCloseButton=r),void 0!==(r=a.themeColor)&&(o.themeColor=Ee(r,100),o.bubbleSentBackground=Ee(r,100),o.bubbleSentTextColor=Ke(r,!0),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.themeColorOpacity)&&(o.themeColorOpacity=+r),void 0!==(r=a.themeForegroundColor)&&(o.themeForegroundColor=Ee(r,100)),void 0!==(r=a.allowTranscriptDownload)&&(o.allowTranscriptDownload=!0===r),void 0!==(r=a.startFromHome)&&(o.startFromHome=!0===r),void 0!==(r=a.logoChat)&&(o.logoChat=r),void 0!==(r=a.welcomeTitle)&&(o.welcomeTitle=r),void 0!==(r=a.welcomeMsg)&&(o.welcomeMsg=r),void 0!==(r=a.autoStart)&&(o.autoStart=!0===r),void 0!==(r=a.startHidden)&&(o.startHidden=!0===r),void 0!==(r=a.isShown)&&(o.isShown=!0===r),void 0!==(r=a.filterByRequester)&&(o.filterByRequester=!0===r),void 0!==(r=a.showWaitTime)&&(o.showWaitTime=!0===r),void 0!==(r=a.showAvailableAgents)&&(o.showAvailableAgents=!0===r),void 0!==(r=a.showLogoutOption)&&(o.showLogoutOption=!0===r),void 0!==(r=a.customAttributes)&&(o.customAttributes=r),void 0!==(r=a.showAttachmentButton)&&(o.showAttachmentButton=!0===r),void 0!==(r=a.showAllConversations)&&(o.showAllConversations=!0===r),void 0!==(r=a.dynamicWaitTimeReply)&&(o.dynamicWaitTimeReply=be(r)),void 0!==(r=a.soundEnabled)&&(o.soundEnabled=r),void 0!==(r=a.openExternalLinkButton)&&(o.openExternalLinkButton=r),void 0!==(r=a.hideCloseConversationOptionMenu)&&(o.hideCloseConversationOptionMenu=!0===r),void 0!==(r=a.hideRestartConversationOptionsMenu)&&(o.hideRestartConversationOptionsMenu=!0===r),void 0!==(r=a.hideHeaderConversationOptionsMenu)&&(o.hideHeaderConversationOptionsMenu=!0===r),void 0!==(r=a.hideSettings)&&(o.hideSettings=!0===r),void 0!==(r=a.logLevel)&&(o.logLevel=r),void 0!==(r=a.preChatFormJson)&&function(i){var o=!0;return Array.isArray(i)&&i.forEach(function(n){if("object"!=typeof n)return o=!1}),o}(r)&&(o.preChatFormJson=r),void 0!==(r=a.bubbleSentBackground)&&(o.bubbleSentBackground=Ee(r,100),o.bubbleSentTextColor=Ke(r,!0),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.bubbleSentTextColor)&&(o.bubbleSentTextColor=Ee(r,100)),void 0!==(r=a.bubbleReceivedBackground)&&(o.bubbleReceivedBackground=Ee(r,100),o.bubbleReceivedTextColor=Ke(r,!0)),void 0!==(r=a.bubbleReceivedTextColor)&&(o.bubbleReceivedTextColor=Ee(r,100)),void 0!==(r=a.fontSize)&&(o.fontSize=r),void 0!==(r=a.fontFamily)&&(o.fontFamily=r),void 0!==(r=a.buttonFontSize)&&(o.buttonFontSize=r),void 0!==(r=a.buttonBackgroundColor)&&(o.buttonBackgroundColor=Ee(r,100),o.buttonTextColor=Ke(r,!0),o.buttonHoverBackgroundColor=Ke(r,!0),o.buttonHoverTextColor=Ee(r,100)),void 0!==(r=a.buttonTextColor)&&(o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.buttonHoverBackgroundColor)&&(o.buttonHoverBackgroundColor=Ee(r,100)),void 0!==(r=a.buttonHoverTextColor)&&(o.buttonHoverTextColor=Ee(r,100)),void 0!==(r=a.singleConversation)&&(o.singleConversation=!0===r),void 0!==(r=a.nativeRating)&&(o.nativeRating=!0===r),void 0!==(r=a.showInfoMessage)&&(o.showInfoMessage=r.split(",").map(function(u){return u.trim()})),void 0!==(r=a.typingLocation)&&(o.typingLocation=r),void 0!==(r=a.allowReopen)&&(o.allowReopen=!0===r,o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),void 0!==(r=a.continueConversationBeforeTime)&&(o.continueConversationBeforeTime=+r),void 0!==(r=a.participants)&&(o.participants=r.split(",").map(function(u){return u.trim()}))}},i.prototype.setVariablesFromAttributeHtml=function(o,n){var t;null!==(t=n.nativeElement.getAttribute("tenant"))&&(this.globals.tenant=t),null!==(t=n.nativeElement.getAttribute("recipientId"))&&(this.globals.recipientId=t),null!==(t=n.nativeElement.getAttribute("widgetTitle"))&&(this.globals.widgetTitle=t),null!==(t=n.nativeElement.getAttribute("userEmail"))&&(this.globals.userEmail=t),null!==(t=n.nativeElement.getAttribute("userFullname"))&&(this.globals.userFullname=t),null!==(t=n.nativeElement.getAttribute("preChatForm"))&&(this.globals.preChatForm=!0===t),null!==(t=n.nativeElement.getAttribute("isOpen"))&&(this.globals.isOpen=!0===t),null!==(t=n.nativeElement.getAttribute("open"))&&(this.globals.isOpen=!0===t),null!==(t=n.nativeElement.getAttribute("channelType"))&&(this.globals.channelType=t),null!==(t=n.nativeElement.getAttribute("lang"))&&(this.globals.lang=t),null!==(t=n.nativeElement.getAttribute("align"))&&(this.globals.align=t),null!==(t=n.nativeElement.getAttribute("marginX"))&&(this.globals.marginX=t),null!==(t=n.nativeElement.getAttribute("marginY"))&&(this.globals.marginY=t),null!==(t=n.nativeElement.getAttribute("mobileMarginX"))&&(this.globals.mobileMarginX=t),null!==(t=n.nativeElement.getAttribute("mobileMarginY"))&&(this.globals.mobileMarginY=t),null!==(t=n.nativeElement.getAttribute("launcherWidth"))&&(this.globals.launcherWidth=t),null!==(t=n.nativeElement.getAttribute("launcherHeight"))&&(this.globals.launcherHeight=t),null!==(t=n.nativeElement.getAttribute("baloonImage"))&&(this.globals.baloonImage=t),null!==(t=n.nativeElement.getAttribute("baloonShape"))&&(this.globals.baloonShape=t),null!==(t=n.nativeElement.getAttribute("calloutTimer"))&&(this.globals.calloutTimer=t),null!==(t=n.nativeElement.getAttribute("welcomeMsg"))&&(this.globals.welcomeMsg=t),null!==(t=n.nativeElement.getAttribute("welcomeTitle"))&&(this.globals.welcomeTitle=t),null!==(t=n.nativeElement.getAttribute("calloutTitle"))&&(this.globals.calloutTitle=t),null!==(t=n.nativeElement.getAttribute("calloutMsg"))&&(this.globals.calloutMsg=t),null!==(t=n.nativeElement.getAttribute("startFromHome"))&&(this.globals.startFromHome=!0===t),null!==(t=n.nativeElement.getAttribute("logoChat"))&&(this.globals.logoChat=t),null!==(t=n.nativeElement.getAttribute("autoStart"))&&(this.globals.autoStart=!0===t),null!==(t=n.nativeElement.getAttribute("startHidden"))&&(this.globals.startHidden=!0===t),null!==(t=n.nativeElement.getAttribute("isShown"))&&(this.globals.isShown=!0===t),null!==(t=n.nativeElement.getAttribute("isLogEnabled"))&&(this.globals.isLogEnabled=!0===t),null!==(t=n.nativeElement.getAttribute("filterByRequester"))&&(this.globals.filterByRequester=!0===t),null!==(t=n.nativeElement.getAttribute("showAttachmentButton"))&&(this.globals.showAttachmentButton=!0===t),null!==(t=n.nativeElement.getAttribute("departmentID"))&&(this.globals.departmentID=t),null!==(t=n.nativeElement.getAttribute("showAllConversations"))&&(this.globals.showAllConversations=!0===t),null!==(t=n.nativeElement.getAttribute("dynamicWaitTimeReply"))&&(this.globals.dynamicWaitTimeReply=be(t)),null!==(t=n.nativeElement.getAttribute("soundEnabled"))&&(this.globals.soundEnabled=t),null!==(t=n.nativeElement.getAttribute("openExternalLinkButton"))&&(this.globals.openExternalLinkButton=t),null!==(t=n.nativeElement.getAttribute("hideHeaderConversationOptionsMenu"))&&(this.globals.hideHeaderConversationOptionsMenu=t),null!==(t=n.nativeElement.getAttribute("hideCloseConversationOptionMenu"))&&(this.globals.hideCloseConversationOptionMenu=t),null!==(t=n.nativeElement.getAttribute("hideRestartConversationOptionsMenu"))&&(this.globals.hideRestartConversationOptionsMenu=t),null!==(t=n.nativeElement.getAttribute("hideSettings"))&&(this.globals.hideSettings=t),null!==(t=n.nativeElement.getAttribute("logLevel"))&&(this.globals.logLevel=t),null!==(t=n.nativeElement.getAttribute("preChatFormJson"))&&(this.globals.preChatFormJson=t),null!==(t=n.nativeElement.getAttribute("fontSize"))&&(this.globals.fontSize=t),null!==(t=n.nativeElement.getAttribute("fontFamily"))&&(this.globals.fontFamily=t),null!==(t=n.nativeElement.getAttribute("buttonFontSize"))&&(this.globals.buttonFontSize=t),null!==(t=n.nativeElement.getAttribute("buttonBackgroundColor"))&&(this.globals.buttonBackgroundColor=t),null!==(t=n.nativeElement.getAttribute("buttonTextColor"))&&(this.globals.buttonTextColor=t),null!==(t=n.nativeElement.getAttribute("buttonHoverBackgroundColor"))&&(this.globals.buttonHoverBackgroundColor=t),null!==(t=n.nativeElement.getAttribute("buttonHoverTextColor"))&&(this.globals.buttonHoverTextColor=t),null!==(t=n.nativeElement.getAttribute("singleConversation"))&&(this.globals.singleConversation=!0===t),null!==(t=n.nativeElement.getAttribute("nativeRating"))&&(this.globals.nativeRating=!0===t),null!==(t=n.nativeElement.getAttribute("showInfoMessage"))&&(this.globals.showInfoMessage=t.split(",").map(function(r){return r.trim()})),null!==(t=n.nativeElement.getAttribute("typingLocation"))&&(this.globals.typingLocation=t),null!==(t=n.nativeElement.getAttribute("allowReopen"))&&(this.globals.allowReopen=t,this.globals.allowReopen&&!this.globals.showInfoMessage.includes("CHAT_CLOSED")&&this.globals.showInfoMessage.push("CHAT_CLOSED")),null!==(t=n.nativeElement.getAttribute("continueConversationBeforeTime"))&&(this.globals.continueConversationBeforeTime=+t),null!==(t=n.nativeElement.getAttribute("participants"))&&(this.globals.participants=t.split(",").map(function(r){return r.trim()}))},i.prototype.setVariablesFromUrlParameters=function(o){this.logger.debug("[GLOBAL-SET] setVariablesFromUrlParameters: ");var t,n=o.windowContext;if((t=pe(n,"tiledesk_tenant"))&&(o.tenant=be(t)),(t=pe(n,"tiledesk_recipientId"))&&(o.recipientId=be(t)),(t=pe(n,"tiledesk_widgetTitle"))&&(o.widgetTitle=be(t)),(t=pe(n,"tiledesk_userEmail"))&&(o.userEmail=be(t)),(t=pe(n,"tiledesk_userFullname"))&&(o.userFullname=be(t)),(t=pe(n,"tiledesk_channelType"))&&(o.channelType=be(t)),(t=pe(n,"tiledesk_lang"))&&(o.lang=be(t)),(t=pe(n,"tiledesk_calloutTimer"))&&(o.calloutTimer=Number(t)),(t=pe(n,"tiledesk_align"))&&(o.align=be(t)),(t=pe(n,"tiledesk_marginX"))&&(o.marginX=be(t)),(t=pe(n,"tiledesk_marginY"))&&(o.marginY=be(t)),(t=pe(n,"tiledesk_mobileMarginX"))&&(o.mobileMarginX=be(t)),(t=pe(n,"tiledesk_mobileMarginY"))&&(o.mobileMarginY=be(t)),(t=pe(n,"tiledesk_launcherWidth"))&&(o.launcherWidth=be(t)),(t=pe(n,"tiledesk_launcherHeight"))&&(o.launcherHeight=be(t)),(t=pe(n,"tiledesk_baloonImage"))&&(o.baloonImage=be(t)),(t=pe(n,"tiledesk_baloonShape"))&&(o.baloonShape=be(t)),(t=pe(n,"tiledesk_welcomeMsg"))&&(o.welcomeMsg=be(t)),(t=pe(n,"tiledesk_calloutTitle"))&&(o.calloutTitle=be(t)),(t=pe(n,"tiledesk_calloutMsg"))&&(o.calloutMsg=be(t)),(t=pe(n,"tiledesk_hideHeaderCloseButton"))&&(o.hideHeaderCloseButton=be(t)),t=pe(n,"tiledesk_themeColor")){var r=be(t);o.themeColor=Ee(r,100),o.bubbleSentBackground=Ee(r,100),o.buttonTextColor=Ee(r,100),o.buttonHoverBackgroundColor=Ee(r,100)}if((t=pe(n,"tiledesk_themeColorOpacity"))&&(o.themeColorOpacity=+t),t=pe(n,"tiledesk_themeForegroundColor")){var a=be(t);o.themeForegroundColor=Ee(a,100),o.bubbleSentTextColor=Ee(a,100)}if((t=pe(n,"tiledesk_logoChat"))&&(o.logoChat=be(t)),(t=pe(n,"tiledesk_welcomeTitle"))&&(o.welcomeTitle=be(t)),(t=pe(n,"tiledesk_autoStart"))&&(o.autoStart=be(t)),(t=pe(n,"tiledesk_startHidden"))&&(o.startHidden=be(t)),(t=pe(n,"tiledesk_isShown"))&&(o.isShown=be(t)),(t=pe(n,"tiledesk_isLogEnabled"))&&(o.isLogEnabled=be(t)),(t=pe(n,"tiledesk_filterByRequester"))&&(o.filterByRequester=be(t)),(t=pe(n,"tiledesk_showWaitTime"))&&(o.showWaitTime=be(t)),(t=pe(n,"tiledesk_showAvailableAgents"))&&(o.showAvailableAgents=be(t)),(t=pe(n,"tiledesk_showLogoutOption"))&&(o.showLogoutOption=be(t)),(t=pe(n,"tiledesk_preChatForm"))&&(o.preChatForm=be(t)),(t=pe(n,"tiledesk_isOpen"))&&(o.isOpen=be(t)),(t=pe(n,"tiledesk_open"))&&(o.isOpen=be(t)),(t=pe(n,"tiledesk_allowTranscriptDownload"))&&(o.allowTranscriptDownload=be(t)),(t=pe(n,"tiledesk_startFromHome"))&&(o.startFromHome=be(t)),(t=pe(n,"tiledesk_fullscreenMode"))&&(o.fullscreenMode=be(t)),(t=pe(n,"tiledesk_customAttributes"))&&(o.customAttributes=JSON.parse(t)),(t=pe(n,"tiledesk_showAttachmentButton"))&&(o.showAttachmentButton=be(t)),(t=pe(n,"tiledesk_departmentID"))&&(o.departmentID=t),(t=pe(n,"tiledesk_persistence"))&&(o.persistence=t),(t=pe(n,"tiledesk_showAllConversations"))&&(o.showAllConversations=be(t)),(t=pe(n,"tiledesk_jwt"))&&(o.jwt=t),(t=pe(n,"tiledesk_dynamicWaitTimeReply"))&&(o.dynamicWaitTimeReply=be(t)),(t=pe(n,"tiledesk_soundEnabled"))&&(o.soundEnabled=be(t)),(t=pe(n,"tiledesk_openExternalLinkButton"))&&(o.openExternalLinkButton=be(t)),(t=pe(n,"tiledesk_hideHeaderConversationOptionsMenu"))&&(o.hideHeaderConversationOptionsMenu=be(t)),(t=pe(n,"tiledesk_hideCloseConversationOptionMenu"))&&(o.hideCloseConversationOptionMenu=be(t)),(t=pe(n,"tiledesk_hideRestartConversationOptionsMenu"))&&(o.hideRestartConversationOptionsMenu=be(t)),(t=pe(n,"tiledesk_hideSettings"))&&(o.hideSettings=be(t)),(t=pe(n,"tiledesk_logLevel"))&&(o.logLevel=t),(t=pe(n,"tiledesk_preChatFormJson"))&&(o.preChatFormJson=JSON.parse(t)),t=pe(n,"tiledesk_bubbleSentBackground")){var u=be(t);o.bubbleSentBackground=Ee(u,100),o.bubbleSentTextColor=Ke(u,!0),o.buttonTextColor=Ee(u,100),o.buttonHoverBackgroundColor=Ee(u,100)}if(t=pe(n,"tiledesk_bubbleSentTextColor")){var y=be(t);o.bubbleSentTextColor=Ee(y,100)}if(t=pe(n,"tiledesk_bubbleReceivedBackground")){var j=be(t);o.bubbleReceivedBackground=Ee(j,100),o.bubbleReceivedTextColor=Ke(t,!0)}if(t=pe(n,"tiledesk_bubbleReceivedTextColor")){var J=be(t);o.bubbleReceivedTextColor=Ee(J,100)}if((t=pe(n,"tiledesk_fontSize"))&&(o.fontSize=t),(t=pe(n,"tiledesk_fontFamily"))&&(o.fontFamily=t),(t=pe(n,"tiledesk_buttonFontSize"))&&(o.buttonFontSize=t),t=pe(n,"tiledesk_buttonBackgroundColor")){var ie=be(t);o.buttonBackgroundColor=Ee(ie,100),o.buttonTextColor=Ke(ie,!0),o.buttonHoverBackgroundColor=Ke(ie,!0),o.buttonHoverTextColor=Ee(ie,100)}if(t=pe(n,"tiledesk_buttonTextColor")){var ue=be(t);o.buttonTextColor=Ee(ue,100)}if(t=pe(n,"tiledesk_buttonHoverBackgroundColor")){var ge=be(t);o.buttonHoverBackgroundColor=Ee(ge,100)}if(t=pe(n,"tiledesk_buttonHoverTextColor")){var de=be(t);o.buttonHoverTextColor=Ee(de,100)}(t=pe(n,"tiledesk_singleConversation"))&&(o.singleConversation=be(t)),(t=pe(n,"tiledesk_nativeRating"))&&(o.nativeRating=be(t)),(t=pe(n,"tiledesk_typingLocation"))&&(o.typingLocation=t),(t=pe(n,"tiledesk_showInfoMessage"))&&(o.showInfoMessage=t.split(",").map(function(ve){return ve.trim()})),(t=pe(n,"tiledesk_allowReopen"))&&(o.allowReopen=be(t),o.allowReopen&&!o.showInfoMessage.includes("CHAT_CLOSED")&&o.showInfoMessage.push("CHAT_CLOSED")),(t=pe(n,"tiledesk_continueConversationBeforeTime"))&&(o.continueConversationBeforeTime=+t),(t=pe(n,"tiledesk_participants"))&&(o.participants=t.split(",").map(function(ve){return ve.trim()}))},i.prototype.setVariableFromStorage=function(o){var n,t;this.logger.debug("[GLOBAL-SET] setVariableFromStorage :::::::: SET VARIABLE ----------\x3e",Object.keys(o));try{for(var r=(0,_e.XA)(Object.keys(o)),a=r.next();!a.done;a=r.next()){var u=a.value,y=this.appStorageService.getItem(u);y&&null!==y&&(o[u]=be(y))}}catch(j){n={error:j}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(n)throw n.error}}},i.prototype.initDepartments=function(o){var n=this;if(this.globals.setParameter("departmentSelected",null),this.globals.setParameter("departmentDefault",null),this.logger.info("[GLOBAL-SET] initDepartments departments ::::",o),null!==o){if(this.globals.departments=o,1===o.length){var t=o[0];this.logger.debug("[GLOBAL-SET] initDepartments DEPARTMENT FIRST ::::",o[0]),this.globals.setParameter("departmentDefault",o[0]),t&&t.online_msg&&""!==t.online_msg&&(this.globals.online_msg=t.online_msg),t&&t.offline_msg&&""!==t.offline_msg&&(this.globals.offline_msg=t.offline_msg),this.setDepartment(o[0])}else if(o.length>1){this.logger.debug("[GLOBAL-SET] initDepartments > MORE THAN 1 DEPARTMENT ::::",o[0]);var r=0;o.forEach(function(a){if(!0===a.default)return a&&a.online_msg&&""!==a.online_msg&&(n.globals.online_msg=a.online_msg),a&&a.offline_msg&&""!==a.offline_msg&&(n.globals.offline_msg=a.offline_msg),void o.splice(r,1);r++}),this.globals.setParameter("departmentDefault",o[0]),this.setDepartment(o[0])}else this.logger.error("[GLOBAL-SET] initDepartments > DEPARTMENT DEFAULT NON RESTITUISCE RISULTATI ::::");this.setDepartmentFromExternal()}},i.prototype.setDepartmentFromExternal=function(){var o=this,n=!1;this.globals.departmentID&&(this.globals.departments.forEach(function(t){if(t._id===o.globals.departmentID)return o.logger.debug("[GLOBAL-SET] setDepartmentFromExternal > EXTERNAL DEPARTMENT ::::"+t._id),o.globals.setParameter("departmentDefault",t),o.setDepartment(t),void(n=!0)}),!1===n&&(this.globals.departmentID=null),this.logger.debug("[GLOBAL-SET] setDepartmentFromExternal > END departmentID ::::"+this.globals.departmentID+n))},i.prototype.setDepartment=function(o){this.logger.debug("[GLOBAL-SET] setDepartment: ",JSON.stringify(o)),this.globals.setParameter("departmentSelected",o);var n=JSON.parse(this.appStorageService.getItem("attributes"));n?(n.departmentId=o._id,n.departmentName=o.name):n={departmentId:o._id,departmentName:o.name},this.logger.debug("[GLOBAL-SET] setDepartment > setAttributes: ",JSON.stringify(n)),this.globals.setParameter("departmentSelected",o),this.globals.setParameter("attributes",n)},i.prototype.setAvailableAgentsStatus=function(o){if(this.globals.setParameter("availableAgentsStatus",!1),null!==o&&o.length>0){var n=[];o.forEach(function(t,r){t.imageurl=function(i){return"https://firebasestorage.googleapis.com/v0/b/"+ce.firebaseConfig.storageBucket+"/o/profiles%2F"+i+"%2Fthumb_photo.jpg?alt=media"}(t.id),n.push(t)}),this.globals.availableAgents=n,this.globals.setParameter("availableAgentsStatus",!0)}},i.prototype.getProjectParametersById=function(o){if(o){var t=this.appConfigService.getConfig().apiUrl+o+"/widgets",r=new Se.WM;return r.append("Content-Type","application/json"),this.http.get(t,{headers:r})}},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Tn=function(){function i(o,n){this.g=o,this.appStorageService=n}return i.prototype.initialize=function(){this.setGlobalsSubscription()},i.prototype.setGlobalsSubscription=function(){var o=this;this.g.obsObjChanged.subscribe(function(n){n&&o.setVariable(n.key,n.val)})},i.prototype.setVariable=function(o,n){JSON.stringify(n)},i.\u0275fac=function(n){return new(n||i)(e.LFG(Re),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Ao=ye(31225),Io=ye(47727),Yt=ye(14095),Gt=function(){function i(o,n,t,r){this._translate=o,this.http=n,this.g=t,this.appConfigService=r,this.defaultLanguage="en",this.logger=Ce.getInstance();var a=window;window.frameElement&&"parent"===window.frameElement.getAttribute("tiledesk_context")&&(a=window.parent),a.tiledesk&&(this.baseLocation=a.tiledesk.getBaseLocation())}return i.prototype.getLanguage=function(){return this.language},i.prototype.initializeTransaltorService=function(){var o=this;this._translate.setDefaultLang("it");var n=this._translate.getBrowserLang();this.logger.debug("[TRANSLATOR-SERV] initializeTransaltorService--\x3e DEVICE LANG ",n),n&&("it"===n?(this._translate.use("it"),this.http.get(this.baseLocation+"/assets/i18n/"+n+".json").subscribe(function(t){console.log("ress lang",JSON.parse(t._body)),o._translate.setTranslation("it",JSON.parse(t._body)),o._translate.get("LABEL_PREVIEW").subscribe(function(r){console.log("default translate --\x3e ",r)})})):this._translate.use("en"))},i.prototype.getTranslationFileUrl=function(o){this.remoteTranslationsUrl=ce.remoteTranslationsUrl;var n=this.appConfigService.getConfig().remoteTranslationsUrl;return n&&(this.remoteTranslationsUrl=n),ce.loadRemoteTranslations?this.remoteTranslationsUrl+this.g.projectid+"/labels/"+o.toUpperCase():this.baseLocation+"/assets/i18n/"+o+".json"},i.prototype.initI18n=function(){var o=this;this._translate.addLangs(["en","it"]),this.logger.debug("[TRANSLATOR-SERV]\xbb\xbb\xbb\xbb initI18n getLangs ",this._translate.getLangs());var n="en";this.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n setDefaultLang "),this._translate.setDefaultLang(n),this.language=n;var t=this._translate.getBrowserLang();return this.g.lang&&""!==this.g.lang?(t=this.g.lang,this.language=this.g.lang):this.g.lang=t,new Promise(function(r,a){o.http.get(o.getTranslationFileUrl(t)).pipe((0,Io.K)(function(y){return o._translate.use(n),o.http.get(o.getTranslationFileUrl(n)).subscribe(function(j){o.translateWithBrowserLang(j.data,n)},function(j){o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Get default language - ERROR ",j),o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n - \xbb\xbb\xbb loadRemoteTranslations IN ERROR ?",ce.loadRemoteTranslations)},function(){r(!0)}),(0,Ao._)(y)})).subscribe(function(y){o.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Successfully initialized '"+t+"' language from URL'",o.getTranslationFileUrl(t)),y.data&&void 0!==y.data&&""!==y.data?(o.language=y.lang.toLowerCase(),o.translateWithBrowserLang(y.data,o.language)):(t=n,o.language=n,o.g.lang=n,o._translate.use(n),o.http.get(o.getTranslationFileUrl(n)).subscribe(function(j){o.translateWithBrowserLang(j.data,t)}))},function(y){o.logger.error("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n Get '"+t+"' language - ERROR ",y)},function(){r(!0)})})},i.prototype.translateWithBrowserLang=function(o,n){this._translate.use(n),this.logger.debug("[TRANSLATOR-SERV] \xbb\xbb\xbb\xbb initI18n - \xbb\xbb\xbb loadRemoteTranslations ?",ce.loadRemoteTranslations),this._translate.setTranslation(n,o,!0)},i.prototype.translate=function(o){var n=this;this._translate.get(["LABEL_TU","LABEL_PLACEHOLDER","LABEL_START_NW_CONV","LABEL_FIRST_MSG","LABEL_FIRST_MSG_NO_AGENTS","LABEL_SELECT_TOPIC","LABEL_COMPLETE_FORM","LABEL_FIELD_NAME","LABEL_ERROR_FIELD_NAME","LABEL_FIELD_EMAIL","LABEL_ERROR_FIELD_EMAIL","LABEL_ERROR_FIELD_REQUIRED","LABEL_WRITING","LABEL_SEND_NEW_MESSAGE","AGENT_NOT_AVAILABLE","AGENT_AVAILABLE","GUEST_LABEL","ALL_AGENTS_OFFLINE_LABEL","CALLOUT_TITLE_PLACEHOLDER","CALLOUT_MSG_PLACEHOLDER","ALERT_LEAVE_CHAT","YES","NO","BUTTON_CLOSE_TO_ICON","BUTTON_EDIT_PROFILE","DOWNLOAD_TRANSCRIPT","RATE_CHAT","WELLCOME_TITLE","WELLCOME_MSG","OPTIONS","SOUND_ON","SOUND_OFF","LOGOUT","CUSTOMER_SATISFACTION","YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE","YOUR_RATING","WRITE_YOUR_OPINION","SUBMIT","THANK_YOU_FOR_YOUR_EVALUATION","YOUR_RATING_HAS_BEEN_RECEIVED","CLOSE","PREV_CONVERSATIONS","YOU","SHOW_ALL_CONV","START_A_CONVERSATION","NO_CONVERSATION","SEE_PREVIOUS","WAITING_TIME_FOUND","WAITING_TIME_NOT_FOUND","CLOSED","LABEL_PREVIEW"]).subscribe(function(r){o.LABEL_TU=r.LABEL_TU,o.LABEL_PLACEHOLDER=r.LABEL_PLACEHOLDER,o.LABEL_START_NW_CONV=r.LABEL_START_NW_CONV,o.LABEL_FIRST_MSG=r.LABEL_FIRST_MSG,o.LABEL_FIRST_MSG_NO_AGENTS=r.LABEL_FIRST_MSG_NO_AGENTS,o.LABEL_SELECT_TOPIC=r.LABEL_SELECT_TOPIC,o.LABEL_COMPLETE_FORM=r.LABEL_COMPLETE_FORM,o.LABEL_FIELD_NAME=r.LABEL_FIELD_NAME,o.LABEL_ERROR_FIELD_NAME=r.LABEL_ERROR_FIELD_NAME,o.LABEL_FIELD_EMAIL=r.LABEL_FIELD_EMAIL,o.LABEL_ERROR_FIELD_EMAIL=r.LABEL_ERROR_FIELD_EMAIL,o.LABEL_WRITING=r.LABEL_WRITING,o.LABEL_SEND_NEW_MESSAGE=r.LABEL_SEND_NEW_MESSAGE,o.AGENT_NOT_AVAILABLE=r.AGENT_NOT_AVAILABLE,o.AGENT_AVAILABLE=r.AGENT_AVAILABLE,o.GUEST_LABEL=r.GUEST_LABEL,o.ALL_AGENTS_OFFLINE_LABEL=r.ALL_AGENTS_OFFLINE_LABEL,o.CALLOUT_TITLE_PLACEHOLDER=r.CALLOUT_TITLE_PLACEHOLDER,o.CALLOUT_MSG_PLACEHOLDER=r.CALLOUT_MSG_PLACEHOLDER,o.ALERT_LEAVE_CHAT=r.ALERT_LEAVE_CHAT,o.YES=r.YES,o.NO=r.NO,o.BUTTON_CLOSE_TO_ICON=r.BUTTON_CLOSE_TO_ICON,o.BUTTON_EDIT_PROFILE=r.BUTTON_EDIT_PROFILE,o.DOWNLOAD_TRANSCRIPT=r.DOWNLOAD_TRANSCRIPT,o.RATE_CHAT=r.RATE_CHAT,o.WELLCOME_TITLE=r.WELLCOME_TITLE,o.WELLCOME_MSG=r.WELLCOME_MSG,o.OPTIONS=r.OPTIONS,o.SOUND_ON=r.SOUND_ON,o.SOUND_OFF=r.SOUND_OFF,o.LOGOUT=r.LOGOUT,o.CUSTOMER_SATISFACTION=r.CUSTOMER_SATISFACTION,o.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE=r.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE,o.YOUR_RATING=r.YOUR_RATING,o.WRITE_YOUR_OPINION=r.WRITE_YOUR_OPINION,o.SUBMIT=r.SUBMIT,o.THANK_YOU_FOR_YOUR_EVALUATION=r.THANK_YOU_FOR_YOUR_EVALUATION,o.YOUR_RATING_HAS_BEEN_RECEIVED=r.YOUR_RATING_HAS_BEEN_RECEIVED,o.CLOSE=r.CLOSE,o.PREV_CONVERSATIONS=r.PREV_CONVERSATIONS,o.YOU=r.YOU,o.SHOW_ALL_CONV=r.SHOW_ALL_CONV,o.START_A_CONVERSATION=r.START_A_CONVERSATION,o.NO_CONVERSATION=r.NO_CONVERSATION,o.SEE_PREVIOUS=r.SEE_PREVIOUS,o.WAITING_TIME_FOUND=r.WAITING_TIME_FOUND,o.WAITING_TIME_NOT_FOUND=r.WAITING_TIME_NOT_FOUND,o.CLOSED=r.CLOSED,o.LABEL_PREVIEW=r.LABEL_PREVIEW,o.LABEL_ERROR_FIELD_REQUIRED=r.LABEL_ERROR_FIELD_REQUIRED,o.welcomeTitle||(o.welcomeTitle=o.WELLCOME_TITLE),o.welcomeMsg||(o.welcomeMsg=o.WELLCOME_MSG)},function(r){n.logger.error("[TRANSLATOR-SERV]\xbb\xbb\xbb\xbb\xbb\xbb \xbb\xbb\xbb\xbb\xbb\xbb GET TRANSLATED LABELS - ERROR ",r)},function(){})},i.\u0275fac=function(n){return new(n||i)(e.LFG(Yt.sK),e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Sn=JSON.parse('{"LABEL_TU":"","LABEL_PLACEHOLDER":"type your message..","LABEL_START_NW_CONV":"New conversation","LABEL_FIRST_MSG":"Describe shortly your problem, you will be contacted by an agent.","LABEL_FIRST_MSG_NO_AGENTS":"\ud83e\udd14 All operators are offline at the moment. You can anyway describe your problem. It will be assigned to the support team who will answer you as soon as possible.","LABEL_SELECT_TOPIC":"Select a topic","LABEL_COMPLETE_FORM":"Complete the form to start a conversation with the next available agent.","LABEL_FIELD_NAME":"Name","LABEL_ERROR_FIELD_NAME":"Required field (minimum 5 characters).","LABEL_FIELD_EMAIL":"Email","LABEL_ERROR_FIELD_EMAIL":"Enter a valid email address.","LABEL_ERROR_FIELD_REQUIRED":"Required field","LABEL_WRITING":"is writing...","LABEL_SEND_NEW_MESSAGE":"Send a new message","AGENT_NOT_AVAILABLE":" Offline","AGENT_AVAILABLE":" Online","GUEST_LABEL":"Guest","ALL_AGENTS_OFFLINE_LABEL":"All operators are offline at the moment","LABEL_LOADING":"Loading...","CALLOUT_TITLE_PLACEHOLDER":"Need Help?","CALLOUT_MSG_PLACEHOLDER":"Click here and start chatting with us!","CUSTOMER_SATISFACTION":"Customer satisfaction","YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE":"your opinion on our customer service","DOWNLOAD_TRANSCRIPT":"Download transcript","BACK":"Back","CONTINUE":"Continue","YOUR_RATING":"your rating","WRITE_YOUR_OPINION":"Write your opinion ... (optional)","SUBMIT":"Submit","THANK_YOU_FOR_YOUR_EVALUATION":"Thank you for your evaluation","YOUR_RATING_HAS_BEEN_RECEIVED":"your rating has been received","ALERT_LEAVE_CHAT":"Do you want to leave the chat?","YES":"Yes","NO":"No","BUTTON_CLOSE_TO_ICON":"Minimize chat","BUTTON_EDIT_PROFILE":"Update profile","RATE_CHAT":"Rate chat","WELLCOME_TITLE":"Hi, welcome to Tiledesk \ud83d\udc4b","WELLCOME_MSG":"How can we help?","OPTIONS":"options","SOUND_OFF":"Sound off","SOUND_ON":"Sound on","LOGOUT":"Logout","CLOSE":"Close","RESTART":"Restart","PREV_CONVERSATIONS":"Your conversations","YOU":"You","SHOW_ALL_CONV":"show all","START_A_CONVERSATION":"Start a conversation","NO_CONVERSATION":"No conversation","SEE_PREVIOUS":"see previous","WAITING_TIME_FOUND":"The team typically replies in $reply_time","WAITING_TIME_NOT_FOUND":"The team will reply as soon as possible","CLOSED":"CLOSED","CLOSE_CHAT":"Close chat","MINIMIZE":"Minimize","MAXIMIZE":"Maximize","INFO_SUPPORT_USER_ADDED_SUBJECT":"you","INFO_SUPPORT_USER_ADDED_YOU_VERB":"have been added to ","INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined","INFO_SUPPORT_USER_ADDED_VERB":"the chat","INFO_SUPPORT_CHAT_REOPENED":"Chat reopened","INFO_SUPPORT_CHAT_CLOSED":"Chat closed","INFO_SUPPORT_LEAD_UPDATED":"Lead updated","INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group","INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"A new support request has been assigned to you","LABEL_PRECHAT_USER_FULLNAME":"Full name","LABEL_PRECHAT_USER_EMAIL":"Email","LABEL_PRECHAT_USER_EMAIL_ERROR":"Invalid email address","LABEL_PRECHAT_USER_PHONE":"Phone","LABEL_PRECHAT_USER_PHONE_ERROR":"Phone is required","LABEL_PRECHAT_FIRST_MESSAGE":"Your message for the support team","LABEL_PRECHAT_STATIC_TERMS_PRIVACY":"Before proceeding in the conversation please agree to our <a href=\'https://tiledesk.com/termsofservice/\' target=\'_blank\'>Terms</a> and <a href=\'https://tiledesk.com/privacy.html\' target=\'_blank\'>Privacy Policy</a>","LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY":"I agree","PRECHAT_REQUIRED_ERROR":"This field is required","LABEL_TODAY":"today","LABEL_TOMORROW":"yesterday","LABEL_LAST_ACCESS":"last access","LABEL_TO":"at","ARRAY_DAYS":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],"SENT_AN_ATTACHMENT":"sent an attachment","SENT_AN_IMAGE":"sent an image","LABEL_PREVIEW":"Preview"}'),ut=function(){function i(o){this.translateService=o}return i.prototype.translateLanguage=function(o,n){return this.initialiseTranslation(o)},i.prototype.initialiseTranslation=function(o){var n=this,t=new Map;return o.forEach(function(r){n.translateService.get(r).subscribe(function(a){r===a&&Sn[r]&&(a=Sn[r]),t.set(r,a)})}),t},i.\u0275fac=function(n){return new(n||i)(e.LFG(Yt.sK))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),mt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),vt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Tt=function(){function i(o,n){this.conversationsHandlerService=o,this.archivedConversationsService=n,this.BSStart=new he.X(null),this.logger=Ce.getInstance()}return i.prototype.initialize=function(){this.handlers=[],this.openInfoConversation=!0,this.currentUser=null,this.logger.info("[CHAT MANAGER]**** init ****",this.handlers)},i.prototype.setTiledeskToken=function(o){this.tiledeskToken=o},i.prototype.getTiledeskToken=function(){return this.tiledeskToken},i.prototype.setCurrentUser=function(o){this.currentUser=o},i.prototype.getCurrentUser=function(){return this.currentUser},i.prototype.startApp=function(){this.BSStart.next(this.currentUser)},i.prototype.getOpenInfoConversation=function(){return this.openInfoConversation},i.prototype.dispose=function(){this.logger.debug("[CHAT MANAGER] 1 - setOffAllReferences"),this.handlers&&this.setOffAllReferences(),this.logger.debug("[CHAT MANAGER] 2 - disposeConversationsHandler"),this.conversationsHandlerService&&this.disposeConversationsHandler(),this.logger.debug("[CHAT MANAGER] 3 - disposeArchivedConversationsHandler"),this.archivedConversationsService&&this.disposeArchivedConversationsHandler(),this.logger.debug("[CHAT MANAGER] 4 - disposeContactsSynchronizer"),this.logger.debug("[CHAT MANAGER] OKK "),this.conversationsHandlerService=null,this.archivedConversationsService=null},i.prototype.goOffLine=function(){this.currentUser=null,this.logger.debug("[CHAT MANAGER] 1 - CANCELLO TUTTE LE REFERENCES"),this.dispose()},i.prototype.addConversationHandler=function(o){this.logger.debug("[CHAT MANAGER] -----\x3e addConversationHandler",this.handlers,o),this.handlers.push(o)},i.prototype.removeConversationHandler=function(o){this.logger.debug("[CHAT MANAGER] -----\x3e removeConversationHandler: ",o);var n=this.handlers.findIndex(function(t){return t.conversationWith===o});this.handlers.splice(n,1)},i.prototype.getConversationHandlerByConversationId=function(o){var n=null;return this.handlers.forEach(function(t){t.conversationWith!==o||(n=t)}),n},i.prototype.setOffAllReferences=function(){this.handlers.forEach(function(o){}),this.handlers=[]},i.prototype.setConversationsHandler=function(o){this.conversationsHandlerService=o},i.prototype.setArchivedConversationsHandler=function(o){this.archivedConversationsService=o},i.prototype.disposeConversationsHandler=function(){this.logger.debug("[CHAT MANAGER] 2 - this.conversationsHandler:: ",this.conversationsHandlerService),this.conversationsHandlerService.dispose()},i.prototype.disposeArchivedConversationsHandler=function(){this.logger.debug("[CHAT MANAGER] 3 - this.archivedConversationsService:: ",this.archivedConversationsService),this.archivedConversationsService.dispose()},i.\u0275fac=function(n){return new(n||i)(e.LFG(mt),e.LFG(vt))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i}(),Jt=function(){function i(o,n){this.http=o,this.appStorage=n,this.logger=Ce.getInstance()}return i.prototype.initialize=function(o,n){this.logger.debug("[TILEDESK-REQUEST-SERV] - initialize",n),this.SERVER_BASE_URL=o,this.URL_TILEDESK_CLOSE_REQUEST=this.SERVER_BASE_URL+n+"/requests/"},i.prototype.closeSupportGroup=function(o){var n=this;this.tiledeskToken=this.appStorage.getItem("tiledeskToken"),this.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup",o);var r={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:this.tiledeskToken})},u=this.URL_TILEDESK_CLOSE_REQUEST+o+"/closeg";return new Promise(function(y,j){n.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup URLLLL",u,r),n.http.put(u,null,r).subscribe(function(J){n.logger.debug("[TILEDESK-REQUEST-SERV] - closeSupportGroup response",J),y("closed")},function(J){j(J)})})},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),Ro=function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge){this.uid=o,this.email=n,this.firstname=t,this.lastname=r,this.fullname=a,this.imageurl=u,this.avatar=y,this.color=j,this.checked=J,this.online=ie,this.lastConnection=ue,this.decoded=ge}}();function bt(i){var o=["#E17076","#7BC862","#65aadd","#a695e7","#ee7aae","#6ec9cb","#faa774"],n=0;if(i){var t=i.charCodeAt(i.length-1);n=Math.round(t%o.length)}return o[n]}function _t(i){var o="";return i&&i.split(" ").forEach(function(t){t.trim().length>1&&o.length<3&&(o+=t.substring(0,1).toUpperCase()),1==t.trim().length&&(o+=t.substring(0,1).toUpperCase())}),o}var Pn=function(){function i(o,n){this.http=o,this.appStorage=n,this.logger=Ce.getInstance()}return i.prototype.initialize=function(o){this.logger.log("[TILEDESK-AUTH-SERV] - initialize serverBaseUrl",o),this.SERVER_BASE_URL=o,this.URL_TILEDESK_SIGNIN=this.SERVER_BASE_URL+"auth/signin",this.URL_TILEDESK_SIGNIN_ANONYMOUSLY=this.SERVER_BASE_URL+"auth/signinAnonymously",this.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN=this.SERVER_BASE_URL+"auth/signinWithCustomToken"},i.prototype.signInWithEmailAndPassword=function(o,n){var t=this;this.logger.debug("[TILEDESK-AUTH]-SERV] - signInWithEmailAndPassword",o,n);var r=new Se.WM;r.append("Accept","application/json"),r.append("Content-Type","application/json");var a={headers:r},u={email:o,password:n},y=this;return new Promise(function(j,J){t.http.post(t.URL_TILEDESK_SIGNIN,u,a).subscribe(function(ie){ie.success&&ie.token&&(y.tiledeskToken=ie.token,y.createCompleteUser(ie.user),y.appStorage.setItem("tiledeskToken",y.tiledeskToken),j(y.tiledeskToken))},function(ie){J(ie)})})},i.prototype.signInAnonymously=function(o){var n=this;this.logger.debug("[TILEDESK-AUTH] - signInAnonymously - projectID",o);var t=new Se.WM;t.append("Accept","application/json"),t.append("Content-Type","application/json");var r={headers:t},a={id_project:o},u=this;return new Promise(function(y,j){n.http.post(n.URL_TILEDESK_SIGNIN_ANONYMOUSLY,a,r).subscribe(function(J){J.success&&J.token&&(u.tiledeskToken=J.token,u.createCompleteUser(J.user),u.appStorage.setItem("tiledeskToken",u.tiledeskToken),y(u.tiledeskToken))},function(J){j(J)})})},i.prototype.signInWithCustomToken=function(o){var n=this,r={headers:new Se.WM({"Content-type":"application/json",Authorization:o})},a=this;return new Promise(function(u,y){n.http.post(n.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN,null,r).subscribe(function(j){j.success&&j.token&&(a.tiledeskToken=j.token,a.createCompleteUser(j.user),n.checkAndSetInStorageTiledeskToken(a.tiledeskToken),u(n.currentUser))},function(j){y(j)})})},i.prototype.logOut=function(){this.logger.debug("[TILEDESK-AUTH] logOut()"),this.appStorage.removeItem("tiledeskToken"),this.appStorage.removeItem("currentUser"),this.setCurrentUser(null)},i.prototype.createCompleteUser=function(o){var n=new Ro(o._id);try{var t=o._id,r=o.firstname?o.firstname:"",a=o.lastname?o.lastname:"",u=o.email?o.email:"",y=(r+" "+a).trim(),j=_t(y),J=bt(y);n.uid=t,n.email=u,n.firstname=r,n.lastname=a,n.fullname=y,n.avatar=j,n.color=J,this.currentUser=n,this.logger.debug("[TILEDESK-AUTH] - createCompleteUser member ",n),this.appStorage.setItem("currentUser",JSON.stringify(this.currentUser))}catch(ie){this.logger.error("[TILEDESK-AUTH]- createCompleteUser ERR ",ie)}},i.prototype.checkAndSetInStorageTiledeskToken=function(o){this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken tiledeskToken from request",o);var n=this.appStorage.getItem("tiledeskToken");this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken storedTiledeskToken ",n),n?n&&n!==o?(this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST BUT IS != FROM TOKEN - RUN SET "),this.appStorage.setItem("tiledeskToken",o)):n&&n===o&&this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST AND IS = TO TOKEN "):(this.logger.log("[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken TOKEN DOES NOT EXIST - RUN SET "),this.appStorage.setItem("tiledeskToken",o))},i.prototype.getCurrentUser=function(){return this.currentUser},i.prototype.setCurrentUser=function(o){this.currentUser=o},i.prototype.getTiledeskToken=function(){return this.tiledeskToken},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(He))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),St=function(){function i(){this.DEFAULT_PERSISTENCE="NONE",this.DEFAULT_URL="https://api.tiledesk.com/v2/auth/"}return i.prototype.setPersistence=function(o){this.persistence=o},i.prototype.getPersistence=function(){return this.persistence?this.persistence:this.DEFAULT_PERSISTENCE},i.prototype.setBaseUrl=function(o){this.baseUrl=o},i.prototype.getBaseUrl=function(){return this.baseUrl?this.baseUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Ct=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),st=function(){function i(){this.DEFAULT_URL=ce.baseImageUrl}return i.prototype.setImageBaseUrl=function(o){this.baseImageUrl=o},i.prototype.getImageBaseUrl=function(){return this.baseImageUrl?this.baseImageUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),ht=function(){function i(){this.BSIsTyping=new he.X(null),this.BSSetTyping=new he.X(null)}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Pt=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),pt=function(){function i(){this.DEFAULT_URL=ce.apiUrl}return i.prototype.setBaseUrl=function(o){this.baseUrl=o},i.prototype.getBaseUrl=function(){return this.baseUrl?this.baseUrl:this.DEFAULT_URL},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}();function Lo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-home",10),e.NdJ("onNewConversation",function(){return e.CHM(n),e.oxw().onNewConversation()})("onConversationSelected",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)})("onOpenAllConvesations",function(){return e.CHM(n),e.oxw().onOpenAllConversation()})("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseWidget()})("onSignOut",function(){return e.CHM(n),e.oxw().onSignOut()})("onImageLoaded",function(a){return e.CHM(n),e.oxw().onImageLoaded(a)})("onConversationLoaded",function(a){return e.CHM(n),e.oxw().onConversationLoaded(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("hideSettings",t.g.hideSettings)("stylesMap",t.styleMapConversation)}}function No(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-list-all-conversations",11),e.NdJ("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseAllConversation()})("onConversationSelected",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("stylesMap",t.styleMapConversation)}}function Fo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"chat-conversation",12),e.NdJ("onBackHome",function(){return e.CHM(n),e.oxw().onBackConversation()})("onCloseWidget",function(){return e.CHM(n),e.oxw().onCloseWidget()})("onSoundChange",function(a){return e.CHM(n),e.oxw().onSoundChange(a)})("onConversationClosed",function(a){return e.CHM(n),e.oxw().onConversationClosed(a)})("onSignOut",function(){return e.CHM(n),e.oxw().onMenuOptionSignOut()})("onNewConversationButtonClicked",function(a){return e.CHM(n),e.oxw().onNewConversationButtonClicked(a)})("onBeforeMessageSent",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerBeforeSendMessageEvent(a)})("onAfterSendMessage",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerAfterSendMessageEvent(a)})("onNewMessageCreated",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerOnMessageCreated(a)})("onNewConversationInit",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerOnNewConversationInit(a)})("onBeforeMessageRender",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerBeforeMessageRender(a)})("onAfterMessageRender",function(a){return e.CHM(n),e.oxw().triggerHandler.triggerAfterMessageRender(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("senderId",t.g.senderId)("conversationId",t.g.recipientId)("isOpen",t.g.isOpen)("isConversationArchived",t.isConversationArchived)("stylesMap",t.styleMapConversation)}}function Bo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",13),e.TgZ(1,"chat-selection-department",14),e.NdJ("onBeforeDepartmentsFormRender",function(r){return e.CHM(n),e.oxw().triggerHandler.triggerOnbeforeDepartmentsFormRender(r)})("onClose",function(){return e.CHM(n),e.oxw().onCloseModalDepartment()})("onDepartmentSelected",function(r){return e.CHM(n),e.oxw().onDepartmentSelected(r)}),e.qZA(),e.qZA()}}function Uo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.TgZ(1,"chat-prechat-form",16),e.NdJ("onClosePage",function(){return e.CHM(n),e.oxw().onCloseModalPrechatForm()})("onCloseForm",function(){return e.CHM(n),e.oxw().onPrechatFormComplete()}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("stylesMap",t.styleMapConversation)}}function Zo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",17),e.TgZ(1,"chat-star-rating-widget",18),e.NdJ("onClosePage",function(){return e.CHM(n),e.oxw().onCloseModalRateChat()})("onCloseRate",function(){return e.CHM(n),e.oxw().onRateChatComplete()}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("recipientId",t.g.recipientId)("stylesMap",t.styleMapConversation)}}function Do(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-eyeeye-catcher-card",19),e.NdJ("onOpenChat",function(){return e.CHM(n),e.oxw().onOpenChatEyeEyeCatcherCard()})("onCloseEyeCatcherCard",function(r){return e.CHM(n),e.oxw().onCloseEyeCatcherCard(r)}),e.qZA()}}function Ho(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"chat-last-message",20),e.NdJ("onCloseMessagePreview",function(){return e.CHM(n),e.oxw().triggerHandler.triggerOnCloseMessagePreview()})("onSelectedConversation",function(a){return e.CHM(n),e.oxw().onSelectedConversation(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("conversation",t.lastConversation)("baseLocation",null==t.g||null==t.g.windowContext.tiledesk?null:t.g.windowContext.tiledesk.getBaseLocation())("stylesMap",t.styleMapConversation)}}function zo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-launcher-button",21),e.NdJ("onButtonClicked",function(r){return e.CHM(n),e.oxw().onOpenCloseWidget(r)}),e.qZA()}}var jo=function(i,o,n,t){return{"swing-in-bottom-fwd":i,"full-screen-mode":o,"c21-align-left":n,"c21-align-right":t}},qo=function(i,o,n,t){return{display:i,bottom:o,left:n,right:t}},Qt=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je){this.el=o,this.ngZone=n,this.g=t,this.triggerHandler=r,this.globalSettingsService=a,this.settingsSaverService=u,this.appConfigService=y,this.appStorageService=j,this.translatorService=J,this.translateService=ie,this.chatManager=ue,this.tiledeskRequestsService=ge,this.tiledeskAuthService=de,this.messagingAuthService=ve,this.conversationsHandlerService=Te,this.archivedConversationsService=ke,this.conversationHandlerBuilderService=Ae,this.imageRepoService=Be,this.typingService=Ze,this.presenceService=ze,this.uploadService=je,this.subscriptions=[],this.isTabVisible=!0,this.isOpenHome=!0,this.isOpenConversation=!1,this.isOpenAllConversation=!1,this.isOpenSelectionDepartment=!1,this.isOpenStartRating=!1,this.isConversationArchived=!1,this.isInitialized=!1,this.isSentMessage=!1,this.styleMapConversation=new Map,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.info("[APP-CONF]---------------- ngOnInit: APP.COMPONENT ---------------- "),this.initWidgetParamiters()},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.info("[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- "),this.ngZone.run(function(){var n=o,t=o.conversationsHandlerService.conversationChanged.subscribe(function(y){if(y)if(o.onImageLoaded(y),o.onConversationLoaded(y),y.recipient===o.g.senderId&&On(y))n.disposeWidget();else{if(y.sender!==o.g.senderId&&!xt(y)&&n.manageTabNotification(),!0===n.g.isOpen){if(n.g.setParameter("displayEyeCatcherCard","none"),o.logger.debug("[APP-COMP] obsChangeConversation ::: ",y),y.attributes&&"info"===y.attributes.subtype)return}else{n.lastConversation=y,n.g.isOpenNewMessage=!0,n.logger.debug("[APP-COMP] lastconversationnn",n.lastConversation);var j=n.conversationsHandlerService.countIsNew();n.g.setParameter("conversationsBadge",j)}n.triggerOnConversationUpdated(y)}else o.logger.debug("[APP-COMP] oBSconversationChanged null: errorrr")});o.subscriptions.push(t);var r=o.conversationsHandlerService.conversationAdded.subscribe(function(y){if(!0===n.g.isOpen&&y){if(n.g.setParameter("displayEyeCatcherCard","none"),n.triggerOnConversationUpdated(y),n.logger.debug("[APP-COMP] obsAddedConversation ::: ",y),y.attributes&&"info"===y.attributes.subtype)return;y.is_new&&n.manageTabNotification(),!1===o.g.isOpen&&(n.lastConversation=y,n.g.isOpenNewMessage=!0)}else{var j=n.conversationsHandlerService.countIsNew();n.g.setParameter("conversationsBadge",j)}y&&(o.onImageLoaded(y),o.onConversationLoaded(y))});o.subscriptions.push(r);var a=o.archivedConversationsService.archivedConversationAdded.subscribe(function(y){y&&(n.triggerOnConversationUpdated(y),o.onImageLoaded(y),o.onConversationLoaded(y))});o.subscriptions.push(a);var u=o.archivedConversationsService.archivedConversationRemoved.subscribe(function(y){y&&(o.isConversationArchived=!1,n.triggerOnConversationUpdated(y))});o.subscriptions.push(u)}),this.appStorageService.initialize(ce.storage_prefix,this.g.persistence,this.g.projectid),this.tiledeskAuthService.initialize(this.appConfigService.getConfig().apiUrl),this.tiledeskRequestsService.initialize(this.appConfigService.getConfig().apiUrl,this.g.projectid),this.messagingAuthService.initialize(),this.chatManager.initialize(),this.uploadService.initialize()},i.prototype.initWidgetParamiters=function(){var o=this,n=this,t=this.globalSettingsService.obsSettingsService.subscribe(function(r){r&&(o.logger.setLoggerConfig(o.g.isLogEnabled,o.g.logLevel),o.tabTitle=o.g.windowContext.window.document.title,o.appStorageService.initialize(ce.storage_prefix,o.g.persistence,o.g.projectid),o.logger.debug("[APP-COMP] check if token is passed throw url: ",o.g.jwt),o.g.jwt&&(o.logger.debug("[APP-COMP] ---------------- logging in with custom token from url ---------------- "),o.appStorageService.getItem("tiledeskToken")===o.g.jwt||o.appStorageService.setItem("tiledeskToken",o.g.jwt),o.g.tiledeskToken=o.g.jwt),o.translatorService.initI18n().then(function(u){o.logger.debug("[APP-COMP] \xbb\xbb\xbb\xbb APP-COMPONENT.TS initI18n result",u);var y=o.translatorService.getLanguage();xe.locale(y),o.translatorService.translate(o.g)}).then(function(){n.initAll(),n.triggerOnBeforeInit(),n.setAuthSubscription()}))});this.subscriptions.push(t),this.globalSettingsService.initWidgetParamiters(this.g,this.el),this.audio=new Audio,this.audio.src=this.g.baseLocation+"/assets/sounds/pling.mp3",this.audio.load()},i.prototype.initAll=function(){this.addComponentToWindow(this.ngZone),this.triggerHandler.setElement(this.el),this.triggerHandler.setWindowContext(this.g.windowContext);var o=this.setAttributesFromStorageService();o&&(this.g.attributes=o),this.setStyleMap(),this.settingsSaverService.initialize(),this.g.initialize(),this.removeFirebasewebsocketFromLocalStorage(),this.initLauncherButton(),this.triggerLoadParamsEvent()},i.prototype.setAuthSubscription=function(){var o=this;this.logger.debug("[APP-COMP] setLoginSubscription : ");var n=this,t=this.messagingAuthService.BSAuthStateChanged.subscribe(function(a){var u=o.appStorageService.getItem("tiledeskToken");u&&void 0!==u&&(n.g.tiledeskToken=u);var y=o.messagingAuthService.getToken();y&&void 0!==y&&(n.g.firebaseToken=y);var j=o.g.autoStart;if(n.stateLoggedUser=a,a&&"online"===a){var J=n.tiledeskAuthService.getCurrentUser();n.logger.info("[APP-COMP] ONLINE - LOGGED SUCCESSFULLY",J),n.g.setParameter("senderId",J.uid),n.g.setParameter("isLogged",!0),n.g.setParameter("attributes",n.setAttributesFromStorageService()),o.initConversationsHandler(o.g.tenant,n.g.senderId),n.g.singleConversation||n.startUI(),n.triggerOnAuthStateChanged(n.stateLoggedUser),n.logger.debug("[APP-COMP] 1 - IMPOSTO STATO CONNESSO UTENTE ",j),n.typingService.initialize(o.g.tenant),n.presenceService.initialize(o.g.tenant),n.presenceService.setPresence(J.uid),j&&!n.g.singleConversation&&n.showWidget()}else a&&"offline"===a&&(n.logger.info("[APP-COMP] OFFLINE - NO CURRENT USER AUTENTICATE: "),n.g.setParameter("isLogged",!1),n.hideWidget(),n.triggerOnAuthStateChanged(n.stateLoggedUser),j&&n.authenticate())});this.subscriptions.push(t);var r=this.messagingAuthService.BSSignOut.subscribe(function(a){!0===a&&(n.logger.debug("[APP-COMP] sono nel caso logout -1"),n.g.tiledeskToken=null,n.g.setParameter("isLogged",!1),n.g.setParameter("isOpenPrechatForm",!1),n.g.setParameter("userFullname",null),n.g.setParameter("userEmail",null),n.g.setAttributeParameter("userFullname",null),n.g.setAttributeParameter("userEmail",null),o.g.setAttributeParameter("preChatForm",null),o.g.setParameter("conversationsBadge",0),o.g.setParameter("recipientId",null,!1),n.hideWidget(),n.g.isLogout=!0,n.triggerOnAuthStateChanged("offline"))});this.subscriptions.push(r)},i.prototype.authenticate=function(){var o=this,n=this.g.tiledeskToken,t=this.appStorageService.getItem("currentUser");this.logger.debug("[APP-COMP] tiledesktokennn",n,t),n?(this.logger.debug("[APP-COMP] ---------------- 13 ---------------- "),this.logger.debug("[APP-COMP] ----------- sono gi\xe0 loggato ------- "),this.signInWithCustomToken(n)):(this.logger.debug("[APP-COMP] ---------------- 14 ---------------- "),this.logger.debug("[APP-COMP] authenticateFirebaseAnonymously"),this.tiledeskAuthService.signInAnonymously(this.g.projectid).then(function(r){o.messagingAuthService.createCustomToken(r);var a=o.tiledeskAuthService.getCurrentUser();if((a.firstname||a.lastname)&&!o.g.userFullname){var u=a.firstname+" "+a.lastname;o.g.setParameter("userFullname",u),o.g.setAttributeParameter("userFullname",u)}a.email&&!o.g.userEmail&&(o.g.setParameter("userEmail",a.email),o.g.setAttributeParameter("userEmail",a.email))}))},i.prototype.signInWithCustomToken=function(o){var n=this,t=this;return this.appStorageService.getItem("tiledeskToken")===o||this.appStorageService.removeItem("recipientId"),this.tiledeskAuthService.signInWithCustomToken(o).then(function(a){if(n.messagingAuthService.createCustomToken(o),n.logger.debug("[APP-COMP] signInWithCustomToken user::",a,n.g.userFullname),(a.firstname||a.lastname)&&!n.g.userFullname){var u=a.firstname+" "+a.lastname;n.g.setParameter("userFullname",u),n.g.setAttributeParameter("userFullname",u)}return a.email&&!n.g.userEmail&&(n.g.setParameter("userEmail",a.email),n.g.setAttributeParameter("userEmail",a.email)),Promise.resolve(a)}).catch(function(a){return n.logger.debug("[APP-COMP] signInWithCustomToken ERR ",a),t.signOut(),Promise.reject(a)})},i.prototype.signInAnonymous=function(){var o=this;return this.logger.debug("[APP-COMP] signInAnonymous"),this.tiledeskAuthService.signInAnonymously(this.g.projectid).then(function(n){o.messagingAuthService.createCustomToken(n);var t=o.tiledeskAuthService.getCurrentUser();if(t.firstname||t.lastname){var r=t.firstname+" "+t.lastname;o.g.setParameter("userFullname",r),o.g.setAttributeParameter("userFullname",r)}return t.email&&(o.g.setParameter("userEmail",t.email),o.g.setAttributeParameter("userEmail",t.email)),Promise.resolve(t)}).catch(function(n){return o.logger.error("[APP-COMP] signInAnonymous ERR",n),Promise.reject(n)})},i.prototype.startUI=function(){this.logger.debug("[APP-COMP] ============ startUI ===============");var o=this.g.departments,n=this.g.attributes,t=this.g.preChatForm;this.isOpenHome=!0,this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenSelectionDepartment=!1,this.isOpenAllConversation=!1;var r=this.appStorageService.getItem("recipientId");this.logger.debug("[APP-COMP] ============ idConversation ===============",r,this.g.recipientId),this.logger.debug("[APP-COMP] singleConversation conv da ...",this.g.recipientId),this.g.recipientId&&this.g.singleConversation?(this.logger.debug("[APP-COMP] singleConversation conv da API",this.g.recipientId),this.isOpenHome=!1,this.isOpenConversation=!0,this.isOpenSelectionDepartment=!1):!this.g.recipientId&&this.g.singleConversation?(this.logger.debug("[APP-COMP] singleConversation start new conv ",this.g.recipientId),this.isOpenHome=!1,this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.onNewConversation()):this.g.recipientId?(this.logger.debug("[APP-COMP] conv da urll",this.g.recipientId),this.g.isOpen&&(this.isOpenConversation=!0),this.g.setParameter("recipientId",this.g.recipientId),this.appStorageService.setItem("recipientId",this.g.recipientId)):r?(this.logger.debug("[APP-COMP] conv da storagee",r),this.g.isOpen&&(this.isOpenConversation=!0),this.g.recipientId=r,this.g.setParameter("recipientId",r)):this.g.startFromHome?(this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenSelectionDepartment=!1):!t||n&&n.userFullname&&n.userEmail?(this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,o.length>1&&null==!this.g.departmentID?this.isOpenSelectionDepartment=!0:(this.isOpenConversation=!1,!this.g.recipientId&&this.g.isOpen&&this.onNewConversation())):(this.g.setParameter("isOpenPrechatForm",!0),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,o.length>1&&null==this.g.departmentID&&(this.isOpenSelectionDepartment=!0)),this.triggerOnViewInit(),this.g.setParentBodyStyleMobile(this.g.isOpen,this.g.isMobile),this.g.setElementStyle(this.g.isOpen)},i.prototype.generateNewUidConversation=function(){return this.logger.debug("[APP-COMP] generateUidConversation **************: senderId= ",this.g.senderId),dn+this.g.projectid+"-"+(0,Ne.Z)().replace(/-/g,"")},i.prototype.startNewConversation=function(){this.logger.debug("[APP-COMP] AppComponent::startNewConversation");var o=this.generateNewUidConversation();this.g.setParameter("recipientId",o),this.appStorageService.setItem("recipientId",o),this.logger.debug("[APP-COMP] recipientId: ",this.g.recipientId),this.isConversationArchived=!1,this.triggerNewConversationEvent(o)},i.prototype.setAttributesFromStorageService=function(){var o={};try{o=JSON.parse(this.appStorageService.getItem("attributes"))}catch(J){this.logger.debug("[APP-COMP] > Error setAttributesFromStorageService:"+J)}var n=navigator.userAgent,t=this.g.projectid,r=this.g.userEmail,a=this.g.userFullname,u=this.g.senderId,y=this.g.BUILD_VERSION;!o&&null===o&&(o=this.g.attributes?this.g.attributes:{}),n&&(o.client=n),location.href&&(o.sourcePage=location.href),t&&(o.projectId=t),r&&(o.userEmail=r),a&&(o.userFullname=a),u&&(o.requester_id=u),y&&(o.widgetVer=y);try{o.payload=[],this.g.customAttributes&&(o.payload=this.g.customAttributes)}catch(J){this.logger.debug("[APP-COMP] > Error is handled payload: ",J)}try{var j=o.preChatForm;j&&j.userEmail&&(this.g.userEmail=j.userEmail),j&&j.userFullname&&(this.g.userFullname=j.userFullname)}catch(J){this.logger.debug("[APP-COMP] > Error is handled preChatForm: ",J)}return this.appStorageService.setItem("attributes",JSON.stringify(o)),o},i.prototype.initConversationsHandler=function(o,n){this.logger.debug("[APP-COMP] initialize: ListConversationsComponent");var r=this.translateService.translateLanguage(["YOU"]);this.listConversations=[],this.archivedConversations=[],this.logger.debug("[APP-COMP] senderId: ",n),this.logger.debug("[APP-COMP] tenant: ",o),this.conversationsHandlerService.initialize(o,n,r),this.archivedConversationsService.initialize(o,n,r),this.g.singleConversation&&this.g.isOpen?this.manageWidgetSingleConversation():this.g.singleConversation&&!this.g.isOpen&&this.showWidget(),this.conversationsHandlerService.subscribeToConversations(function(){}),this.archivedConversationsService.subscribeToConversations(function(){}),this.listConversations=this.conversationsHandlerService.conversations,this.archivedConversations=this.archivedConversationsService.archivedConversations,this.chatManager.setConversationsHandler(this.conversationsHandlerService),this.chatManager.setArchivedConversationsHandler(this.archivedConversationsService),this.logger.debug("[APP-COMP] this.listConversations.length",this.listConversations.length),this.logger.debug("[APP-COMP] this.listConversations appcomponent",this.listConversations,this.archivedConversations)},i.prototype.initConversationHandler=function(o){var n=this.g.tenant,r=this.translateService.translateLanguage(["INFO_SUPPORT_USER_ADDED_SUBJECT","INFO_SUPPORT_USER_ADDED_YOU_VERB","INFO_SUPPORT_USER_ADDED_COMPLEMENT","INFO_SUPPORT_USER_ADDED_VERB","INFO_SUPPORT_CHAT_REOPENED","INFO_SUPPORT_CHAT_CLOSED","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU","INFO_SUPPORT_LEAD_UPDATED","INFO_SUPPORT_MEMBER_LEFT_GROUP","LABEL_TODAY","LABEL_TOMORROW","LABEL_LOADING","LABEL_TO","ARRAY_DAYS"]),a={uid:this.g.senderId},u=this.g.recipientFullname,y=this.chatManager.getConversationHandlerByConversationId(o);if(this.logger.debug("[APP-COMP] DETTAGLIO CONV - handler **************",y,o),!y){var j=this.conversationHandlerBuilderService.build();j.initialize(o,u,a,n,r),this.logger.debug("[APP-COMP] DETTAGLIO CONV - NEW handler **************",j),this.chatManager.addConversationHandler(j),y=j}return y},i.prototype.initLauncherButton=function(){this.isInitialized=!0,this.marginBottom=+this.g.marginY+70},i.prototype.manageWidgetSingleConversation=function(){var o=this;if(this.g.recipientId)return this.appStorageService.setItem("recipientId",this.g.recipientId),void new Promise(function(n,t){o.startUI(),n("ok")}).then(function(n){o.showWidget()});this.conversationsHandlerService.getLastConversation(function(n,t){if(o.logger.debug("[APP-COMP] getConverationRESTApi: conversation from rest API --\x3e ",n),t&&o.logger.error("[APP-COMP] getConverationRESTApi: ERORR while retriving data",t),n){var r=n.uid;o.g.setParameter("recipientId",r),o.appStorageService.setItem("recipientId",r)}else o.logger.debug("[APP-COMP] getConverationRESTApi: NO active conversations");new Promise(function(a,u){o.startUI(),a("ok")}).then(function(a){o.showWidget()})})},i.prototype.signOut=function(){if(this.logger.debug("[APP-COMP] SIGNOUT"),!0===this.g.isLogged)return this.logger.debug("[APP-COMP] prima ero loggato allora mi sloggo!"),this.g.setIsOpen(!1),this.appStorageService.clear(),this.presenceService.removePresence(),this.tiledeskAuthService.logOut(),this.messagingAuthService.logout()},i.prototype.showWidget=function(){this.logger.debug("[APP-COMP] show widget--\x3e autoStart:",this.g.autoStart,"startHidden",this.g.startHidden,"isShown",this.g.isShown);var o=this.g.startHidden,n=this.g.windowContext.document.getElementById("tiledesk-container");n&&!1===o?(n.style.display="block",this.g.setParameter("isShown",!0,!0)):(this.g.startHidden=!1,this.g.setParameter("isShown",!1,!0))},i.prototype.hideWidget=function(){var o=this.g.windowContext.document.getElementById("tiledesk-container");o&&(o.style.display="none"),this.g.setParameter("isShown",!1,!0)},i.prototype.disposeWidget=function(){var o=this.g.windowContext.document.getElementById("tiledesk-container");o&&o.remove()},i.prototype.sendMessage=function(o){var t=o.senderId,r=o.senderFullname,a=o.message,u=o.type,y=o.metadata,j=o.recipientId,J=o.recipientFullname,ie=o.attributes,ge=o.channelType;this.logger.debug("[APP-COMP] sendMessage from window.tiledesk *********** ",o.tenant,t,r,a,u,y,j,J,ie,o.projectid,ge),this.initConversationHandler(j).sendMessage(a,u,y,j,J,t,r,ge,ie)},i.prototype.setPreChatForm=function(o){null!=o&&(this.g.setParameter("preChatForm",o),!0===o?this.appStorageService.setItem("preChatForm",o):this.appStorageService.removeItem("preChatForm"))},i.prototype.setPreChatFormJson=function(o){o&&this.g.setParameter("preChatFormJson",o),this.logger.debug("[APP-COMP] setPreChatFormJson from external",o)},i.prototype.getPreChatFormJson=function(){var o={};return this.g.preChatFormJson&&(o=this.g.preChatFormJson),this.logger.debug("[APP-COMP] getPreChatFormJson from external",o),o},i.prototype.setPrivacyPolicy=function(){this.g.privacyApproved=!0,this.g.setAttributeParameter("privacyApproved",this.g.privacyApproved),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes)),this.g.setParameter("preChatForm",!1),this.appStorageService.removeItem("preChatForm")},i.prototype.reInit=function(){this.tiledeskAuthService.getCurrentUser()?(this.tiledeskAuthService.logOut(),this.messagingAuthService.logout(),this.logger.debug("[APP-COMP] sono nel caso reinit -2"),this.g.setParameter("isLogged",!1),this.hideWidget(),this.appStorageService.removeItem("tiledeskToken"),this.g.isLogout=!0,!1!==this.g.autoStart&&(this.authenticate(),this.initAll()),this.appStorageService.clear()):this.logger.debug("[APP-COMP] reInit ma NON SONO LOGGATO!");var o=this.g.windowContext.document.getElementsByTagName("chat-root")[0];this.g.windowContext.document.getElementById("tiledesk-container").remove(),o.remove(),this.g.windowContext.initWidget()},i.prototype.restart=function(){this.hideWidget(),!1!==this.g.autoStart&&(this.authenticate(),this.initAll());var o=this.g.windowContext.document.getElementsByTagName("chat-root")[0];this.g.windowContext.document.getElementById("tiledesk-container").remove(),o.remove(),this.g.windowContext.initWidget()},i.prototype.logout=function(){return this.signOut()},i.prototype.showCallout=function(){!1===this.g.isOpen&&(this.eyeeyeCatcherCardComponent.openEyeCatcher(),this.g.setParameter("displayEyeCatcherCard","block"),this.triggerOnOpenEyeCatcherEvent())},i.prototype.f21_open=function(){var o=this.g.senderId;this.logger.debug("[APP-COMP] f21_open senderId: ",o),o&&(this.g.setParameter("displayEyeCatcherCard","none"),this.g.setIsOpen(!0),this.isInitialized=!0,this.appStorageService.setItem("isOpen","true"),this.triggerOnOpenEvent())},i.prototype.f21_close=function(){this.g.setIsOpen(!1),this.g.isOpenNewMessage=!1,this.appStorageService.setItem("isOpen","false"),this.triggerOnCloseEvent()},i.prototype._f21_open=function(){this.g.setParameter("displayEyeCatcherCard","none"),this.g.setIsOpen(!0),this.appStorageService.setItem("isOpen","true"),this.triggerOnOpenEvent()},i.prototype.setParameter=function(o){this.g.setParameter(o.key,o.value)},i.prototype.setAttributeParameter=function(o){this.g.setAttributeParameter(o.key,o.value)},i.prototype.removeFirebasewebsocketFromLocalStorage=function(){this.logger.debug("[APP-COMP] ---------------- A1 ---------------- "),rt()&&this.appStorageService.removeItem("firebase:previous_websocket_failure")},i.prototype.addComponentToWindow=function(o){var t=this.g.windowContext;t&&t.tiledesk&&(t.tiledesk.angularcomponent={component:this,ngZone:o},t.tiledesk.signInWithCustomToken=function(r){return o.run(function(){return t.tiledesk.angularcomponent.component.signInWithCustomToken(r)})},t.tiledesk.signInAnonymous=function(){return o.run(function(){return t.tiledesk.angularcomponent.component.signInAnonymous()})},t.tiledesk.show=function(){o.run(function(){t.tiledesk.angularcomponent.component.showWidget()})},t.tiledesk.hide=function(){o.run(function(){t.tiledesk.angularcomponent.component.hideWidget()})},t.tiledesk.dispose=function(){o.run(function(){t.tiledesk.angularcomponent.component.disposeWidget()})},t.tiledesk.close=function(){o.run(function(){t.tiledesk.angularcomponent.component.f21_close()})},t.tiledesk.open=function(){o.run(function(){t.tiledesk.angularcomponent.component.f21_open()})},t.tiledesk.setPreChatForm=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setPreChatForm(r)})},t.tiledesk.setPrivacyPolicy=function(){o.run(function(){t.tiledesk.angularcomponent.component.setPrivacyPolicy()})},t.tiledesk.sendMessage=function(r){var a,u,y,j,J=t.tiledesk.angularcomponent.component.g,ie=r.tenant?r.tenant:null,ue=r.senderId?r.senderId:null,ge=r.senderFullname?r.senderFullname:null,de=r.message?r.message:null,ve=r.type?r.type:null,Te=r.metadata?r.metadata:null,ke=r.recipientId?r.recipientId:null,Ae=r.recipientFullname?r.recipientFullname:null,Be=r.attributes?r.attributes:null,Ze=r.projectid?r.projectid:null,ze=r.channelType?r.channelType:null;ie||(ie=J.tenant),ue||(ue=J.senderId),ge||(ge=J.senderFullname),de||(de="hello"),ve||(ve="text"),Te||(Te=""),ke||(ke=J.recipientId),Ae||(Ae=J.recipientFullname),Ze||(Ze=J.projectId),(!ze||void 0===ze)&&(ze="group");var je=J.attributes,Ye={};if(je)try{for(var Ge=(0,_e.XA)(Object.entries(je)),qe=Ge.next();!qe.done;qe=Ge.next()){var ot=(0,_e.CR)(qe.value,2);Ye[ot[0]]=ot[1]}}catch(sn){a={error:sn}}finally{try{qe&&!qe.done&&(u=Ge.return)&&u.call(Ge)}finally{if(a)throw a.error}}if(Be)try{for(var et=(0,_e.XA)(Object.entries(Be)),wt=et.next();!wt.done;wt=et.next()){var oo=(0,_e.CR)(wt.value,2);Ye[oo[0]]=oo[1]}}catch(sn){y={error:sn}}finally{try{wt&&!wt.done&&(j=et.return)&&j.call(et)}finally{if(y)throw y.error}}o.run(function(){t.tiledesk.angularcomponent.component.sendMessage({tenant:ie,senderId:ue,senderFullname:ge,message:de,type:ve,metadata:Te,recipientId:ke,recipientFullname:Ae,attributes:Ye,projectid:Ze,channel_type:ze})})},t.tiledesk.sendSupportMessage=function(r){var a,u,y,j,J=t.tiledesk.angularcomponent.component.g,ie=r.message?r.message:null,ue=r.recipientId?r.recipientId:null,ge=r.recipientFullname?r.recipientFullname:null,de=r.type?r.type:null,ve=r.metadata?r.metadata:null,Te=r.attributes?r.attributes:null;ie||(ie="hello"),ue||(ue=J.recipientId),de||(de="text"),ve||(ve={});var ke=J.attributes,Ae={};if(ke)try{for(var Be=(0,_e.XA)(Object.entries(ke)),Ze=Be.next();!Ze.done;Ze=Be.next()){var ze=(0,_e.CR)(Ze.value,2);Ae[ze[0]]=ze[1]}}catch(tt){a={error:tt}}finally{try{Ze&&!Ze.done&&(u=Be.return)&&u.call(Be)}finally{if(a)throw a.error}}if(Te)try{for(var Ge=(0,_e.XA)(Object.entries(Te)),qe=Ge.next();!qe.done;qe=Ge.next()){var ot=(0,_e.CR)(qe.value,2);Ae[ot[0]]=ot[1]}}catch(tt){y={error:tt}}finally{try{qe&&!qe.done&&(j=Ge.return)&&j.call(Ge)}finally{if(y)throw y.error}}o.run(function(){t.tiledesk.angularcomponent.component.sendMessage({tenant:J.tenant,senderId:J.senderId,senderFullname:J.userFullname,message:ie,type:de,metadata:ve,recipientId:ue,recipientFullname:ge,attributes:Ae,projectid:J.projectid,channelType:J.channelType})})},t.tiledesk.reInit=function(){o.run(function(){t.tiledesk.angularcomponent.component.reInit()})},t.tiledesk.restart=function(){o.run(function(){t.tiledesk.angularcomponent.component.restart()})},t.tiledesk.logout=function(){return o.run(function(){return t.tiledesk.angularcomponent.component.logout()})},t.tiledesk.showCallout=function(){o.run(function(){t.tiledesk.angularcomponent.component.showCallout()})},t.tiledesk.setPreChatFormJson=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setPreChatFormJson(r)})},t.tiledesk.getPreChatFormJson=function(){var r={};return o.run(function(){r=t.tiledesk.angularcomponent.component.getPreChatFormJson()}),r},t.tiledesk.setParameter=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setParameter(r)})},t.tiledesk.setAttributeParameter=function(r){o.run(function(){t.tiledesk.angularcomponent.component.setAttributeParameter(r)})})},i.prototype.visibilitychange=function(){document.hidden?this.isTabVisible=!1:(clearInterval(this.setIntervalTime),this.setIntervalTime=null,this.isTabVisible=!0,this.g.windowContext.window.document.title=this.tabTitle)},i.prototype.manageTabNotification=function(){if(!this.isTabVisible){var o=this.conversationsHandlerService.countIsNew();this.logger.debug("[APP-COMP] badgeNewConverstionNumber::",o),o>0||(o=1),this.g.windowContext.window.document.title="("+o+") "+this.tabTitle,clearInterval(this.setIntervalTime);var n=this;this.setIntervalTime=window.setInterval(function(){n.g.windowContext.window.document.title="("===n.g.windowContext.window.document.title.charAt(0)?n.tabTitle:"("+o+") "+n.tabTitle},1e3)}this.soundMessage()},i.prototype.soundMessage=function(){var o=this,n=this;this.g.soundEnabled&&(this.logger.debug("[APP-COMP] ****** soundMessage *****",this.audio),this.audio.pause(),this.audio.currentTime=0,clearTimeout(this.setTimeoutSound),this.setTimeoutSound=setTimeout(function(){n.audio.play().then(function(){o.logger.debug("[APP-COMP] ****** soundMessage played *****")}).catch(function(r){o.logger.debug("[APP-COMP] ***soundMessage error*",r)})},1e3))},i.prototype.onCloseWidget=function(){this.isOpenConversation=!1;var o=this.conversationsHandlerService.countIsNew();this.g.setParameter("conversationsBadge",o),this.logger.debug("[APP-COMP] widgetclosed:::",this.g.conversationsBadge,this.conversationsHandlerService.countIsNew()),this.f21_close()},i.prototype.onOpenCloseWidget=function(o){this.g.setParameter("displayEyeCatcherCard","none");var n=this.appStorageService.getItem("recipientId");this.g.setParameter("recipientId",n),this.logger.debug("[APP-COMP] openCloseWidget",n,this.g.isOpen,this.g.startFromHome),!1===this.g.isOpen?(n?(this.isOpenHome=!1,this.isOpenConversation=!0,this.startUI()):this.g.singleConversation?(this.isOpenHome=!1,this.g.setParameter("isOpenPrechatForm",!1),this.manageWidgetSingleConversation()):this.g.startFromHome?(this.isOpenHome=!0,this.isOpenConversation=!1):(this.isOpenHome=!1,this.isOpenConversation=!0,this.onNewConversation()),this.triggerOnOpenEvent()):this.triggerOnCloseEvent(),this.g.setIsOpen(!this.g.isOpen),this.appStorageService.setItem("isOpen",this.g.isOpen)},i.prototype.onDepartmentSelected=function(o){var n=this;o&&(this.logger.debug("[APP-COMP] onSelectDepartment: ",o),this.g.setParameter("departmentSelected",o),!1===this.g.isOpenPrechatForm&&(this.isOpenSelectionDepartment=!1,this.isOpenConversation=!0,setTimeout(function(){n.isOpenHome=!1},0),this.startNewConversation()))},i.prototype.onCloseModalDepartment=function(){this.g.singleConversation?this.onCloseWidget():(this.logger.debug("[APP-COMP] returnCloseModalDepartment"),this.isOpenHome=!0,this.isOpenSelectionDepartment=!1,this.isOpenConversation=!1)},i.prototype.onPrechatFormComplete=function(){this.logger.debug("[APP-COMP] onPrechatFormComplete"),this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),!1===this.g.isOpenPrechatForm&&!1===this.isOpenSelectionDepartment&&(this.isOpenConversation=!0,this.startNewConversation())},i.prototype.onCloseModalPrechatForm=function(){this.logger.debug("[APP-COMP] onCloseModalPrechatForm"),this.g.singleConversation?this.onCloseWidget():(this.isOpenHome=!0,this.isOpenSelectionDepartment=!1,this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!1),this.g.newConversationStart=!1)},i.prototype.onSoundChange=function(o){this.g.setParameter("soundEnabled",o)},i.prototype.onMenuOptionSignOut=function(){this.logger.debug("[APP-COMP] onMenuOptionSignOut"),this.signOut(),this.isOpenConversation=!1},i.prototype.onSelectedConversation=function(o){o&&(!1===this.g.isOpen&&this._f21_open(),o.channel_type===W?(this.g.setParameter("recipientId",o.sender),this.appStorageService.setItem("recipientId",o.sender)):(this.g.setParameter("recipientId",o.recipient),this.appStorageService.setItem("recipientId",o.recipient)),this.isOpenConversation=!0,this.isConversationArchived=!!o.archived&&o.archived,this.logger.debug("[APP-COMP] onSelectConversation in APP COMPONENT: ",o))},i.prototype.onNewConversation=function(){this.logger.debug("[APP-COMP] returnNewConversation in APP COMPONENT"),this.g.newConversationStart=!0;var o=this.g.preChatForm,n=this.g.attributes,t=this.g.departments;this.logger.debug("[APP-COMP] attributesssss",this.g.attributes,this.g.preChatForm),!o||n&&n.userFullname&&n.userEmail?(this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,t&&t.length>1&&null==this.g.departmentID?this.isOpenSelectionDepartment=!0:this.isOpenConversation=!0):(this.isOpenConversation=!1,this.g.setParameter("isOpenPrechatForm",!0),this.isOpenSelectionDepartment=!1,t&&t.length>1&&null==this.g.departmentID&&(this.isOpenSelectionDepartment=!0)),this.logger.debug("[APP-COMP] isOpenPrechatForm",this.g.isOpenPrechatForm," isOpenSelectionDepartment:",this.isOpenSelectionDepartment),!1===this.g.isOpenPrechatForm&&!1===this.isOpenSelectionDepartment&&this.startNewConversation()},i.prototype.onOpenAllConversation=function(){this.isOpenHome=!0,this.isOpenConversation=!1,this.isOpenAllConversation=!0},i.prototype.onOpenChatEyeEyeCatcherCard=function(){this.f21_open()},i.prototype.onCloseEyeCatcherCard=function(o){!0===o?this.triggerOnOpenEyeCatcherEvent():this.triggerOnClosedEyeCatcherEvent()},i.prototype.onBackConversation=function(){this.logger.debug("[APP-COMP] onCloseConversation"),this.appStorageService.removeItem("recipientId"),this.g.setParameter("recipientId",null,!1),this.isOpenHome=!0,this.isOpenAllConversation=!1,this.isOpenConversation=!1},i.prototype.onConversationClosed=function(o){this.g.singleConversation||this.onBackConversation()},i.prototype.onNewConversationButtonClicked=function(o){this.logger.debug("[APP-COMP] onNewConversationButtonClicked"),this.isOpenConversation=!1,this.g.singleConversation&&(this.isOpenHome=!1),this.onNewConversation()},i.prototype.onCloseAllConversation=function(){var o=this;this.logger.debug("[APP-COMP] Close all conversation");var n=this.isOpenHome,t=this.isOpenConversation;this.isOpenHome=!1,this.isOpenConversation=!1,setTimeout(function(){o.isOpenHome=n,o.isOpenConversation=t,o.isOpenAllConversation=!1},200)},i.prototype.onAfterMessageSent=function(o){this.triggerHandler.triggerAfterSendMessageEvent(o),this.isSentMessage=!0},i.prototype.onImageLoaded=function(o){this.logger.debug("[APP-COMP] onLoadImage convvvv:::",o),o.image=this.imageRepoService.getImagePhotoUrl(o.sender)},i.prototype.onConversationLoaded=function(o){this.logger.debug("[APP-COMP] onConversationLoaded convvvv:::",o);var t=this.translateService.translateLanguage(["YOU","SENT_AN_IMAGE","SENT_AN_ATTACHMENT"]);if(o.sender===this.g.senderId){if(o.type===I){this.logger.log("[CONVS-LIST-PAGE] HAS SENT AN IMAGE");var r=o.last_message_text=t.get("SENT_AN_IMAGE");o.last_message_text=r}else if(o.type===$){this.logger.log("[CONVS-LIST-PAGE] HAS SENT FILE");var a=o.last_message_text=t.get("SENT_AN_ATTACHMENT");o.last_message_text=a}}else o.type===I?(this.logger.log("[CONVS-LIST-PAGE] HAS SENT AN IMAGE"),r=o.last_message_text=t.get("SENT_AN_IMAGE"),o.last_message_text=r):o.type===$&&(this.logger.log("[CONVS-LIST-PAGE] HAS SENT FILE"),a=o.last_message_text=t.get("SENT_AN_ATTACHMENT"),o.last_message_text=a)},i.prototype.onSignOut=function(){this.signOut()},i.prototype.onCloseModalRateChat=function(){!this.g.singleConversation&&this.g.nativeRating&&(this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.g.setParameter("isOpenStartRating",!1),this.onBackConversation())},i.prototype.onRateChatComplete=function(){!this.g.singleConversation&&this.g.nativeRating&&(this.isOpenHome=!0,this.g.setParameter("isOpenPrechatForm",!1),this.isOpenConversation=!1,this.isOpenSelectionDepartment=!1,this.g.setParameter("isOpenStartRating",!1),this.onBackConversation())},i.prototype.triggerOnBeforeInit=function(){var o={global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnBeforeInit(o)},i.prototype.triggerOnViewInit=function(){var o={global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnViewInit(o)},i.prototype.triggerOnOpenEvent=function(){this.triggerHandler.triggerOnOpenEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnCloseEvent=function(){this.triggerHandler.triggerOnCloseEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnOpenEyeCatcherEvent=function(){this.triggerHandler.triggerOnOpenEyeCatcherEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnClosedEyeCatcherEvent=function(){this.triggerHandler.triggerOnClosedEyeCatcherEvent()},i.prototype.triggerOnAuthStateChanged=function(o){var n={event:o,isLogged:this.g.isLogged,user_id:this.g.senderId,global:this.g,default_settings:this.g.default_settings,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerOnAuthStateChanged(n)},i.prototype.triggerNewConversationEvent=function(o){var n={global:this.g,default_settings:this.g.default_settings,newConvId:o,appConfigs:this.appConfigService.getConfig()};this.triggerHandler.triggerNewConversationEvent(n)},i.prototype.triggerLoadParamsEvent=function(){this.triggerHandler.triggerLoadParamsEvent({default_settings:this.g.default_settings})},i.prototype.triggerOnConversationUpdated=function(o){this.triggerHandler.triggerOnConversationUpdated(o)},i.prototype.triggerOnCloseMessagePreview=function(){this.triggerHandler.triggerOnCloseMessagePreview()},i.prototype.setStyleMap=function(){this.styleMapConversation.set("foregroundColor",this.g.themeForegroundColor),this.styleMapConversation.set("themeColor",this.g.themeColor),this.styleMapConversation.set("colorGradient",this.g.colorGradient180),this.styleMapConversation.set("bubbleSentBackground",this.g.bubbleSentBackground),this.styleMapConversation.set("bubbleSentTextColor",this.g.bubbleSentTextColor),this.styleMapConversation.set("bubbleReceivedBackground",this.g.bubbleReceivedBackground),this.styleMapConversation.set("bubbleReceivedTextColor",this.g.bubbleReceivedTextColor),this.styleMapConversation.set("fontSize",this.g.fontSize),this.styleMapConversation.set("fontFamily",this.g.fontFamily),this.styleMapConversation.set("buttonFontSize",this.g.buttonFontSize),this.styleMapConversation.set("buttonBackgroundColor",this.g.buttonBackgroundColor),this.styleMapConversation.set("buttonTextColor",this.g.buttonTextColor),this.styleMapConversation.set("buttonHoverBackgroundColor",this.g.buttonHoverBackgroundColor),this.styleMapConversation.set("buttonHoverTextColor",this.g.buttonHoverTextColor),this.styleMapConversation.set("iconColor","#5f6368"),this.el.nativeElement.style.setProperty("--button-in-msg-background-color",this.g.bubbleSentBackground),this.el.nativeElement.style.setProperty("--button-in-msg-font-size",this.g.buttonFontSize)},i.prototype.ngOnDestroy=function(){this.logger.debug("[APP-COMP] this.subscriptions",this.subscriptions);var o=this.g.windowContext;o&&o.tiledesk&&(o.tiledesk.angularcomponent=null,this.g.windowContext=o),this.unsubscribe()},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.logger.debug("[APP-COMP] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq),e.Y36(e.R0b),e.Y36(Re),e.Y36(xn),e.Y36(En),e.Y36(Tn),e.Y36(Fe),e.Y36(He),e.Y36(Gt),e.Y36(ut),e.Y36(Tt),e.Y36(Jt),e.Y36(Pn),e.Y36(St),e.Y36(mt),e.Y36(vt),e.Y36(Ct),e.Y36(st),e.Y36(ht),e.Y36(Pt),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-root"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(yn,5),2&n)&&(e.iGM(r=e.CRH())&&(t.eyeeyeCatcherCardComponent=r.first))},hostBindings:function(n,t){1&n&&e.NdJ("visibilitychange",function(){return t.visibilitychange()},!1,e.evT)},decls:11,vars:23,consts:[["id","tiledesk-container","tabindex","9999"],["id","chat21-conversations",3,"ngClass","ngStyle"],["class","modal-page active",4,"ngIf"],["class","modal-page selection-department active",4,"ngIf"],["class","modal-page prechat-form active",4,"ngIf"],["class","modal-page star-rating-widget active",4,"ngIf"],[3,"onOpenChat","onCloseEyeCatcherCard",4,"ngIf"],[4,"ngIf"],[3,"onButtonClicked",4,"ngIf"],[1,"modal-page","active"],[3,"listConversations","archivedConversations","hideSettings","stylesMap","onNewConversation","onConversationSelected","onOpenAllConvesations","onCloseWidget","onSignOut","onImageLoaded","onConversationLoaded"],[3,"listConversations","archivedConversations","stylesMap","onCloseWidget","onConversationSelected"],[3,"senderId","conversationId","isOpen","isConversationArchived","stylesMap","onBackHome","onCloseWidget","onSoundChange","onConversationClosed","onSignOut","onNewConversationButtonClicked","onBeforeMessageSent","onAfterSendMessage","onNewMessageCreated","onNewConversationInit","onBeforeMessageRender","onAfterMessageRender"],[1,"modal-page","selection-department","active"],[3,"onBeforeDepartmentsFormRender","onClose","onDepartmentSelected"],[1,"modal-page","prechat-form","active"],[3,"stylesMap","onClosePage","onCloseForm"],[1,"modal-page","star-rating-widget","active"],[3,"recipientId","stylesMap","onClosePage","onCloseRate"],[3,"onOpenChat","onCloseEyeCatcherCard"],[3,"conversation","baseLocation","stylesMap","onCloseMessagePreview","onSelectedConversation"],[3,"onButtonClicked"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Lo,2,4,"div",2),e.YNc(3,No,2,3,"div",2),e.YNc(4,Fo,2,5,"div",2),e.YNc(5,Bo,2,0,"div",3),e.YNc(6,Uo,2,1,"div",4),e.YNc(7,Zo,2,2,"div",5),e.qZA(),e.YNc(8,Do,1,0,"chat-eyeeye-catcher-card",6),e.YNc(9,Ho,2,3,"div",7),e.YNc(10,zo,1,0,"chat-launcher-button",8),e.qZA()),2&n&&(e.ekj("active",t.g.isShown),e.xp6(1),e.Q6J("ngClass",e.l5B(13,jo,!0===t.g.isOpen,!0===t.g.fullscreenMode,"left"===t.g.align,"left"!==t.g.align))("ngStyle",e.l5B(18,qo,1==t.g.isOpen?"block":"none",t.g.marginY+"px","left"===t.g.align?t.g.marginX+"px":"","right"===t.g.align?t.g.marginX+"px":"")),e.xp6(1),e.Q6J("ngIf",t.isOpenHome&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenAllConversation&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenConversation&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.isOpenSelectionDepartment),e.xp6(1),e.Q6J("ngIf",t.g.isOpenPrechatForm&&t.g.senderId),e.xp6(1),e.Q6J("ngIf",t.g.isOpenStartRating),e.xp6(1),e.Q6J("ngIf",t.g.senderId),e.xp6(1),e.Q6J("ngIf",!t.g.isOpen),e.xp6(1),e.Q6J("ngIf",t.isInitialized))},styles:['@import"https://fonts.googleapis.com/css?family=Google+Sans:200,400,800";@import"https://fonts.googleapis.com/css?family=Roboto:400,700,300|Material+Icons";@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,400;0,700;1,300;1,400";@-webkit-keyframes modal-active-in{0%{left:100%;opacity:0}to{background-color:$trasp-black;opacity:1;left:0px}}@keyframes modal-active-in{0%{left:100%;opacity:0}to{background-color:$trasp-black;opacity:1;left:0px}}@-webkit-keyframes modal-active-out{0%{left:0%;opacity:1;display:block}99%{display:block}to{opacity:0;left:100%;display:none}}@keyframes modal-active-out{0%{opacity:1;left:0px;display:block}99%{display:block}to{left:100%;opacity:0;display:none}}@-webkit-keyframes slide-out-right{0%{transform:translate(0);opacity:1}99%{transform:translate(1000px);opacity:0}to{transform:translate(1000px);opacity:0}}@keyframes slide-out-right{0%{transform:translate(0);opacity:1}99%{transform:translate(1000px);opacity:0}to{transform:translate(1000px);opacity:0}}@-webkit-keyframes rotate-scale-up{0%{transform:scale(1) rotate(0)}50%{transform:scale(1.6) rotate(180deg)}to{transform:scale(1) rotate(360deg)}}@keyframes rotate-scale-up{0%{transform:scale(1) rotate(0)}50%{transform:scale(1.6) rotate(180deg)}to{transform:scale(1) rotate(360deg)}}@-webkit-keyframes swirl-in-bck{0%{transform:rotate(540deg) scale(5);opacity:0}to{transform:rotate(0) scale(1);opacity:1}}@keyframes swirl-in-bck{0%{transform:rotate(540deg) scale(5);opacity:0}to{transform:rotate(0) scale(1);opacity:1}}@-webkit-keyframes jello-horizontal{0%{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}to{transform:scale(1)}}@keyframes jello-horizontal{0%{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}to{transform:scale(1)}}@-webkit-keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}@keyframes scale-in-center{0%{transform:scale(0);opacity:1}to{transform:scale(1);opacity:1}}@-webkit-keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@-webkit-keyframes swing-in-bottom-fwd{0%{transform:rotateX(100deg);transform-origin:bottom;opacity:0}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@keyframes swing-in-bottom-fwd{0%{transform:rotateX(100deg);transform-origin:bottom;opacity:0}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@keyframes fade{0%{transform:rotateX(0);transform-origin:bottom;opacity:0}50%{transform:rotateX(0);transform-origin:bottom;opacity:.5}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@-webkit-keyframes fade{0%{transform:rotateX(0);transform-origin:bottom;opacity:0}50%{transform:rotateX(0);transform-origin:bottom;opacity:.5}to{transform:rotateX(0);transform-origin:bottom;opacity:1}}@-webkit-keyframes heartbeat{0%{transform:scale(1);transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}10%{transform:scale(.91);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}17%{transform:scale(.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}33%{transform:scale(.87);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}45%{transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes heartbeat{0%{transform:scale(1);transform-origin:center center;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}10%{transform:scale(.91);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}17%{transform:scale(.98);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}33%{transform:scale(.87);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}45%{transform:scale(1);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@-webkit-keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes fade-in-bottom{0%{transform:translateY(50px);opacity:0}to{transform:translateY(0);opacity:1}}@-webkit-keyframes fade-in-dw-up{0%{display:none;transform:translateY(50px);opacity:0}1%{display:block;transform:translateY(50px);opacity:0}to{display:block;transform:translateY(0);opacity:1}}@keyframes fade-in-dw-up{0%{display:none;transform:translateY(50px);opacity:0}1%{display:block;transform:translateY(50px);opacity:0}to{display:block;transform:translateY(0);opacity:1}}@-webkit-keyframes slide-in-right{0%{transform:translate(1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@keyframes slide-in-right{0%{transform:translate(1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-1000px);opacity:0}99%{-webkit-transform:translateX(0);opacity:1}to{-webkit-transform:translateX(0);opacity:1}}@keyframes slide-in-left{0%{transform:translate(-1000px);opacity:0}99%{transform:translate(0);opacity:1}to{transform:translate(0);opacity:1}}@-webkit-keyframes slideIn{0%{transform:translate(-900px)}to{transform:translate(0)}}@keyframes slideIn{0%{transform:translate(-900px)}to{transform:translate(0)}}.hvr-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-grow:hover,.hvr-grow:focus,.hvr-grow:active{transform:scale(1.1)}.hvr-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-shrink:hover,.hvr-shrink:focus,.hvr-shrink:active{transform:scale(.9)}@-webkit-keyframes hvr-pulse{25%{transform:scale(1.1)}75%{transform:scale(.9)}}@keyframes hvr-pulse{25%{transform:scale(1.1)}75%{transform:scale(.9)}}.hvr-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse:hover,.hvr-pulse:focus,.hvr-pulse:active{-webkit-animation-name:hvr-pulse;animation-name:hvr-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-pulse-grow{to{transform:scale(1.1)}}@keyframes hvr-pulse-grow{to{transform:scale(1.1)}}.hvr-pulse-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse-grow:hover,.hvr-pulse-grow:focus,.hvr-pulse-grow:active{-webkit-animation-name:hvr-pulse-grow;animation-name:hvr-pulse-grow;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-pulse-shrink{to{transform:scale(.9)}}@keyframes hvr-pulse-shrink{to{transform:scale(.9)}}.hvr-pulse-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pulse-shrink:hover,.hvr-pulse-shrink:focus,.hvr-pulse-shrink:active{-webkit-animation-name:hvr-pulse-shrink;animation-name:hvr-pulse-shrink;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-push{50%{transform:scale(.8)}to{transform:scale(1)}}@keyframes hvr-push{50%{transform:scale(.8)}to{transform:scale(1)}}.hvr-push{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-push:hover,.hvr-push:focus,.hvr-push:active{-webkit-animation-name:hvr-push;animation-name:hvr-push;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-pop{50%{transform:scale(1.2)}}@keyframes hvr-pop{50%{transform:scale(1.2)}}.hvr-pop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-pop:hover,.hvr-pop:focus,.hvr-pop:active{-webkit-animation-name:hvr-pop;animation-name:hvr-pop;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-bounce-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.5s}.hvr-bounce-in:hover,.hvr-bounce-in:focus,.hvr-bounce-in:active{transform:scale(1.2);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-bounce-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.5s}.hvr-bounce-out:hover,.hvr-bounce-out:focus,.hvr-bounce-out:active{transform:scale(.8);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-rotate:hover,.hvr-rotate:focus,.hvr-rotate:active{transform:rotate(4deg)}.hvr-grow-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-grow-rotate:hover,.hvr-grow-rotate:focus,.hvr-grow-rotate:active{transform:scale(1.1) rotate(4deg)}.hvr-float{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-float:hover,.hvr-float:focus,.hvr-float:active{transform:translateY(-8px)}.hvr-sink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-sink:hover,.hvr-sink:focus,.hvr-sink:active{transform:translateY(8px)}@-webkit-keyframes hvr-bob{0%{transform:translateY(-8px)}50%{transform:translateY(-4px)}to{transform:translateY(-8px)}}@keyframes hvr-bob{0%{transform:translateY(-8px)}50%{transform:translateY(-4px)}to{transform:translateY(-8px)}}@-webkit-keyframes hvr-bob-float{to{transform:translateY(-8px)}}@keyframes hvr-bob-float{to{transform:translateY(-8px)}}.hvr-bob{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-bob:hover,.hvr-bob:focus,.hvr-bob:active{-webkit-animation-name:hvr-bob-float,hvr-bob;animation-name:hvr-bob-float,hvr-bob;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-hang{0%{transform:translateY(8px)}50%{transform:translateY(4px)}to{transform:translateY(8px)}}@keyframes hvr-hang{0%{transform:translateY(8px)}50%{transform:translateY(4px)}to{transform:translateY(8px)}}@-webkit-keyframes hvr-hang-sink{to{transform:translateY(8px)}}@keyframes hvr-hang-sink{to{transform:translateY(8px)}}.hvr-hang{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-hang:hover,.hvr-hang:focus,.hvr-hang:active{-webkit-animation-name:hvr-hang-sink,hvr-hang;animation-name:hvr-hang-sink,hvr-hang;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}.hvr-skew{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-skew:hover,.hvr-skew:focus,.hvr-skew:active{transform:skew(-10deg)}.hvr-skew-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transform-origin:0 100%}.hvr-skew-forward:hover,.hvr-skew-forward:focus,.hvr-skew-forward:active{transform:skew(-10deg)}.hvr-skew-backward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform;transform-origin:0 100%}.hvr-skew-backward:hover,.hvr-skew-backward:focus,.hvr-skew-backward:active{transform:skew(10deg)}@-webkit-keyframes hvr-wobble-vertical{16.65%{transform:translateY(8px)}33.3%{transform:translateY(-6px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}@keyframes hvr-wobble-vertical{16.65%{transform:translateY(8px)}33.3%{transform:translateY(-6px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}.hvr-wobble-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-vertical:hover,.hvr-wobble-vertical:focus,.hvr-wobble-vertical:active{-webkit-animation-name:hvr-wobble-vertical;animation-name:hvr-wobble-vertical;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-horizontal{16.65%{transform:translate(8px)}33.3%{transform:translate(-6px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}@keyframes hvr-wobble-horizontal{16.65%{transform:translate(8px)}33.3%{transform:translate(-6px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}.hvr-wobble-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-horizontal:hover,.hvr-wobble-horizontal:focus,.hvr-wobble-horizontal:active{-webkit-animation-name:hvr-wobble-horizontal;animation-name:hvr-wobble-horizontal;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-to-bottom-right{16.65%{transform:translate(8px,8px)}33.3%{transform:translate(-6px,-6px)}49.95%{transform:translate(4px,4px)}66.6%{transform:translate(-2px,-2px)}83.25%{transform:translate(1px,1px)}to{transform:translate(0)}}@keyframes hvr-wobble-to-bottom-right{16.65%{transform:translate(8px,8px)}33.3%{transform:translate(-6px,-6px)}49.95%{transform:translate(4px,4px)}66.6%{transform:translate(-2px,-2px)}83.25%{transform:translate(1px,1px)}to{transform:translate(0)}}.hvr-wobble-to-bottom-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-to-bottom-right:hover,.hvr-wobble-to-bottom-right:focus,.hvr-wobble-to-bottom-right:active{-webkit-animation-name:hvr-wobble-to-bottom-right;animation-name:hvr-wobble-to-bottom-right;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-to-top-right{16.65%{transform:translate(8px,-8px)}33.3%{transform:translate(-6px,6px)}49.95%{transform:translate(4px,-4px)}66.6%{transform:translate(-2px,2px)}83.25%{transform:translate(1px,-1px)}to{transform:translate(0)}}@keyframes hvr-wobble-to-top-right{16.65%{transform:translate(8px,-8px)}33.3%{transform:translate(-6px,6px)}49.95%{transform:translate(4px,-4px)}66.6%{transform:translate(-2px,2px)}83.25%{transform:translate(1px,-1px)}to{transform:translate(0)}}.hvr-wobble-to-top-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-to-top-right:hover,.hvr-wobble-to-top-right:focus,.hvr-wobble-to-top-right:active{-webkit-animation-name:hvr-wobble-to-top-right;animation-name:hvr-wobble-to-top-right;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-top{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-top{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transform-origin:0 100%}.hvr-wobble-top:hover,.hvr-wobble-top:focus,.hvr-wobble-top:active{-webkit-animation-name:hvr-wobble-top;animation-name:hvr-wobble-top;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-bottom{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-bottom{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transform-origin:100% 0}.hvr-wobble-bottom:hover,.hvr-wobble-bottom:focus,.hvr-wobble-bottom:active{-webkit-animation-name:hvr-wobble-bottom;animation-name:hvr-wobble-bottom;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-wobble-skew{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}@keyframes hvr-wobble-skew{16.65%{transform:skew(-12deg)}33.3%{transform:skew(10deg)}49.95%{transform:skew(-6deg)}66.6%{transform:skew(4deg)}83.25%{transform:skew(-2deg)}to{transform:skew(0)}}.hvr-wobble-skew{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-wobble-skew:hover,.hvr-wobble-skew:focus,.hvr-wobble-skew:active{-webkit-animation-name:hvr-wobble-skew;animation-name:hvr-wobble-skew;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}@keyframes hvr-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}.hvr-buzz{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-buzz:hover,.hvr-buzz:focus,.hvr-buzz:active{-webkit-animation-name:hvr-buzz;animation-name:hvr-buzz;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}@keyframes hvr-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}.hvr-buzz-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-buzz-out:hover,.hvr-buzz-out:focus,.hvr-buzz-out:active{-webkit-animation-name:hvr-buzz-out;animation-name:hvr-buzz-out;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-forward:hover,.hvr-forward:focus,.hvr-forward:active{transform:translate(8px)}.hvr-backward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:transform}.hvr-backward:hover,.hvr-backward:focus,.hvr-backward:active{transform:translate(-8px)}.hvr-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);overflow:hidden;transition-duration:.3s;transition-property:color,background-color}.hvr-fade:hover,.hvr-fade:focus,.hvr-fade:active{background-color:#2098d1;color:#fff}@-webkit-keyframes hvr-back-pulse{50%{background-color:rgba(32,152,209,.75)}}@keyframes hvr-back-pulse{50%{background-color:rgba(32,152,209,.75)}}.hvr-back-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);overflow:hidden;transition-duration:.5s;transition-property:color,background-color}.hvr-back-pulse:hover,.hvr-back-pulse:focus,.hvr-back-pulse:active{-webkit-animation-name:hvr-back-pulse;animation-name:hvr-back-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-delay:.5s;animation-delay:.5s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;background-color:#2098d1;color:#fff}.hvr-sweep-to-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:0 50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-right:hover,.hvr-sweep-to-right:focus,.hvr-sweep-to-right:active{color:#fff}.hvr-sweep-to-right:hover:before,.hvr-sweep-to-right:focus:before,.hvr-sweep-to-right:active:before{transform:scaleX(1)}.hvr-sweep-to-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:100% 50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-left:hover,.hvr-sweep-to-left:focus,.hvr-sweep-to-left:active{color:#fff}.hvr-sweep-to-left:hover:before,.hvr-sweep-to-left:focus:before,.hvr-sweep-to-left:active:before{transform:scaleX(1)}.hvr-sweep-to-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 0;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-bottom:hover,.hvr-sweep-to-bottom:focus,.hvr-sweep-to-bottom:active{color:#fff}.hvr-sweep-to-bottom:hover:before,.hvr-sweep-to-bottom:focus:before,.hvr-sweep-to-bottom:active:before{transform:scaleY(1)}.hvr-sweep-to-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.3s}.hvr-sweep-to-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 100%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-sweep-to-top:hover,.hvr-sweep-to-top:focus,.hvr-sweep-to-top:active{color:#fff}.hvr-sweep-to-top:hover:before,.hvr-sweep-to-top:focus:before,.hvr-sweep-to-top:active:before{transform:scaleY(1)}.hvr-bounce-to-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-right:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:0 50%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-right:hover,.hvr-bounce-to-right:focus,.hvr-bounce-to-right:active{color:#fff}.hvr-bounce-to-right:hover:before,.hvr-bounce-to-right:focus:before,.hvr-bounce-to-right:active:before{transform:scaleX(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-left:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleX(0);transform-origin:100% 50%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-left:hover,.hvr-bounce-to-left:focus,.hvr-bounce-to-left:active{color:#fff}.hvr-bounce-to-left:hover:before,.hvr-bounce-to-left:focus:before,.hvr-bounce-to-left:active:before{transform:scaleX(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-bottom:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 0;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-bottom:hover,.hvr-bounce-to-bottom:focus,.hvr-bounce-to-bottom:active{color:#fff}.hvr-bounce-to-bottom:hover:before,.hvr-bounce-to-bottom:focus:before,.hvr-bounce-to-bottom:active:before{transform:scaleY(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-bounce-to-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-property:color;transition-duration:.5s}.hvr-bounce-to-top:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scaleY(0);transform-origin:50% 100%;transition-property:transform;transition-duration:.5s;transition-timing-function:ease-out}.hvr-bounce-to-top:hover,.hvr-bounce-to-top:focus,.hvr-bounce-to-top:active{color:#fff}.hvr-bounce-to-top:hover:before,.hvr-bounce-to-top:focus:before,.hvr-bounce-to-top:active:before{transform:scaleY(1);transition-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-radial-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-radial-out:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;border-radius:100%;transform:scale(0);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-radial-out:hover,.hvr-radial-out:focus,.hvr-radial-out:active{color:#fff}.hvr-radial-out:hover:before,.hvr-radial-out:focus:before,.hvr-radial-out:active:before{transform:scale(2)}.hvr-radial-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-radial-in:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#e1e1e1;border-radius:100%;transform:scale(2);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-radial-in:hover,.hvr-radial-in:focus,.hvr-radial-in:active{color:#fff}.hvr-radial-in:hover:before,.hvr-radial-in:focus:before,.hvr-radial-in:active:before{transform:scale(0)}.hvr-rectangle-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-rectangle-in:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#e1e1e1;transform:scale(1);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-rectangle-in:hover,.hvr-rectangle-in:focus,.hvr-rectangle-in:active{color:#fff}.hvr-rectangle-in:hover:before,.hvr-rectangle-in:focus:before,.hvr-rectangle-in:active:before{transform:scale(0)}.hvr-rectangle-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-rectangle-out:before{content:"";position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;background:#2098D1;transform:scale(0);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-rectangle-out:hover,.hvr-rectangle-out:focus,.hvr-rectangle-out:active{color:#fff}.hvr-rectangle-out:hover:before,.hvr-rectangle-out:focus:before,.hvr-rectangle-out:active:before{transform:scale(1)}.hvr-shutter-in-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-shutter-in-horizontal:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#e1e1e1;transform:scaleX(1);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-in-horizontal:hover,.hvr-shutter-in-horizontal:focus,.hvr-shutter-in-horizontal:active{color:#fff}.hvr-shutter-in-horizontal:hover:before,.hvr-shutter-in-horizontal:focus:before,.hvr-shutter-in-horizontal:active:before{transform:scaleX(0)}.hvr-shutter-out-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-shutter-out-horizontal:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#2098D1;transform:scaleX(0);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-out-horizontal:hover,.hvr-shutter-out-horizontal:focus,.hvr-shutter-out-horizontal:active{color:#fff}.hvr-shutter-out-horizontal:hover:before,.hvr-shutter-out-horizontal:focus:before,.hvr-shutter-out-horizontal:active:before{transform:scaleX(1)}.hvr-shutter-in-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#2098D1;transition-property:color;transition-duration:.3s}.hvr-shutter-in-vertical:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#e1e1e1;transform:scaleY(1);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-in-vertical:hover,.hvr-shutter-in-vertical:focus,.hvr-shutter-in-vertical:active{color:#fff}.hvr-shutter-in-vertical:hover:before,.hvr-shutter-in-vertical:focus:before,.hvr-shutter-in-vertical:active:before{transform:scaleY(0)}.hvr-shutter-out-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;background:#e1e1e1;transition-property:color;transition-duration:.3s}.hvr-shutter-out-vertical:before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:0;right:0;background:#2098D1;transform:scaleY(0);transform-origin:50%;transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-shutter-out-vertical:hover,.hvr-shutter-out-vertical:focus,.hvr-shutter-out-vertical:active{color:#fff}.hvr-shutter-out-vertical:hover:before,.hvr-shutter-out-vertical:focus:before,.hvr-shutter-out-vertical:active:before{transform:scaleY(1)}.hvr-border-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow;box-shadow:inset 0 0 0 4px #e1e1e1,0 0 1px rgba(0,0,0,0)}.hvr-border-fade:hover,.hvr-border-fade:focus,.hvr-border-fade:active{box-shadow:inset 0 0 0 4px #2098d1,0 0 1px rgba(0,0,0,0)}.hvr-hollow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:background;box-shadow:inset 0 0 0 4px #e1e1e1,0 0 1px rgba(0,0,0,0)}.hvr-hollow:hover,.hvr-hollow:focus,.hvr-hollow:active{background:none}.hvr-trim{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-trim:before{content:"";position:absolute;border:white solid 4px;top:4px;left:4px;right:4px;bottom:4px;opacity:0;transition-duration:.3s;transition-property:opacity}.hvr-trim:hover:before,.hvr-trim:focus:before,.hvr-trim:active:before{opacity:1}@-webkit-keyframes hvr-ripple-out{to{top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0}}@keyframes hvr-ripple-out{to{top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0}}.hvr-ripple-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-ripple-out:before{content:"";position:absolute;border:#e1e1e1 solid 6px;top:0;right:0;bottom:0;left:0;-webkit-animation-duration:1s;animation-duration:1s}.hvr-ripple-out:hover:before,.hvr-ripple-out:focus:before,.hvr-ripple-out:active:before{-webkit-animation-name:hvr-ripple-out;animation-name:hvr-ripple-out}@-webkit-keyframes hvr-ripple-in{to{top:0;right:0;bottom:0;left:0;opacity:1}}@keyframes hvr-ripple-in{to{top:0;right:0;bottom:0;left:0;opacity:1}}.hvr-ripple-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-ripple-in:before{content:"";position:absolute;border:#e1e1e1 solid 4px;top:-12px;right:-12px;bottom:-12px;left:-12px;opacity:0;-webkit-animation-duration:1s;animation-duration:1s}.hvr-ripple-in:hover:before,.hvr-ripple-in:focus:before,.hvr-ripple-in:active:before{-webkit-animation-name:hvr-ripple-in;animation-name:hvr-ripple-in}.hvr-outline-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-outline-out:before{content:"";position:absolute;border:#e1e1e1 solid 4px;top:0;right:0;bottom:0;left:0;transition-duration:.3s;transition-property:top,right,bottom,left}.hvr-outline-out:hover:before,.hvr-outline-out:focus:before,.hvr-outline-out:active:before{top:-8px;right:-8px;bottom:-8px;left:-8px}.hvr-outline-in{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-outline-in:before{pointer-events:none;content:"";position:absolute;border:#e1e1e1 solid 4px;top:-16px;right:-16px;bottom:-16px;left:-16px;opacity:0;transition-duration:.3s;transition-property:top,right,bottom,left}.hvr-outline-in:hover:before,.hvr-outline-in:focus:before,.hvr-outline-in:active:before{top:-8px;right:-8px;bottom:-8px;left:-8px;opacity:1}.hvr-round-corners{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:border-radius}.hvr-round-corners:hover,.hvr-round-corners:focus,.hvr-round-corners:active{border-radius:1em}.hvr-underline-from-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-left:before{content:"";position:absolute;z-index:-1;left:0;right:100%;bottom:0;background:#2098D1;height:4px;transition-property:right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-left:hover:before,.hvr-underline-from-left:focus:before,.hvr-underline-from-left:active:before{right:0}.hvr-underline-from-center{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-center:before{content:"";position:absolute;z-index:-1;left:51%;right:51%;bottom:0;background:#2098D1;height:4px;transition-property:left,right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-center:hover:before,.hvr-underline-from-center:focus:before,.hvr-underline-from-center:active:before{left:0;right:0}.hvr-underline-from-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-from-right:before{content:"";position:absolute;z-index:-1;left:100%;right:0;bottom:0;background:#2098D1;height:4px;transition-property:left;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-from-right:hover:before,.hvr-underline-from-right:focus:before,.hvr-underline-from-right:active:before{left:0}.hvr-overline-from-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-left:before{content:"";position:absolute;z-index:-1;left:0;right:100%;top:0;background:#2098D1;height:4px;transition-property:right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-left:hover:before,.hvr-overline-from-left:focus:before,.hvr-overline-from-left:active:before{right:0}.hvr-overline-from-center{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-center:before{content:"";position:absolute;z-index:-1;left:51%;right:51%;top:0;background:#2098D1;height:4px;transition-property:left,right;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-center:hover:before,.hvr-overline-from-center:focus:before,.hvr-overline-from-center:active:before{left:0;right:0}.hvr-overline-from-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-from-right:before{content:"";position:absolute;z-index:-1;left:100%;right:0;top:0;background:#2098D1;height:4px;transition-property:left;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-from-right:hover:before,.hvr-overline-from-right:focus:before,.hvr-overline-from-right:active:before{left:0}.hvr-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;top:0;bottom:0;border-color:#2098d1;border-style:solid;border-width:0;transition-property:border-width;transition-duration:.1s;transition-timing-function:ease-out}.hvr-reveal:hover:before,.hvr-reveal:focus:before,.hvr-reveal:active:before{transform:translateY(0);border-width:4px}.hvr-underline-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-underline-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;bottom:0;background:#2098D1;height:4px;transform:translateY(4px);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-underline-reveal:hover:before,.hvr-underline-reveal:focus:before,.hvr-underline-reveal:active:before{transform:translateY(0)}.hvr-overline-reveal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;overflow:hidden}.hvr-overline-reveal:before{content:"";position:absolute;z-index:-1;left:0;right:0;top:0;background:#2098D1;height:4px;transform:translateY(-4px);transition-property:transform;transition-duration:.3s;transition-timing-function:ease-out}.hvr-overline-reveal:hover:before,.hvr-overline-reveal:focus:before,.hvr-overline-reveal:active:before{transform:translateY(0)}.hvr-glow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-glow:hover,.hvr-glow:focus,.hvr-glow:active{box-shadow:0 0 8px rgba(0,0,0,.6)}.hvr-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-shadow:hover,.hvr-shadow:focus,.hvr-shadow:active{box-shadow:0 10px 10px -10px rgba(0,0,0,.5)}.hvr-grow-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow,transform}.hvr-grow-shadow:hover,.hvr-grow-shadow:focus,.hvr-grow-shadow:active{box-shadow:0 10px 10px -10px rgba(0,0,0,.5);transform:scale(1.1)}.hvr-box-shadow-outset{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow}.hvr-box-shadow-outset:hover,.hvr-box-shadow-outset:focus,.hvr-box-shadow-outset:active{box-shadow:2px 2px 2px rgba(0,0,0,.6)}.hvr-box-shadow-inset{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s;transition-property:box-shadow;box-shadow:inset 0 0 rgba(0,0,0,.6),0 0 1px rgba(0,0,0,0)}.hvr-box-shadow-inset:hover,.hvr-box-shadow-inset:focus,.hvr-box-shadow-inset:active{box-shadow:inset 2px 2px 2px rgba(0,0,0,.6),0 0 1px rgba(0,0,0,0)}.hvr-float-shadow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-float-shadow:before{pointer-events:none;position:absolute;z-index:-1;content:"";top:100%;left:5%;height:10px;width:90%;opacity:0;background:radial-gradient(ellipse at center,rgba(0,0,0,.35) 0%,rgba(0,0,0,0) 80%);transition-duration:.3s;transition-property:transform,opacity}.hvr-float-shadow:hover,.hvr-float-shadow:focus,.hvr-float-shadow:active{transform:translateY(-5px)}.hvr-float-shadow:hover:before,.hvr-float-shadow:focus:before,.hvr-float-shadow:active:before{opacity:1;transform:translateY(5px)}.hvr-shadow-radial{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-shadow-radial:before,.hvr-shadow-radial:after{pointer-events:none;position:absolute;content:"";left:0;width:100%;box-sizing:border-box;background-repeat:no-repeat;height:5px;opacity:0;transition-duration:.3s;transition-property:opacity}.hvr-shadow-radial:before{bottom:100%;background:radial-gradient(ellipse at 50% 150%,rgba(0,0,0,.6) 0%,rgba(0,0,0,0) 80%)}.hvr-shadow-radial:after{top:100%;background:radial-gradient(ellipse at 50% -50%,rgba(0,0,0,.6) 0%,rgba(0,0,0,0) 80%)}.hvr-shadow-radial:hover:before,.hvr-shadow-radial:focus:before,.hvr-shadow-radial:active:before,.hvr-shadow-radial:hover:after,.hvr-shadow-radial:focus:after,.hvr-shadow-radial:active:after{opacity:1}.hvr-bubble-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-top:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;left:calc(50% - 10px);top:0;border-width:0 10px 10px 10px;border-color:transparent transparent #e1e1e1 transparent}.hvr-bubble-top:hover:before,.hvr-bubble-top:focus:before,.hvr-bubble-top:active:before{transform:translateY(-10px)}.hvr-bubble-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-right:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;top:calc(50% - 10px);right:0;border-width:10px 0 10px 10px;border-color:transparent transparent transparent #e1e1e1}.hvr-bubble-right:hover:before,.hvr-bubble-right:focus:before,.hvr-bubble-right:active:before{transform:translate(10px)}.hvr-bubble-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-bottom:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;left:calc(50% - 10px);bottom:0;border-width:10px 10px 0 10px;border-color:#e1e1e1 transparent transparent transparent}.hvr-bubble-bottom:hover:before,.hvr-bubble-bottom:focus:before,.hvr-bubble-bottom:active:before{transform:translateY(10px)}.hvr-bubble-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-bubble-left:before{pointer-events:none;position:absolute;z-index:-1;content:"";border-style:solid;transition-duration:.3s;transition-property:transform;top:calc(50% - 10px);left:0;border-width:10px 10px 10px 0;border-color:transparent #e1e1e1 transparent transparent}.hvr-bubble-left:hover:before,.hvr-bubble-left:focus:before,.hvr-bubble-left:active:before{transform:translate(-10px)}.hvr-bubble-float-top{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-top:before{position:absolute;z-index:-1;content:"";left:calc(50% - 10px);top:0;border-style:solid;border-width:0 10px 10px 10px;border-color:transparent transparent #e1e1e1 transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-top:hover,.hvr-bubble-float-top:focus,.hvr-bubble-float-top:active{transform:translateY(10px)}.hvr-bubble-float-top:hover:before,.hvr-bubble-float-top:focus:before,.hvr-bubble-float-top:active:before{transform:translateY(-10px)}.hvr-bubble-float-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-right:before{position:absolute;z-index:-1;top:calc(50% - 10px);right:0;content:"";border-style:solid;border-width:10px 0 10px 10px;border-color:transparent transparent transparent #e1e1e1;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-right:hover,.hvr-bubble-float-right:focus,.hvr-bubble-float-right:active{transform:translate(-10px)}.hvr-bubble-float-right:hover:before,.hvr-bubble-float-right:focus:before,.hvr-bubble-float-right:active:before{transform:translate(10px)}.hvr-bubble-float-bottom{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-bottom:before{position:absolute;z-index:-1;content:"";left:calc(50% - 10px);bottom:0;border-style:solid;border-width:10px 10px 0 10px;border-color:#e1e1e1 transparent transparent transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-bottom:hover,.hvr-bubble-float-bottom:focus,.hvr-bubble-float-bottom:active{transform:translateY(-10px)}.hvr-bubble-float-bottom:hover:before,.hvr-bubble-float-bottom:focus:before,.hvr-bubble-float-bottom:active:before{transform:translateY(10px)}.hvr-bubble-float-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-left:before{position:absolute;z-index:-1;content:"";top:calc(50% - 10px);left:0;border-style:solid;border-width:10px 10px 10px 0;border-color:transparent #e1e1e1 transparent transparent;transition-duration:.3s;transition-property:transform}.hvr-bubble-float-left:hover,.hvr-bubble-float-left:focus,.hvr-bubble-float-left:active{transform:translate(10px)}.hvr-bubble-float-left:hover:before,.hvr-bubble-float-left:focus:before,.hvr-bubble-float-left:active:before{transform:translate(-10px)}.hvr-icon-back{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.1s}.hvr-icon-back .hvr-icon{transform:translateZ(0);transition-duration:.1s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-back:hover .hvr-icon,.hvr-icon-back:focus .hvr-icon,.hvr-icon-back:active .hvr-icon{transform:translate(-4px)}.hvr-icon-forward{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.1s}.hvr-icon-forward .hvr-icon{transform:translateZ(0);transition-duration:.1s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-forward:hover .hvr-icon,.hvr-icon-forward:focus .hvr-icon,.hvr-icon-forward:active .hvr-icon{transform:translate(4px)}@-webkit-keyframes hvr-icon-down{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(6px)}}@keyframes hvr-icon-down{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(6px)}}.hvr-icon-down{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-down .hvr-icon{transform:translateZ(0)}.hvr-icon-down:hover .hvr-icon,.hvr-icon-down:focus .hvr-icon,.hvr-icon-down:active .hvr-icon{-webkit-animation-name:hvr-icon-down;animation-name:hvr-icon-down;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes hvr-icon-up{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(-6px)}}@keyframes hvr-icon-up{0%,50%,to{transform:translateY(0)}25%,75%{transform:translateY(-6px)}}.hvr-icon-up{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-up .hvr-icon{transform:translateZ(0)}.hvr-icon-up:hover .hvr-icon,.hvr-icon-up:focus .hvr-icon,.hvr-icon-up:active .hvr-icon{-webkit-animation-name:hvr-icon-up;animation-name:hvr-icon-up;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}.hvr-icon-spin{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-spin .hvr-icon{transition-duration:1s;transition-property:transform;transition-timing-function:ease-in-out}.hvr-icon-spin:hover .hvr-icon,.hvr-icon-spin:focus .hvr-icon,.hvr-icon-spin:active .hvr-icon{transform:rotate(360deg)}@-webkit-keyframes hvr-icon-drop{0%{opacity:0}50%{opacity:0;transform:translateY(-100%)}51%,to{opacity:1}}@keyframes hvr-icon-drop{0%{opacity:0}50%{opacity:0;transform:translateY(-100%)}51%,to{opacity:1}}.hvr-icon-drop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-drop .hvr-icon{transform:translateZ(0)}.hvr-icon-drop:hover .hvr-icon,.hvr-icon-drop:focus .hvr-icon,.hvr-icon-drop:active .hvr-icon{opacity:0;transition-duration:.3s;-webkit-animation-name:hvr-icon-drop;animation-name:hvr-icon-drop;-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-delay:.3s;animation-delay:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-timing-function:cubic-bezier(.52,1.64,.37,.66);animation-timing-function:cubic-bezier(.52,1.64,.37,.66)}.hvr-icon-fade{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-fade .hvr-icon{transform:translateZ(0);transition-duration:.5s;transition-property:color}.hvr-icon-fade:hover .hvr-icon,.hvr-icon-fade:focus .hvr-icon,.hvr-icon-fade:active .hvr-icon{color:#0f9e5e}@-webkit-keyframes hvr-icon-float-away{0%{opacity:1}to{opacity:0;transform:translateY(-1em)}}@keyframes hvr-icon-float-away{0%{opacity:1}to{opacity:0;transform:translateY(-1em)}}.hvr-icon-float-away{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-float-away .hvr-icon{transform:translateZ(0);-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.hvr-icon-float-away:hover .hvr-icon,.hvr-icon-float-away:focus .hvr-icon,.hvr-icon-float-away:active .hvr-icon{-webkit-animation-name:hvr-icon-float-away;animation-name:hvr-icon-float-away;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes hvr-icon-sink-away{0%{opacity:1}to{opacity:0;transform:translateY(1em)}}@keyframes hvr-icon-sink-away{0%{opacity:1}to{opacity:0;transform:translateY(1em)}}.hvr-icon-sink-away{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-sink-away .hvr-icon{transform:translateZ(0);-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.hvr-icon-sink-away:hover .hvr-icon,.hvr-icon-sink-away:focus .hvr-icon,.hvr-icon-sink-away:active .hvr-icon{-webkit-animation-name:hvr-icon-sink-away;animation-name:hvr-icon-sink-away;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}.hvr-icon-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-grow .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-grow:hover .hvr-icon,.hvr-icon-grow:focus .hvr-icon,.hvr-icon-grow:active .hvr-icon{transform:scale(1.3) translateZ(0)}.hvr-icon-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-shrink .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-shrink:hover .hvr-icon,.hvr-icon-shrink:focus .hvr-icon,.hvr-icon-shrink:active .hvr-icon{transform:scale(.8)}@-webkit-keyframes hvr-icon-pulse{25%{transform:scale(1.3)}75%{transform:scale(.8)}}@keyframes hvr-icon-pulse{25%{transform:scale(1.3)}75%{transform:scale(.8)}}.hvr-icon-pulse{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse:hover .hvr-icon,.hvr-icon-pulse:focus .hvr-icon,.hvr-icon-pulse:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse;animation-name:hvr-icon-pulse;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-icon-pulse-grow{to{transform:scale(1.3)}}@keyframes hvr-icon-pulse-grow{to{transform:scale(1.3)}}.hvr-icon-pulse-grow{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse-grow .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse-grow:hover .hvr-icon,.hvr-icon-pulse-grow:focus .hvr-icon,.hvr-icon-pulse-grow:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse-grow;animation-name:hvr-icon-pulse-grow;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-icon-pulse-shrink{to{transform:scale(.8)}}@keyframes hvr-icon-pulse-shrink{to{transform:scale(.8)}}.hvr-icon-pulse-shrink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0)}.hvr-icon-pulse-shrink .hvr-icon{transform:translateZ(0);transition-timing-function:ease-out}.hvr-icon-pulse-shrink:hover .hvr-icon,.hvr-icon-pulse-shrink:focus .hvr-icon,.hvr-icon-pulse-shrink:active .hvr-icon{-webkit-animation-name:hvr-icon-pulse-shrink;animation-name:hvr-icon-pulse-shrink;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-direction:alternate;animation-direction:alternate}@-webkit-keyframes hvr-icon-push{50%{transform:scale(.5)}}@keyframes hvr-icon-push{50%{transform:scale(.5)}}.hvr-icon-push{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-push .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-push:hover .hvr-icon,.hvr-icon-push:focus .hvr-icon,.hvr-icon-push:active .hvr-icon{-webkit-animation-name:hvr-icon-push;animation-name:hvr-icon-push;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-pop{50%{transform:scale(1.5)}}@keyframes hvr-icon-pop{50%{transform:scale(1.5)}}.hvr-icon-pop{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-pop .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-pop:hover .hvr-icon,.hvr-icon-pop:focus .hvr-icon,.hvr-icon-pop:active .hvr-icon{-webkit-animation-name:hvr-icon-pop;animation-name:hvr-icon-pop;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-icon-bounce{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-bounce .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-bounce:hover .hvr-icon,.hvr-icon-bounce:focus .hvr-icon,.hvr-icon-bounce:active .hvr-icon{transform:scale(1.5);transition-timing-function:cubic-bezier(.47,2.02,.31,-.36)}.hvr-icon-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-rotate .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-rotate:hover .hvr-icon,.hvr-icon-rotate:focus .hvr-icon,.hvr-icon-rotate:active .hvr-icon{transform:rotate(20deg)}.hvr-icon-grow-rotate{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-grow-rotate .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-grow-rotate:hover .hvr-icon,.hvr-icon-grow-rotate:focus .hvr-icon,.hvr-icon-grow-rotate:active .hvr-icon{transform:scale(1.5) rotate(12deg)}.hvr-icon-float{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-float .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-float:hover .hvr-icon,.hvr-icon-float:focus .hvr-icon,.hvr-icon-float:active .hvr-icon{transform:translateY(-4px)}.hvr-icon-sink{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-sink .hvr-icon{transform:translateZ(0);transition-duration:.3s;transition-property:transform;transition-timing-function:ease-out}.hvr-icon-sink:hover .hvr-icon,.hvr-icon-sink:focus .hvr-icon,.hvr-icon-sink:active .hvr-icon{transform:translateY(4px)}@-webkit-keyframes hvr-icon-bob{0%{transform:translateY(-6px)}50%{transform:translateY(-2px)}to{transform:translateY(-6px)}}@keyframes hvr-icon-bob{0%{transform:translateY(-6px)}50%{transform:translateY(-2px)}to{transform:translateY(-6px)}}@-webkit-keyframes hvr-icon-bob-float{to{transform:translateY(-6px)}}@keyframes hvr-icon-bob-float{to{transform:translateY(-6px)}}.hvr-icon-bob{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-bob .hvr-icon{transform:translateZ(0)}.hvr-icon-bob:hover .hvr-icon,.hvr-icon-bob:focus .hvr-icon,.hvr-icon-bob:active .hvr-icon{-webkit-animation-name:hvr-icon-bob-float,hvr-icon-bob;animation-name:hvr-icon-bob-float,hvr-icon-bob;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-icon-hang{0%{transform:translateY(6px)}50%{transform:translateY(2px)}to{transform:translateY(6px)}}@keyframes hvr-icon-hang{0%{transform:translateY(6px)}50%{transform:translateY(2px)}to{transform:translateY(6px)}}@-webkit-keyframes hvr-icon-hang-sink{to{transform:translateY(6px)}}@keyframes hvr-icon-hang-sink{to{transform:translateY(6px)}}.hvr-icon-hang{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-hang .hvr-icon{transform:translateZ(0)}.hvr-icon-hang:hover .hvr-icon,.hvr-icon-hang:focus .hvr-icon,.hvr-icon-hang:active .hvr-icon{-webkit-animation-name:hvr-icon-hang-sink,hvr-icon-hang;animation-name:hvr-icon-hang-sink,hvr-icon-hang;-webkit-animation-duration:.3s,1.5s;animation-duration:.3s,1.5s;-webkit-animation-delay:0s,.3s;animation-delay:0s,.3s;-webkit-animation-timing-function:ease-out,ease-in-out;animation-timing-function:ease-out,ease-in-out;-webkit-animation-iteration-count:1,infinite;animation-iteration-count:1,infinite;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-direction:normal,alternate;animation-direction:normal,alternate}@-webkit-keyframes hvr-icon-wobble-horizontal{16.65%{transform:translate(6px)}33.3%{transform:translate(-5px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}@keyframes hvr-icon-wobble-horizontal{16.65%{transform:translate(6px)}33.3%{transform:translate(-5px)}49.95%{transform:translate(4px)}66.6%{transform:translate(-2px)}83.25%{transform:translate(1px)}to{transform:translate(0)}}.hvr-icon-wobble-horizontal{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-wobble-horizontal .hvr-icon{transform:translateZ(0)}.hvr-icon-wobble-horizontal:hover .hvr-icon,.hvr-icon-wobble-horizontal:focus .hvr-icon,.hvr-icon-wobble-horizontal:active .hvr-icon{-webkit-animation-name:hvr-icon-wobble-horizontal;animation-name:hvr-icon-wobble-horizontal;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-wobble-vertical{16.65%{transform:translateY(6px)}33.3%{transform:translateY(-5px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}@keyframes hvr-icon-wobble-vertical{16.65%{transform:translateY(6px)}33.3%{transform:translateY(-5px)}49.95%{transform:translateY(4px)}66.6%{transform:translateY(-2px)}83.25%{transform:translateY(1px)}to{transform:translateY(0)}}.hvr-icon-wobble-vertical{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-wobble-vertical .hvr-icon{transform:translateZ(0)}.hvr-icon-wobble-vertical:hover .hvr-icon,.hvr-icon-wobble-vertical:focus .hvr-icon,.hvr-icon-wobble-vertical:active .hvr-icon{-webkit-animation-name:hvr-icon-wobble-vertical;animation-name:hvr-icon-wobble-vertical;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-iteration-count:1;animation-iteration-count:1}@-webkit-keyframes hvr-icon-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}@keyframes hvr-icon-buzz{50%{transform:translate(3px) rotate(2deg)}to{transform:translate(-3px) rotate(-2deg)}}.hvr-icon-buzz{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-buzz .hvr-icon{transform:translateZ(0)}.hvr-icon-buzz:hover .hvr-icon,.hvr-icon-buzz:focus .hvr-icon,.hvr-icon-buzz:active .hvr-icon{-webkit-animation-name:hvr-icon-buzz;animation-name:hvr-icon-buzz;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}@-webkit-keyframes hvr-icon-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}@keyframes hvr-icon-buzz-out{10%{transform:translate(3px) rotate(2deg)}20%{transform:translate(-3px) rotate(-2deg)}30%{transform:translate(3px) rotate(2deg)}40%{transform:translate(-3px) rotate(-2deg)}50%{transform:translate(2px) rotate(1deg)}60%{transform:translate(-2px) rotate(-1deg)}70%{transform:translate(2px) rotate(1deg)}80%{transform:translate(-2px) rotate(-1deg)}90%{transform:translate(1px) rotate(0)}to{transform:translate(-1px) rotate(0)}}.hvr-icon-buzz-out{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);transition-duration:.3s}.hvr-icon-buzz-out .hvr-icon{transform:translateZ(0)}.hvr-icon-buzz-out:hover .hvr-icon,.hvr-icon-buzz-out:focus .hvr-icon,.hvr-icon-buzz-out:active .hvr-icon{-webkit-animation-name:hvr-icon-buzz-out;animation-name:hvr-icon-buzz-out;-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:1;animation-iteration-count:1}.hvr-curl-top-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-top-left:before{pointer-events:none;position:absolute;content:"";height:0;width:0;top:0;left:0;background:white;background:linear-gradient(135deg,white 45%,#aaa 50%,#ccc 56%,white 80%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr="#ffffff",endColorstr="#000000");z-index:1000;box-shadow:1px 1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-top-left:hover:before,.hvr-curl-top-left:focus:before,.hvr-curl-top-left:active:before{width:25px;height:25px}.hvr-curl-top-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-top-right:before{pointer-events:none;position:absolute;content:"";height:0;width:0;top:0;right:0;background:white;background:linear-gradient(225deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:-1px 1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-top-right:hover:before,.hvr-curl-top-right:focus:before,.hvr-curl-top-right:active:before{width:25px;height:25px}.hvr-curl-bottom-right{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-bottom-right:before{pointer-events:none;position:absolute;content:"";height:0;width:0;bottom:0;right:0;background:white;background:linear-gradient(315deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:-1px -1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-bottom-right:hover:before,.hvr-curl-bottom-right:focus:before,.hvr-curl-bottom-right:active:before{width:25px;height:25px}.hvr-curl-bottom-left{display:inline-block;vertical-align:middle;transform:perspective(1px) translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);position:relative}.hvr-curl-bottom-left:before{pointer-events:none;position:absolute;content:"";height:0;width:0;bottom:0;left:0;background:white;background:linear-gradient(45deg,white 45%,#aaa 50%,#ccc 56%,white 80%);box-shadow:1px -1px 1px rgba(0,0,0,.4);transition-duration:.3s;transition-property:width,height}.hvr-curl-bottom-left:hover:before,.hvr-curl-bottom-left:focus:before,.hvr-curl-bottom-left:active:before{width:25px;height:25px}#tiledesk-container html{line-height:1.15;-webkit-text-size-adjust:100%}#tiledesk-container body{margin:0}#tiledesk-container main{display:block}#tiledesk-container h1{font-size:2em;margin:.67em 0}#tiledesk-container hr{box-sizing:content-box;height:0;overflow:visible}#tiledesk-container pre{font-family:monospace,monospace;font-size:1em}#tiledesk-container a{background-color:transparent}#tiledesk-container abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#tiledesk-container b,#tiledesk-container strong{font-weight:bolder}#tiledesk-container code,#tiledesk-container kbd,#tiledesk-container samp{font-family:monospace,monospace;font-size:1em}#tiledesk-container small{font-size:80%}#tiledesk-container sub,#tiledesk-container sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#tiledesk-container sub{bottom:-.25em}#tiledesk-container sup{top:-.5em}#tiledesk-container img{border-style:none;max-width:100%}#tiledesk-container button,#tiledesk-container input,#tiledesk-container optgroup,#tiledesk-container select,#tiledesk-container textarea{font-family:inherit;font-size:100%;line-height:1.15}#tiledesk-container button,#tiledesk-container input{overflow:visible}#tiledesk-container button,#tiledesk-container select{text-transform:none}#tiledesk-container button,#tiledesk-container [type=button],#tiledesk-container [type=reset],#tiledesk-container [type=submit]{-webkit-appearance:button}#tiledesk-container button::-moz-focus-inner,#tiledesk-container [type=button]::-moz-focus-inner,#tiledesk-container [type=reset]::-moz-focus-inner,#tiledesk-container [type=submit]::-moz-focus-inner{border-style:none;padding:0}#tiledesk-container button:-moz-focusring,#tiledesk-container [type=button]:-moz-focusring,#tiledesk-container [type=reset]:-moz-focusring,#tiledesk-container [type=submit]:-moz-focusring{outline:1px dotted ButtonText}#tiledesk-container fieldset{padding:.35em .75em .625em}#tiledesk-container legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}#tiledesk-container progress{vertical-align:baseline}#tiledesk-container textarea{overflow:auto}#tiledesk-container [type=checkbox],#tiledesk-container [type=radio]{box-sizing:border-box;padding:0}#tiledesk-container [type=number]::-webkit-inner-spin-button,#tiledesk-container [type=number]::-webkit-outer-spin-button{height:auto}#tiledesk-container [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#tiledesk-container [type=search]::-webkit-search-decoration{-webkit-appearance:none}#tiledesk-container ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#tiledesk-container details{display:block}#tiledesk-container summary{display:list-item}#tiledesk-container template{display:none}#tiledesk-container [hidden]{display:none}.emoji-mart,.emoji-mart *{box-sizing:border-box;line-height:1.15}.emoji-mart{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif;font-size:16px;display:inline-block;color:#222427;border:1px solid #d9d9d9;border-radius:5px;background:#fff}.emoji-mart .emoji-mart-emoji{padding:6px}.emoji-mart-bar{border:0 solid #d9d9d9}.emoji-mart-bar:first-child{border-bottom-width:1px;border-top-left-radius:5px;border-top-right-radius:5px}.emoji-mart-bar:last-child{border-top-width:1px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.emoji-mart-anchors{display:flex;flex-direction:row;justify-content:space-between;padding:0 6px;line-height:0}.emoji-mart-anchor{position:relative;display:block;flex:1 1 auto;color:#858585;text-align:center;padding:12px 4px;overflow:hidden;transition:color .1s ease-out;margin:0;box-shadow:none;background:none;border:none}.emoji-mart-anchor:focus{outline:0}.emoji-mart-anchor:hover,.emoji-mart-anchor:focus,.emoji-mart-anchor-selected{color:#464646}.emoji-mart-anchor-selected .emoji-mart-anchor-bar{bottom:0}.emoji-mart-anchor-bar{position:absolute;bottom:-3px;left:0;width:100%;height:3px;background-color:#464646}.emoji-mart-anchors i{display:inline-block;width:100%;max-width:22px}.emoji-mart-anchors svg,.emoji-mart-anchors img{fill:currentColor;height:18px;width:18px}.emoji-mart-scroll{overflow-y:scroll;height:270px;padding:0 6px 6px;will-change:transform}.emoji-mart-search{margin-top:6px;padding:0 6px;position:relative}.emoji-mart-search input{font-size:16px;display:block;width:100%;padding:5px 25px 6px 10px;border-radius:5px;border:1px solid #d9d9d9;outline:0}.emoji-mart-search input,.emoji-mart-search input::-webkit-search-decoration,.emoji-mart-search input::-webkit-search-cancel-button,.emoji-mart-search input::-webkit-search-results-button,.emoji-mart-search input::-webkit-search-results-decoration{-webkit-appearance:none}.emoji-mart-search-icon{position:absolute;top:3px;right:11px;z-index:2;padding:2px 5px 1px;border:none;background:none}.emoji-mart-category .emoji-mart-emoji span{z-index:1;position:relative;text-align:center;cursor:default}.emoji-mart-category .emoji-mart-emoji:hover:before{z-index:0;content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#f4f4f4;border-radius:100%}.emoji-mart-category-label{z-index:2;position:relative;position:-webkit-sticky;position:sticky;top:0}.emoji-mart-category-label span{display:block;width:100%;font-weight:500;padding:5px 6px;background-color:#fff;background-color:rgba(255,255,255,.95)}.emoji-mart-category-list{margin:0;padding:0}.emoji-mart-category-list li{list-style:none;margin:0;padding:0;display:inline-block}.emoji-mart-emoji{position:relative;display:inline-block;font-size:0;margin:0;padding:0;border:none;background:none;box-shadow:none}.emoji-mart-emoji-native{font-family:"Segoe UI Emoji","Segoe UI Symbol","Segoe UI","Apple Color Emoji","Twemoji Mozilla","Noto Color Emoji","Android Emoji"}.emoji-mart-no-results{font-size:14px;text-align:center;padding-top:70px;color:#858585}.emoji-mart-no-results .emoji-mart-category-label{display:none}.emoji-mart-no-results .emoji-mart-no-results-label{margin-top:.2em}.emoji-mart-no-results .emoji-mart-emoji:hover:before{content:none}.emoji-mart-preview{position:relative;height:70px}.emoji-mart-preview-emoji,.emoji-mart-preview-data,.emoji-mart-preview-skins{position:absolute;top:50%;transform:translateY(-50%)}.emoji-mart-preview-emoji{left:12px}.emoji-mart-preview-data{left:68px;right:12px;word-break:break-all}.emoji-mart-preview-skins{right:30px;text-align:right}.emoji-mart-preview-skins.custom{right:10px;text-align:right}.emoji-mart-preview-name{font-size:14px}.emoji-mart-preview-shortname{font-size:12px;color:#888}.emoji-mart-preview-shortname+.emoji-mart-preview-shortname,.emoji-mart-preview-shortname+.emoji-mart-preview-emoticon,.emoji-mart-preview-emoticon+.emoji-mart-preview-emoticon{margin-left:.5em}.emoji-mart-preview-emoticon{font-size:11px;color:#bbb}.emoji-mart-title span{display:inline-block;vertical-align:middle}.emoji-mart-title .emoji-mart-emoji{padding:0}.emoji-mart-title-label{color:#999a9c;font-size:26px;font-weight:300}.emoji-mart-skin-swatches{font-size:0;padding:2px 0;border:1px solid #d9d9d9;border-radius:12px;background-color:#fff}.emoji-mart-skin-swatches.custom{font-size:0;border:none;background-color:#fff}.emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch{width:16px;padding:0 2px}.emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch.selected:after{opacity:.75}.emoji-mart-skin-swatch{display:inline-block;width:0;vertical-align:middle;transition-property:width,padding;transition-duration:.125s;transition-timing-function:ease-out}.emoji-mart-skin-swatch:nth-child(1){transition-delay:0s}.emoji-mart-skin-swatch:nth-child(2){transition-delay:.03s}.emoji-mart-skin-swatch:nth-child(3){transition-delay:.06s}.emoji-mart-skin-swatch:nth-child(4){transition-delay:.09s}.emoji-mart-skin-swatch:nth-child(5){transition-delay:.12s}.emoji-mart-skin-swatch:nth-child(6){transition-delay:.15s}.emoji-mart-skin-swatch.selected{position:relative;width:16px;padding:0 2px}.emoji-mart-skin-swatch.selected:after{content:"";position:absolute;top:50%;left:50%;width:4px;height:4px;margin:-2px 0 0 -2px;background-color:#fff;border-radius:100%;pointer-events:none;opacity:0;transition:opacity .2s ease-out}.emoji-mart-skin-swatch.custom{display:inline-block;width:0;height:38px;overflow:hidden;vertical-align:middle;transition-property:width,height;transition-duration:.125s;transition-timing-function:ease-out;cursor:default}.emoji-mart-skin-swatch.custom.selected{position:relative;width:36px;height:38px;padding:0 2px 0 0}.emoji-mart-skin-swatch.custom.selected:after{content:"";width:0;height:0}.emoji-mart-skin-swatches.custom .emoji-mart-skin-swatch.custom:hover{background-color:#f4f4f4;border-radius:10%}.emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom{width:36px;height:38px;padding:0 2px 0 0}.emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom.selected:after{opacity:.75}.emoji-mart-skin-text.opened{display:inline-block;vertical-align:middle;text-align:left;color:#888;font-size:11px;padding:5px 2px;width:95px;height:40px;border-radius:10%;background-color:#fff}.emoji-mart-skin{display:inline-block;width:100%;padding-top:100%;max-width:12px;border-radius:100%}.emoji-mart-skin-tone-1{background-color:#ffc93a}.emoji-mart-skin-tone-2{background-color:#fadcbc}.emoji-mart-skin-tone-3{background-color:#e0bb95}.emoji-mart-skin-tone-4{background-color:#bf8f68}.emoji-mart-skin-tone-5{background-color:#9b643d}.emoji-mart-skin-tone-6{background-color:#594539}.emoji-mart-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.emoji-mart-dark{color:#fff;border-color:#555453;background-color:#222}.emoji-mart-dark .emoji-mart-bar{border-color:#555453}.emoji-mart-dark .emoji-mart-search input{color:#fff;border-color:#555453;background-color:#2f2f2f}.emoji-mart-dark .emoji-mart-search-icon svg{fill:#fff}.emoji-mart-dark .emoji-mart-category .emoji-mart-emoji:hover:before{background-color:#444}.emoji-mart-dark .emoji-mart-category-label span{background-color:#222;color:#fff}.emoji-mart-dark .emoji-mart-skin-swatches{border-color:#555453;background-color:#222}.emoji-mart-dark .emoji-mart-anchor:hover,.emoji-mart-dark .emoji-mart-anchor:focus,.emoji-mart-dark .emoji-mart-anchor-selected{color:#bfbfbf}input,select:focus,textarea{font-size:16px!important}:root{--button-in-msg-background-color: #2a6ac1;--button-in-msg-font-size: 15px}.chat-tooltip{font-family:"Roboto","Google Sans",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300}body{margin:0}:focus{outline:none!important}::-moz-focus-inner{border:0}.slide-in-right{-webkit-animation:slide-in-right .5s cubic-bezier(.895,.03,.685,.22) 0s both;animation:slide-in-right .5s cubic-bezier(.895,.03,.685,.22) 0s both}.slide-in-left{-webkit-animation:slideIn .5s cubic-bezier(.895,.03,.685,.22) 0s;animation:slideIn .5s cubic-bezier(.895,.03,.685,.22) 0s}.scale-in-center{display:block;opacity:1;-webkit-animation:scale-in-center .5s both;animation:scale-in-center .5s both}.jello-horizontal{-webkit-animation:jello-horizontal .9s 3s both;animation:jello-horizontal .9s 3s both}.swirl-in-bck{-webkit-animation:swirl-in-bck .65s ease-in .5s both;animation:swirl-in-bck .65s ease-in .5s both}.rotate-scale-up{-webkit-animation:rotate-scale-up .65s linear both;animation:rotate-scale-up .65s linear both}.rotate-center:hover{-webkit-animation:rotate-center .6s ease-in-out both;animation:rotate-center .6s ease-in-out both}.swing-in-bottom-fwd{-webkit-animation:fade .5s both;animation:fade .5s both}.heartbeat:hover{-webkit-animation:heartbeat 1.5s ease-in-out infinite both;animation:heartbeat 1.5s ease-in-out infinite both}.avatar-project{position:relative;padding:0;margin:0;height:70px;width:80px;line-height:52px}.avatar-project .avatar-placeholder{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;max-width:52px;text-align:center;font-size:20px;color:#fff;font-weight:500}.avatar-project .avatar-image{position:absolute;top:0;bottom:0;margin:0;left:0;width:100%;height:100%;max-height:100%;text-align:left;background-color:transparent;background-repeat:no-repeat;background-size:contain;background-attachment:scroll;background-attachment:initial;background-position:left;background-origin:content-box}textarea::-moz-placeholder{color:#aaa;font-weight:300}textarea:-ms-input-placeholder{color:#aaa;font-weight:300}textarea::placeholder{color:#aaa;font-weight:300}.msg_container .button-in-msg{color:#fff!important;background:#2a6ac1!important;background:var(--button-in-msg-background-color)!important;position:relative;max-width:300px;min-width:inherit;padding:8px 16px;cursor:auto;border:1px solid white;border-radius:20px!important;margin:3px;overflow:hidden;font-family:"Muli",sans-serif;font-size:15px;text-overflow:ellipsis;white-space:normal;letter-spacing:-.24px;-webkit-font-smoothing:antialiased}.msg_container .button-in-msg p{font-size:15px!important;font-size:var(--button-in-msg-font-size)!important;font-family:"Muli",sans-serif!important;font-weight:normal!important}chat-root{position:absolute;display:block;width:100%;height:100%}chat-root *:focus{outline:none}chat-root button{cursor:pointer}chat-root textarea,chat-root textarea:visited,chat-root textarea:focus,chat-root textarea:hover,chat-root textarea:active{line-height:20px!important;outline:none!important;box-shadow:none!important;border:0px solid rgba(0,0,0,.2)!important}chat-root .c21-button-clean{-webkit-appearance:initial;border:none;background-color:transparent;padding:0;margin:0}chat-root #tiledesk-container{position:absolute;width:100%;height:100%;font-family:"Roboto","Google Sans",Helvetica,Arial,sans-serif;font-size:10px;text-align:left;background-color:transparent;display:none;overflow:hidden}chat-root #tiledesk-container.active{display:block}chat-root #tiledesk-container a:link{color:#fff}chat-root #tiledesk-container a:visited{color:#fff}chat-root #tiledesk-container a:hover{color:#fff}chat-root #tiledesk-container a:active{color:#fff}chat-root #tiledesk-container #c21-app-list-conversations a:link,chat-root #tiledesk-container #c21-app-list-all-conversations a:link,chat-root #tiledesk-container #chat21-star-rating-widget a:link,chat-root #tiledesk-container #chat21-prechat-form a:link{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:visited,chat-root #tiledesk-container #c21-app-list-all-conversations a:visited,chat-root #tiledesk-container #chat21-star-rating-widget a:visited,chat-root #tiledesk-container #chat21-prechat-form a:visited{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:hover,chat-root #tiledesk-container #c21-app-list-all-conversations a:hover,chat-root #tiledesk-container #chat21-star-rating-widget a:hover,chat-root #tiledesk-container #chat21-prechat-form a:hover{color:#3a3c4c}chat-root #tiledesk-container #c21-app-list-conversations a:active,chat-root #tiledesk-container #c21-app-list-all-conversations a:active,chat-root #tiledesk-container #chat21-star-rating-widget a:active,chat-root #tiledesk-container #chat21-prechat-form a:active{color:#3a3c4c}chat-root #tiledesk-container div.clear{all:unset;clear:both}chat-root #tiledesk-container .truncate{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}chat-root #tiledesk-container .truncate p{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-margin-before:0em;margin-block-start:0em;-webkit-margin-after:0em;margin-block-end:0em}chat-root #tiledesk-container .v-align-center{display:inline-flex;align-items:center;height:100%;float:left}chat-root #tiledesk-container .c21-align-left{left:0px}chat-root #tiledesk-container .c21-align-right{right:0px}chat-root #tiledesk-container .time{display:none;font-size:1em;color:#aaa;text-align:left;margin:-2px 0 0;padding:0 40px;background-color:transparent}chat-root #tiledesk-container .time.sender{text-align:right;margin-right:24px;padding:0}chat-root #tiledesk-container .msg_receive a{color:#62a8ea}chat-root #tiledesk-container img{max-width:230px}chat-root #tiledesk-container button.c21-button-primary{width:auto;height:40px;line-height:40px;margin:25px 0;padding:0 24px;opacity:1;text-align:center;font-size:1em;border-radius:40px;background-color:#2a6ac1;color:#fff;border:0px;cursor:pointer}chat-root #tiledesk-container button.c21-button-primary .c21-label-button{margin-left:8px;font-weight:400;font-size:.9em}chat-root #tiledesk-container button.c21-button-primary:hover,chat-root #tiledesk-container button.c21-button-primary:focus,chat-root #tiledesk-container button.c21-button-primary:active{opacity:.8}chat-root #tiledesk-container button.c21-button-link{font-weight:400;font-size:14px;color:#2a6ac1;text-decoration:none;background-color:transparent;border:1px solid transparent;cursor:pointer}chat-root #tiledesk-container button.c21-button-link:hover,chat-root #tiledesk-container button.c21-button-link:focus,chat-root #tiledesk-container button.c21-button-link:active{text-decoration:underline;outline:none}chat-root #tiledesk-container .c21-divBudge{position:absolute;top:0;width:auto;height:12px;min-width:12px;font-size:1em;line-height:1.2em;border-radius:50%;background-color:red;color:#fff;text-align:center;margin-top:-10px;display:inline-block;box-sizing:content-box;box-sizing:initial;padding:5px;left:0px}chat-root #tiledesk-container .c21-button{display:flex;cursor:pointer}chat-root #tiledesk-container .c21-close-button{position:absolute;width:35px;height:35px;top:0;right:0;margin:10px;z-index:10}chat-root #tiledesk-container .c21-close-button .c21-close-button-body{cursor:pointer;width:35px;height:35px;border-radius:8px;padding:0;margin:0;display:flex;align-items:center;-webkit-appearance:initial;border:none;background-color:rgba(0,0,0,0)}chat-root #tiledesk-container .c21-close-button .c21-close-button-body:hover{background-color:rgba(0,0,0,.4)}chat-root #tiledesk-container .c21-close-button .c21-close-button-body svg{margin:0 auto;fill:#fff}chat-root #tiledesk-container #chat21-spinner{display:none;width:70px;min-height:20px;margin:20px auto 0;text-align:center}chat-root #tiledesk-container #chat21-spinner.active{display:block}chat-root #tiledesk-container #chat21-spinner>div{width:12px;height:12px;background-color:#2a6ac1;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}chat-root #tiledesk-container #chat21-spinner .chat21-bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}chat-root #tiledesk-container #chat21-spinner .chat21-bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}chat-root #tiledesk-container #chat21-spinner span{display:block;margin:.5em 0 0;color:#1a1a1a;font-family:"Roboto",sans-serif;-webkit-animation:pulse 2s linear infinite;animation:pulse 2s linear infinite;text-align:center}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}chat-root #tiledesk-container #chat21-conversations{position:absolute;left:1px;right:1px;top:1px;bottom:1px;border-radius:16px;overflow:hidden;background-color:transparent;margin:0;padding:0}chat-root #tiledesk-container #chat21-conversations.full-screen-mode{width:100%;height:100%;right:0px;top:0px;left:0px;bottom:0px;border-radius:0;max-height:none}chat-root #tiledesk-container #chat21-conversations.isMobile{border-radius:0}chat-root #tiledesk-container #chat21-conversations.shadow{transition:box-shadow .8s ease-in;box-shadow:rgba(0,0,0,.16) 0 8px 36px}chat-root #tiledesk-container .chat21-fullscreen{width:100%;height:100%;right:0px;left:0px;bottom:0px;border-radius:0;max-height:none}chat-root #tiledesk-container .modal-page{position:absolute;height:100%;width:100%;z-index:1;background-color:transparent;opacity:0;display:none}chat-root #tiledesk-container .modal-page.active{display:inline-block;opacity:1}chat-root #tiledesk-container .modal-page.modal-slide-in-right{position:absolute;left:0px;opacity:1;display:inline-block;-webkit-animation-name:modal-active-in;-webkit-animation-duration:.3s;animation-name:modal-active-in;animation-duration:.3s}chat-root #tiledesk-container .modal-page.modal-slide-out-right{position:absolute;opacity:1;display:inline-block;-webkit-animation:slide-out-right .3s cubic-bezier(.55,.085,.68,.53) both;animation:slide-out-right .3s cubic-bezier(.55,.085,.68,.53) both}chat-root .c21-header{overflow:hidden;width:100%;height:52px;position:relative;margin:0;padding:0;color:#fff;z-index:10}chat-root .c21-header button:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:10%}chat-root .c21-header .c21-header-container{position:relative;height:52px;width:100%;margin:0 auto}chat-root .c21-header .c21-header-container .c21-header-content{position:absolute;top:0;left:0;width:100%;height:100%}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button{display:block;align-items:center;justify-content:center;text-align:center;width:35px;height:35px;margin:9px;padding:0;border-radius:8px;cursor:pointer}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-right{float:right}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-left{float:left}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button.c21-close{display:none}chat-root .c21-header .c21-header-container .c21-header-content .c21-header-button svg{height:20px;width:20px}chat-root .c21-header .c21-header-container .c21-header-content .c21-title{position:absolute;left:0;display:inline-block;width:calc(100% - 200px);height:1.6em;line-height:1.6em;padding:0;margin:10px 100px;text-align:center;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}chat-root .c21-body::-webkit-scrollbar{display:none}chat-root .c21-body{position:absolute;top:52px;bottom:0;left:0;right:0;padding:0;margin:0 auto;overflow:auto}chat-root .c21-body .c21-body-container{position:absolute;top:0;bottom:0;left:0;right:0;height:auto;width:auto}chat-root .c21-body .c21-body-container .c21-body-header{position:absolute;top:0;left:30px;right:30px;padding:10px 0;margin:0 auto;width:auto;height:auto;z-index:2}chat-root .c21-body .c21-body-container .c21-body-content{position:absolute;top:0;bottom:0;left:0;right:0;padding:0;margin:0 auto;height:auto}@media (max-width: 451px){chat-root #tiledesk-container .header-button.close{display:flex}}\n'],encapsulation:2}),i}(),kn=ye(39917),An=ye(79996),In=function(){function i(o,n,t){this.http=o,this.g=n,this.appConfigService=t,this.API_URL=t.getConfig().apiUrl}return i.prototype.getCurrent=function(o){var n=this.API_URL+o+"/publicanalytics/waiting/current",t=new Se.WM;return t.append("Content-Type","application/json"),this.http.get(n,{headers:t}).pipe((0,An.U)(function(r){return r}))},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}(),$e=ye(53717);function Vo(i,o){if(1&i&&e._UZ(0,"div",16,17),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.image+")")}}function Wo(i,o){if(1&i&&(e.TgZ(0,"div",18),e.O4$(),e.TgZ(1,"svg",19),e._UZ(2,"path",20),e._UZ(3,"path",21),e.qZA(),e.qZA()),2&i){var n=e.oxw().$implicit;e.ekj("not-read",null==n?null:n.is_new)}}function Yo(i,o){if(1&i&&(e.TgZ(0,"div",18),e.O4$(),e.TgZ(1,"svg",22),e._UZ(2,"path",23),e.qZA(),e.qZA()),2&i){var n=e.oxw().$implicit;e.ekj("not-read",n.is_new)}}var Go=function(i){return{"background-color":i}};function Jo(i,o){if(1&i&&(e.TgZ(0,"div",24),e._uU(1),e.qZA()),2&i){var n=e.oxw().$implicit,t=e.oxw();e.Q6J("ngStyle",e.VKq(2,Go,t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(n.badge)}}function Qo(i,o){if(1&i&&(e.TgZ(0,"div",25),e.TgZ(1,"button",26),e.O4$(),e.TgZ(2,"svg",27),e._UZ(3,"path",28),e._UZ(4,"path",29),e.TgZ(5,"title",30),e._uU(6),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(6),e.Oqu(n.translationMap.get("CLOSED"))}}var Ko=function(i){return{background:i}};function Xo(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"button",2),e.NdJ("click",function(){var u=e.CHM(n).$implicit;return e.oxw().openConversationByID(u)}),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.TgZ(5,"span",6),e._uU(6),e.qZA(),e.YNc(7,Vo,2,2,"div",7),e.qZA(),e.qZA(),e.TgZ(8,"div",8),e.TgZ(9,"div",9),e._uU(10),e.ALo(11,"amTimeAgo"),e.qZA(),e.TgZ(12,"div",10),e._uU(13),e.qZA(),e.YNc(14,Wo,4,2,"div",11),e.YNc(15,Yo,3,2,"div",11),e.TgZ(16,"div",12),e._uU(17),e.qZA(),e.qZA(),e.YNc(18,Jo,2,4,"div",13),e.YNc(19,Qo,7,1,"div",14),e.qZA(),e._UZ(20,"div",15),e.qZA(),e.qZA()}if(2&i){var t=o.$implicit;e.xp6(4),e.Q6J("ngStyle",e.VKq(16,Ko,"linear-gradient(rgb(255,255,255) -125%, "+t.color+")")),e.xp6(2),e.Oqu(null==t?null:t.avatar),e.xp6(1),e.Q6J("ngIf",null==t?null:t.image),e.xp6(3),e.Oqu(e.lcZ(11,14,null==t?null:t.timestamp)),e.xp6(3),e.Oqu(null==t?null:t.sender_fullname),e.xp6(1),e.Q6J("ngIf","image"===(null==t?null:t.type)),e.xp6(1),e.Q6J("ngIf","image"!==t.type&&"text"!==t.type),e.xp6(1),e.ekj("not-read",t.is_new)("archived",t.archived),e.xp6(1),e.Oqu(t.last_message_text),e.xp6(1),e.Q6J("ngIf",t.is_new),e.xp6(1),e.Q6J("ngIf",t.archived)}}var Rn=function(){function i(o){this.iterableDiffers=o,this.onConversationSelected=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.convertMessage=Ft,this.setColorFromString=Ut,this.avatarPlaceholder=Bt,this.logger=Ce.getInstance(),this.empDifferMap=new Map,this.empMap=new Map,this.iterableDifferListConv=this.iterableDiffers.find([]).create(null)}return i.prototype.ngOnInit=function(){this.logger.debug("[LISTCONVERSATIONS] ngOnInit",this.listConversations)},i.prototype.ngOnChanges=function(o){},i.prototype.openConversationByID=function(o){this.logger.debug("[LISTCONVERSATIONS] openConversationByID: ",o),o&&(this.uidConvSelected=o.uid,this.onConversationSelected.emit(o))},i.prototype.ngAfterViewInit=function(){this.logger.debug("[LISTCONVERSATIONS] ---ngAfterViewInit---: listConversations ",this.listConversations)},i.prototype.ngDoCheck=function(){this.iterableDifferListConv.diff(this.listConversations)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.ZZ4))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-list-conversations"]],inputs:{listConversations:"listConversations",limit:"limit",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onConversationSelected:"onConversationSelected",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},features:[e.TTD],decls:3,vars:5,consts:[["id","c21-app-list-conversations"],[4,"ngFor","ngForOf"],["tabindex","1103",1,"c21-item-conversation",3,"click"],[1,"c21-body-conv"],[1,"c21-left-conv"],[1,"c21-ball",3,"ngStyle"],[1,"c21-ball-label"],["class","c21-avatar-image",3,"background-image",4,"ngIf"],[1,"c21-right-conv"],[1,"c21-last-time"],[1,"truncate","c21-name"],["class","c21-msg","style","float: left; margin-right: 5px;",3,"not-read",4,"ngIf"],[1,"truncate","c21-msg"],["class","c21-divBudge",3,"ngStyle",4,"ngIf"],["class","c21-icon-archived-chat",4,"ngIf"],[1,"clear"],[1,"c21-avatar-image"],["avatarImage",""],[1,"c21-msg",2,"float","left","margin-right","5px"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#000000","width","20px","height","20px","viewBox","0 0 24 24"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#000000","width","20px","height","20px","viewBox","0 0 24 24","transform","rotate(45)"],["d","M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"],[1,"c21-divBudge",3,"ngStyle"],[1,"c21-icon-archived-chat"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","fill","#aaaaaa","width","24px","height","24px","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0z"],["d","M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"],["id","altIconTitle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,Xo,21,18,"div",1),e.ALo(2,"slice"),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngForOf",e.Dn7(2,1,t.listConversations,0,t.limit)))},directives:[me.sg,me.PC,me.O5],pipes:[me.OU,$e.eG],styles:["[_nghost-%COMP%] .c21-msg[_ngcontent-%COMP%] >a>img{max-width:24%!important;vertical-align:middle}#c21-app-list-conversations[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:auto;font-size:10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;min-width:325;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{border-bottom:1px solid #eee;width:auto;text-align:left;padding:0 15px;position:relative;display:flex;align-items:center;height:60px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0;text-align:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:300;color:#8b8ea6;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:400;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .archived.c21-msg[_ngcontent-%COMP%]{margin-right:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:45px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:#2a6ac1;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-icon-archived-chat[_ngcontent-%COMP%]{border-radius:4px;position:absolute;right:0px;bottom:20px;margin-right:-5px;color:#858585;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center;color:#777}"]}),i}();function $o(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",10),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e.TgZ(1,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e._uU(2),e.qZA(),e.TgZ(3,"button",12),e.O4$(),e.TgZ(4,"svg",13),e._UZ(5,"path",14),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.hij("",t.g.SHOW_ALL_CONV," ")}}function ei(i,o){if(1&i&&(e.TgZ(0,"div"),e.TgZ(1,"div",8),e._uU(2),e.qZA(),e.YNc(3,$o,6,1,"div",9),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Oqu(n.g.PREV_CONVERSATIONS),e.xp6(1),e.Q6J("ngIf",1==n.g.showAllConversations)}}function ti(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",10),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).returnOpenAllConversation()}),e.TgZ(1,"div",15),e._uU(2),e.qZA(),e.O4$(),e.TgZ(3,"svg",16),e._UZ(4,"path",17),e._UZ(5,"path",18),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Oqu(t.g.SHOW_ALL_CONV)}}function ni(i,o){if(1&i&&(e.TgZ(0,"div"),e.TgZ(1,"div",8),e._uU(2),e.qZA(),e.YNc(3,ti,6,1,"div",9),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Oqu(n.g.NO_CONVERSATION),e.xp6(1),e.Q6J("ngIf",n.listConversations&&n.listConversations.length>0)}}function oi(i,o){if(1&i&&e._UZ(0,"div",25,26),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.imageurl+")")}}var Ln=function(i){return{"background-color":i}};function ii(i,o){if(1&i&&(e.TgZ(0,"div",21),e.TgZ(1,"div",22),e.TgZ(2,"span",23),e._uU(3),e.qZA(),e.YNc(4,oi,2,2,"div",24),e.qZA(),e.qZA()),2&i){var n=o.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(3,Ln,t.setColorFromString(n.firstname))),e.xp6(2),e.Oqu(t.avatarPlaceholder(n.firstname)),e.xp6(1),e.Q6J("ngIf",n.imageurl)}}function ri(i,o){if(1&i&&(e.TgZ(0,"div",19),e.YNc(1,ii,5,5,"div",20),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngForOf",n.availableAgents)}}function ai(i,o){if(1&i&&e._UZ(0,"div",25,26),2&i){var n=e.oxw().$implicit;e.Udp("background-image","url("+n.imageurl+")")}}function si(i,o){if(1&i&&(e.TgZ(0,"div",35),e.TgZ(1,"div",22),e.TgZ(2,"span",23),e._uU(3),e.qZA(),e.YNc(4,ai,2,2,"div",24),e.qZA(),e.qZA()),2&i){var n=o.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(3,Ln,t.setColorFromString(n.firstname))),e.xp6(2),e.Oqu(t.avatarPlaceholder(n.firstname)),e.xp6(1),e.Q6J("ngIf",n.imageurl)}}var Nn=function(i,o,n){return{"background-color":i,"border-color":o,color:n}},Fn=function(){return{fill:"yellow"}},Bn=function(i){return{fill:i}};function li(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",27),e.YNc(1,si,5,5,"div",28),e.TgZ(2,"button",29,30),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(4,"span",31),e.O4$(),e.TgZ(5,"svg",32),e._UZ(6,"path",33),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"span",34),e._uU(8),e.qZA(),e._UZ(9,"div",3),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.availableAgents),e.xp6(1),e.Q6J("ngStyle",e.kEZ(5,Nn,t.g.themeColor,t.g.themeColor,t.g.themeForegroundColor)),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,Fn)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,Bn,t.g.themeForegroundColor)),e.xp6(2),e.hij(" ",t.g.LABEL_START_NW_CONV," ")}}function ci(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-list-conversations",38),e.NdJ("onConversationSelected",function(a){return e.CHM(n),e.oxw(2).onConversationSelectedFN(a)})("onImageLoaded",function(a){return e.CHM(n),e.oxw(2).onImageLoadedFN(a)})("onConversationLoaded",function(a){return e.CHM(n),e.oxw(2).onConversationLoadedFN(a)}),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("listConversations",t.listConversations)("limit",3)("stylesMap",t.stylesMap)("translationMap",t.translationMapConversation)}}function ui(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div"),e.YNc(1,ci,1,4,"chat-list-conversations",36),e.TgZ(2,"div",37),e.TgZ(3,"button",29,30),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(5,"span",31),e.O4$(),e.TgZ(6,"svg",32),e._UZ(7,"path",33),e.qZA(),e.qZA(),e.kcU(),e.TgZ(8,"span",34),e._uU(9),e.qZA(),e._UZ(10,"div",3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.listConversations&&t.listConversations.length>0),e.xp6(2),e.Q6J("ngStyle",e.kEZ(5,Nn,t.g.themeColor,t.g.themeColor,t.g.themeForegroundColor)),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,Fn)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,Bn,t.g.themeForegroundColor)),e.xp6(2),e.hij(" ",t.g.LABEL_START_NW_CONV," ")}}function hi(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER," ")}}function pi(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.WAITING_TIME_NOT_FOUND," ")}}function di(i,o){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.WAITING_TIME_NOT_FOUND)}}function gi(i,o){if(1&i&&(e.TgZ(0,"div",39),e.TgZ(1,"div",40),e.YNc(2,hi,2,1,"div",2),e.YNc(3,pi,2,1,"div",2),e.YNc(4,di,2,1,"div",2),e.qZA(),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Q6J("ngIf",n.waitingTime>=0&&!0===n.g.dynamicWaitTimeReply),e.xp6(1),e.Q6J("ngIf",n.waitingTime>=0&&!1===n.g.dynamicWaitTimeReply),e.xp6(1),e.Q6J("ngIf",-1==n.waitingTime)}}var fi=function(){function i(o,n,t,r,a,u){this.g=o,this.imageRepoService=n,this.chatManager=t,this.waitingService=r,this.translatorService=a,this.customTranslateService=u,this.onNewConversation=new e.vpe,this.onConversationSelected=new e.vpe,this.onOpenAllConvesations=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.subscriptions=[],this.convertMessage=Ft,this.setColorFromString=Ut,this.avatarPlaceholder=Bt,this.tenant="",this.themeColor="",this.themeForegroundColor="",this.availableAgents=[],this.langService=new kn.b,this.logger=Ce.getInstance(),this.humanizer=new kn.f(this.langService),this.humanizer.setOptions({round:!0}),this.initialize()}return i.prototype.ngOnInit=function(){this.logger.debug("[HOMECONVERSATIONS]---ngOnInit--- ",this.listConversations)},i.prototype.initTranslations=function(){this.translationMapConversation=this.customTranslateService.translateLanguage(["CLOSED"])},i.prototype.onConversationSelectedFN=function(o){o&&this.onConversationSelected.emit(o)},i.prototype.initialize=function(){var o=this;this.logger.debug("initialize: ListConversationsComponent"),this.initTranslations(),this.tenant=this.g.tenant,this.LABEL_START_NW_CONV=this.g.LABEL_START_NW_CONV,this.listConversations=[],this.archivedConversations=[],this.waitingTime=-1,this.availableAgents=this.g.availableAgents.slice(0,5),this.availableAgents.forEach(function(n){n.imageurl=o.imageRepoService.getImagePhotoUrl(n.id)}),this.logger.debug("[HOMECONVERSATIONS] tenant: ",this.tenant,this.availableAgents),this.logger.debug("[HOMECONVERSATIONS] this.listConversations.length",this.listConversations.length),this.logger.debug("[HOMECONVERSATIONS] this.listConversations",this.listConversations),this.showWaitingTime()},i.prototype.showWaitingTime=function(){var o=this,n=this,t=this.g.projectid;t&&this.waitingService.getCurrent(t).subscribe(function(r){if(n.logger.debug("[HOMECONVERSATIONS] response waiting",r),r&&r.length>0&&r[0].waiting_time_avg){var a=r[0].waiting_time_avg;n.waitingTime=a,n.logger.debug("[HOMECONVERSATIONS] that.waitingTime",n.waitingTime);var u=n.translatorService.getLanguage();n.humanWaitingTime=o.humanizer.humanize(a,{language:u}),o.g.WAITING_TIME_FOUND.includes("$reply_time")&&(o.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER=o.g.WAITING_TIME_FOUND.replace("$reply_time",n.humanWaitingTime))}})},i.prototype.checkShowAllConversation=function(){return!!(this.archivedConversations&&this.archivedConversations.length>0)||!!(this.listConversations&&this.listConversations.length>0)},i.prototype.openNewConversation=function(){this.onNewConversation.emit()},i.prototype.returnOpenAllConversation=function(){this.onOpenAllConvesations.emit()},i.prototype.onImageLoadedFN=function(o){this.onImageLoaded.emit(o)},i.prototype.onConversationLoadedFN=function(o){this.onConversationLoaded.emit(o)},i.prototype.openConversationByID=function(o){this.logger.debug("[HOMECONVERSATIONS] openConversationByID: ",o),o&&this.onConversationSelected.emit(o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[HOMECONVERSATIONS] ngOnDestroy list conv subscriptions",this.subscriptions),this.unsubscribe()},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.subListConversations=null,this.subArchivedConversations=null,this.logger.debug("[HOMECONVERSATIONS] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(st),e.Y36(Tt),e.Y36(In),e.Y36(Gt),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-home-conversations"]],inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",hideNewConversationButton:"hideNewConversationButton",stylesMap:"stylesMap"},outputs:{onNewConversation:"onNewConversation",onConversationSelected:"onConversationSelected",onOpenAllConvesations:"onOpenAllConvesations",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},decls:10,vars:6,consts:[["id","c21-app-list-conversations"],[1,"c21-header"],[4,"ngIf"],[1,"clear"],[1,"c21-body"],["style","margin: 20px 30px;",4,"ngIf"],["class","flex-container",4,"ngIf"],["class","c21-footer",4,"ngIf"],[1,"c21-title"],["class","c21-button",3,"click",4,"ngIf"],[1,"c21-button",3,"click"],[2,"display","inline-block","line-height","40px","margin-right","10px",3,"click"],["tabindex","1101","aria-label"," tutte le conversazioni",1,"c21-button-clean"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","width","20","height","20","viewBox","0 0 20 20",0,"xml","space","preserve",2,"enable-background","new 0 0 20 20"],["d","M1.9,15.4h16.2v-1.8H1.9V15.4z M1.9,10.9h16.2V9.1H1.9V10.9z M1.9,4.6v1.8h16.2V4.6H1.9z"],[2,"display","inline-block","line-height","40px","margin-right","10px"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0V0z"],["d","M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"],[2,"margin","20px 30px"],["class","c21-pallozzo",4,"ngFor","ngForOf"],[1,"c21-pallozzo"],[1,"c21-ball",3,"ngStyle"],[1,"c21-ball-label"],["class","c21-avatar-image",3,"background-image",4,"ngIf"],[1,"c21-avatar-image"],["avatarImage",""],[1,"flex-container"],["class","c21-pallozzo flex-inline-agent ",4,"ngFor","ngForOf"],["tabindex","1040","aflistconv","",1,"c21-button-primary",3,"ngStyle","click"],["aflistconv",""],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",3,"ngStyle"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],[1,"v-align-center","c21-label-button"],[1,"c21-pallozzo","flex-inline-agent"],[3,"listConversations","limit","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded",4,"ngIf"],[1,"c21-new-conversation"],[3,"listConversations","limit","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded"],[1,"c21-footer"],[1,"c21-waiting-time"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,ei,4,2,"div",2),e.YNc(3,ni,4,2,"div",2),e.qZA(),e._UZ(4,"div",3),e.TgZ(5,"div",4),e.YNc(6,ri,2,1,"div",5),e.YNc(7,li,10,12,"div",6),e.YNc(8,ui,11,12,"div",2),e.qZA(),e.YNc(9,gi,5,3,"div",7),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngIf",t.checkShowAllConversation()),e.xp6(1),e.Q6J("ngIf",!t.checkShowAllConversation()),e.xp6(3),e.Q6J("ngIf",(!t.listConversations||0==t.listConversations.length)&&!0===t.g.showAvailableAgents&&t.availableAgents&&t.availableAgents.length>1),e.xp6(1),e.Q6J("ngIf",(!t.listConversations||0==t.listConversations.length)&&t.availableAgents&&1===t.availableAgents.length&&!0===t.g.showAvailableAgents),e.xp6(1),e.Q6J("ngIf",t.availableAgents&&t.availableAgents.length>1||t.listConversations&&t.listConversations.length>0||t.availableAgents&&0===t.availableAgents.length),e.xp6(1),e.Q6J("ngIf",!0===t.g.showWaitTime))},directives:[me.O5,me.sg,me.PC,Rn],styles:["#c21-app-list-conversations[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:auto;font-size:10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{color:#5f6368;height:auto;position:relative;min-height:40px;display:block;font-weight:300;border-bottom:1px solid #f1f1f1;border-radius:0}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{font-size:1.4em;max-width:230px;line-height:normal;padding:14px 0 10px 24px;float:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%]{font-size:1.4em;margin:0;line-height:normal;padding:0 5px;float:right;fill:#2a6ac1}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:40px;height:40px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#5f6368}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-button[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:rgba(220,220,220,.4)!important}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:relative;display:inline-block;width:100%;height:auto;top:0px;font-size:1em;box-shadow:none;overflow:hidden;margin:0}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .flex-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-content:center;margin:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;min-width:344px;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{border-top:1px solid #eee;width:auto;text-align:left;margin:0 20px;position:relative;display:flex;align-items:center;height:80px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0;text-align:left}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:700;color:#3a3c4c;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:200;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-pallozzo[_ngcontent-%COMP%]{display:inline}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-pallozzo.flex-inline-agent[_ngcontent-%COMP%]{margin:auto 15px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-new-conversation[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;border-top:0px solid #eeeeee;display:flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-footer[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;display:flex;align-items:center}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-footer[_ngcontent-%COMP%] .c21-waiting-time[_ngcontent-%COMP%]{font-size:1.3em;font-weight:200;padding:0 24px 10px}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:40px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:#2a6ac1;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-conversations[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{margin-left:8px;font-weight:400;font-size:1.2em}"]}),i}();function mi(i,o){if(1&i&&(e.TgZ(0,"div",15),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.userFullname)}}function vi(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",16),e._UZ(1,"path",17),e._UZ(2,"path",18),e.TgZ(3,"title",19),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(n.g.SOUND_OFF)}}function bi(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",16),e._UZ(1,"path",17),e._UZ(2,"path",20),e.TgZ(3,"title",19),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(n.g.SOUND_ON)}}function _i(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.SOUND_OFF,"")}}function Ci(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",n.g.SOUND_ON,"")}}function yi(i,o){if(1&i&&(e.O4$(),e.kcU(),e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){var n=e.oxw(3);e.xp6(1),e.hij(" ",n.g.LOGOUT,"")}}function wi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",9),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).signOut()}),e.O4$(),e.TgZ(1,"svg",21),e._UZ(2,"path",17),e._UZ(3,"path",22),e.TgZ(4,"title",19),e._uU(5),e.qZA(),e.qZA(),e.YNc(6,yi,2,1,"span",11),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(t.g.LOGOUT),e.xp6(1),e.Q6J("ngIf",t.g.isLogged&&t.g.showLogoutOption)}}function Oi(i,o){if(1&i){var n=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"div",6),e.TgZ(1,"div",7),e.YNc(2,mi,2,1,"div",8),e.TgZ(3,"div",9),e.NdJ("click",function(){return e.CHM(n),e.oxw().toggleSound()}),e.YNc(4,vi,5,1,"svg",10),e.YNc(5,bi,5,1,"svg",10),e.YNc(6,_i,2,1,"span",11),e.YNc(7,Ci,2,1,"span",11),e.qZA(),e.YNc(8,wi,7,2,"div",12),e.TgZ(9,"div",13),e.TgZ(10,"span",14),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.g.signInWithCustomToken&&t.g.userFullname),e.xp6(2),e.Q6J("ngIf",!t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",!t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.g.isLogged&&t.g.showLogoutOption),e.xp6(3),e.hij(" ",t.g.BUILD_VERSION,"")}}var Mi=function(i){return{display:i}},xi=function(){function i(o){this.g=o,this.isHover=!1,this.onSignOut=new e.vpe}return i.prototype.ngOnInit=function(){this.themeColor50=Ie(this.g.themeColor,50)},i.prototype.f21_toggle_options=function(){this.g.setParameter("isOpenMenuOptions",!this.g.isOpenMenuOptions,!0)},i.prototype.toggleSound=function(){this.g.setParameter("soundEnabled",!this.g.soundEnabled,!0),this.g.setParameter("isOpenMenuOptions",!1,!0)},i.prototype.signOut=function(){this.g.setParameter("isOpenMenuOptions",!1,!0),this.onSignOut.emit()},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-menu-options"]],inputs:{isHover:"isHover"},outputs:{onSignOut:"onSignOut"},decls:7,vars:4,consts:[["id","c21-menu-options"],[1,"button-menu-options",3,"click","mouseover","mouseleave"],["xmlns","http://www.w3.org/2000/svg","enable-background","new 0 0 24 24","height","24px","width","24px","viewBox","0 0 24 24",3,"ngStyle"],["d","M0,0h24v24H0V0z","fill","none"],["d","M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"],["class","modal-menu-options",4,"ngIf"],[1,"modal-menu-options"],[1,""],["class","label-menu-welcome",4,"ngIf"],[1,"c21-button",3,"click"],["aria-labelledby","altIconTitle","class","icon-menu","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",4,"ngIf"],["class","label-menu-item",4,"ngIf"],["class","c21-button",3,"click",4,"ngIf"],[1,"c21-button","build_version_menu"],[1,"label-menu-item"],[1,"label-menu-welcome"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",1,"icon-menu"],["fill","none","d","M0 0h24v24H0V0z"],["d","M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"],["id","altIconTitle"],["d","M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24","aria-labelledby","altIconTitle",1,"icon-menu"],["d","M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.NdJ("click",function(){return t.f21_toggle_options()})("mouseover",function(){return t.isHover=!0})("mouseleave",function(){return t.isHover=!1}),e.O4$(),e.TgZ(2,"svg",2),e.TgZ(3,"g"),e._UZ(4,"path",3),e._UZ(5,"path",4),e.qZA(),e.qZA(),e.qZA(),e.YNc(6,Oi,12,7,"div",5),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.VKq(2,Mi,t.isHover||t.g.isOpenMenuOptions?"block":"none")),e.xp6(4),e.Q6J("ngIf",t.g.isOpenMenuOptions))},directives:[me.PC,me.O5],styles:["#c21-menu-options[_ngcontent-%COMP%] .modal-menu-options[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;bottom:40px;right:10px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;background-color:#fff;z-index:25;box-shadow:0 4px 15px rgba(0,0,0,.2),0 1px 2px rgba(0,0,0,.2)}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]{position:absolute;width:auto;line-height:12px;font-size:1em;font-weight:bold;color:#777;display:inline-block;align-items:center;margin:4px 20px;padding:0;cursor:pointer;width:22px;height:22px;right:0px}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#5f6368;display:none}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]:hover{border-radius:50%}#c21-menu-options[_ngcontent-%COMP%] .button-menu-options[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{display:block}.c21-button[_ngcontent-%COMP%]{cursor:pointer;margin:5px;padding:5px 10px;color:#777;display:flex}.c21-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;border-radius:6px;cursor:pointer}.build_version_menu[_ngcontent-%COMP%]{color:#aaa;justify-content:center;font-size:1em}.build_version_menu[_ngcontent-%COMP%]:hover{cursor:default;background-color:unset}.label-menu-welcome[_ngcontent-%COMP%]{cursor:default;font-weight:500;margin:10px 0;padding:0 10px}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;border:1px solid #d7d7d7;background-color:#fff;padding:10px 0}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center}.label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}.icon-menu[_ngcontent-%COMP%]{fill:#5f6368}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}"]}),i}(),Ei=["homeComponent"],Ti=["aflistconv"];function Si(i,o){if(1&i&&(e.TgZ(0,"div",26),e._UZ(1,"div",27,28),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Udp("background-image","url("+n.g.project.logoChat+")")}}function Pi(i,o){if(1&i&&(e.TgZ(0,"div",29),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Oqu(n.g.welcomeMsg)}}function ki(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-menu-options",30),e.NdJ("onSignOut",function(){return e.CHM(n),e.oxw().onSignOutFN()}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("isHover",t.hover)}}var Ai=function(i,o){return{color:i,"background-image":o}},Ii=function(i){return{display:i}},Ri=function(i){return{fill:i}},Li=function(){function i(o){this.g=o,this.onNewConversation=new e.vpe,this.onConversationSelected=new e.vpe,this.onOpenAllConvesations=new e.vpe,this.onCloseWidget=new e.vpe,this.onSignOut=new e.vpe,this.onImageLoaded=new e.vpe,this.onConversationLoaded=new e.vpe,this.hover=!1,this.convertColorToRGBA=Ie,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.debug("[HOME-COMP] ngOnInit")},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.debug("[HOME-COMP]---ngAfterViewInit--- "),!0===this.g.firstOpen&&(this.addAnimation(),this.g.firstOpen=!1),setTimeout(function(){o.aflistconv&&o.aflistconv.nativeElement.focus()},1e3)},i.prototype.onNewConversationFN=function(){this.removeAnimation(),this.onNewConversation.emit()},i.prototype.onOpenAllConversation=function(){this.removeAnimation(),this.onOpenAllConvesations.emit()},i.prototype.onConversationSelectedFN=function(o){o&&(this.removeAnimation(),this.onConversationSelected.emit(o))},i.prototype.onImageLoadedFN=function(o){this.onImageLoaded.emit(o)},i.prototype.onConversationLoadedFN=function(o){this.onConversationLoaded.emit(o)},i.prototype.f21_close=function(){this.addAnimation(),this.onCloseWidget.emit()},i.prototype.hideMenuOptions=function(){this.logger.debug("[HOME-COMP] hideMenuOptions"),this.g.setParameter("isOpenMenuOptions",!1,!0)},i.prototype.onSignOutFN=function(){this.onSignOut.emit()},i.prototype.addAnimation=function(){try{var o=this.element.nativeElement;o&&o.classList.add("start-animation")}catch(n){this.logger.error("[HOME-COMP] addAnimation > Error :"+n)}},i.prototype.removeAnimation=function(){try{var o=this.element.nativeElement;o&&o.classList.remove("start-animation")}catch(n){this.logger.error("[HOME-COMP] removeAnimation > Error :"+n)}},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-home"]],viewQuery:function(n,t){if(1&n&&(e.Gf(Ei,5),e.Gf(Ti,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.element=r.first),e.iGM(r=e.CRH())&&(t.aflistconv=r.first)}},inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",hideSettings:"hideSettings",hideNewConversationButton:"hideNewConversationButton",stylesMap:"stylesMap"},outputs:{onNewConversation:"onNewConversation",onConversationSelected:"onConversationSelected",onOpenAllConvesations:"onOpenAllConvesations",onCloseWidget:"onCloseWidget",onSignOut:"onSignOut",onImageLoaded:"onImageLoaded",onConversationLoaded:"onConversationLoaded"},decls:28,vars:22,consts:[["id","chat21-home-component","tabindex","2002","onFocus","document.querySelector('[aflistconv]').focus()"],["homeComponent",""],[1,"c21-header",3,"ngStyle","click"],[1,"c21-header-container"],[1,"c21-header-button",3,"ngStyle"],[1,"c21-close-button"],["tabindex","2001","aria-label"," chiudi chat",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],[1,"c21-header-content"],["class","avatar-project","item-start","",4,"ngIf"],[1,"c21-text","fade-in-bottom"],[1,"c21-text-welcome"],["class","c21-text-intro",4,"ngIf"],[1,"c21-body",3,"click"],[1,"c21-body-content"],[1,"c21-cards"],[1,"c21-card-blank","fade-in-top"],[1,"c21-card","fade-in-top"],[3,"listConversations","archivedConversations","hideNewConversationButton","stylesMap","onNewConversation","onConversationSelected","onOpenAllConvesations","onImageLoaded","onConversationLoaded"],[1,"c21-footer","fade-in-bottom-footer"],["id","c21-powered-by",3,"mouseover","mouseleave"],["tabindex","-1",1,"c21-powered-by",3,"innerHTML"],[3,"isHover","onSignOut",4,"ngIf"],["item-start","",1,"avatar-project"],[1,"avatar-image"],["avatarImage",""],[1,"c21-text-intro"],[3,"isHover","onSignOut"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.NdJ("click",function(){return t.hideMenuOptions()}),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.f21_close()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.TgZ(10,"title",10),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",11),e.YNc(13,Si,3,2,"div",12),e.TgZ(14,"div",13),e.TgZ(15,"div",14),e._uU(16),e.qZA(),e.YNc(17,Pi,2,1,"div",15),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(18,"div",16),e.NdJ("click",function(){return t.hideMenuOptions()}),e.TgZ(19,"div",17),e.TgZ(20,"div",18),e._UZ(21,"div",19),e.TgZ(22,"div",20),e.TgZ(23,"chat-home-conversations",21),e.NdJ("onNewConversation",function(){return t.onNewConversationFN()})("onConversationSelected",function(a){return t.onConversationSelectedFN(a)})("onOpenAllConvesations",function(){return t.onOpenAllConversation()})("onImageLoaded",function(a){return t.onImageLoadedFN(a)})("onConversationLoaded",function(a){return t.onConversationLoadedFN(a)}),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(24,"div",22),e.TgZ(25,"div",23),e.NdJ("mouseover",function(){return t.hover=!0})("mouseleave",function(){return t.hover=!1}),e._UZ(26,"div",24),e.qZA(),e.YNc(27,ki,1,1,"chat-menu-options",25),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(15,Ai,t.g.themeForegroundColor,t.g.colorGradient)),e.xp6(2),e.Q6J("ngStyle",e.VKq(18,Ii,t.g.hideHeaderCloseButton?"none":"block")),e.xp6(3),e.Q6J("ngStyle",e.VKq(20,Ri,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.BUTTON_CLOSE_TO_ICON),e.xp6(2),e.Q6J("ngIf","nologo"!==t.g.project.logoChat),e.xp6(3),e.Oqu(null==t.g?null:t.g.welcomeTitle),e.xp6(1),e.Q6J("ngIf",t.g.welcomeMsg),e.xp6(2),e.ekj("nologo","nologo"===t.g.project.logoChat),e.xp6(4),e.Q6J("listConversations",t.listConversations)("archivedConversations",t.archivedConversations)("hideNewConversationButton",t.hideNewConversationButton)("stylesMap",t.stylesMap),e.xp6(3),e.Q6J("innerHTML",t.g.poweredBy,e.oJD),e.xp6(1),e.Q6J("ngIf",!t.hideSettings))},directives:[me.PC,me.O5,fi,xi],styles:['#chat21-home-component{position:absolute;width:100%;height:100%}#chat21-home-component.start-animation .fade-in-top{-webkit-animation:fade-in-top .5s cubic-bezier(.39,.575,.565,1) .3s both;animation:fade-in-top .5s cubic-bezier(.39,.575,.565,1) .3s both}#chat21-home-component.start-animation .fade-in-bottom{-webkit-animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s;animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s}#chat21-home-component .c21-header{position:absolute;width:100%;height:500px;border-radius:0 0 16px 16px;overflow:hidden;margin:0;padding:0}#chat21-home-component .c21-header .c21-header-container{padding:0;margin:0;width:100%;height:100%;position:absolute}#chat21-home-component .c21-header .c21-header-container .c21-header-button{display:block;width:100%;height:70px;position:absolute;margin:0}#chat21-home-component .c21-header .c21-header-container .flex-container{display:flex;align-items:stretch;margin:30px 40px 0;width:auto;height:auto}#chat21-home-component .c21-header .c21-header-container .flex-container .avatar-project{width:22%}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text{font-family:"Google Sans"}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text .c21-text-welcome{overflow:hidden;line-height:1.2em;max-height:2.4em;font-weight:400;font-size:3em;margin-bottom:10px}#chat21-home-component .c21-header .c21-header-container .flex-container .c21-text .c21-text-intro{display:inline-block;font-size:1.4em;font-weight:300;line-height:1.2em;max-height:2.4em}#chat21-home-component .c21-header .c21-header-container .c21-header-content{margin:55px 40px 0;width:auto;height:auto;display:flex;align-items:stretch}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-logo{position:relative;width:auto;height:70px;margin-bottom:20px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-logo img{max-width:100%;max-height:100%;margin:auto 0;display:block}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text{font-family:"Roboto";margin:0 0 0 15px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text .c21-text-welcome{overflow:hidden;line-height:1.4em;max-height:3em;font-weight:200;font-size:2.5em;margin-bottom:15px}#chat21-home-component .c21-header .c21-header-container .c21-header-content .c21-text .c21-text-intro{display:inline-block;font-size:1.7em;font-weight:600;line-height:1.2em;max-height:2.4em}#chat21-home-component .c21-body{position:absolute;width:100%;height:calc(100% - 30px);padding:0;margin:0;overflow:auto;background-color:#fff;top:0;box-shadow:none}#chat21-home-component .c21-body .c21-body-content{position:relative;padding:180px 25px 20px;margin:0}#chat21-home-component .c21-body .c21-body-content.nologo{padding:180px 10px 20px}#chat21-home-component .c21-body .c21-body-content .c21-cards .c21-card-blank{width:0;height:0;position:absolute;margin:-8px 16px;border-radius:0;z-index:40;border-style:solid;border-width:0px 15px 15px 15px;border-color:transparent transparent #ffffff transparent}#chat21-home-component .c21-body .c21-body-content .c21-cards .c21-card{position:relative;margin-bottom:20px;background-color:#fff;border-radius:16px;font-size:1.4em;line-height:1.4;color:#1a1a1a;overflow:hidden;-webkit-box-shadow:0 4px 15px 0 rgba(0,0,0,.2),0 1px 2px 0 rgba(0,0,0,.2);z-index:20;text-align:left}#chat21-home-component .c21-footer{position:absolute;width:100%;height:40px;bottom:0px;display:flex;background-color:#fff;z-index:20}#chat21-home-component .c21-footer#c21-powered-by{display:block!important}#chat21-home-component .c21-footer .c21-powered-by{height:40px;text-align:center;padding:0;position:absolute;color:#aaa;top:0;left:20px;display:flex;align-items:center}#chat21-home-component .c21-footer .c21-powered-by a{text-decoration:none;cursor:pointer;display:inline-block;color:#aaa;font-size:1.1em;font-weight:500;line-height:22px;font-family:Mulish,sans-serif;letter-spacing:-.24px;-webkit-font-smoothing:antialiased}#chat21-home-component .c21-footer .c21-powered-by a span{display:inline-block;position:relative;top:2px}#chat21-home-component .c21-footer .c21-powered-by a img{width:80px;height:auto;max-height:40px;position:relative;vertical-align:middle;-o-object-fit:contain;object-fit:contain}#chat21-home-component .c21-footer .c21-powered-by b{font-weight:bolder}#chat21-home-component .c21-footer .build_version{display:none;font-size:1em;color:#aaa;position:absolute;bottom:0px;right:40px;line-height:30px}#chat21-home-component .c21-footer #c21-powered-by{width:calc(100% - 40px)}#chat21-home-component .c21-footer #c21-powered-by:hover div.build_version{display:block}@media (max-width: 451px){#tiledesk-container .c21-header-button.close{display:flex}}\n'],encapsulation:2}),i}(),Ni=["afallconv"],Fi=function(i,o){return{color:i,"background-image":o}},Un=function(i){return{fill:i}},Bi=function(i){return{color:i}},Ui=function(){function i(o,n,t){this.g=o,this.iterableDiffers=n,this.customTranslateService=t,this.onConversationSelected=new e.vpe,this.onCloseWidget=new e.vpe,this.convertMessage=Ft,this.subscriptions=[],this.logger=Ce.getInstance(),this.iterableDifferListConv=this.iterableDiffers.find([]).create(null),this.iterableDifferListArchivedConv=this.iterableDiffers.find([]).create(null)}return i.prototype.ngOnInit=function(){this.initialize()},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afallconv&&o.afallconv.nativeElement.focus()},1e3)},i.prototype.ngDoCheck=function(){var o=this.iterableDifferListConv.diff(this.listConversations),n=this.iterableDifferListArchivedConv.diff(this.archivedConversations);(o||n)&&this.concatAndOrderArray()},i.prototype.initTranslations=function(){this.translationMapConversation=this.customTranslateService.translateLanguage(["CLOSED"])},i.prototype.initialize=function(){this.logger.debug("[LISTALLCONVERSATIONS] initialize"),this.initTranslations(),this.LABEL_START_NW_CONV=this.g.LABEL_START_NW_CONV,this.allConversations=[],this.logger.debug("[LISTALLCONVERSATIONS] listconversations",this.listConversations,this.archivedConversations),this.concatAndOrderArray()},i.prototype.concatAndOrderArray=function(){var o,n,t;if(this.listConversations&&this.listConversations.length>0?t=this.archivedConversations&&this.archivedConversations.length>0?this.listConversations.concat(this.archivedConversations):this.listConversations:this.archivedConversations&&this.archivedConversations.length>0&&(t=this.archivedConversations),t){var r=[],a=new Map;try{for(var u=(0,_e.XA)(t),y=u.next();!y.done;y=u.next()){var j=y.value;a.has(j.uid)||(a.set(j.uid,!0),r.push(j))}}catch(J){o={error:J}}finally{try{y&&!y.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}this.allConversations=r,this.allConversations.sort(function(i,o){return void 0===o&&(o="asc"),function(n,t){if(!n.hasOwnProperty(i)||!t.hasOwnProperty(i))return 0;var r="string"==typeof n[i]?n[i].toUpperCase():n[i],a="string"==typeof t[i]?t[i].toUpperCase():t[i],u=0;return r>a?u=1:r<a&&(u=-1),"desc"===o?-1*u:u}}("timestamp","desc")),this.logger.debug("[LISTALLCONVERSATIONS] concatAndOrderArray ",this.allConversations)}},i.prototype.returnClosePage=function(){this.onCloseWidget.emit()},i.prototype.onConversationSelectedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] openConversationByID: ",o),o&&this.onConversationSelected.emit(o)},i.prototype.onImageLoadedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] onImageLoadedFN",o)},i.prototype.onConversationLoadedFN=function(o){this.logger.debug("[LISTALLCONVERSATIONS] onImageLoadedFN",o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[LISTALLCONVERSATIONS] ngOnDestroy ->list conv subscriptions",this.subscriptions)},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.allConversations=[],this.listConversations=[],this.archivedConversations=[]},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(e.ZZ4),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-list-all-conversations"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ni,5),2&n)&&(e.iGM(r=e.CRH())&&(t.afallconv=r.first))},inputs:{listConversations:"listConversations",archivedConversations:"archivedConversations",stylesMap:"stylesMap"},outputs:{onConversationSelected:"onConversationSelected",onCloseWidget:"onCloseWidget"},decls:21,vars:19,consts:[["id","c21-app-list-all-conversations"],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],[1,"c21-header-button","c21-right","c21-close"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["tabindex","1310","aria-label","indietro",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],["tabindex","1311","onFocus","document.querySelector('[start-focus]').focus()",1,"c21-body"],[3,"listConversations","stylesMap","translationMap","onConversationSelected","onImageLoaded","onConversationLoaded"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.O4$(),e.TgZ(5,"svg",5),e._UZ(6,"path",6),e._UZ(7,"path",7),e.TgZ(8,"title",8),e._uU(9),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"button",9),e.NdJ("click",function(){return t.returnClosePage()}),e.O4$(),e.TgZ(11,"svg",5),e._UZ(12,"path",6),e._UZ(13,"path",10),e.TgZ(14,"title",8),e._uU(15),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(16,"div",11),e.TgZ(17,"div",12),e._uU(18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"div",13),e.TgZ(20,"chat-list-conversations",14),e.NdJ("onConversationSelected",function(a){return t.onConversationSelectedFN(a)})("onImageLoaded",function(a){return t.onImageLoadedFN(a)})("onConversationLoaded",function(a){return t.onConversationLoadedFN(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngStyle",e.WLB(10,Fi,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(4),e.Q6J("ngStyle",e.VKq(13,Un,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.BUTTON_CLOSE_TO_ICON),e.xp6(2),e.Q6J("ngStyle",e.VKq(15,Un,t.g.themeForegroundColor)),e.xp6(4),e.Oqu(t.g.PREV_CONVERSATIONS),e.xp6(1),e.Q6J("ngStyle",e.VKq(17,Bi,t.g.themeForegroundColor)),e.xp6(2),e.Oqu(t.g.project.widgetTitle),e.xp6(2),e.Q6J("listConversations",t.allConversations)("stylesMap",t.stylesMap)("translationMap",t.translationMapConversation))},directives:[me.PC,Rn],styles:["#c21-app-list-all-conversations[_ngcontent-%COMP%]{display:block;height:auto;font-size:10px;background-color:#fff;width:100%;height:100%;position:relative;margin:0;padding:0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px;position:relative;margin:0;padding:0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;font-size:1em;line-height:40px;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{position:relative;height:52px;width:100%;margin:0 auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;bottom:3px;width:100%;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-pallozzo[_ngcontent-%COMP%]{display:inline}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:relative;display:block;width:100%;height:calc(100% - 52px);top:0px;font-size:1em;box-shadow:none;overflow:auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]{width:100%;height:auto;position:relative;margin:auto;padding:0;cursor:pointer;-webkit-appearance:initial;border:none;border-bottom:1px solid #eeeeee;background-color:#fff;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%]{width:auto;margin:0 24px;position:relative;display:flex;align-items:center;height:80px;text-align:left}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%]{width:auto;height:100%;float:left;display:flex;align-items:center}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:14px;color:#fff;font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-left-conv[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:2px 0 0;background-repeat:no-repeat;background-position:center;background-size:cover}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%]{width:calc(100% - 65px);margin-left:15px;height:auto;float:left;padding:17px 0}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-last-time[_ngcontent-%COMP%]{font-size:.8em;color:#aaa;float:right;display:block;padding:0;margin:0;width:auto;height:auto}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-name[_ngcontent-%COMP%]{font-weight:700;color:#3a3c4c;font-size:1.3em;line-height:1.7;min-height:20px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .c21-msg[_ngcontent-%COMP%]{font-weight:200;color:#3a3c4c;font-size:1.3em;line-height:1.7;max-height:21px}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%] .c21-body-conv[_ngcontent-%COMP%] .c21-right-conv[_ngcontent-%COMP%] .not-read.c21-msg[_ngcontent-%COMP%]{font-weight:500}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:hover, #c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:focus, #c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-item-conversation[_ngcontent-%COMP%]:active{background-color:#fafafa}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:40px;left:inherit;right:10px;width:10px;height:10px;min-width:10px;font-size:1.2em;line-height:10px;border-radius:50%;background-color:red;color:#fff;font-weight:bold;padding:0;text-align:center;margin-right:0;display:inline-block}#c21-app-list-all-conversations[_ngcontent-%COMP%] .c21-lablel-close[_ngcontent-%COMP%]{border:1px solid #e2e2e2;background-color:#ececec;padding:4px;border-radius:4px;position:absolute;right:0px;bottom:2px;margin-right:-10px;color:#858585;font-weight:500}"]}),i}(),Zi=function(){return function(o){this.createdAt=new Date,this.file=o}}(),Oe=ye(31041),Zn=ye(51868),Di=["chat21_file"],Dn=function(i,o,n){return{"background-color":i,"border-color":o,color:n}};function Hi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).onContinueConversation()}),e.TgZ(1,"span",11),e._uU(2),e.qZA(),e._UZ(3,"div",12),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("ngStyle",e.kEZ(2,Dn,t.stylesMap.get("themeColor"),t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.hij(" ",null==t.translationMap?null:t.translationMap.get("CONTINUE")," ")}}var zi=function(){return{fill:"yellow"}},ji=function(i){return{fill:i}};function qi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",5),e.TgZ(1,"button",6,7),e.NdJ("click",function(){return e.CHM(n),e.oxw().openNewConversation()}),e.TgZ(3,"span",8),e.O4$(),e.TgZ(4,"svg",9),e._UZ(5,"path",10),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",11),e._uU(7),e.qZA(),e._UZ(8,"div",12),e.qZA(),e.YNc(9,Hi,4,6,"button",13),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.kEZ(5,Dn,t.stylesMap.get("themeColor"),t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.Q6J("ngStyle",e.DdM(9,zi)),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,ji,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.hij(" ",null==t.translationMap?null:t.translationMap.get("LABEL_START_NW_CONV")," "),e.xp6(2),e.Q6J("ngIf",t.showContinueConversationButton)}}function Vi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.TgZ(1,"textarea",16,17),e.NdJ("ngModelChange",function(a){return e.CHM(n),e.oxw().textInputTextArea=a})("ngModelChange",function(){return e.CHM(n),e.oxw().onTextAreaChange()})("keypress",function(a){return e.CHM(n),e.oxw().onkeypress(a)})("keydown",function(a){return e.CHM(n),e.oxw().onkeydown(a)})("paste",function(a){return e.CHM(n),e.oxw().onPaste(a)}),e._uU(3),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.ekj("disabled",!(!t.isConversationArchived&&!t.hideTextReply)||null),e.xp6(1),e.Q6J("ngModel",t.textInputTextArea),e.uIk("disabled",!!t.hideTextReply||null)("placeholder",t.footerMessagePlaceholder?t.footerMessagePlaceholder:null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER")),e.xp6(2),e.hij(' \x3c!-- placeholder="',null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER"),'"> --\x3e\n ')}}var Wi=function(){return{display:"block",height:"1px",width:"1px",overflow:"hidden"}};function Yi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"label",29),e.TgZ(1,"span",8),e.O4$(),e.TgZ(2,"svg",30),e._UZ(3,"path",31),e.qZA(),e.qZA(),e.kcU(),e.TgZ(4,"input",32,33),e.NdJ("change",function(a){return e.CHM(n),e.oxw(2).detectFiles(a)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.ekj("active",!t.isFilePendingToUpload&&!t.hideTextReply),e.xp6(4),e.Q6J("accept",t.fileUploadAccept)("ngStyle",e.DdM(5,Wi)),e.uIk("disabled",!!(t.isFilePendingToUpload||t.isConversationArchived||t.hideTextReply)||null)}}function Gi(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",null,18),e.YNc(2,Yi,6,6,"label",19),e.TgZ(3,"div",20),e.NdJ("click",function(a){return e.CHM(n),e.oxw().onSendPressed(a)}),e.TgZ(4,"span",8),e.O4$(),e.TgZ(5,"svg",21),e._UZ(6,"path",22),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"label",23),e.NdJ("click",function(){return e.CHM(n),e.oxw().onEmojiiPickerClicked()}),e.TgZ(8,"span",8),e.O4$(),e.TgZ(9,"svg",24),e._UZ(10,"path",25),e._UZ(11,"circle",26),e._UZ(12,"circle",27),e._UZ(13,"path",28),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",1==t.showAttachmentButton),e.xp6(1),e.ekj("active",t.textInputTextArea&&!t.hideTextReply),e.xp6(4),e.ekj("active",!t.isFilePendingToUpload&&!t.hideTextReply)}}function Ji(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"emoji-mart",34),e.NdJ("emojiSelect",function(a){return e.CHM(n),e.oxw().addEmoji(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("showPreview",t.emojiiOptions.showPreview)("color",null==t.stylesMap?null:t.stylesMap.get("themeColor"))("perLine",t.emojiiOptions.emojiPerLine)("totalFrequentLines",t.emojiiOptions.totalFrequentLines)("enableSearch",t.emojiiOptions.enableSearch)("darkMode",t.emojiiOptions.darkMode)("include",t.emojiiOptions.include)}}var Hn=function(){function i(o,n,t,r){this.g=o,this.chatManager=n,this.typingService=t,this.uploadService=r,this.onEmojiiPickerShow=new e.vpe,this.onBeforeMessageSent=new e.vpe,this.onAfterSendMessage=new e.vpe,this.onChangeTextArea=new e.vpe,this.onAttachmentFileButtonClicked=new e.vpe,this.onNewConversationButtonClicked=new e.vpe,this.onBackButton=new e.vpe,this.isFilePendingToUpload=!1,this.arrayFilesLoad=[],this.isFileSelected=!1,this.HEIGHT_DEFAULT="20px",this.showEmojiPicker=!1,this.emojiiOptions={emojiPerLine:9,totalFrequentLines:1,showPreview:!1,darkMode:!1,enableSearch:!1,include:["recent","people","nature","activity"]},this.convertColorToRGBA=Ie,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){o.conversationWith&&void 0!==o.conversationWith.currentValue&&(this.conversationHandlerService=this.chatManager.getConversationHandlerByConversationId(this.conversationWith)),o.hideTextReply&&void 0!==o.hideTextReply.currentValue&&this.restoreTextArea()},i.prototype.ngAfterViewInit=function(){this.logger.debug("[CONV-FOOTER] --------ngAfterViewInit: conversation-footer-------- "),this.showEmojiPicker=!0},i.prototype.detectFiles=function(o){if(this.logger.debug("[CONV-FOOTER] detectFiles: ",o),o){this.selectedFiles=o.target.files,this.logger.debug("[CONV-FOOTER] AppComponent:detectFiles::selectedFiles",this.selectedFiles),this.isFilePendingToUpload=null!=this.selectedFiles,this.logger.debug("[CONV-FOOTER] AppComponent:detectFiles::selectedFiles::isFilePendingToUpload",this.isFilePendingToUpload),this.logger.debug("[CONV-FOOTER] fileChange: ",o.target.files),this.isFilePendingToUpload=!(o.target.files.length<=0);var n=this;if(o.target.files&&o.target.files[0]){var t=o.target.files[0].name,r=o.target.files[0].type,a=new FileReader;n.logger.debug("[CONV-FOOTER] OK preload: ",t,r,a),a.addEventListener("load",function(){if(n.logger.debug("[CONV-FOOTER] addEventListener load",a.result),n.isFileSelected=!0,r.startsWith("image")&&!r.includes("svg")){var u=new Image;n.logger.debug("[CONV-FOOTER] onload ",u),u.src=a.result.toString(),u.title=t,u.onload=function(){n.logger.debug("[CONV-FOOTER] onload image");var J=(new Date).getTime().toString(36);n.arrayFilesLoad[0]={uid:J,file:u,type:r},n.logger.debug("[CONV-FOOTER] OK: ",n.arrayFilesLoad[0]),n.loadFile()}}else{n.logger.debug("[CONV-FOOTER] onload file");var y={src:a.result.toString(),title:t},j=(new Date).getTime().toString(36);n.arrayFilesLoad[0]={uid:j,file:y,type:r},n.logger.debug("[CONV-FOOTER] OK: ",n.arrayFilesLoad[0]),n.loadFile()}},!1),o.target.files[0]&&(a.readAsDataURL(o.target.files[0]),n.logger.debug("[CONV-FOOTER] reader-result: ",o.target.files[0]))}}},i.prototype.loadFile=function(){if(this.logger.debug("[CONV-FOOTER] that.fileXLoad: ",this.arrayFilesLoad),this.arrayFilesLoad[0]&&this.arrayFilesLoad[0].file){var o=this.arrayFilesLoad[0].file,n=this.arrayFilesLoad[0].uid,t=this.arrayFilesLoad[0].type;this.logger.debug("[CONV-FOOTER] that.fileXLoad: ",t);var r;r=t.startsWith("image")&&!t.includes("svg")?{name:o.title,src:o.src,width:o.width,height:o.height,type:t,uid:n}:{name:o.title,src:o.src,type:t,uid:n},this.logger.debug("[CONV-FOOTER] metadata -------\x3e ",r);var a=this.selectedFiles.item(0);this.onAttachmentFileButtonClicked.emit({attachments:[{metadata:r,file:a}],message:this.textInputTextArea}),this.restoreTextArea(),this.chat21_file.nativeElement.value=""}},i.prototype.uploadSingle=function(o,n,t){var r=this;document.getElementById("chat21-start-upload-doc").disabled=!0,r.logger.debug("[CONV-FOOTER] AppComponent::uploadSingle::",o,n);var u=new Zi(n);this.uploadService.upload(this.senderId,u).then(function(y){r.logger.debug("[CONV-FOOTER] AppComponent::uploadSingle:: downloadURL",y),r.logger.debug("[CONV-FOOTER] Successfully uploaded file and got download link - "+y),o.src=y;var j=B,J="["+o.name+"]("+o.src+")";o.type.startsWith("image")&&!o.type.includes("svg")?(j=I,J=t):o.type.startsWith("image")&&o.type.includes("svg")||!o.type.startsWith("image")?(j=$,J=J+"\n"+t):o.type.startsWith("image")||(j=$,J=J+"\n"+t),r.sendMessage(J,j,o),r.chat21_file.nativeElement.value="",r.isFilePendingToUpload=!1}).catch(function(y){r.logger.error("[CONV-FOOTER] uploadSingle:: Failed to upload file and get link - "+y),r.isFilePendingToUpload=!1}),r.logger.debug("[CONV-FOOTER] reader-result: ",n)},i.prototype.sendMessage=function(o,n,t,r){var a,u,y,j;if(t=t||"",this.onEmojiiPickerShow.emit(!1),this.logger.debug("[CONV-FOOTER] SEND MESSAGE: ",o,n,t,r),o&&""!==o.trim()||n===I||n===$){var J=this.translationMap.get("GUEST_LABEL"),ie=this.attributes,ue={};if(ie)try{for(var ge=(0,_e.XA)(Object.entries(ie)),de=ge.next();!de.done;de=ge.next()){var ve=(0,_e.CR)(de.value,2);ue[ve[0]]=ve[1]}}catch(et){a={error:et}}finally{try{de&&!de.done&&(u=ge.return)&&u.call(ge)}finally{if(a)throw a.error}}if(r)try{for(var Ae=(0,_e.XA)(Object.entries(r)),Be=Ae.next();!Be.done;Be=Ae.next()){var Ze=(0,_e.CR)(Be.value,2);ue[Ze[0]]=Ze[1]}}catch(et){y={error:et}}finally{try{Be&&!Be.done&&(j=Ae.return)&&j.call(Ae)}finally{if(y)throw y.error}}var ze=this.senderId,je=this.projectid,Ye=this.channelType,ot=this.conversationWith;J=this.userFullname||this.userEmail||(ue&&ue.userFullname?ue.userFullname:this.translationMap.get("GUEST_LABEL")),this.onBeforeMessageSent.emit({senderFullname:J,text:o,type:n,metadata:t,conversationWith:ot,recipientFullname:J,attributes:ue,projectid:je,channelType:Ye});var tt=this.conversationHandlerService.sendMessage(o,n,t,ot,J,ze,J,Ye,ue);this.onAfterSendMessage.emit(tt);try{var dt=document.getElementById("chat21-main-message-context");dt.value="",dt.style.height=this.HEIGHT_DEFAULT}catch(et){this.logger.error("[CONV-FOOTER] > Error :"+et)}this.restoreTextArea()}},i.prototype.restoreTextArea=function(){this.resizeInputField();var o=document.getElementById("chat21-main-message-context");this.textInputTextArea="",o&&(o.value="",o.placeholder=this.translationMap.get("LABEL_PLACEHOLDER"),o.style.height>this.HEIGHT_DEFAULT&&document.getElementById("chat21-button-send").style.removeProperty("right"),this.logger.debug("[CONV-FOOTER] AppComponent:restoreTextArea::restoreTextArea::textArea:","restored")),this.setFocusOnId("chat21-main-message-context")},i.prototype.resizeInputField=function(){try{var o=document.getElementById("chat21-main-message-context");o&&(o.style.height="100%"),o&&"\n"===o.value?(o.value="",o.style.height=this.HEIGHT_DEFAULT):o&&o.scrollHeight>o.offsetHeight?(o.style.height=o.scrollHeight+2+"px",o.style.minHeight=this.HEIGHT_DEFAULT):o&&(o.style.height=this.HEIGHT_DEFAULT),this.onChangeTextArea.emit({textAreaEl:o,minHeightDefault:this.HEIGHT_DEFAULT})}catch(n){this.logger.error("[CONV-FOOTER] > Error :"+n)}},i.prototype.onTextAreaChange=function(){this.resizeInputField(),this.setWritingMessages(this.textInputTextArea)},i.prototype.onSendPressed=function(o){this.logger.debug("[CONV-FOOTER] onSendPressed:event",o),o.preventDefault(),this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:",this.isFilePendingToUpload),this.isFilePendingToUpload?(this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed","is a file"),this.loadFile(),this.isFilePendingToUpload=!1,this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed::isFilePendingToUpload:",this.isFilePendingToUpload)):this.textInputTextArea&&this.textInputTextArea.length>0&&(this.logger.debug("[CONV-FOOTER] AppComponent::onSendPressed","is a message"),""!==this.textInputTextArea.trim()&&this.sendMessage(this.textInputTextArea,B))},i.prototype.onEmojiiPickerClicked=function(){this.onEmojiiPickerShow.emit(!this.isEmojiiPickerShow)},i.prototype.addEmoji=function(o){this.onEmojiiPickerShow.emit(!1),this.textInputTextArea=this.textInputTextArea.trimStart()+o.emoji.native+" ",this.setFocusOnId("chat21-main-message-context")},i.prototype.openNewConversation=function(){this.onNewConversationButtonClicked.emit()},i.prototype.onContinueConversation=function(){this.hideTextAreaContent=!1,this.onBackButton.emit(!1),this.restoreTextArea()},i.prototype.onBackButtonFN=function(){this.onBackButton.emit(!1)},i.prototype.setFocusOnId=function(o){this.isMobile||setTimeout(function(){var n=document.getElementById(o);n&&(n.setAttribute("value"," "),n.focus())},500)},i.prototype.removeFocusOnId=function(o){var n=document.getElementById(o);n&&n.blur()},i.prototype.setWritingMessages=function(o){this.typingService.setTyping(this.conversationWith,o,this.senderId,this.userFullname)},i.prototype.onkeypress=function(o){var n=o.which||o.keyCode;this.textInputTextArea=document.getElementById("chat21-main-message-context").value,13===n?this.textInputTextArea&&""!==this.textInputTextArea.trim()&&this.sendMessage(this.textInputTextArea,B):9===n&&o.preventDefault()},i.prototype.onkeydown=function(o){(o.metaKey||o.shiftKey||o.altKey||o.ctrlKey)&&13===(o.which||o.keyCode)&&(o.preventDefault(),this.textInputTextArea+="\r\n",this.resizeInputField())},i.prototype.onPaste=function(o){var n,t;this.resizeInputField();var r=(o.clipboardData||o.originalEvent.clipboardData).items,a=null;this.logger.debug("[CONV-FOOTER] onPaste items ",r);try{for(var u=(0,_e.XA)(r),y=u.next();!y.done;y=u.next()){var j=y.value;if(this.logger.debug("[CONV-FOOTER] onPaste item ",j),this.logger.debug("[CONV-FOOTER] onPaste item.type ",j.type),j.type.startsWith("image")){try{this.restoreTextArea()}catch(ie){this.logger.error("[CONV-FOOTER] onPaste - error while restoring textArea:",ie)}this.logger.debug("[CONV-FOOTER] onPaste item.type",j.type),a=j.getAsFile();var J={target:new ClipboardEvent("").clipboardData||new DataTransfer};J.target.items.add(new File([a],a.name,{type:a.type})),this.logger.debug("[CONV-FOOTER] onPaste data",J),this.logger.debug("[CONV-FOOTER] onPaste file ",a),this.detectFiles(J)}}}catch(ie){n={error:ie}}finally{try{y&&!y.done&&(t=u.return)&&t.call(u)}finally{if(n)throw n.error}}},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Tt),e.Y36(ht),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-footer"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Di,5),2&n)&&(e.iGM(r=e.CRH())&&(t.chat21_file=r.first))},inputs:{conversationWith:"conversationWith",attributes:"attributes",senderId:"senderId",tenant:"tenant",projectid:"projectid",channelType:"channelType",userFullname:"userFullname",userEmail:"userEmail",showAttachmentButton:"showAttachmentButton",showContinueConversationButton:"showContinueConversationButton",isConversationArchived:"isConversationArchived",hideTextAreaContent:"hideTextAreaContent",hideTextReply:"hideTextReply",isMobile:"isMobile",isEmojiiPickerShow:"isEmojiiPickerShow",footerMessagePlaceholder:"footerMessagePlaceholder",fileUploadAccept:"fileUploadAccept",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onEmojiiPickerShow:"onEmojiiPickerShow",onBeforeMessageSent:"onBeforeMessageSent",onAfterSendMessage:"onAfterSendMessage",onChangeTextArea:"onChangeTextArea",onAttachmentFileButtonClicked:"onAttachmentFileButtonClicked",onNewConversationButtonClicked:"onNewConversationButtonClicked",onBackButton:"onBackButton"},features:[e.TTD],decls:5,vars:6,consts:[["id","floating-container","class","fade-in-bottom","start-focus-chat21-conversation-component","",4,"ngIf"],["class","visible-text-area",3,"disabled",4,"ngIf"],[4,"ngIf"],[1,"emoji-container"],["id","emoji-mart","class","emoji-mart",3,"showPreview","color","perLine","totalFrequentLines","enableSearch","darkMode","include","emojiSelect",4,"ngIf"],["id","floating-container","start-focus-chat21-conversation-component","",1,"fade-in-bottom"],["tabindex","1040","aflistconv","",1,"c21-button-primary",3,"ngStyle","click"],["aflistconv",""],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",3,"ngStyle"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],[1,"v-align-center","c21-label-button"],[1,"clear"],["tabindex","1040","class","c21-button-primary",3,"ngStyle","click",4,"ngIf"],["tabindex","1040",1,"c21-button-primary",3,"ngStyle","click"],[1,"visible-text-area"],["start-focus-chat21-conversation-component","","inputTextArea","","tabindex","1501","aria-labelledby","altTextArea","rows","1","id","chat21-main-message-context",1,"f21textarea","c21-button-clean",3,"ngModel","ngModelChange","keypress","keydown","paste"],["textbox",""],["div_attached",""],["tabindex","1502","aria-label","allegati","for","chat21-file","class","chat21-textarea-button","id","chat21-start-upload-doc",3,"active",4,"ngIf"],["tabindex","-1","id","chat21-button-send",1,"chat21-textarea-button",3,"click"],["xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","height","24","width","24","viewBox","0 0 24 24",0,"xml","space","preserve",2,"enable-background","new 0 0 24 24"],["d","M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"],["tabindex","1504","aria-label","emojii","for","chat21-emojii","id","chat21-emoticon-picker",1,"chat21-textarea-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 28 28"],["d","M0 0h24v24H0V0z","fill","none"],["cx","15.5","cy","9.5","r","1.5"],["cx","8.5","cy","9.5","r","1.5"],["d","M12 16c-1.48 0-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5s4.32-1.45 5.12-3.5h-1.67c-.7 1.19-1.97 2-3.45 2zm-.01-14C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"],["tabindex","1502","aria-label","allegati","for","chat21-file","id","chat21-start-upload-doc",1,"chat21-textarea-button"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 28 28","transform","rotate(45)"],["d","M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"],["tabindex","1503","type","file","aria-label","seleziona allegato","name","chat21-file","id","chat21-file",1,"inputfile",3,"accept","ngStyle","change"],["chat21_file",""],["id","emoji-mart",1,"emoji-mart",3,"showPreview","color","perLine","totalFrequentLines","enableSearch","darkMode","include","emojiSelect"]],template:function(n,t){1&n&&(e.YNc(0,qi,10,12,"div",0),e.YNc(1,Vi,4,6,"div",1),e.YNc(2,Gi,14,5,"div",2),e.TgZ(3,"div",3),e.YNc(4,Ji,1,7,"emoji-mart",4),e.qZA()),2&n&&(e.Q6J("ngIf",t.hideTextAreaContent),e.xp6(1),e.Q6J("ngIf",!t.hideTextAreaContent),e.xp6(1),e.Q6J("ngIf",!t.hideTextAreaContent),e.xp6(1),e.Udp("visibility",t.isEmojiiPickerShow?"visible":"hidden"),e.xp6(1),e.Q6J("ngIf",t.showEmojiPicker))},directives:[me.O5,me.PC,Oe.Fj,Oe.JJ,Oe.On,Zn.qP],styles:[".visible-text-area[_ngcontent-%COMP%]{pointer-events:auto;border-radius:16px;background-color:#f6f7fb}.visible-text-area.disabled[_ngcontent-%COMP%]{background-color:#e8e9ed}.chat21-textarea-button[_ngcontent-%COMP%]{fill:#5f6368;pointer-events:auto}#button[_ngcontent-%COMP%]{position:absolute;bottom:12px;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:1}#button.chat-open[_ngcontent-%COMP%]:not(.sidebar){right:5px;left:auto;background-color:#fff}#button[_ngcontent-%COMP%]:not(.sidebar) .buttonWave[_ngcontent-%COMP%]{position:absolute;z-index:-1;width:60px;height:60px}#button-body[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:28px;border-color:transparent;display:inherit;align-items:center;justify-content:center;pointer-events:initial;transition:all .2s ease-in-out 0s;position:relative;box-shadow:rgba(3,6,12,.5) 0 4px 10px}#chat21-buttonToBottom[_ngcontent-%COMP%]{display:flex;position:relative;margin-right:-25px;margin-top:-40px;float:right;width:30px;height:30px;border-radius:50%;z-index:1;cursor:pointer;background-color:#fff;border:1px solid rgba(191,191,191,.2);text-align:center}#chat21-buttonToBottom[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin:auto;fill:#aaa}#chat21-buttonToBottom[_ngcontent-%COMP%]:hover{background-color:#2a6ac1;opacity:1!important;transition:all .45s ease-in-out!important;-moz-transition:all .45s ease-in-out!important;-webkit-transition:all .45s ease-in-out!important;border:1px solid #ffffff}#chat21-buttonToBottom[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{fill:#fff}textarea[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]:visited, textarea[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:hover, textarea[_ngcontent-%COMP%]:active{all:unset}#chat21-main-message-context[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;resize:horizontal;overflow-y:auto;box-sizing:border-box;color:#1a1a1a;min-width:100%;outline:0;resize:none;font-size:1.4em;line-height:1.4em;font-weight:300;max-height:110px;min-height:auto;height:20px;padding:0 12px;margin:10px 0;border:none}#chat21-main-message-context[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#chat21-main-message-context[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#chat21-main-message-context[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}.chat21-textarea-button[_ngcontent-%COMP%]{position:absolute;display:block;height:56px;bottom:22px;opacity:.3;cursor:auto;cursor:initial}.chat21-textarea-button.active[_ngcontent-%COMP%]{opacity:1;cursor:pointer}.chat21-textarea-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:50%}.chat21-back-button[_ngcontent-%COMP%]{position:absolute;display:block;height:56px;cursor:pointer}.chat21-back-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]:hover{background:rgba(240,240,240,.4)!important;opacity:1!important;transition:all .45s ease-in-out 0s!important;-moz-transition:all .45s ease-in-out 0s!important;-webkit-transition:all .45s ease-in-out 0s!important;padding:0;margin:0;border-radius:50%}#chat21-button-send[_ngcontent-%COMP%]{right:8px;bottom:0}#chat21-file[_ngcontent-%COMP%]{left:8px;bottom:0}#chat21-emoticon-picker[_ngcontent-%COMP%]{left:36px;bottom:0}#chat21-start-upload-doc[_ngcontent-%COMP%], #chat21-start-mic[_ngcontent-%COMP%]{left:8px;bottom:0}#chat21-back-button[_ngcontent-%COMP%]{left:8px;bottom:0}#floating-container[_ngcontent-%COMP%]{width:100%;border-top:0px solid #eeeeee;display:inline-flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top;text-align:center}#floating-container[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{margin-left:8px;font-weight:400;font-size:1.2em}#floating-container[_ngcontent-%COMP%] .c21-button-primary[_ngcontent-%COMP%]{height:36px;margin:5px 3px}#floating-container[_ngcontent-%COMP%] .c21-waiting-time[_ngcontent-%COMP%]{font-size:1.3em;font-weight:200;padding:0 24px 5px}.fade-in-bottom[_ngcontent-%COMP%]{-webkit-animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s;animation:fade-in-bottom .5s cubic-bezier(.6,-.28,.735,.045) 0s}.emoji-container[_ngcontent-%COMP%]{height:312px;position:absolute;overflow:hidden;width:93%;bottom:100%;z-index:10;left:10px;box-shadow:0 -15px 20px -13px rgba(0,0,0,.38);-webkit-box-shadow:0px -15px 20px -13px rgba(0,0,0,.38)}.emoji-mart[_ngcontent-%COMP%]{position:absolute;border:none;margin:-2px -2px 0}"]}),i}();function Qi(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij("",n.nameUserTypingNow," ")}}function Ki(i,o){if(1&i&&(e.TgZ(0,"div",2),e.YNc(1,Qi,2,1,"span",3),e._uU(2),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngIf",n.nameUserTypingNow),e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("LABEL_WRITING"),"\n")}}function Xi(i,o){1&i&&(e.TgZ(0,"div",4),e._UZ(1,"div",5),e._UZ(2,"div",6),e._UZ(3,"div",7),e.qZA())}var zn=function(){function i(o){this.elementRef=o,this.typingLocation="content"}return i.prototype.ngOnInit=function(){this.elementRef.nativeElement.style.setProperty("--bubbleReceivedBackgroundColor",this.color)},i.prototype.ngOnDestroy=function(){},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["user-typing"]],inputs:{typingLocation:"typingLocation",translationMap:"translationMap",color:"color",idUserTypingNow:"idUserTypingNow",nameUserTypingNow:"nameUserTypingNow"},decls:2,vars:2,consts:[["class","tile-typing-now",4,"ngIf"],["class","spinner",4,"ngIf"],[1,"tile-typing-now"],[4,"ngIf"],[1,"spinner"],[1,"bounce1"],[1,"bounce2"],[1,"bounce3"]],template:function(n,t){1&n&&(e.YNc(0,Ki,3,2,"div",0),e.YNc(1,Xi,4,0,"div",1)),2&n&&(e.Q6J("ngIf","header"===t.typingLocation),e.xp6(1),e.Q6J("ngIf","content"===t.typingLocation))},directives:[me.O5],styles:["[_ngcontent-%COMP%]:root{--bubbleReceivedBackgroundColor: $blue;--foregroundColor: $bck-msg-sent}.tile-typing-now[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:$bck-msg-sent;color:var(--foregroundColor)}#tile-spinner[_ngcontent-%COMP%]{position:relative;left:0;top:0;margin:0}#tile-spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:6px;height:6px;background-color:var(--basic-blue)}.spinner[_ngcontent-%COMP%]{margin:15px 10px;width:70px;min-height:20px;display:block}.spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:9px;height:9px;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}.spinner[_ngcontent-%COMP%] .bounce1[_ngcontent-%COMP%]{-webkit-animation-delay:-.32s;animation-delay:-.32s;background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor)}.spinner[_ngcontent-%COMP%] .bounce2[_ngcontent-%COMP%]{-webkit-animation-delay:-.16s;animation-delay:-.16s;background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor);opacity:.4}.spinner[_ngcontent-%COMP%] .bounce3[_ngcontent-%COMP%]{background-color:$blue;background-color:var(--bubbleReceivedBackgroundColor);opacity:.6}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}"]}),i}(),$i=ye(82051),jn=function(i,o){return{width:i,height:o}};function er(i,o){if(1&i&&e._UZ(0,"div",4),2&i){var n=e.oxw();e.Q6J("ngStyle",e.WLB(1,jn,n.width,n.height))}}function tr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Oqu(n.tooltipMessage)}}var nr=function(i){return{isLoadingImage:i}},qn=function(){function i(){this.onElementRendered=new e.vpe,this.loading=!0,this.tooltipOptions={"show-delay":0,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.popupUrl=Ht}return i.prototype.ngOnInit=function(){},i.prototype.onLoaded=function(o){this.loading=!1,this.onElementRendered.emit({element:"image",status:!0})},i.prototype.downloadImage=function(o,n){console.log("Image COMP - IMAGE URL ",o),console.log("Image COMP - IMAGE FILENAME ",n),n||(n=decodeURIComponent(decodeURIComponent(o).split("/").pop())),(0,$i.saveAs)(o,n)},i.prototype.onClickImage=function(){},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-image"]],inputs:{metadata:"metadata",width:"width",height:"height"},outputs:{onElementRendered:"onElementRendered"},decls:5,vars:9,consts:[[1,"c21-img-container"],["class","loader",3,"ngStyle",4,"ngIf"],[1,"message-contentX","message-content-imageX",3,"ngClass","ngStyle","src","load","click"],["timeTooltipRight",""],[1,"loader",3,"ngStyle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,er,1,4,"div",1),e.TgZ(2,"img",2),e.NdJ("load",function(a){return t.onLoaded(a)})("click",function(){return t.downloadImage(t.metadata.src,t.metadata.name)}),e.qZA(),e.YNc(3,tr,2,1,"ng-template",null,3,e.W1O),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngIf",t.loading),e.xp6(1),e.Q6J("ngClass",e.VKq(4,nr,t.loading))("ngStyle",e.WLB(6,jn,t.width,t.height))("src",t.metadata.src,e.LSH))},directives:[me.O5,me.mk,me.PC],styles:["[_nghost-%COMP%]{--borderRadius: 8px}img[_ngcontent-%COMP%]{border-radius:var(--borderRadius);margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover;transition:transform .3s ease-in-out 0s}.c21-img-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}.c21-img-container[_ngcontent-%COMP%]{text-align:center;width:100%;overflow:hidden;border-radius:var(--borderRadius)}.demo-content[_ngcontent-%COMP%]{position:relative}.isLoadingImage[_ngcontent-%COMP%]{display:none}.loader[_ngcontent-%COMP%]{float:left;z-index:1000;border-radius:var(--borderRadius);background-image:linear-gradient(90deg,transparent 0px,#e8e8e8 40px,transparent 80px);background-size:600px;-webkit-animation:shine-loader 1.6s infinite linear;animation:shine-loader 1.6s infinite linear}@-webkit-keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}@keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}"]}),i}(),or=function(i,o){return{width:i,height:o}};function ir(i,o){if(1&i&&e._UZ(0,"div",3),2&i){var n=e.oxw();e.Q6J("ngStyle",e.WLB(1,or,n.width,n.height))}}var rr=function(i,o){return{"max-width":"100%",width:i,height:o}},ar=function(i){return{isLoadingImage:i}},sr=function(){function i(o){this.sanitizer=o,this.onElementRendered=new e.vpe,this.url=null,this.loading=!0}return i.prototype.ngOnInit=function(){this.metadata&&this.metadata.src&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(this.metadata.src))},i.prototype.ngOnDestroy=function(){this.url=null},i.prototype.onLoaded=function(o){this.loading=!1,this.onElementRendered.emit({element:"frame",status:!0})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-frame"]],inputs:{metadata:"metadata",width:"width",height:"height"},outputs:{onElementRendered:"onElementRendered"},decls:3,vars:9,consts:[[3,"ngStyle"],["class","loader",3,"ngStyle",4,"ngIf"],["allowfullscreen","","width","100%","height","100%",3,"ngClass","src","load"],[1,"loader",3,"ngStyle"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,ir,1,4,"div",1),e.TgZ(2,"iframe",2),e.NdJ("load",function(a){return t.onLoaded(a)}),e.qZA(),e.qZA()),2&n&&(e.Q6J("ngStyle",e.WLB(4,rr,t.width,t.height)),e.xp6(1),e.Q6J("ngIf",t.loading),e.xp6(1),e.Q6J("ngClass",e.VKq(7,ar,t.loading))("src",t.url,e.uOi))},directives:[me.PC,me.O5,me.mk],styles:["[_nghost-%COMP%]{--borderRadius: 8px}.loader[_ngcontent-%COMP%]{float:left;z-index:1000;border-radius:var(--borderRadius);background-image:linear-gradient(90deg,transparent 0px,#e8e8e8 40px,transparent 80px);background-size:600px;-webkit-animation:shine-loader 1.6s infinite linear;animation:shine-loader 1.6s infinite linear}.isLoadingImage[_ngcontent-%COMP%]{display:none}iframe[_ngcontent-%COMP%]{border:none;border-radius:var(--borderRadius)}@-webkit-keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}@keyframes shine-loader{0%{background-position:-32px}40%,to{background-position:208px}}"]}),i}(),Kt=ye(95166),kt=ye(4765),Xt=function(){function i(){}return i.prototype.transform=function(o){var n=new kt.TU.Renderer;return n.link=function(r,a,u){return kt.TU.Renderer.prototype.link.call(this,r,a,u).replace("<a",'<a target="_blank" ')},kt.TU.setOptions({renderer:n}),o&&o.length>0?(0,kt.TU)(o):o},i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=e.Yjl({name:"marked",type:i,pure:!0}),i}(),Vn=function(){function i(){}return i.prototype.transform=function(o,n){return(o=function(i){return i.replace(/[\n\r]/g,"<br>")}(o=function(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}(o))).trim()},i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=e.Yjl({name:"htmlEntitiesEncode",type:i,pure:!0}),i}(),lr=function(){function i(){this.htmlEnabled=!1,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe}return i.prototype.ngOnInit=function(){},i.prototype.printMessage=function(o,n,t){var r={messageEl:n,component:t};this.onBeforeMessageRender.emit(r);var a=o;return this.onAfterMessageRender.emit(r),a},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-text"]],inputs:{text:"text",htmlEnabled:"htmlEnabled",color:"color",fontSize:"fontSize",fontFamily:"fontFamily"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender"},decls:4,vars:9,consts:[[1,"message_innerhtml","marked",3,"innerHTML"],["messageEl",""]],template:function(n,t){if(1&n&&(e._UZ(0,"p",0,1),e.ALo(2,"marked"),e.ALo(3,"htmlEntitiesEncode")),2&n){var r=e.MAs(1);e.Udp("color",t.color)("font-size",t.fontSize),e.Q6J("innerHTML",e.lcZ(2,5,e.lcZ(3,7,t.printMessage(t.text,r,t))),e.oJD)}},pipes:[Xt,Vn],styles:[".message_innerhtml[_ngcontent-%COMP%]{margin:0}.message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}p[_ngcontent-%COMP%]{font-size:1.4em;margin:0;padding:14px;line-height:1.4em;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}"]}),i}(),cr=function(){function i(o){this.sanitizer=o}return i.prototype.transform=function(o,n){return this.sanitizer.bypassSecurityTrustHtml(o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7,16))},i.\u0275pipe=e.Yjl({name:"safeHtml",type:i,pure:!0}),i}(),ur=["htmlCode"],hr=function(){function i(o){this.elementRef=o}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.style.setProperty("--buttonFontSize",this.fontSize),this.themeColor&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.themeColor),this.foregroundColor&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.foregroundColor)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-html"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(ur,5),2&n)&&(e.iGM(r=e.CRH())&&(t.container=r.first))},inputs:{htmlText:"htmlText",fontSize:"fontSize",themeColor:"themeColor",foregroundColor:"foregroundColor"},features:[e.TTD],decls:3,vars:3,consts:[["id","htmlCode",3,"innerHTML"],["htmlCode",""]],template:function(n,t){1&n&&(e._UZ(0,"div",0,1),e.ALo(2,"safeHtml")),2&n&&e.Q6J("innerHTML",e.lcZ(2,1,t.htmlText),e.oJD)},pipes:[cr],styles:['[_ngcontent-%COMP%]:root{--themeColor: #2a6ac1;--foregroundColor: #ffffff;--buttonFontSize: 15px} .button-html{padding:8px 16px!important;position:relative;max-width:300px;min-width:inherit;cursor:pointer!important;border:1px solid #2a6ac1;border:1px solid var(--themeColor);border-radius:20px;margin:3px;background:transparent;overflow:hidden;font-family:"Muli",sans-serif!important;font-size:15px!important;font-size:var(--buttonFontSize)!important;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:#2a6ac1;color:var(--themeColor);line-height:16px} .url{transition:background-color .6s ease} .url .icon-button-action{position:absolute;top:-1px;right:1px} .url .icon-button-action svg{fill:#2a6ac1;fill:var(--themeColor)} .url .icon-button-action-self{position:absolute;right:1px} .url .icon-button-action-self svg{fill:#2a6ac1;fill:var(--themeColor)} .url:focus, .url:hover{color:#fff;background:#2a6ac1;background:var(--themeColor)} .url:focus .icon-button-action svg, .url:focus .icon-button-action-self svg, .url:hover .icon-button-action svg, .url:hover .icon-button-action-self svg{fill:#fff} .url:active{font-size:20px} .text-html{font-size:1.4em;margin:0;padding:8px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}']}),i}(),pr=function(i){return{margin:i}};function dr(i,o){if(1&i&&(e.TgZ(0,"div",4),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.Udp("color",n.convertColorToRGBA(n.fontColor,65)),e.Q6J("ngStyle",e.VKq(4,pr,n.isImage(n.message)||n.isFrame(n.message)?"10px 16px 8px 16px":"10px 8px 0px 8px")),e.xp6(1),e.hij(" ",null==n.message?null:n.message.sender_fullname," ")}}function gr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-image",5),e.NdJ("onElementRendered",function(a){return e.CHM(n),e.oxw().onElementRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.message.metadata)("width",null==t.sizeImage?null:t.sizeImage.width)("height",null==t.sizeImage?null:t.sizeImage.height)}}function fr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-frame",5),e.NdJ("onElementRendered",function(a){return e.CHM(n),e.oxw().onElementRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.message.metadata)("width",null==t.sizeImage?null:t.sizeImage.width)("height",null==t.sizeImage?null:t.sizeImage.height)}}function mr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"amTimeAgo"),e.ALo(3,"amDateFormat"),e.ALo(4,"amLocal"),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.AsE("",e.lcZ(2,2,n.message.timestamp)," (",e.xi3(3,4,e.lcZ(4,7,n.message.timestamp),"L HH:mm:ss"),")")}}function vr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-text",10),e.NdJ("onBeforeMessageRender",function(a){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(a)})("onAfterMessageRender",function(a){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(a)}),e.qZA()}if(2&i){var t=e.oxw(2);e.Q6J("text",null==t.message?null:t.message.text)("color",t.fontColor)("fontSize",t.fontSize)("fontFamily",t.fontFamily)}}function br(i,o){if(1&i&&e._UZ(0,"chat-html",11),2&i){var n=e.oxw(2);e.Q6J("htmlText",null==n.message?null:n.message.text)("fontSize",n.stylesMap.get("buttonFontSize"))("themeColor",n.stylesMap.get("themeColor"))("foregroundColor",n.stylesMap.get("foregroundColor"))}}function _r(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",6),e.NdJ("click",function(u){return e.CHM(n),e.oxw().handleTooltipEvents(u)}),e.YNc(1,mr,5,9,"ng-template",null,7,e.W1O),e.YNc(3,vr,1,4,"chat-text",8),e.YNc(4,br,1,4,"chat-html",9),e.qZA()}if(2&i){var t=e.MAs(2),r=e.oxw();e.Q6J("tooltip",t)("options",r.tooltipOptions),e.xp6(3),e.Q6J("ngIf","html"!==(null==r.message?null:r.message.type)),e.xp6(1),e.Q6J("ngIf","html"===(null==r.message?null:r.message.type))}}var Cr=function(i){return{padding:i}},yr=function(){function i(o){this.sanitizer=o,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onElementRendered=new e.vpe,this.isImage=qt,this.isFile=So,this.isFrame=wn,this.convertColorToRGBA=Ie,this.messageType=Xe,this.MESSAGE_TYPE_MINE=V,this.MESSAGE_TYPE_OTHERS=Q,this.tooltipOptions={"show-delay":500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(){this.message&&this.message.metadata&&"object"==typeof this.message.metadata&&(this.sizeImage=this.getMetadataSize(this.message.metadata))},i.prototype.getMetadataSize=function(o){var n={width:o.width,height:o.height};if(o.width&&o.width<We)if(o.width<=55){var t=o.width/o.height;n.width=130,n.height=130/t}else o.width>55&&(n.width=o.width,n.height=o.height);else o.width&&o.width>We&&(t=o.width/o.height,n.width=We,n.height=We/t);return n},i.prototype.handleTooltipEvents=function(o){var n=this;setTimeout(function(){try{var r=document.getElementsByClassName("chat-tooltip");if(r){var a=r[0];a.classList.contains("tooltip-show")||a.classList.add("tooltip-show"),setTimeout(function(){a.classList.contains("tooltip-show")&&a.classList.remove("tooltip-show")},n.tooltipOptions.hideDelayAfterClick)}}catch(u){n.logger.error("[BUBBLE-MESSAGE] handleTooltipEvents >>>> Error :"+u)}},this.tooltipOptions.showDelay)},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit({message:this.message,sanitizer:this.sanitizer,messageEl:o.messageEl,component:o.component})},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit({message:this.message,sanitizer:this.sanitizer,messageEl:o.messageEl,component:o.component})},i.prototype.onElementRenderedFN=function(o){this.onElementRendered.emit({element:o.element,status:o.status})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-bubble-message"]],inputs:{message:"message",isSameSender:"isSameSender",fontColor:"fontColor",fontSize:"fontSize",fontFamily:"fontFamily",stylesMap:"stylesMap"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onElementRendered:"onElementRendered"},features:[e.TTD],decls:6,vars:7,consts:[[1,"messages","primary-color",3,"ngStyle"],["class","message_sender_fullname",3,"color","ngStyle",4,"ngIf"],[3,"metadata","width","height","onElementRendered",4,"ngIf"],["placement","left","contentType","template",3,"tooltip","options","click",4,"ngIf"],[1,"message_sender_fullname",3,"ngStyle"],[3,"metadata","width","height","onElementRendered"],["placement","left","contentType","template",3,"tooltip","options","click"],["timeTooltipLeft",""],[3,"text","color","fontSize","fontFamily","onBeforeMessageRender","onAfterMessageRender",4,"ngIf"],[3,"htmlText","fontSize","themeColor","foregroundColor",4,"ngIf"],[3,"text","color","fontSize","fontFamily","onBeforeMessageRender","onAfterMessageRender"],[3,"htmlText","fontSize","themeColor","foregroundColor"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div"),e.YNc(2,dr,2,6,"div",1),e.YNc(3,gr,1,3,"chat-image",2),e.YNc(4,fr,1,3,"chat-frame",2),e.YNc(5,_r,5,4,"div",3),e.qZA(),e.qZA()),2&n&&(e.Q6J("ngStyle",e.VKq(5,Cr,t.isImage(t.message)||t.isFrame(t.message)?"0 0px":"0 8px")),e.xp6(2),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_OTHERS,t.message)&&!t.isSameSender),e.xp6(1),e.Q6J("ngIf",t.isImage(t.message)),e.xp6(1),e.Q6J("ngIf",t.isFrame(t.message)),e.xp6(1),e.Q6J("ngIf",null==t.message?null:t.message.text))},directives:[me.PC,me.O5,qn,sr,Kt.i9,lr,hr],pipes:[$e.eG,$e.Ek,$e.Bs],styles:[".messages[_ngcontent-%COMP%]{border-radius:20px;padding:0;word-wrap:break-word}.messages[_ngcontent-%COMP%] .message_sender_fullname[_ngcontent-%COMP%]{font-size:12px;font-weight:600}.messages[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:20px;padding:3px;margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover}.messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{margin:0}.messages[_ngcontent-%COMP%] .message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}"]}),i}();function wr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",6),e._UZ(8,"path",7),e._UZ(9,"path",8),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function Or(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function Mr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function xr(i,o){1&i&&(e.TgZ(0,"div",2),e.O4$(),e.TgZ(1,"svg",3),e.TgZ(2,"defs"),e.TgZ(3,"style"),e._uU(4,".cls-1{fill:none;}"),e.qZA(),e.qZA(),e.TgZ(5,"g",4),e.TgZ(6,"g",5),e._UZ(7,"path",7),e._UZ(8,"path",10),e.qZA(),e.qZA(),e.qZA(),e.qZA())}var Er=function(){function i(){this.MSG_STATUS_SENT=100,this.MSG_STATUS_SENT_SERVER=150,this.MSG_STATUS_RETURN_RECEIPT=250}return i.prototype.ngOnInit=function(){},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-return-receipt"]],inputs:{status:"status"},decls:5,vars:4,consts:[[1,"status-message"],["class","icon",4,"ngIf"],[1,"icon"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 18 18"],["id","Livello_2","data-name","Livello 2"],["id","Livello_1-2","data-name","Livello 1"],["d","M9,1.5A7.5,7.5,0,1,0,16.5,9,7.5,7.5,0,0,0,9,1.5ZM9,15a6,6,0,1,1,6-6A6,6,0,0,1,9,15Z"],["d","M0,0H18V18H0Z",1,"cls-1"],["d","M9.38,5.25H8.25v4.5l3.94,2.36.56-.92-3.37-2Z"],["d","M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"],["d","M13.5,5.25,12.44,4.19,7.69,8.95,8.74,10Zm3.18-1.06L8.74,12.13,5.61,9,4.55,10.06l4.19,4.19,9-9ZM.31,10.06,4.5,14.25l1.06-1.06L1.37,9Z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.YNc(1,wr,10,0,"div",1),e.YNc(2,Or,9,0,"div",1),e.YNc(3,Mr,9,0,"div",1),e.YNc(4,xr,9,0,"div",1),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngIf",!t.status),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_SENT),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_SENT_SERVER),e.xp6(1),e.Q6J("ngIf",t.status==t.MSG_STATUS_RETURN_RECEIPT))},directives:[me.O5],styles:[".status-message[_ngcontent-%COMP%]{width:16px;height:16px;margin-left:4px}.status-message[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:13px;height:13px;background-repeat:no-repeat;background-position:center;background-size:cover;overflow-x:hidden}.status-message[_ngcontent-%COMP%] .c21-ico-schedule[_ngcontent-%COMP%]{background-image:url(f21ico-schedule.svg)}.status-message[_ngcontent-%COMP%] .c21-ico-done[_ngcontent-%COMP%]{background-image:url(f21ico-done.svg)}.status-message[_ngcontent-%COMP%] .c21-ico-done_all[_ngcontent-%COMP%]{background-image:url(f21ico-done_all.svg)}"]}),i}();function Tr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"img",3),e.NdJ("error",function(a){return e.CHM(n),e.oxw().onBotImgError(a)})("load",function(a){return e.CHM(n),e.oxw().onLoadedBot(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("src",t.url,e.LSH)}}function Sr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"img",3),e.NdJ("error",function(a){return e.CHM(n),e.oxw().onHumanImgError(a)})("load",function(a){return e.CHM(n),e.oxw().onLoadedHuman(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("src",t.url,e.LSH)}}var Wn=function(){function i(o){this.imageRepoService=o}return i.prototype.ngOnInit=function(){var o=this;if(this.senderID){-1!==this.senderID.indexOf("bot_")||this.senderFullname.toLowerCase().includes("bot")?this.url=this.baseLocation+"/assets/images/tommy_bot_tiledesk.svg":-1==this.senderID.indexOf("bot_")&&(this.url=this.baseLocation+"/assets/images/chat_human_avatar.svg");var n=this.imageRepoService.getImagePhotoUrl(this.senderID);this.checkImageExists(n,function(t){t&&(o.url=n)})}},i.prototype.onBotImgError=function(o){o.target.src=this.baseLocation+"/assets/images/tommy_bot_tiledesk.svg"},i.prototype.onHumanImgError=function(o){o.target.src=this.baseLocation+"/assets/images/chat_human_avatar.svg"},i.prototype.onLoadedBot=function(o){},i.prototype.onLoadedHuman=function(o){},i.prototype.checkImageExists=function(o,n){var t=new Image;t.onload=function(){n(!0)},t.onerror=function(){n(!1)},t.src=o},i.\u0275fac=function(n){return new(n||i)(e.Y36(st))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-avatar-image"]],inputs:{senderID:"senderID",senderFullname:"senderFullname",baseLocation:"baseLocation"},decls:4,vars:2,consts:[[1,"c21-icon-avatar"],[1,"c21-avatar-image","profile_image"],[3,"src","error","load",4,"ngIf"],[3,"src","error","load"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Tr,1,1,"img",2),e.YNc(3,Sr,1,1,"img",2),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngIf",-1!==(null==t.senderID?null:t.senderID.indexOf("bot_"))||t.senderFullname.toLowerCase().includes("bot")),e.xp6(1),e.Q6J("ngIf",-1===(null==t.senderID?null:t.senderID.indexOf("bot_"))&&!t.senderFullname.toLowerCase().includes("bot")))},directives:[me.O5],styles:[".c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%;display:flex;align-items:center;justify-content:center}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}.c21-pallozzo[_ngcontent-%COMP%]{display:inline}.c21-ball[_ngcontent-%COMP%]{position:relative;width:52px;height:52px;border-radius:50%;display:inline-flex;align-items:center;text-align:center;margin:0 0 0 -10px}.c21-ball[_ngcontent-%COMP%] .c21-ball-label[_ngcontent-%COMP%]{color:#fff;margin:auto;font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:500}.c21-ball[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}"]}),i}();function Pr(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"amTimeAgo"),e.ALo(3,"amDateFormat"),e.ALo(4,"amLocal"),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.AsE("",e.lcZ(2,2,n.message.timestamp)," (",e.xi3(3,4,e.lcZ(4,7,n.message.timestamp),"L HH:mm:ss"),")")}}var kr=function(){function i(){this.logger=Ce.getInstance(),this.tooltipOptions={"show-delay":500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200}}return i.prototype.ngOnInit=function(){this.logger.debug("[INFO-COMP] message ",this.message),this.message&&this.message.text&&(this.message.text=this.message.text.replace(/<br\s*[\/]?>/gi,"\n"),this.logger.debug("[INFO-COMP] message .text ",this.message.text))},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-info-message"]],inputs:{message:"message"},decls:14,vars:5,consts:[[1,"info-container"],[1,"spinner"],[1,"bounce3"],[1,"bounce2"],[1,"bounce1"],["placement","left","contentType","template",1,"base_info",3,"innerHTML","options","tooltip"],["timeTooltipLeft",""]],template:function(n,t){if(1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"div",2),e._UZ(3,"div",3),e._UZ(4,"div",4),e.qZA(),e.TgZ(5,"div"),e._UZ(6,"span",5),e.ALo(7,"marked"),e.YNc(8,Pr,5,9,"ng-template",null,6,e.W1O),e.qZA(),e.TgZ(10,"div",1),e._UZ(11,"div",4),e._UZ(12,"div",3),e._UZ(13,"div",2),e.qZA(),e.qZA()),2&n){var r=e.MAs(9);e.xp6(6),e.Q6J("innerHTML",e.lcZ(7,3,null==t.message?null:t.message.text),e.oJD)("options",t.tooltipOptions)("tooltip",r)}},directives:[Kt.i9],pipes:[Xt,$e.eG,$e.Ek,$e.Bs],styles:[".info-container[_ngcontent-%COMP%]{display:flex;align-content:center;justify-content:center;padding:4px 0 2px}.base_info[_ngcontent-%COMP%]{border-radius:14px;padding:6px 10px;display:inline-block;background:rgba(24,119,242,.1);font-size:10px;color:#666;margin-left:5px;margin-right:5px}.base_info[_ngcontent-%COMP%] >p{margin-top:0!important;margin-bottom:0!important}.spinner[_ngcontent-%COMP%]{width:45px;min-height:100%;margin:auto 0}.spinner[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:10px;height:10px;background-color:#333;border-radius:100%;display:inline-block;margin:0 2px}.spinner[_ngcontent-%COMP%] .bounce1[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1)}.spinner[_ngcontent-%COMP%] .bounce2[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1);opacity:.6}.spinner[_ngcontent-%COMP%] .bounce3[_ngcontent-%COMP%]{background-color:rgba(24,119,242,.1);opacity:.4}"]}),i}(),Ar=function(i){return{disabled:i}},Ir=function(){function i(o){this.elementRef=o,this.onButtonClicked=new e.vpe,this.type="text"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".text").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonText=function(){this.onButtonClicked.emit({target:this,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-text-button-attachment"]],inputs:{button:"button",isConversationArchived:"isConversationArchived",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:2,vars:5,consts:[[1,"button-in-msg","text",3,"ngClass","title","click","mouseover","mouseout"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.actionButtonText()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e._uU(1),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.Q6J("ngClass",e.VKq(3,Ar,t.isConversationArchived)),e.xp6(1),e.hij(" ",null==t.button?null:t.button.value,"\n"))},directives:[me.mk],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.text[_ngcontent-%COMP%]{transition:background-color .6s ease}.text[_ngcontent-%COMP%]:focus, .text[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.text[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .text[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#1a1a1a}.disabled[_ngcontent-%COMP%]{pointer-events:none}']}),i}();function Rr(i,o){1&i&&(e.TgZ(0,"span",4),e.O4$(),e.TgZ(1,"svg",5),e._UZ(2,"path",6),e._UZ(3,"path",7),e.qZA(),e.qZA())}function Lr(i,o){1&i&&(e.TgZ(0,"span",8),e.O4$(),e.TgZ(1,"svg",9),e._UZ(2,"path",6),e._UZ(3,"path",7),e.qZA(),e.qZA())}var Nr=function(){function i(o){this.elementRef=o,this.onButtonClicked=new e.vpe,this.type="url"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".url").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonUrl=function(){this.button&&this.button.link&&""!==this.button.link&&this.onButtonClicked.emit({target:this,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-link-button-attachment"]],inputs:{button:"button",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:5,vars:4,consts:[[1,"button-in-msg","url",3,"title","click","mouseover","mouseout"],["class","icon-button-action",4,"ngIf"],["class","icon-button-action-self",4,"ngIf"],[1,"clear"],[1,"icon-button-action"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","black","width","18px","height","18px",2,"transform","rotateZ(45deg)"],["d","M0 0h24v24H0z","fill","none"],["d","M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"],[1,"icon-button-action-self"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","black","width","18px","height","18px",2,"transform","rotateZ(90deg)"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.actionButtonUrl()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e.YNc(1,Rr,4,0,"span",1),e.YNc(2,Lr,4,0,"span",2),e._uU(3),e._UZ(4,"div",3),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.xp6(1),e.Q6J("ngIf","self"!==(null==t.button?null:t.button.target)),e.xp6(1),e.Q6J("ngIf","self"===(null==t.button?null:t.button.target)),e.xp6(1),e.hij(" ",null==t.button?null:t.button.value," "))},directives:[me.O5],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.url[_ngcontent-%COMP%]{transition:background-color .6s ease}.url[_ngcontent-%COMP%] .icon-button-action[_ngcontent-%COMP%]{position:absolute;top:-1px;right:1px}.url[_ngcontent-%COMP%] .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--textColor)}.url[_ngcontent-%COMP%] .icon-button-action-self[_ngcontent-%COMP%]{position:absolute;right:1px}.url[_ngcontent-%COMP%] .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--textColor)}.url[_ngcontent-%COMP%]:focus, .url[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.url[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:focus .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .url[_ngcontent-%COMP%]:hover .icon-button-action-self[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--hoverTextColor)}']}),i}(),Fr=function(i){return{disabled:i}},Br=function(){function i(o){this.elementRef=o,this.isConversationArchived=!0,this.onButtonClicked=new e.vpe,this.type="action"}return i.prototype.ngOnInit=function(){},i.prototype.ngOnChanges=function(o){this.fontSize&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--buttonFontSize",this.fontSize),this.backgroundColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--backgroundColor",this.backgroundColor),this.textColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--textColor",this.textColor),this.hoverBackgroundColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--hoverBackgroundColor",this.hoverBackgroundColor),this.hoverTextColor&&this.elementRef.nativeElement.querySelector(".action").style.setProperty("--hoverTextColor",this.hoverTextColor)},i.prototype.onMouseOver=function(o){},i.prototype.onMouseOut=function(o){},i.prototype.actionButtonAction=function(){if(this.button&&this.button.action&&""!==this.button.action){var o=this.elementRef.nativeElement.querySelector(".action");o&&(o.classList.contains("active")||o.classList.add("active"),setTimeout(function(){o.classList.contains("active")&&o.classList.remove("active")},400)),this.onButtonClicked.emit({target:this,currentTarget:this})}},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-action-button-attachment"]],inputs:{button:"button",isConversationArchived:"isConversationArchived",fontSize:"fontSize",backgroundColor:"backgroundColor",textColor:"textColor",hoverBackgroundColor:"hoverBackgroundColor",hoverTextColor:"hoverTextColor"},outputs:{onButtonClicked:"onButtonClicked"},features:[e.TTD],decls:3,vars:5,consts:[["id","actionButton",1,"button-in-msg","action",3,"ngClass","title","click","mouseover","mouseout"],["actionButton",""]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.NdJ("click",function(){return t.actionButtonAction()})("mouseover",function(a){return t.onMouseOver(a)})("mouseout",function(a){return t.onMouseOut(a)}),e._uU(2),e.qZA()),2&n&&(e.s9C("title",null==t.button?null:t.button.value),e.Q6J("ngClass",e.VKq(3,Fr,t.isConversationArchived)),e.xp6(2),e.hij(" ",null==t.button?null:t.button.value,"\n"))},directives:[me.mk],styles:['[_nghost-%COMP%]{--backgroundColor: #2a6ac1;--textColor: #62a8ea;--hoverBackgroundColor: #62a8ea;--hoverTextColor: #2a6ac1;--buttonFontSize: 15px;--max-width: 280px}.button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important;position:relative;max-width:var(--max-width);min-width:inherit;cursor:pointer;border:1px solid var(--textColor);border-radius:20px;margin:3px;background:var(--backgroundColor);overflow:hidden;font-family:"Muli",sans-serif;font-size:var(--buttonFontSize);text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.24px;-webkit-font-smoothing:antialiased;color:var(--textColor);line-height:16px}.action[_ngcontent-%COMP%]{background:var(--backgroundColor);transition:background-color .6s ease}.action[_ngcontent-%COMP%]:focus, .action[_ngcontent-%COMP%]:hover{color:var(--hoverTextColor);background:var(--hoverBackgroundColor);transform:scale(1.05)}.action[_ngcontent-%COMP%]:focus .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .action[_ngcontent-%COMP%]:hover .icon-button-action[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:var(--hoverTextColor)}.action[_ngcontent-%COMP%]:after{content:"";position:absolute;width:0;height:0;top:50%;left:50%;transform-style:flat;transform:translate(-50%,-50%);background:rgba(255,255,255,.2);border-radius:100%;transition:width .5s ease,height .5s ease}.action.active[_ngcontent-%COMP%]:after{width:200px;height:200px}.disabled[_ngcontent-%COMP%]{pointer-events:none}']}),i}();function Ur(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-text-button-attachment",6),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("isConversationArchived",r.isConversationArchived)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Zr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-link-button-attachment",7),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Dr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-action-button-attachment",6),e.NdJ("onButtonClicked",function(u){return e.CHM(n),e.oxw(2).returnOnAttachmentButtonClicked(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("button",t)("isConversationArchived",r.isConversationArchived)("fontSize",r.stylesMap.get("buttonFontSize"))("backgroundColor",r.stylesMap.get("buttonBackgroundColor"))("textColor",r.stylesMap.get("buttonTextColor"))("hoverBackgroundColor",r.stylesMap.get("buttonHoverBackgroundColor"))("hoverTextColor",r.stylesMap.get("buttonHoverTextColor"))}}function Hr(i,o){if(1&i&&(e.TgZ(0,"span",3),e.YNc(1,Ur,1,7,"chat-text-button-attachment",4),e.YNc(2,Zr,1,6,"chat-link-button-attachment",5),e.YNc(3,Dr,1,7,"chat-action-button-attachment",4),e.qZA()),2&i){var n=o.$implicit,t=e.oxw();e.xp6(1),e.Q6J("ngIf","text"===n.type&&!0===t.isLastMessage),e.xp6(1),e.Q6J("ngIf","url"===n.type),e.xp6(1),e.Q6J("ngIf","action"===n.type&&!0===t.isLastMessage)}}var zr=function(){function i(){this.onAttachmentButtonClicked=new e.vpe,this.onElementRendered=new e.vpe}return i.prototype.ngOnInit=function(){this.getAttachmentButton()},i.prototype.getAttachmentButton=function(){if(this.message&&this.message.attributes&&this.message.attributes.attachment){try{this.type=this.message.attributes.attachment.type}catch(o){return}try{this.buttons=this.message.attributes.attachment.buttons}catch(o){return}}},i.prototype.ngAfterViewInit=function(){this.onElementRendered.emit({element:"attachment",status:!0})},i.prototype.returnOnAttachmentButtonClicked=function(o){o&&o.target&&this.onAttachmentButtonClicked.emit({target:o.target,message:this.message,currentTarget:this})},i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-message-attachment"]],inputs:{message:"message",isConversationArchived:"isConversationArchived",isLastMessage:"isLastMessage",stylesMap:"stylesMap"},outputs:{onAttachmentButtonClicked:"onAttachmentButtonClicked",onElementRendered:"onElementRendered"},decls:3,vars:1,consts:[["id","buttons-in-message"],[1,"buttons-wrapper"],["class","div-button",4,"ngFor","ngForOf"],[1,"div-button"],["class","div-button",3,"button","isConversationArchived","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked",4,"ngIf"],["class","div-button",3,"button","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked",4,"ngIf"],[1,"div-button",3,"button","isConversationArchived","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked"],[1,"div-button",3,"button","fontSize","backgroundColor","textColor","hoverBackgroundColor","hoverTextColor","onButtonClicked"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.YNc(2,Hr,4,3,"span",2),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngForOf",t.buttons))},directives:[me.sg,me.O5,Ir,Nr,Br],styles:["#buttons-in-message[_ngcontent-%COMP%]{text-align:right;display:block;margin-right:16px;height:auto;width:85%;float:right}#buttons-in-message[_ngcontent-%COMP%] .buttons-wrapper[_ngcontent-%COMP%]{margin-top:0;display:flex;flex-wrap:wrap;justify-content:flex-end;width:100%;border:none}#buttons-in-message[_ngcontent-%COMP%] .div-button[_ngcontent-%COMP%]{display:inline-block}#buttons-in-message[_ngcontent-%COMP%] .div-button[_ngcontent-%COMP%] .button-in-msg[_ngcontent-%COMP%]{padding:8px 16px!important}#buttons-in-message.align-left[_ngcontent-%COMP%]{text-align:left;margin:4px 50px}"]}),i}(),jr=["scrollMe"];function qr(i,o){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"user-typing",12),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("color",null==n.stylesMap?null:n.stylesMap.get("iconColor"))("translationMap",n.translationMap)("idUserTypingNow",n.idUserTypingNow)("nameUserTypingNow",n.nameUserTypingNow)}}var Yn=function(i,o){return{background:i,color:o}},Vr=function(i){return{"button-in-msg":i}};function Wr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.TgZ(1,"chat-bubble-message",20),e.NdJ("onBeforeMessageRender",function(u){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(u)})("onAfterMessageRender",function(u){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(u)})("onElementRendered",function(u){return e.CHM(n),e.oxw(2).onElementRenderedFN(u)}),e.qZA(),e._UZ(2,"chat-return-receipt",21),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.xp6(1),e.ekj("no-background",(r.isImage(t)||r.isFrame(t))&&""===(null==t?null:t.text.trim()))("emoticon",r.isEmojii(null==t?null:t.text)),e.Q6J("ngStyle",e.WLB(12,Yn,r.stylesMap.get("bubbleSentBackground"),r.stylesMap.get("bubbleSentTextColor")))("ngClass",e.VKq(15,Vr,(null==t?null:t.metadata)&&(null==t||null==t.metadata?null:t.metadata.button)))("message",t)("fontColor",r.stylesMap.get("bubbleSentTextColor"))("fontSize",r.stylesMap.get("fontSize"))("fontFamily",r.stylesMap.get("fontFamily"))("stylesMap",r.stylesMap),e.xp6(1),e.Q6J("status",null==t?null:t.status)}}var $t=function(){return{"slide-in-left":!1}};function Yr(i,o){if(1&i&&e._UZ(0,"chat-avatar-image",25),2&i){var n=e.oxw(2).$implicit,t=e.oxw();e.Q6J("ngClass",e.DdM(4,$t))("senderID",null==n?null:n.sender)("senderFullname",null==n?null:n.sender_fullname)("baseLocation",t.baseLocation)}}function Gr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",22),e.YNc(1,Yr,1,5,"chat-avatar-image",23),e.TgZ(2,"chat-bubble-message",24),e.NdJ("onBeforeMessageRender",function(j){return e.CHM(n),e.oxw(2).onBeforeMessageRenderFN(j)})("onAfterMessageRender",function(j){return e.CHM(n),e.oxw(2).onAfterMessageRenderFN(j)})("onElementRendered",function(j){return e.CHM(n),e.oxw(2).onElementRenderedFN(j)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(),r=t.$implicit,a=t.index,u=e.oxw();e.xp6(1),e.Q6J("ngIf",!u.isSameSender(null==r?null:r.sender,a)),e.xp6(1),e.Udp("margin-left",u.isSameSender(null==r?null:r.sender,a)?"50px":null),e.ekj("no-background",(u.isImage(r)||u.isFrame(r))&&""===(null==r?null:r.text.trim()))("emoticon",u.isEmojii(null==r?null:r.text)),e.Q6J("ngClass",e.DdM(15,$t))("ngStyle",e.WLB(16,Yn,u.stylesMap.get("bubbleReceivedBackground"),u.stylesMap.get("bubbleReceivedTextColor")))("isSameSender",u.isSameSender(null==r?null:r.sender,a))("message",r)("fontColor",u.stylesMap.get("bubbleReceivedTextColor"))("fontSize",u.stylesMap.get("fontSize"))("fontFamily",u.stylesMap.get("fontFamily"))("stylesMap",u.stylesMap)}}function Jr(i,o){if(1&i&&(e.TgZ(0,"div",26),e._UZ(1,"chat-info-message",27),e.qZA()),2&i){var n=e.oxw().$implicit;e.xp6(1),e.Q6J("message",n)}}function Qr(i,o){if(1&i&&(e.TgZ(0,"time",null,28),e._uU(2),e.ALo(3,"amTimeAgo"),e.qZA()),2&i){var n=e.oxw().$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,null==n?null:n.timestamp)," ")}}function Kr(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",29),e.TgZ(1,"chat-message-attachment",30),e.NdJ("onElementRendered",function(u){return e.CHM(n),e.oxw(2).onElementRenderedFN(u)})("onAttachmentButtonClicked",function(u){return e.CHM(n),e.oxw(2).onAttachmentButtonClickedFN(u)}),e.qZA(),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("ngClass",e.DdM(5,$t)),e.xp6(1),e.Q6J("message",t)("isConversationArchived",r.isConversationArchived)("isLastMessage",r.isLastMessage(null==t?null:t.uid))("stylesMap",r.stylesMap)}}var Xr=function(i){return{sender:i}};function $r(i,o){if(1&i&&(e.TgZ(0,"div",13),e.YNc(1,Wr,3,17,"div",14),e.YNc(2,Gr,3,19,"div",15),e.YNc(3,Jr,2,1,"div",16),e.TgZ(4,"div",17),e.YNc(5,Qr,4,3,"time",3),e.qZA(),e.YNc(6,Kr,2,6,"div",18),e.qZA()),2&i){var n=o.$implicit,t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_MINE,n)),e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_OTHERS,n)),e.xp6(1),e.Q6J("ngIf",t.messageType(t.MESSAGE_TYPE_INFO,n)),e.xp6(1),e.Q6J("ngClass",e.VKq(6,Xr,(null==n?null:n.sender)==t.senderId)),e.xp6(1),e.Q6J("ngIf",""!==(null==n?null:n.sender)&&"{.sv: timestamp}"!==(null==n?null:n.timestamp)),e.xp6(1),e.Q6J("ngIf",(null==n?null:n.attributes)&&(null==n||null==n.attributes?null:n.attributes.attachment))}}var ea=function(i){return{"background-color":i}},ta=function(i){return{"background-color":i,opacity:.4}},na=function(i){return{"background-color":i,opacity:.6}};function oa(i,o){if(1&i&&(e.TgZ(0,"div",31),e.TgZ(1,"div",32),e._UZ(2,"div",33),e._UZ(3,"div",34),e._UZ(4,"div",35),e.qZA(),e.qZA()),2&i){var n=e.oxw();e.xp6(2),e.Q6J("ngStyle",e.VKq(3,ea,n.stylesMap.get("iconColor"))),e.xp6(1),e.Q6J("ngStyle",e.VKq(5,ta,n.stylesMap.get("iconColor"))),e.xp6(1),e.Q6J("ngStyle",e.VKq(7,na,n.stylesMap.get("iconColor")))}}function ia(i,o){if(1&i&&e._UZ(0,"chat-avatar-image",39),2&i){var n=e.oxw(2);e.Q6J("senderID",n.idUserTypingNow)("senderFullname",n.nameUserTypingNow)("baseLocation",n.baseLocation)}}var ra=function(i){return{userTypingNowExist:i}};function aa(i,o){if(1&i&&(e.TgZ(0,"div",36),e.YNc(1,ia,1,3,"chat-avatar-image",37),e._UZ(2,"user-typing",38),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.Q6J("ngIf",n.idUserTypingNow),e.xp6(1),e.Q6J("ngClass",e.VKq(6,ra,!n.idUserTypingNow))("color",null==n.stylesMap?null:n.stylesMap.get("iconColor"))("translationMap",n.translationMap)("idUserTypingNow",n.idUserTypingNow)("nameUserTypingNow",n.nameUserTypingNow)}}var Gn=function(){function i(o,n,t){this.cdref=o,this.elementRef=n,this.uploadService=t,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onMenuOptionShow=new e.vpe,this.onEmojiiPickerShow=new e.vpe,this.onAttachmentButtonClicked=new e.vpe,this.onScrollContent=new e.vpe,this.startScroll=!0,this.idDivScroll="c21-contentScroll",this.isScrolling=!1,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.isPopupUrl=po,this.popupUrl=Ht,this.MSG_STATUS_SENT=100,this.MSG_STATUS_SENT_SERVER=150,this.MSG_STATUS_RETURN_RECEIPT=250,this.isMine=Vt,this.isInfo=xt,this.messageType=Xe,this.isEmojii=Po,this.isImage=qt,this.isFrame=wn,this.MESSAGE_TYPE_INFO=N,this.MESSAGE_TYPE_MINE=V,this.MESSAGE_TYPE_OTHERS=Q,this.tooltipOptions={"show-delay":1500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.urlBOTImage="https://s3.eu-west-1.amazonaws.com/tiledesk-widget/dev/2.0.4-beta.7/assets/images/avatar_bot_tiledesk.svg",this.showUploadProgress=!1,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.listenToUploadFileProgress()},i.prototype.ngAfterContentChecked=function(){this.cdref.detectChanges()},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("bubbleSentTextColor")&&this.elementRef.nativeElement.querySelector(".c21-body").style.setProperty("--textColorSent",this.stylesMap.get("bubbleSentTextColor")),this.stylesMap&&this.stylesMap.get("bubbleReceivedTextColor")&&this.elementRef.nativeElement.querySelector(".c21-body").style.setProperty("--textColorReceive",this.stylesMap.get("bubbleReceivedTextColor"))},i.prototype.getMetadataSize=function(o){void 0===o.width&&(o.width="100%"),void 0===o.height&&(o.height=We);var n={width:o.width,height:o.height};if(o.width&&o.width>We){var t=o.width/o.height;n.width=We,n.height=We/t}return n},i.prototype.listenToUploadFileProgress=function(){var o=this;this.uploadService.BSStateUpload.subscribe(function(n){o.logger.debug("[CONV-CONTENT] BSStateUpload",n),n&&(o.showUploadProgress=100!==n.upload&&!isNaN(n.upload),o.uploadProgress=n.upload,o.fileType="file",o.scrollToBottom())})},i.prototype.onScroll=function(o){if(this.startScroll=!1,this.scrollMe){var t=this.checkContentScrollPosition(this.scrollMe.nativeElement);this.onScrollContent.emit(!!t)}},i.prototype.checkContentScrollPosition=function(o){return o||(o=this.scrollMe.nativeElement),o.scrollHeight-o.scrollTop<=o.clientHeight+40?(this.logger.debug("[CONV-CONTENT] - SONO ALLA FINE"),!0):(this.logger.debug("[CONV-CONTENT] - NON SONO ALLA FINE"),!1)},i.prototype.scrollToBottom=function(o){var n=this;try{n.isScrolling=!0;var t=document.getElementById(n.idDivScroll);setTimeout(function(){!0===n.isIE||!0===o||!0===n.firstScroll?t.parentElement.classList.add("withoutAnimation"):t.parentElement.classList.remove("withoutAnimation"),t.parentElement.scrollTop=t.scrollHeight,t.style.opacity="1",n.firstScroll=!1},0)}catch(r){this.logger.error("[CONV-CONTENT] scrollToBottom > Error :"+r)}n.isScrolling=!1},i.prototype.isLastMessage=function(o){return o===this.messages[this.messages.length-1].uid},i.prototype.isSameSender=function(o,n){return!(!o||!this.messages[n-1]||o!==this.messages[n-1].sender)},i.prototype.isFirstMessage=function(o,n){return!(!o||0!=n||!this.messages[n]||this.messages[n]===o)},i.prototype.hideOutsideElements=function(){this.onMenuOptionShow.emit(!1),this.onEmojiiPickerShow.emit(!1)},i.prototype.onAttachmentButtonClickedFN=function(o){this.onAttachmentButtonClicked.emit(o)},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit(o)},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit(o)},i.prototype.onElementRenderedFN=function(o){o.status&&this.scrollMe&&(this.checkContentScrollPosition(this.scrollMe.nativeElement),this.scrollToBottom())},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.sBO),e.Y36(e.SBq),e.Y36(pt))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-content"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(jr,5),2&n)&&(e.iGM(r=e.CRH())&&(t.scrollMe=r.first))},inputs:{messages:"messages",senderId:"senderId",baseLocation:"baseLocation",isConversationArchived:"isConversationArchived",isTypings:"isTypings",idUserTypingNow:"idUserTypingNow",nameUserTypingNow:"nameUserTypingNow",typingLocation:"typingLocation",fullscreenMode:"fullscreenMode",translationMap:"translationMap",stylesMap:"stylesMap"},outputs:{onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onMenuOptionShow:"onMenuOptionShow",onEmojiiPickerShow:"onEmojiiPickerShow",onAttachmentButtonClicked:"onAttachmentButtonClicked",onScrollContent:"onScrollContent"},features:[e.TTD],decls:12,vars:5,consts:[[1,"c21-body",3,"click"],[1,"c21-body-container"],["tabindex","1520","aria-label"," messaggi della conversazione: ",1,"c21-body-content"],[4,"ngIf"],["id","chat21-sheet-content",1,"chat21-sheet-content"],[1,"chat21-conversation-parts-container"],["id","scroll-me",3,"scroll"],["scrollMe",""],[1,"c21-contentScroll",3,"id"],["tabindex","1521","class","rowMsg",4,"ngFor","ngForOf"],["class","msg_container base_sent",4,"ngIf"],["class","msg_container base_receive",4,"ngIf"],[1,"loading",3,"color","translationMap","idUserTypingNow","nameUserTypingNow"],["tabindex","1521",1,"rowMsg"],["role","messaggio","class","msg_container base_sent",4,"ngIf"],["role","messaggio","class","msg_container base_receive",4,"ngIf"],["class","msg_info_container",4,"ngIf"],[1,"time","slide-in-left",3,"ngClass"],["class","attachment_container",3,"ngClass",4,"ngIf"],["role","messaggio",1,"msg_container","base_sent"],[1,"messages","msg_sent",3,"ngStyle","ngClass","message","fontColor","fontSize","fontFamily","stylesMap","onBeforeMessageRender","onAfterMessageRender","onElementRendered"],[3,"status"],["role","messaggio",1,"msg_container","base_receive"],[3,"ngClass","senderID","senderFullname","baseLocation",4,"ngIf"],[1,"messages","msg_receive",3,"ngClass","ngStyle","isSameSender","message","fontColor","fontSize","fontFamily","stylesMap","onBeforeMessageRender","onAfterMessageRender","onElementRendered"],[3,"ngClass","senderID","senderFullname","baseLocation"],[1,"msg_info_container"],[1,"messages",3,"message"],["timeTooltip",""],[1,"attachment_container",3,"ngClass"],[2,"height","100%","display","block",3,"message","isConversationArchived","isLastMessage","stylesMap","onElementRendered","onAttachmentButtonClicked"],[1,"msg_container","base_sent"],["id","chat21-spinner",1,"chat21-spinner","active",2,"margin","0px 6px 0px"],[1,"chat21-bounce1",3,"ngStyle"],[1,"chat21-bounce2",3,"ngStyle"],[1,"chat21-bounce3",3,"ngStyle"],[1,"msg_container","base_receive"],["class","slide-in-left",3,"senderID","senderFullname","baseLocation",4,"ngIf"],[3,"ngClass","color","translationMap","idUserTypingNow","nameUserTypingNow"],[1,"slide-in-left",3,"senderID","senderFullname","baseLocation"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.NdJ("click",function(){return t.hideOutsideElements()}),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.YNc(3,qr,2,4,"span",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"div",6,7),e.NdJ("scroll",function(a){return t.onScroll(a)}),e.TgZ(8,"div",8),e.YNc(9,$r,7,8,"div",9),e.YNc(10,oa,5,9,"div",10),e.YNc(11,aa,3,8,"div",11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(3),e.Q6J("ngIf",t.messages&&0===t.messages.length),e.xp6(5),e.s9C("id",t.idDivScroll),e.xp6(1),e.Q6J("ngForOf",t.messages),e.xp6(1),e.Q6J("ngIf",t.showUploadProgress),e.xp6(1),e.Q6J("ngIf",t.isTypings&&"content"===t.typingLocation))},directives:[me.O5,me.sg,zn,me.mk,yr,me.PC,Er,Wn,kr,zr],pipes:[$e.eG],styles:['#scroll-me[_ngcontent-%COMP%]{scroll-behavior:smooth}#scroll-me.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}[_nghost-%COMP%]{--textColorSent: #ffffff;--textColorReceive: #1a1a1a}[_nghost-%COMP%] .base_receive[_ngcontent-%COMP%] .msg_receive[_ngcontent-%COMP%] >div>div>div>chat-text a{color:var(--textColorReceive)!important}[_nghost-%COMP%] .base_sent[_ngcontent-%COMP%] .msg_sent[_ngcontent-%COMP%] >div>div>div>chat-text a{color:var(--textColorSent)!important}[_nghost-%COMP%] .userTypingNowExist[_ngcontent-%COMP%] >div.spinner{margin:15px 50px}[_nghost-%COMP%] .loading[_ngcontent-%COMP%] >div.spinner{margin:25px 50px}.c21-body[_ngcontent-%COMP%]{position:fixed}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .chat21-header-modal-select[_ngcontent-%COMP%]{font-family:"Google Sans",sans-serif!important;padding:0;background-color:rgba(185,185,185,.13);margin:8px;line-height:1.2em;color:#616161;font-size:15px;text-align:center;word-wrap:break-word;border-radius:8px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .chat21-header-modal-select-more-of-one-dept[_ngcontent-%COMP%]{position:relative;height:auto;padding:10px;margin:30px 0 0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%]{position:absolute;top:0;right:0;left:0;bottom:56px;overflow:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .time[_ngcontent-%COMP%]{margin-bottom:20px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #c21-contentScroll[_ngcontent-%COMP%]{position:absolute;left:0px;right:0px;padding:10px;opacity:0;transition:opacity .5s;transition-timing-function:ease-in}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.1);background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .chat21-conversation-parts-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:6px!important;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0);background-color:rgba(0,0,0,.25)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;top:0;right:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] #scroll-me[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#d3d6dc}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .msg_container[_ngcontent-%COMP%]{overflow:hidden;display:flex;width:100%}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .attachment_container[_ngcontent-%COMP%]{display:flex;align-content:center;justify-content:flex-end}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .msg_info_container[_ngcontent-%COMP%]{text-align:center;padding:0 0 6px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%]{border-radius:20px;padding:0;word-wrap:break-word}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:1.4em;margin:0;padding:14px;font-style:normal;letter-spacing:normal;font-stretch:normal;font-feature-settings:normal;font-variant:normal;font-weight:300;overflow:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:8px;padding:3px;margin-bottom:0;max-width:calc(100% - 6px);width:auto;height:auto;-o-object-fit:cover;object-fit:cover}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml.marked[_ngcontent-%COMP%]{padding:8px;-webkit-margin-before:-1em!important;margin-block-start:-1em!important;-webkit-margin-after:-1em!important;margin-block-end:-1em!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .messages[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%] .text-message[_ngcontent-%COMP%]{padding-top:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_info[_ngcontent-%COMP%]{border-radius:8px;border:1px solid #C9E4F6;padding-left:4px;padding-right:4px;display:inline-block;background:#C9E4F6;font-size:.85em}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%]{align-items:flex-end;justify-content:flex-end;padding:2px 0 4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .msg_sent[_ngcontent-%COMP%]{background-color:#62a8ea;color:#fff;margin-right:0;margin-left:4px;max-width:calc(100% - 30px);min-width:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:8px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .no-background[_ngcontent-%COMP%]{background:transparent!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%]{background:transparent!important;font-size:4em;margin:-15px 0 0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:0;margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%]{width:16px;height:16px;margin-left:4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:13px;height:13px;background-repeat:no-repeat;background-position:center;background-size:cover;overflow-x:hidden}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-schedule[_ngcontent-%COMP%]{background-image:url(f21ico-schedule.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-done[_ngcontent-%COMP%]{background-image:url(f21ico-done.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_sent[_ngcontent-%COMP%] .status-message[_ngcontent-%COMP%] .c21-ico-done_all[_ngcontent-%COMP%]{background-image:url(f21ico-done_all.svg)}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%]{padding:2px 0 4px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%]{position:relative;border-radius:50%;width:28px;height:28px;margin-right:6px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%] .profile_image[_ngcontent-%COMP%]{position:relative;width:25px;height:25px;border-radius:50%;overflow:hidden;background-color:#fff;border:1px solid #e2e2e2}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .content-avatar[_ngcontent-%COMP%] .profile_image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .msg_receive[_ngcontent-%COMP%]{background-color:#f7f7f7;color:#1a1a1a;max-width:calc(100% - 70px);min-width:14px;margin:auto 20px auto 10px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:auto}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:14px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .no-background[_ngcontent-%COMP%]{background:transparent!important}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%]{background-color:transparent!important;font-size:4em;margin:-15px 20px -10px 10px}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .base_receive[_ngcontent-%COMP%] .emoticon[_ngcontent-%COMP%] .message_innerhtml[_ngcontent-%COMP%]{padding:0;margin:0}.c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .chat21-sheet-content[_ngcontent-%COMP%] .message_sender_fullname[_ngcontent-%COMP%]{font-size:12px;color:#5f6368;margin:0 auto 4px}.c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}.c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}']}),i}(),sa=function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te,ke,Ae,Be,Ze,ze,je){this.uid=o,this.attributes=n,this.channel_type=t,this.conversation_with_fullname=r,this.conversation_with=a,this.recipient=u,this.recipient_fullname=y,this.image=j,this.is_new=J,this.last_message_text=ie,this.text=ue,this.sender=ge,this.senderAuthInfo=de,this.sender_fullname=ve,this.status=Te,this.timestamp=ke,this.selected=Ae,this.color=Be,this.avatar=Ze,this.archived=ze,this.type=je}}(),lt=ye(25416),la=ye(55959),en=function(){function i(o,n,t){if(this.http=o,this.g=n,this.appConfigService=t,this.logger=Ce.getInstance(),this.API_URL=this.appConfigService.getConfig().apiUrl,!this.API_URL)throw new Error("apiUrl is not defined");this.obsCloseConversation=new he.X(null)}return i.prototype.httpSendRate=function(o,n){var t=this.g.tiledeskToken,r=this.g.projectid,a=this.g.recipientId;if(o&&t&&r&&a){var u=new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:t}),y=this.API_URL+r+"/requests/"+a+"/rating";this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e url: ",y);var j={rating:o,rating_message:n};return this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e options: ",u),this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e body: ",JSON.stringify(j)),this.http.patch(y,JSON.stringify(j),{headers:u}).pipe((0,An.U)(function(J){return J.json()}))}},i.prototype.setOsservable=function(o){this.logger.debug("[STAR-RATING-SERVICE] ------------------\x3e setOsservable: ",o),this.obsCloseConversation.next(o)},i.prototype._dowloadTranscript=function(o){this.g.windowContext.open(this.API_URL+"public/requests/"+o+"/messages-user.html","_blank")},i.\u0275fac=function(n){return new(n||i)(e.LFG(Se.eN),e.LFG(Re),e.LFG(Fe))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i}();function ca(i,o){if(1&i&&e._UZ(0,"user-typing",17),2&i){var n=e.oxw();e.Q6J("color",null==n.stylesMap?null:n.stylesMap.get("foregroundColor"))("translationMap",n.translationMap)("nameUserTypingNow",n.nameUserTypingNow)("typingLocation",n.typingLocation)}}function ua(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",23),e._UZ(1,"path",5),e._UZ(2,"path",24),e.TgZ(3,"title",7),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(null==n.translationMap?null:n.translationMap.get("SOUND_OFF"))}}function ha(i,o){if(1&i&&(e.O4$(),e.TgZ(0,"svg",23),e._UZ(1,"path",5),e._UZ(2,"path",25),e.TgZ(3,"title",7),e._uU(4),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.xp6(4),e.Oqu(null==n.translationMap?null:n.translationMap.get("SOUND_ON"))}}function pa(i,o){if(1&i&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("SOUND_OFF"),"")}}function da(i,o){if(1&i&&(e.TgZ(0,"span",26),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij(" ",null==n.translationMap?null:n.translationMap.get("SOUND_ON"),"")}}function ga(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.O4$(),e.TgZ(1,"svg",27),e._UZ(2,"path",5),e._UZ(3,"path",28),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("DOWNLOAD_TRANSCRIPT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("DOWNLOAD_TRANSCRIPT"))}}function fa(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).closeChat()}),e.O4$(),e.TgZ(1,"svg",29),e._UZ(2,"path",30),e._UZ(3,"rect",31),e._UZ(4,"path",32),e.TgZ(5,"title",7),e._uU(6),e.qZA(),e.qZA(),e.kcU(),e.TgZ(7,"span",26),e._uU(8),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(6),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE_CHAT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE_CHAT"))}}function ma(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).restartChat()}),e.O4$(),e.TgZ(1,"svg",33),e._UZ(2,"path",34),e._UZ(3,"path",35),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("RESTART")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("RESTART"))}}function va(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).signOut()}),e.O4$(),e.TgZ(1,"svg",36),e._UZ(2,"path",5),e._UZ(3,"path",37),e.TgZ(4,"title",7),e._uU(5),e.qZA(),e.qZA(),e.kcU(),e.TgZ(6,"span",26),e._uU(7),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(5),e.Oqu(null==t.translationMap?null:t.translationMap.get("LOGOUT")),e.xp6(2),e.Oqu(null==t.translationMap?null:t.translationMap.get("LOGOUT"))}}function ba(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",18),e.TgZ(1,"div",19),e.NdJ("click",function(){return e.CHM(n),e.oxw().toggleSound()}),e.YNc(2,ua,5,1,"svg",20),e.YNc(3,ha,5,1,"svg",20),e.YNc(4,pa,2,1,"span",21),e.YNc(5,da,2,1,"span",21),e.qZA(),e.YNc(6,ga,8,2,"div",22),e.YNc(7,fa,9,2,"div",22),e.YNc(8,ma,8,2,"div",22),e.YNc(9,va,8,2,"div",22),e.qZA()}if(2&i){var t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.soundEnabled),e.xp6(1),e.Q6J("ngIf",!t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.soundEnabled),e.xp6(1),e.Q6J("ngIf",t.isTrascriptDownloadEnabled),e.xp6(1),e.Q6J("ngIf",!t.hideCloseConversationOptionMenu),e.xp6(1),e.Q6J("ngIf",!t.hideRestartConversationOptionsMenu),e.xp6(1),e.Q6J("ngIf",!t.hideSignOutOptionMenu)}}var _a=function(i){return{"background-image":i}},tn=function(i){return{display:i}},nn=function(i){return{fill:i}},Ca=function(i){return{color:i}},ya=function(){function i(o,n){this.g=o,this.appConfigService=n,this.onBack=new e.vpe,this.onCloseWidget=new e.vpe,this.onSoundChange=new e.vpe,this.onCloseChat=new e.vpe,this.onRestartChat=new e.vpe,this.onWidgetHeightChange=new e.vpe,this.onSignOut=new e.vpe,this.onMenuOptionShow=new e.vpe,this.convertColorToRGBA=Ie,this.isButtonsDisabled=!0,this.isDirect=!1,this.subscriptions=[],this.membersConversation=["SYSTEM"],this.heightStatus="min",this.logger=Ce.getInstance(),this.API_URL=this.appConfigService.getConfig().apiUrl}return i.prototype.ngOnInit=function(){this.logger.debug("[CONV-HEADER] ngOnInit: conversation-header COMPONENT ",this.translationMap),this.membersConversation.push(this.senderId)},i.prototype.ngOnChanges=function(o){o.idConversation&&void 0!==o.idConversation.currentValue&&this.logger.debug("[CONV-HEADER] onChanges -- Conversation-header.component-> start initializeTyping()",this.idConversation)},i.prototype.ngAfterViewInit=function(){this.logger.debug("[CONV-HEADER] --------ngAfterViewInit: conversation-header-------- "),this.isButtonsDisabled=!1,this.setSubscriptions()},i.prototype.setSubscriptions=function(){},i.prototype.returnHome=function(){this.onBack.emit()},i.prototype.closeChat=function(){this.onCloseChat.emit()},i.prototype.restartChat=function(){this.onRestartChat.emit(),this.onMenuOptionShow.emit(!1)},i.prototype.closeWidget=function(){this.onCloseWidget.emit()},i.prototype.dowloadTranscript=function(){this.windowContext.open(this.API_URL+"public/requests/"+this.idConversation+"/messages-user.html","_blank"),this.onMenuOptionShow.emit(!1)},i.prototype.toggleSound=function(){this.onMenuOptionShow.emit(!1),this.onSoundChange.emit(!this.soundEnabled)},i.prototype.signOut=function(){this.onSignOut.emit(!0)},i.prototype.toggleMenu=function(){this.onMenuOptionShow.emit(!this.isMenuShow)},i.prototype.maximizeMinimize=function(o){this.heightStatus=o,this.onWidgetHeightChange.emit(o)},i.prototype.ngOnDestroy=function(){this.logger.debug("[CONV-HEADER] ngOnDestroy ------------------\x3e this.subscriptions",this.subscriptions),this.unsubescribeAll()},i.prototype.unsubescribeAll=function(){var o=this;this.logger.debug("[CONV-HEADER] unsubescribeAll: ",this.subscriptions),this.subscriptions.forEach(function(n){o.logger.debug("[CONV-HEADER] unsubescribe: ",n),n.value.unsubscribe()}),this.subscriptions.length=0,this.subscriptions=[]},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Fe))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-header"]],inputs:{idConversation:"idConversation",senderId:"senderId",soundEnabled:"soundEnabled",isMenuShow:"isMenuShow",isTypings:"isTypings",nameUserTypingNow:"nameUserTypingNow",typingLocation:"typingLocation",isTrascriptDownloadEnabled:"isTrascriptDownloadEnabled",hideCloseConversationOptionMenu:"hideCloseConversationOptionMenu",hideRestartConversationOptionsMenu:"hideRestartConversationOptionsMenu",hideHeaderCloseButton:"hideHeaderCloseButton",hideHeaderBackButton:"hideHeaderBackButton",hideHeaderConversationOptionsMenu:"hideHeaderConversationOptionsMenu",hideSignOutOptionMenu:"hideSignOutOptionMenu",windowContext:"windowContext",stylesMap:"stylesMap",translationMap:"translationMap",widgetTitle:"widgetTitle"},outputs:{onBack:"onBack",onCloseWidget:"onCloseWidget",onSoundChange:"onSoundChange",onCloseChat:"onCloseChat",onRestartChat:"onRestartChat",onWidgetHeightChange:"onWidgetHeightChange",onSignOut:"onSignOut",onMenuOptionShow:"onMenuOptionShow"},features:[e.TTD],decls:26,vars:33,consts:[[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean",3,"ngStyle","click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["tabindex","-1",1,"c21-header-button","c21-right","c21-button-clean",3,"ngStyle","click"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24",3,"ngStyle"],["d","M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"],["tabindex","1530","aria-label"," indietro ",1,"c21-header-button","c21-left","c21-button-clean",3,"ngStyle","click"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],[3,"color","translationMap","nameUserTypingNow","typingLocation",4,"ngIf"],["id","c21-options-menu",4,"ngIf"],[3,"color","translationMap","nameUserTypingNow","typingLocation"],["id","c21-options-menu"],[1,"c21-header-button","c21-right",3,"click"],["aria-labelledby","altIconTitle","class","icon-menu","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",4,"ngIf"],["class","label-menu-item",4,"ngIf"],["class","c21-header-button c21-right",3,"click",4,"ngIf"],["aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24",1,"icon-menu"],["d","M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"],["d","M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"],[1,"label-menu-item"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",1,"icon-menu"],["d","M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"],["role","img","id","archive","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 512 512",1,"icon-menu"],["d","M80 152v256a40.12 40.12 0 0040 40h272a40.12 40.12 0 0040-40V152","stroke-linecap","round","stroke-linejoin","round","stroke-width","50px","fill","none"],["x","48","y","64","width","416","height","80","rx","28","ry","28","stroke-linejoin","round","stroke-width","50px","fill","none"],["stroke-linecap","round","stroke-linejoin","round","d","M320 304l-64 64-64-64M256 345.89V224","stroke-width","50px","fill","none"],["role","img","id","refresh","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 20 20",1,"icon-menu"],["d","M9.6,18.2c0.6,0,1-0.7,1-1.5s-0.5-1.5-1-1.5H6c-0.6,0-1-0.7-1-1.5V7.8h1c0.4,0,0.8-0.4,1-0.9c0.2-0.6,0.1-1.2-0.2-1.6 l-2.1-3c-0.4-0.6-1.1-0.6-1.5,0l-2.1,3C0.9,5.7,0.8,6.3,1,6.9s0.5,0.9,1,0.9h1v5.9c0,2.5,1.4,4.4,3.1,4.4H9.6z"],["d","M10.5,1.8c-0.5,0-1,0.7-1,1.5s0.4,1.5,1,1.5h3.5c0.5,0,1,0.7,1,1.5v5.9h-1c-0.4,0-0.8,0.4-0.9,0.9s-0.1,1.2,0.2,1.6l2,3 c0.4,0.6,1,0.6,1.4,0l2-3c0.3-0.4,0.4-1.1,0.2-1.6c-0.2-0.6-0.5-0.9-0.9-0.9h-1V6.3c0-2.5-1.3-4.4-3-4.4H10.5z"],["xmlns","http://www.w3.org/2000/svg","width","20","height","20","viewBox","0 0 24 24","aria-labelledby","altIconTitle",1,"icon-menu"],["d","M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"button",3),e.NdJ("click",function(){return t.closeWidget()}),e.O4$(),e.TgZ(4,"svg",4),e._UZ(5,"path",5),e._UZ(6,"path",6),e.TgZ(7,"title",7),e._uU(8),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(9,"button",8),e.NdJ("click",function(){return t.toggleMenu()}),e.O4$(),e.TgZ(10,"svg",9),e._UZ(11,"path",5),e._UZ(12,"path",10),e.TgZ(13,"title",7),e._uU(14),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(15,"button",11),e.NdJ("click",function(){return t.returnHome()}),e.O4$(),e.TgZ(16,"svg",4),e._UZ(17,"path",5),e._UZ(18,"path",12),e.TgZ(19,"title",7),e._uU(20),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(21,"div",13),e.TgZ(22,"div",14),e._uU(23),e.qZA(),e.qZA(),e.YNc(24,ca,1,4,"user-typing",15),e.qZA(),e.qZA(),e.qZA(),e.YNc(25,ba,10,8,"div",16)),2&n&&(e.Q6J("ngStyle",e.VKq(17,_a,null==t.stylesMap?null:t.stylesMap.get("colorGradient"))),e.xp6(3),e.Q6J("ngStyle",e.VKq(19,tn,t.hideHeaderCloseButton?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(21,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("BUTTON_CLOSE_TO_ICON")),e.xp6(1),e.Q6J("ngStyle",e.VKq(23,tn,t.hideHeaderConversationOptionsMenu?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(25,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("OPTIONS")),e.xp6(1),e.Q6J("ngStyle",e.VKq(27,tn,t.hideHeaderBackButton?"none":"flex")),e.uIk("disabled",!!t.isButtonsDisabled||null),e.xp6(1),e.Q6J("ngStyle",e.VKq(29,nn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("PREV_CONVERSATIONS")),e.xp6(1),e.Q6J("ngStyle",e.VKq(31,Ca,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Oqu(t.widgetTitle),e.xp6(1),e.Q6J("ngIf",t.isTypings&&"header"===t.typingLocation),e.xp6(1),e.Q6J("ngIf",t.isMenuShow))},directives:[me.PC,me.O5,zn],styles:[".c21-header[_ngcontent-%COMP%]{position:fixed;left:0px;right:0px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}.c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;color:#2a6ac1;box-shadow:0 4px 15px rgba(0,0,0,.2),0 1px 2px rgba(0,0,0,.2);background-color:#fff}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{margin:5px;padding:5px 10px;display:flex;align-items:center;color:#777}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;border-radius:6px;cursor:pointer}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}#c21-options-menu[_ngcontent-%COMP%] .icon-menu[_ngcontent-%COMP%]{fill:#5f6368}#c21-options-menu[_ngcontent-%COMP%] .icon-menu#archive[_ngcontent-%COMP%]{stroke:#5f6368}"]}),i}(),wa=["iframe"],Jn=function(i){return{fill:i}};function Oa(i,o){if(1&i){var n=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnOpenExternal()}),e.O4$(),e.TgZ(1,"svg",3),e._UZ(2,"path",15),e._UZ(3,"path",16),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.VKq(1,Jn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor")))}}function Ma(i,o){1&i&&(e.TgZ(0,"div",17),e._UZ(1,"div"),e._UZ(2,"div"),e._UZ(3,"div"),e._UZ(4,"div"),e._UZ(5,"div"),e._UZ(6,"div"),e._UZ(7,"div"),e._UZ(8,"div"),e.qZA())}var xa=function(i){return{"background-image":i}},Ea=function(i){return{color:i}},Ta=function(){function i(o){this.sanitizer=o,this.onOpenExternal=new e.vpe,this.onClose=new e.vpe,this.isOpen="open",this.hideSpinner=!1,this.logger=Ce.getInstance(),this.convertColorToRGBA=Ie}return i.prototype.ngOnInit=function(){this.button&&this.button.link&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(this.button.link))},i.prototype.ngAfterViewInit=function(){this.logger.debug("[INTERNALFRAME] ngAfterViewInit",this.iframe.nativeElement.contentDocument||this.iframe.nativeElement.contentWindow,this.iframe.nativeElement.contentWindow,this.iframe.nativeElement.contentWindow.history)},i.prototype.ngOnDestroy=function(){this.url=null,this.hideSpinner=!1},i.prototype.returnClose=function(){this.isOpen="closed",this.onClose.emit()},i.prototype.returnOpenExternal=function(){this.onOpenExternal.emit(this.button)},i.prototype.onIframeLoaded=function(o){this.hideSpinner=!0},i.prototype.onError=function(o){this.logger.error("[INTERNALFRAME] onError ",o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-internal-frame"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(wa,5),2&n)&&(e.iGM(r=e.CRH())&&(t.iframe=r.first))},inputs:{button:"button",openExternalLinkButton:"openExternalLinkButton",stylesMap:"stylesMap",translationMap:"translationMap"},outputs:{onOpenExternal:"onOpenExternal",onClose:"onClose"},decls:16,vars:15,consts:[[1,"c21-iframe-container"],[1,"c21-iframe-header","c21-header",3,"ngStyle"],["tabindex","1530",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],["id","altIconTitle"],["tabindex","1530","class","c21-header-button c21-right c21-button-clean",3,"click",4,"ngIf"],[1,"c21-title",3,"ngStyle"],[1,"titleText"],[1,"c21-iframe"],["class","lds-roller",4,"ngIf"],["id","contentFrame","allowfullscreen","","title","","width","100%","height","100%",2,"border","none",3,"src","load","error"],["iframe",""],["tabindex","1530",1,"c21-header-button","c21-right","c21-button-clean",3,"click"],["d","M0 0h24v24H0z","fill","none"],["d","M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"],[1,"lds-roller"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return t.returnClose()}),e.O4$(),e.TgZ(3,"svg",3),e._UZ(4,"path",4),e._UZ(5,"path",5),e.TgZ(6,"title",6),e._uU(7),e.qZA(),e.qZA(),e.qZA(),e.YNc(8,Oa,4,3,"button",7),e.kcU(),e.TgZ(9,"div",8),e.TgZ(10,"div",9),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",10),e.YNc(13,Ma,9,0,"div",11),e.TgZ(14,"iframe",12,13),e.NdJ("load",function(a){return t.onIframeLoaded(a)})("error",function(a){return t.onError(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.Q6J("@enterAnimation",void 0),e.xp6(1),e.Q6J("ngStyle",e.VKq(9,xa,null==t.stylesMap?null:t.stylesMap.get("colorGradient"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(11,Jn,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE")),e.xp6(1),e.Q6J("ngIf",t.openExternalLinkButton),e.xp6(1),e.Q6J("ngStyle",e.VKq(13,Ea,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Oqu(null==t.button?null:t.button.value),e.xp6(2),e.Q6J("ngIf",!t.hideSpinner),e.xp6(1),e.Q6J("src",t.url,e.uOi))},directives:[me.PC,me.O5],styles:['.c21-iframe-container[_ngcontent-%COMP%]{max-width:100%;height:100%;width:100%;position:fixed;background-color:#fff;z-index:10}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%]{left:0px;right:0px}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{display:block;align-items:center;text-align:center;width:40px;height:40px;margin:6px;padding:0;cursor:pointer}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-right[_ngcontent-%COMP%]{float:right}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-left[_ngcontent-%COMP%]{float:left}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button.c21-close[_ngcontent-%COMP%]{display:none}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:20px;width:20px;margin:10px}.c21-iframe-container[_ngcontent-%COMP%] .c21-iframe[_ngcontent-%COMP%]{height:calc(100% - 40px)}.lds-roller[_ngcontent-%COMP%]{position:relative;width:80px;height:80px;margin:30px auto}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{-webkit-animation:lds-roller 1.2s cubic-bezier(.5,0,.5,1) infinite;animation:lds-roller 1.2s cubic-bezier(.5,0,.5,1) infinite;transform-origin:40px 40px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:after{content:" ";display:block;position:absolute;width:7px;height:7px;border-radius:50%;background:#1e60b5;margin:-4px 0 0 -4px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(1){-webkit-animation-delay:-36ms;animation-delay:-36ms}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(1):after{top:63px;left:63px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(2){-webkit-animation-delay:-72ms;animation-delay:-72ms}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(2):after{top:68px;left:56px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(3){-webkit-animation-delay:-.108s;animation-delay:-.108s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(3):after{top:71px;left:48px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(4){-webkit-animation-delay:-.144s;animation-delay:-.144s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(4):after{top:72px;left:40px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(5){-webkit-animation-delay:-.18s;animation-delay:-.18s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(5):after{top:71px;left:32px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(6){-webkit-animation-delay:-.216s;animation-delay:-.216s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(6):after{top:68px;left:24px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(7){-webkit-animation-delay:-.252s;animation-delay:-.252s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(7):after{top:63px;left:17px}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(8){-webkit-animation-delay:-.288s;animation-delay:-.288s}.lds-roller[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:nth-child(8):after{top:56px;left:12px}@-webkit-keyframes lds-roller{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes lds-roller{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],data:{animation:[(0,we.X$)("enterAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"translateX(100%)",opacity:0}),(0,we.jt)("400ms",(0,we.oB)({transform:"translateX(0)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"translateX(0)",opacity:1}),(0,we.jt)("400ms",(0,we.oB)({transform:"translateX(100%)",opacity:0}))])])]}}),i}(),Sa=["divPreview"];function Pa(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-image",25),e.NdJ("onImageRendered",function(a){return e.CHM(n),e.oxw().onImageRenderedFN(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("metadata",t.fileSelected)("width",null==t.fileSelected?null:t.fileSelected.width)("height",null==t.fileSelected?null:t.fileSelected.height)}}var ka=function(i){return{display:i}},Aa=function(i){return{fill:i}},Ia=function(){function i(o){this.sanitizer=o,this.onSendAttachment=new e.vpe,this.onCloseModalPreview=new e.vpe,this.hideHeaderCloseButton=!1,this.arrayFiles=[],this.isFilePendingToLoad=!1,this.HEIGHT_DEFAULT="20px",this.currentHeight=0,this.startScroll=!0,this.idDivScroll="c21-contentScroll-preview",this.isScrolling=!1,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.log("[LOADER-PREVIEW-PAGE] Hello!",this.textInputTextArea),this.setFocusOnId("chat21-main-message-context-preview");for(var o=0;o<this.attachments.length;o++)this.logger.log("[LOADER-PREVIEW-PAGE] ngOnInit",this.attachments[o]),this.readAsDataURL(this.attachments[o])},i.prototype.getMetadataSize=function(o){var n=230;void 0===o.width&&(o.width=n),void 0===o.height&&(o.height=n);var r={width:o.width,height:o.height};if(o.width&&o.width>n){var a=o.width/o.height;r.width=o.width=n,r.height=o.height=n/a}else if(o.width&&o.width<=55){a=o.width/o.height;r.width=130,r.height=130/a}return o.height&&o.height>150&&(r.width=150/(a=o.height/o.width),r.height=150),r},i.prototype.readAsDataURL=function(o){this.logger.log("[LOADER-PREVIEW-PAGE] readAsDataURL file",o),o.file.type.startsWith("image")&&!o.file.type.includes("svg")?(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE IMAGE - IMAGE ",o),this.fileSelected||(this.fileSelected=Object.assign({},this.attachments[0].metadata),this.fileSelected=Object.assign(this.fileSelected,this.getMetadataSize(this.fileSelected)))):o.file.type.startsWith("image")&&o.file.type.includes("svg")?(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE SVG - SVG ",o),o.metadata.src=this.sanitizer.bypassSecurityTrustUrl(o.metadata.src),this.fileSelected||(this.fileSelected=Object.assign({},this.attachments[0].metadata),this.fileSelected=Object.assign(this.fileSelected,this.getMetadataSize(this.fileSelected)))):o.file.type.startsWith("image")||(this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE ",o),this.logger.log("[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE FILE - FILE TYPE",o.file.type),this.file_extension=o.file.name.substring(o.file.name.lastIndexOf(".")+1,o.file.name.length)||o.file.name,this.createFile(o))},i.prototype.createFile=function(o){return(0,_e.mG)(this,void 0,void 0,function(){var n,r,a,u,y=this;return(0,_e.Jh)(this,function(j){switch(j.label){case 0:return n=this,[4,fetch(n.baseLocation+"/assets/images/file-alt-solid.png")];case 1:return[4,j.sent().blob()];case 2:return r=j.sent(),a=new File([r],o.file.name),this.logger.log("[LOADER-PREVIEW-PAGE] - createFile file - file",a),(u=new FileReader).onloadend=function(){var J=new Image;y.logger.debug("[LOADER-PREVIEW-PAGE] onload ",J),J.src=u.result.toString(),J.title=o.file.name,J.onload=function(){var ie={name:J.title,src:n.sanitizer.bypassSecurityTrustUrl(J.src),width:80,height:106,type:o.metadata.type,uid:o.metadata.uid};n.logger.debug("[LOADER-PREVIEW-PAGE] OK: ",ie),n.arrayFiles.push({metadata:ie}),n.fileSelected||(n.fileSelected=Object.assign({},ie))}},u.readAsDataURL(a),[2]}})})},i.prototype.onTextAreaChange=function(){this.resizeInputField(),this.resizeModalHeight()},i.prototype.setFocusOnId=function(o){setTimeout(function(){var n=document.getElementById(o);n&&(n.setAttribute("value"," "),n.focus())},500)},i.prototype.resizeInputField=function(){try{var o=document.getElementById("chat21-main-message-context-preview");o.style.height="100%","\n"===o.value?(o.value="",o.style.height=this.HEIGHT_DEFAULT):o.scrollHeight>o.offsetHeight?(o.style.height=o.scrollHeight+2+"px",o.style.minHeight=this.HEIGHT_DEFAULT):o.style.height=this.HEIGHT_DEFAULT}catch(n){this.logger.error("[LOADER-PREVIEW-PAGE] > Error :"+n)}},i.prototype.resizeModalHeight=function(){try{var o=document.getElementById("chat21-main-message-context-preview"),n=+o.style.height.substring(0,o.style.height.length-2);n>20&&n<110?this.scrollMe.nativeElement.style.height="calc(39% + "+(n-20)+"px":n<=20&&(this.scrollMe.nativeElement.style.height="39%")}catch(t){this.logger.error("[LOADER-PREVIEW-PAGE] > Error :"+t)}},i.prototype.restoreTextArea=function(){this.resizeInputField();var o=document.getElementById("chat21-main-message-context-preview");this.textInputTextArea="",o?(o.value="",o.placeholder=this.translationMap.get("LABEL_PLACEHOLDER"),this.logger.debug("[LOADER-PREVIEW-PAGE] AppComponent:restoreTextArea::restoreTextArea::textArea:","restored")):this.logger.error("[LOADER-PREVIEW-PAGE] restoreTextArea::textArea:","not restored"),this.setFocusOnId("chat21-main-message-context-preview")},i.prototype.onkeypress=function(o){var n=o.which||o.keyCode;this.textInputTextArea=document.getElementById("chat21-main-message-context-preview").value,13===n?this.textInputTextArea&&""!==this.textInputTextArea.trim()&&(this.onSendAttachment.emit(this.textInputTextArea),this.restoreTextArea()):9===n&&o.preventDefault()},i.prototype.onkeydown=function(o){27===(o.which||o.keyCode)&&this.onClickClose()},i.prototype.onPaste=function(o){this.resizeInputField(),this.logger.debug("[LOADER-PREVIEW] onPaste",o)},i.prototype.onClickClose=function(){this.logger.debug("[LOADER-PREVIEW] onCLose"),this.onCloseModalPreview.emit()},i.prototype.onSendPressed=function(o){this.logger.debug("[LOADER-PREVIEW] onSendPressed",o),this.onSendAttachment.emit(this.textInputTextArea)},i.prototype.onImageRenderedFN=function(o){this.isFilePendingToLoad=!1},i.\u0275fac=function(n){return new(n||i)(e.Y36(Le.H7))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation-attachment-preview"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Sa,5),2&n)&&(e.iGM(r=e.CRH())&&(t.scrollMe=r.first))},inputs:{textInputTextArea:"textInputTextArea",attachments:"attachments",baseLocation:"baseLocation",translationMap:"translationMap",stylesMap:"stylesMap"},outputs:{onSendAttachment:"onSendAttachment",onCloseModalPreview:"onCloseModalPreview"},decls:29,vars:13,consts:[["id","c21-preview"],["id","divPreview",1,"modal-preview-image"],["divPreview",""],[1,"c21-header"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","-1",1,"c21-header-button","c21-right","c21-close","c21-button-clean",3,"ngStyle","click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],["id","altIconTitle"],["id","scroll-me-preview",1,"c21-content"],["scrollMePreview",""],[3,"metadata","width","height","onImageRendered",4,"ngIf"],["id","img-preview-file-extension"],["id","c21-footer"],[1,"visible-text-area"],["start-focus-chat21-conversation-preview-component","","inputTextArea","","tabindex","1502","aria-labelledby","altTextArea","rows","1","id","chat21-main-message-context-preview",1,"f21textarea","c21-button-clean",3,"ngModel","placeholder","ngModelChange","keypress","keydown","paste"],["textbox",""],["tabindex","-1","id","chat21-button-send",1,"chat21-textarea-button",3,"click"],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24",0,"xml","space","preserve",2,"enable-background","new 0 0 24 24"],["d","M1.8,18.9V1.7L22,10.3L1.8,18.9z M3.9,15.6l12.6-5.4L3.9,4.9v3.7l6.4,1.6l-6.4,1.6V15.6z M3.9,15.6V4.9v7V15.6z"],["id","testFocus","tabindex","1599","onFocus","document.querySelector('[start-focus-chat21-conversation-preview-component]').focus()"],["id","altTextArea",2,"display","none"],[3,"metadata","width","height","onImageRendered"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1,2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.onClickClose()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.TgZ(10,"title",10),e._uU(11),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",11,12),e.YNc(14,Pa,1,3,"chat-image",13),e.TgZ(15,"div",14),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",15),e.TgZ(18,"div",16),e.TgZ(19,"textarea",17,18),e.NdJ("ngModelChange",function(a){return t.textInputTextArea=a})("ngModelChange",function(){return t.onTextAreaChange()})("keypress",function(a){return t.onkeypress(a)})("keydown",function(a){return t.onkeydown(a)})("paste",function(a){return t.onPaste(a)}),e._uU(21," "),e.qZA(),e.qZA(),e.TgZ(22,"div",19),e.NdJ("click",function(a){return t.onSendPressed(a)}),e.TgZ(23,"span",20),e.O4$(),e.TgZ(24,"svg",21),e._UZ(25,"path",22),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e._UZ(26,"span",23),e.TgZ(27,"span",24),e._uU(28,"scrivi la tua domanda"),e.qZA()),2&n&&(e.xp6(6),e.Q6J("ngStyle",e.VKq(9,ka,t.hideHeaderCloseButton?"none":"flex")),e.xp6(1),e.Q6J("ngStyle",e.VKq(11,Aa,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(4),e.Oqu(null==t.translationMap?null:t.translationMap.get("CLOSE")),e.xp6(3),e.Q6J("ngIf",t.fileSelected),e.xp6(2),e.hij("",t.file_extension," "),e.xp6(3),e.s9C("placeholder",null==t.translationMap?null:t.translationMap.get("LABEL_PLACEHOLDER")),e.Q6J("ngModel",t.textInputTextArea),e.xp6(3),e.ekj("active",!t.isFilePendingToLoad))},directives:[me.PC,me.O5,Oe.Fj,Oe.JJ,Oe.On,qn],styles:["[_nghost-%COMP%] .c21-content[_ngcontent-%COMP%] >chat-image div{margin:2px auto!important}#c21-preview[_ngcontent-%COMP%]{--margin-top: 200px;--margin-left: 50px;--margin-right: 50px;--header-height: 40px;--modal-height: 240px;--modal-width: 80%;--content-height: 160px;--border-radius: 16px;background-color:rgba(0,0,0,.4);height:100%;width:100%;position:absolute;z-index:25}#c21-preview[_ngcontent-%COMP%] .modal-preview-image[_ngcontent-%COMP%]{width:auto;height:auto;min-height:var(--modal-height);min-width:100px;max-width:80%;border-radius:var(--border-radius);font-size:1.2em;line-height:normal;overflow:hidden;background-color:#fff;z-index:25;margin:auto;margin-top:var(--margin-top)}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{height:calc(var(--header-height));width:var(--modal-width);position:fixed;top:var(--margin-top)}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{height:calc(var(--header-height))}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;display:inline-block;width:auto;height:40px;padding:0;margin:0 10px;font-size:1em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}#c21-preview[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{margin:6px;width:30px;height:30px}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%]{position:fixed;top:calc(var(--margin-top) + var(--header-height));width:var(--modal-width);height:var(--content-height);display:flex;justify-content:center;align-items:center}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #c21-contentScroll-preview[_ngcontent-%COMP%]{position:absolute;left:0px;right:10px;padding:10px;opacity:0;transition:opacity .5s;transition-timing-function:ease-in}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]{height:100%;width:100%;overflow-y:auto;overflow-x:hidden;position:absolute;top:0;right:0}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview[_ngcontent-%COMP%]{scroll-behavior:smooth}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #scroll-me-preview.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}#c21-preview[_ngcontent-%COMP%] .c21-content[_ngcontent-%COMP%] #img-preview-file-extension[_ngcontent-%COMP%]{text-align:center;position:absolute;text-transform:uppercase;color:#fff;bottom:30px;font-weight:500}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%]{position:fixed;top:calc(var(--margin-top) + var(--header-height) + var(--content-height));width:var(--modal-width);border-radius:var(--border-radius);background:white;--heigth: calc( var(--modal-height) - var(--header-height) - var(--content-height));--paddingTopBottom: 8px;display:flex;grid-gap:5px;gap:5px;padding:var(--paddingTopBottom) 10px;box-sizing:border-box}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]{overflow:hidden;word-wrap:break-word;resize:horizontal;overflow-y:auto;box-sizing:border-box;color:#1a1a1a;min-width:100%;outline:0;resize:none;font-size:1.4em;line-height:1.4em;font-weight:300;max-height:110px;min-height:auto;height:20px;padding:0 12px;margin:10px 0;border:none}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-main-message-context-preview[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{position:absolute;display:block;bottom:22px;height:var(--heigth);opacity:.3;cursor:auto;cursor:initial}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button.active[_ngcontent-%COMP%]{opacity:1;cursor:pointer}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] #chat21-button-send[_ngcontent-%COMP%]{right:8px;bottom:var(--paddingTopBottom)}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .visible-text-area[_ngcontent-%COMP%]{pointer-events:auto;border-radius:10px;background-color:#f6f7fb;-webkit-box-flex:1;width:88%}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{pointer-events:auto}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] .chat21-textarea-button[_ngcontent-%COMP%]{fill:#5f6368;pointer-events:auto}#c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:visited, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:hover, #c21-preview[_ngcontent-%COMP%] #c21-footer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:active{all:unset}"]}),i}(),Ra=["afConversationComponent"];function La(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-internal-frame",9),e.NdJ("onOpenExternal",function(a){return e.CHM(n),e.oxw().onOpenExternalFrame(a)})("onClose",function(a){return e.CHM(n),e.oxw().onCloseInternalFrame(a)}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("button",t.buttonClicked)("openExternalLinkButton",null==t.g?null:t.g.openExternalLinkButton)("translationMap",t.translationMapHeader)("stylesMap",t.stylesMap)}}function Na(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-conversation-attachment-preview",10),e.NdJ("onSendAttachment",function(a){return e.CHM(n),e.oxw().onSendAttachment(a)})("onCloseModalPreview",function(){return e.CHM(n),e.oxw().onCloseModalPreview()}),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("textInputTextArea",t.textInputTextArea)("attachments",t.attachments)("baseLocation",null==t.g?null:t.g.baseLocation)("translationMap",t.translationMapPreview)("stylesMap",t.stylesMap)}}function Fa(i,o){if(1&i&&(e.O4$(),e.kcU(),e.TgZ(0,"div",16),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.messagesBadgeCount)}}function Ba(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",11),e.NdJ("click",function(){return e.CHM(n),e.oxw().scrollToBottom()}),e.O4$(),e.TgZ(1,"svg",12),e._UZ(2,"path",13),e._UZ(3,"path",14),e.qZA(),e.YNc(4,Fa,2,1,"div",15),e.qZA()}if(2&i){var t=e.oxw();e.xp6(4),e.Q6J("ngIf",0!=t.messagesBadgeCount)}}var Ua=function(){function i(o,n,t,r,a,u,y,j,J,ie,ue,ge,de){this.g=o,this.starRatingWidgetService=n,this.sanitizer=t,this.appComponent=r,this.appStorageService=a,this.conversationHandlerBuilderService=u,this.appConfigService=y,this.customTranslateService=j,this.chatManager=J,this.typingService=ie,this.tiledeskRequestService=ue,this.changeDetectorRef=ge,this.elementRef=de,this.onBackHome=new e.vpe,this.onCloseWidget=new e.vpe,this.onSoundChange=new e.vpe,this.onConversationClosed=new e.vpe,this.onSignOut=new e.vpe,this.onBeforeMessageSent=new e.vpe,this.onAfterSendMessage=new e.vpe,this.onNewConversationInit=new e.vpe,this.onBeforeMessageRender=new e.vpe,this.onAfterMessageRender=new e.vpe,this.onNewMessageCreated=new e.vpe,this.onNewConversationButtonClicked=new e.vpe,this.isMenuShow=!1,this.isEmojiiPickerShow=!1,this.isButtonsDisabled=!0,this.hideFooterTextReply=!1,this.hideTextAreaContent=!1,this.footerMessagePlaceholder="",this.isTrascriptDownloadEnabled=!1,this.showContinueConversationButton=!1,this.isScrolling=!1,this.idDivScroll="c21-contentScroll",this.showBadgeScroollToBottom=!1,this.messagesBadgeCount=0,this.isFileSelected=!1,this.isOpenAttachmentPreview=!1,this.isPopupUrl=gn,this.popupUrl=Ht,this.messages=[],this.CLIENT_BROWSER=navigator.userAgent,this.subscriptions=[],this.unsubscribe$=new la.xQ,this.isIE=/msie\s|trident\//i.test(window.navigator.userAgent),this.firstScroll=!0,this.tooltipOptions={"show-delay":1500,"tooltip-class":"chat-tooltip",theme:"light",shadow:!1,"hide-delay-mobile":0,hideDelayAfterClick:3e3,"hide-delay":200},this.isTypings=!1,this.isDirect=!1,this.membersConversation=["SYSTEM"],this.isButtonUrl=!1,this.logger=Ce.getInstance()}return i.prototype.onResize=function(o){this.logger.debug("[CONV-COMP] resize event",o)},i.prototype.ngOnInit=function(){this.logger.debug("[CONV-COMP] ngOnInit: ",this.senderId),this.showMessageWelcome=!1,this.translations()},i.prototype.translations=function(){this.translationMapHeader=this.customTranslateService.translateLanguage(["LABEL_LAST_ACCESS","LABEL_WRITING","BUTTON_CLOSE_TO_ICON","OPTIONS","PREV_CONVERSATIONS","SOUND_OFF","SOUND_ON","DOWNLOAD_TRANSCRIPT","BACK","CLOSE","MAXIMIZE","MINIMIZE","CLOSE_CHAT","RESTART","LOGOUT"]),this.translationMapFooter=this.customTranslateService.translateLanguage(["LABEL_PLACEHOLDER","GUEST_LABEL","LABEL_START_NW_CONV","CONTINUE"]),this.translationMapContent=this.customTranslateService.translateLanguage(["INFO_SUPPORT_USER_ADDED_SUBJECT","INFO_SUPPORT_USER_ADDED_YOU_VERB","INFO_SUPPORT_USER_ADDED_COMPLEMENT","INFO_SUPPORT_USER_ADDED_VERB","INFO_SUPPORT_CHAT_REOPENED","INFO_SUPPORT_CHAT_CLOSED","INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU","INFO_SUPPORT_LEAD_UPDATED","INFO_SUPPORT_MEMBER_LEFT_GROUP","LABEL_TODAY","LABEL_TOMORROW","LABEL_LOADING","LABEL_TO","ARRAY_DAYS"]),this.translationMapPreview=this.customTranslateService.translateLanguage(["BACK","CLOSE","LABEL_PLACEHOLDER","LABEL_PREVIEW"])},i.prototype.ngAfterViewInit=function(){var o=this;this.logger.debug("[CONV-COMP] --------ngAfterViewInit: conversation-------- "),setTimeout(function(){o.initAll(),!0===o.g.newConversationStart&&(o.onNewConversationComponentInit(),o.g.newConversationStart=!1),o.setSubscriptions(),o.afConversationComponent&&o.afConversationComponent.nativeElement.focus(),o.isButtonsDisabled=!1},300)},i.prototype.ngAfterViewChecked=function(){this.changeDetectorRef.detectChanges()},i.prototype.ngOnChanges=function(o){this.logger.debug("[CONV-COMP] onChagnges",o),this.stylesMap&&(this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))),o&&o.conversationId&&void 0!==o.conversationId.previousValue&&o.conversationId.previousValue!==o.conversationId.currentValue&&(this.logger.debug("[CONV-COMP] UID CHANGESSSS",o.conversationId),this.ngOnDestroy(),this.ngOnInit(),this.ngAfterViewInit())},i.prototype.updateConversationBadge=function(){if(this.logger.debug("[CONV-COMP] updateConversationBadge",this.conversationId,this.isConversationArchived),this.isConversationArchived&&this.conversationId&&this.archivedConversationsHandlerService&&this.archivedConversationsHandlerService.setConversationRead(this.conversationId),!this.isConversationArchived&&this.conversationId&&this.conversationsHandlerService){this.conversationsHandlerService.setConversationRead(this.conversationId);var o=this.conversationsHandlerService.countIsNew();this.g.setParameter("conversationsBadge",o)}},i.prototype.initAll=function(){var o=this;this.logger.debug("[CONV-COMP] ------ 2: setConversation ------ "),this.setConversation(),this.logger.debug("[CONV-COMP] ------ 3: connectConversation ------ "),this.initConversationHandler(),this.logger.debug("[CONV-COMP] ------ 4: initializeChatManager ------ "),this.logger.debug("[CONV-COMP] ------ 6: getConversationDetail ------ ",this.conversationId),this.getConversationDetail(function(n){o.logger.debug("[CONV-COMP] ------ 6: updateConversationbage ------ "),o.updateConversationBadge()}),this.g.customAttributes&&this.updateUserInfo(this.g.customAttributes),this.logger.debug("[CONV-COMP] ------ 7: initializeTyping()",this.conversationId),this.initializeTyping()},i.prototype.getConversationDetail=function(o){var n=this;this.logger.debug("[CONV-COMP] getConversationDetail: isConversationArchived???",this.isConversationArchived,this.conversationWith),this.conversationsHandlerService.getConversationDetail(this.conversationWith,function(t){n.logger.debug("[CONV-COMP] getConversationDetail: conversationsHandlerService ",n.conversationWith,t,n.isConversationArchived),t&&(n.conversation=t,n.isConversationArchived=!1,o(n.isConversationArchived)),t||(n.logger.debug("[CONV-COMP] getConversationDetail: conv not exist --\x3e search in archived list",n.isConversationArchived,n.conversationWith),n.archivedConversationsHandlerService.getConversationDetail(n.conversationWith,function(r){if(n.logger.debug("[CONV-COMP] getConversationDetail: archivedConversationsHandlerService",n.conversationWith,r,n.isConversationArchived),r){n.conversation=r,n.isConversationArchived=!0;var a=function(i,o){var n=xe(i),t=xe(o),r=xe.duration(t.diff(n));return{days:r.asDays(),hours:r.asHours(),minutes:r.asMinutes()}}(n.conversation.timestamp,Date.now());n.showContinueConversationButton=a.hours<n.g.continueConversationBeforeTime,o(n.isConversationArchived)}else r||o(null)}))})},i.prototype.setConversation=function(){var o=this.g.recipientId,n=this.g.channelType;this.logger.debug("[CONV-COMP] setConversation recipientId::: ",o,n),o||this.g.setParameter("recipientId",this.setRecipientId()),n||this.g.setParameter("channelType",this.setChannelType()),this.conversationWith=o,this.logger.debug("[CONV-COMP] setConversation conversation::: ",this.conversation),this.conversation||(this.conversation=new sa(o,this.g.attributes,n,this.g.recipientFullname,this.conversationWith,o,this.g.recipientFullname,"",!0,"","",this.senderId,"",this.g.userFullname,"0","",!0,"","",!1,"text"))},i.prototype.setRecipientId=function(){var o;return(o=this.appStorageService.getItem(this.senderId))||(o=dn+this.g.projectid+"-"+(0,Ne.Z)().replace(/-/g,""),this.logger.debug("[CONV-COMP] recipitent",o)),o},i.prototype.setChannelType=function(){var o="group",n=this.g.projectid;return this.g.recipientId&&-1!==this.g.recipientId.indexOf("group")?o="group":n||(o="direct"),o},i.prototype.initConversationHandler=function(){var o=this.g.tenant;this.messages=[];var n={uid:this.senderId},t=this.g.recipientFullname;this.logger.debug("[CONV-COMP] initconversation NEWWW",n,t,o),this.showMessageWelcome=!1;var r=this.chatManager.getConversationHandlerByConversationId(this.conversationWith);if(this.logger.debug("[CONV-COMP] DETTAGLIO CONV - handler **************",r,this.conversationWith),r)this.logger.debug("[CONV-COMP] NON ENTRO ***",this.conversationHandlerService,r),this.conversationHandlerService=r,this.messages=this.conversationHandlerService.messages;else{this.conversationHandlerService=this.conversationHandlerBuilderService.build(),this.conversationHandlerService.initialize(this.conversationWith,t,n,o,this.translationMapContent,this.g.showInfoMessage),this.conversationHandlerService.connect(),this.logger.debug("[CONV-COMP] DETTAGLIO CONV - NEW handler **************",this.conversationHandlerService),this.messages=this.conversationHandlerService.messages,this.sendFirstMessagePreChatForm(),this.logger.debug("[CONV-COMP] DETTAGLIO CONV - messages **************",this.messages),this.chatManager.addConversationHandler(this.conversationHandlerService);var a=this;setTimeout(function(){(!a.messages||0===a.messages.length)&&(a.showMessageWelcome=!0,a.logger.debug("[CONV-COMP] setTimeout ***",a.showMessageWelcome))},8e3)}this.logger.debug("[CONV-COMP] CONVERSATION MESSAGES "+this.messages),this.conversationsHandlerService=this.chatManager.conversationsHandlerService,this.archivedConversationsHandlerService=this.chatManager.archivedConversationsService},i.prototype.sendFirstMessagePreChatForm=function(){var o=this;setTimeout(function(){o.messages&&0===o.messages.length&&(o.logger.debug("[CONV-COMP] sendFirstMessage: messages + attributes ",o.messages,o.g.attributes),o.g.attributes&&o.g.attributes.preChatForm&&o.g.attributes.preChatForm.firstMessage)&&o.conversationFooter.sendMessage(o.g.attributes.preChatForm.firstMessage,Nt,o.g.attributes)},1e3)},i.prototype.initializeTyping=function(){this.logger.debug("[CONV-COMP] membersconversation",this.membersConversation),this.membersConversation.push(this.senderId),this.typingService.isTyping(this.conversationId,this.senderId,this.isDirect)},i.prototype.subscribeTypings=function(o){var n=this;try{var t=o.uidUserTypingNow,r=o.waitTime;this.nameUserTypingNow=null,this.idUserTypingNow=null,o.nameUserTypingNow&&(this.nameUserTypingNow=o.nameUserTypingNow),o.uidUserTypingNow&&(this.idUserTypingNow=o.uidUserTypingNow),this.logger.debug("[CONV-COMP] subscribeTypings data:",o),!this.membersConversation.includes(t)&&t&&(this.isTypings=!0,setTimeout(function(){n.conversationContent.scrollToBottom()},0),this.setTimeoutWritingMessages=setTimeout(function(){n.isTypings=!1},r))}catch(u){this.logger.error("[CONV-COMP] error: ",u)}},i.prototype.initiTimeout=function(o){var n=this;this.setTimeoutWritingMessages=setTimeout(function(){n.isTypings=!1},o)},i.prototype.resetTimeout=function(){this.isTypings=!1,this.setTimeoutWritingMessages=null,clearTimeout(this.setTimeoutWritingMessages)},i.prototype.setSubscriptions=function(){var t,r,o=this,n=this;r="starRating",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.starRatingWidgetService.setOsservable(!1),this.logger.debug("[CONV-COMP] setSubscriptions!!!! StartRating",this.starRatingWidgetService.obsCloseConversation.value),t=this.starRatingWidgetService.obsCloseConversation.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(u){o.logger.debug("[CONV-COMP] startratingggg",u),n.g.setParameter("isOpenStartRating",u),!1===u?o.logger.debug("[CONV-COMP] NOT OPEN StartRating **"):!0===u&&o.logger.debug("[CONV-COMP] OPEN StartRating **")}),this.subscriptions.push({key:r,value:t})),r="messageAdded",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageAdded *****",this.conversationHandlerService),t=this.conversationHandlerService.messageAdded.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageAdded *****",y),y&&(n.newMessageAdded(y),o.onNewMessageCreated.emit(y),o.checkMessagesLegntForTranscriptDownloadMenuOption(),o.resetTimeout())}),this.subscriptions.push({key:r,value:t})),r="conversationsRemoved",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.chatManager.conversationsHandlerService.conversationRemoved.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DATAIL conversationsRemoved *****",y,o.conversationWith,o.isConversationArchived),y&&y.uid===o.conversationWith&&(o.isConversationArchived=!0,o.g.nativeRating&&o.starRatingWidgetService.setOsservable(!0),o.g.nativeRating||o.onConversationClosed.emit(y.uid))}),this.subscriptions.push({key:r,value:t})),r="conversationsChanged",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.chatManager.conversationsHandlerService.conversationChanged.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DATAIL conversationsChanged *****",y,o.conversationWith,o.isConversationArchived),y&&y.recipient===o.g.senderId&&On(y)||!y||y.sender===o.senderId||n.conversationContent.checkContentScrollPosition()&&y.is_new&&(o.logger.debug("[CONV-COMP] updateConversationBadge..."),n.updateConversationBadge())}),this.subscriptions.push({key:r,value:t})),r="messageWait",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageWait *****",this.conversationHandlerService),t=this.conversationHandlerService.messageWait.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageWait *****",y),y&&y.waitTime&&0!==y.waitTime&&o.conversationId===y.uid&&n.subscribeTypings(y)}),this.subscriptions.push({key:r,value:t})),r="messageInfo",(t=this.subscriptions.find(function(u){return u.key===r}))||(this.logger.debug("[CONV-COMP] ***** add messageInfo *****",this.conversationHandlerService),t=this.conversationHandlerService.messageInfo.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** DETAIL messageInfo *****",y),y&&o.updateLeadInfo(y)}),this.subscriptions.push({key:r,value:t})),r="conversationTyping",(t=this.subscriptions.find(function(u){return u.key===r}))||(t=this.typingService.BSIsTyping.pipe((0,lt.R)(this.unsubscribe$)).subscribe(function(y){o.logger.debug("[CONV-COMP] ***** BSIsTyping *****",y),y&&o.conversationId===y.uid&&n.subscribeTypings(y)}),this.subscriptions.push({key:r,value:t}))},i.prototype.checkMessagesLegntForTranscriptDownloadMenuOption=function(){this.messages.length>1&&this.g.allowTranscriptDownload&&(this.isTrascriptDownloadEnabled=!0)},i.prototype.newMessageAdded=function(o){var n=this,t=n.senderId;o.sender===t?(n.logger.debug("[CONV-COMP] *A1-------"),setTimeout(function(){n.conversationContent.scrollToBottom()},200)):o.sender!==t&&(n.conversationContent.checkContentScrollPosition()?(n.logger.debug("[CONV-COMP] *A2-------"),setTimeout(function(){n.conversationContent.scrollToBottom()},200)):(n.logger.debug("[CONV-COMP] *A3-------"),n.messagesBadgeCount++),o.attributes&&o.attributes.disableInputMessage?this.hideFooterTextReply=o.attributes.disableInputMessage:o.attributes&&!o.attributes.disableInputMessage&&(this.hideFooterTextReply=!1),this.footerMessagePlaceholder=o.attributes&&o.attributes.inputMessagePlaceholder?o.attributes.inputMessagePlaceholder:"")},i.prototype.updateLeadInfo=function(o){if(o.attributes&&o.attributes.updateUserFullname){var n=o.attributes.updateUserFullname;this.logger.debug("[CONV-COMP] newMessageAdded --\x3e updateUserFullname",n),this.g.setAttributeParameter("userFullname",n),this.g.setParameter("userFullname",n),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))}if(o.attributes&&o.attributes.updateUserEmail){var t=o.attributes.updateUserEmail;this.logger.debug("[CONV-COMP] newMessageAdded --\x3e userEmail",t),this.g.setAttributeParameter("userEmail",t),this.g.setParameter("userEmail",t),this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))}},i.prototype.updateUserInfo=function(o){if(o&&o.userFullname){var n=o.userFullname;this.logger.debug("[CONV-COMP] updateUserInfo --\x3e userFullname",n),this.g.setAttributeParameter("userFullname",n),this.g.setParameter("userFullname",n)}if(o&&o.userEmail){var t=o.userEmail;this.logger.debug("[CONV-COMP] updateUserInfo --\x3e userEmail",t),this.g.setAttributeParameter("userEmail",t),this.g.setParameter("userEmail",t)}this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes))},i.prototype.scrollToBottom=function(){this.conversationContent.scrollToBottom()},i.prototype.onBackHomeFN=function(){this.onBackHome.emit()},i.prototype.onCloseWidgetFN=function(){this.onCloseWidget.emit()},i.prototype.onSoundChangeFN=function(o){this.onSoundChange.emit(o)},i.prototype.onCloseChat=function(o){var n=this;this.logger.debug("[CONV-COMP] close chat with uid ",this.conversation.uid),this.tiledeskRequestService.closeSupportGroup(this.conversation.uid).then(function(t){"closed"===t&&(n.isMenuShow=!1,n.logger.debug("[CONV-COMP] chat closed successfully with uid ",n.conversation.uid))}).catch(function(t){n.logger.error("[CONV-COMP] ERROR while closing chat with id: ",n.conversation.uid,t)})},i.prototype.onRestartChat=function(o){this.hideTextAreaContent=!0},i.prototype.onWidgetHeightChange=function(o){var n=this.g.windowContext.window.document.getElementById("tiledeskdiv");"max"===o?n.style.maxHeight="unset":"min"===o&&(n.style.maxHeight="620px"),this.isMenuShow=!1},i.prototype.onSignOutFN=function(o){this.onSignOut.emit(!0)},i.prototype.onMenuOption=function(o){this.isMenuShow=o,this.conversationFooter.removeFocusOnId("chat21-main-message-context")},i.prototype.onBeforeMessageRenderFN=function(o){this.onBeforeMessageRender.emit(o)},i.prototype.onAfterMessageRenderFN=function(o){this.onAfterMessageRender.emit(o)},i.prototype.onAttachmentButtonClicked=function(o){if(this.logger.debug("[CONV-COMP] eventbutton",o),o&&o.target.type)switch(o.target.type){case"url":try{this.openLink(o.target.button)}catch(r){this.logger.error("[CONV-COMP] url > Error :"+r)}return;case"action":try{this.actionButton(o.target.button)}catch(r){this.logger.error("[CONV-COMP] action > Error :"+r)}return!1;case"text":try{this.conversationFooter.sendMessage(o.target.button.value,Nt,{button:!0})}catch(r){this.logger.error("[CONV-COMP] text > Error :"+r)}default:return}},i.prototype.onScrollContent=function(o){this.showBadgeScroollToBottom=!o,this.logger.debug("[CONV-COMP] scroool eventtt",o),this.showBadgeScroollToBottom||(this.messagesBadgeCount=0,this.updateConversationBadge())},i.prototype.onOpenExternalFrame=function(o){window.open(o.link,"_blank")},i.prototype.onCloseInternalFrame=function(o){this.isButtonUrl=!1,this.buttonClicked=null,this.restoreDefaultWidgetSize()},i.prototype.onSendAttachment=function(o){this.isOpenAttachmentPreview=!1,this.conversationFooter.uploadSingle(this.attachments[0].metadata,this.attachments[0].file,o)},i.prototype.onCloseModalPreview=function(){this.isOpenAttachmentPreview=!1,this.conversationFooter.isFilePendingToUpload=!1,this.logger.debug("[CONV-COMP] onCloseModalPreview::::",this.isOpenAttachmentPreview,this.conversationFooter)},i.prototype.onEmojiiPickerShow=function(o){this.isEmojiiPickerShow=o},i.prototype.onBeforeMessangeSentFN=function(o){this.onBeforeMessageSent.emit(o)},i.prototype.onAfterSendMessageFN=function(o){this.onAfterSendMessage.emit(o)},i.prototype.onChangeTextArea=function(o){if(o&&o.textAreaEl){var n=this.conversationContent.scrollMe,t=+o.textAreaEl.style.height.substring(0,o.textAreaEl.style.height.length-2);t>20&&t<110?(n.nativeElement.style.height="calc(100% - "+(t-20)+"px",this.scrollToBottom()):t<=20&&(n.nativeElement.style.height="100%")}},i.prototype.onAttachmentFileButtonClicked=function(o){this.logger.debug("[CONV-COMP] onAttachmentButtonClicked::::",o),this.attachments=o.attachments,this.textInputTextArea=o.message,this.logger.debug("[CONV-COMP] onAttachmentButtonClicked::::",this.textInputTextArea),this.isOpenAttachmentPreview=!0},i.prototype.onNewConversationButtonClickedFN=function(o){this.logger.debug("[CONV-COMP] floating onNewConversationButtonClicked"),this.onNewConversationButtonClicked.emit()},i.prototype.onBackButton=function(o){this.hideTextAreaContent=o;try{document.getElementById("chat21-footer").classList.remove("maximize-width")}catch(t){this.logger.error("[CONV-COMP] onBackButton > Error :"+t)}},i.prototype.openInputFiles=function(){alert("ok"),document.getElementById("chat21-file")&&(document.getElementById("chat21-file").style.display="block")},i.prototype.ngOnDestroy=function(){this.logger.debug("[CONV-COMP] ngOnDestroy ------------------\x3e this.subscriptions",this.subscriptions),this.isConversationArchived=!1,this.hideTextAreaContent=!1,this.conversationFooter.textInputTextArea="",this.hideFooterTextReply=!1,this.footerMessagePlaceholder="",this.unsubscribe()},i.prototype.unsubscribe=function(){this.logger.debug("[CONV-COMP] ******* unsubscribe *******"),this.unsubscribe$.next(),this.unsubscribe$.complete(),this.chatManager.conversationsHandlerService.conversationRemoved.next(null),this.conversationHandlerService.messageWait.next(null),this.typingService.BSIsTyping.next(null),this.subscriptions.forEach(function(o){o.value.unsubscribe()}),this.subscriptions=[],this.subscriptions.length=0,this.logger.debug("[CONV-COMP]this.subscriptions",this.subscriptions)},i.prototype.onIncreaseWith=function(){try{this.g.windowContext.window.document.getElementById("tiledeskdiv").classList.add("increaseSize"),document.getElementById("chat21-conversations").style.borderRadius="16px"}catch(t){this.logger.error("[CONV-COMP] onIncreaseWith > Error :"+t)}},i.prototype.restoreDefaultWidgetSize=function(){try{var o=this.g.windowContext.window.document.getElementById("tiledeskdiv");o.classList.remove("increaseSize"),o.classList.remove("decreaseSize")}catch(n){this.logger.error("[CONV-COMP] restoreDefaultWidgetSize > Error :"+n)}},i.prototype.openLink=function(o){var n=o.link?o.link:"",t=o.target?o.target:"";"self"===t?(this.isButtonUrl=!0,this.buttonClicked=o):"parent"===t?window.open(n,"_parent"):window.open(n,"_blank")},i.prototype.actionButton=function(o){this.conversationFooter.sendMessage(o.value?o.value:"",Nt,null,{action:o.action?o.action:"",subtype:o.show_echo?"":"info"}),this.logger.debug("[CONV-COMP] > action :")},i.prototype.onNewConversationComponentInit=function(){this.logger.debug("[CONV-COMP] ------- onNewConversationComponentInit ------- "),this.setConversation();var o=this.conversationWith,n=this.g.default_settings,t=this.appConfigService.getConfig();this.onNewConversationInit.emit({global:this.g,default_settings:n,newConvId:o,appConfigs:t})},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(en),e.Y36(Le.H7),e.Y36(Qt),e.Y36(He),e.Y36(Ct),e.Y36(Fe),e.Y36(ut),e.Y36(Tt),e.Y36(ht),e.Y36(Jt),e.Y36(e.sBO),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-conversation"]],viewQuery:function(n,t){if(1&n&&(e.Gf(Ra,5),e.Gf(Hn,5),e.Gf(Gn,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.afConversationComponent=r.first),e.iGM(r=e.CRH())&&(t.conversationFooter=r.first),e.iGM(r=e.CRH())&&(t.conversationContent=r.first)}},hostBindings:function(n,t){1&n&&e.NdJ("resize",function(a){return t.onResize(a)},!1,e.Jf7)},inputs:{conversationId:"conversationId",stylesMap:"stylesMap",isOpen:"isOpen",senderId:"senderId",isConversationArchived:"isConversationArchived"},outputs:{onBackHome:"onBackHome",onCloseWidget:"onCloseWidget",onSoundChange:"onSoundChange",onConversationClosed:"onConversationClosed",onSignOut:"onSignOut",onBeforeMessageSent:"onBeforeMessageSent",onAfterSendMessage:"onAfterSendMessage",onNewConversationInit:"onNewConversationInit",onBeforeMessageRender:"onBeforeMessageRender",onAfterMessageRender:"onAfterMessageRender",onNewMessageCreated:"onNewMessageCreated",onNewConversationButtonClicked:"onNewConversationButtonClicked"},features:[e.TTD],decls:9,vars:53,consts:[["id","chat21-conversation-component","tabindex","1500","aria-modal","true"],["afConversationComponent",""],[3,"idConversation","senderId","soundEnabled","isTrascriptDownloadEnabled","hideHeaderCloseButton","hideHeaderBackButton","hideCloseConversationOptionMenu","hideRestartConversationOptionsMenu","hideHeaderConversationOptionsMenu","hideSignOutOptionMenu","stylesMap","translationMap","widgetTitle","windowContext","isMenuShow","isTypings","nameUserTypingNow","typingLocation","onBack","onCloseWidget","onSoundChange","onCloseChat","onRestartChat","onWidgetHeightChange","onSignOut","onMenuOptionShow"],[3,"messages","senderId","baseLocation","isConversationArchived","isTypings","idUserTypingNow","nameUserTypingNow","typingLocation","fullscreenMode","translationMap","stylesMap","onBeforeMessageRender","onAfterMessageRender","onAttachmentButtonClicked","onScrollContent","onMenuOptionShow","onEmojiiPickerShow"],[3,"button","openExternalLinkButton","translationMap","stylesMap","onOpenExternal","onClose",4,"ngIf"],[3,"textInputTextArea","attachments","baseLocation","translationMap","stylesMap","onSendAttachment","onCloseModalPreview",4,"ngIf"],["id","chat21-footer"],["id","chat21-buttonToBottom",3,"click",4,"ngIf"],[3,"conversationWith","attributes","senderId","tenant","projectid","channelType","userFullname","userEmail","showContinueConversationButton","showAttachmentButton","hideTextAreaContent","isConversationArchived","hideTextReply","isMobile","isEmojiiPickerShow","footerMessagePlaceholder","fileUploadAccept","stylesMap","translationMap","onEmojiiPickerShow","onBeforeMessageSent","onAfterSendMessage","onChangeTextArea","onAttachmentFileButtonClicked","onNewConversationButtonClicked","onBackButton"],[3,"button","openExternalLinkButton","translationMap","stylesMap","onOpenExternal","onClose"],[3,"textInputTextArea","attachments","baseLocation","translationMap","stylesMap","onSendAttachment","onCloseModalPreview"],["id","chat21-buttonToBottom",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24"],["opacity",".87","fill","none","d","M24 24H0V0h24v24z"],["d","M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"],["id","chat21-divBudge","class","c21-divBudge",4,"ngIf"],["id","chat21-divBudge",1,"c21-divBudge"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"chat-conversation-header",2),e.NdJ("onBack",function(){return t.onBackHomeFN()})("onCloseWidget",function(){return t.onCloseWidgetFN()})("onSoundChange",function(a){return t.onSoundChangeFN(a)})("onCloseChat",function(a){return t.onCloseChat(a)})("onRestartChat",function(a){return t.onRestartChat(a)})("onWidgetHeightChange",function(a){return t.onWidgetHeightChange(a)})("onSignOut",function(a){return t.onSignOutFN(a)})("onMenuOptionShow",function(a){return t.onMenuOption(a)}),e.qZA(),e.TgZ(3,"chat-conversation-content",3),e.NdJ("onBeforeMessageRender",function(a){return t.onBeforeMessageRenderFN(a)})("onAfterMessageRender",function(a){return t.onAfterMessageRenderFN(a)})("onAttachmentButtonClicked",function(a){return t.onAttachmentButtonClicked(a)})("onScrollContent",function(a){return t.onScrollContent(a)})("onMenuOptionShow",function(a){return t.onMenuOption(a)})("onEmojiiPickerShow",function(a){return t.onEmojiiPickerShow(a)}),e.qZA(),e.YNc(4,La,1,4,"chat-internal-frame",4),e.YNc(5,Na,1,5,"chat-conversation-attachment-preview",5),e.TgZ(6,"div",6),e.YNc(7,Ba,5,1,"div",7),e.TgZ(8,"chat-conversation-footer",8),e.NdJ("onEmojiiPickerShow",function(a){return t.onEmojiiPickerShow(a)})("onBeforeMessageSent",function(a){return t.onBeforeMessangeSentFN(a)})("onAfterSendMessage",function(a){return t.onAfterSendMessageFN(a)})("onChangeTextArea",function(a){return t.onChangeTextArea(a)})("onAttachmentFileButtonClicked",function(a){return t.onAttachmentFileButtonClicked(a)})("onNewConversationButtonClicked",function(a){return t.onNewConversationButtonClickedFN(a)})("onBackButton",function(a){return t.onBackButton(a)}),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("idConversation",t.conversationWith)("senderId",t.senderId)("soundEnabled",null==t.g?null:t.g.soundEnabled)("isTrascriptDownloadEnabled",t.isTrascriptDownloadEnabled)("hideHeaderCloseButton",null==t.g?null:t.g.hideHeaderCloseButton)("hideHeaderBackButton",null==t.g?null:t.g.singleConversation)("hideCloseConversationOptionMenu",t.isConversationArchived||(null==t.g?null:t.g.hideCloseConversationOptionMenu))("hideRestartConversationOptionsMenu",!(null!=t.g&&t.g.singleConversation)&&!t.hideTextAreaContent||(null==t.g?null:t.g.hideRestartConversationOptionsMenu))("hideHeaderConversationOptionsMenu",null==t.g?null:t.g.hideHeaderConversationOptionsMenu)("hideSignOutOptionMenu",!(null!=t.g&&t.g.singleConversation&&null!=t.g&&t.g.showLogoutOption))("stylesMap",t.stylesMap)("translationMap",t.translationMapHeader)("widgetTitle",null==t.g||null==t.g.project?null:t.g.project.widgetTitle)("windowContext",null==t.g?null:t.g.windowContext)("isMenuShow",t.isMenuShow)("isTypings",t.isTypings)("nameUserTypingNow",t.nameUserTypingNow)("typingLocation",null==t.g?null:t.g.typingLocation),e.xp6(1),e.Q6J("messages",t.messages)("senderId",t.senderId)("baseLocation",null==t.g||null==t.g.windowContext.tiledesk?null:t.g.windowContext.tiledesk.getBaseLocation())("isConversationArchived",t.isConversationArchived)("isTypings",t.isTypings)("idUserTypingNow",t.idUserTypingNow)("nameUserTypingNow",t.nameUserTypingNow)("typingLocation",null==t.g?null:t.g.typingLocation)("fullscreenMode",null==t.g?null:t.g.fullscreenMode)("translationMap",t.translationMapContent)("stylesMap",t.stylesMap),e.xp6(1),e.Q6J("ngIf",t.isButtonUrl),e.xp6(1),e.Q6J("ngIf",t.isOpenAttachmentPreview),e.xp6(1),e.ekj("maximize-width",(null==t.g?null:t.g.singleConversation)&&t.hideTextAreaContent||t.isConversationArchived&&!(null!=t.g&&t.g.allowReopen)),e.xp6(1),e.Q6J("ngIf",t.showBadgeScroollToBottom),e.xp6(1),e.Q6J("conversationWith",t.conversationWith)("attributes",null==t.g?null:t.g.attributes)("senderId",t.senderId)("tenant",null==t.g?null:t.g.tenant)("projectid",null==t.g?null:t.g.projectid)("channelType",null==t.g?null:t.g.channelType)("userFullname",null==t.g?null:t.g.userFullname)("userEmail",null==t.g?null:t.g.userEmail)("showContinueConversationButton",(null==t.g?null:t.g.singleConversation)&&t.showContinueConversationButton)("showAttachmentButton",null==t.g?null:t.g.showAttachmentButton)("hideTextAreaContent",(null==t.g?null:t.g.singleConversation)&&t.hideTextAreaContent||t.isConversationArchived&&!(null!=t.g&&t.g.allowReopen))("isConversationArchived",t.isConversationArchived)("hideTextReply",t.hideFooterTextReply)("isMobile",null==t.g?null:t.g.isMobile)("isEmojiiPickerShow",t.isEmojiiPickerShow)("footerMessagePlaceholder",t.footerMessagePlaceholder)("fileUploadAccept",null==t.appConfigService?null:t.appConfigService.getConfig().fileUploadAccept)("stylesMap",t.stylesMap)("translationMap",t.translationMapFooter))},directives:[ya,Gn,me.O5,Hn,Ta,Ia],styles:["[_nghost-%COMP%]{--themeColor: $bck-msg-sent;--foregroundColor: $col-msg-sent}#scroll-me[_ngcontent-%COMP%]{scroll-behavior:smooth}#scroll-me.withoutAnimation[_ngcontent-%COMP%]{scroll-behavior:unset}#chat21-conversation-component[_ngcontent-%COMP%]{position:absolute;background-color:#fff;width:100%;height:100%;top:0px;left:0px;right:0px;bottom:0px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:50px;right:100px;display:inline-block;width:auto;height:42px;padding:0;margin:5px 0;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#chat21-conversation-component[_ngcontent-%COMP%] .titleText[_ngcontent-%COMP%]{position:relative;line-height:40px;text-align:left;font-size:1em}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-project[_ngcontent-%COMP%]{position:relative;padding:0;margin:0 10px 0 0;float:left;height:42px;width:42px;line-height:42px}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-placeholder[_ngcontent-%COMP%]{font-size:16px}#chat21-conversation-component[_ngcontent-%COMP%] .avatar-image[_ngcontent-%COMP%]{max-width:30px;max-height:30px;margin:6px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%]{position:relative;padding:0;margin:0;height:40px;width:40px;min-height:40px;min-width:40px;line-height:40px;border-radius:50%;overflow:hidden;background-color:#fff}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-placeholder[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;text-align:center;font-size:1.4em;color:#fff;font-weight:500}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;background-repeat:no-repeat;background-position:center;background-size:cover;border-radius:50%}#chat21-conversation-component[_ngcontent-%COMP%] .c21-icon-avatar[_ngcontent-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;width:100%;height:100%;min-width:25px;min-height:25px;-o-object-fit:cover;object-fit:cover}#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{position:fixed;left:0px;right:0px}#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-writing[_ngcontent-%COMP%]{position:absolute;left:40px;right:40px;bottom:3px;width:auto;text-align:center;margin:0;padding:0;font-size:1.1em;color:#fff}#chat21-conversation-component[_ngcontent-%COMP%] .rowMsg[_ngcontent-%COMP%]{position:relative;height:auto;display:block}#chat21-conversation-component[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{position:fixed}#chat21-footer[_ngcontent-%COMP%]{position:fixed;bottom:0px;left:0px;right:0px;margin:0;padding:8px 45px 8px 70px;background:white;min-height:40px}#chat21-footer.maximize-width[_ngcontent-%COMP%]{padding:8px 0}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]{display:flex;position:relative;margin-right:-25px;margin-top:-40px;float:right;width:30px;height:30px;border-radius:50%;z-index:1;cursor:pointer;background-color:#fff;border:1px solid rgba(191,191,191,.2);text-align:center}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{margin:auto;fill:#aaa}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]:hover{background-color:var(--themeColor);opacity:1!important;transition:all .45s ease-in-out!important;-moz-transition:all .45s ease-in-out!important;-webkit-transition:all .45s ease-in-out!important;border:1px solid var(--foregroundColor)}#chat21-footer[_ngcontent-%COMP%] #chat21-buttonToBottom[_ngcontent-%COMP%]:hover svg[_ngcontent-%COMP%]{fill:var(--foregroundColor)}#c21-options-menu[_ngcontent-%COMP%]{width:auto;height:auto;min-height:40px;min-width:100px;max-width:80%;position:absolute;z-index:10;top:40px;right:15px;border-radius:6px;font-size:1.2em;line-height:normal;overflow:hidden;border:1px solid #d7d7d7;background-color:#fff;padding:10px 0}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{padding:6px 10px;display:flex;align-items:center}#c21-options-menu[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]:hover{background-color:#f5f5f5;cursor:pointer}#c21-options-menu[_ngcontent-%COMP%] .label-menu-item[_ngcontent-%COMP%]{line-height:20px;position:relative;margin:0 10px}@media (max-width: 451px){#chat21-conversation-component[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-header-button.c21-close[_ngcontent-%COMP%]{display:flex}}"]}),i}(),Za=ye(42265),Da=["div_input"];function Ha(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",null==n.translationErrorLabelMap?null:n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}function za(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",null==n.element?null:n.element.errorLabel," ")}}var ja=function(i){return{"is-empty":i}},qa=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.onKeyEnterPressed=new e.vpe,this.inputType="text"}return i.prototype.ngOnInit=function(){var o=this;this.form=this.rootFormGroup.control,this.form&&this.form.controls&&this.form.controls[this.controlName]&&this.form.controls[this.controlName].valueChanges.subscribe(function(n){o.hasSubmitted=!1,o.setFormStyle()})},i.prototype.ngOnChanges=function(o){this.controlName&&(this.controlName.toLowerCase().includes("email")||this.controlName.toLowerCase().includes("e-mail"))&&(this.inputType="email"),this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onFocusOut=function(){this.input.nativeElement.classList.remove("is-focused")},i.prototype.onFocus=function(){this.input.nativeElement.classList.add("is-focused")},i.prototype.onEnterPressed=function(o){this.onKeyEnterPressed.emit(o)},i.prototype.setFormStyle=function(){this.form.controls[this.controlName].hasError("pattern")||this.form.controls[this.controlName].hasError("required")||this.form.controls[this.controlName].invalid?(this.input.nativeElement.classList.add("form-danger"),this.input.nativeElement.classList.remove("form-success")):this.form.controls[this.controlName].valid&&(this.input.nativeElement.classList.remove("form-danger"),this.input.nativeElement.classList.add("form-success"))},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-text"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Da,5),2&n)&&(e.iGM(r=e.CRH())&&(t.input=r.first))},inputs:{element:"element",controlName:"controlName",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:8,vars:12,consts:[[3,"formGroup"],["id","div_input",1,"form-group","label-floating",3,"ngClass"],["div_input",""],[1,"control-label"],[1,"form-control",3,"formControlName","type","tabIndex","keydown.enter","focus","focusout"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1,2),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.TgZ(5,"input",4),e.NdJ("keydown.enter",function(a){return t.onEnterPressed(a)})("focus",function(){return t.onFocus()})("focusout",function(){return t.onFocusOut()}),e.qZA(),e.qZA(),e.YNc(6,Ha,2,1,"div",5),e.YNc(7,za,2,1,"div",5),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(1),e.Q6J("ngClass",e.VKq(10,ja,!(null!=t.form&&t.form.controls[t.element.name].value))),e.xp6(3),e.hij(" ",null==t.element?null:t.element.text," "),e.xp6(1),e.ekj("errors",(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&t.hasSubmitted),e.Q6J("formControlName",null==t.element?null:t.element.name)("type",t.inputType)("tabIndex",null==t.element?null:t.element.tabIndex),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].hasError("required"))),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].errors)&&(null==t.form?null:t.form.controls[null==t.element?null:t.element.name].hasError("pattern"))&&(null==t.element?null:t.element.errorLabel)))},directives:[Oe._Y,Oe.JL,Oe.sg,me.mk,Oe.Fj,Oe.JJ,Oe.u,me.O5],styles:["[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1}.c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;height:36px;display:inline-flex}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}.c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}input[type=text].errors[_ngcontent-%COMP%]{color:red}.text-danger[_ngcontent-%COMP%]{color:red;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}.form-group[_ngcontent-%COMP%]{position:relative;padding-bottom:0;margin:35px 0 0}.form-group[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{font-size:11px;line-height:1.07142857;color:#b3b6b8;font-weight:400;margin:16px 0 0}input[_ngcontent-%COMP%]{border:0;background-image:none;background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:#f6f7fb;transition:background 0s ease-out;float:none;box-shadow:none;border-radius:16px;font-weight:400;height:48px;padding:16px;font-size:14px;line-height:1.42857143;display:block;width:100%;color:#555}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:.3s ease all}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{will-change:left,top,contents}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-2px;left:16px;font-size:14px;line-height:1.42857}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-40px;left:0;font-size:16px;line-height:1.07143;color:#9b9b9c}.form-group.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-28px;left:0;font-size:11px;line-height:1.07143}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-11px;font-size:11px;line-height:1.5}.form-group.form-group-sm.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-5px;font-size:18px;line-height:1.33333}.form-group.form-group-lg.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.is-focused[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{outline:none;background-image:linear-gradient(var(--themeColor),var(--themeColor)),linear-gradient(#D2D2D2,#D2D2D2);background-size:100% 2px,100% 1px;box-shadow:none;transition-duration:.3s}.form-group.is-focused.form-info[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#00bcd4,#00bcd4),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-success[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#4caf50,#4caf50),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-warning[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#ff9800,#ff9800),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-danger[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#f44336,#f44336),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-rose[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#e91e63,#e91e63),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-white[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#FFFFFF,#FFFFFF),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-black[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#555555,#555555),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{color:#aaa}.form-group.is-focused[_ngcontent-%COMP%] select.form-control[_ngcontent-%COMP%]{box-shadow:none;border-color:#d2d2d2}select.form-control[multiple][_ngcontent-%COMP%], .form-group.is-focused[_ngcontent-%COMP%] select.form-control[multiple][_ngcontent-%COMP%]{height:85px}"]}),i}(),Va=function(){function i(o){this.rootFormGroup=o}return i.prototype.ngOnInit=function(){this.form=this.rootFormGroup.control},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-label"]],inputs:{element:"element",controlName:"controlName",hasSubmitted:"hasSubmitted"},decls:2,vars:2,consts:[[1,"c21-header-label"],[1,"c21-form-message-field",3,"innerHTML","tabIndex"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"label",1),e.qZA()),2&n&&(e.xp6(1),e.Q6J("innerHTML",null==t.element?null:t.element.text,e.oJD)("tabIndex",null==t.element?null:t.element.tabIndex))},styles:[".c21-header-label[_ngcontent-%COMP%]{padding:10px 0;position:relative;left:0;right:0}.c21-header-label[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}"]}),i}();function Wa(i,o){if(1&i&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}var Ya=function(i){return{errors:i}},Ga=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.onKeyEnterPressed=new e.vpe}return i.prototype.ngOnInit=function(){this.form=this.rootFormGroup.control},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onEnterPressed=function(o){this.onKeyEnterPressed.emit(o)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-checkbox"]],inputs:{element:"element",controlName:"controlName",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:6,vars:9,consts:[[3,"formGroup"],[1,"c21-body-header-checkbox"],["type","checkbox",1,"form-check-input","errors",3,"formControlName","checked","tabIndex","ngClass","keydown.enter"],[1,"c21-form-message-field"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1),e.TgZ(2,"input",2),e.NdJ("keydown.enter",function(a){return t.onEnterPressed(a)}),e.qZA(),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.YNc(5,Wa,2,1,"div",4),e.qZA(),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(2),e.Q6J("formControlName",null==t.element?null:t.element.name)("checked",null==t.element?null:t.element.value)("tabIndex",null==t.element?null:t.element.tabIndex)("ngClass",e.VKq(7,Ya,t.hasSubmitted&&t.form.controls[null==t.element?null:t.element.name].errors)),e.xp6(2),e.Oqu(null==t.element?null:t.element.text),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&t.form.get(null==t.element?null:t.element.name).errors))},directives:[Oe._Y,Oe.JL,Oe.sg,Oe.Wl,Oe.JJ,Oe.u,me.mk,me.O5],styles:['[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1;--backgroundUnchecked: #ffff;--dangerError: #ff0000}.c21-body-header-checkbox[_ngcontent-%COMP%]{--dangerError: #ff0000;position:relative;left:0;right:0}.c21-body-header-checkbox[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}input[type=radio][_ngcontent-%COMP%], input[type=checkbox][_ngcontent-%COMP%]{height:16px;width:16px;vertical-align:middle;margin:0 .4em .4em 0;border:1px solid var(--themeColor);border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none;transition:box-shadow .2s}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):hover, input[type=checkbox][_ngcontent-%COMP%]:not(:checked):focus{border-width:2px;background-color:#fff;border-radius:4px;box-shadow:0 2px 5px rgba(0,0,0,.25);cursor:pointer;padding:15px 25px;transition:all .1s ease-in}input[type=radio][_ngcontent-%COMP%]:active:not(:disabled), input[type=checkbox][_ngcontent-%COMP%]:active:not(:disabled){border-width:2px}input[type=radio][_ngcontent-%COMP%]:focus, input[type=checkbox][_ngcontent-%COMP%]:focus{outline:none}input[type=radio][_ngcontent-%COMP%]:checked, input[type=checkbox][_ngcontent-%COMP%]:checked{background-color:var(--themeColor);-webkit-animation:shrink-bounce .2s cubic-bezier(.4,0,.23,1);animation:shrink-bounce .2s cubic-bezier(.4,0,.23,1)}input[type=radio][_ngcontent-%COMP%]:checked:before{display:block;height:.4em;width:.4em;position:relative;left:.4em;top:.4em;background:var(--backgroundUnchecked);border-radius:100%;content:""}input[type=checkbox][_ngcontent-%COMP%]:checked:before{content:"";display:block;width:4px;height:10px;border:solid var(--foregroundColor);color:var(--foregroundColor);border-width:0 3px 3px 0;transform:rotate(45deg);margin-left:0;margin-top:-5px;transform-origin:0% 100%;background-color:transparent;-webkit-animation:rippleOn .2s;animation:rippleOn .2s}input[type=checkbox][_ngcontent-%COMP%]:checked:after{border:solid var(--backgroundUnchecked);background-color:var(--themeColor);-webkit-animation:rippleOn .2s forwards;animation:rippleOn .2s forwards}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):before{-webkit-animation:rippleOff .2s;animation:rippleOff .2s}input[type=checkbox][_ngcontent-%COMP%]:not(:checked):after{-webkit-animation:rippleOff .2s;animation:rippleOff .2s}input[_ngcontent-%COMP%]:disabled{opacity:.6;background:rgba(0,0,0,.1);box-shadow:none}input[_ngcontent-%COMP%]:disabled + label[_ngcontent-%COMP%]{opacity:.6;cursor:default;-webkit-user-select:none}input[type=checkbox].errors[_ngcontent-%COMP%]{border:2px solid var(--dangerError)}.text-danger[_ngcontent-%COMP%]{color:var(--dangerError);font-size:1em;min-height:20px;background-color:var(--backgroundUnchecked);margin:0 10px}@-webkit-keyframes rippleOn{0%{opacity:0}50%{opacity:.3}to{opacity:0}}@keyframes rippleOn{0%{opacity:0}50%{opacity:.3}to{opacity:0}}@-webkit-keyframes rippleOff{0%{opacity:0}50%{opacity:.2}to{opacity:0}}@keyframes rippleOff{0%{opacity:0}50%{opacity:.2}to{opacity:0}}']}),i}(),Ja=["div_input"];function Qa(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.translationErrorLabelMap.get("LABEL_ERROR_FIELD_REQUIRED")," ")}}function Ka(i,o){if(1&i&&(e.TgZ(0,"div",6),e._uU(1),e.qZA()),2&i){var n=e.oxw();e.xp6(1),e.hij(" ",n.element.errorLabel," ")}}var Xa=function(i){return{"is-empty":i}},$a=function(){function i(o,n){this.rootFormGroup=o,this.elementRef=n,this.rows=3,this.onKeyEnterPressed=new e.vpe}return i.prototype.ngOnInit=function(){var o=this;this.form=this.rootFormGroup.control,this.form&&this.form.controls&&this.form.controls[this.controlName]&&this.form.controls[this.controlName].valueChanges.subscribe(function(n){o.hasSubmitted=!1,o.setFormStyle()})},i.prototype.ngOnChanges=function(o){this.stylesMap&&this.stylesMap.get("themeColor")&&this.elementRef.nativeElement.style.setProperty("--themeColor",this.stylesMap.get("themeColor")),this.stylesMap&&this.stylesMap.get("foregroundColor")&&this.elementRef.nativeElement.style.setProperty("--foregroundColor",this.stylesMap.get("foregroundColor"))},i.prototype.onFocusOut=function(){this.input.nativeElement.classList.remove("is-focused")},i.prototype.onFocus=function(){this.input.nativeElement.classList.add("is-focused")},i.prototype.onEnterPressed=function(o){o.preventDefault(),this.onKeyEnterPressed.emit(o)},i.prototype.onkeydown=function(o){(o.metaKey||o.shiftKey||o.altKey||o.ctrlKey)&&13===(o.which||o.keyCode)&&(o.preventDefault(),this.form.controls[this.controlName].patchValue(this.form.controls[this.controlName].value+"\r\n"))},i.prototype.setFormStyle=function(){this.form.controls[this.controlName].hasError("pattern")||this.form.controls[this.controlName].hasError("required")||this.form.controls[this.controlName].invalid?(this.input.nativeElement.classList.add("form-danger"),this.input.nativeElement.classList.remove("form-success")):this.form.controls[this.controlName].valid&&(this.input.nativeElement.classList.remove("form-danger"),this.input.nativeElement.classList.add("form-success"))},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.sg),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-textarea"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ja,5),2&n)&&(e.iGM(r=e.CRH())&&(t.input=r.first))},inputs:{element:"element",controlName:"controlName",rows:"rows",translationErrorLabelMap:"translationErrorLabelMap",stylesMap:"stylesMap",hasSubmitted:"hasSubmitted"},outputs:{onKeyEnterPressed:"onKeyEnterPressed"},features:[e.TTD],decls:9,vars:10,consts:[[3,"formGroup"],["id","div_input",1,"form-group","label-floating",3,"ngClass"],["div_input",""],[1,"control-label"],["type","text",1,"form-control",3,"formControlName","rows","tabIndex","keydown","keydown.enter","focus","focusout"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(n,t){1&n&&(e.TgZ(0,"form",0),e.TgZ(1,"div",1,2),e.TgZ(3,"label",3),e._uU(4),e.qZA(),e.TgZ(5,"textarea",4),e.NdJ("keydown",function(a){return t.onkeydown(a)})("keydown.enter",function(a){return t.onEnterPressed(a)})("focus",function(){return t.onFocus()})("focusout",function(){return t.onFocusOut()}),e._uU(6," "),e.qZA(),e.qZA(),e.YNc(7,Qa,2,1,"div",5),e.YNc(8,Ka,2,1,"div",5),e.qZA()),2&n&&(e.Q6J("formGroup",t.form),e.xp6(1),e.Q6J("ngClass",e.VKq(8,Xa,!(null!=t.form&&null!=t.form.controls[t.element.name]&&t.form.controls[t.element.name].value))),e.xp6(3),e.hij(" ",null==t.element?null:t.element.text," "),e.xp6(1),e.Q6J("formControlName",null==t.element?null:t.element.name)("rows",t.rows)("tabIndex",null==t.element?null:t.element.tabIndex),e.xp6(2),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[t.element.name].errors)&&(null==t.form?null:t.form.controls[t.element.name].hasError("required"))),e.xp6(1),e.Q6J("ngIf",t.hasSubmitted&&(null==t.form?null:t.form.controls[t.element.name].errors)&&(null==t.form?null:t.form.controls[t.element.name].hasError("pattern"))&&(null==t.element?null:t.element.errorLabel)))},directives:[Oe._Y,Oe.JL,Oe.sg,me.mk,Oe.Fj,Oe.JJ,Oe.u,me.O5],styles:["[_nghost-%COMP%]{--foregroundColor: #0000;--themeColor: #2a6ac1}.c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;display:inline-flex}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}.c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:active, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:hover, .c21-input-container[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:visited{background-image:linear-gradient(#3ea9f5,#3ea9f5),linear-gradient(#d2d2d2,#d2d2d2);background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:rgba(0,0,0,0);transition:background 0s ease-out}textarea[type=text].errors[_ngcontent-%COMP%]{border-bottom:2px solid red;color:red}.text-danger[_ngcontent-%COMP%]{color:red;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}.form-group[_ngcontent-%COMP%]{position:relative;padding-bottom:0;margin:35px 0 0}.form-group[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{font-size:11px;line-height:1.07142857;color:#b3b6b8;font-weight:400;margin:16px 0 0}textarea[_ngcontent-%COMP%]{border:0;background-image:none;background-size:0 2px,100% 1px;background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-color:#f6f7fb;transition:background 0s ease-out;float:none;box-shadow:none;border-radius:16px;font-weight:400;padding:16px;font-size:14px;line-height:1.42857143;display:block;width:100%;color:#555;resize:vertical}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:.3s ease all}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{will-change:left,top,contents}.form-group.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-2px;left:16px;font-size:14px;line-height:1.42857}.form-group.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-40px;left:0;font-size:16px;line-height:1.07143;color:#9b9b9c}.form-group.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-28px;left:0;font-size:11px;line-height:1.07143}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-11px;font-size:11px;line-height:1.5}.form-group.form-group-sm.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-sm.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-sm.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-25px;left:0;font-size:9px;line-height:1.125}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-5px;font-size:18px;line-height:1.33333}.form-group.form-group-lg.label-static[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating.is-focused[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%], .form-group.form-group-lg.label-floating[_ngcontent-%COMP%]:not(.is-empty) label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.form-group-lg.label-floating[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:-webkit-autofill ~ label.control-label[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{top:-32px;left:0;font-size:14px;line-height:1}.form-group.is-focused[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{outline:none;background-image:linear-gradient(var(--themeColor),var(--themeColor)),linear-gradient(#D2D2D2,#D2D2D2);background-repeat:no-repeat;background-position:center bottom,center calc(100% - 1px);background-size:100% 2px,100% 1px;transition-duration:.3s;width:100%}.form-group.is-focused.form-info[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#00bcd4,#00bcd4),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-success[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#4caf50,#4caf50),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-warning[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#ff9800,#ff9800),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-danger[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#f44336,#f44336),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-rose[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#e91e63,#e91e63),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-white[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#FFFFFF,#FFFFFF),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.form-black[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{background-image:linear-gradient(#555555,#555555),linear-gradient(#D2D2D2,#D2D2D2)}.form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label[_ngcontent-%COMP%], .form-group.is-focused.label-placeholder[_ngcontent-%COMP%] label.control-label[_ngcontent-%COMP%]{color:#aaa}.form-group.is-focused[_ngcontent-%COMP%] select.form-control[_ngcontent-%COMP%]{box-shadow:none;border-color:#d2d2d2}"]}),i}();function es(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-text",13),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function ts(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-label",14),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("hasSubmitted",r.submitted)}}function ns(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-checkbox",13),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function os(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"chat-form-textarea",15),e.NdJ("onKeyEnterPressed",function(u){return e.CHM(n),e.oxw(2).onEnterButtonPressed(u)}),e.qZA()}if(2&i){var t=e.oxw().$implicit,r=e.oxw();e.Q6J("element",t)("controlName",null==t?null:t.name)("rows",null==t?null:t.rows)("translationErrorLabelMap",r.translationErrorLabelMap)("stylesMap",r.stylesMap)("hasSubmitted",r.submitted)}}function is(i,o){if(1&i&&(e.TgZ(0,"span"),e.YNc(1,es,1,5,"chat-form-text",10),e.YNc(2,ts,1,3,"chat-form-label",11),e.YNc(3,ns,1,5,"chat-form-checkbox",10),e.YNc(4,os,1,6,"chat-form-textarea",12),e.qZA()),2&i){var n=o.$implicit;e.xp6(1),e.Q6J("ngIf","text"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","static"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","checkbox"===(null==n?null:n.type)),e.xp6(1),e.Q6J("ngIf","textarea"===(null==n?null:n.type))}}var rs=function(i,o,n){return{"background-color":i,"border-color":o,color:n}},as=function(i){return{fill:i}},ss=function(){function i(o,n){this.formBuilder=o,this.customTranslateService=n,this.onSubmitForm=new e.vpe,this.onErrorRenderForm=new e.vpe,this.submitted=!1,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.translationErrorLabelMap=this.customTranslateService.translateLanguage(["LABEL_ERROR_FIELD_REQUIRED","PRECHAT_REQUIRED_ERROR"]),this.translationMap=this.customTranslateService.translateLanguage(["LABEL_START_NW_CONV"]),this.logger.debug("[FORM-BUILDER] ngOnChanges: preChatFormJson ----\x3e",this.formArray),this.logger.debug("[FORM-BUILDER] ngOnChanges: preChatForm completed ----\x3e",this.preChatFormGroupCustom)},i.prototype.ngOnChanges=function(o){this.formArray&&(this.browserLang=navigator.language,this.preChatFormGroupCustom=this.buildFormGroup(this.formArray),this.formArray=this.setTranslations(this.formArray),this.subscribeToFormChanges())},i.prototype.buildFormGroup=function(o){var n=this,t={},r=!1;return o.forEach(function(u,y){if(u.tabIndex=1411+y,n.lastTabIndex=1411+y+1,u.label||(u.label=u.name),u.type=u.type?u.type.toLowerCase():"text",!u.type||"text"!==u.type&&"textarea"!==u.type){if("checkbox"!==u.type){if("static"===u.type)return;return n.logger.error("[FORM-BUILDER] ERROR while rendering field --\x3e RESTORE DEFAULT"),void(r=!0)}j=[],J=!1,u.mandatory&&j.push(Oe.kI.required,Oe.kI.requiredTrue),u.value&&(J="true"===u.value||!0===u.value),t[u.name]=new Oe.NI(J,Oe.kI.compose(j))}else{var j=[],J=null;u.mandatory&&j.push(Oe.kI.required),u.regex&&j.push(Oe.kI.pattern(new RegExp(function(i){var o=i;return"/"!==i.substring(0,1)&&(o="/"+i),"/"!==i.substring(i.length-1,i.length)&&(o+="/"),o}(u.regex).slice(1,-1)))),u.value&&(J=u.value),t[u.name]=new Oe.NI(J,Oe.kI.compose(j))}}),r&&(this.logger.error("[FORM-BUILDER] ERROR while rendering field --\x3e restoreDefault",t={}),this.onErrorRenderForm.emit()),this.formBuilder.group(t)},i.prototype.setTranslations=function(o){var n=this;return o.forEach(function(t){if("object"==typeof t.label){var r=n.getAcceptLanguage(t.label);n.logger.debug("[FORM-BUILDER] setTranslations acceptedLanguage for element.label:",t,r),t.text=t.label[r]}else"string"==typeof t.label&&(t.text=n.customTranslateService.translateLanguage([t.label]).get(t.label));"object"==typeof t.errorLabel?(r=n.getAcceptLanguage(t.errorLabel),n.logger.debug("[FORM-BUILDER] setTranslations acceptedLanguage for element.errorLabel:",t,r),t.errorLabel=t.errorLabel[r]):"string"==typeof t.errorLabel&&(t.errorLabel=n.customTranslateService.translateLanguage([t.errorLabel]).get(t.errorLabel))}),this.formArray},i.prototype.getAcceptLanguage=function(o){var n="",t="";o&&o.default&&(t="default"),navigator.languages.forEach(function(a){n+=a+","});var r=Za.e(Object.keys(o),n);return r&&(t=r),t},i.prototype.subscribeToFormChanges=function(){var o=this;this.preChatFormGroupCustom&&this.preChatFormGroupCustom.valueChanges.subscribe(function(n){o.submitted=!1})},i.prototype.onSubmitPreChatForm=function(){this.submitted=!0,this.logger.debug("[FORM-BUILDER] onSubmitPreChatForm",this.preChatFormGroupCustom),this.preChatFormGroupCustom.valid&&this.onSubmitForm.emit(this.preChatFormGroupCustom.value)},i.prototype.onEnterButtonPressed=function(o){this.logger.debug("[FORM-BUILDER] onEnterButtonPressed event",o),this.onSubmitPreChatForm()},i.prototype.onResetForm=function(){this.submitted=!1,this.preChatFormGroupCustom.reset()},i.\u0275fac=function(n){return new(n||i)(e.Y36(Oe.qu),e.Y36(ut))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-form-builder"]],inputs:{formArray:"formArray",isOpenPrechatForm:"isOpenPrechatForm",stylesMap:"stylesMap"},outputs:{onSubmitForm:"onSubmitForm",onErrorRenderForm:"onErrorRenderForm"},features:[e.TTD],decls:12,vars:12,consts:[["id","chat21-form-container",3,"formGroup"],[4,"ngFor","ngForOf"],[1,"c21-new-conversation"],[1,"c21-button-primary",3,"tabindex","ngStyle","click","keydown.enter"],[1,"v-align-center"],["xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z",3,"ngStyle"],["d","M0 0h24v24H0z","fill","none"],[1,"v-align-center","c21-label-button"],[1,"clear"],[3,"element","controlName","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","rows","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed",4,"ngIf"],[3,"element","controlName","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed"],[3,"element","controlName","hasSubmitted","onKeyEnterPressed"],[3,"element","controlName","rows","translationErrorLabelMap","stylesMap","hasSubmitted","onKeyEnterPressed"]],template:function(n,t){1&n&&(e.TgZ(0,"div"),e.TgZ(1,"form",0),e.YNc(2,is,5,4,"span",1),e.qZA(),e.TgZ(3,"div",2),e.TgZ(4,"button",3),e.NdJ("click",function(){return t.onSubmitPreChatForm()})("keydown.enter",function(a){return t.onEnterButtonPressed(a)}),e.TgZ(5,"span",4),e.O4$(),e.TgZ(6,"svg",5),e._UZ(7,"path",6),e._UZ(8,"path",7),e.qZA(),e.qZA(),e.kcU(),e.TgZ(9,"span",8),e._uU(10),e.qZA(),e._UZ(11,"div",9),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("formGroup",t.preChatFormGroupCustom),e.xp6(1),e.Q6J("ngForOf",t.formArray),e.xp6(2),e.Q6J("tabindex",t.lastTabIndex)("ngStyle",e.kEZ(6,rs,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.Q6J("ngStyle",e.VKq(10,as,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(3),e.hij(" ",null==t.translationMap?null:t.translationMap.get("LABEL_START_NW_CONV")," "))},directives:[Oe._Y,Oe.JL,Oe.sg,me.sg,me.PC,me.O5,qa,Va,Ga,$a],styles:[".c21-label-button[_ngcontent-%COMP%]{font-size:1.2em!important}.c21-new-conversation[_ngcontent-%COMP%]{width:auto;height:auto;position:relative;border-top:0px solid #eeeeee;display:flex;align-items:center;justify-content:center;box-shadow:none;vertical-align:top}.c21-new-conversation[_ngcontent-%COMP%] button.c21-button-primary[_ngcontent-%COMP%]{margin:10px 0}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;overflow:hidden;width:100%;height:36px;display:inline-flex}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding:11px 10px 8px;color:#616161;font-size:1.3em;font-weight:300;line-height:1.2em;box-shadow:none}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input.errors[_ngcontent-%COMP%]{border:1px solid red}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}#chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}"]}),i}(),ls=["afPrechatFormComponent"],cs=["privacyInputField"],us=function(i,o){return{color:i,"background-image":o}},hs=function(i){return{fill:i}},ps=function(i){return{color:i}},ds=function(){function i(o,n,t){this.g=o,this.formBuilder=n,this.appStorageService=t,this.onClosePage=new e.vpe,this.onCloseForm=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.initialize()},i.prototype.initialize=function(){},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afPrechatFormComponent&&o.afPrechatFormComponent.nativeElement.focus()},1e3)},i.prototype.openNewConversation=function(){if(this.g.attributes){var o=this.g.attributes;if(this.privacyInputField&&!1===this.privacyInputField.nativeElement.checked){this.g.privacyApproved=!1;var n=window.document.getElementById("span-checkmark");return void(n&&n.classList.add("unchecked"))}this.privacyInputField&&!0===this.privacyInputField.nativeElement.checked&&(this.g.privacyApproved=!0),this.g.setAttributeParameter("privacyApproved",this.g.privacyApproved),this.g.setAttributeParameter("userFullname",this.userFullname),this.g.setAttributeParameter("userEmail",this.userEmail),this.g.setParameter("userFullname",this.userFullname),this.g.setParameter("userEmail",this.userEmail),this.appStorageService.setItem("attributes",JSON.stringify(o)),this.onCloseForm.emit()}},i.prototype.returnClosePage=function(){this.onClosePage.emit()},i.prototype.onSubmitForm=function(o){this.logger.debug("[PRE-CHAT-FORM] onSubmitForm:",o),this.g.attributes&&(o.hasOwnProperty("userFullname")&&(this.g.setAttributeParameter("userFullname",o.userFullname),this.g.setParameter("userFullname",o.userFullname)),o.hasOwnProperty("userEmail")&&(this.g.setAttributeParameter("userEmail",o.userEmail),this.g.setParameter("userEmail",o.userEmail)),this.g.attributes.preChatForm=o,this.appStorageService.setItem("attributes",JSON.stringify(this.g.attributes)),this.onCloseForm.emit())},i.prototype.onErrorRenderForm=function(){this.logger.debug("[PRE-CHAT-FORM] onErrorRenderForm: RESTORE DEFAULT JSON"),this.g.setParameter("preChatFormJson",[{name:"userFullname",type:"text",mandatory:!0,label:"LABEL_FIELD_NAME"},{name:"userEmail",type:"text",mandatory:!0,regex:"/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/",label:"LABEL_FIELD_EMAIL",errorLabel:"LABEL_ERROR_FIELD_EMAIL"}])},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(Oe.qu),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-prechat-form"]],viewQuery:function(n,t){if(1&n&&(e.Gf(ls,5),e.Gf(cs,5)),2&n){var r=void 0;e.iGM(r=e.CRH())&&(t.afPrechatFormComponent=r.first),e.iGM(r=e.CRH())&&(t.privacyInputField=r.first)}},inputs:{stylesMap:"stylesMap"},outputs:{onClosePage:"onClosePage",onCloseForm:"onCloseForm"},decls:20,vars:14,consts:[["id","chat21-prechat-form","tabindex","1400","aria-modal","true","onFocus","document.querySelector('[start-focus-chat21-prechat-form]').focus()"],["afPrechatFormComponent",""],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-button"],[1,"c21-close-button","c21-small"],["tabindex","1490","aria-label"," chiudi pannello",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"c21-header-content"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-header"],["start-focus-chat21-prechat-form","","tabindex","1410",1,"c21-form-message-field"],[1,"c21-body-content"],[3,"formArray","isOpenPrechatForm","stylesMap","onSubmitForm","onErrorRenderForm"],["tabindex","1499","onFocus","document.querySelector('[start-focus-chat21-prechat-form]').focus()"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.returnClosePage()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"div",10),e._UZ(11,"div",11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",12),e.TgZ(13,"div",13),e.TgZ(14,"div",14),e.TgZ(15,"div",15),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",16),e.TgZ(18,"chat-form-builder",17),e.NdJ("onSubmitForm",function(a){return t.onSubmitForm(a)})("onErrorRenderForm",function(){return t.onErrorRenderForm()}),e.qZA(),e.qZA(),e.qZA(),e._UZ(19,"span",18),e.qZA(),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(7,us,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(5),e.Q6J("ngStyle",e.VKq(10,hs,t.g.themeForegroundColor)),e.xp6(4),e.Q6J("ngStyle",e.VKq(12,ps,t.g.themeForegroundColor)),e.xp6(5),e.Oqu(t.g.LABEL_COMPLETE_FORM),e.xp6(2),e.Q6J("formArray",t.g.preChatFormJson)("isOpenPrechatForm",t.g.isOpenPrechatForm)("stylesMap",t.stylesMap))},directives:[me.PC,ss],styles:['#chat21-prechat-form[_ngcontent-%COMP%]{background-color:#fff;width:100%;height:100%}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:100%;margin:0 auto}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{width:auto;height:auto;top:6px;left:40px;right:40px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{display:inline-block;width:100%;height:auto;padding:0;margin:10px 0;text-align:center;font-size:1.6em;line-height:normal}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{padding:0;margin:20px auto}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{padding:10px 25px;position:relative;left:0;right:0}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-form-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:10px 30px;position:relative}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .c21-label-button[_ngcontent-%COMP%]{font-size:1.2em}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%]{padding:0 0 30px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{background-color:#fff;overflow:hidden;position:relative;height:36px;margin:10px 10px 0}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .text-danger[_ngcontent-%COMP%]{color:#a94442;font-size:1em;min-height:20px;background-color:#fff;margin:0 10px}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%]{border-bottom:1px solid rgba(211,212,213,.4);border-radius:3px;background-color:#fff;position:relative;margin:0;padding:0;width:100%;display:inline-flex}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%], #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;margin:0;border:0;padding:12px 0;background-color:#fff;vertical-align:middle}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:block;padding:11px 10px 8px;color:#616161;font-size:1.3em;font-weight:300;line-height:1.2em;box-shadow:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial;opacity:1}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder{color:#b3b6b8;font-weight:normal;font-weight:initial}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:active, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:visited{box-shadow:none;background-color:#fff;outline:none}#chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:hover, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:focus, #chat21-prechat-form[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] #chat21-form-container[_ngcontent-%COMP%] .c21-input-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-webkit-autofill:active{-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%]{display:block;position:absolute;bottom:0;padding:35px;font-size:12px;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:22px;position:absolute;top:30px;left:10px;opacity:0;cursor:pointer;height:18px;width:18px}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{position:absolute;top:30;left:10;height:18px;width:18px;background-color:#eee;border:solid white;cursor:pointer}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark.unchecked[_ngcontent-%COMP%]{box-shadow:0 0 0 1px red}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%]:hover input[_ngcontent-%COMP%] ~ .checkmark[_ngcontent-%COMP%]{background-color:#ccc}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]{background-color:#2196f3}#chat21-prechat-form[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute;display:none}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]:after{display:block}#chat21-prechat-form[_ngcontent-%COMP%] .privacy-field[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{left:5px;top:2px;width:5px;height:8px;border:solid white;border-width:0 3px 3px 0;transform:rotate(45deg)}']}),i}();function gs(i,o){1&i&&(e.TgZ(0,"div"),e._uU(1,"here is ignored"),e.qZA())}function fs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"p",22),e.NdJ("click",function(){e.CHM(n);var a=e.oxw(3);return a.popupUrl(a.g.windowContext,a.conversation.last_message_text,"windowName")}),e._uU(1),e.qZA()}if(2&i){var t=e.oxw(3);e.xp6(1),e.hij("",t.strip_tags(t.conversation.last_message_text)," ")}}function ms(i,o){if(1&i&&(e._UZ(0,"p",23),e.ALo(1,"marked"),e.ALo(2,"htmlEntitiesEncode")),2&i){var n=e.oxw(3);e.Q6J("innerHTML",e.lcZ(1,1,e.lcZ(2,3,n.conversation.last_message_text)),e.oJD)}}function vs(i,o){if(1&i&&(e.TgZ(0,"div",18),e.YNc(1,gs,2,0,"div",19),e.YNc(2,fs,2,1,"ng-template",null,20,e.W1O),e.YNc(4,ms,3,5,"ng-template",null,21,e.W1O),e.qZA()),2&i){var n=e.MAs(3),t=e.MAs(5),r=e.oxw(2);e.xp6(1),e.Q6J("ngIf",r.isPopupUrl(r.conversation.last_message_text))("ngIfThen",n)("ngIfElse",t)}}function bs(i,o){if(1&i&&(e.TgZ(0,"time"),e._uU(1),e.ALo(2,"amTimeAgo"),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.hij("",e.lcZ(2,1,n.conversation.timestamp)," ")}}function _s(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"div",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.NdJ("click",function(){e.CHM(n);var a=e.oxw();return a.openConversationByID(a.conversation)}),e.TgZ(5,"span"),e._uU(6,"View more"),e.qZA(),e.qZA(),e.TgZ(7,"div",6),e.NdJ("click",function(){return e.CHM(n),e.oxw().closeMessagePreview()}),e.TgZ(8,"span"),e.O4$(),e.TgZ(9,"svg",7),e._UZ(10,"path",8),e._UZ(11,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(12,"div",10),e.NdJ("click",function(){e.CHM(n);var a=e.oxw();return a.openConversationByID(a.conversation)}),e.TgZ(13,"div",11),e._uU(14),e.qZA(),e.YNc(15,vs,6,3,"div",12),e.TgZ(16,"div",13),e.YNc(17,bs,3,3,"time",14),e.qZA(),e.TgZ(18,"div",15),e.TgZ(19,"div",16),e._UZ(20,"chat-avatar-image",17),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(14),e.Oqu(t.conversation.sender_fullname),e.xp6(1),e.Q6J("ngIf","text"==t.conversation.type),e.xp6(2),e.Q6J("ngIf","{.sv: timestamp}"!==t.conversation.timestamp),e.xp6(3),e.Q6J("senderID",t.conversation.sender)("senderFullname",t.conversation.sender_fullname)("baseLocation",t.baseLocation)}}var Cs=function(){function i(o,n){this.imageRepoService=o,this.g=n,this.onCloseMessagePreview=new e.vpe,this.onSelectedConversation=new e.vpe,this.subscriptions=[],this.isPopupUrl=gn,this.popupUrl=so,this.strip_tags=lo,this.isImage=qt,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){},i.prototype.ngAfterViewInit=function(){},i.prototype.ngOnChanges=function(o){this.logger.debug("[LASTMESSAGE] onChanges",o),this.conversation&&(this.conversation.image=this.imageRepoService.getImagePhotoUrl(this.conversation.sender))},i.prototype.getMetadataSize=function(o){void 0===o.width&&(o.width=We),void 0===o.height&&(o.height=We);var n={width:o.width,height:o.height};if(o.width&&o.width>We){var t=o.width/o.height;n.width=We,n.height=We/t}return n},i.prototype.onAttachmentButtonClicked=function(o){this.logger.debug("[LASTMESSAGE] onAttachmentButtonClicked",o)},i.prototype.openConversationByID=function(o){this.logger.debug("[LASTMESSAGE] openConversationByID: ",o),this.conversation=null,this.g.isOpenNewMessage=!1,o&&this.onSelectedConversation.emit(o)},i.prototype.closeMessagePreview=function(){this.conversation=null,this.g.isOpenNewMessage=!1,this.onCloseMessagePreview.emit()},i.prototype.ngOnDestroy=function(){this.conversation=null,this.g.isOpenNewMessage=!1},i.prototype.unsubscribe=function(){this.subscriptions.forEach(function(o){o.unsubscribe()}),this.subscriptions=[],this.logger.debug("[LASTMESSAGE] this.subscriptions",this.subscriptions)},i.\u0275fac=function(n){return new(n||i)(e.Y36(st),e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-last-message"]],inputs:{conversation:"conversation",baseLocation:"baseLocation",stylesMap:"stylesMap"},outputs:{onCloseMessagePreview:"onCloseMessagePreview",onSelectedConversation:"onSelectedConversation"},features:[e.TTD],decls:1,vars:1,consts:[["id","messagePreview",4,"ngIf"],["id","messagePreview"],["role","messaggio","id","new_message"],[1,"headerPreviewMessage"],[1,"boxButtons"],["role","button","tabindex","0",1,"buttonMore",3,"click"],["aria-label","Dismiss","role","button","tabindex","0",1,"buttonClose",3,"click"],["aria-labelledby","altIconTitle","height","20px","role","img","viewBox","0 0 24 24","width","20px","xmlns","http://www.w3.org/2000/svg",2,"fill","rgb(255, 255, 255)"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"previewNewMessagge",3,"click"],["role","messaggio",1,"c21-text","message_sender_fullname"],["class","c21-box-text",4,"ngIf"],[1,"c21-time","c21-text"],[4,"ngIf"],[1,"c21-icon-avatar"],[1,"c21-avatar-image","profile_image"],[1,"slide-in-left",3,"senderID","senderFullname","baseLocation"],[1,"c21-box-text"],[4,"ngIf","ngIfThen","ngIfElse"],["contentPopup",""],["contentNewTab",""],[1,"c21-link",3,"click"],[1,"c21-text","overflow4Lines",3,"innerHTML"]],template:function(n,t){1&n&&e.YNc(0,_s,21,6,"div",0),2&n&&e.Q6J("ngIf",t.conversation&&t.g.isOpenNewMessage)},directives:[me.O5,Wn],pipes:[Xt,Vn,$e.eG],styles:['[_nghost-%COMP%] .c21-avatar-image[_ngcontent-%COMP%] >chat-avatar-image .c21-icon-avatar{height:32px;width:32px;min-width:32px;min-height:32px}[_nghost-%COMP%] .slide-in-left[_ngcontent-%COMP%] >chat-message-attachment>#buttons-in-message>span>chat-text-button-attachment .button-in-msg{font-size:13px;padding:5px 10px!important}#messagePreview[_ngcontent-%COMP%]{position:relative;width:320px;max-height:200px;height:100%;padding:0 10px 10px;background-color:transparent;font-family:"Helvetica Neue","Apple Color Emoji",Helvetica,Arial,sans-serif;font-size:100%;font-style:normal;letter-spacing:normal;font-stretch:normal;font-weight:normal;text-align:left;-moz-text-align-last:auto;text-align-last:auto;-moz-text-align-last:initial;text-align-last:initial;text-indent:0px;text-shadow:none;text-transform:none;box-sizing:content-box;-webkit-font-smoothing:antialiased;line-height:1;font-feature-settings:normal;font-variant:normal}#new_message[_ngcontent-%COMP%]:hover .boxButtons[_ngcontent-%COMP%]{display:block;-webkit-animation:fade-in-dw-up .3s ease-in 0s;animation:fade-in-dw-up .3s ease-in 0s}.previewNewMessagge[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;background-color:#fff;box-shadow:rgba(35,47,53,.09) 0 2px 8px;clear:both;margin-left:45px;margin-bottom:8px;border-radius:5px 5px 5px 0;padding:4;font-size:14px}.previewNewMessagge[_ngcontent-%COMP%]:after{content:"";position:absolute;bottom:0px;left:-5px;width:0px;height:0px;border-style:solid;border-width:0px 0px 13px 5px;border-color:transparent transparent white}.c21-text.message_sender_fullname[_ngcontent-%COMP%]{font-size:13px;padding:0 10;margin:4 0;clear:both;color:#686868}.c21-box-text[_ngcontent-%COMP%]{max-height:110;overflow-y:auto}.c21-text[_ngcontent-%COMP%]{font-size:14px;color:#000;padding:0 10;margin:0;line-height:1.4;word-break:break-word}.overflow4Lines[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}.c21-img[_ngcontent-%COMP%]{margin-left:5px;width:120px}.c21-text.c21-time[_ngcontent-%COMP%]{font-size:13px;padding:0 10;clear:both;color:#737376}.c21-link[_ngcontent-%COMP%]{text-decoration:underline;padding:8px;cursor:pointer}.c21-icon-avatar[_ngcontent-%COMP%]{position:absolute;width:32px;height:32px;bottom:0px;left:-40px;box-shadow:rgba(35,47,53,.09) 0 2px 8px;border-radius:100%;border:1px solid #eee;overflow:hidden}.c21-avatar-image[_ngcontent-%COMP%]{width:32px;height:32px;display:block;position:absolute}.c21-avatar-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%}.headerPreviewMessage[_ngcontent-%COMP%]{position:relative;height:40;margin:10 0 0 50}.boxButtons[_ngcontent-%COMP%]{display:none}.buttonClose[_ngcontent-%COMP%]{transform:translateY(0);opacity:1;position:absolute;top:0px;right:0px;transition:all .12s ease-out 80ms}.buttonMore[_ngcontent-%COMP%]{transform:translateY(0);opacity:1;display:inline-block;transition:all .12s ease-out 80ms;text-align:center}.buttonMore[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;background-color:#67788f;color:#fff;font-size:13px;height:32px;line-height:32px;cursor:pointer;border-radius:16px;background-position:center center;padding:0 20px}.buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:32px;height:32px;padding:0}.buttonClose[_ngcontent-%COMP%] span[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{padding:6}#new_message[_ngcontent-%COMP%]{position:absolute;left:0;right:10;bottom:0}']}),i}(),yt=function(i){return{fill:i}};function ys(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){return e.CHM(n),e.oxw().prevStep()}),e.O4$(),e.TgZ(1,"svg",11),e._UZ(2,"path",12),e._UZ(3,"path",13),e.TgZ(4,"title",14),e._uU(5),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.VKq(2,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.BACK)}}var on=function(i){return{color:i}};function ws(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",38),e.TgZ(1,"div",39),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.TgZ(2,"span",40),e._uU(3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Q6J("ngStyle",e.VKq(2,on,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(t.g.DOWNLOAD_TRANSCRIPT)}}var At=function(i,o,n){return{"background-color":i,"border-color":o,color:n}};function Os(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.YNc(1,ws,4,4,"div",16),e._UZ(2,"div",17),e.TgZ(3,"div",18),e.TgZ(4,"div",19),e._uU(5),e.qZA(),e.TgZ(6,"fieldset",20),e._UZ(7,"input",21),e.TgZ(8,"label",22),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(1)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(1)}),e.O4$(),e.TgZ(9,"svg",23),e._UZ(10,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(11,"input",25),e.TgZ(12,"label",26),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(2)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(2)}),e.O4$(),e.TgZ(13,"svg",23),e._UZ(14,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(15,"input",27),e.TgZ(16,"label",28),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(3)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(3)}),e.O4$(),e.TgZ(17,"svg",23),e._UZ(18,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(19,"input",29),e.TgZ(20,"label",30),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(4)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(4)}),e.O4$(),e.TgZ(21,"svg",23),e._UZ(22,"path",24),e.qZA(),e.qZA(),e.kcU(),e._UZ(23,"input",31),e.TgZ(24,"label",32),e.NdJ("mouseover",function(){return e.CHM(n),e.oxw().mouseOverRate(5)})("mouseleave",function(){return e.CHM(n),e.oxw().mouseOverRate(0)})("click",function(){return e.CHM(n),e.oxw().openRate(5)}),e.O4$(),e.TgZ(25,"svg",23),e._UZ(26,"path",24),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e._UZ(27,"div",17),e.TgZ(28,"button",33),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(29,"span",34),e.O4$(),e.TgZ(30,"svg",35),e._UZ(31,"path",12),e._UZ(32,"path",36),e.TgZ(33,"title",14),e._uU(34),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(35,"span",37),e._uU(36),e.qZA(),e._UZ(37,"div",17),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.g.allowTranscriptDownload),e.xp6(4),e.Oqu(t.g.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE),e.xp6(1),e.uIk("disabled",t.g.isOpenStartRating?null:""),e.xp6(3),e.ekj("active",t.mouseRate>=1),e.xp6(4),e.ekj("active",t.mouseRate>=2),e.xp6(4),e.ekj("active",t.mouseRate>=3),e.xp6(4),e.ekj("active",t.mouseRate>=4),e.xp6(4),e.ekj("active",t.mouseRate>=5),e.xp6(3),e.Q6J("ngStyle",e.kEZ(17,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(21,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," ")}}function Ms(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e._UZ(1,"div",17),e.TgZ(2,"div",41),e.TgZ(3,"textarea",42,43),e._uU(5),e.qZA(),e._UZ(6,"div",17),e.TgZ(7,"button",44),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(8,"span",34),e.O4$(),e.TgZ(9,"svg",35),e._UZ(10,"path",12),e._UZ(11,"path",36),e.TgZ(12,"title",14),e._uU(13),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(14,"span",37),e._uU(15),e.qZA(),e._UZ(16,"div",17),e.qZA(),e.TgZ(17,"button",45),e.NdJ("click",function(){return e.CHM(n),e.oxw().sendRate()}),e.TgZ(18,"span",34),e.O4$(),e.TgZ(19,"svg",35),e._UZ(20,"path",46),e._UZ(21,"path",47),e.TgZ(22,"title",14),e._uU(23),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(24,"span",37),e._uU(25),e.qZA(),e._UZ(26,"div",17),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(3),e.s9C("placeholder",t.g.WRITE_YOUR_OPINION),e.xp6(2),e.Oqu(t.message),e.xp6(2),e.Q6J("ngStyle",e.kEZ(10,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(14,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," "),e.xp6(2),e.Q6J("ngStyle",e.kEZ(16,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(20,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.SUBMIT),e.xp6(2),e.hij(" ",t.g.SUBMIT," ")}}function xs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",38),e.TgZ(1,"div",39),e.NdJ("click",function(){return e.CHM(n),e.oxw(2).dowloadTranscript()}),e.TgZ(2,"span",40),e._uU(3),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=e.oxw(2);e.xp6(2),e.Q6J("ngStyle",e.VKq(2,on,null==t.stylesMap?null:t.stylesMap.get("themeColor"))),e.xp6(1),e.Oqu(t.g.DOWNLOAD_TRANSCRIPT)}}function Es(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"div",15),e.YNc(1,xs,4,4,"div",16),e._UZ(2,"div",17),e.TgZ(3,"div",41),e.TgZ(4,"div",48),e._uU(5),e.qZA(),e.TgZ(6,"div",19),e._uU(7),e.qZA(),e.qZA(),e.TgZ(8,"button",44),e.NdJ("click",function(){return e.CHM(n),e.oxw().returnClosePage()}),e.TgZ(9,"span",34),e.O4$(),e.TgZ(10,"svg",35),e._UZ(11,"path",12),e._UZ(12,"path",36),e.TgZ(13,"title",14),e._uU(14),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(15,"span",37),e._uU(16),e.qZA(),e._UZ(17,"div",17),e.qZA(),e.qZA()}if(2&i){var t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.g.allowTranscriptDownload),e.xp6(4),e.Oqu(t.g.THANK_YOU_FOR_YOUR_EVALUATION),e.xp6(2),e.Oqu(t.g.YOUR_RATING_HAS_BEEN_RECEIVED),e.xp6(1),e.Q6J("ngStyle",e.kEZ(7,At,null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("themeColor"),null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(2),e.Q6J("ngStyle",e.VKq(11,yt,null==t.stylesMap?null:t.stylesMap.get("foregroundColor"))),e.xp6(4),e.Oqu(t.g.CLOSE),e.xp6(2),e.hij(" ",t.g.CLOSE," ")}}var Ts=function(i,o){return{color:i,"background-image":o}},Ss=function(){function i(o,n){this.starRatingWidgetService=o,this.g=n,this.onClosePage=new e.vpe,this.onCloseRate=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.step=0},i.prototype.dowloadTranscript=function(){this.starRatingWidgetService._dowloadTranscript(this.recipientId)},i.prototype.openRate=function(o){var n=this;this.rate=o,setTimeout(function(){n.step=1},300)},i.prototype.mouseOverRate=function(o){this.mouseRate=o},i.prototype.nextStep=function(){this.step=this.step+1},i.prototype.prevStep=function(){this.step=this.step-1},i.prototype.sendRate=function(){this.message=document.getElementById("chat21-message-rate-context").value,this.logger.debug("[STAR-RATING_COMP] sendRate!!!::",this.message);var o=this;this.starRatingWidgetService.httpSendRate(this.rate,this.message).subscribe(function(n){o.logger.debug("[STAR-RATING_COMP] OK sender",n),o.nextStep()},function(n){o.nextStep()},function(){})},i.prototype.ngOnDestroy=function(){this.step=0},i.prototype.returnClosePage=function(){this.logger.debug("[STAR-RATING_COMP] closePage: ",this.mouseRate,this.step,this.rate),this.rate&&0!==this.rate&&this.step<2?this.sendRate():this.step=0,this.starRatingWidgetService.setOsservable(!1),this.onClosePage.emit()},i.\u0275fac=function(n){return new(n||i)(e.Y36(en),e.Y36(Re))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-star-rating-widget"]],inputs:{recipientId:"recipientId",stylesMap:"stylesMap"},outputs:{onClosePage:"onClosePage",onCloseRate:"onCloseRate"},decls:14,vars:12,consts:[["id","chat21-star-rating-widget"],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-content"],["tabindex","1417","aria-label"," indietro ","class","c21-header-button c21-left c21-button-clean",3,"click",4,"ngIf"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-content"],["class","step-rate",4,"ngIf"],["tabindex","1417","aria-label"," indietro ",1,"c21-header-button","c21-left","c21-button-clean",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","24px","height","24px","viewBox","0 0 24 24",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z"],["id","altIconTitle"],[1,"step-rate"],["class","c21-modal-content","style","text-align: right; margin: 0px 20px 30px 10px;",4,"ngIf"],[1,"clear"],[1,"c21-modal-content"],[1,"default-text"],[1,"chat21-rating"],["type","radio","id","star1","name","rating","value","1",1,"c21-input-star"],["for","star1","title","scarso - 1 star",1,"full","c21-button",3,"mouseover","mouseleave","click"],["width","30px","height","30px","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 576 512",1,"star"],["d","M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"],["type","radio","id","star2","name","rating","value","2",1,"c21-input-star"],["for","star2","title","sufficiente - 2 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star3","name","rating","value","3",1,"c21-input-star"],["for","star3","title","buono - 3 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star4","name","rating","value","4",1,"c21-input-star"],["for","star4","title","ottimo - 4 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["type","radio","id","star5","name","rating","value","5",1,"c21-input-star"],["for","star5","title","eccellente - 5 stars",1,"full","c21-button",3,"mouseover","mouseleave","click"],["tabindex","1414",1,"c21-button-primary",3,"ngStyle","click"],[1,"v-align-center"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","18","height","18","viewBox","0 0 24 24",3,"ngStyle"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"v-align-center","c21-label-button"],[1,"c21-modal-content",2,"text-align","right","margin","0px 20px 30px 10px"],[1,"c21-link",3,"click"],[3,"ngStyle"],[1,"c21-step-content"],["rows","1","id","chat21-message-rate-context",1,"textarea-rate",3,"placeholder"],["textbox",""],["tabindex","1415",1,"c21-button-primary",3,"ngStyle","click"],["tabindex","1416",1,"c21-button-primary",3,"ngStyle","click"],["d","M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"],["d","M0 0h24v24H0z","fill","none"],[1,"default-title"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.YNc(4,ys,6,4,"button",4),e.TgZ(5,"div",5),e.TgZ(6,"span"),e._uU(7),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",6),e.TgZ(9,"div",7),e.TgZ(10,"div",8),e.YNc(11,Os,38,23,"div",9),e.YNc(12,Ms,27,22,"div",9),e.YNc(13,Es,18,13,"div",9),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(1),e.Q6J("ngStyle",e.WLB(7,Ts,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(3),e.Q6J("ngIf",t.step>0&&2!=t.step),e.xp6(1),e.Q6J("ngStyle",e.VKq(10,on,t.g.themeForegroundColor)),e.xp6(2),e.Oqu(t.g.CUSTOMER_SATISFACTION),e.xp6(4),e.Q6J("ngIf",0==t.step),e.xp6(1),e.Q6J("ngIf",1==t.step),e.xp6(1),e.Q6J("ngIf",2==t.step))},directives:[me.PC,me.O5],styles:['#chat21-star-rating-widget[_ngcontent-%COMP%]{background-color:#fff;width:100%;height:100%;font-size:10px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%]{z-index:1}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{position:absolute;left:45px;right:45px;display:inline-block;width:auto;height:1.6em;line-height:1.6em;padding:0;margin:13px 0;text-align:center;font-size:1.6em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%]{overflow:hidden}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{padding:10px 30px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#616161;font-size:1.5em;text-align:center;word-wrap:break-word}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:10px 0}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .default-title[_ngcontent-%COMP%]{font-size:2em;font-family:"Roboto";color:#1a1a1a}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .default-text[_ngcontent-%COMP%]{font-size:1.4em;font-family:"Roboto";color:#1a1a1a;margin:0 0 4px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%]{text-align:center;position:relative;margin:10px 0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%]{border:none;width:190px;min-height:30px;margin:20px auto;font-size:1.6em;padding:0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] input.c21-input-star[_ngcontent-%COMP%]{border:0;width:1px;height:1px;overflow:hidden;position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);opacity:0}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]{position:relative;display:inline;float:none;color:#c8c8c8}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:before{margin:5px;display:inline-block;font-size:24px;color:#ccc;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] input.c21-input-star[_ngcontent-%COMP%]:checked ~ label.c21-button[_ngcontent-%COMP%]:before{color:#ffc107}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:hover ~ label.c21-button[_ngcontent-%COMP%]:before{color:#ffdb70}#chat21-star-rating-widget[_ngcontent-%COMP%] .chat21-rating[_ngcontent-%COMP%] label.c21-button[_ngcontent-%COMP%]:hover:before{color:#ffc107}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] .chat21-stars[_ngcontent-%COMP%]{padding:0;position:absolute;text-align:right;display:block;top:0px;right:40px;width:70px;line-height:20px;fill:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star[_ngcontent-%COMP%]{fill:#efefef}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star[_ngcontent-%COMP%]:hover{fill:gold;stroke-width:15px;transform:rotate(-15deg) scale(1.3)}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] svg.star.active[_ngcontent-%COMP%]{fill:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] .fa-star[_ngcontent-%COMP%]:before{margin:0;font-size:1em;display:inline-block;color:gold}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]{margin:0 auto 10px;border:hidden;overflow-x:hidden;overflow-y:visible;box-sizing:border-box;padding:10px;color:#1a1a1a;width:calc(100% - 40px);height:110px;resize:none;font-size:13px;border-radius:16px;background-color:#fafafa;text-align:left;font-weight:300}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;background-color:rgba(0,0,0,0)!important}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#f9f9f9!important}#chat21-star-rating-widget[_ngcontent-%COMP%] .step-rate[_ngcontent-%COMP%] textarea.textarea-rate[_ngcontent-%COMP%]:hover::-webkit-scrollbar-thumb{background:#777777}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-step-content[_ngcontent-%COMP%]{margin:10px 0 20px;position:relative}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-button-primary[_ngcontent-%COMP%]{font-size:1.4em;border:1px solid;margin:0 10px}#chat21-star-rating-widget[_ngcontent-%COMP%] .c21-link[_ngcontent-%COMP%]{cursor:pointer;font-size:14px}#chat21-star-rating-widget[_ngcontent-%COMP%] a.c21-link[_ngcontent-%COMP%]:visited, #chat21-star-rating-widget[_ngcontent-%COMP%] a.c21-link[_ngcontent-%COMP%]:link{color:#2a6ac1}',".star.active[_ngcontent-%COMP%]{\n fill:#FFD700;\n}\nsvg.star[_ngcontent-%COMP%]{\n fill: #efefef;\n}\nsvg.star[_ngcontent-%COMP%]:hover{\n fill: #FFD700;\n}"]}),i}(),Ps=["aflauncherbutton"];function ks(i,o){if(1&i&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&i){var n=e.oxw(2);e.xp6(1),e.Oqu(n.g.conversationsBadge)}}var As=function(i){return{width:"100%",height:"100%",margin:"auto","border-radius":i}};function Is(i,o){if(1&i&&e._UZ(0,"img",11),2&i){var n=e.oxw(3);e.Q6J("src",n.g.baloonImage,e.LSH)("ngStyle",e.VKq(2,As,n.g.baloonShape))}}var Rs=function(i,o){return{fill:i,display:o}};function Ls(i,o){if(1&i&&(e.TgZ(0,"div",6),e.YNc(1,Is,1,4,"img",7),e.O4$(),e.TgZ(2,"svg",8),e._UZ(3,"path",9),e._UZ(4,"path",10),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.Q6J("@enterBubbleAnimation",void 0),e.xp6(1),e.Q6J("ngIf",""!==n.g.baloonImage),e.xp6(1),e.Q6J("ngStyle",e.WLB(3,Rs,n.g.themeForegroundColor,""===n.g.baloonImage?"":"none"))}}var Ns=function(i){return{fill:i}};function Fs(i,o){if(1&i&&(e.TgZ(0,"div",6),e.O4$(),e.TgZ(1,"svg",8),e._UZ(2,"path",9),e._UZ(3,"path",12),e.qZA(),e.qZA()),2&i){var n=e.oxw(2);e.Q6J("@enterCloseAnimation",void 0),e.xp6(1),e.Q6J("ngStyle",e.VKq(2,Ns,n.g.themeForegroundColor))}}var Bs=function(i,o){return{"c21-align-left":i,"c21-align-right":o}},Us=function(i,o,n,t,r,a,u){return{"background-color":i,bottom:o,left:n,right:t,width:r,height:a,"border-radius":u}};function Zs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"button",1,2),e.NdJ("click",function(){return e.CHM(n),e.oxw().openCloseWidget()}),e.YNc(2,ks,2,1,"div",3),e.YNc(3,Ls,5,6,"div",4),e.YNc(4,Fs,4,4,"div",4),e.qZA()}if(2&i){var t=e.oxw();e.Q6J("ngClass",e.WLB(5,Bs,"left"===t.g.align,"left"!==t.g.align))("ngStyle",e.Hh0(8,Us,t.g.baloonImage?null:t.g.themeColor,t.g.marginY+"px!important","left"===t.g.align?t.g.marginX+"px!important":"","right"===t.g.align?t.g.marginX+"px!important":"",t.g.launcherWidth,t.g.launcherHeight,t.g.baloonShape)),e.xp6(2),e.Q6J("ngIf",t.g.conversationsBadge>0),e.xp6(1),e.Q6J("ngIf",!t.g.isOpen),e.xp6(1),e.Q6J("ngIf",t.g.isOpen)}}var Ds=function(){function i(o,n){this.g=o,this.appStorageService=n,this.onButtonClicked=new e.vpe}return i.prototype.ngOnInit=function(){},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){!o.g.isOpen&&o.aflauncherbutton&&(o.aflauncherbutton.nativeElement.style["box-shadow"]="0px 4px 20px "+Ie(o.g.themeColor,50))},0)},i.prototype.openCloseWidget=function(){!0===this.g.isLogged&&this.onButtonClicked.emit(this.g.isOpen)},i.\u0275fac=function(n){return new(n||i)(e.Y36(Re),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-launcher-button"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Ps,5),2&n)&&(e.iGM(r=e.CRH())&&(t.aflauncherbutton=r.first))},outputs:{onButtonClicked:"onButtonClicked"},decls:1,vars:1,consts:[["aflauncherbutton","","id","c21-launcher-button","class","c21-button-clean scale-in-center","tabindex","1000","aria-label"," apri chat",3,"ngClass","ngStyle","click",4,"ngIf"],["aflauncherbutton","","id","c21-launcher-button","tabindex","1000","aria-label"," apri chat",1,"c21-button-clean","scale-in-center",3,"ngClass","ngStyle","click"],["aflauncherbutton",""],["class","c21-divBudge",4,"ngIf"],["class","launcher-button rotate-center",4,"ngIf"],[1,"c21-divBudge"],[1,"launcher-button","rotate-center"],[3,"src","ngStyle",4,"ngIf"],["role","img","xmlns","http://www.w3.org/2000/svg","width","100%","height","100%","viewBox","0 0 90 90",3,"ngStyle"],["fill","none","d","M0 0h24v24H0V0z"],["d","M33.57,31A4.58,4.58,0,0,0,29,35.57V58.3a1.94,1.94,0,0,0,3.32,1.38l3-3a.29.29,0,0,1,.21-.09H56.43A4.58,4.58,0,0,0,61,52V35.57A4.58,4.58,0,0,0,56.43,31Z"],[3,"src","ngStyle"],["d","M54.92,37.08l-2-2L45,43l-7.92-7.92-2,2L43,45l-7.92,7.92,2,2L45,47l7.92,7.92,2-2L47,45Z",1,"cls-1"]],template:function(n,t){1&n&&e.YNc(0,Zs,5,16,"button",0),2&n&&e.Q6J("ngIf",1==t.g.isLogged&&0==t.g.isOpen)},directives:[me.O5,me.mk,me.PC],styles:["#c21-launcher-button[_ngcontent-%COMP%]{position:fixed;bottom:0px;cursor:pointer;display:block;margin:20px;z-index:1;box-shadow:rgba(0,18,46,.16) 0 0 16px}#c21-launcher-button[_ngcontent-%COMP%] .launcher-button[_ngcontent-%COMP%]{width:100%;height:100%;padding:0;margin:0;display:flex}.c21-divBudge[_ngcontent-%COMP%]{position:absolute;top:0;width:16px;height:16px;min-width:12px;font-size:1.2em;line-height:16px;border-radius:50%;background-color:red;color:#fff;font-weight:bold;padding:5px;text-align:center;margin-top:-10px;display:inline-block}@media (max-width: 451px){#c21-launcher-button.c21-align-right[_ngcontent-%COMP%]{right:0}#c21-launcher-button.c21-align-left[_ngcontent-%COMP%]{left:0}}"],data:{animation:[(0,we.X$)("enterCloseAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"rotate(-90deg)",opacity:1}),(0,we.jt)("450ms ease-out",(0,we.oB)({transform:"rotate(0deg)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"scale(1)",opacity:1}),(0,we.jt)("200ms ease-in",(0,we.oB)({transform:"scale(0.5)",opacity:0}))])]),(0,we.X$)("enterBubbleAnimation",[(0,we.eR)(":enter",[(0,we.oB)({transform:"scale(0.5)",opacity:0}),(0,we.jt)("200ms ease-out",(0,we.oB)({transform:"scale(1)",opacity:1}))]),(0,we.eR)(":leave",[(0,we.oB)({transform:"scale(1)",opacity:1}),(0,we.jt)("200ms ease-in",(0,we.oB)({transform:"scale(0.5)",opacity:0}))])])]}}),i}(),Hs=["afSelectionDepartment"];function zs(i,o){if(1&i){var n=e.EpF();e.TgZ(0,"li"),e.TgZ(1,"button",20),e.NdJ("click",function(){var y=e.CHM(n).$implicit;return e.oxw().onSelectDepartment(y)}),e.TgZ(2,"span",21),e._uU(3),e.qZA(),e.TgZ(4,"span",22),e._uU(5),e.qZA(),e.qZA(),e.qZA()}if(2&i){var t=o.$implicit,r=o.index;e.xp6(3),e.Oqu(r+1),e.xp6(2),e.Oqu(null==t?null:t.name)}}var js=function(i,o){return{color:i,"background-image":o}},qs=function(i){return{color:i}},Vs=function(){function i(o,n,t){this.elementRef=o,this.g=n,this.appStorageService=t,this.onDepartmentSelected=new e.vpe,this.onClose=new e.vpe,this.onOpen=new e.vpe,this.onBeforeDepartmentsFormRender=new e.vpe,this.logger=Ce.getInstance()}return i.prototype.ngOnInit=function(){this.logger.debug("[SELECT-DEP] ngOnInit"),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--backgroundColor",this.g.themeForegroundColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--textColor",this.g.themeColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--hoverBackgroundColor",this.g.themeColor),this.elementRef.nativeElement.querySelector("#chat21-selection-department").style.setProperty("--hoverTextColor",this.g.themeForegroundColor),this.g.departments&&this.g.departments.length>0&&(this.g.windowContext&&this.g.windowContext.tiledesk&&this.g.windowContext.tiledesk.beforeDepartmentsFormRender?(this.departments=this.g.departments,this.departments=this.g.windowContext.tiledesk.beforeDepartmentsFormRender(this.g.departments)):(this.departments=JSON.parse(JSON.stringify(this.g.departments)),this.triggerOnbeforeDepartmentsFormRender()))},i.prototype.ngAfterViewInit=function(){var o=this;setTimeout(function(){o.afSelectionDepartment&&o.afSelectionDepartment.nativeElement.focus()},1e3)},i.prototype.setDepartment=function(o){if(this.g.setParameter("departmentSelected",o),this.g.attributes){var n=this.g.attributes;this.g.setAttributeParameter("departmentId",o._id),this.g.setAttributeParameter("departmentName",o.name),this.appStorageService.setItem("attributes",JSON.stringify(n)),this.logger.debug("[SELECT-DEP] setDepartment: attributes",JSON.stringify(n))}},i.prototype.onSelectDepartment=function(o){this.logger.debug("[SELECT-DEP] onSelectDepartment: ",o),this.setDepartment(o),this.onDepartmentSelected.emit(o)},i.prototype.openPage=function(){this.logger.debug("[SELECT-DEP] openPage "),this.onOpen.emit()},i.prototype.closePage=function(){this.logger.debug("[SELECT-DEP] closePage"),this.onClose.emit()},i.prototype.cancelPage=function(){this.logger.debug("[SELECT-DEP] cancelPage"),this.g.newConversationStart=!1,this.onClose.emit()},i.prototype.triggerOnbeforeDepartmentsFormRender=function(){this.onBeforeDepartmentsFormRender.emit(this.departments)},i.\u0275fac=function(n){return new(n||i)(e.Y36(e.SBq),e.Y36(Re),e.Y36(He))},i.\u0275cmp=e.Xpm({type:i,selectors:[["chat-selection-department"]],viewQuery:function(n,t){var r;(1&n&&e.Gf(Hs,5),2&n)&&(e.iGM(r=e.CRH())&&(t.afSelectionDepartment=r.first))},outputs:{onDepartmentSelected:"onDepartmentSelected",onClose:"onClose",onOpen:"onOpen",onBeforeDepartmentsFormRender:"onBeforeDepartmentsFormRender"},decls:21,vars:9,consts:[["id","chat21-selection-department","tabindex","1200","aria-modal","true","onFocus","document.querySelector('[start-focus-chat21-selection-department]').focus()"],["afSelectionDepartment",""],[1,"c21-header",3,"ngStyle"],[1,"c21-header-container"],[1,"c21-header-button"],["role","button",1,"c21-close-button","c21-small"],["tabindex","1210","aria-label"," chiudi pannello",1,"c21-close-button-body",3,"click"],["role","img","aria-labelledby","altIconTitle","xmlns","http://www.w3.org/2000/svg","width","20px","height","20px","viewBox","0 0 24 24"],["fill","none","d","M0 0h24v24H0V0z"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"c21-header-content"],[1,"c21-title",3,"ngStyle"],[1,"c21-body"],[1,"c21-body-container"],[1,"c21-body-header"],["start-focus-chat21-selection-department","","tabindex","1201",1,"c21-message-field"],["tabindex","211","onFocus","document.querySelector('[start-focus]').focus()",1,"c21-body-content"],[1,"chat21-content-modal-select"],[4,"ngFor","ngForOf"],["tabindex","1299","onFocus","document.querySelector('[start-focus-chat21-selection-department]').focus()",2,"height","0px"],["tabindex","1202",1,"c21-button-department","c21-button-clean",3,"click"],[1,"chat21-badge"],[1,"chat21-name-list"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0,1),e.TgZ(2,"div",2),e.TgZ(3,"div",3),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return t.closePage()}),e.O4$(),e.TgZ(7,"svg",7),e._UZ(8,"path",8),e._UZ(9,"path",9),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.kcU(),e.TgZ(10,"div",10),e._UZ(11,"div",11),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",12),e.TgZ(13,"div",13),e.TgZ(14,"div",14),e.TgZ(15,"div",15),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",16),e.TgZ(18,"ul",17),e.YNc(19,zs,6,2,"li",18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e._UZ(20,"span",19),e.qZA()),2&n&&(e.xp6(2),e.Q6J("ngStyle",e.WLB(4,js,t.g.themeForegroundColor,t.g.colorGradient180)),e.xp6(9),e.Q6J("ngStyle",e.VKq(7,qs,t.g.themeForegroundColor)),e.xp6(5),e.Oqu(t.g.LABEL_SELECT_TOPIC),e.xp6(3),e.Q6J("ngForOf",t.departments))},directives:[me.PC,me.sg],styles:["#chat21-selection-department[_ngcontent-%COMP%]{--backgroundColor: #f7f7f7;--textColor: #2a6ac1;--hoverBackgroundColor: #2a6ac1;--hoverTextColor: #f7f7f7;background-color:#fff;width:100%;height:100%}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%]{overflow:hidden;width:100%;height:52px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%]{width:31px;height:31px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-button[_ngcontent-%COMP%] .c21-close-button.c21-small[_ngcontent-%COMP%] .c21-close-button-body[_ngcontent-%COMP%]{width:31px;height:31px;-webkit-appearance:initial;border:none}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;height:100%;margin:0 auto}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%]{width:100%;height:auto;padding:0 40px}#chat21-selection-department[_ngcontent-%COMP%] .c21-header[_ngcontent-%COMP%] .c21-header-container[_ngcontent-%COMP%] .c21-header-content[_ngcontent-%COMP%] .c21-title[_ngcontent-%COMP%]{display:inline-block;width:100%;height:auto;padding:0;text-align:center;font-size:1.8em;line-height:normal}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding-left:16px;padding-right:16px;grid-gap:10px;gap:10px}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%]{position:relative;top:0;bottom:0;left:0;right:0;padding:20px 30px 0}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-header[_ngcontent-%COMP%] .c21-message-field[_ngcontent-%COMP%]{padding:0;margin:0;line-height:1.2em;color:#aaa;font-size:1.6em;text-align:center;word-wrap:break-word}#chat21-selection-department[_ngcontent-%COMP%] .c21-body[_ngcontent-%COMP%] .c21-body-content[_ngcontent-%COMP%]{padding:0 0 40px;position:relative;width:100%}.chat21-content-modal-select[_ngcontent-%COMP%]{margin:0 0 2em;list-style-type:none;padding:0;height:auto;overflow-y:auto;display:flex;flex-direction:column;grid-gap:12px;gap:12px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{cursor:pointer;position:relative;margin:0;padding:20px 16px;font-size:1.4em;text-align:left;color:var(--textColor);border:1px solid var(--textColor);line-height:normal;display:block;border-radius:10px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] .c21-button-department[_ngcontent-%COMP%]{width:100%;text-align:left;display:flex;grid-gap:12px;gap:12px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover{background-color:var(--hoverBackgroundColor);border-radius:10px}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover .chat21-name-list[_ngcontent-%COMP%]{color:var(--hoverTextColor)}.chat21-content-modal-select[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:hover .chat21-badge[_ngcontent-%COMP%]{color:var(--hoverBackgroundColor);background-color:var(--hoverTextColor)}.chat21-content-modal-select[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{position:relative}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-badge[_ngcontent-%COMP%]{box-sizing:content-box;box-sizing:initial;display:flex;justify-content:center;align-items:center;font-size:12px;padding:0;line-height:24px;height:24px;width:24px;border-radius:50%;margin:0 10px 0 0;text-align:center;font-weight:500;color:var(--backgroundColor);background-color:var(--textColor)}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-name-list[_ngcontent-%COMP%]{font-size:18px;font-weight:500;line-height:24px;color:#7d87a4}.chat21-content-modal-select[_ngcontent-%COMP%] .chat21-title[_ngcontent-%COMP%]{margin-left:10px;font-weight:normal;font-weight:initial;line-height:normal}"]}),i}(),Ws=ye(26136),It=ye(60680),Gs=function(i){function o(n){var t=i.call(this)||this;return t.logger=n,t.logLevel=le.ERROR,t.isLogEnabled=!0,t}return(0,_e.ZT)(o,i),o.prototype.setLoggerConfig=function(n,t){this.isLogEnabled=n,"string"==typeof t?this.logLevel=le[t.toUpperCase()]:console.error("logLevel is not a string. See the chat21-ionic README.md")},o.prototype.error=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.ERROR&&(t=this.logger).error.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.warn=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.WARN&&(t=this.logger).warn.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.info=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.INFO&&(t=this.logger).info.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.debug=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.DEBUG&&(t=this.logger).debug.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.prototype.log=function(n){for(var t,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];this.isLogEnabled&&this.logLevel>=le.DEBUG&&(t=this.logger).log.apply(t,(0,_e.ev)([n],(0,_e.CR)(r)))},o.\u0275fac=function(t){return new(t||o)(e.LFG(It.Kf))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}()),rn=function(){function i(){}return i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Me=ye(41858),Qn=function(){function i(){}return i.initFirebase=function(o){if(!i.firebaseInit){if(!o||"CHANGEIT"===o.apiKey)throw new Error("Firebase config is not defined. Please create your widget-config.json. See the Chat21-Web_widget Installation Page");i.firebaseInit=Me.Z.initializeApp(o)}return i.firebaseInit},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),Js=(ye(8995),ye(73993),ye(77420),function(i){function o(n){var t=i.call(this)||this;return t.http=n,t.BSAuthStateChanged=new he.X(null),t.BSSignOut=new he.X(null),t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.SERVER_BASE_URL=this.getBaseUrl(),this.URL_TILEDESK_CREATE_CUSTOM_TOKEN=this.SERVER_BASE_URL+"chat21/firebase/auth/createCustomToken",this.logger.debug("[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ",this.URL_TILEDESK_CREATE_CUSTOM_TOKEN),this.onAuthStateChanged()},o.prototype.getToken=function(){return this.firebaseToken},o.prototype.onAuthStateChanged=function(){var n=this,t=this;Me.Z.auth().onAuthStateChanged(function(r){n.logger.debug("[FIREBASEAuthSERVICE] onAuthStateChanged",r),r?(n.logger.debug("[FIREBASEAuthSERVICE] 2 - PUBLISH ONLINE to chat-manager"),t.BSAuthStateChanged.next("online")):(n.logger.debug("[FIREBASEAuthSERVICE] 1 - PUBLISH OFFLINE to chat-manager"),t.BSAuthStateChanged.next("offline"))})},o.prototype.signInFirebaseWithCustomToken=function(n){var a,t=this,r=this;switch(this.getPersistence()){case"SESSION":a=Me.Z.auth.Auth.Persistence.SESSION;break;case"LOCAL":a=Me.Z.auth.Auth.Persistence.LOCAL;break;case"NONE":default:a=Me.Z.auth.Auth.Persistence.NONE}return Me.Z.auth().setPersistence(a).then(function(){return(0,_e.mG)(t,void 0,void 0,function(){var u=this;return(0,_e.Jh)(this,function(y){return[2,Me.Z.auth().signInWithCustomToken(n).then(function(){return(0,_e.mG)(u,void 0,void 0,function(){return(0,_e.Jh)(this,function(j){return[2]})})}).catch(function(j){r.logger.error("[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ",j)})]})})}).catch(function(u){r.logger.error("[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ",u)})},o.prototype.createUserWithEmailAndPassword=function(n,t){var r=this;return Me.Z.auth().createUserWithEmailAndPassword(n,t).then(function(a){return r.logger.debug("[FIREBASEAuthSERVICE] CRATE USER WITH EMAIL: ",n," & PSW: ",t),a}).catch(function(a){return r.logger.error("[FIREBASEAuthSERVICE] createUserWithEmailAndPassword error: ",a.message),a})},o.prototype.sendPasswordResetEmail=function(n){var t=this;return Me.Z.auth().sendPasswordResetEmail(n).then(function(){t.logger.debug("[FIREBASEAuthSERVICE] firebase-send-password-reset-email")}).catch(function(r){t.logger.error("[FIREBASEAuthSERVICE] sendPasswordResetEmail error: ",r)})},o.prototype.signOut=function(){var n=this;return new Promise(function(t,r){Me.Z.auth().signOut().then(function(){n.logger.debug("[FIREBASEAuthSERVICE] firebase-sign-out"),n.BSSignOut.next(!0),t(!0)}).catch(function(a){t(!1),n.logger.error("[FIREBASEAuthSERVICE] signOut error: ",a)})})},o.prototype.delete=function(){var n=this;Me.Z.auth().currentUser.delete().then(function(){n.logger.debug("[FIREBASEAuthSERVICE] firebase-current-user-delete")}).catch(function(t){n.logger.error("[FIREBASEAuthSERVICE] delete error: ",t)})},o.prototype.createCustomToken=function(n){var t=new Se.WM({"Content-type":"application/json",Authorization:n}),u=this;this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN,{},{headers:t,responseType:"text"}).subscribe(function(y){u.firebaseToken=y,u.signInFirebaseWithCustomToken(y)},function(y){u.logger.error("[FIREBASEAuthSERVICE] createFirebaseCustomToken ERR ",y)})},o.prototype.logout=function(){return this.logger.debug("[FIREBASEAuthSERVICE] logout"),this.signOut()},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(St)),Qs=function(i){function o(n,t){var r=i.call(this)||this;return r.http=n,r.appConfig=t,r.BSConversationDetail=new he.X(null),r.conversationAdded=new he.X(null),r.conversationChanged=new he.X(null),r.conversationChangedDetailed=new he.X(null),r.conversationRemoved=new he.X(null),r.conversations=[],r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.conversations=[],this.isConversationClosingMap=new Map,this.BASE_URL=this.appConfig.getConfig().firebaseConfig.chat21ApiUrl,this.BASE_URL_DATABASE=this.appConfig.getConfig().firebaseConfig.databaseURL},o.prototype.subscribeToConversations=function(n){var t=this,r=Mt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEConversationsHandlerSERVICE] SubscribeToConversations conversations::ACTIVE urlNodeFirebase",r),this.ref=Me.Z.database().ref(r).orderByChild("timestamp").limitToLast(200),this.ref.on("child_changed",function(a){t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)}),this.ref.on("child_added",function(a){t.added(a)}),setTimeout(function(){n()},2e3)},o.prototype.getLastConversation=function(n){var t=this;this.getFirebaseToken(function(r,a){if(t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi idToken",a),t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi error",r),a){var u={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json"})},y=Mt(t.tenant,t.loggedUserId);t.http.get(t.BASE_URL_DATABASE+y+".json?auth="+a+'&orderBy="timestamp"&limitToLast=1',u).subscribe(function(ie){if(t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi - RES",ie),ie){var ue=ie[Object.keys(ie)[0]];ue.uid=Object.keys(ie)[0];var ge=t.completeConversation(ue);n(ge,null)}else ie||n(null,null)},function(ie){t.logger.error("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi ERROR ",ie),n(null,"error")},function(){t.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationsRESTApi * COMPLETE *")})}else n(null,"error")})},o.prototype.countIsNew=function(){var n=0;return this.conversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.setConversationRead=function(n){var t=Mt(this.tenant,this.loggedUserId)+"/"+n;Me.Z.database().ref(t).update({"/is_new":!1})},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){var t=this;this.setClosingConversation(n,!0);var r=Ue(this.conversations,n);this.deleteConversation(n,function(a){t.logger.debug("[FIREBASEConversationsHandlerSERVICE] ARCHIVE-CONV",a),"success"===a?r>-1&&t.conversations.splice(r,1):"error"===a&&t.setClosingConversation(n,!1)})},o.prototype.deleteConversation=function(n,t){var r=this;this.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV conversationId",n),this.getFirebaseToken(function(a,u){if(r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV idToken",u),r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV error",a),u){var y={headers:new Se.WM({Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+u})};r.http.delete(r.BASE_URL+"/api/"+r.tenant+"/conversations/"+n,y).subscribe(function(J){r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV - RES",J),t("success")},function(J){r.logger.error("[FIREBASEConversationsHandlerSERVICE] DELETE CONV ERROR ",J),t("error")},function(){r.logger.debug("[FIREBASEConversationsHandlerSERVICE] DELETE CONV * COMPLETE *")})}else t("error")})},o.prototype.getFirebaseToken=function(n){var t=Me.Z.auth().currentUser;this.logger.debug(" // firebase current user ",t),t&&t.getIdToken(!0).then(function(r){n(null,r)}).catch(function(r){n(r,null)})},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.conversations.find(function(j){return j.uid===n});if(this.logger.debug("[FIREBASEConversationsHandlerSERVICE] conversations *****: ",this.conversations),this.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationDetail *****: ",a),a)t(a);else{var u=Mt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEConversationsHandlerSERVICE] conversationDetail urlNodeFirebase *****",u);var y=Me.Z.database().ref(u);this.subscribe=y.on("value",function(j){var J=j.child("/"+n);if(J.exists()){var ie=J.val();if(r.logger.debug("[FIREBASEConversationsHandlerSERVICE] getConversationDetail conversation exist",J.val(),J.key),J&&J.key&&ie){ie.uid=J.key;var ue=r.completeConversation(ie);t(ue||null)}}else r.logger.log("[FIREBASEConversationsHandlerSERVICE] getConversationDetail conversation NOT exist",n),t(null)})}},o.prototype.dispose=function(){this.conversations=[],this.uidConvSelected="",this.logger.debug("[FIREBASEConversationsHandlerSERVICE] DISPOSE::: ",this.ref)},o.prototype.conversationGenerate=function(n){var t=n.val();t.uid=n.key;var r=this.completeConversation(t);if(this.isValidConversation(r)){this.setClosingConversation(n.key,!1);var a=Ue(this.conversations,r.uid);return a>-1?this.conversations.splice(a,1,r):this.conversations.splice(0,0,r),this.conversations.sort(at("timestamp","desc")),!0}return!1},o.prototype.added=function(n){if(this.conversationGenerate(n)){var t=Ue(this.conversations,n.key);t>-1&&this.conversationAdded.next(this.conversations[t])}else this.logger.error("[FIREBASEConversationsHandlerSERVICE]ADDED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.changed=function(n){var t=this.conversations[Ue(this.conversations,n.key)];if(this.conversationGenerate(n)){var r=Ue(this.conversations,n.key);if(r>-1){var a=this.conversations[r];this.conversationChanged.next(a),this.conversationChangedDetailed.next({value:a,previousValue:t})}}else this.logger.error("[FIREBASEConversationsHandlerSERVICE]CHANGED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.conversations,n.key);if(t>-1){var r=this.conversations[t];this.conversations.splice(t,1),this.conversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.completeConversation=function(n){this.logger.debug("[FIREBASEConversationsHandlerSERVICE] completeConversation --\x3e conv from firebase",n),n.selected=!1,(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return n.sender===this.loggedUserId?(r=n.recipient,t=n.recipient_fullname,n.sender_fullname=this.translationMap.get("YOU")):Cn(n)&&(r=n.recipient,t=n.recipient_fullname),n.conversation_with=r,n.conversation_with_fullname=t,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n,10)/1e3)},o.prototype.isValidConversation=function(n){return!!(this.isValidField(n.uid)&&this.isValidField(n.is_new)&&this.isValidField(n.last_message_text)&&this.isValidField(n.recipient)&&this.isValidField(n.recipient_fullname)&&this.isValidField(n.sender)&&this.isValidField(n.sender_fullname)&&this.isValidField(n.status)&&this.isValidField(n.timestamp)&&this.isValidField(n.channel_type))},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(Fe))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(mt),Ks=function(i){function o(){var n=i.call(this)||this;return n.archivedConversationAdded=new he.X(null),n.archivedConversationChanged=new he.X(null),n.archivedConversationRemoved=new he.X(null),n.archivedConversations=[],n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.archivedConversations=[],this.isConversationClosingMap=new Map},o.prototype.subscribeToConversations=function(n){var t=this,r=Zt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations conversations::ARCHIVED urlNodeFirebase",r),this.ref=Me.Z.database().ref(r).orderByChild("timestamp").limitToLast(200),this.ref.on("child_changed",function(a){t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)}),this.ref.on("child_added",function(a){t.added(a)}),setTimeout(function(){n()},2e3)},o.prototype.countIsNew=function(){var n=0;return this.archivedConversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.setConversationRead=function(n){var t=Zt(this.tenant,this.loggedUserId)+"/"+n;Me.Z.database().ref(t).update({"/is_new":!1})},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.archivedConversations.find(function(j){return j.uid===n});if(this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations getConversationDetail::ARCHIVED *****: ",a),a)t(a);else{var u=Zt(this.tenant,this.loggedUserId);this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] urlNodeFirebase conversationDetail *****",u,n);var y=Me.Z.database().ref(u);this.subscribe=y.on("value",function(j){var J=j.child("/"+n);if(J.exists()){var ie=J.val();if(r.logger.log("[FIREBASEArchivedConversationsHandlerSERVICE] getConversationDetail archived conversation exist",ie),J&&J.key&&ie){ie.uid=J.key;var ue=r.completeConversation(ie);t(ue||null)}}else r.logger.log("[FIREBASEArchivedConversationsHandlerSERVICE] getConversationDetail archived conversation NOT exist",n),t(null)})}},o.prototype.dispose=function(){this.archivedConversations=[],this.uidConvSelected="",this.logger.debug("[FIREBASEArchivedConversationsHandlerSERVICE] DISPOSE::: ",this.ref)},o.prototype.conversationGenerate=function(n){var t=n.val();t.uid=n.key;var r=this.completeConversation(t);if(this.isValidConversation(r)){this.setClosingConversation(n.key,!1);var a=Ue(this.archivedConversations,r.uid);return a>-1?this.archivedConversations.splice(a,1,r):this.archivedConversations.splice(0,0,r),this.archivedConversations.sort(at("timestamp","desc")),!0}return!1},o.prototype.added=function(n){if(this.conversationGenerate(n)){var t=Ue(this.archivedConversations,n.key);t>-1&&this.archivedConversationAdded.next(this.archivedConversations[t])}else this.logger.error("[FIREBASEArchivedConversationsHandlerSERVICE] ADDED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.changed=function(n){if(this.conversationGenerate(n)){var t=Ue(this.archivedConversations,n.key);t>-1&&this.archivedConversationChanged.next(this.archivedConversations[t])}else this.logger.error("[FIREBASEArchivedConversationsHandlerSERVICE] CHANGED::conversations with conversationId: ",n.key,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.archivedConversations,n.key);if(t>-1){var r=this.archivedConversations[t];this.archivedConversations.splice(t,1),this.archivedConversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.completeConversation=function(n){n.selected=!1,(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return n.sender===this.loggedUserId?(r=n.recipient,t=n.recipient_fullname,n.sender_fullname=this.translationMap.get("YOU")):Cn(n)&&(r=n.recipient,t=n.recipient_fullname),n.conversation_with=r,n.conversation_with_fullname=t,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.archived=!0,n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n,10)/1e3)},o.prototype.isValidConversation=function(n){return!!(this.isValidField(n.uid)&&this.isValidField(n.is_new)&&this.isValidField(n.last_message_text)&&this.isValidField(n.recipient)&&this.isValidField(n.recipient_fullname)&&this.isValidField(n.sender)&&this.isValidField(n.sender_fullname)&&this.isValidField(n.status)&&this.isValidField(n.timestamp)&&this.isValidField(n.channel_type))},o.prototype.isValidField=function(n){return null!=n},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(vt),Kn=(ye(95132),function(){return function(o,n,t,r,a,u,y,j,J,ie,ue,ge,de,ve,Te){this.uid=o,this.language=n,this.recipient=t,this.recipient_fullname=r,this.sender=a,this.sender_fullname=u,this.status=y,this.metadata=j,this.text=J,this.timestamp=ie,this.type=ue,this.attributes=ge,this.channel_type=de,this.isSender=ve,this.emoticon=Te}}()),Xn=function(i){function o(n){var t=i.call(this)||this;return t.skipInfoMessage=n,t.messageAdded=new he.X(null),t.messageChanged=new he.X(null),t.messageRemoved=new he.X(null),t.messageWait=new he.X(null),t.messageInfo=new he.X(null),t.startTime=new Date,t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r,a,u,y){this.logger.debug("[FIREBASEConversationHandlerSERVICE] initWithRecipient",n,t,r,a,u),this.recipientId=n,this.recipientFullname=t,this.loggedUser=r,r&&(this.senderId=r.uid),this.tenant=a,this.translationMap=u,this.listSubsriptions=[],this.CLIENT_BROWSER=navigator.userAgent,this.conversationWith=n,this.messages=[],this.showInfoMessage=y},o.prototype.connect=function(){var n=this,t=this;this.urlNodeFirebase=function(i,o){return"/apps/"+i+"/users/"+o+"/messages/"}(this.tenant,this.loggedUser.uid),this.urlNodeFirebase=this.urlNodeFirebase+this.conversationWith,this.logger.debug("[FIREBASEConversationHandlerSERVICE] urlNodeFirebase *****",this.urlNodeFirebase);var r=Me.Z.database().ref(this.urlNodeFirebase);this.ref=r.orderByChild("timestamp").limitToLast(100),this.ref.on("child_added",function(a){t.logger.debug("[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_added: ",a.val());var u=a.val();u.uid=a.key,u.attributes&&u.attributes.commands?(n.logger.debug("[FIREBASEConversationHandlerSERVICE] splitted message::::",u),t.addCommandMessage(u)):(n.logger.debug("[FIREBASEConversationHandlerSERVICE] NOT splitted message::::",u),t.addedNew(u))}),this.ref.on("child_changed",function(a){t.logger.debug("[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_changed: ",a.val()),t.changed(a)}),this.ref.on("child_removed",function(a){t.removed(a)})},o.prototype.sendMessage=function(n,t,r,a,u,y,j,J,ie){(!J||"undefined"===J)&&(J=W);var ge=Me.Z.database().ref(this.urlNodeFirebase),de=document.documentElement.lang,ve=u,ke=new Kn("",de,a,ve,y,j,0,r,n,Me.Z.database.ServerValue.TIMESTAMP,t,ie,J,!0);return ge.push({language:de,recipient:a,recipient_fullname:ve,sender:y,sender_fullname:j,status:0,metadata:r,text:n,timestamp:Me.Z.database.ServerValue.TIMESTAMP,type:t,attributes:ie,channel_type:J}),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e messages: ",this.messages),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e senderFullname: ",j),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e sender: ",y),this.logger.debug("[FIREBASEConversationHandlerSERVICE] sendMessage --\x3e SEND MESSAGE: ",n,J),ke},o.prototype.dispose=function(){},o.prototype.added=function(n){var t=this.messageGenerate(n);Xe(N,t)||(this.addRepalceMessageInArray(n.key,t),this.messageAdded.next(t))},o.prototype.addedNew=function(n){var t=this.messageCommandGenerate(n);if(this.isValidMessage(t)){var r=Xe(N,t);if(r&&this.messageInfo.next(t),r&&Et(t,this.showInfoMessage))return;if(r&&!Et(t,this.showInfoMessage)&&!Mn(t,this.loggedUser))return;this.addRepalceMessageInArray(t.uid,t),this.messageAdded.next(t)}else this.logger.error("[FIREBASEConversationHandlerSERVICE] ADDED::message with uid: ",t.uid,"is not valid")},o.prototype.changed=function(n){var t=this.messageGenerate(n);if(this.isValidMessage(t)){if(Xe(N,t)||t.attributes&&t.attributes.commands)return;this.addRepalceMessageInArray(n.key,t),this.messageChanged.next(t)}else this.logger.error("[FIREBASEConversationHandlerSERVICE] CHANGED::message with uid: ",t.uid,"is not valid")},o.prototype.removed=function(n){var t=Ue(this.messages,n.key);t>-1&&(this.messages.splice(t,1),this.messageRemoved.next(n.key))},o.prototype.messageGenerate=function(n){var t=n.val();return t.uid=n.key,t.text=t.text.trim(),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.messageCommandGenerate=function(n){var t=n;return t.text&&(t.text=t.text.trim()),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.addRepalceMessageInArray=function(n,t){var r=Ue(this.messages,n);r>-1?this.messages.splice(r,1,t):this.messages.splice(0,0,t),this.messages.sort(at("timestamp","asc")),this.setStatusMessage(t,this.conversationWith)},o.prototype.translateInfoSupportMessages=function(n){var t=this.translationMap.get("INFO_SUPPORT_USER_ADDED_SUBJECT"),r=this.translationMap.get("INFO_SUPPORT_USER_ADDED_YOU_VERB"),a=this.translationMap.get("INFO_SUPPORT_USER_ADDED_COMPLEMENT"),u=this.translationMap.get("INFO_SUPPORT_USER_ADDED_VERB"),y=this.translationMap.get("INFO_SUPPORT_CHAT_REOPENED"),j=this.translationMap.get("INFO_SUPPORT_CHAT_CLOSED"),J=this.translationMap.get("INFO_SUPPORT_LEAD_UPDATED"),ie=this.translationMap.get("INFO_SUPPORT_MEMBER_LEFT_GROUP"),ue=this.translationMap.get("INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU");if(n.attributes.messagelabel&&n.attributes.messagelabel.parameters&&n.attributes.messagelabel.key===H){var ge=void 0,de=void 0,ve=void 0;n.attributes.messagelabel.parameters.member_id===this.loggedUser.uid?(ge=t,de=r,ve=a):n.attributes.messagelabel.parameters.fullname?(ge=n.attributes.messagelabel.parameters.fullname,de=u,ve=a):(ge=n.attributes.messagelabel.parameters.member_id,de=u,ve=a),n.text=ge+" "+de+" "+ve}else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===x)n.text=y;else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===D)n.text=j;else if(n.attributes&&n.attributes.messagelabel&&n.attributes.messagelabel.key===l&&"system"===n.sender){var Te=n.text.split(":")[1];void 0!==Te&&(n.text=ue+": "+Te)}else n.attributes.messagelabel&&n.attributes.messagelabel.key===te?n.text=J:n.attributes.messagelabel&&n.attributes.messagelabel.key===ee&&(ge=void 0,n.text=(ge=n.attributes.messagelabel.parameters.fullname?n.attributes.messagelabel.parameters.fullname:n.attributes.messagelabel.parameters.member_id)+" "+ie)},o.prototype.setStatusMessage=function(n,t){if(this.logger.debug("[FIREBASEConversationHandlerSERVICE] update statusss",n),n.status<_){var r=n.uid;if(n.attributes.commands&&(r=n.attributes.parentUid),n.sender!==this.loggedUser.uid&&n.status<_){var a=this.urlNodeFirebase+"/"+r;this.logger.debug("[FIREBASEConversationHandlerSERVICE] update message status",a),Me.Z.database().ref(a).update({status:_})}}},o.prototype.isSender=function(n,t){return!!t&&n===t},o.prototype.unsubscribe=function(n){var t=this;this.listSubsriptions.forEach(function(r){if(t.logger.debug("[FIREBASEConversationHandlerSERVICE] unsubscribe: ",r.uid,n),r.uid===n)return t.logger.debug("[FIREBASEConversationHandlerSERVICE] unsubscribe: ",r.uid,n),void r.unsubscribe(n,null)})},o.prototype.addCommandMessage=function(n){var t=this,r=n.attributes.commands,a=0;!function u(y){if("message"===y.type){if(t.logger.debug('[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e type="message"',y,a),a>=2){if(r[a-1].time||(r[a-1].time=1e3),y.message.timestamp=r[a-2].message.timestamp+r[a-1].time,!Wt(t.startTime.getTime(),n.timestamp)){var j=n.timestamp;r[a-2]&&(j=r[a-2].message.timestamp),y.message.timestamp=j+100,r[a+1]&&(r[a+1].time=0)}}else y.message.timestamp=n.timestamp,Wt(t.startTime.getTime(),n.timestamp)||r[a+1]&&(r[a+1].time=0);t.generateMessageObject(n,y.message,function(){(a+=1)<r.length?u(r[a]):t.logger.debug("[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e last command executed (wait), exit")})}else"wait"===y.type&&(t.logger.debug('[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e type="wait"',y,a,r.length),Wt(t.startTime.getTime(),n.timestamp)&&t.messageWait.next({uid:t.conversationWith,uidUserTypingNow:n.sender,nameUserTypingNow:n.sender_fullname,waitTime:y.time,command:y}),setTimeout(function(){(a+=1)<r.length?u(r[a]):t.logger.debug("[FIREBASEConversationHandlerSERVICE] addCommandMessage --\x3e last command executed (send message), exit")},y.time))}(r[0])},o.prototype.generateMessageObject=function(n,t,r){var a=n.uid;t.uid=(0,Ne.Z)(),t.text&&(t.text=t.text.trim()),t.language=n.language,t.recipient=n.recipient,t.recipient_fullname=n.recipient_fullname,t.sender=n.sender,t.sender_fullname=n.sender_fullname,t.channel_type=n.channel_type,t.status=n.status,t.isSender=n.isSender,t.attributes?t.attributes.commands=!0:t.attributes={commands:!0},t.attributes.parentUid=a,this.addedNew(t),r()},o.prototype.isValidMessage=function(n){return!0},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG("skipMessage"))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(rn),Xs=function(i){function o(){return i.call(this)||this}return(0,_e.ZT)(o,i),o.prototype.build=function(){return new Xn(!1)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Ct),$s=function(){return function(o,n,t,r){this.uid=o,this.timestamp=n,this.message=t,this.name=r}}(),el=function(i){function o(){var n=i.call(this)||this;return n.BSIsTyping=new he.X(null),n.BSSetTyping=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[FIREBASETypingSERVICE] initialize - tenant ",this.tenant),this.urlNodeTypings="/apps/"+this.tenant+"/typings/"},o.prototype.isTyping=function(n,t,r){var a=this,y=this.urlNodeTypings+n;r&&(y=this.urlNodeTypings+t+"/"+n),this.logger.debug("[FIREBASETypingSERVICE] urlTyping: ",y),this.ref=Me.Z.database().ref(y),this.ref.on("child_changed",function(j){var J=j.val();a.logger.debug("[FIREBASETypingSERVICE] child_changed: ",J),a.BSIsTyping.next({uid:n,uidUserTypingNow:J.uid,nameUserTypingNow:J.name,waitTime:2e3})})},o.prototype.setTyping=function(n,t,r,a){var u=this;clearTimeout(this.setTimeoutWritingMessages),this.setTimeoutWritingMessages=setTimeout(function(){var j=u.urlNodeTypings+n+"/"+r;u.logger.debug("[FIREBASETypingSERVICE] setWritingMessages:",j,a);var ie=new $s(r,Me.Z.database.ServerValue.TIMESTAMP,t,a);Me.Z.database().ref(j).set(ie,function(ue){ue?u.logger.error("[FIREBASETypingSERVICE] setTyping error",ue):u.BSSetTyping.next({uid:n,typing:ie})})},500)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(ht),tl=function(i){function o(){var n=i.call(this)||this;return n.BSIsOnline=new he.X(null),n.BSLastOnline=new he.X(null),n.logger=Ce.getInstance(),n.online_member=[],n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[FIREBASEPresenceSERVICE] initialize this.tenant",this.tenant),this.urlNodePresence="/apps/"+this.tenant+"/presence/"},o.prototype.userIsOnline=function(n){var t=this,r=new he.X(null),a=this.urlNodePresence+n+"/connections";this.logger.debug("[FIREBASEPresenceSERVICE] userIsOnline: ",a);var u=Me.Z.database().ref().child(a);return u.off(),u.on("value",function(y){t.logger.debug("[FIREBASEPresenceSERVICE] CONVERSATION-DETAIL group detail userIsOnline id user",n,"- child.val: ",y.val()),y.val()?(t.BSIsOnline.next({uid:n,isOnline:!0}),r.next({uid:n,isOnline:!0})):(t.BSIsOnline.next({uid:n,isOnline:!1}),r.next({uid:n,isOnline:!1}))}),r},o.prototype.lastOnlineForUser=function(n){var t=this;this.logger.debug("[FIREBASEPresenceSERVICE] lastOnlineForUser",n),this.referenceLastOnlineForUser(n).on("value",function(u){u.val()?t.BSLastOnline.next({uid:n,lastOnline:u.val()}):t.BSLastOnline.next({uid:n,lastOnline:null})})},o.prototype.setPresence=function(n){var t=this;this.onlineConnectionsRef=this.referenceOnlineForUser(n),this.lastOnlineConnectionsRef=this.referenceLastOnlineForUser(n),Me.Z.database().ref("/.info/connected").on("value",function(u){if(t.logger.debug("[FIREBASEPresenceSERVICE] self.deviceConnectionRef: ",u.val()),u.val())if(t.onlineConnectionsRef){t.keyConnectionRef=t.onlineConnectionsRef.push(!0),t.keyConnectionRef.onDisconnect().remove();var j=(new Date).valueOf();t.lastOnlineConnectionsRef.onDisconnect().set(j)}else t.logger.error("[FIREBASEPresenceSERVICE] setPresence --\x3e This is an error. self.deviceConnectionRef already set. Cannot be set again.")})},o.prototype.removePresence=function(){if(this.onlineConnectionsRef){var t=(new Date).valueOf();this.lastOnlineConnectionsRef.set(t),this.onlineConnectionsRef.off(),this.onlineConnectionsRef.remove(),this.logger.debug("[FIREBASEPresenceSERVICE] goOffline onlineConnectionsRef",this.onlineConnectionsRef)}},o.prototype.referenceLastOnlineForUser=function(n){var t=this.urlNodePresence+n+"/lastOnline";return Me.Z.database().ref().child(t)},o.prototype.referenceOnlineForUser=function(n){var t=this.urlNodePresence+n+"/connections";return Me.Z.database().ref().child(t)},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Pt),nl=function(i){function o(n){var t=i.call(this)||this;return t.http=n,t.urlStorageBucket=ce.firebaseConfig.storageBucket+"/o/profiles%2F",t}return(0,_e.ZT)(o,i),o.prototype.getImagePhotoUrl=function(n){this.baseImageURL=this.getImageBaseUrl();var a="/o/profiles%2F"+(n&&n.includes("bot_")?n.slice(4):n)+"%2Fthumb_photo.jpg?alt=media";return this.baseImageURL+Me.Z.storage().ref().bucket+a},o.prototype.checkImageExists=function(n,t){console.log("urllll",n),this.http.get(n,{responseType:"blob"}).subscribe(function(r){t(!0)},function(r){console.log("ressssssss errorr",r),t(!1)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(st),ol=function(i){function o(){var n=i.call(this)||this;return n.BSStateUpload=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.logger.debug("[FIREBASEUploadSERVICE] initialize")},o.prototype.upload=function(n,t){var r=this,u="/public/images/"+n+"/"+this.createGuid()+"/"+t.file.name;this.logger.debug("[FIREBASEUploadSERVICE] pushUpload ",u,t.file);var y=Me.Z.storage().ref();this.logger.debug("[FIREBASEUploadSERVICE] storageRef",y);var j=y.child(u);this.logger.debug("[FIREBASEUploadSERVICE] mountainsRef ",j);var ie=j.put(t.file,{name:t.file.name,contentType:t.file.type,contentDisposition:"attachment; filename="+t.file.name});return new Promise(function(ue,ge){ie.on("state_changed",function(ve){var Te=ve.bytesTransferred/ve.totalBytes*100;switch(r.logger.debug("[FIREBASEUploadSERVICE] Upload is "+Te+"% done"),r.BSStateUpload.next({upload:Te,type:t.file.type}),ve.state){case Me.Z.storage.TaskState.PAUSED:r.logger.debug("[FIREBASEUploadSERVICE] Upload is paused");break;case Me.Z.storage.TaskState.RUNNING:r.logger.debug("[FIREBASEUploadSERVICE] Upload is running")}},function(de){ge(de)},function(){r.logger.debug("[FIREBASEUploadSERVICE] Upload is complete",t),ue(ie.snapshot.ref.getDownloadURL())})})},o.prototype.createGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(pt),il=ye(75134),rl=ye(47289),al=ye(23268),an="/clientadded",Rt="/clientupdated",$n="/clientdeleted",eo="onMessageUpdatedForConversation",to="onMessageAddedForConversation",sl=function(){function i(o){if((0,il.Z)(this,i),this.client=null,this.reconnections=0,this.client_id=this.uuidv4(),this.log=!!o.log,o&&o.MQTTendpoint)if(o.MQTTendpoint.startsWith("/")){var t;this.log&&console.log("MQTTendpoint relative url"),t="mqtt:",t+="//"+window.location.host,this.endpoint=t+=o.MQTTendpoint}else this.endpoint=o.MQTTendpoint;else this.endpoint="ws://34.253.207.0:15675/ws";this.APIendpoint=o.APIendpoint,this.appid=o.appId,this.log&&console.log("final endpoint:",this.endpoint),this.user_id=null,this.jwt=null,this.last_handler=0,this.onConversationAddedCallbacks=new Map,this.onConversationUpdatedCallbacks=new Map,this.onConversationDeletedCallbacks=new Map,this.onArchivedConversationAddedCallbacks=new Map,this.onArchivedConversationDeletedCallbacks=new Map,this.onMessageAddedCallbacks=new Map,this.onMessageUpdatedCallbacks=new Map,this.onGroupUpdatedCallbacks=new Map,this.callbackHandlers=new Map,this.on_message_handler=null,this.topic_inbox=null,this.connected=!1}return(0,rl.Z)(i,[{key:"subscribeToMyConversations",value:function(n){var t=this;this.topic_inbox="apps/tilechat/users/"+this.user_id+"/#",this.log&&console.log("subscribing to:",this.user_id,"topic",this.topic_inbox),this.client.subscribe(this.topic_inbox,function(r){r&&console.error("An error occurred while subscribing user",t.user_id,"on topic:",t.topic_inbox,"Error:",r),t.log&&console.log("subscribed to:",t.topic_inbox," with err",r),n()})}},{key:"sendMessage",value:function(n,t,r,a,u,y,j,J,ie){var ue="apps/".concat(this.appid,"/outgoing/users/").concat(this.user_id,"/messages/").concat(r,"/outgoing"),ge={text:n,type:t,recipient_fullname:a,sender_fullname:u,attributes:y,metadata:j,channel_type:J},de=JSON.stringify(ge);this.client.publish(ue,de,null,function(ve){ie(ve,ge)})}},{key:"basicMessageBuilder",value:function(n,t,r,a,u,y,j){return{text:n,type:t,recipient_fullname:r,sender_fullname:a,attributes:u,metadata:y,channel_type:j}}},{key:"sendMessageRaw",value:function(n,t,r){var a="apps/".concat(this.appid,"/outgoing/users/").concat(this.user_id,"/messages/").concat(t,"/outgoing");this.log&&console.log("dest_topic:",a);var u=JSON.stringify(n);this.client.publish(a,u,null,function(y){r(y,n)})}},{key:"updateMessageStatus",value:function(n,t,r,a){this.log&&console.log("updating recipient_id:",n,"on conversWith",t,"status",r);var u="apps/".concat(this.appid,"/users/").concat(this.user_id,"/messages/").concat(t,"/").concat(n,"/update");this.log&&console.log("update dest_topic:",u);var y={status:r},j=JSON.stringify(y);this.log&&console.log("payload:",j),this.client.publish(u,j,null,function(J){a&&a(J,y)})}},{key:"updateConversationIsNew",value:function(n,t,r){this.log&&console.log("updating conversation with:",n,"is_new",t);var a="apps/".concat(this.appid,"/users/").concat(this.user_id,"/conversations/").concat(n,"/update");this.log&&console.log("update dest_topic:",a);var y=JSON.stringify({is_new:t});this.log&&console.log("payload:",y),this.client.publish(a,y,null,function(j){r&&r(j)})}},{key:"groupCreate",value:function(n,t,r,a){this.log&&console.log("creating group:",n,"id",t,"members",r);var u="".concat(this.APIendpoint,"/").concat(this.appid,"/groups");this.log&&console.log("creating group...",u),i.myrequest({url:u,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{group_name:n,group_id:t,group_members:r},method:"POST"},function(j,J,ie){j?a(j,null):ie&&a&&a(null,ie)},this.log)}},{key:"groupData",value:function(n,t){var r="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n);i.myrequest({url:r,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},method:"GET"},function(u,y,j){u?t(u,null):j&&t&&t(null,j)},this.log)}},{key:"groupLeave",value:function(n,t,r){this.log&&console.log("leaving group:",n);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members/").concat(t);this.log&&console.log("leaving group:",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},method:"DELETE"},function(y,j,J){y?r(y,null):r&&r(null,J)},this.log)}},{key:"groupJoin",value:function(n,t,r){this.log&&console.log("leaving group:",n);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members");this.log&&console.log("joining group:",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{member_id:t},method:"POST"},function(y,j,J){y?r(y,null):r&&r(null,J)},this.log)}},{key:"groupSetMembers",value:function(n,t,r){this.log&&console.log("setting group members of",n,"members",t);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/groups/").concat(n,"/members");this.log&&console.log("setting group members...",a),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:{members:t},method:"PUT"},function(y,j,J){y?r(y,null):J&&r&&r(null,J)},this.log)}},{key:"saveInstance",value:function(n,t,r){this.log&&console.log("saving instance_id:",n,"data",t);var a="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/instances/").concat(n);this.log&&console.log("saving instance..."),i.myrequest({url:a,headers:{Authorization:this.jwt,"Content-Type":"application/json;charset=UTF-8"},data:t,method:"POST"},function(y,j,J){y?r(y,null):J&&r&&r(null,J)},this.log)}},{key:"archiveConversation",value:function(n,t){this.log&&console.log("archiving conversation with:",n);var r="apps/tilechat/users/"+this.user_id+"/conversations/"+n+"/archive";this.log&&console.log("archive dest_topic:",r);var a=JSON.stringify({});this.client.publish(r,a,null,function(u){t&&t(u)})}},{key:"onConversationAdded",value:function(n){return this.last_handler++,this.onConversationAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onConversationUpdated",value:function(n){return this.last_handler++,this.onConversationUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onConversationDeleted",value:function(n){return this.last_handler++,this.onConversationDeletedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onArchivedConversationAdded",value:function(n){return this.last_handler++,this.onArchivedConversationAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onArchivedConversationDeleted",value:function(n){return this.last_handler++,this.onArchivedConversationDeletedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onMessageAdded",value:function(n){return this.last_handler++,this.onMessageAddedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onMessageAddedInConversation",value:function(n,t){return this.last_handler++,this.callbackHandlers.set(this.last_handler,{type:to,conversWith:n,callback:t}),this.last_handler}},{key:"onMessageUpdatedInConversation",value:function(n,t){return this.last_handler++,this.callbackHandlers.set(this.last_handler,{type:eo,conversWith:n,callback:t}),this.last_handler}},{key:"onMessageUpdated",value:function(n){return this.last_handler+=1,this.onMessageUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"onGroupUpdated",value:function(n){return this.last_handler+=1,this.onGroupUpdatedCallbacks.set(this.last_handler,n),this.last_handler}},{key:"removeOnMessageAddedHandler",value:function(n){this.onMessageAddedCallbacks.delete(n)}},{key:"removeOnGroupUpdatedHandler",value:function(n){this.onGroupUpdatedCallbacks.delete(n)}},{key:"start",value:function(n){var t=this;if(this.on_message_handler)return this.log&&console.log("this.on_message_handler already subscribed. Reconnected num",this.reconnections),void callbsubscribedCallbackack();this.subscribeToMyConversations(function(){t.on_message_handler=t.client.on("message",function(r,a){t.log&&console.log("topic:"+r+"\nmessage payload:"+a);var u=t.parseTopic(r);if(u){var y=u.conversWith;try{var j=JSON.parse(a.toString());if(t.onConversationUpdatedCallbacks&&r.includes("/conversations/")&&r.endsWith(Rt)&&(t.log&&console.log("conversation updated! /conversations/, topic:",r),t.onConversationUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)})),t.onConversationDeletedCallbacks&&r.includes("/conversations/")&&r.endsWith($n)&&(t.log&&console.log("conversation deleted! /conversations/, topic:",r,a.toString()),t.onConversationDeletedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)})),t.onArchivedConversationAddedCallbacks&&r.includes("/archived_conversations/")&&r.endsWith(an)&&t.onArchivedConversationAddedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.onArchivedConversationDeletedCallbacks&&r.includes("/archived_conversations/")&&r.endsWith($n)&&t.onArchivedConversationDeletedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),r.includes("/messages/")&&r.endsWith(an)){t.onMessageAddedCallbacks&&t.onMessageAddedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)});var J=!0;j.attributes&&0==j.attributes.updateconversation&&(J=!1),J&&t.onConversationAddedCallbacks&&t.onConversationAddedCallbacks.forEach(function(ie,ue,ge){j.is_new=!0;var de=JSON.stringify(j);ie(JSON.parse(de),u)})}t.onMessageUpdatedCallbacks&&r.includes("/messages/")&&r.endsWith(Rt)&&t.onMessageUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.onGroupUpdatedCallbacks&&r.includes("/groups/")&&r.endsWith(Rt)&&t.onGroupUpdatedCallbacks.forEach(function(ie,ue,ge){ie(JSON.parse(a.toString()),u)}),t.callbackHandlers.forEach(function(ie,ue,ge){var de=ie,ve=de.type;r.includes("/messages/")&&r.endsWith(an)&&(t.log&&console.log("/messages/_CLIENTADDED"),ve===to&&y===de.conversWith&&(t.log&&console.log("/messages/_CLIENTADDED on: ",y),de.callback(JSON.parse(a.toString()),u))),r.includes("/messages/")&&r.endsWith(Rt)&&(t.log&&console.log("/messages/_CLIENTUPDATED"),ve===eo&&y===de.conversWith&&(t.log&&console.log("/messages/_CLIENTUPDATED on: ",y),de.callback(JSON.parse(a.toString()),u)))})}catch(ie){console.error("ERROR:",ie)}}else t.log&&console.log("Invalid message topic:",r)}),n()})}},{key:"parseTopic",value:function(n){var t=n.split("/");return t.length>=7?{conversWith:t[5]}:null}},{key:"lastArchivedConversations",value:function(n){var t="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/archived_conversations");this.log&&console.log("getting last archived conversations...",t);var r=new XMLHttpRequest;r.open("GET",t,!0),r.setRequestHeader("authorization",this.jwt),r.onreadystatechange=function(){if(n&&4==r.readyState&&200==r.status&&r.responseText)try{var a=JSON.parse(r.responseText);n(null,a.result)}catch(u){console.error("parsing json ERROR",u),n(u,null)}},r.send(null)}},{key:"lastConversations",value:function(n,t){var r=n?"/archived":"",a="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/conversations")+r;this.log&&console.log("getting last convs...",a);var u=new XMLHttpRequest;u.open("GET",a,!0),u.setRequestHeader("authorization",this.jwt),u.onreadystatechange=function(){if(t&&4==u.readyState&&200==u.status&&u.responseText)try{var y=JSON.parse(u.responseText);t(null,y.result)}catch(j){console.error("parsing json ERROR",j),t(j,null)}},u.send(null)}},{key:"conversationDetail",value:function(n,t){this.log&&console.log("conversationDetail(). searching on user:",this.user_id," - conversWith:",n),this.crossConversationDetail(n,!1,t)}},{key:"archivedConversationDetail",value:function(n,t){this.log&&console.log("archivedConversationDetail(). searching on user:",this.user_id," - conversWith:",n),this.crossConversationDetail(n,!0,t)}},{key:"crossConversationDetail",value:function(n,t,r){var a=this;this.log&&console.log("searching on user:",this.user_id," - conv of conversWith:",n," - archived:",t);var u="conversations";t&&(u="archived_conversations");var y="".concat(this.APIendpoint,"/").concat(this.appid,"/").concat(this.user_id,"/").concat(u,"/").concat(n);this.log&&(console.log("getting conversation detail:",y),console.log("conversWith:",n)),i.myrequest({url:y,headers:{Authorization:this.jwt},method:"GET"},function(J,ie,ue){a.log&&console.log("JSON...",ue),ue&&ue.result&&Array.isArray(ue.result)&&1==ue.result.length?r(null,ue.result[0]):r(null,null)},this.log)}},{key:"lastMessages",value:function(n,t){var r=this.APIendpoint+"/"+this.appid+"/"+this.user_id+"/conversations/"+n+"/messages",a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("authorization",this.jwt),a.onreadystatechange=function(){if(t&&4==a.readyState&&200==a.status&&a.responseText)try{var u=JSON.parse(a.responseText);t(null,u.result)}catch(y){console.error("parsing json messages ERROR",y),t(y,null)}},a.send(null)}},{key:"connect",value:function(n,t,r){var a=this;this.user_id=n,this.jwt=t,this.log&&(console.log("connecting user_id:",n),console.log("using jwt token:",t)),this.client&&this.client.end();var u="apps/tilechat/users/"+this.user_id+"/presence/"+this.client_id,y={keepalive:10,reconnectPeriod:1e3,will:{topic:u,payload:'{"disconnected":true}',qos:1,retain:!0},clientId:this.client_id,username:"JWT",password:t,rejectUnauthorized:!1};this.log&&console.log("starting mqtt connection with LWT on:",u,this.endpoint),this.client=al.connect(this.endpoint,y),this.client.on("connect",function(){a.log&&console.log("Chat client connected. User:"+n),a.connected||(a.log&&console.log("Chat client first connection for:"+n),a.connected=!0,a.start(function(){r()}))}),this.client.on("reconnect",function(){a.log&&console.log("Chat client reconnect event")}),this.client.on("close",function(){a.log&&console.log("Chat client close event")}),this.client.on("offline",function(){a.log&&console.log("Chat client offline event")}),this.client.on("error",function(j){console.error("Chat client error event",j)})}},{key:"close",value:function(n){var t=this;this.topic_inbox&&this.client.unsubscribe(this.topic_inbox,function(r){t.log&&console.log("unsubscribed from",t.topic_inbox),t.client.end(function(){t.connected=!1,t.onConversationAddedCallbacks=new Map,t.onConversationUpdatedCallbacks=new Map,t.onConversationDeletedCallbacks=new Map,t.onArchivedConversationAddedCallbacks=new Map,t.onArchivedConversationDeletedCallbacks=new Map,t.onMessageAddedCallbacks=new Map,t.onMessageUpdatedCallbacks=new Map,t.onGroupUpdatedCallbacks=new Map,t.callbackHandlers=new Map,t.on_message_handler=null,t.topic_inbox=null,n&&n()})})}},{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"==n?t:3&t|8).toString(16)})}}],[{key:"myrequest",value:function(n,t,r){r&&console.log("HTTP Request:",n);var a=new XMLHttpRequest;a.open(n.method,n.url,!0),Object.keys(n.headers).forEach(function(u){a.setRequestHeader(u,n.headers[u])}),a.onreadystatechange=function(){if(t&&4==a.readyState&&200==a.status&&a.responseText)try{var u=JSON.parse(a.responseText);t(null,null,u)}catch(y){console.error("parsing json ERROR",y),t(y,null)}},a.send("POST"===n.method?JSON.stringify(n.data):null)}}]),i}(),Je=function(){function i(){}return Object.defineProperty(i.prototype,"config",{get:function(){return this._config},set:function(o){this._config=o},enumerable:!1,configurable:!0}),i.prototype.initChat=function(){if(!this._config||"CHANGEIT"===this._config.appId)throw new Error("chat21Config is not defined. Please setup your environment");this.chatClient?console.log("Did you try again to create a Chat21Client istance?"):this.chatClient=new sl(this._config)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac=function(n){return new(n||i)}}),i}(),cl=function(i){function o(n,t,r){var a=i.call(this)||this;return a.http=n,a.chat21Service=t,a.appStorage=r,a.BSAuthStateChanged=new he.X(null),a.BSSignOut=new he.X(null),a.logger=Ce.getInstance(),a}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.SERVER_BASE_URL=this.getBaseUrl(),this.URL_TILEDESK_CREATE_CUSTOM_TOKEN=this.SERVER_BASE_URL+"chat21/native/auth/createCustomToken",this.logger.log("[MQTTAuthService] initialize "),this.onAuthStateChanged()},o.prototype.logout=function(){var n=this;return this.logger.log("[MQTTAuthService] logout: closing mqtt connection..."),new Promise(function(t,r){n.chat21Service.chatClient.close(function(){n.currentUser=null,n.logger.debug("[MQTTAuthService] logout: mqtt connection closed. user removed. OK"),n.BSSignOut.next(!0),n.BSAuthStateChanged.next("offline"),t(!0)})})},o.prototype.getUser=function(){return this.currentUser},o.prototype.getToken=function(){return this.logger.debug("[MQTTAuthService]::getToken"),this.token},o.prototype.onAuthStateChanged=function(){this.logger.debug("UserService::onAuthStateChanged"),this.BSAuthStateChanged.next("offline"),this.logger.debug("STORAGE CHANGED: added listner")},o.prototype.createCustomToken=function(n){this.connectWithCustomToken(n)},o.prototype.connectWithCustomToken=function(n){var t=this,r=new Se.WM({"Content-type":"application/json",Authorization:n});this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN,{},{headers:r,responseType:"text"}).subscribe(function(y){t.logger.debug("[MQTTAuthService] connectWithCustomToken: **** data",y);var j=JSON.parse(y);t.connectMQTT(j)},function(y){t.logger.error(y)})},o.prototype.connectMQTT=function(n){var t=this;this.logger.debug("[MQTTAuthService] connectMQTT: **** credentials:",n),this.chat21Service.chatClient.connect(n.userid,n.token,function(){t.logger.debug("[MQTTAuthService] connectMQTT: Chat connected."),t.BSAuthStateChanged.next("online")})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(Je),e.LFG(He))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(St),ul=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t.BSConversationDetail=new he.X(null),t.conversationAdded=new he.X(null),t.conversationChanged=new he.X(null),t.conversationChangedDetailed=new he.X(null),t.conversationRemoved=new he.X(null),t.conversations=[],t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.logger.debug("[MQTTConversationsHandler] initialize"),this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.conversations=[],this.isConversationClosingMap=new Map},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.conversations.find(function(u){return u.conversation_with===n});this.logger.log("[MQTTConversationsHandler] getConversationDetail found locally? *****: ",a),a?t(a):(this.logger.log("[MQTTConversationsHandler] getConversationDetail Not found locally, remote.getConversationDetail *****: ",a),this.chat21Service.chatClient.conversationDetail(n,function(u,y){r.logger.log("[MQTTConversationsHandler] getConversationDetail --REMOTE CONV IS OBJ:",y),y?t&&t(r.completeConversation(y)):t&&t(null)}))},o.prototype.setConversationRead=function(n){var t=this;this.logger.debug("[MQTTConversationsHandler] setConversationRead..."),this.chat21Service.chatClient.updateConversationIsNew(n,!1,function(r){r?t.logger.error("[MQTTConversationsHandler]setConversationRead: false. An error occurred",r):t.logger.debug("[MQTTConversationsHandler]setConversationRead: false. Ok")})},o.prototype.subscribeToConversations=function(n){var t=this;this.logger.debug("[MQTTConversationsHandler] connecting MQTT conversations handler"),this.chat21Service.chatClient.onConversationAdded(function(r){var a=t.completeConversation(r);t.logger.log("onConversationAdded completed:",a),t.searchIndexInArrayForConversationWith(t.conversations,a.conversation_with)>-1?(t.logger.log("[MQTTConversationsHandler] Added conv -> Changed!"),t.changed(a)):(t.logger.log("[MQTTConversationsHandler]Added conv -> Added!"),t.added(a))}),this.chat21Service.chatClient.onConversationUpdated(function(r,a){t.logger.debug("[MQTTConversationsHandler] conversation updated:",JSON.stringify(r)),t.changed(r)}),this.chat21Service.chatClient.onConversationDeleted(function(r,a){t.logger.debug("[MQTTConversationsHandler] conversation deleted:",r,a),t.removed({uid:a.conversWith})}),this.chat21Service.chatClient.lastConversations(!1,function(r,a){t.logger.debug("[MQTTConversationsHandler] Last conversations",a,"err",r),r||(a.forEach(function(u){t.added(u)}),n())})},o.prototype.getLastConversation=function(n){this.chat21Service.chatClient.lastConversations(!1,function(t,r){console.log("Last conversations",r,"err",t),t?n(null,t):n(r&&r.length>0?r[0]:null,null)})},o.prototype.added=function(n){this.logger.debug("[MQTTConversationsHandler] NEW CONV childSnapshot",n);var t=this.completeConversation(n);if(this.isValidConversation(t)){this.setClosingConversation(t.conversation_with,!1),this.logger.debug("[MQTTConversationsHandler] conversations:",t.uid,this.conversations);var r=this.searchIndexInArrayForConversationWith(this.conversations,t.conversation_with);console.log("NUOVA CONVER;.uid2"+t.uid),r>-1?(this.logger.debug("[MQTTConversationsHandler] TROVATO"),this.conversations.splice(r,1,t)):(this.logger.debug("[MQTTConversationsHandler] NON TROVATO"),this.conversations.splice(0,0,t)),this.logger.debug("[MQTTConversationsHandler] NUOVA CONVER;.uid3"+t.uid),this.conversations.sort(at("timestamp","desc")),this.logger.debug("[MQTTConversationsHandler] TUTTE:",this.conversations),this.conversationAdded.next(t)}else this.logger.error("[MQTTConversationsHandler] ChatConversationsHandler::added::conversations with conversationId: ",t.conversation_with,"is not valid")},o.prototype.searchIndexInArrayForConversationWith=function(n,t){return n.findIndex(function(r){return r.conversation_with===t})},o.prototype.changed=function(n){this.logger.debug("[MQTTConversationsHandler] Conversation changed:",n),n.conversation_with||(n.conversation_with=n.conversWith);var t=Ue(this.conversations,n.conversation_with);t>-1&&(this.updateConversationWithSnapshot(this.conversations[t],n),this.logger.debug("[MQTTConversationsHandler] conversationchanged.isnew",JSON.stringify(n)),this.conversations.sort(at("timestamp","desc")),this.conversations.splice(t,1,this.conversations[t]),this.conversationChanged.next(this.conversations[t]))},o.prototype.updateConversationWithSnapshot=function(n,t){var r=this;this.logger.debug("[MQTTConversationsHandler] updating conv",n,"with snap",t),Object.keys(t).forEach(function(a){"is_new"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.is_new=t[a]),"text"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.last_message_text=t[a],n.text=t[a]),"recipient"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.recipient=t[a]),"recipient_fullname"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.recipient_fullname=t[a]),"sender"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.sender=t[a]),"sender_fullname"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.sender_fullname=t[a]),"attributes"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.attributes=t[a]),"timestamp"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.timestamp=t[a]),"status"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.status=r.setStatusConversation(n.sender,n.uid)),"type"===a&&(r.logger.debug("[MQTTConversationsHandler] aggiorno key:"+a),n.type=t[a])})},o.prototype.removed=function(n){var t=Ue(this.conversations,n.uid);if(t>-1){var r=this.conversations[t];this.conversations.splice(t,1),this.logger.debug("[MQTTConversationsHandler] conversationRemoved::",r),this.conversationRemoved.next(r)}this.deleteClosingConversation(n.uid)},o.prototype.dispose=function(){this.conversations.length=0,this.conversations=[],this.uidConvSelected=""},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){this.chat21Service.chatClient.archiveConversation(n)},o.prototype.completeConversation=function(n){(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return(n.sender===this.loggedUserId||this.isGroup(n))&&(r=n.recipient,t=n.recipient_fullname,n.last_message_text=n.last_message_text),n.conversation_with_fullname=t,n.conversation_with=r,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.last_message_text||(n.last_message_text=n.text),n.uid=n.conversation_with,n.uid===this.uidConvSelected&&(n.is_new=!1),n.sender===this.loggedUserId&&(n.is_new=!1),n},o.prototype.isGroup=function(n){return!(!n.recipient||!n.recipient.startsWith("group-")&&!n.recipient.startsWith("support-group"))},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n)/1e3)},o.prototype.countIsNew=function(){var n=0;return this.conversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.isValidConversation=function(n){return this.logger.debug("[MQTTConversationsHandler] checking uid of",n),this.logger.debug("[MQTTConversationsHandler] conversation.uid",n.uid),this.logger.debug("[MQTTConversationsHandler] channel_type is:",n.channel_type),this.isValidField(n.uid)?this.isValidField(n.last_message_text)?this.isValidField(n.recipient)?this.isValidField(n.recipient_fullname)?this.isValidField(n.sender)?this.isValidField(n.sender_fullname)?this.isValidField(n.status)?this.isValidField(n.timestamp)?!!this.isValidField(n.channel_type)||(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "channel_type is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "timestamp is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "status is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender_fullname is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient_fullname is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "last_message_text is not valid" '),!1):(this.logger.error('[MQTTConversationsHandler] ChatConversationsHandler::isValidConversation:: "uid is not valid" '),!1)},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(mt),hl=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t.archivedConversationAdded=new he.X(null),t.archivedConversationChanged=new he.X(null),t.archivedConversationRemoved=new he.X(null),t.archivedConversations=[],t.logger=Ce.getInstance(),t}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.logger.debug("[MQTTArchivedConversationsHandler] initialize"),this.tenant=n,this.loggedUserId=t,this.translationMap=r,this.archivedConversations=[],this.isConversationClosingMap=new Map},o.prototype.getConversationDetail=function(n,t){var r=this,a=this.archivedConversations.find(function(u){return u.conversation_with===n});this.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail found locally? *****: ",a),a?(console.log("found!"),t(a)):(this.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail Not found locally, remote.getConversationDetail *****: ",a),this.chat21Service.chatClient.archivedConversationDetail(n,function(u,y){r.logger.log("[MQTTArchivedConversationsHandler] getConversationDetail --REMOTE CONV IS OBJ:",y),y?t&&t(r.completeConversation(y)):t&&t(null)}))},o.prototype.setConversationRead=function(n){},o.prototype.subscribeToConversations=function(n){var t=this;this.logger.debug("[MQTTArchivedConversationsHandler] connecting MQTT conversations handler"),this.chat21Service.chatClient.onArchivedConversationAdded(function(r){t.logger.log("[MQTTArchivedConversationsHandler] Added conv ->",r.text),t.added(r)}),this.chat21Service.chatClient.onArchivedConversationDeleted(function(r){t.logger.debug("[MQTTArchivedConversationsHandler] conversation deleted:",r),t.removed(r)}),this.chat21Service.chatClient.lastConversations(!0,function(r,a){t.logger.debug("[MQTTArchivedConversationsHandler] Last conversations",a,"err",r),r||(a.forEach(function(u){t.added(u)}),n())})},o.prototype.added=function(n){this.logger.debug("[MQTTArchivedConversationsHandler] NEW CONV childSnapshot",n);var t=this.completeConversation(n);if(t.uid=t.conversation_with,this.isValidConversation(t)){this.setClosingConversation(t.conversation_with,!1),this.logger.debug("[MQTTArchivedConversationsHandler] conversations:",t.uid,this.archivedConversations);var r=this.searchIndexInArrayForConversationWith(this.archivedConversations,t.conversation_with);console.log("NUOVA CONVER;.uid2"+t.uid),r>-1?(this.logger.debug("[MQTTArchivedConversationsHandler] TROVATO"),this.archivedConversations.splice(r,1,t)):(this.logger.debug("[MQTTArchivedConversationsHandler] NON TROVATO"),this.archivedConversations.splice(0,0,t)),this.logger.debug("[MQTTArchivedConversationsHandler] NUOVA CONVER;.uid3"+t.uid),this.archivedConversations.sort(at("timestamp","desc")),this.logger.debug("[MQTTArchivedConversationsHandler] TUTTE:",this.archivedConversations),this.archivedConversationChanged.next(t),this.archivedConversationAdded.next(t)}else this.logger.error("[MQTTArchivedConversationsHandler] ChatConversationsHandler::added::conversations with conversationId: ",t.conversation_with,"is not valid")},o.prototype.searchIndexInArrayForConversationWith=function(n,t){return n.findIndex(function(r){return r.conversation_with===t})},o.prototype.removed=function(n){var t=Ue(this.archivedConversations,n.key);if(t>-1){var r=this.archivedConversations[t];this.archivedConversations.splice(t,1),this.archivedConversationRemoved.next(r)}this.deleteClosingConversation(n.key)},o.prototype.dispose=function(){this.archivedConversations=[],this.archivedConversations.length=0,this.uidConvSelected=""},o.prototype.getClosingConversation=function(n){return this.isConversationClosingMap[n]},o.prototype.setClosingConversation=function(n,t){this.isConversationClosingMap[n]=t},o.prototype.deleteClosingConversation=function(n){this.isConversationClosingMap.delete(n)},o.prototype.archiveConversation=function(n){},o.prototype.completeConversation=function(n){(!n.sender_fullname||"undefined"===n.sender_fullname||""===n.sender_fullname.trim())&&(n.sender_fullname=n.sender),(!n.recipient_fullname||"undefined"===n.recipient_fullname||""===n.recipient_fullname.trim())&&(n.recipient_fullname=n.recipient);var t=n.sender_fullname,r=n.sender;return(n.sender===this.loggedUserId||"group"===n.channel_type)&&(r=n.recipient,t=n.recipient_fullname,n.last_message_text=n.last_message_text),n.conversation_with_fullname=t,n.conversation_with=r,n.status=this.setStatusConversation(n.sender,n.uid),n.avatar=_t(t),n.color=bt(t),n.last_message_text||(n.last_message_text=n.text),n},o.prototype.setStatusConversation=function(n,t){return n===this.loggedUserId||t===this.uidConvSelected?"0":"1"},o.prototype.getTimeLastMessage=function(n){return ft(parseInt(n)/1e3)},o.prototype.countIsNew=function(){var n=0;return this.archivedConversations.forEach(function(t){!0===t.is_new&&n++}),n},o.prototype.isValidConversation=function(n){return this.logger.debug("[MQTTArchivedConversationsHandler] checking uid of",n),this.logger.debug("[MQTTArchivedConversationsHandler] conversation.uid",n.uid),this.logger.debug("[MQTTArchivedConversationsHandler] channel_type is:",n.channel_type),this.isValidField(n.uid)?this.isValidField(n.last_message_text)?this.isValidField(n.recipient)?this.isValidField(n.recipient_fullname)?this.isValidField(n.sender)?this.isValidField(n.sender_fullname)?this.isValidField(n.status)?this.isValidField(n.timestamp)?!!this.isValidField(n.channel_type)||(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "channel_type is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "timestamp is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "status is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender_fullname is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "sender is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient_fullname is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "recipient is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "last_message_text is not valid" '),!1):(this.logger.error('[MQTTArchivedConversationsHandler] ChatConversationsHandler::isValidConversation:: "uid is not valid" '),!1)},o.prototype.isValidField=function(n){return null!=n},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(vt),no=function(i){function o(n,t){var r=i.call(this)||this;return r.chat21Service=n,r.skipInfoMessage=t,r.messageAdded=new he.X(null),r.messageChanged=new he.X(null),r.messageRemoved=new he.X(null),r.messageWait=new he.X(null),r.messageInfo=new he.X(null),r.lastDate="",r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r,a,u,y){this.logger.log("[MQTTConversationHandler] initWithRecipient:",a),this.recipientId=n,this.recipientFullname=t,this.loggedUser=r,r&&(this.senderId=r.uid),this.tenant=a,this.translationMap=u,this.listSubsriptions=[],this.CLIENT_BROWSER=navigator.userAgent,this.conversationWith=n,this.messages=[],this.showInfoMessage=y},o.prototype.connect=function(){var n=this;this.logger.log("[MQTTConversationHandler] connecting conversation handler..."),null!=this.conversationWith?(this.chat21Service.chatClient.lastMessages(this.conversationWith,function(a,u){a||u.forEach(function(y){n.addedMessage(y)})}),this.chat21Service.chatClient.onMessageAddedInConversation(this.conversationWith,function(a,u){n.logger.log("[MQTTConversationHandler] message added:",a,"on topic:",u),n.addedMessage(a)}),this.chat21Service.chatClient.onMessageUpdatedInConversation(this.conversationWith,function(a,u){n.logger.log("[MQTTConversationHandler] message updated:",a,"on topic:",u),n.updatedMessageStatus(a)})):this.logger.error("[MQTTConversationHandler] cant connect invalid this.conversationWith",this.conversationWith)},o.prototype.isGroup=function(n){return n.indexOf("group-")>=0},o.prototype.sendMessage=function(n,t,r,a,u,y,j,J,ie){var ue=this;(!J||"undefined"===J)&&(J=W),this.logger.log("[MQTTConversationHandler] Senderfullname",j);var de=document.documentElement.lang,ve=u,Te=a;return ie.lang=de,this.chat21Service.chatClient.sendMessage(n,t,Te,ve,j,ie,r,J,function(ke,Ae){ke?(Ae.status="-100",ue.logger.log("[MQTTConversationHandler] ERROR",ke)):Ae.status="150"}),new Kn("",de,a,ve,y,j,0,r,n,Date.now(),t,this.attributes,J,!1)},o.prototype.dispose=function(){},o.prototype.addedMessage=function(n){var t=this.messageGenerate(n);t.uid=t.message_id;var r=Xe(N,t);if(r&&this.messageInfo.next(t),(!r||!Et(t,this.showInfoMessage))&&(!r||Et(t,this.showInfoMessage)||Mn(t,this.loggedUser))){t.headerDate=null;var a=function(i,o){var n=new Date(o),t=new Date,r="";if(t.getFullYear()!==n.getFullYear()){var a=n.getMonth()+1;r=n.getDay()+"/"+a+"/"+n.getFullYear()}else t.getMonth()!==n.getMonth()?(a=n.getMonth()+1,r=n.getDay()+"/"+a+"/"+n.getFullYear()):r=t.getDay()===n.getDay()||t.getDay()-n.getDay()==1?xe().calendar(o).split(" ")[0].toLocaleLowerCase():function(i,o){return i.get("ARRAY_DAYS")[o]}(i,n.getDay());return r}(this.translationMap,t.timestamp);a!==this.lastDate&&(this.lastDate=a,t.headerDate=a),this.logger.log("[MQTTConversationHandler] adding message:"+JSON.stringify(t)),this.addReplaceMessageInArray(t.uid,t),this.updateMessageStatusReceived(t),this.messageAdded.next(t)}},o.prototype.updatedMessageStatus=function(n){if(!Xe(N,n)){this.logger.log("[MQTTConversationHandler] updating message with patch",n);var t=Ue(this.messages,n.message_id);if(t>-1){var r=this.messages[t];r&&(r.status=n.status,this.logger.log("[MQTTConversationHandler] message found and patched (replacing)",r),this.addReplaceMessageInArray(r.uid,r),this.messageChanged.next(r))}}},o.prototype.removed=function(n){var t=Ue(this.messages,n.key);t>-1&&(this.messages.splice(t,1),this.messageRemoved.next(n.key))},o.prototype.messageGenerate=function(n){this.logger.log("[MQTTConversationHandler] childSnapshot >"+JSON.stringify(n));var t=n;return t.uid=n.key,t.text=t.text.trim(),(!t.sender_fullname||"undefined"===t.sender_fullname)&&(t.sender_fullname=t.sender),this.logger.log("[MQTTConversationHandler] ****>msg.sender:"+t.sender),t.isSender=this.isSender(t.sender,this.loggedUser.uid),Xe(N,t)&&this.translateInfoSupportMessages(t),t},o.prototype.addReplaceMessageInArray=function(n,t){var r=Ue(this.messages,n);r>-1?this.messages.splice(r,1,t):this.messages.splice(0,0,t),this.messages.sort(at("timestamp","asc"))},o.prototype.translateInfoSupportMessages=function(n){var t=this.translationMap.get("INFO_SUPPORT_USER_ADDED_SUBJECT"),r=this.translationMap.get("INFO_SUPPORT_USER_ADDED_YOU_VERB"),a=this.translationMap.get("INFO_SUPPORT_USER_ADDED_COMPLEMENT"),u=this.translationMap.get("INFO_SUPPORT_USER_ADDED_VERB"),y=this.translationMap.get("INFO_SUPPORT_CHAT_REOPENED"),j=this.translationMap.get("INFO_SUPPORT_CHAT_CLOSED"),J=this.translationMap.get("INFO_SUPPORT_LEAD_UPDATED"),ie=this.translationMap.get("INFO_SUPPORT_MEMBER_LEFT_GROUP"),ue=this.translationMap.get("INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU");if(n.attributes.messagelabel&&n.attributes.messagelabel.parameters&&n.attributes.messagelabel.key===H){var ge=void 0,de=void 0,ve=void 0;n.attributes.messagelabel.parameters.member_id===this.loggedUser.uid?(ge=t,de=r,ve=a):n.attributes.messagelabel.parameters.fullname?(ge=n.attributes.messagelabel.parameters.fullname,de=u,ve=a):(ge=n.attributes.messagelabel.parameters.member_id,de=u,ve=a),n.text=ge+" "+de+" "+ve}else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===x)n.text=y;else if(n.attributes.messagelabel&&n.attributes.messagelabel.key===D)n.text=j;else if(n.attributes&&n.attributes.messagelabel&&n.attributes.messagelabel.key===l&&"system"===n.sender){var Te=n.text.split(":")[1];void 0!==Te&&(n.text=ue+": "+Te)}else n.attributes.messagelabel&&n.attributes.messagelabel.key===te?n.text=J:n.attributes.messagelabel&&n.attributes.messagelabel.key===ee&&(ge=void 0,n.text=(ge=n.attributes.messagelabel.parameters.fullname?n.attributes.messagelabel.parameters.fullname:n.attributes.messagelabel.parameters.member_id)+" "+ie)},o.prototype.updateMessageStatusReceived=function(n){this.logger.log("[MQTTConversationHandler] updateMessageStatusReceived",n),n.status<_&&(this.logger.log("[MQTTConversationHandler] status ",n.status," < (RECEIVED:200)",_),n.sender!==this.loggedUser.uid&&n.status<_&&(this.logger.log("[MQTTConversationHandler] updating message with status received"),this.chat21Service.chatClient.updateMessageStatus(n.message_id,this.conversationWith,_,null)))},o.prototype.isSender=function(n,t){return!!t&&n===t},o.prototype.unsubscribe=function(n){var t=this;this.logger.log("[MQTTConversationHandler] unsubscribe: ",n),this.listSubsriptions.forEach(function(r){t.logger.log("[MQTTConversationHandler] unsubscribe: ",r.uid,n),r.uid!==n||r.unsubscribe(n,null)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je),e.LFG("skipMessage"))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(rn),pl=function(i){function o(n){var t=i.call(this)||this;return t.chat21Service=n,t}return(0,_e.ZT)(o,i),o.prototype.build=function(){return new no(this.chat21Service,!0)},o.\u0275fac=function(t){return new(t||o)(e.LFG(Je))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(Ct),dl=function(i){function o(){var n=i.call(this)||this;return n.BSIsTyping=new he.X(null),n.BSSetTyping=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[MQTT-TYPING] initialize this.tenant",this.tenant),this.urlNodeTypings="/apps/"+this.tenant+"/typings/"},o.prototype.isTyping=function(n,t){},o.prototype.setTyping=function(n,t,r,a){},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(ht),gl=function(i){function o(){var n=i.call(this)||this;return n.BSIsOnline=new he.X(null),n.BSLastOnline=new he.X(null),n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n){this.tenant=n,this.logger.debug("[MQTT-PRESENCE] initialize this.tenant",this.tenant),this.urlNodePresence="/apps/"+this.tenant+"/presence/"},o.prototype.userIsOnline=function(n){return this.BSIsOnline},o.prototype.lastOnlineForUser=function(n){},o.prototype.setPresence=function(n){},o.prototype.removePresence=function(){},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac=function(t){return new(t||o)}}),o}(Pt),fl=function(i){function o(n){var t=i.call(this)||this;return t.http=n,t}return(0,_e.ZT)(o,i),o.prototype.getImagePhotoUrl=function(n){this.baseImageURL=this.getImageBaseUrl()+"images";var t;return t=n.includes("bot_")?n.slice(4):n,this.baseImageURL+"?path=uploads/users/"+t+"/images/photo.jpg"},o.prototype.checkImageExists=function(n,t){this.http.get(n).subscribe(function(r){t(!0)},function(r){console.log("errorrrrrr",n,r),t(!1)})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(st),ml=function(i){function o(n,t){var r=i.call(this)||this;return r.http=n,r.appStorage=t,r.BSStateUpload=new he.X(null),r.logger=Ce.getInstance(),r}return(0,_e.ZT)(o,i),o.prototype.initialize=function(){this.logger.debug("[NATIVE UPLOAD] initialize"),this.URL_TILEDESK_FILE=this.getBaseUrl()+"files",this.URL_TILEDESK_IMAGES=this.getBaseUrl()+"images",this.tiledeskToken=this.appStorage.getItem("tiledeskToken")},o.prototype.upload=function(n,t){var r=this;this.logger.debug("[NATIVE UPLOAD] - upload new image/file ... upload",t);var u={headers:new Se.WM({Authorization:this.tiledeskToken})},y=new FormData;y.append("file",t.file);var j=this;if(t.file.type.startsWith("image")&&!t.file.type.includes("svg")){this.logger.debug("[NATIVE UPLOAD] - upload new image");var J=this.URL_TILEDESK_IMAGES+"/users";return new Promise(function(ue,ge){j.http.post(J,y,u).subscribe(function(de){ue(r.URL_TILEDESK_IMAGES+"?path="+de.filename)},function(de){ge(de)})})}this.logger.debug("[NATIVE UPLOAD] - upload new file");var ie=this.URL_TILEDESK_FILE+"/users";return new Promise(function(ue,ge){j.http.post(ie,y,u).subscribe(function(de){var ve=r.URL_TILEDESK_FILE+"/download?path="+encodeURI(de.filename);t.file.type.includes("pdf")&&(ve=r.URL_TILEDESK_FILE+"?path="+encodeURI(de.filename)),ue(ve)},function(de){r.logger.error("[NATIVE UPLOAD] - ERROR upload new file ",de),ge(de)})})},o.\u0275fac=function(t){return new(t||o)(e.LFG(Se.eN),e.LFG(He))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(pt),vl=function(i){function o(){var n=null!==i&&i.apply(this,arguments)||this;return n.storagePrefix=z,n.logger=Ce.getInstance(),n}return(0,_e.ZT)(o,i),o.prototype.initialize=function(n,t,r){this.storagePrefix=n,this.projectID=r,this.persistence=t},o.prototype.getItem=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] getItem >Error :",a)}return this.getValueForKey(t+this.projectID+"_"+n)},o.prototype.setItem=function(n,t){var r;try{r=this.storagePrefix+"_"}catch(u){this.logger.error("[LocalSessionStorage] setItem > Error :",u)}this.saveValueForKey(r+this.projectID+"_"+n,t)},o.prototype.getItemWithoutProjectID=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] getItemWithoutProjectID > Error :",a)}return this.getValueForKey(t+n)},o.prototype.setItemWithoutProjectID=function(n,t){this.removeItem(n);var r=z;try{r=this.storagePrefix+"_"}catch(u){this.logger.error("[LocalSessionStorage] setItemWithoutProjectID > Error :",u)}this.saveValueForKey(r+n,t)},o.prototype.removeItem=function(n){var t;try{t=this.storagePrefix+"_"}catch(a){this.logger.error("[LocalSessionStorage] removeItem > Error :",a)}return this.removeItemForKey(t+this.projectID+"_"+n)},o.prototype.clear=function(){var n;try{n=this.storagePrefix+"_"}catch(y){this.logger.error("[LocalSessionStorage] clear > Error :",y)}for(var t=n+this.projectID,r=[],a=0;a<localStorage.length;a++){var u=localStorage.key(a);-1!==u.indexOf(t)&&r.push(u)}for(a=0;a<r.length;a++)this.removeItemForKey(r[a])},o.prototype.getValueForKey=function(n){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.getItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.getItem(n):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.getItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.prototype.saveValueForKey=function(n,t){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.setItem(n,t):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.setItem(n,t):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.setItem(n,t):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.prototype.removeItemForKey=function(n){return"local"===this.persistence||"LOCAL"===this.persistence?rt()?localStorage.removeItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null):"session"===this.persistence||"SESSION"===this.persistence?Dt()?sessionStorage.removeItem(n):(this.logger.warn("sessionStorage is not defind. Storage disabled"),null):"none"===this.persistence||"NONE"===this.persistence?null:rt()?localStorage.removeItem(n):(this.logger.warn("localStorage is not defind. Storage disabled"),null)},o.\u0275fac=function(){var n;return function(r){return(n||(n=e.n5z(o)))(r||o)}}(),o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac}),o}(He),bl=function(i,o){return function(){var n=new Gs(o);if(Ce.setInstance(n),ce.remoteConfig)return i.loadAppConfig()}};function _l(i,o,n,t){var a,r=o.getConfig();return r.chatEngine===De?(n.config=r.chat21Config,n.initChat(),(a=new cl(i,n,t)).setBaseUrl(o.getConfig().apiUrl),a):(Qn.initFirebase(r.firebaseConfig),(a=new Js(i)).setBaseUrl(r.apiUrl),a)}function Cl(i,o,n){return n.getConfig().chatEngine===De?new ul(i):new Qs(o,n)}function yl(i,o){return o.getConfig().chatEngine===De?new hl(i):new Ks}function wl(i,o){return o.getConfig().chatEngine===De?new pl(i):new Xs}function Ol(i,o){return o.getConfig().chatEngine===De?new no(i,!0):new Xn(!0)}function Ml(i){return i.getConfig().chatEngine===De?new dl:new el}function xl(i){return i.getConfig().chatEngine===De?new gl:new tl}function El(i,o){var n=i.getConfig();if("native"===n.uploadEngine)return(t=new fl(o)).setImageBaseUrl(n.baseImageUrl),t;var t=new nl(o);return Qn.initFirebase(n.firebaseConfig),t.setImageBaseUrl(n.baseImageUrl),t}function Tl(i,o,n){var t=o.getConfig();if("native"===t.uploadEngine){var r=new ml(i,n);return r.setBaseUrl(t.apiUrl),r}return new ol}var Sl=function(){function i(){}return i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=e.oAB({type:i,bootstrap:[Qt]}),i.\u0275inj=e.cJS({providers:[Fe,Je,Re,En,Tn,en,{provide:e.ip1,useFactory:bl,multi:!0,deps:[Fe,It.Kf]},{provide:He,useClass:vl},{provide:St,useFactory:_l,deps:[Se.eN,Fe,Je,He]},{provide:mt,useFactory:Cl,deps:[Je,Se.eN,Fe]},{provide:vt,useFactory:yl,deps:[Je,Fe]},{provide:Ct,useFactory:wl,deps:[Je,Fe]},{provide:rn,useFactory:Ol,deps:[Je,Fe]},{provide:st,useFactory:El,deps:[Fe,Se.eN]},{provide:Pt,useFactory:xl,deps:[Fe]},{provide:ht,useFactory:Ml,deps:[Fe]},{provide:pt,useFactory:Tl,deps:[Se.eN,Fe,He]},Pn,Jt,Gt,ut,xn,In],imports:[[Le.b2,Ws.PW,Se.JF,Oe.u5,Oe.UX,$e._G,Kt.z8,Zn.bd,Yt.aw.forRoot({}),It.f9.forRoot({level:It._z.DEBUG,enableSourceMaps:!1,disableFileDetails:!0,colorScheme:["purple","yellow","gray","gray","red","red","red"]})]]}),i}();e.B6R(Qt,[me.mk,me.PC,me.O5,Li,Ui,Ua,Vs,ds,Ss,yn,Cs,Ds],[]),ce.production&&(0,e.G48)(),Le.q6().bootstrapModule(Sl).catch(function(i){return console.error(i)})},46700:function(Ve,Qe,ye){var Le={"./af":90776,"./af.js":90776,"./ar":67634,"./ar-dz":42758,"./ar-dz.js":42758,"./ar-kw":64980,"./ar-kw.js":64980,"./ar-ly":9602,"./ar-ly.js":9602,"./ar-ma":52500,"./ar-ma.js":52500,"./ar-sa":36909,"./ar-sa.js":36909,"./ar-tn":92735,"./ar-tn.js":92735,"./ar.js":67634,"./az":27798,"./az.js":27798,"./be":29949,"./be.js":29949,"./bg":44590,"./bg.js":44590,"./bm":15938,"./bm.js":15938,"./bn":60595,"./bn-bd":51942,"./bn-bd.js":51942,"./bn.js":60595,"./bo":4756,"./bo.js":4756,"./br":17277,"./br.js":17277,"./bs":4166,"./bs.js":4166,"./ca":13943,"./ca.js":13943,"./cs":53474,"./cs.js":53474,"./cv":92218,"./cv.js":92218,"./cy":21061,"./cy.js":21061,"./da":82743,"./da.js":82743,"./de":31899,"./de-at":28580,"./de-at.js":28580,"./de-ch":3264,"./de-ch.js":3264,"./de.js":31899,"./dv":98784,"./dv.js":98784,"./el":54654,"./el.js":54654,"./en-au":56277,"./en-au.js":56277,"./en-ca":76896,"./en-ca.js":76896,"./en-gb":71609,"./en-gb.js":71609,"./en-ie":24557,"./en-ie.js":24557,"./en-il":15836,"./en-il.js":15836,"./en-in":30262,"./en-in.js":30262,"./en-nz":43586,"./en-nz.js":43586,"./en-sg":38965,"./en-sg.js":38965,"./eo":62777,"./eo.js":62777,"./es":63357,"./es-do":3128,"./es-do.js":3128,"./es-mx":69179,"./es-mx.js":69179,"./es-us":83256,"./es-us.js":83256,"./es.js":63357,"./et":2654,"./et.js":2654,"./eu":57287,"./eu.js":57287,"./fa":73875,"./fa.js":73875,"./fi":73431,"./fi.js":73431,"./fil":39606,"./fil.js":39606,"./fo":41781,"./fo.js":41781,"./fr":61717,"./fr-ca":11539,"./fr-ca.js":11539,"./fr-ch":19847,"./fr-ch.js":19847,"./fr.js":61717,"./fy":42250,"./fy.js":42250,"./ga":47665,"./ga.js":47665,"./gd":85214,"./gd.js":85214,"./gl":36154,"./gl.js":36154,"./gom-deva":68222,"./gom-deva.js":68222,"./gom-latn":18518,"./gom-latn.js":18518,"./gu":89221,"./gu.js":89221,"./he":64743,"./he.js":64743,"./hi":77339,"./hi.js":77339,"./hr":13224,"./hr.js":13224,"./hu":50856,"./hu.js":50856,"./hy-am":76855,"./hy-am.js":76855,"./id":2190,"./id.js":2190,"./is":53887,"./is.js":53887,"./it":19270,"./it-ch":85890,"./it-ch.js":85890,"./it.js":19270,"./ja":46595,"./ja.js":46595,"./jv":93081,"./jv.js":93081,"./ka":27477,"./ka.js":27477,"./kk":13978,"./kk.js":13978,"./km":19205,"./km.js":19205,"./kn":60025,"./kn.js":60025,"./ko":50427,"./ko.js":50427,"./ku":79089,"./ku.js":79089,"./ky":19314,"./ky.js":19314,"./lb":23136,"./lb.js":23136,"./lo":29115,"./lo.js":29115,"./lt":27087,"./lt.js":27087,"./lv":95683,"./lv.js":95683,"./me":79454,"./me.js":79454,"./mi":35507,"./mi.js":35507,"./mk":98466,"./mk.js":98466,"./ml":82933,"./ml.js":82933,"./mn":19477,"./mn.js":19477,"./mr":43597,"./mr.js":43597,"./ms":85529,"./ms-my":99965,"./ms-my.js":99965,"./ms.js":85529,"./mt":30259,"./mt.js":30259,"./my":88061,"./my.js":88061,"./nb":72618,"./nb.js":72618,"./ne":28452,"./ne.js":28452,"./nl":1885,"./nl-be":60413,"./nl-be.js":60413,"./nl.js":1885,"./nn":45107,"./nn.js":45107,"./oc-lnc":71763,"./oc-lnc.js":71763,"./pa-in":702,"./pa-in.js":702,"./pl":31711,"./pl.js":31711,"./pt":10594,"./pt-br":58238,"./pt-br.js":58238,"./pt.js":10594,"./ro":74681,"./ro.js":74681,"./ru":16201,"./ru.js":16201,"./sd":62912,"./sd.js":62912,"./se":6002,"./se.js":6002,"./si":67942,"./si.js":67942,"./sk":25577,"./sk.js":25577,"./sl":41775,"./sl.js":41775,"./sq":36823,"./sq.js":36823,"./sr":59038,"./sr-cyrl":83848,"./sr-cyrl.js":83848,"./sr.js":59038,"./ss":96173,"./ss.js":96173,"./sv":5788,"./sv.js":5788,"./sw":76882,"./sw.js":76882,"./ta":82678,"./ta.js":82678,"./te":82797,"./te.js":82797,"./tet":52447,"./tet.js":52447,"./tg":31335,"./tg.js":31335,"./th":68667,"./th.js":68667,"./tk":9222,"./tk.js":9222,"./tl-ph":99914,"./tl-ph.js":99914,"./tlh":71389,"./tlh.js":71389,"./tr":3578,"./tr.js":3578,"./tzl":36969,"./tzl.js":36969,"./tzm":76509,"./tzm-latn":690,"./tzm-latn.js":690,"./tzm.js":76509,"./ug-cn":20055,"./ug-cn.js":20055,"./uk":22452,"./uk.js":22452,"./ur":91151,"./ur.js":91151,"./uz":31555,"./uz-latn":46547,"./uz-latn.js":46547,"./uz.js":31555,"./vi":16541,"./vi.js":16541,"./x-pseudo":42401,"./x-pseudo.js":42401,"./yo":2341,"./yo.js":2341,"./zh-cn":80619,"./zh-cn.js":80619,"./zh-hk":67058,"./zh-hk.js":67058,"./zh-mo":89141,"./zh-mo.js":89141,"./zh-tw":22782,"./zh-tw.js":22782};function e(De){var nt=_e(De);return ye(nt)}function _e(De){if(!ye.o(Le,De)){var nt=new Error("Cannot find module '"+De+"'");throw nt.code="MODULE_NOT_FOUND",nt}return Le[De]}e.keys=function(){return Object.keys(Le)},e.resolve=_e,Ve.exports=e,e.id=46700},4147:function(Ve){"use strict";Ve.exports={i8:"5.0.46"}}},function(Ve){Ve.O(0,[736],function(){return Ve(Ve.s=27565)}),Ve.O()}]);
|