var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /** * crisp-client - Customer Messaging Made Simple. * @version v2.5.5 * @author Crisp IM SARL https://crisp.chat/ * @date 5/9/2019 */ (function(){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _is_development=!1;try{var Crisp={},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Crisp.Library=new(function(){function CrispLibrary(){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var fn="constructor";try{this.ns="CrispLibrary";var __crisp_local_context={},__crisp_local_instance=Crisp,__crisp_local_configuration={environment:"production"};__crisp_local_context.Console=function(){var e={};return e._environment=__crisp_local_configuration.environment,e._development="development"==e._environment,e._available="undefined"!=typeof window.console,e._has=e._development&&e._available,e._log_sink=function(e,t,i){},e.warn=function(t,i){e._has&&console.warn(t,i),e._log_sink("warn",t,i)},e.error=function(t,i){e._has&&console.error(t,i),e._log_sink("error",t,i)},e.info=function(t,i){e._has&&console.info(t,i),e._log_sink("info",t,i)},e.log=function(t,i){e._has&&console.log(t,i),e._log_sink("log",t,i)},e.debug=function(t,i){e._has&&("undefined"!=typeof console.debug?console.debug(t,i):console.log(t,i)),e._log_sink("debug",t,i)},e.set_log_sink=function(t){if("function"!=typeof t)throw new Error("Expected log sink argument to be a function");e._log_sink=t},e}(),!function(e){if("object"==typeof __crisp_void_exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof __crisp_void_define&&define.amd)define([],e);else{var t;"undefined"!=typeof __crisp_local_context?t=__crisp_local_context:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jade=e()}}(function(){return function e(t,i,r){function s(a,o){if(!i[a]){if(!t[a]){var _="function"==typeof require&&require;if(!o&&_)return _(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[a]={exports:{}};t[a][0].call(l.exports,function(e){var i=t[a][1][e];return s(i?i:e)},l,l.exports,e,t,i,r)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a/g,">").replace(/"/g,""");return t===""+e?e:t},i.rethrow=function t(i,r,s,n){if(!(i instanceof Error))throw i;if(!("undefined"==typeof window&&r||n))throw i.message+=" on line "+s,i;try{n=n||e("fs").readFileSync(r,"utf8")}catch(e){t(i,null,s)}var a=3,o=n.split("\n"),_=Math.max(s-a,0),c=Math.min(o.length,s+a),a=o.slice(_,c).map(function(e,t){var i=t+_+1;return(i==s?" > ":" ")+i+"| "+e}).join("\n");throw i.path=r,i.message=(r||"Jade")+":"+s+"\n"+a+"\n\n"+i.message,i}},{fs:2}],2:[function(e,t,i){},{}]},{},[1])(1)}),function(e,t){"function"==typeof __crisp_void_define&&define.amd?define(t):"undefined"!=typeof __crisp_void_exports?module.exports=t():e.cash=e.$=t()}(__crisp_local_context,function(){function e(t,i){return new e.fn.init(t,i)}function t(e){var t=t||n.createDocumentFragment(),i=i||t.appendChild(n.createElement("div"));return i.innerHTML=e,i}function i(e,t){return parseInt(a.getComputedStyle(e[0],null)[t],10)}function r(){function e(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return e()+e(!0)+e(!0)+e()}function s(t,i,s){var n=e(t).data("cshid")||r();e(t).data("cshid",n),n in f||(f[n]={}),i in f[n]||(f[n][i]=[]),f[n][i].push(s)}var n=document,a=window,o=Array.prototype,_=o.slice,c=o.filter,l=/^#[\w-]*$/,p=/^\.[\w-]*$/,h=/^[\w-]*$/,u=e.fn=e.prototype={cash:!0,length:0};u.init=function(t,i){var r,s,a=[];if(!t)return this;if(this.length=1,"string"!=typeof t)return t.cash?t:(this[0]=t,this);if("<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3)a=e.parseHTML(t);else{if(r=l.test(t),s=t.slice(1),!i&&r)return this[0]=n.getElementById(s),this;i=e(i)[0]||n,a=_.call(h.test(s)?p.test(t)?n.getElementsByClassName(s):n.getElementsByTagName(t):i.querySelectorAll(t))}return this.length=0,e.merge(this,a),this},u.init.prototype=u,e.each=function(e,t){for(var i=e.length,r=0;r(?:<\/\1>|)$/.exec(e);return i?[n.createElement(i[1])]:(i=t(e),_.call(i.childNodes))},e.unique=function(t){return e.merge(e(),_.call(t).filter(function(e,t,i){return i.indexOf(e)===t}))};var d=/\S+/g;u.extend({addClass:function(e){var t,i,r=e.match(d);return this.each(function(e){if(i=r.length,e.classList)for(;i--;)e.classList.add(r[i]);else for(;i--;)t=" "+e.className+" ",t.indexOf(" "+r[i]+" ")===-1&&(e.className+=" "+r[i])}),this},attr:function(e,t){return t?(this.each(function(i){return i.setAttribute(e,t)}),this):this[0].getAttribute(e)},hasClass:function(e){return this[0].classList?this[0].classList.contains(e):this[0].className.indexOf(e)!==-1},prop:function(e){return this[0][e]},removeAttr:function(e){return this.each(function(t){return t.removeAttribute(e)}),this},removeClass:function(e){var t,i,r=e.match(d);return this.each(function(e){if(t=r.length,e.classList)for(;t--;)e.classList.remove(r[t]);else{for(i=" "+e.className+" ";t--;)i=i.replace(" "+r[t]+" "," ");e.className=i.trim()}}),this}}),u.extend({add:function(){var t,i=_.call(this),r=0;for(t=arguments.length;r=0;t--)if(e=r.elements[t],e.name&&"file"!==e.type&&"reset"!==e.type)if("select-multiple"===e.type)for(i=r.elements[t].options.length-1;i>=0;i--)e.options[i].selected&&(s+="&"+e.name+"="+g(e.options[i].value).replace(/%20/g,"+"));else"submit"!==e.type&&"button"!==e.type&&(s+="&"+e.name+"="+g(e.value).replace(/%20/g,"+"));return s.substr(1)},val:function(e){return void 0===e?this[0].value:(this.each(function(t){return t.value=e}),this)}}),u.extend({append:function(t){return this[0].appendChild(e(t)[0]),this},appendTo:function(t){return e(t)[0].appendChild(this[0]),this},clone:function(){return e(this[0].cloneNode(!0))},empty:function(){return this.each(function(e){return e.innerHTML=""}),this},html:function(t){var i;return"undefined"===t?this[0].innerHTML:(i="object"==typeof t?e(t)[0].outerHTML:t,this.each(function(e){return e.innerHTML=""+i}),this)},insertAfter:function(t){return e(t)[0].insertAdjacentHTML("afterend",this[0].outerHTML),this},insertBefore:function(t){return e(t)[0].insertAdjacentHTML("beforebegin",this[0].outerHTML),this},prepend:function(t){return e(this)[0].insertAdjacentHTML("afterBegin",e(t)[0].outerHTML),this},prependTo:function(t){return e(t)[0].insertAdjacentHTML("afterBegin",this[0].outerHTML),this},remove:function(){this.each(function(e){return e.parentNode.removeChild(e)})},text:function(e){return e?(this.each(function(t){return t.textContent=e}),this):this[0].textContent}}),u.extend({children:function(t){return t?e(this[0].children).filter(function(i){return e.matches(i,t)}):e.fn.extend(this[0].children,e.fn)},closest:function(t){return!t||e.matches(this[0],t)?this:this.parent().closest(t)},is:function(t){return!!t&&(t.cash?this[0]===t[0]:"string"==typeof t&&e.matches(this[0],t))},find:function(t){return e.fn.extend(this[0].querySelectorAll(t),e.fn)},has:function(t){return c.call(this,function(i){return 0!==e(i).find(t).length})},next:function(){return e(this[0].nextElementSibling)},not:function(t){return c.call(this,function(i){return!e.matches(i,t)})},parent:function(){var t=o.map.call(this,function(e){return e.parentElement||n.body.parentNode});return e.unique(t)},parents:function(t){var i,r=[],s=0;return this.each(function(a){for(i=a;i!==n.body.parentNode;)i=i.parentElement,(!t||t&&e.matches(i,t))&&(r[s]=i,s++)}),e.unique(r)},prev:function(){return e(this[0].previousElementSibling)},siblings:function(){var e=this.parent().children(),t=this[0];return c.call(e,function(e){return e!==t})}}),e}),function(e,t){e.CrispLibraryWeb=new t}(__crisp_local_context,function(){function e(){}return e.prototype.init=function(e){var t=function(){function e(e){this.parent=e,this.__smiley_list={angry:/(^|\s|\()((?:=|:)(?:-)?@)($|\s|\))/i,blushing:/(^|\s|\()((?:=|:)(?:-)?\$)($|\s|\))/i,cool:/(^|\s|\()(8(?:-)?\))($|\s|\))/i,confused:/(^|\s|\()(x(?:-)?\))($|\s|\))/i,crying:/(^|\s|\()((?:=|:)'(?:-)?\()($|\s|\))/i,embarrased:/(^|\s|\()((?:=|:)(?:-)?\/)($|\s|\))/i,heart:/(^|\s|\()(<3)($|\s|\))/i,laughing:/(^|\s|\()((?:=|:)(?:-)?'D)($|\s|\))/i,sad:/(^|\s|\()((?:=|:)(?:-)?(?:\(|\|))($|\s|\))/i,sick:/(^|\s|\()((?:=|:)(?:-)?S)($|\s|\))/i,"small-smile":/(^|\s|\()((?:=|:)(?:-)?\))($|\s|\))/i,"big-smile":/(^|\s|\()((?:=|:)(?:-)?D)($|\s|\))/i,"thumbs-up":/(^|\s|\()(\+1)($|\s|\))/i,surprised:/(^|\s|\()((?:=|:)(?:-)?o)($|\s|\))/i,tongue:/(^|\s|\()((?:=|:)(?:-)?P)($|\s|\))/i,winking:/(^|\s|\()(;(?:-)?\))($|\s|\))/i}}return e.prototype.code=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"small",i=this.parent.template.render("smiley",{name:e,size:t});return i},e.prototype.parse=function(e){var t=void 0,i=void 0,r=void 0,s=void 0,n=void 0,a=e;for(t in this.__smiley_list)if(this.__smiley_list.hasOwnProperty(t))for(i=this.__smiley_list[t];null!==(n=a.match(i));)r="small",a===n[2]&&(r="large"),s=this.code(t,r),a=a.replace(i,"$1"+s+"$3");return a},e.prototype.count=function(e){var t=0,i=void 0,r=void 0,s=e;for(i in this.__smiley_list)if(this.__smiley_list.hasOwnProperty(i))for(r=this.__smiley_list[i];r.test(s)===!0;)t++,s=s.replace(r,"$1[]$3");return t},e.prototype.name=function(e){var t=void 0,i=void 0,r=null;for(t in this.__smiley_list)if(this.__smiley_list.hasOwnProperty(t)&&(i=this.__smiley_list[t],e.match(i))){r=t;break}return r},e}(),i=function(){function e(e){this.parent=e,this.__gtld_list=["aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","active","actor","ad","adac","ads","adult","ae","aeg","aero","aetna","af","afamilycompany","afl","africa","ag","agakhan","agency","ai","aig","aigo","airbus","airforce","airtel","akdn","al","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blanco","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bnl","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","boots","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","budapest","bugatti","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","cancerresearch","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","cartier","casa","case","caseih","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","ceb","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","chase","chat","cheap","chintai","chloe","christmas","chrome","chrysler","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","coop","corsica","country","coupon","coupons","courses","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","csc","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dodge","dog","doha","domains","dot","download","drive","dtv","dubai","duck","dunlop","duns","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epost","epson","equipment","ericsson","erni","es","esq","estate","esurance","et","etisalat","eu","eurovision","eus","events","everbank","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fujixerox","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glade","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodhands","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","honeywell","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hr","hsbc","ht","htc","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","industries","infiniti","info","ing","ink","institute","insurance","insure","int","intel","international","intuit","investments","io","ipiranga","iq","ir","irish","is","iselect","ismaili","ist","istanbul","it","itau","itv","iveco","iwc","jaguar","java","jcb","jcp","je","jeep","jetzt","jewelry","jio","jlc","jll","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","ki","kia","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","ky","kyoto","kz","la","lacaixa","ladbrokes","lamborghini","lamer","lancaster","lancia","lancome","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","liaison","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lixil","lk","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","lupin","luxe","luxury","lv","ly","ma","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mc","mcd","mcdonalds","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","meo","merckmsd","metlife","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mma","mn","mo","mobi","mobile","mobily","moda","moe","moi","mom","monash","money","monster","montblanc","mopar","mormon","mortgage","moscow","moto","motorcycles","mov","movie","movistar","mp","mq","mr","ms","msd","mt","mtn","mtpc","mtr","mu","museum","mutual","mv","mw","mx","my","mz","na","nab","nadex","nagoya","name","nationwide","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","newholland","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","northwesternmutual","norton","now","nowruz","nowtv","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","off","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onion","onl","online","onyourside","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","pamperedchef","panasonic","panerai","paris","pars","partners","parts","party","passagens","pay","pccw","pe","pet","pf","pfizer","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","piaget","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","qvc","racing","radio","raid","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","rightathome","ril","rio","rip","rmit","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sapo","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scjohnson","scor","scot","sd","se","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","shriram","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","space","spiegel","spot","spreadbetting","sr","srl","srt","st","stada","staples","star","starhub","statebank","statefarm","statoil","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiftcover","swiss","sx","sy","sydney","symantec","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","telecity","telefonica","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","uconnect","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","vermögensberater","vermögensberatung","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","vista","vistaprint","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","vuelos","wales","walmart","walter","wang","wanggou","warman","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","xperia","xxx","xyz","yachts","yahoo","yamaxun","yandex","yodobashi","yoga","yokohama","you","youtube","yt","yun","zappos","zara","zero","zip","zippo","zm","zone","zuerich","zw","ελ","бел","дети","ею","католик","ком","мкд","мон","москва","онлайн","орг","рус","рф","сайт","срб","укр","қаз","հայ","קום","ابوظبي","اتصالات","ارامكو","الاردن","الجزائر","السعودية","السعوديه","السعودیة","السعودیۃ","العليان","المغرب","اليمن","امارات","ايران","ایران","بازار","بيتك","بھارت","تونس","سودان","سوريا","سورية","شبكة","عراق","عرب","عمان","فلسطين","قطر","كاثوليك","كوم","مصر","مليسيا","موبايلي","موقع","همراه","پاكستان","پاکستان","कॉम","नेट","भारत","संगठन","বাংলা","ভারত","ਭਾਰਤ","ભારત","இந்தியா","இலங்கை","சிங்கப்பூர்","భారత్","ලංකා","คอม","ไทย","გე","みんな","クラウド","グーグル","コム","ストア","セール","ファッション","ポイント","世界","中信","中国","中國","中文网","企业","佛山","信息","健康","八卦","公司","公益","台湾","台灣","商城","商店","商标","嘉里","嘉里大酒店","在线","大众汽车","大拿","天主教","娱乐","家電","工行","广东","微博","慈善","我爱你","手机","手表","政务","政府","新加坡","新闻","时尚","書籍","机构","淡马锡","游戏","澳門","澳门","点看","珠宝","移动","组织机构","网址","网店","网站","网络","联通","臺灣","诺基亚","谷歌","购物","通販","集团","電訊盈科","飞利浦","食品","餐厅","香格里拉","香港","닷넷","닷컴","삼성","한국"],this.__html_escape={"&":/&/g,"<"://g,""":/"/g,"'":/'/g},this.__attribute_escape={"\\\\":/\\/g,"\\t":/\t/g,"\\n":/\n/g,"\\u00A0":/\u00A0/g},this.__escape_regex_regex=/[-\/\\^$*+?.()|[\]{}]/g,this.__protect_items_regex=/([\#\*\_\-\[\]\(\)~\.\|])/g,this.__links_regex={email:new RegExp("(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)([\\w\\._-]+@[\\w\\.\\/_-]+)(,|\\s|<[^<>]+\\/>|]*>|\\)|$)","gi"),domain:new RegExp("(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)((?:[^<>\\(\\)\\s,@]+)(?:\\.(?:"+this.__gtld_list.map(this.escape_regex.bind(this)).join("|")+")))(,|\\s|<[^<>]+\\/>|]*>|\\)|$)","gim"),uri:new RegExp("(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)((?:https?|ftps?|file):(?:[^<>\\(\\)\\s,]+))(,|\\s|<[^<>]+\\/>|]*>|\\)|$)","gim")},this.__markdown_regex=[["code_block",/(\s|<[^<>]+\/>|^)(`{2,3})([^`]*)(?:\2)(\s|\.|,|:|$)/gi],["code_inline",/(\s|<[^<>]+\/>|\(|^)(`{1})([^`]*)(?:\2)(\s|\.|,|:|\)|<\/[^<>]+>|$)/gim],["title",/(^)(#{1})(?:[\s]+)([^#].*)($)/gim],["title",/(^)(#{2})(?:[\s]+)([^#].*)($)/gim],["title",/(^)(#{3})(?:[\s]+)([^#].*)($)/gim],["title",/(^)(#{4})(?:[\s]+)([^#].*)($)/gim],["title",/(^)(#{5})(?:[\s]+)([^#].*)($)/gim],["title",/(^)(#{6})(?:[\s]+)([^#].*)($)/gim],["image",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)!\\[([^\\[]*)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")],["link",new RegExp("(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)\\[([^\\[]+)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|]*>|\\)|$)","gim")],["youtube",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)\\$\\{youtube\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")],["vimeo",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)\\$\\{vimeo\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")],["dailymotion",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)\\$\\{dailymotion\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")],["frame",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)\\$\\{frame\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")],["bold",/(\s|<[^<>]+\/>|\(|^)(\*\*)(.*?)(?:\2)/gim],["underline",/(\s|<[^<>]+\/>|\(|^)(__)(.*?)(?:\2)/gim],["italic",/(\s|<[^<>]+\/>|\(|^)(\*|_)(.*?)(?:\2)/gim],["delete",/(\s|<[^<>]+\/>|\(|^)(\~\~)(.*?)(?:\2)/gim],["highlight",/(\s|<[^<>]+\/>|\(|^)(\+\+)(.*?)(?:\2)/gim],["list",/(^\s*)(\*)(?:[\s]+)(.*?)($)/gim],["list",/(^\s*)(?:([\d]+)\.)(?:[\s]+)(.*?)($)/gim],["blockquote",/(^)(>|\>)(?:[\s]+)(.*)($)/gim],["emphasis",/(^)(\|{1})(?:[\s]+)([^\|].*)($)/gim],["emphasis",/(^)(\|{2})(?:[\s]+)([^\|].*)($)/gim],["emphasis",/(^)(\|{3})(?:[\s]+)([^\|].*)($)/gim],["interpolate",new RegExp('(\\s|\\(|^)(?:\\{\\{\\s*)([^\\{\\}\\|\\s]+)(?:\\s*\\|\\s*(?:(?:")|")([^&"]*)(?:(?:")|"))?(?:\\s*\\}\\})',"gim")],["line",/(^)(\s+)?(-{3,})(\s|$)/gim],["color",new RegExp("(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)\\$\\{color\\}\\[(#[0-9A-Fa-f]{6})\\]\\(([^\\)]+)\\)(\\s|.|,|:|<[^<>]+\\/>|\\)|$)","gim")]], this.__markdown_trim_items=["title","list","code_block","code_inline","blockquote","emphasis"],this.__markdown_protect_items=["code_block","code_inline"],this.__format_pipeline=[this.__apply_escape,this.__apply_consecutive_lines,this.__apply_markdown,this.__apply_links_uri,this.__apply_links_domain,this.__apply_emails,this.__apply_smileys,this.__apply_new_lines]}return e.prototype.format=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void 0,r=e;for(i=0;i1&&void 0!==arguments[1]?arguments[1]:[],i=void 0,r=void 0,s=e;for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return this.__apply_escape(e,{},"attribute")},e.prototype.escape_regex=function(e){return e.replace(this.__escape_regex_regex,"\\$&")},e.prototype.__apply_escape=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"html"),i=void 0,r=void 0,s=e,n=this["__"+t+"_escape"];for(r in n)n.hasOwnProperty(r)&&(i=n[r],s=s.replace(i,r));return s},e.prototype.__apply_consecutive_lines=function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.replace(/\n(\s+)?\n(\s+)?\n/g,"\n\n")},e.prototype.__apply_new_lines=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.parent.template.render("new_line",{},t);return e.trim().replace(/\n/g,i)},e.prototype.__apply_emails=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.replace(this.__links_regex.email,function(e,r,s,n){var a=t.parent.template.render("link_email",{email:s,no_external_link:t.parent.config.runtime.no_external_link||!1},i);return""+r+a+n})},e.prototype.__apply_markdown=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e="\n"+e+"\n";for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return e.replace(this.__links_regex.domain,function(e,r,s,n){var a=t.parent.template.render("link_domain",{domain_value:s,domain_name:s,no_external_link:t.parent.config.runtime.no_external_link||!1},i);return""+r+a+n})},e.prototype.__apply_links_uri=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.replace(this.__links_regex.uri,function(e,r,s,n){var a=t.parent.template.render("link_uri",{uri_value:s,uri_name:s,no_external_link:t.parent.config.runtime.no_external_link||!1},i);return""+r+a+n})},e.prototype.__apply_smileys=function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.parent.Smileys.parse(e)},e.prototype.__replace_markdown_item=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r,s,n,a,o){var _="",c="",l={type:null,value:null,url_crisp_image:t.parent.config.url.crisp_image,no_external_link:t.parent.config.runtime.no_external_link||!1};_=("string"==typeof s?s:null)||"",c=("string"==typeof o?o:null)||"",l.type=n,l.value=a,t.__markdown_trim_items.indexOf(e[0])!==-1&&"string"==typeof l.value&&(l.value=l.value.trim()),t.__markdown_protect_items.indexOf(e[0])!==-1&&"string"==typeof l.value&&(l.value=t.__protect_item(l.value));var p=t.parent.template.render("markdown_"+e[0],l,i);return""+_+p+c}},e.prototype.__protect_item=function(e){return e.replace(this.__protect_items_regex,function(e){return"&#"+e.charCodeAt(0)+";"})},e}(),r=function(){function e(e){this.parent=e,this.__full_name_regex=/^(\S+)((?:\s+)(.+))?$/}return e.prototype.parse_first_name=function(e){return this.__parse(e,1)},e.prototype.parse_last_name=function(e){return this.__parse(e,3)},e.prototype.__parse=function(e,t){var i=(e||"").trim();if(i){var r=i.match(this.__full_name_regex);r&&r[t]&&(i=r[t].trim())}return i},e}();this.__configure(e),this.Smileys=new t(this),this.Parse=new i(this),this.Name=new r(this)},e.prototype.__configure=function(e){e&&e.template&&(this.template=e.template),e&&e.config&&(this.config=e.config)},e}()),function(e,t){e.CrispLibraryClient=new t}(__crisp_local_context,function(){function CrispLibraryClient(){}return CrispLibraryClient.prototype.init=function init(params){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var __local_context={},__local_instance=this,CrispConfig=function(){function e(e){this.parent=e,this.__init_storage()}return e.prototype.set_ignore_privacy=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._ignore_privacy=e},e.prototype.set_visitor_compose=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._visitor_compose=e},e.prototype._clear=function(){this.__init_storage()},e.prototype.__init_storage=function(){this._ignore_privacy=!1,this._visitor_compose=!0},e}(),CrispSocket=function(){function e(e){this.parent=e,this.__init_events()}return e.prototype.get_state=function(){this.__publish_state(this.parent.socket.connected||!1)},e.prototype.__init_events=function(){var e=this;this.parent.socket.on("connect",function(){e.__publish_state(!0)}),this.parent.socket.on("disconnect",function(){e.__publish_state(!1)})},e.prototype.__publish_state=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.parent.event.publish("socket:state",{connected:e})},e}(),CrispStream=function(){function e(e){this.parent=e,this.__established=!1,this.__room=null,this.__events=[],this.__context={},this.__pending_bind_fn_success=null,this.__pending_bind_fn_error=null,this.__last_bound_room=null,this.__last_bound_events=null,this.__init_events()}return e.prototype.bind_to=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;this.__room=e,this.__events=t,this.__context=i,this.__pending_bind_fn_success=r,this.__pending_bind_fn_error=s,this.__established!==!0?this.parent.stream.connect():this.__trigger_connected()},e.prototype.unbind_from=function(){this.__cleanup(),this.parent.stream.disconnect()},e.prototype.__init_events=function(){var e=this;this.parent.stream.on("connect",function(){e.__established=!0,e.__trigger_connected()}),this.parent.stream.on("disconnect",function(){e.__established=!1,e.__trigger_disconnected()}),this.parent.stream.on("socket:bound",function(){e.__trigger_bound()})},e.prototype.__trigger_connected=function(){if(this.__last_bound_room!==this.__room||this.__last_bound_events!==this.__events){this.__last_bound_room=this.__room,this.__last_bound_events=this.__events;var e=[];this.__last_bound_room&&e.push(this.__last_bound_room),this.parent.stream.emit("socket:bind",{ray:"client",events:this.__last_bound_events,rooms:e,context:this.__context})}else this.__trigger_bound()},e.prototype.__trigger_disconnected=function(){null!==this.__pending_bind_fn_error&&this.__pending_bind_fn_error(),this.__cleanup(),this.__last_bound_room=null,this.__last_bound_events=null},e.prototype.__trigger_bound=function(){null!==this.__pending_bind_fn_success&&this.__pending_bind_fn_success(),this.__cleanup()},e.prototype.__cleanup=function(){this.__room=null,this.__events=[],this.__context={},this.__pending_bind_fn_success=null,this.__pending_bind_fn_error=null},e}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CrispStorage=function(){function e(e){this.parent=e,this.__ray_entropy_factor=1e5,this.__storage_prefix="crisp-client",this.__init_storage(),this.__init_events()}return e.prototype.update=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},s={ray:this.__gen_ray(e),type:e,data:t};this.__pending_rays_index.push(s.ray),this.__callback_register[s.ray]={success:i,error:r},this.parent.socket.emit("storage:sync:update",s),this.parent.event.publish("storage:sync:update",s)},e.prototype.get_stamp_local=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this._generate_store_key(e,t);return"object"===_typeof(window.localStorage)?window.localStorage.getItem(i)||"":""},e.prototype.set_stamp_local=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this._generate_store_key(e,t);return"object"===_typeof(window.localStorage)&&(window.localStorage.setItem(r,i),!0)},e.prototype.remove_stamp_local=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this._generate_store_key(e,t);return"object"===_typeof(window.localStorage)&&(window.localStorage.removeItem(i),!0)},e.prototype.clear_stamp_local=function(){if("object"===_typeof(window.localStorage)){for(var e in window.localStorage)window.localStorage.hasOwnProperty(e)&&0===e.indexOf(this.__storage_prefix)&&window.localStorage.removeItem(e);return!0}return!1},e.prototype.is_syncing_storage=function(){return this.__pending_rays_index.length>0&&!0},e.prototype._generate_store_key=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=this.__storage_prefix+"/"+e;return t.length>0&&(i+="/"+t.join("/")),i},e.prototype._clear=function(){this.__init_storage()},e.prototype.__init_storage=function(){this.__ray_entropy_seed=1,this.__ray_entropy_increment=0,this.__callback_register={},this.__pending_rays_index=[]},e.prototype.__init_events=function(){this.parent.socket.on("storage:sync:updated",this.__handle_storage_sync_updated.__crisp_bind(this))},e.prototype.__handle_storage_sync_updated=function(e){if("object"===_typeof(this.__callback_register[e.ray])){e.error?this.__callback_register[e.ray].error():this.__callback_register[e.ray].success(),delete this.__callback_register[e.ray];var t=this.__pending_rays_index.indexOf(e.ray);t!==-1&&this.__pending_rays_index.splice(t,1)}this.parent.event.publish("storage:sync:updated",e)},e.prototype.__gen_ray=function(e){var t=Math.floor(Math.random()*this.__ray_entropy_factor),i=this.__ray_entropy_increment++;return e+"/"+t+"/"+i},e}(),CrispMessage=function(){function e(e){this.parent=e,this.__message_compose_resend_delay=6e4,this.__message_compose_debounce_delay=4e3,this.__message_compose_regex=new RegExp(["(^(?:\\S+(?:(?:\\s+|\\?|\\!|\\.|\\(|\\)|:|;)|(?:[\\u4e00-\\u9fff])|(?:[\\u0e00-\\u0e7f])))+).*$"].join(""),"i"),this.__init_storage(),this.__init_events()}return e.prototype.update_message=function(e,t){var i={fingerprint:e,content:t};this.parent.socket.emit("message:update",i),this.__handle_message_updated(i,origin="local")},e.prototype.send_raw_message=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.__sending_messages_index.indexOf(e.fingerprint)===-1&&this.__sending_messages_index.push(e.fingerprint),this.parent.platform_name&&this.parent.platform_signature_key){_signature_data=[this.parent.Session._session_id,e.fingerprint,e.type];var r=this.parent.sha256.hmac.create(this.parent.platform_signature_key.split("/").map(function(e){return String.fromCharCode(parseInt(e,36))}).join(""));r.update("["+_signature_data.join("|")+"]"),e.signature=this.parent.platform_name+":"+r.hex()}this.parent.event.publish("message:send",e),setTimeout(function(){t.parent.socket.emit("message:send",e)},i)},e.prototype.send_text_message=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.send_raw_message({type:"text",origin:"chat",content:e,timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},t)},e.prototype.send_file_message=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.send_raw_message({type:"file",origin:"chat",content:{name:e,url:t,type:i},timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},r)},e.prototype.send_animation_message=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.send_raw_message({type:"animation",origin:"chat",content:{url:e,type:t},timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},i)},e.prototype.send_audio_message=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.send_raw_message({type:"audio",origin:"chat",content:{url:e,type:t,duration:i},timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},r)},e.prototype.send_picker_message=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.send_raw_message({type:"picker",origin:"chat",content:{id:e,text:t,choices:i},timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},r)},e.prototype.send_field_message=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.send_raw_message({type:"field",origin:"chat",content:{id:e,text:t,explain:i},timestamp:(new Date).getTime(),fingerprint:this.__gen_fingerprint()},r)},e.prototype.send_message_compose=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(this.parent.Config._ignore_privacy!==!0&&"1"===(navigator||{}).doNotTrack||this.parent.Config._visitor_compose===!1)&&(i=null),i=this.__rasterize_message_compose_excerpt(i);var r=e!==this.__message_compose.local.type&&!0;(r===!0||i!==(this.__message_compose.local.excerpt||null)||"start"===this.__message_compose.local.type&&this.__message_compose_local_since&&(new Date).getTime()-this.__message_compose_local_since>=this.__message_compose_resend_delay)&&(this.__message_compose_local_since=(new Date).getTime(),this.__message_compose.local={type:e},i&&(this.__message_compose.local.excerpt=i),r===!0&&null!==this.__defer_compose_debounce&&(clearTimeout(this.__defer_compose_debounce),this.__defer_compose_debounce=null),null===this.__defer_compose_debounce&&(this.__defer_compose_debounce=setTimeout(function(){t.__defer_compose_debounce=null,t.parent.socket.emit("message:compose:send",t.__message_compose.local),t.parent.event.publish("message:compose:send",t.__message_compose.local)},r===!0?0:this.__message_compose_debounce_delay)))},e.prototype.receive_message_local=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s={from:"operator",type:e,origin:"local",timestamp:(new Date).getTime(),content:t,fingerprint:null!==r?r:this.__gen_fingerprint(),user:i};this.parent.socket.emit("message:received:local",s),this.__handle_message_received_local(s)},e.prototype.receive_message_mirror=function(e,t,i,r){var s={from:"operator",type:e,origin:t,timestamp:(new Date).getTime(),content:i,fingerprint:r};this.parent.socket.emit("message:received:mirror",s)},e.prototype.get_message_compose=function(){this.parent.event.publish("message:compose:received",this.__message_compose.remote)},e.prototype.get_cached_messages=function(){return this.__messages},e.prototype.count_message_history=function(){return this.__messages.length},e.prototype.count_message_history_diff=function(){return this.__messages_history_diff.length},e.prototype.get_message_history=function(){for(var e=0;e0&&!0},e.prototype.mark_messages_as_read=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.__check_mark_messages_read(void 0,void 0,e);t===!0&&this.__write_messages_cache()},e.prototype.set_messages_in_view=function(e){this.__messages_in_view=e,this.mark_messages_as_read(!1)},e.prototype.get_unread_messages=function(){this.__unread_messages_count=-1,this.__handle_unread_messages()},e.prototype.set_unread_messages_callback=function(e){this.__unread_messages_callback=e},e.prototype._clear=function(){this.__init_storage()},e.prototype._storage_session_message_handle=function(e){this._restore_messages(e)},e.prototype._sync_message_compose_diff=function(e){e&&(this.__message_compose.remote=e)},e.prototype._sync_message_history_diff=function(e){if(e){this.__sort_messages_by_timestamp(e);for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t||!1;return t===!1&&(i===!0||this.__messages_in_view===!0)&&this.__unread_messages_index.length>0&&(this.__acknowledge_messages_read_received(this.__unread_messages_index),r=!0),r===!0&&this.__mark_messages_read(e,t)},e.prototype.__write_messages_cache=function(e,t){if(this.__updated_messages_index.length>0){for(var i=[],r=0;r=0?this.__messages[t]||null:null},e.prototype.__set_message_updated=function(e){this.__updated_messages_index.indexOf(e.fingerprint)===-1&&this.__updated_messages_index.push(e.fingerprint)},e.prototype.__sort_messages_by_timestamp=function(e){e.sort(function(e,t){return e.timestampt.timestamp?1:0})},e.prototype.__gen_fingerprint=function(){var e=100,t=15,i=""+(new Date).getTime()+Math.ceil(Math.random()*e);return i.length0&&void 0!==arguments[0]?arguments[0]:[],t=this.__unread_messages_index.length;t!==this.__unread_messages_count&&(this.__unread_messages_count=t,"function"==typeof this.__unread_messages_callback&&this.__unread_messages_callback(t,this.__unread_messages_index,[].concat(this.__messages,e)))},e.prototype.__handle_message_updated=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"network",i=this.__get_cached_message(e.fingerprint);null!==i&&(i.content=e.content,i.edited=!0,this.__handle_local_loop_message(i,origin="update"),"local"!==t&&(this.__set_message_updated(i),this.__write_messages_cache()))},e.prototype.__handle_message_sent=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"network",r=this.__sending_messages_index.indexOf(e.fingerprint);r!==-1&&this.__sending_messages_index.splice(r,1),e.origin=i,e.index={current:1,total:1},this.__cache_message(e,function(){t.parent.event.publish("message:sent",e)}),1===this.count_message_history()&&this.parent.Session._trigger_email_keep_alive()},e.prototype.__handle_message_received=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"network",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"message:received";e.origin=i,e.index={current:1,total:1},"update"!==i&&(this.__unread_messages_index.push(e.fingerprint),this.__handle_unread_messages(pending_messages=[e])),this.__cache_message(e,function(){"network"!==i&&"diff"!==i||t.__acknowledge_messages_pending([e.fingerprint]),t.parent.event.publish(r,e)})},e.prototype.__handle_message_received_local=function(e){this.__handle_message_received(e,origin="local",event="message:received:local")},e.prototype.__handle_message_compose_received=function(e){this.__message_compose.remote=e,this.parent.event.publish("message:compose:received",e)},e.prototype.__handle_message_read_send=function(e){this.__check_mark_messages_read(e.fingerprints,!0)===!0&&this.__write_messages_cache(),this.parent.event.publish("message:acknowledge:read:send",e.fingerprints)},e.prototype.__handle_message_read_received=function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[],t={events:[]},i=0;i0&&this.parent.socket.emit("session:event",t)},e.prototype.get_request_initiate=function(e){Object.keys&&0===Object.keys(this.__state).length&&this.parent.Message.count_message_history_diff()>0&&this.__handle_session_request_initiate({}),"function"==typeof e&&e()},e.prototype.get_state=function(e){this.handle_state(this.__state,e)},e.prototype.handle_state=function(e,t){this.__state=e,this.parent.event.publish("session:state",this.__state),"function"==typeof t&&t()},e.prototype.set_state=function(e,t){for(var i in e)this.__state[i]=e[i];this.parent.Storage.update("state",e),this.sync_state(e,t)},e.prototype.sync_state=function(e,t){this.parent.socket.emit("session:state",e),"function"==typeof t&&t()},e.prototype.create=function(){var e={website_id:this.parent.website_id,website_domain:this.parent.website_domain,useragent:this.parent.device.useragent||"",timezone:this.parent.device.timezone||0,capabilities:this.parent.device.capabilities||[],locales:this.parent.device.locales||[]};this.parent.token_id&&(e.token_id=this.parent.token_id),this.parent.socket.emit("session:create",e)},e.prototype.get_email=function(){return this.__user_data.email},e.prototype.set_email=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r={};if(null!==i){var s="undefined"==typeof i?"undefined":_typeof(i);"string"===s?r.verify=i:"object"===s&&(r=i)}this.__set_user_data_value("email",e,t,r)===!0&&this._trigger_email_keep_alive()},e.prototype.get_phone=function(){return this.__user_data.phone},e.prototype.set_phone=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.__set_user_data_value("phone",e,t)},e.prototype.get_nickname=function(){return this.__user_data.nickname},e.prototype.set_nickname=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.__set_user_data_value("nickname",e,t)},e.prototype.get_avatar=function(){return this.__user_data.avatar},e.prototype.set_avatar=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.__set_user_data_value("avatar",e,t)},e.prototype.get_company=function(){return this.__user_data.company},e.prototype.set_company=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.__set_user_data_value("company",e,t)},e.prototype.get_data=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===e?this.__user_data.data:this.__user_data.data[e]||null},e.prototype.set_data=function(e){this.__sync_data_diff(this.__user_data.data||{},e)},e.prototype.set_segments=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.__sync_segments_diff(this.__user_data.segments||[],e,t)},e.prototype.mark_active=function(){var e=(new Date).getTime(),t=Math.min(this.__last_active||e,this.__last_heartbeat||e);e-t>=this.__consider_inactive_delay&&this.__keep_alive(!0),this.__last_active=e},e.prototype.acquire_saved=function(){var e=this.__obtain_cached_session_id_params(),t=null,i=(location.search||"").match(this.__regex_parameter_sid),r=(document.referrer||"").match(this.__regex_referer);i&&i[2]&&i[2]!==e.current&&(t=i[2]||null),r&&r[1]===this.parent.url_go&&r[3]!==e.current&&(t=r[3]||null);var s=t||e.current,n=null;return e.previous&&e.current!==e.previous&&e.current===s&&(n=e.previous),{session_id:s,merge:n}},e.prototype.restore=function(){var e=this.acquire_saved();this.__restore_session(e.session_id,e.merge)},e.prototype.join=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={session_id:this._session_id,expire:this.__interval_heartbeat_hard,storage:!0,sync:e,useragent:this.parent.device.useragent||"",timezone:this.parent.device.timezone||0,capabilities:this.parent.device.capabilities||[],locales:this.parent.device.locales||[]};null!==this._session_id_merge&&(t.merge={session_id:this._session_id_merge}),this.parent.socket.emit("session:join",t)},e.prototype.clear=function(e,t){var i=null;try{this.parent.Config._clear(),this.parent.Message._clear(),this.parent.Browsing._clear(),this.parent.Helpdesk._clear(),this.parent.Storage._clear(),this.__clear()}catch(e){i=e}i?"function"==typeof t&&t(i):"function"==typeof e&&e()},e.prototype._trigger_email_keep_alive=function(){var e=this;this.__user_data.email&&(this.__defer_email_keep_alive&&clearTimeout(this.__defer_email_keep_alive), this.__defer_email_keep_alive=setTimeout(function(){e.__defer_email_keep_alive=null,e.__keep_alive(!0)},this.__email_keep_alive_delay))},e.prototype.__init_storage=function(){this._session_id=null,this._session_id_merge=null,this.__connected=!1,this.__last_active=0,this.__last_heartbeat=(new Date).getTime(),this.__defer_heartbeat=null,this.__defer_email_keep_alive=null,this.__last_device_location=null,this.__user_data={},this.__user_data_meta={},this.__state={}},e.prototype.__init_events=function(){var e=this;this.parent.socket.on("session:created",this.__handle_session_created.__crisp_bind(this)),this.parent.socket.on("session:joined",this.__handle_session_joined.__crisp_bind(this)),this.parent.socket.on("session:state",this.__handle_session_state.__crisp_bind(this)),this.parent.socket.on("session:error",this.__handle_session_error.__crisp_bind(this)),this.parent.socket.on("session:request:initiate",this.__handle_session_request_initiate.__crisp_bind(this)),this.parent.socket.on("session:request:purge",this.__handle_session_request_purge.__crisp_bind(this)),this.parent.socket.on("connect",function(){e.__connected?e.join(!0):e.restore()})},e.prototype.__handle_session_created=function(e){if(e.error)this.parent.event.publish("session:created",{error:e.error});else{var t=!!this.parent.token_id;this._session_id=e.session_id,this.save(),this.join(t),this.parent.event.publish("session:created",{session_id:this._session_id})}},e.prototype.__handle_session_joined=function(e){e.error?this.parent.event.publish("session:joined",{error:e.error}):(this.__connected||(this.__connected=!0,this.send_device()),this.parent.Website.set_users_available(e.users_available),this.storage_session_retrieve(e.storage||{}),this.sync_session_diff(e.sync||{}),this.sync_user_data(e),this.parent.Browsing.restore_browsing_state(),this.parent.event.publish("session:joined",e),this.__start_keep_alive(e.last_active))},e.prototype.__handle_session_state=function(e){this.handle_state(e)},e.prototype.__handle_session_error=function(e){switch(e.type){case"email:invalid_format":delete this.__user_data.email,delete this.__user_data_meta.email}this.parent.event.publish("session:error",e)},e.prototype.__handle_session_request_initiate=function(e){this.parent.event.publish("session:request:initiate",e)},e.prototype.__handle_session_request_purge=function(e){this.parent.event.publish("session:request:purge",e)},e.prototype.__clear=function(){this.__init_storage();var e={domain:this.__get_cookie_domain()};this.parent.cookie.expire(this.__get_cookie_key(),e),this.parent.token_id&&this.parent.cookie.expire(this.__get_cookie_key(this.parent.token_id),e)},e.prototype.__obtain_cached_session_id_params=function(){var e={previous:null,current:null};return this.parent.token_id?(this.parent.runtime_configuration&&this.parent.runtime_configuration.session_merge===!0&&(e.previous=this.parent.cookie.get(this.__get_cookie_key())||null),e.current=this.parent.cookie.get(this.__get_cookie_key(this.parent.token_id))||null):e.current=this.parent.cookie.get(this.__get_cookie_key())||null,e},e.prototype.__restore_session=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null!==t&&(this._session_id_merge=t),e?(this._session_id=e,this.save(),this.join(!0)):this.create()},e.prototype.__storage_session_state_handle=function(e){this.__state=e||{}},e.prototype.__start_keep_alive=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.__last_active=e||(new Date).getTime(),this.__keep_alive()},e.prototype.__keep_alive=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.__defer_heartbeat&&clearTimeout(this.__defer_heartbeat),this.__defer_heartbeat=setTimeout(function(){e.__defer_heartbeat=null,e.__last_heartbeat=(new Date).getTime(),e.parent.socket.emit("session:heartbeat",{last_active:e.__last_active||0,availability:{type:"online",time:{for:e.__interval_heartbeat_hard}}}),e.__keep_alive()},t===!0?0:this.__interval_heartbeat_soft)},e.prototype.__get_cookie_key=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=[this.parent.website_id];return e&&t.push(e),this.parent.Storage._generate_store_key("session",t)},e.prototype.__get_cookie_expire=function(){return"number"==typeof this.parent.cookie_expire&&this.parent.cookie_expire>0?this.parent.cookie_expire:this.__cookie_expire},e.prototype.__get_cookie_domain=function(){return"string"==typeof this.parent.cookie_domain&&this.parent.cookie_domain?this.parent.cookie_domain:this.__get_base_domain()},e.prototype.__get_base_domain=function(){var e=document.domain,t=e;try{for(var i=0,r=t.split("."),s=this.parent.Storage._generate_store_key("domain-detect",[""+(new Date).getTime()]);i2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!1;if(i===!0?s=!0:t instanceof Object?this.__check_object_same(this.__user_data[e],t)===!1&&(s=!0):this.__user_data[e]!==t&&(s=!0),s===!0&&(this.__user_data[e]=t,this.__user_data_meta[e]=r,this.__connected===!0)){var n={};n[e]=t;for(var a in r)n[a]=r[a];return this.parent.socket.emit("session:set_"+e,n),!0}return!1},e.prototype.__sync_segments_diff=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],s=0;s0||e.length!==t.length?(a=[].concat(t),this.__user_data.segments=a):a=[]:(a=r,this.__user_data.segments=e.concat(a)),a.length>0&&this.__connected===!0){var o={segments:a};i===!0&&(o.overwrite=!0),this.parent.socket.emit("session:set_segments",o)}},e.prototype.__sync_data_diff=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!1,r={};for(var s in t)e[s]!==t[s]&&(i=!0,r[s]=t[s]);this.__user_data.data=e;for(var n in r)this.__user_data.data[n]=r[n];i===!0&&this.__connected===!0&&this.parent.socket.emit("session:set_data",{data:r})},e.prototype.__check_object_same=function(e,t){if(e instanceof Object&&t instanceof Object){var i={};for(var r in e)i[r]=!0;for(var s in t)i[s]=!0;var n=!0;for(var a in i)if(this.__check_object_same(e[a],t[a])===!1){n=!1;break}return n}return e===t&&!0},e}(),CrispWebsite=function(){function e(e){this.parent=e,this.__init_storage(),this.__init_events()}return e.prototype.get_users_available=function(){this.__publish_users_available(!1)},e.prototype.set_users_available=function(e){this.__users_available=e},e.prototype.__init_storage=function(){this.__users_available=!1},e.prototype.__init_events=function(){this.parent.socket.on("website:users:available",this.__handle_website_users_available.__crisp_bind(this))},e.prototype.__handle_website_users_available=function(e){"boolean"==typeof e&&(this.set_users_available(e),this.__publish_users_available(!0))},e.prototype.__publish_users_available=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.parent.event.publish("website:users:available",{available:this.__users_available,changed:e})},e}(),CrispBucket=function(){function e(e){this.parent=e,this.__init_events()}return e.prototype.get_url_upload=function(e,t){var i={id:""+(new Date).getTime(),from:"visitor",file:{name:e,type:t}};this.parent.socket.emit("bucket:url:upload:generate",i),this.parent.event.publish("bucket:url:upload:generate",i)},e.prototype.__init_events=function(){this.parent.socket.on("bucket:url:upload:generated",this.__handle_bucket_url_upload_generate.__crisp_bind(this))},e.prototype.__handle_bucket_url_upload_generate=function(e){this.parent.event.publish("bucket:url:upload:generated",e)},e}(),CrispMedia=function(){function e(e){this.parent=e,this.__init_events()}return e.prototype.get_animation_list=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i={id:(new Date).getTime(),from:"visitor",list:{page:t}};e&&(i.list.query=e),this.parent.socket.emit("media:animation:list",i),this.parent.event.publish("media:animation:list",i)},e.prototype.__init_events=function(){this.parent.socket.on("media:animation:listed",this.__handle_media_animation_list.__crisp_bind(this))},e.prototype.__handle_media_animation_list=function(e){this.parent.event.publish("media:animation:listed",e)},e}(),CrispHelpdesk=function(){function e(e){this.parent=e,this.__timeout_article_results_cache=100,this.__init_storage(),this.__init_events()}return e.prototype.get_article_search=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.__get_article_results_generic("search",this.__article_search_cache,"query",this.__handle_helpdesk_article_search.__crisp_bind(this),e,t)},e.prototype.get_article_suggest=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.__get_article_results_generic("suggest",this.__article_suggest_cache,"part",this.__handle_helpdesk_article_suggest.__crisp_bind(this),e,t)},e.prototype._clear=function(){this.__init_storage()},e.prototype.__init_storage=function(){this.__article_search_cache={},this.__article_suggest_cache={}},e.prototype.__init_events=function(){this.parent.socket.on("helpdesk:article:searched",this.__handle_helpdesk_article_search.__crisp_bind(this)),this.parent.socket.on("helpdesk:article:suggested",this.__handle_helpdesk_article_suggest.__crisp_bind(this))},e.prototype.__handle_helpdesk_article_search=function(e){return this.__handle_helpdesk_article_results_generic("search",this.__article_search_cache,"query",e)},e.prototype.__handle_helpdesk_article_suggest=function(e){return this.__handle_helpdesk_article_results_generic("suggest",this.__article_suggest_cache,"part",e)},e.prototype.__get_article_results_generic=function(e,t,i,r,s){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=(t[n||"default"]||{})[s],o="helpdesk:article:"+e,_=_defineProperty({id:(new Date).getTime(),from:"visitor"},e,_defineProperty({locale:n},i,s));this.parent.event.publish(o,_),a?setTimeout(function(){r(_defineProperty({id:_.id,results:a},e,_defineProperty({locale:n},i,s)))},this.__timeout_article_results_cache):this.parent.socket.emit(o,_)},e.prototype.__handle_helpdesk_article_results_generic=function(e,t,i,r){if(r[e]&&"string"==typeof r[e][i]){var s=r[e].locale||"default";t[s]=t[s]||{},t[s][r[e][i]]=r.results}this.parent.event.publish("helpdesk:article:"+e+"ed",r)},e}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CrispBrowsing=function(){function CrispBrowsing(e){this.parent=e,this.__interval_heartbeat=1e4,this.__timeout_dead_peer=45e3,this.__timeout_session_dead=45e3,this.__resize_defer_delay=1e3,this.__throttle_delay=1e3,this.__debounce_delay=500,this.__stream_limit_window_time=5e3,this.__stream_limit_reset_time=6e4,this.__stream_limit_threshold=40,this.__debug_limit_window_time=2e4,this.__debug_limit_window_max=50,this.__stream_events=["browsing:action:start","browsing:action:stop","browsing:action:heartbeat","browsing:debug:start","browsing:debug:stop","browsing:debug:heartbeat","browsing:debug:execute","browsing:assist:start","browsing:assist:stop","browsing:assist:heartbeat","browsing:assist:mouse","browsing:assist:scroll","browsing:assist:click"],this.__init_storage(),this.__init_events(),this.__restore_browsing_cache(),this.__reference_console(),this.__bind_mouse(),this.__bind_resize(),this.__bind_scroll(),this.__bind_click()}return CrispBrowsing.prototype.init=function(e,t,i){var r=this;this.parent.Stream.bind_to(null,this.__stream_events,{session_id:this.parent.Session._session_id},function(){(r.parent.device.capabilities||[]).indexOf("browsing")===-1||r.parent.Config._ignore_privacy!==!0&&"1"===(navigator||{}).doNotTrack?(r.parent.stream.emit("client:browsing:request:decline",{}),r.__stop()):(r.__tree_mirror=e.deps.tree_mirror||null,r.__is_initiated=!0,e.resume===!0?(r.parent.stream.emit("client:browsing:resume",{browsing_id:r.__browsing_id}),r.__keep_alive(!0),r.__is_playing===!0&&r.__start(!0)):(r.__keep_alive(!0),r.parent.stream.emit("client:browsing:request:accept",{useragent:navigator.userAgent}))),"function"==typeof t&&t()},function(){"function"==typeof i&&i()})},CrispBrowsing.prototype.restore_browsing_state=function(){this.__browsing_id&&(this.__is_dead_remote_peer()===!1?this.__handle_request_initiate({resume:!0}):this.__stop())},CrispBrowsing.prototype.toggle_ignore_scroll_event=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.__ignore_scroll_event=e},CrispBrowsing.prototype._clear=function(){this.__init_storage(),"object"===_typeof(window.sessionStorage)&&window.sessionStorage.removeItem(this.__get_cookie_key())},CrispBrowsing.prototype.__init_storage=function(){if(clearInterval(this.__keep_alive_interval),clearInterval(this.__stream_window_interval),clearInterval(this.__stream_reset_interval),clearInterval(this.__mouse_interval),clearInterval(this.__scroll_interval),"object"===_typeof(this.__debounce_timeouts))for(var e in this.__debounce_timeouts)clearTimeout(this.__debounce_timeouts[e]);if("object"===_typeof(this.__sessions))for(var t in this.__sessions)clearTimeout(this.__sessions[t].dead_timeout);(this.__resize_params||{}).defer_event&&clearTimeout(this.__resize_params.defer_event),this.__is_initiated=!1,this.__browsing_id=null,this.__is_playing=!1,this.__last_heartbeat=null,this.__keep_alive_interval=null,this.__stream_window_interval=null,this.__stream_reset_interval=null,this.__mouse_interval=null,this.__scroll_interval=null,this.__ignore_scroll_event=!1,this.__initial_stream=null,this.__tree_mirror=null,this.__mirror_client=null,this.__debounce_timeouts={},this.__console_references={},this.__sessions={debug:{ongoing:!1,last_heartbeat:null,dead_timeout:null,limits:{window_last:null,window_count:0}},assist:{ongoing:!1,last_heartbeat:null,dead_timeout:null}},this.__mouse_position={x:0,y:0,last_x:0,last_y:0},this.__scroll_position={x:0,y:0,last_x:0,last_y:0},this.__resize_params={last_call:(new Date).getTime(),defer_event:null},this.__stream_params={event_calls:0,is_limited:!1}},CrispBrowsing.prototype.__get_cookie_key=function(){return this.parent.Storage._generate_store_key("browsing",[this.parent.website_id])},CrispBrowsing.prototype.__init_events=function(){this.parent.socket.on("browsing:request:initiate",this.__handle_request_initiate.__crisp_bind(this)),this.parent.stream.on("client:browsing:request:initiated",this.__handle_request_initiated.__crisp_bind(this)),this.parent.stream.on("client:browsing:action:start",this.__handle_action_start.__crisp_bind(this)),this.parent.stream.on("client:browsing:action:stop",this.__handle_action_stop.__crisp_bind(this)),this.parent.stream.on("client:browsing:action:heartbeat",this.__handle_action_heartbeat.__crisp_bind(this)),this.parent.stream.on("client:browsing:debug:start",this.__handle_debug_start.__crisp_bind(this)),this.parent.stream.on("client:browsing:debug:stop",this.__handle_debug_stop.__crisp_bind(this)),this.parent.stream.on("client:browsing:debug:heartbeat",this.__handle_debug_heartbeat.__crisp_bind(this)),this.parent.stream.on("client:browsing:debug:execute",this.__handle_debug_execute.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:start",this.__handle_assist_start.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:stop",this.__handle_assist_stop.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:heartbeat",this.__handle_assist_heartbeat.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:mouse",this.__handle_assist_mouse.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:scroll",this.__handle_assist_scroll.__crisp_bind(this)),this.parent.stream.on("client:browsing:assist:click",this.__handle_assist_click.__crisp_bind(this))},CrispBrowsing.prototype.__reference_console=function(){"object"===_typeof(window.console)&&(this.__console_references={log:window.console.log,debug:window.console.debug,info:window.console.info,warn:window.console.warn,error:window.console.error})},CrispBrowsing.prototype.__restore_browsing_cache=function(){if("object"===_typeof(window.sessionStorage)){var e=window.sessionStorage.getItem(this.__get_cookie_key());e&&(e=JSON.parse(e),this.__browsing_id=e.browsing_id||null,this.__is_playing=e.is_playing||!1,this.__last_heartbeat=e.last_heartbeat||null)}},CrispBrowsing.prototype.__apply_debug_monkey_patches=function(){var e=this,t=this,i=function(i){var r=e.__console_references[i];window.console[i]===r&&(window.console[i]=function(){var e=Array.prototype.slice.call(arguments);t.__process_console_event.__crisp_bind(t)(i,e),r.apply(this,e)})};for(var r in this.__console_references)i(r)},CrispBrowsing.prototype.__unapply_debug_monkey_patches=function(){for(var e in this.__console_references){var t=this.__console_references[e];window.console[e]!==t&&(window.console[e]=t)}},CrispBrowsing.prototype.__process_console_event=function(e,t){if(this.__sessions.debug.ongoing===!0){var i=(new Date).getTime();(null===this.__sessions.debug.limits.window_last||i-this.__sessions.debug.limits.window_last>=this.__debug_limit_window_time)&&(this.__sessions.debug.limits.window_last=i,this.__sessions.debug.limits.window_count=0),++this.__sessions.debug.limits.window_count<=this.__debug_limit_window_max&&this.__debug_stream(e,t)}},CrispBrowsing.prototype.__handle_request_initiate=function(e){this.__is_initiated===!0&&e.resume!==!0||(e.resume!==!0&&this.__stop(),this.parent.event.publish("browsing:request:initiate",e||{}))},CrispBrowsing.prototype.__handle_request_initiated=function(e){this.__is_initiated===!0&&(this.__browsing_id=e.browsing_id,this.__last_heartbeat=(new Date).getTime(),this.__save_cache())},CrispBrowsing.prototype.__handle_action_start=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__start()},CrispBrowsing.prototype.__handle_action_stop=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__stop()},CrispBrowsing.prototype.__handle_action_heartbeat=function(){this.__is_initiated===!0&&this.__browsing_id&&(this.__last_heartbeat=(new Date).getTime(),this.__save_cache())},CrispBrowsing.prototype.__handle_debug_start=function(){this.__is_initiated===!0&&this.__browsing_id&&(this.__apply_debug_monkey_patches(),this.__generic_session_start("debug"))},CrispBrowsing.prototype.__handle_debug_stop=function(){this.__is_initiated===!0&&this.__browsing_id&&(this.__unapply_debug_monkey_patches(),this.__generic_session_stop("debug"))},CrispBrowsing.prototype.__handle_debug_heartbeat=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__generic_session_heartbeat("debug")},CrispBrowsing.prototype.__handle_debug_execute=function __handle_debug_execute(execute_data){if(this.__is_initiated===!0&&this.__browsing_id&&this.__sessions.debug.ongoing===!0&&execute_data.execute)try{var result=eval(execute_data.execute);this.__debug_executed(execute_data.execute,result)}catch(e){if(e){var error_message=e.name+": "+e.message;this.__debug_executed(execute_data.execute,null,"error"),this.__debug_stream("error",[error_message])}}},CrispBrowsing.prototype.__handle_assist_start=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__generic_session_start("assist")===!0&&this.parent.event.publish("browsing:assist:started",{})},CrispBrowsing.prototype.__handle_assist_stop=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__generic_session_stop("assist")===!0&&this.parent.event.publish("browsing:assist:stopped",{})},CrispBrowsing.prototype.__handle_assist_heartbeat=function(){this.__is_initiated===!0&&this.__browsing_id&&this.__generic_session_heartbeat("assist")},CrispBrowsing.prototype.__handle_assist_mouse=function(e){this.__is_initiated===!0&&this.__browsing_id&&this.__sessions.assist.ongoing===!0&&this.parent.event.publish("browsing:assist:mouse",e)},CrispBrowsing.prototype.__handle_assist_scroll=function(e){this.__is_initiated===!0&&this.__browsing_id&&this.__sessions.assist.ongoing===!0&&this.parent.event.publish("browsing:assist:scroll",e)},CrispBrowsing.prototype.__handle_assist_click=function(e){this.__is_initiated===!0&&this.__browsing_id&&this.__sessions.assist.ongoing===!0&&this.parent.event.publish("browsing:assist:click",e)},CrispBrowsing.prototype.__save_cache=function(){"object"===_typeof(window.sessionStorage)&&JSON&&"function"==typeof JSON.stringify&&window.sessionStorage.setItem(this.__get_cookie_key(),JSON.stringify({browsing_id:this.__browsing_id,is_playing:this.__is_playing,last_heartbeat:this.__last_heartbeat}))},CrispBrowsing.prototype.__start=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.__is_playing=!0,this.__last_heartbeat=(new Date).getTime(),this.__save_cache(),this.__stream(),this.__mouse_timer(!0),this.__scroll_timer(!0),this.__stream_limit_window_timer(!0),this.__stream_limit_reset_timer(!0),e!==!0&&this.parent.stream.emit("client:browsing:action:started",{})},CrispBrowsing.prototype.__stop=function(){var e=this.__is_playing;this.__mirror_client&&this.__mirror_client.disconnect(),this.__init_storage(),this.__save_cache(),e===!0&&this.parent.stream.emit("client:browsing:action:stopped",{}),this.parent.Stream.unbind_from()},CrispBrowsing.prototype.__stream=function(){var e=this;return this.__stream_mouse(),this.__stream_tab(),this.__stream_scroll(),this.__mirror_client?this.__stream_mirror(this.__initial_stream):void(this.__mirror_client=new this.__tree_mirror(document,{initialize:function(t,i){e.__initial_stream={f:"initialize",args:[t,i]},e.__stream_mirror(e.__initial_stream)},applyChanged:function(t,i,r,s){!e.__stream_params.is_limited&&e.__stream_params.event_calls<=e.__stream_limit_threshold&&(e.__stream_mirror({f:"applyChanged",args:[t,i,r,s]}),e.__stream_params.event_calls++)}}))},CrispBrowsing.prototype.__stream_mirror=function(e){e.f&&e.args&&"function"==typeof JSON.stringify&&this.parent.stream.emit("client:browsing:stream:mirror",{f:e.f,args:JSON.stringify(e.args)})},CrispBrowsing.prototype.__stream_tab=function(){this.parent.stream.emit("client:browsing:stream:tab",{title:document.title,url:document.location.href,width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight})},CrispBrowsing.prototype.__stream_mouse=function(){this.parent.stream.emit("client:browsing:stream:mouse",{x:this.__mouse_position.x,y:this.__mouse_position.y})},CrispBrowsing.prototype.__stream_scroll=function(){this.parent.stream.emit("client:browsing:stream:scroll",{x:this.__scroll_position.x,y:this.__scroll_position.y})},CrispBrowsing.prototype.__stream_click=function(){this.parent.stream.emit("client:browsing:stream:click",{})},CrispBrowsing.prototype.__debug_executed=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(this.__sessions.debug.ongoing===!0){var r={execute:e,type:null!==i?i:"undefined"==typeof t?"undefined":_typeof(t)};"error"!==r.type&&"undefined"!==r.type&&(r.value=this.__format_debug_value(t)),this.parent.stream.emit("client:browsing:debug:executed",r)}},CrispBrowsing.prototype.__debug_stream=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.__sessions.debug.ongoing===!0&&t.length>0){for(var i={message:"",traceback:""},r=0;r0&&(s="traceback"),i[s]&&("traceback"===s?i[s]+="\n":i[s]+=" "),i[s]+=this.__format_debug_value(t[r],!0)}var n={level:e,message:i.message};i.traceback&&(n.traceback=i.traceback),this.parent.stream.emit("client:browsing:debug:stream",n)}},CrispBrowsing.prototype.__generic_session_start=function(e){var t=this.__sessions[e].ongoing!==!0&&!0;return this.__sessions[e].ongoing=!0,this.__generic_session_heartbeat(e),this.parent.stream.emit("client:browsing:"+e+":started",{}),t},CrispBrowsing.prototype.__generic_session_stop=function(e){return this.__sessions[e].ongoing===!0&&(this.__generic_session_heartbeat(e,!1),this.__sessions[e].ongoing=!1,this.parent.stream.emit("client:browsing:"+e+":stopped",{}),!0)},CrispBrowsing.prototype.__generic_session_heartbeat=function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.__sessions[e].ongoing===!0&&(null!==this.__sessions[e].dead_timeout&&(clearTimeout(this.__sessions[e].dead_timeout),this.__sessions[e].dead_timeout=null),i===!0?(this.__sessions[e].last_heartbeat=(new Date).getTime(),this.__sessions[e].dead_timeout=setTimeout(function(){t.__generic_session_stop(e)},this.__timeout_session_dead)):this.__sessions[e].last_heartbeat=null)},CrispBrowsing.prototype.__bind_mouse=function(){var e=this,t=void 0;"function"==typeof document.onmousemove&&(t=document.onmousemove),document.onmousemove=function(i){e.__mouse_position.last_x=i.pageX,e.__mouse_position.last_y=i.pageY,"function"==typeof t&&t(i)}},CrispBrowsing.prototype.__bind_resize=function(){var e=this,t=void 0;"function"==typeof window.onresize&&(t=window.onresize),window.onresize=function(i){null!==e.__resize_params.defer_event&&clearTimeout(e.__resize_params.defer_event),e.__resize_params.defer_event=setTimeout(function(){e.__resize_params.defer_event=null;var t=e.__resize_params.last_call,i=(new Date).getTime();e.__resize_params.last_call=i,t&&i>t+e.__throttle_delay&&e.__is_playing===!0&&e.__stream_tab()},e.__resize_defer_delay),"function"==typeof t&&t(i)}},CrispBrowsing.prototype.__bind_scroll=function(){var e=this,t=(!(arguments.length>0&&void 0!==arguments[0])||arguments[0],void 0);"function"==typeof window.onscroll&&(t=window.onscroll),window.onscroll=function(i){if(e.__ignore_scroll_event!==!0){var r=document.documentElement;e.__scroll_position.last_x=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),e.__scroll_position.last_y=(window.pageYOffset||r.scrollTop)-(r.clientTop||0)}"function"==typeof t&&t(i)}},CrispBrowsing.prototype.__bind_click=function(){var e=this;window.addEventListener("click",function(t){e.__is_playing!==!0||t._from_crisp||e.__debounce_event("click",function(){e.__stream_click(),e.__stream_mouse()})})},CrispBrowsing.prototype.__is_dead_remote_peer=function(){return null===this.__last_heartbeat||null!==this.__last_heartbeat&&(new Date).getTime()-this.__last_heartbeat>=this.__timeout_dead_peer},CrispBrowsing.prototype.__keep_alive=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];null!==this.__keep_alive_interval&&clearInterval(this.__keep_alive_interval),t===!0&&(this.__keep_alive_interval=setInterval(function(){e.parent.stream.emit("client:browsing:heartbeat",{}),e.__is_dead_remote_peer()===!0&&e.__stop()},this.__interval_heartbeat))},CrispBrowsing.prototype.__mouse_timer=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];null!==this.__mouse_interval&&(clearInterval(this.__mouse_interval),this.__mouse_interval=null),t===!0&&(this.__mouse_interval=setInterval(function(){e.__mouse_position.last_x===e.__mouse_position.x&&e.__mouse_position.last_y===e.__mouse_position.y||e.__is_playing!==!0||(e.__mouse_position.x=e.__mouse_position.last_x,e.__mouse_position.y=e.__mouse_position.last_y,e.__stream_mouse())},this.__throttle_delay))},CrispBrowsing.prototype.__scroll_timer=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];null!==this.__scroll_interval&&(clearInterval(this.__scroll_interval),this.__scroll_interval=null),t===!0&&(this.__scroll_interval=setInterval(function(){e.__scroll_position.last_x===e.__scroll_position.x&&e.__scroll_position.last_y===e.__scroll_position.y||e.__is_playing!==!0||(e.__scroll_position.x=e.__scroll_position.last_x,e.__scroll_position.y=e.__scroll_position.last_y,e.__stream_mouse(),e.__stream_scroll())},this.__throttle_delay))},CrispBrowsing.prototype.__stream_limit_window_timer=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];null!==this.__stream_window_interval&&clearInterval(this.__stream_window_interval),t===!0&&(this.__stream_window_interval=setInterval(function(){e.__stream_params.event_calls>=e.__stream_limit_threshold&&(e.__stream_params.is_limited=!0),e.__stream_params.event_calls=0},this.__stream_limit_window_time))},CrispBrowsing.prototype.__stream_limit_reset_timer=function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];null!==this.__stream_reset_interval&&clearInterval(this.__stream_reset_interval),t===!0&&(this.__stream_reset_interval=setInterval(function(){e.__stream_params.is_limited=!1},this.__stream_limit_reset_time))},CrispBrowsing.prototype.__format_debug_value=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t===!0&&"string"==typeof e?e:"function"==typeof JSON.stringify?JSON.stringify(e):""+e},CrispBrowsing.prototype.__debounce_event=function(e,t){var i=this;"undefined"==typeof this.__debounce_timeouts[e]&&(this.__debounce_timeouts[e]=setTimeout(function(){delete i.__debounce_timeouts[e],t()},this.__debounce_delay))},CrispBrowsing}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CrispCall=function(){function e(e){this.parent=e,this.__interval_heartbeat=1e4,this.__stream_events=["call:request:initiate","call:request:accepted","call:request:declined","call:action:stopped","call:signaling:sdp","call:signaling:candidate"],this.__is_initiated=!1,this.__is_accepted=!1,this.__browsing_id=null,this.__peer_connection=null,this.__keep_alive_interval=null,this.__mode=null,this.__ice_configuration=[],this.__streams={local:null,remote:null},this.__init_events()}return e.prototype.init=function(e,t,i){var r=this;this.parent.Stream.bind_to(null,this.__stream_events,{session_id:this.parent.Session._session_id},function(){r.__mode=e.mode||null,r.__ice_configuration=e.ice||[],e.has_support===!0?(r.parent.stream.emit("client:call:request:initiated",{call_id:e.call_id}),r.__keep_alive(!0)):r.parent.stream.emit("client:call:request:decline",{}),"function"==typeof t&&t()},function(){"function"==typeof i&&i()})},e.prototype.accept=function(){this.__is_initiated===!0&&(this.__is_accepted=!0,this.parent.stream.emit("client:call:request:accept",{}))},e.prototype.decline=function(){this.__is_initiated===!0&&(this.parent.stream.emit("client:call:request:decline",{}),this.__stop())},e.prototype.stop=function(){this.__is_initiated===!0&&(this.parent.stream.emit("client:call:action:stopped",{}),this.__stop())},e.prototype.toggle_audio=function(){return this.__toggle_media("getAudioTracks")},e.prototype.toggle_video=function(){return this.__toggle_media("getVideoTracks")},e.prototype.is_ongoing=function(){return this.__is_initiated===!0&&null!==this.__peer_connection&&!0},e.prototype.get_stream=function(e){return this.__streams[e]||null},e.prototype.__init_events=function(){this.parent.socket.on("call:request:initiate",this.__handle_request_initiate.__crisp_bind(this)),this.parent.stream.on("client:call:request:accepted",this.__handle_request_accepted.__crisp_bind(this)),this.parent.stream.on("client:call:request:declined",this.__handle_request_declined.__crisp_bind(this)),this.parent.stream.on("client:call:action:stopped",this.__handle_action_stopped.__crisp_bind(this)),this.parent.stream.on("client:call:signaling:sdp",this.__handle_signaling_sdp.__crisp_bind(this)),this.parent.stream.on("client:call:signaling:candidate",this.__handle_signaling_candidate.__crisp_bind(this)); },e.prototype.__handle_request_initiate=function(e){this.__is_initiated!==!0&&(e.has_support=(this.parent.device.capabilities||[]).indexOf("call")!==-1,this.__is_initiated=!0,this.parent.event.publish("call:request:initiate",e))},e.prototype.__handle_request_accepted=function(){this.__is_initiated===!0&&this.__is_accepted!==!0&&this.__stop()},e.prototype.__handle_request_declined=function(){this.__is_initiated===!0&&this.__stop()},e.prototype.__handle_action_stopped=function(){this.__is_initiated===!0&&this.__stop()},e.prototype.__handle_signaling_sdp=function(e){var t=this;if(this.__is_initiated===!0){if(this.__assert_peer_connection(),"operator"!==e.from)return;this.__peer_connection.setRemoteDescription(new RTCSessionDescription(e.sdp)).then(function(){return t.parent.event.publish("call:peer:remote:success",{}),t.__create_local_stream()}).catch(function(){t.parent.event.publish("call:peer:remote:error",{})})}},e.prototype.__handle_signaling_candidate=function(e){if(this.__is_initiated===!0){if(this.__assert_peer_connection(),"operator"!==e.from)return;if("object"!==_typeof(e.candidate)||null===e.candidate)return;this.__peer_connection.addIceCandidate(new RTCIceCandidate({sdpMLineIndex:e.candidate.sdpMLineIndex,candidate:e.candidate.candidate})).catch(function(){})}},e.prototype.__assert_peer_connection=function(){var e=this;null===this.__peer_connection&&(this.__peer_connection=new RTCPeerConnection({iceServers:this.__ice_configuration}),this.__peer_connection.onicecandidate=function(t){t&&t.candidate&&e.parent.stream.emit("client:call:signaling:candidate",{from:"user",candidate:t.candidate})},this.__peer_connection.onaddstream=function(t){e.__streams.remote=t.stream,e.parent.event.publish("call:media:remote:success",{})},this.__peer_connection.oniceconnectionstatechange=function(t){var i=e.__peer_connection;null!==i&&"failed"!==i.iceConnectionState&&"disconnected"!==i.iceConnectionState&&"closed"!==i.iceConnectionState||e.__unbind()},this.__peer_connection.onclose=function(){e.__unbind()})},e.prototype.__create_local_stream=function(){var e=this,t=function(t){e.parent.event.publish("call:peer:local:error",{})};this.__acquire_device_support_map(function(i){navigator.mediaDevices.getUserMedia({audio:!0,video:"video"===e.__mode&&i.video===!0}).then(function(t){return e.__streams.local=t,e.parent.event.publish("call:media:local:success",{}),e.__create_local_peer(t)}).catch(t)},t)},e.prototype.__create_local_peer=function(e){var t=this,i=void 0;this.__peer_connection.addStream(e),this.__peer_connection.createAnswer({OfferToReceiveAudio:!0,OfferToReceiveVideo:!0}).then(function(e){return i=e,t.__peer_connection.setLocalDescription(i)}).then(function(){t.parent.stream.emit("client:call:signaling:sdp",{from:"user",sdp:i}),t.parent.event.publish("call:peer:local:success",{})}).catch(function(){t.parent.event.publish("call:peer:local:error",{})})},e.prototype.__acquire_device_support_map=function(e,t){var i={audio:!1,video:!1};navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then(function(r){for(var s=0;s0&&void 0!==arguments[0])||arguments[0];null!==this.__keep_alive_interval&&clearInterval(this.__keep_alive_interval),t===!0&&(this.__keep_alive_interval=setInterval(function(){e.parent.stream.emit("client:call:heartbeat",{})},this.__interval_heartbeat))},e}(),CrispTrigger=function(){function e(e){this.parent=e}return e.prototype.fired=function(e,t){var i={identifier:e,name:t};this.parent.socket.emit("trigger:fired",i),this.parent.event.publish("trigger:fired",i)},e}(),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CrispIssue=function(){function e(e){this.parent=e,this.__init_storage()}return e.prototype.configure=function(e){this._state_project=e.project,this._state_revision=e.revision,this._state_environment=e.environment,this._state_useragent=e.useragent,this._state_page=e.page},e.prototype.report=function(e,t,i){if(!(this._state_project&&this._state_revision&&this._state_environment&&this._state_useragent&&this._state_page))throw new Error("Missing a configuration parameter. Did you call configure() before?");"object"===("undefined"==typeof i?"undefined":_typeof(i))&&i instanceof Error&&(i={fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,message:i.message,stack:i.stack});var r={project:this._state_project,revision:this._state_revision,environment:this._state_environment,useragent:this._state_useragent,page:this._state_page,level:e,namespace:t,traceback:i};this.parent.socket.emit("issue:report",r),this.parent.event.publish("issue:report",r)},e.prototype.__init_storage=function(){this._state_project=null,this._state_revision=null,this._state_environment=null,this._state_useragent=null,this._state_page=null},e}();!function(e,t){"object"==typeof __crisp_void_exports&&"object"==typeof module?module.exports=t():"function"==typeof __crisp_void_define&&define.amd?define([],t):"object"==typeof __crisp_void_exports?exports.io=t():e.io=t()}(__local_context,function(){return function(e){function t(r){if(i[r])return i[r].exports;var s=i[r]={exports:{},id:r,loaded:!1};return e[r].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){function r(e,t){"object"===("undefined"==typeof e?"undefined":s(e))&&(t=e,e=void 0),t=t||{};var i,r=n(e),a=r.source,l=r.id,p=r.path,h=c[l]&&p in c[l].nsps,u=t.forceNew||t["force new connection"]||!1===t.multiplex||h;return u?(_("ignoring socket cache for %s",a),i=o(a,t)):(c[l]||(_("new io instance for %s",a),c[l]=o(a,t)),i=c[l]),r.query&&!t.query&&(t.query=r.query),i.socket(r.path,t)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=i(1),a=i(7),o=i(13),_=i(3)("socket.io-client");e.exports=t=r;var c=t.managers={};t.protocol=a.protocol,t.connect=r,t.Manager=i(13),t.Socket=i(37)},function(e,t,i){(function(t){function r(e,i){var r=e;i=i||t.location,null==e&&(e=i.protocol+"//"+i.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?i.protocol+e:i.host+e),/^(https?|wss?):\/\//.test(e)||(n("protocol-less url %s",e),e="undefined"!=typeof i?i.protocol+"//"+e:"https://"+e),n("parse %s",e),r=s(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var a=r.host.indexOf(":")!==-1,o=a?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port,r.href=r.protocol+"://"+o+(i&&i.port===r.port?"":":"+r.port),r}var s=i(2),n=i(3)("socket.io-client:url");e.exports=r}).call(t,function(){return this}())},function(e,t){var i=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var t=e,s=e.indexOf("["),n=e.indexOf("]");s!=-1&&n!=-1&&(e=e.substring(0,s)+e.substring(s,n).replace(/:/g,";")+e.substring(n,e.length));for(var a=i.exec(e||""),o={},_=14;_--;)o[r[_]]=a[_]||"";return s!=-1&&n!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o}},function(e,t,i){(function(r){function s(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"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+)/)}function n(e){var i=this.useColors;if(e[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+e[0]+(i?"%c ":" ")+"+"+t.humanize(this.diff),i){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(n=s))}),e.splice(n,0,r)}}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function _(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof r&&"env"in r&&(e=r.env.DEBUG),e}function c(){try{return window.localStorage}catch(e){}}t=e.exports=i(5),t.log=a,t.formatArgs=n,t.save=o,t.load=_,t.useColors=s,t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(_())}).call(t,i(4))},function(e,t){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function s(e){if(l===setTimeout)return setTimeout(e,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function n(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){f&&u&&(f=!1,u.length?d=u.concat(d):g=-1,d.length&&o())}function o(){if(!f){var e=s(a);f=!0;for(var t=d.length;t;){for(u=d,d=[];++g1)for(var i=1;i100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*l;case"days":case"day":case"d":return i*c;case"hours":case"hour":case"hrs":case"hr":case"h":return i*_;case"minutes":case"minute":case"mins":case"min":case"m":return i*o;case"seconds":case"second":case"secs":case"sec":case"s":return i*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function r(e){return e>=c?Math.round(e/c)+"d":e>=_?Math.round(e/_)+"h":e>=o?Math.round(e/o)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function s(e){return n(e,c,"day")||n(e,_,"hour")||n(e,o,"minute")||n(e,a,"second")||e+" ms"}function n(e,t,i){if(!(e0)return i(e);if("number"===n&&isNaN(e)===!1)return t.long?s(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,i){function r(){}function s(e){var i=""+e.type;return t.BINARY_EVENT!==e.type&&t.BINARY_ACK!==e.type||(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data)),p("encoded %j as %s",e,i),i}function n(e,t){function i(e){var i=d.deconstructPacket(e),r=s(i.packet),n=i.buffers;n.unshift(r),t(n)}d.removeBlobs(e,i)}function a(){this.reconstructor=null}function o(e){var i=0,r={type:Number(e.charAt(0))};if(null==t.types[r.type])return l();if(t.BINARY_EVENT===r.type||t.BINARY_ACK===r.type){for(var s="";"-"!==e.charAt(++i)&&(s+=e.charAt(i),i!=e.length););if(s!=Number(s)||"-"!==e.charAt(i))throw new Error("Illegal attachments");r.attachments=Number(s)}if("/"===e.charAt(i+1))for(r.nsp="";++i;){var n=e.charAt(i);if(","===n)break;if(r.nsp+=n,i===e.length)break}else r.nsp="/";var a=e.charAt(i+1);if(""!==a&&Number(a)==a){for(r.id="";++i;){var n=e.charAt(i);if(null==n||Number(n)!=n){--i;break}if(r.id+=e.charAt(i),i===e.length)break}r.id=Number(r.id)}return e.charAt(++i)&&(r=_(r,e.substr(i))),p("decoded %s as %j",e,r),r}function _(e,t){try{e.data=JSON.parse(t)}catch(e){return l()}return e}function c(e){this.reconPack=e,this.buffers=[]}function l(){return{type:t.ERROR,data:"parser error"}}var p=i(3)("socket.io-parser"),h=i(8),u=i(9),d=i(11),f=i(12);t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=r,t.Decoder=a,r.prototype.encode=function(e,i){if(e.type!==t.EVENT&&e.type!==t.ACK||!u(e.data)||(e.type=e.type===t.EVENT?t.BINARY_EVENT:t.BINARY_ACK),p("encoding packet %j",e),t.BINARY_EVENT===e.type||t.BINARY_ACK===e.type)n(e,i);else{var r=s(e);i([r])}},h(a.prototype),a.prototype.add=function(e){var i;if("string"==typeof e)i=o(e),t.BINARY_EVENT===i.type||t.BINARY_ACK===i.type?(this.reconstructor=new c(i),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",i)):this.emit("decoded",i);else{if(!f(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");i=this.reconstructor.takeBinaryData(e),i&&(this.reconstructor=null,this.emit("decoded",i))}},a.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},c.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},c.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(e,t,i){function r(e){if(e)return s(e)}function s(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,s=0;s0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},r.prototype.cleanup=function(){p("cleanup");for(var e=this.subs.length,t=0;t=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var i=setTimeout(function(){e.skipReconnect||(p("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(p("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(p("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(i)}})}},r.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},function(e,t,i){e.exports=i(15),e.exports.parser=i(22)},function(e,t,i){(function(t){function r(e,i){if(!(this instanceof r))return new r(e,i);i=i||{},e&&"object"==typeof e&&(i=e,e=null),e?(e=l(e),i.hostname=e.host,i.secure="https"===e.protocol||"wss"===e.protocol,i.port=e.port,e.query&&(i.query=e.query)):i.host&&(i.hostname=l(i.host).host),this.secure=null!=i.secure?i.secure:t.location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.agent=i.agent||!1,this.hostname=i.hostname||(t.location?location.hostname:"localhost"),this.port=i.port||(t.location&&location.port?location.port:this.secure?443:80),this.query=i.query||{},"string"==typeof this.query&&(this.query=p.decode(this.query)),this.upgrade=!1!==i.upgrade,this.path=(i.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!i.forceJSONP,this.jsonp=!1!==i.jsonp,this.forceBase64=!!i.forceBase64,this.enablesXDR=!!i.enablesXDR,this.timestampParam=i.timestampParam||"t",this.timestampRequests=i.timestampRequests,this.transports=i.transports||["polling","websocket"],this.transportOptions=i.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=i.policyPort||843,this.rememberUpgrade=i.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=i.onlyBinaryUpgrades,this.perMessageDeflate=!1!==i.perMessageDeflate&&(i.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=i.pfx||null,this.key=i.key||null,this.passphrase=i.passphrase||null,this.cert=i.cert||null,this.ca=i.ca||null,this.ciphers=i.ciphers||null,this.rejectUnauthorized=void 0===i.rejectUnauthorized||i.rejectUnauthorized,this.forceNode=!!i.forceNode;var s="object"==typeof t&&t;s.global===s&&(i.extraHeaders&&Object.keys(i.extraHeaders).length>0&&(this.extraHeaders=i.extraHeaders),i.localAddress&&(this.localAddress=i.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function s(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}var n=i(16),a=i(8),o=i(3)("engine.io-client:socket"),_=i(36),c=i(22),l=i(2),p=i(30);e.exports=r,r.priorWebsocketSuccess=!1,a(r.prototype),r.protocol=c.protocol,r.Socket=r,r.Transport=i(21),r.transports=i(16),r.parser=i(22),r.prototype.createTransport=function(e){o('creating transport "%s"',e);var t=s(this.query);t.EIO=c.protocol,t.transport=e;var i=this.transportOptions[e]||{};this.id&&(t.sid=this.id);var r=new n[e]({query:t,socket:this,agent:i.agent||this.agent,hostname:i.hostname||this.hostname,port:i.port||this.port,secure:i.secure||this.secure,path:i.path||this.path,forceJSONP:i.forceJSONP||this.forceJSONP,jsonp:i.jsonp||this.jsonp,forceBase64:i.forceBase64||this.forceBase64,enablesXDR:i.enablesXDR||this.enablesXDR,timestampRequests:i.timestampRequests||this.timestampRequests,timestampParam:i.timestampParam||this.timestampParam,policyPort:i.policyPort||this.policyPort,pfx:i.pfx||this.pfx,key:i.key||this.key,passphrase:i.passphrase||this.passphrase,cert:i.cert||this.cert,ca:i.ca||this.ca,ciphers:i.ciphers||this.ciphers,rejectUnauthorized:i.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:i.perMessageDeflate||this.perMessageDeflate,extraHeaders:i.extraHeaders||this.extraHeaders,forceNode:i.forceNode||this.forceNode,localAddress:i.localAddress||this.localAddress,requestTimeout:i.requestTimeout||this.requestTimeout,protocols:i.protocols||void 0});return r},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){o("setting transport %s",e.name);var t=this;this.transport&&(o("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},r.prototype.probe=function(e){function t(){if(h.onlyBinaryUpgrades){var t=!this.supportsBinary&&h.transport.supportsBinary;p=p||t}p||(o('probe transport "%s" opened',e),l.send([{type:"ping",data:"probe"}]),l.once("packet",function(t){if(!p)if("pong"===t.type&&"probe"===t.data){ if(o('probe transport "%s" pong',e),h.upgrading=!0,h.emit("upgrading",l),!l)return;r.priorWebsocketSuccess="websocket"===l.name,o('pausing current transport "%s"',h.transport.name),h.transport.pause(function(){p||"closed"!==h.readyState&&(o("changing transport and sending upgrade packet"),c(),h.setTransport(l),l.send([{type:"upgrade"}]),h.emit("upgrade",l),l=null,h.upgrading=!1,h.flush())})}else{o('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=l.name,h.emit("upgradeError",i)}}))}function i(){p||(p=!0,c(),l.close(),l=null)}function s(t){var r=new Error("probe error: "+t);r.transport=l.name,i(),o('probe transport "%s" failed because of error: %s',e,t),h.emit("upgradeError",r)}function n(){s("transport closed")}function a(){s("socket closed")}function _(e){l&&e.name!==l.name&&(o('"%s" works - aborting "%s"',e.name,l.name),i())}function c(){l.removeListener("open",t),l.removeListener("error",s),l.removeListener("close",n),h.removeListener("close",a),h.removeListener("upgrading",_)}o('probing transport "%s"',e);var l=this.createTransport(e,{probe:1}),p=!1,h=this;r.priorWebsocketSuccess=!1,l.once("open",t),l.once("error",s),l.once("close",n),this.once("close",a),this.once("upgrading",_),l.open()},r.prototype.onOpen=function(){if(o("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var e=0,t=this.upgrades.length;e1?{type:v[s],data:e.substring(1)}:{type:v[s]}:b}var n=new Uint8Array(e),s=n[0],a=h(e,1);return C&&"blob"===i&&(a=new C([a])),{type:v[s],data:a}},t.decodeBase64Packet=function(e,t){var i=v[e.charAt(0)];if(!c)return{type:i,data:{base64:!0,data:e.substr(1)}};var r=c.decode(e.substr(1));return"blob"===t&&C&&(r=new C([r])),{type:i,data:r}},t.encodePayload=function(e,i,r){function s(e){return e.length+":"+e}function n(e,r){t.encodePacket(e,!!a&&i,!1,function(e){r(null,s(e))})}"function"==typeof i&&(r=i,i=null);var a=p(e);return i&&a?C&&!m?t.encodePayloadAsBlob(e,r):t.encodePayloadAsArrayBuffer(e,r):e.length?void _(e,n,function(e,t){return r(t.join(""))}):r("0:")},t.decodePayload=function(e,i,r){if("string"!=typeof e)return t.decodePayloadAsBinary(e,i,r);"function"==typeof i&&(r=i,i=null);var s;if(""===e)return r(b,0,1);for(var n,a,o="",_=0,c=e.length;_0;){for(var a=new Uint8Array(s),o=0===a[0],_="",c=1;255!==a[c];c++){if(_.length>310)return r(b,0,1);_+=a[c]}s=h(s,2+_.length),_=parseInt(_);var l=h(s,0,_);if(o)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(e){var p=new Uint8Array(l);l="";for(var c=0;cr&&(i=r),t>=r||t>=i||0===r)return new ArrayBuffer(0);for(var s=new Uint8Array(e),n=new Uint8Array(i-t),a=t,o=0;a=55296&&t<=56319&&s65535&&(t-=65536,s+=b(t>>>10&1023|55296),t=56320|1023&t),s+=b(t);return s}function _(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function c(e,t){return b(e>>t&63|128)}function l(e,t){if(0==(4294967168&e))return b(e);var i="";return 0==(4294965248&e)?i=b(e>>6&31|192):0==(4294901760&e)?(_(e,t)||(e=65533),i=b(e>>12&15|224),i+=c(e,6)):0==(4292870144&e)&&(i=b(e>>18&7|240),i+=c(e,12),i+=c(e,6)),i+=b(63&e|128)}function p(e,t){t=t||{};for(var i,r=!1!==t.strict,s=a(e),n=s.length,o=-1,_="";++o=y)throw Error("Invalid byte index");var e=255&m[v];if(v++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function u(e){var t,i,r,s,n;if(v>y)throw Error("Invalid byte index");if(v==y)return!1;if(t=255&m[v],v++,0==(128&t))return t;if(192==(224&t)){if(i=h(),n=(31&t)<<6|i,n>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if(i=h(),r=h(),n=(15&t)<<12|i<<6|r,n>=2048)return _(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(i=h(),r=h(),s=h(),n=(7&t)<<18|i<<12|r<<6|s,n>=65536&&n<=1114111))return n;throw Error("Invalid UTF-8 detected")}function d(e,t){t=t||{};var i=!1!==t.strict;m=a(e),y=m.length,v=0;for(var r,s=[];(r=u(i))!==!1;)s.push(r);return o(s)}var f="object"==typeof t&&t,g=("object"==typeof e&&e&&e.exports==f&&e,"object"==typeof s&&s);g.global!==g&&g.window!==g||(n=g);var m,y,v,b=String.fromCharCode,C={version:"2.1.2",encode:p,decode:d};r=function(){return C}.call(t,i,t,e),!(void 0!==r&&(e.exports=r))}(this)}).call(t,i(27)(e),function(){return this}())},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){!function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(256),r=0;r>2],n+=e[(3&r[i])<<4|r[i+1]>>4],n+=e[(15&r[i+1])<<2|r[i+2]>>6],n+=e[63&r[i+2]];return s%3===2?n=n.substring(0,n.length-1)+"=":s%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t.decode=function(e){var t,r,s,n,a,o=.75*e.length,_=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var l=new ArrayBuffer(o),p=new Uint8Array(l);for(t=0;t<_;t+=4)r=i[e.charCodeAt(t)],s=i[e.charCodeAt(t+1)],n=i[e.charCodeAt(t+2)],a=i[e.charCodeAt(t+3)],p[c++]=r<<2|s>>4,p[c++]=(15&s)<<4|n>>2,p[c++]=(3&n)<<6|63&a;return l}}()},function(e,t){(function(t){function i(e){for(var t=0;t0);return t}function r(e){var t=0;for(l=0;l';n=document.createElement(e)}catch(e){n=document.createElement("iframe"),n.name=s.iframeId,n.src="javascript:0"}n.id=s.iframeId,s.form.appendChild(n),s.iframe=n}var s=this;if(!this.form){var n,a=document.createElement("form"),o=document.createElement("textarea"),l=this.iframeId="eio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=l,a.method="POST",a.setAttribute("accept-charset","utf-8"),o.name="d",a.appendChild(o),document.body.appendChild(a),this.form=a,this.area=o}this.form.action=this.uri(),r(),e=e.replace(c,"\\\n"),this.area.value=e.replace(_,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===s.iframe.readyState&&i()}:this.iframe.onload=i}}).call(t,function(){return this}())},function(e,t,i){(function(t){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=p&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(h=s),n.call(this,e)}var s,n=i(21),a=i(22),o=i(30),_=i(31),c=i(32),l=i(3)("engine.io-client:websocket"),p=t.WebSocket||t.MozWebSocket;if("undefined"==typeof window)try{s=i(35)}catch(e){}var h=p;h||"undefined"!=typeof window||(h=s),e.exports=r,_(r,n),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,i={agent:this.agent,perMessageDeflate:this.perMessageDeflate};i.pfx=this.pfx,i.key=this.key,i.passphrase=this.passphrase,i.cert=this.cert,i.ca=this.ca,i.ciphers=this.ciphers,i.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(i.headers=this.extraHeaders),this.localAddress&&(i.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new h(e,t):new h(e):new h(e,t,i)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},r.prototype.write=function(e){function i(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var s=e.length,n=0,o=s;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=i,i.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-i:e+i}return 0|Math.min(e,this.max)},i.prototype.reset=function(){this.attempts=0},i.prototype.setMin=function(e){this.ms=e},i.prototype.setMax=function(e){this.max=e},i.prototype.setJitter=function(e){this.jitter=e}}])}),function(e,t){"use strict";if("function"==typeof __crisp_void_define&&define.amd)define(["exports"],t);else if("object"==typeof __crisp_void_exports)t(exports);else{var i={};e.PubSub=i,t(i)}}("object"==typeof __local_context&&__local_context||this,function(e){"use strict";function t(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function i(e){return function(){throw e}}function r(e,t,r){try{e(t,r)}catch(e){setTimeout(i(e),0)}}function s(e,t,i){e(t,i)}function n(e,t,i,n){var a,o=c[t],_=n?s:r;if(c.hasOwnProperty(t))for(a in o)o.hasOwnProperty(a)&&_(o[a],e,i)}function a(e,t,i){return function(){var r=String(e),s=r.lastIndexOf(".");for(n(e,e,t,i);s!==-1;)r=r.substr(0,s),s=r.lastIndexOf("."),n(e,r,t,i)}}function o(e){for(var i=String(e),r=Boolean(c.hasOwnProperty(i)&&t(c[i])),s=i.lastIndexOf(".");!r&&s!==-1;)i=i.substr(0,s),s=i.lastIndexOf("."),r=Boolean(c.hasOwnProperty(i)&&t(c[i]));return r}function _(e,t,i,r){var s=a(e,t,r),n=o(e);return!!n&&(i===!0?s():setTimeout(s,0),!0)}var c={},l=-1;e.publish=function(t,i){return _(t,i,!1,e.immediateExceptions)},e.publishSync=function(t,i){return _(t,i,!0,e.immediateExceptions)},e.subscribe=function(e,t){if("function"!=typeof t)return!1;c.hasOwnProperty(e)||(c[e]={});var i="uid_"+String(++l);return c[e][i]=t,i},e.clearAllSubscriptions=function(){c={}},e.clearSubscriptions=function(e){var t;for(t in c)c.hasOwnProperty(t)&&0===t.indexOf(e)&&delete c[t]},e.unsubscribe=function(e){var t,i,r,s="string"==typeof e&&c.hasOwnProperty(e),n=!s&&"string"==typeof e,a="function"==typeof e,o=!1;if(s)return void delete c[e];for(t in c)if(c.hasOwnProperty(t)){if(i=c[t],n&&i[e]){delete i[e],o=e;break}if(a)for(r in i)i.hasOwnProperty(r)&&i[r]===e&&(delete i[r],o=!0)}return o}}),function(e,t){"use strict";var i=function(e){if("object"!=typeof e.document)throw new Error("Cookies.js requires a `window` with a `document` object");var i=function(e,t,r){return 1===arguments.length?i.get(e):i.set(e,t,r)};return i._document=e.document,i._cacheKeyPrefix="cookey.",i._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),i.defaults={path:"/",secure:!1},i.get=function(e){i._cachedDocumentCookie!==i._document.cookie&&i._renewCache();var r=i._cache[i._cacheKeyPrefix+e];return r===t?t:decodeURIComponent(r)},i.set=function(e,r,s){return s=i._getExtendedOptions(s),s.expires=i._getExpiresDate(r===t?-1:s.expires),i._document.cookie=i._generateCookieString(e,r,s),i},i.expire=function(e,r){return i.set(e,t,r)},i._getExtendedOptions=function(e){return{path:e&&e.path||i.defaults.path,domain:e&&e.domain||i.defaults.domain,expires:e&&e.expires||i.defaults.expires,secure:e&&e.secure!==t?e.secure:i.defaults.secure}},i._isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},i._getExpiresDate=function(e,t){if(t=t||new Date,"number"==typeof e?e=e===1/0?i._maxExpireDate:new Date(t.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!i._isValidDate(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e},i._generateCookieString=function(e,t,i){e=e.replace(/[^#$&+\^`|]/g,encodeURIComponent),e=e.replace(/\(/g,"%28").replace(/\)/g,"%29"),t=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),i=i||{};var r=e+"="+t;return r+=i.path?";path="+i.path:"",r+=i.domain?";domain="+i.domain:"",r+=i.expires?";expires="+i.expires.toUTCString():"",r+=i.secure?";secure":""},i._getCacheFromString=function(e){for(var r={},s=e?e.split("; "):[],n=0;n>6,a[_++]=128|63&n):n<55296||n>=57344?(a[_++]=224|n>>12,a[_++]=128|n>>6&63,a[_++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++r)),a[_++]=240|n>>18,a[_++]=128|n>>12&63,a[_++]=128|n>>6&63,a[_++]=128|63&n);e=a}else{if("object"!==s)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,(!0)).update(e).array());var c=[],l=[];for(r=0;r<64;++r){var p=e[r]||0;c[r]=92^p,l[r]=54^p}Sha256.call(this,t,i),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=i}var ERROR="input is invalid type",WINDOW="object"==typeof window,root=__local_context;root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!1;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!1&&module.exports,AMD=!1,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(i){return new Sha256(t,(!0)).update(i)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var i=0;i>2]|=e[n]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(o[s>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.block=o[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,i,r,s,n,a,o,_,c,l,p=this.h0,h=this.h1,u=this.h2,d=this.h3,f=this.h4,g=this.h5,m=this.h6,y=this.h7,v=this.blocks;for(e=16;e<64;++e)s=v[e-15],t=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,s=v[e-2],i=(s>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,v[e]=v[e-16]+t+v[e-7]+i<<0;for(l=h&u,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,s=v[0]-1413257819,y=s-150054599<<0,d=s+24177077<<0):(o=704751109,s=v[0]-210244248,y=s-1521486534<<0,d=s+143694565<<0),this.first=!1):(t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7),o=p&h,r=o^p&u^l,a=f&g^~f&m,s=y+i+a+K[e]+v[e],n=t+r,y=d+s<<0,d=s+n<<0),t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),_=d&p,r=_^d&h^o,a=y&f^~y&g,s=m+i+a+K[e+1]+v[e+1],n=t+r,m=u+s<<0,u=s+n<<0,t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),i=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),c=u&d,r=c^u&p^_,a=m&y^~m&f,s=g+i+a+K[e+2]+v[e+2],n=t+r,g=h+s<<0,h=s+n<<0,t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),l=h&u,r=l^h&d^c,a=g&m^~g&y,s=f+i+a+K[e+3]+v[e+3],n=t+r,f=p+s<<0,p=s+n<<0;this.h0=this.h0+p<<0,this.h1=this.h1+h<<0,this.h2=this.h2+u<<0,this.h3=this.h3+d<<0,this.h4=this.h4+f<<0,this.h5=this.h5+g<<0,this.h6=this.h6+m<<0,this.h7=this.h7+y<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4,n=this.h5,a=this.h6,o=this.h7,_=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(_+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]),_},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,i=this.h2,r=this.h3,s=this.h4,n=this.h5,a=this.h6,o=this.h7,_=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||_.push(o>>24&255,o>>16&255,o>>8&255,255&o),_},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))}(),this.__configure(params),this.__transports(params,__local_context),this.Config=new CrispConfig(this),this.Socket=new CrispSocket(this),this.Stream=new CrispStream(this),this.Storage=new CrispStorage(this),this.Browsing=new CrispBrowsing(this),this.Call=new CrispCall(this),this.Message=new CrispMessage(this),this.Session=new CrispSession(this),this.Website=new CrispWebsite(this),this.Bucket=new CrispBucket(this),this.Media=new CrispMedia(this),this.Helpdesk=new CrispHelpdesk(this),this.Trigger=new CrispTrigger(this),this.Issue=new CrispIssue(this),params.connect_socket===!0&&this.socket.connect()},CrispLibraryClient.prototype.__configure=function(e){e&&e.environment&&(this.environment=e.environment||"development"),e&&e.disable_autoload&&(this.disable_autoload=e.disable_autoload),e&&e.url_go&&(this.url_go=e.url_go),e&&e.website_domain&&(this.website_domain=e.website_domain),e&&e.website_id&&(this.website_id=e.website_id),e&&e.token_id&&(this.token_id=e.token_id),e&&e.cookie_expire&&(this.cookie_expire=e.cookie_expire),e&&e.cookie_domain&&(this.cookie_domain=e.cookie_domain),e&&e.platform_name&&(this.platform_name=e.platform_name),e&&e.platform_signature_key&&(this.platform_signature_key=e.platform_signature_key),e&&e.runtime_configuration&&(this.runtime_configuration=e.runtime_configuration),this.device={},e&&e.useragent&&(this.device.useragent=e.useragent),e&&e.timezone&&(this.device.timezone=e.timezone),e&&e.capabilities&&(this.device.capabilities=e.capabilities),e&&e.locales&&(this.device.locales=e.locales)},CrispLibraryClient.prototype.__transports=function(e,t){var i=this,r=this,s=["websocket","polling"];"production"===this.environment&&(s=["websocket"]),this.event=t.PubSub,this.socket=t.io(e.url_relay_client,{path:"/",transports:s,autoConnect:!1,reconnectionDelay:5e3,reconnectionDelayMax:15e3}),this.stream=t.io(e.url_relay_stream,{path:"/",transports:s,reconnection:!1,autoConnect:!1}),window.addEventListener("unload",function(){i.socket.connected===!0&&i.socket.disconnect(),i.stream.connected===!0&&i.stream.disconnect()}),window.addEventListener("popstate",function(){i.__window_history()});var n=window.history.pushState,a=window.history.replaceState;window.history.pushState=function(){var e=n.apply(window.history,arguments);return r.__window_history(),e},window.history.replaceState=function(){var e=a.apply(window.history,arguments);return r.__window_history(),e},this.cookie=t.Cookies(window),this.sha256=t.sha256},CrispLibraryClient.prototype.__window_history=function(){this.Session.send_device(),this.event.publish("window:history",{page_url:document.location.href,page_domain:document.location.hostname})},CrispLibraryClient}());var JadeClient={};JadeClient.client=function(e){var t=[],i=e||{};return function(e,i,r,s,n,a,o,_,c,l,p,h,u){t.push('
')}.call(this,"availability_tooltip"in i?i.availability_tooltip:"undefined"!=typeof availability_tooltip?availability_tooltip:void 0,"blocked"in i?i.blocked:"undefined"!=typeof blocked?blocked:void 0,"direction"in i?i.direction:"undefined"!=typeof direction?direction:void 0,"full_view"in i?i.full_view:"undefined"!=typeof full_view?full_view:void 0,"hide_on_away"in i?i.hide_on_away:"undefined"!=typeof hide_on_away?hide_on_away:void 0,"hide_on_mobile"in i?i.hide_on_mobile:"undefined"!=typeof hide_on_mobile?hide_on_mobile:void 0,"hide_vacation"in i?i.hide_vacation:"undefined"!=typeof hide_vacation?hide_vacation:void 0,"lang"in i?i.lang:"undefined"!=typeof lang?lang:void 0,"large_view"in i?i.large_view:"undefined"!=typeof large_view?large_view:void 0,"last_operator_face"in i?i.last_operator_face:"undefined"!=typeof last_operator_face?last_operator_face:void 0,"lock_maximized"in i?i.lock_maximized:"undefined"!=typeof lock_maximized?lock_maximized:void 0,"position_reverse"in i?i.position_reverse:"undefined"!=typeof position_reverse?position_reverse:void 0,"small_view"in i?i.small_view:"undefined"!=typeof small_view?small_view:void 0),t.join("")},JadeClient.viewport=function(e){var t=[],i=e||{};return function(e){t.push('")}.call(this,"content"in i?i.content:"undefined"!=typeof content?content:void 0),t.join("")},JadeClient.clear=function(e){var t=[];return t.push(''),t.join("")},JadeClient.style_color=function(e){var t,i=[],r=e||{};return function(e){i.push('
"); }.call(this,"colors"in r?r.colors:"undefined"!=typeof colors?colors:void 0),i.join("")},JadeClient.style_other=function(e){var t,i=[],r=e||{};return function(e,r){i.push('
"),r===!1&&i.push(''),i.push("
")}.call(this,"container_index"in r?r.container_index:"undefined"!=typeof container_index?container_index:void 0,"show_operator_count"in r?r.show_operator_count:"undefined"!=typeof show_operator_count?show_operator_count:void 0),i.join("")},JadeClient.style_position=function(e){var t,i=[],r=e||{};return function(e){i.push('
'),e.default_button_horizontal&&i.push('"),e.default_button_vertical&&i.push('"),e.mobile_button_horizontal&&i.push('"),e.mobile_button_vertical&&i.push('"),i.push("
")}.call(this,"position"in r?r.position:"undefined"!=typeof position?position:void 0),i.join("")},JadeClient.new_line=function(e){var t=[];return t.push('
'),t.join("")},JadeClient.link_email=function(e){var t,i=[],r=e||{};return function(e){i.push("'+(null==(t=e)?"":t)+"")}.call(this,"email"in r?r.email:"undefined"!=typeof email?email:void 0),i.join("")},JadeClient.link_uri=function(e){var t,i=[],r=e||{};return function(e,r){i.push("'+(null==(t=e)?"":t)+"")}.call(this,"uri_name"in r?r.uri_name:"undefined"!=typeof uri_name?uri_name:void 0,"uri_value"in r?r.uri_value:"undefined"!=typeof uri_value?uri_value:void 0),i.join("")},JadeClient.link_domain=function(e){var t,i=[],r=e||{};return function(e,r){i.push("'+(null==(t=e)?"":t)+"")}.call(this,"domain_name"in r?r.domain_name:"undefined"!=typeof domain_name?domain_name:void 0,"domain_value"in r?r.domain_value:"undefined"!=typeof domain_value?domain_value:void 0),i.join("")},JadeClient.markdown_blockquote=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_color=function(e){var t,i=[],r=e||{};return function(e,r){i.push("'+(null==(t=r)?"":t)+"")}.call(this,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_bold=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_code_inline=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_code_block=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_delete=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_highlight=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_emphasis=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_image=function(e){var t=[],i=e||{};return function(e,i,r,s){t.push("");var n=e(s);t.push('")}.call(this,"encodeURIComponent"in i?i.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"type"in i?i.type:"undefined"!=typeof type?type:void 0,"url_crisp_image"in i?i.url_crisp_image:"undefined"!=typeof url_crisp_image?url_crisp_image:void 0,"value"in i?i.value:"undefined"!=typeof value?value:void 0),t.join("")},JadeClient.markdown_interpolate=function(e){var t,i=[],r=e||{};return function(e,r){i.push('{{ '+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e)?"":t)+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r?' | "'+r+'"':"")?"":t)+" }}")}.call(this,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_italic=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_line=function(e){var t=[];return t.push(''),t.join("")},JadeClient.markdown_link=function(e){var t,i=[],r=e||{};return function(e,r,s){i.push("'+(null==(t=r)?"":t)+"")}.call(this,"methods"in r?r.methods:"undefined"!=typeof methods?methods:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_list=function(e){var t,i=[],r=e||{};return function(e,r){i.push("'+(null==(t=r)?"":t)+"")}.call(this,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_title=function(e){var t,i=[],r=e||{};return function(e,r){i.push("'+(null==(t=r)?"":t)+"")}.call(this,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_underline=function(e){var t,i=[],r=e||{};return function(e){i.push(''+(null==(t=e)?"":t)+"")}.call(this,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_youtube=function(e){var t=[],i=e||{};return function(e,i,r,s){t.push("");var n="https://web.archive.org/web/20190510100347/https://www.youtube.com/embed/"+e(s),a=e("https://web.archive.org/web/20190510100347/https://img.youtube.com/vi/"+e(s)+"/hqdefault.jpg"),o=960,_=960;t.push("")}.call(this,"encodeURIComponent"in i?i.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"type"in i?i.type:"undefined"!=typeof type?type:void 0,"url_crisp_image"in i?i.url_crisp_image:"undefined"!=typeof url_crisp_image?url_crisp_image:void 0,"value"in i?i.value:"undefined"!=typeof value?value:void 0),t.join("")},JadeClient.markdown_vimeo=function(e){var t,i=[],r=e||{};return function(e,r,s){i.push("");var n="https://web.archive.org/web/20190510100347/https://vimeo.com/"+e(s);i.push("'+(null==(t=r||n)?"":t)+"")}.call(this,"encodeURIComponent"in r?r.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.markdown_dailymotion=function(e){var t=[],i=e||{};return function(e,i,r,s){t.push("");var n="https://web.archive.org/web/20190510100347/https://www.dailymotion.com/embed/video/"+e(s),a=e("https://web.archive.org/web/20190510100347/https://www.dailymotion.com/thumbnail/video/"+e(s)),o=320,_=240;t.push("")}.call(this,"encodeURIComponent"in i?i.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"type"in i?i.type:"undefined"!=typeof type?type:void 0,"url_crisp_image"in i?i.url_crisp_image:"undefined"!=typeof url_crisp_image?url_crisp_image:void 0,"value"in i?i.value:"undefined"!=typeof value?value:void 0),t.join("")},JadeClient.markdown_frame=function(e){var t,i=[],r=e||{};return function(e,r,s){i.push("'+(null==(t=r||s)?"":t)+"")}.call(this,"methods"in r?r.methods:"undefined"!=typeof methods?methods:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"value"in r?r.value:"undefined"!=typeof value?value:void 0),i.join("")},JadeClient.smiley=function(e){var t=[],i=e||{};return function(e,i){t.push("')}.call(this,"name"in i?i.name:"undefined"!=typeof name?name:void 0,"size"in i?i.size:"undefined"!=typeof size?size:void 0),t.join("")},JadeClient.magnify=function(e){var t=[],i=e||{};return function(e,i,r,s){switch(t.push('
'),s){case"embed":t.push('');break;default:t.push("')}t.push('
'),e.previous&&t.push(''),"file"===s&&t.push(''),t.push(''),e.next&&t.push(''),t.push("
")}.call(this,"fingerprints"in i?i.fingerprints:"undefined"!=typeof fingerprints?fingerprints:void 0,"name"in i?i.name:"undefined"!=typeof name?name:void 0,"source"in i?i.source:"undefined"!=typeof source?source:void 0,"type"in i?i.type:"undefined"!=typeof type?type:void 0),t.join("")},JadeClient.article=function(e){var t,i=[],r=e||{};return function(e,r){i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("article","controls_close"))?"":t)+"'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("article","controls_view"))?"":t)+'
')}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"frame"in r?r.frame:"undefined"!=typeof frame?frame:void 0),i.join("")},JadeClient.spotlight=function(e){var t,i=[],r=e||{};return function(e,r){i.push('
');var s=e("spotlight","search_form_field");i.push('
'),r&&i.push('"),i.push("
")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"url"in r?r.url:"undefined"!=typeof url?url:void 0),i.join("")},JadeClient.spotlight_results=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a){i.push('
'),n.length>0?(i.push('
    '),function(){var a=n;if("number"==typeof a.length)for(var o=0,_=a.length;o<_;o++){var c=a[o];i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=c.title)?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("spotlight","result_view"))?"":t)+"")}else{var _=0;for(var o in a){_++;var c=a[o];i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=c.title)?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("spotlight","result_view"))?"":t)+"")}}}.call(this),i.push("
")):i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("spotlight","result_empty"))?"":t)+""),i.push("
")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"base_url"in r?r.base_url:"undefined"!=typeof base_url?base_url:void 0,"has_active"in r?r.has_active:"undefined"!=typeof has_active?has_active:void 0,"results"in r?r.results:"undefined"!=typeof results?results:void 0,"undefined"in r?r.undefined:void 0),i.join("")},JadeClient.date_now=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","now"))?"":t)+"")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0),i.join("")},JadeClient.date_seconds=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","second"))?"":t)+"")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0),i.join("")},JadeClient.date_minutes=function(e){var t,i=[],r=e||{};return function(e,r){i.push(''),1===r?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","minute_singular"))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","minute_plural",[r]))?"":t)),i.push("")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"minutes"in r?r.minutes:"undefined"!=typeof minutes?minutes:void 0),i.join("")},JadeClient.date_hours=function(e){var t,i=[],r=e||{};return function(e,r){i.push(''),1===r?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","hour_singular"))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("date","hour_plural",[r]))?"":t)),i.push("")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"hours"in r?r.hours:"undefined"!=typeof hours?hours:void 0),i.join("")},JadeClient.date_far_away=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e)?"":t)+"")}.call(this,"date_full"in r?r.date_full:"undefined"!=typeof date_full?date_full:void 0),i.join("")},JadeClient.duration_now=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","now"))?"":t)+"")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0),i.join("")},JadeClient.duration_seconds=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","second"))?"":t)+"")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0),i.join("")},JadeClient.duration_minutes=function(e){var t,i=[],r=e||{};return function(e,r){i.push(''),1===r?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","minute_singular"))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","minute_plural",[r]))?"":t)),i.push("")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"minutes"in r?r.minutes:"undefined"!=typeof minutes?minutes:void 0),i.join("")},JadeClient.duration_hours=function(e){var t,i=[],r=e||{};return function(e,r){i.push(''),1===r?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","hour_singular"))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","hour_plural",[r]))?"":t)),i.push("")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"hours"in r?r.hours:"undefined"!=typeof hours?hours:void 0),i.join("")},JadeClient.duration_days=function(e){var t,i=[],r=e||{};return function(e){i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("duration","days"))?"":t)+"")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0),i.join("")},JadeClient.chat=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d){i.push("");i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push('
');var f=_.chat.tile&&"default"!==_.chat.tile&&!0;i.push("');var g=p.active_operators(d.id,_),m=p.count_other_operators(_);(function(){var e=g;if("number"==typeof e.length)for(var r=0,n=e.length;r'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a.name)?"":t)+"")}else{var n=0;for(var r in e){n++;var a=e[r],o=s(240,a.type,a.identifier,a.avatar);i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a.name)?"":t)+"")}}}).call(this),m>0&&i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=m)?"":t)+"+"),i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("theme_text",["default_chat",_.chat.theme_text+"_chat"]))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_from"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=_.website.name)?"":t)+'');var y=_.chat.activity_metrics===!0&&a.metrics&&!0;i.push(''),y===!0?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_metrics",[a.metrics.format]))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_online"))?"":t)),i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_online"))?"":t)+'');var y=_.chat.activity_metrics===!0&&a.last&&!0;i.push(''),y===!0?i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_last",[a.last.format]))?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_away"))?"":t)),i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_status_away"))?"":t)+'');var v=[["email",n("chat","chat_header_ongoing_channel_continue_email")],["phone",n("chat","chat_header_ongoing_channel_continue_phone")],["messenger","Messenger"],["telegram","Telegram"],["twitter","Twitter"]];o.helpdesk.search===!0&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_welcome_helpdesk"))?"":t)+""),function(){var e=v;if("number"==typeof e.length)for(var r=0,s=e.length;r'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_channel_continue",[a[1]]))?"":t)+"")}else{var s=0;for(var r in e){s++;var a=e[r],o=p.generate_channel_link(a[0]),_=["email","phone"].indexOf(a[0])!==-1?"_self":"_blank";o&&_&&i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_header_ongoing_channel_continue",[a[1]]))?"":t)+""); }}}.call(this),i.push('
=18e4?"true":"false",!0,!1)+' data-has-offline="false" class="crisp-zyxrmn">');var b=o.runtime.lock_maximized!==!0&&(_.chat.hide_vacation===!0||o.blocked===!0);i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_offline_main"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_offline_label"))?"":t)+"
"),h.url&&(i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_health_main"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_health_label_link"))?"":t)+""),r["text-space"](),i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_health_label_updates"))?"":t)+"
")),i.push('
'),_.chat.file_transfer===!0&&i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_form_attach_tooltip"))?"":t)+"
"),i.push('
'),function(){var e=l.smileys;if("number"==typeof e.length)for(var t=0,r=e.length;t')}else{var r=0;for(var t in e){r++;var s=e[t];i.push('')}}}.call(this),i.push('
');var C=n("chat","chat_pickers_gif_search");i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_pickers_gif_no_results"))?"":t)+'
');var k=n("chat","chat_form_field_message"),x=n("chat","chat_form_field_disabled");if(i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_form_smiley_tooltip"))?"":t)+'
'),_.chat.file_transfer===!0&&i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","chat_form_attach_tooltip"))?"":t)+'
'),i.push('
'),!("urn:crisp.im:debranding:0"in _.plugins&&_.website.trial!==!0)){i.push('
');var L=c(d.domain),j=c(d.name);i.push("We run onCrisp
')}if(i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n("chat","minimized_tooltip_message_compose"))?"":t)+''),_.chat.last_operator_face===!0&&_.website.active_operators.length>0){var S=_.website.active_operators[0],z=s(240,"operator",S.user_id,S.avatar);i.push('')}else i.push('');i.push('0')}.call(this,"Date"in s?s.Date:"undefined"!=typeof Date?Date:void 0,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"activity"in s?s.activity:"undefined"!=typeof activity?activity:void 0,"chatbox"in s?s.chatbox:"undefined"!=typeof chatbox?chatbox:void 0,"configuration"in s?s.configuration:"undefined"!=typeof configuration?configuration:void 0,"encodeURIComponent"in s?s.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"environment"in s?s.environment:"undefined"!=typeof environment?environment:void 0,"methods"in s?s.methods:"undefined"!=typeof methods?methods:void 0,"status"in s?s.status:"undefined"!=typeof status?status:void 0,"undefined"in s?s.undefined:void 0,"website"in s?s.website:"undefined"!=typeof website?website:void 0),i.join("")},JadeClient.minimized_authorized=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a,o,_,c){i.push("");var l=!1;if(i.push('
'),!l){i.push('');var p=o.active_operators(c.id,n);if(i.push('0?"true":"false",!0,!1)+' class="crisp-1sd4dmd">'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("theme_text",["default_chat",n.chat.theme_text+"_chat"]))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_status_online"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_status_away"))?"":t)+""),p.length>0){var h=p[0],u=e(240,h.type,h.identifier,h.avatar);i.push('')}i.push(""),function(){var e=["online","away"];if("number"==typeof e.length)for(var s=0,o=e.length;s'),"away"===_&&a&&a.url?i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_split_helpdesk"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_split_chat"))?"":t)+""):i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_full_chat",[n.website.name]))?"":t)+""),i.push("")}else{var o=0;for(var s in e){o++;var _=e[s];i.push("'),"away"===_&&a&&a.url?i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_split_helpdesk"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_split_chat"))?"":t)+""):i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("minimized","tooltip_entice_full_chat",[n.website.name]))?"":t)+""),i.push("")}}}.call(this),i.push("")}if(l&&i.push(''),i.push(""),l)i.push('');else{if(i.push(''),n.chat.last_operator_face===!0&&n.website.active_operators.length>0){var d=n.website.active_operators[0],u=e(240,"operator",d.user_id,d.avatar);i.push('')}i.push("")}i.push("
")}.call(this,"_a"in r?r._a:"undefined"!=typeof _a?_a:void 0,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"conceal_general_entice"in r?r.conceal_general_entice:"undefined"!=typeof conceal_general_entice?conceal_general_entice:void 0,"configuration"in r?r.configuration:"undefined"!=typeof configuration?configuration:void 0,"helpdesk"in r?r.helpdesk:"undefined"!=typeof helpdesk?helpdesk:void 0,"methods"in r?r.methods:"undefined"!=typeof methods?methods:void 0,"undefined"in r?r.undefined:void 0,"website"in r?r.website:"undefined"!=typeof website?website:void 0),i.join("")},JadeClient.minimized_unauthorized=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a){i.push("");var o=!0;if(i.push('")}.call(this,"_a"in r?r._a:"undefined"!=typeof _a?_a:void 0,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"conceal_general_entice"in r?r.conceal_general_entice:"undefined"!=typeof conceal_general_entice?conceal_general_entice:void 0,"configuration"in r?r.configuration:"undefined"!=typeof configuration?configuration:void 0,"helpdesk"in r?r.helpdesk:"undefined"!=typeof helpdesk?helpdesk:void 0),i.join("")},JadeClient.chat_preview_message=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a,o,_,c,l,p,h){if(i.push(""),"text"===p||"file"===p||"animation"===p||"audio"===p||"picker"===p||"field"===p){i.push('');var u=e(240,h.type||l,h.user_id,h.avatar);switch(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("chat","minimized_tooltip_message_from"))?"":t)+''),"website"===h.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=h.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n(h.nickname))?"":t)),i.push(''),p){case"text":i.push(null==(t=s(a,c))?"":t);break;case"file":case"animation":switch(a.type){case"image/jpg":case"image/jpeg":case"image/png":var d=o(a.url);switch(p){case"animation":i.push("');break;default:var f=180,g=180;i.push("')}break;default:"animation"===p?i.push("🎉"):(i.push("📦"),a.name&&i.push(" "+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a.name)?"":t)))}break;case"audio":i.push("🎧");break;case"picker":case"field":i.push(null==(t=s(a.text,c))?"":t)}i.push('')}}.call(this,"_a"in r?r._a:"undefined"!=typeof _a?_a:void 0,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"_f"in r?r._f:"undefined"!=typeof _f?_f:void 0,"_n"in r?r._n:"undefined"!=typeof _n?_n:void 0,"content"in r?r.content:"undefined"!=typeof content?content:void 0,"encodeURIComponent"in r?r.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"environment"in r?r.environment:"undefined"!=typeof environment?environment:void 0,"format_context"in r?r.format_context:"undefined"!=typeof format_context?format_context:void 0,"from"in r?r.from:"undefined"!=typeof from?from:void 0,"type"in r?r.type:"undefined"!=typeof type?type:void 0,"user"in r?r.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_text=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d,f,g,m){i.push("");var y="text",v=!1;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===d){var b=e(240,m.type||d,m.user_id,m.avatar);i.push(''),m.nickname&&(i.push(''),"website"===m.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=m.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a(m.nickname))?"":t)),i.push("")),i.push("")}i.push('"+(null==(t=n(o,u))?"":t)),f.preview&&function(){var e=f.preview;if("number"==typeof e.length)for(var r=0,s=e.length;r'),n.preview&&n.preview.embed&&n.preview.image){var a=l(n.preview.image),o=600,_=600;i.push("')}else{i.push("");var c=n.title||n.website||n.url;i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=c)?"":t)+"")}i.push("")}else{var s=0;for(var r in e){s++;var n=e[r];if(i.push("'),n.preview&&n.preview.embed&&n.preview.image){var a=l(n.preview.image),o=600,_=600;i.push("')}else{i.push("");var c=n.title||n.website||n.url;i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=c)?"":t)+"")}i.push("")}}}.call(this),i.push(''),_&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=_)?"":t)+''),f.edited!==!0&&f.translated!==!0||(i.push('('),f.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),f.translated===!0&&(i.push(","),r["text-space"]())),f.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===d&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_f"in s?s._f:"undefined"!=typeof _f?_f:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"encodeURIComponent"in s?s.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"environment"in s?s.environment:"undefined"!=typeof environment?environment:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"format_context"in s?s.format_context:"undefined"!=typeof format_context?format_context:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"undefined"in s?s.undefined:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_file=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d){i.push("");var f="file",g=l.types.file_preview.indexOf(a.type)!==-1&&!0;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===h){var m=e(240,d.type||h,d.user_id,d.avatar);i.push(''),d.nickname&&(i.push(''),"website"===d.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=d.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n(d.nickname))?"":t)),i.push("")),i.push("")}if(i.push(''),a.name?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a.name)?"":t)):i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_file_name"))?"":t)),i.push(""),g===!0){i.push("');var y=c(a.url),v=600,b=600;i.push("')}else i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_file_button"))?"":t)+""); i.push(''),o&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=o)?"":t)+''),u.edited!==!0&&u.translated!==!0||(i.push('('),u.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),u.translated===!0&&(i.push(","),r["text-space"]())),u.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===h&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"encodeURIComponent"in s?s.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"environment"in s?s.environment:"undefined"!=typeof environment?environment:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_animation=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d){i.push("");var f="animation",g=!0;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===h){var m=e(240,d.type||h,d.user_id,d.avatar);i.push(''),d.nickname&&(i.push(''),"website"===d.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=d.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n(d.nickname))?"":t)),i.push("")),i.push("")}i.push('");var y=a.url.match(/^(?:https?:)?(?:\/\/)?([^\/\?]+)/)[1],v=c(a.url);i.push("'),o&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=o)?"":t)+''),u.edited!==!0&&u.translated!==!0||(i.push('('),u.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),u.translated===!0&&(i.push(","),r["text-space"]())),u.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===h&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"encodeURIComponent"in s?s.encodeURIComponent:"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"environment"in s?s.environment:"undefined"!=typeof environment?environment:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_audio=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h){i.push("");var u="audio",d=!1;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===l){var f=e(240,h.type||l,h.user_id,h.avatar);i.push(''),h.nickname&&(i.push(''),"website"===h.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=h.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n(h.nickname))?"":t)),i.push("")),i.push("")}i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=p.duration)?"":t)+''),o&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=o)?"":t)+''),p.edited!==!0&&p.translated!==!0||(i.push('('),p.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),p.translated===!0&&(i.push(","),r["text-space"]())),p.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===l&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_picker=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d,f){i.push("");var g="picker",m=!1;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===h){var y=e(240,f.type||h,f.user_id,f.avatar);i.push(''),f.nickname&&(i.push(''),"website"===f.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=f.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a(f.nickname))?"":t)),i.push("")),i.push("")}i.push('"+(null==(t=n(o.text,p))?"":t)+"'),function(){var e=o.choices;if("number"==typeof e.length)for(var r=0,s=e.length;r"+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n.label)?"":t)+"")}else{var s=0;for(var r in e){s++;var n=e[r];i.push('"+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n.label)?"":t)+"")}}}.call(this),i.push(''),_&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=_)?"":t)+''),u.edited!==!0&&u.translated!==!0||(i.push('('),u.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),u.translated===!0&&(i.push(","),r["text-space"]())),u.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===h&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_f"in s?s._f:"undefined"!=typeof _f?_f:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"format_context"in s?s.format_context:"undefined"!=typeof format_context?format_context:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"undefined"in s?s.undefined:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_message_field=function(e){var t,i=[],r={},s=e||{};return function(e,s,n,a,o,_,c,l,p,h,u,d){i.push("");var f="field",g=!1;if(i.push(""),r["text-space"]=t=function(){this&&this.block,this&&this.attributes||{};i.push(" ")},i.push("'),"operator"===h){var m=e(240,d.type||h,d.user_id,d.avatar);i.push(''),d.nickname&&(i.push(''),"website"===d.type?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=d.nickname)?"":t)):i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a(d.nickname))?"":t)),i.push("")),i.push("")}i.push(''),o.previous&&"operator"===h&&i.push(''),i.push(null==(t=n(o.text,p))?"":t),o.value||"operator"!==h?i.push(""+__crisp_local_instance.Library.jade.runtime.escape(null==(t=o.value||o.explain)?"":t)+""):i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_text_identity_ask_field_submit"))?"":t)+"
"),i.push(''),_&&(i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=_)?"":t)+''),u.edited!==!0&&u.translated!==!0||(i.push('('),u.edited===!0&&(i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_edited"))?"":t)),u.translated===!0&&(i.push(","),r["text-space"]())),u.translated===!0&&i.push(__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_tag_translated"))?"":t)),i.push(")")),i.push("")),i.push(''),"visitor"===h&&i.push(''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_info_read"))?"":t)+''+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s("chat","chat_message_error_retry"))?"":t)+''),i.push("")}.call(this,"_a"in s?s._a:"undefined"!=typeof _a?_a:void 0,"_e"in s?s._e:"undefined"!=typeof _e?_e:void 0,"_f"in s?s._f:"undefined"!=typeof _f?_f:void 0,"_n"in s?s._n:"undefined"!=typeof _n?_n:void 0,"content"in s?s.content:"undefined"!=typeof content?content:void 0,"date_formatted"in s?s.date_formatted:"undefined"!=typeof date_formatted?date_formatted:void 0,"date_iso"in s?s.date_iso:"undefined"!=typeof date_iso?date_iso:void 0,"fingerprint"in s?s.fingerprint:"undefined"!=typeof fingerprint?fingerprint:void 0,"format_context"in s?s.format_context:"undefined"!=typeof format_context?format_context:void 0,"from"in s?s.from:"undefined"!=typeof from?from:void 0,"metas"in s?s.metas:"undefined"!=typeof metas?metas:void 0,"user"in s?s.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.chat_bubble_composing=function(e){var t=[],i=e||{};return function(e){t.push('
'),function(){var e=[1,2,3];if("number"==typeof e.length)for(var i=0,r=e.length;i')}else{var r=0;for(var i in e){r++;e[i];t.push('')}}}.call(this),t.push('
')}.call(this,"undefined"in i?i.undefined:void 0),t.join("")},JadeClient.chat_bubble_thread=function(e){var t,i=[],r=e||{};return function(e,r,s,n){i.push("'),s&&i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=s)?"":t)+"
"),i.push('
')}.call(this,"day"in r?r.day:"undefined"!=typeof day?day:void 0,"month"in r?r.month:"undefined"!=typeof month?month:void 0,"title"in r?r.title:"undefined"!=typeof title?title:void 0,"year"in r?r.year:"undefined"!=typeof year?year:void 0),i.join("")},JadeClient.chat_bubble_group=function(e){var t=[],i=e||{};return function(e,i){t.push("')}.call(this,"from"in i?i.from:"undefined"!=typeof from?from:void 0,"user_marker"in i?i.user_marker:"undefined"!=typeof user_marker?user_marker:void 0),t.join("")},JadeClient.chat_picker_gif_item=function(e){var t=[];return t.push(''),t.join("")},JadeClient.chat_game=function(e){var t,i=[],r=e||{};return function(e,r){i.push('')}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"environment"in r?r.environment:"undefined"!=typeof environment?environment:void 0),i.join("")},JadeClient.browsing_assist=function(e){var t,i=[],r=e||{};return function(e,r){i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=e("browsing","assist_mouse_tooltip",[r.website.name]))?"":t)+"
")}.call(this,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"configuration"in r?r.configuration:"undefined"!=typeof configuration?configuration:void 0),i.join("")},JadeClient.call_ring=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a,o){i.push('
');var _=e(240,o.type,o.user_id);i.push("
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","ring_title_website",[s.website.name]))?"":t)+'
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","ring_title_label",[o.nickname]))?"":t)+'
    ');var c=[["decline",r("call","ring_actions_decline"),null],["accept",r("call","ring_actions_accept"),n]];(function(){var e=c;if("number"==typeof e.length)for(var r=0,s=e.length;r'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n[1])?"":t)+"")}else{var s=0;for(var r in e){s++;var n=e[r];i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=n[1])?"":t)+"")}}}).call(this),i.push("
")}.call(this,"_a"in r?r._a:"undefined"!=typeof _a?_a:void 0,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"configuration"in r?r.configuration:"undefined"!=typeof configuration?configuration:void 0,"mode"in r?r.mode:"undefined"!=typeof mode?mode:void 0,"undefined"in r?r.undefined:void 0,"user"in r?r.user:"undefined"!=typeof user?user:void 0),i.join("")},JadeClient.call_screen=function(e){var t,i=[],r=e||{};return function(e,r,s,n,a){i.push('
');var o=e(240,a.type,a.user_id);i.push('
'),"audio"===s&&i.push(''),i.push('
    ');var _=["audio"];"video"===s&&_.push("video"),function(){var e=_;if("number"==typeof e.length)for(var s=0,n=e.length;s'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","screen_label_"+a+"_muted"))?"":t)+"")}else{var n=0;for(var s in e){n++;var a=e[s];i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","screen_label_"+a+"_muted"))?"":t)+"")}}}.call(this),i.push('
'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=a.nickname)?"":t)+'');var c=["connecting","ongoing"];(function(){var e=c;if("number"==typeof e.length)for(var s=0,n=e.length;s'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","screen_status_"+a))?"":t)+"")}else{var n=0;for(var s in e){n++;var a=e[s];i.push("'+__crisp_local_instance.Library.jade.runtime.escape(null==(t=r("call","screen_status_"+a))?"":t)+"")}}}).call(this),i.push('0:00:00
');var l=[["audio",!0,!1],["hangup",!1,!0],["toggle",!1,!0]];"video"===s&&l.unshift(["video",!0,!1]),function(){var e=l;if("number"==typeof e.length)for(var t=0,r=e.length;t')}else{var r=0;for(var t in e){r++;var s=e[t];i.push('')}}}.call(this),i.push("
"),"video"===s&&i.push('
'),i.push("
")}.call(this,"_a"in r?r._a:"undefined"!=typeof _a?_a:void 0,"_e"in r?r._e:"undefined"!=typeof _e?_e:void 0,"mode"in r?r.mode:"undefined"!=typeof mode?mode:void 0,"undefined"in r?r.undefined:void 0,"user"in r?r.user:"undefined"!=typeof user?user:void 0),i.join("")},this.logger=__crisp_local_context.Console, this.dom=__crisp_local_context.cash,this.crisp={web:__crisp_local_context.CrispLibraryWeb,client:__crisp_local_context.CrispLibraryClient},this.jade={runtime:__crisp_local_context.jade,client:JadeClient},this.__extends()}catch(e){this.logger.error(this.ns+"."+fn,e)}}return CrispLibrary.prototype.__extends=function(){var e="__extends";try{this.__extend_dom()}catch(t){this.logger.error(this.ns+"."+e,t)}},CrispLibrary.prototype.__extend_dom=function(){var e="__extend_dom";try{this.dom.fn.extend({safe_css_text:function(e,t){return e?"object"===("undefined"==typeof e?"undefined":_typeof(e))||t?(this.each(function(i){var r={};"object"===("undefined"==typeof e?"undefined":_typeof(e))?r=e:r[e]=t;var s="";for(var n in r)r.hasOwnProperty(n)&&(s+=n+": "+r[n]+" !important;");i.style.cssText=s}),this):this[0].style.cssText:void this.each(function(e){e.style.cssText=""})}})}catch(t){this.logger.error(this.ns+"."+e,t)}},CrispLibrary}()),Crisp.Polyfill=new(function(){function e(){var e="constructor";try{this.ns="CrispPolyfill",this.__schedule_incompatible_delay=3e3,this.__native_function_regex=/\{\s*\[native code\]\s*\}$/,this.__apply()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.schedule_warn_incompatible=function(){var e=this,t="schedule_warn_incompatible";try{setTimeout(function(){Crisp.Pipeline._safe_mode!==!0&&e.__warn_incompatible()},this.__schedule_incompatible_delay)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__apply=function(){var e="__apply";try{this.__function_bind()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__function_bind=function(){var e="__function_bind";try{Function.prototype.__crisp_bind=function(e){var t=void 0,i=void 0,r=void 0,s=void 0;if("function"!=typeof this)throw new TypeError("Function.prototype.__crisp_bind - not callable");return t=Array.prototype.slice.call(arguments,1),i=this,r=function(){},s=function(){return i.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))},this.prototype&&(r.prototype=this.prototype),s.prototype=new r,s}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__warn_incompatible=function(){var e="__warn_incompatible";try{if(window.console&&"function"==typeof window.console.warn&&"function"==typeof Function.prototype.toString){for(var t=[[window.eval,"eval"],[window.escape,"escape"],[window.unescape,"unescape"],[window.decodeURI,"decodeURI"],[window.encodeURI,"encodeURI"],[window.decodeURIComponent,"decodeURIComponent"],[window.encodeURIComponent,"encodeURIComponent"],[window.setTimeout,"setTimeout"],[window.clearTimeout,"clearTimeout"],[window.setInterval,"setInterval"],[window.clearInterval,"clearInterval"],[window.parseInt,"parseInt"],[window.parseFloat,"parseFloat"],[window.Array,"Array"],[window.Array.prototype.push,"Array.prototype.push"],[window.Array.prototype.pop,"Array.prototype.pop"],[window.Array.prototype.indexOf,"Array.prototype.indexOf"],[window.Array.prototype.includes,"Array.prototype.includes"],[window.Array.prototype.sort,"Array.prototype.sort"],[window.Array.prototype.splice,"Array.prototype.splice"],[window.Array.prototype.slice,"Array.prototype.slice"],[window.Array.prototype.shift,"Array.prototype.shift"],[window.Array.prototype.unshift,"Array.prototype.unshift"],[window.Array.prototype.map,"Array.prototype.map"],[window.Array.prototype.forEach,"Array.prototype.forEach"],[window.Object,"Object"],[window.Object.keys,"Object.keys"],[window.Object.values,"Object.values"],[window.Object.prototype.hasOwnProperty,"Object.prototype.hasOwnProperty"],[window.String,"String"],[window.String.fromCharCode,"String.fromCharCode"],[window.String.prototype.indexOf,"String.prototype.indexOf"],[window.String.prototype.charAt,"String.prototype.charAt"],[window.String.prototype.charCodeAt,"String.prototype.charCodeAt"],[window.String.prototype.trim,"String.prototype.trim"],[window.String.prototype.toLowerCase,"String.prototype.toLowerCase"],[window.String.prototype.toUpperCase,"String.prototype.toUpperCase"],[window.String.prototype.slice,"String.prototype.slice"],[window.String.prototype.replace,"String.prototype.replace"],[window.String.prototype.match,"String.prototype.match"],[window.Math.random,"Math.random"],[window.Math.round,"Math.round"],[window.Math.floor,"Math.floor"],[window.Math.ceil,"Math.ceil"],[window.Math.abs,"Math.abs"],[window.Date,"Date"],[window.Date.now,"Date.now"],[window.Date.prototype.getTime,"Date.prototype.getTime"],[window.Date.prototype.toISOString,"Date.prototype.toISOString"],[window.Function.prototype.bind,"Function.prototype.bind"],[window.Function.prototype.apply,"Function.prototype.apply"],[window.Function.prototype.call,"Function.prototype.call"],[window.RegExp,"RegExp"],[window.RegExp.prototype.test,"RegExp.prototype.test"],[window.RegExp.prototype.exec,"RegExp.prototype.exec"],[window.Event,"Event"],[window.Event.prototype.preventDefault,"Event.prototype.preventDefault"],[window.Event.prototype.stopPropagation,"Event.prototype.stopPropagation"],[window.Error,"Error"],[window.document.createElement,"document.createElement"],[window.document.addEventListener,"document.addEventListener"],[window.document.removeEventListener,"document.removeEventListener"],[(window.JSON||{}).stringify,"JSON.stringify"],[(window.JSON||{}).parse,"JSON.parse"],[(window.localStorage||{}).setItem,"localStorage.setItem"],[(window.localStorage||{}).getItem,"localStorage.getItem"],[(window.localStorage||{}).removeItem,"localStorage.removeItem"],[(window.sessionStorage||{}).setItem,"sessionStorage.setItem"],[(window.sessionStorage||{}).getItem,"sessionStorage.getItem"],[(window.sessionStorage||{}).removeItem,"sessionStorage.removeItem"],[window.RTCPeerConnection,"RTCPeerConnection"],[window.MutationObserver,"MutationObserver"],[window.XMLHttpRequest,"XMLHttpRequest"],[window.AudioContext,"AudioContext"],[window.WebSocket,"WebSocket"]],i=[],r=void 0,s=0;s0&&console.warn('[WARNING] Crisp found shims of native JavaScript methods. This can alter the chatbox behavior and break things. Make sure not to override listed functions to ensure your chatbox works as expected. You may be looking for other JavaScript libraries in use on this page.\n\nYou can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.\n\nMethods to check:',i)}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}());var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Crisp.Utility=new(function(){function e(){var e="constructor";try{this.ns="CrispUtility",this.__rule_single_key="[match:single]",this.__rule_double_key="[match:double]",this.__rule_single_regex=/([\*]{1})/g,this.__rule_double_regex=/([\*]{2})/g,this.__rule_single_key_regex=/(\[match:single\])/g,this.__rule_double_key_regex=/(\[match:double\])/g,this.__page_url_regex=/^(?:https?:[\/]*)?(?:www\.)?([^\/]+)([^#?]*)?(?:[\/]+)?(?:[#?].*)?/i,this.__channel_url_regexes={},this.__unsafe_link_regex=/^(?:\s*)(?:(?:javascript|vbscript):)/i}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.get_or_fallback=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r="get_or_fallback",s=e;try{s=null!==i?("undefined"==typeof e?"undefined":_typeof(e))!==i?t:e:e||t}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e.prototype.lower_string_first=function(e){var t="lower_string_first",i=e;try{e&&(i=""+e.charAt(0).toLowerCase()+e.slice(1))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.pad_number=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00",i="pad_number",r=t;try{if(e>=0){var s=t.length-Math.ceil((e+1)/10);r=e?t.substr(0,s)+e:t}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.filter_link_safe=function(e){var t="filter_link_safe",i="#";try{e&&this.__unsafe_link_regex.test(e)===!1&&(i=e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.to_hashcode=function(e){var t="to_hashcode",i=0;try{if(e.length>0)for(var r=0;r0&&(i=!1)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.is_equal=function(e,t){var i="is_equal",r=!0;try{var s=-1,n=void 0,a=void 0;if(("undefined"==typeof e?"undefined":_typeof(e))!==("undefined"==typeof t?"undefined":_typeof(t)))r=!1;else if(e&&"object"===("undefined"==typeof e?"undefined":_typeof(e))&&t&&"object"===("undefined"==typeof t?"undefined":_typeof(t)))for(e instanceof Array||t instanceof Array?(a=this.union(e,t),e.length===a.length&&t.length===a.length||(r=!1)):a=this.union(this.keys(e),this.keys(t));++s2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s="extract",n=t||i||"";try{var a=(t||"").trim().match(e);n=a&&a[r]?a[r]:i||""}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}finally{return n}},e.prototype.compare_rule=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",s="compare_rule",n=!1;try{t.indexOf("*")!==-1?(t=t.replace(this.__rule_double_regex,this.__rule_double_key),t=t.replace(this.__rule_single_regex,this.__rule_single_key),t=t.replace(this.__rule_double_key_regex,r+"*"),t=t.replace(this.__rule_single_key_regex,i+"*"),n=new RegExp("^"+t+"$").test(e)&&!0):n=e===t&&!0}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}finally{return n}},e.prototype.compare_rules=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",s="compare_rules",n=!1;try{for(var a=0;a1&&"/"!==t[t.length-1]&&"*"!==t[t.length-1]&&(t+="/"):t="/",r=""+e+t}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.compare_page_rules=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r="compare_page_rules",s=!1;try{if(t.length>0){var n=void 0,a=[];null===i&&(i=Crisp.Base._website_domain);for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:"",r="acquire_channel_regex",s=null;try{if(Crisp.Base._website_configuration.channels[e]&&(s=(this.__channel_url_regexes[e]||{})[t],!s)){var n=Crisp.Chat.Interface._generate_channel_link("helpdesk");s=new RegExp("^"+Crisp.Library.crisp.web.Parse.escape_regex(n)+(i+"$")),this.__channel_url_regexes[e]=this.__channel_url_regexes[e]||{},this.__channel_url_regexes[e][t]=s}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e}()),Crisp.Feature=new(function(){function e(){var e="constructor";try{this.ns="CrispFeature",this.__has_css_animations=this.__has_css_support_for("animation"),this.__html_audio_format=this.__detect_html_audio_support(),this.__assign_has_screen_touch()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.has_screen_touch=function(){var e="has_screen_touch";try{return this.__has_screen_touch}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.has_css_animations=function(){var e="has_css_animations";try{return this.__has_css_animations}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.has_html_audio=function(){var e="has_html_audio";try{return null!==this.__html_audio_format&&!0}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.html_audio_format=function(){var e="html_audio_format";try{return this.__html_audio_format}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__has_window_property=function(e){var t="__has_window_property",i=!1;try{i=!!(e in window)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.__has_css_support_for=function(e){var t="__has_css_support_for",i=!1;try{var r=document.documentElement.style,s=["Khtml","Ms","O","Moz","Webkit"],n=s.length;if(e in r)i=!0;else for(e=e.replace(/^[a-z]/,function(e){return e.toUpperCase()});n--;)if(s[n]+e in r){i=!0;break}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.__assign_has_screen_touch=function(){var e=this,t="__assign_has_screen_touch";try{this.__has_screen_touch=(this.__has_window_property("ontouchstart")||navigator.maxTouchPoints>0)&&!0;var i=function t(){e.__has_screen_touch=!0,window.removeEventListener("touchstart",t)};window.addEventListener("touchstart",i,!1)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__detect_html_audio_support=function(){var e="__detect_html_audio_support",t=null;try{var i=document.createElement("audio"),r=!(!i.canPlayType||!i.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,"")),s=!(!i.canPlayType||!i.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/,"")),n=!(!i.canPlayType||!i.canPlayType("audio/mpeg;").replace(/no/,""));r===!0?t="oga":s===!0?t="m4a":n===!0&&(t="mp3")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}finally{return t}},e}());var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Crisp.Action=new(function(){function e(){var e="constructor";try{this.ns="CrispAction",this._events=["session:loaded","chat:initiated","chat:opened","chat:closed","message:sent","message:received","message:compose:sent","message:compose:received","user:email:changed","user:phone:changed","user:nickname:changed","user:avatar:changed","website:availability:changed","helpdesk:queried"],this.__message_emit_delay_milliseconds=500,this.__verify_signature_regex=/^([a-f0-9]{64})$/,this.__event_register={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.do_chat_open=function(){Crisp.Chat._is_initialized===!0?Crisp.Chat.Interface._maximize():Crisp.Minimized.Interface._pane_open_handler()},e.prototype.do_chat_close=function(){Crisp.Chat._is_initialized===!0&&Crisp.Chat.Interface._minimize()},e.prototype.do_chat_toggle=function(){this.is_chat_closed()===!0?this.do_chat_open():this.do_chat_close()},e.prototype.do_chat_show=function(){this.is_chat_hidden()===!0&&null!==Crisp.Base._container_sel&&(Crisp.Base._container_sel.safe_css_text("display","block"),Crisp.Chat.Interface._apply_dynamic_sizing_properties())},e.prototype.do_chat_hide=function(){this.is_chat_visible()===!0&&null!==Crisp.Base._container_sel&&Crisp.Base._container_sel.safe_css_text("display","none")},e.prototype.do_helpdesk_search=function(){if(Crisp.Chat.Interface._spotlight()!==!0)throw new Error("Helpdesk search is unavailable");this.do_chat_show()},e.prototype.do_helpdesk_query=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Crisp.Base._ensure_socket(function(){Crisp.Library.crisp.client.Helpdesk.get_article_search(e,Crisp.Locale.code())})},e.prototype.do_message_send=function(e,t){var i=this;Crisp.Base._ensure_socket(function(){var r=i.__generate_message(e,t);if(null!==r.type&&null!==r.content){var s=Crisp.Chat.Message._trigger_will_send_hooks(),n=s===!0?i.__message_emit_delay_milliseconds:0;switch(r.type){case"text":Crisp.Library.crisp.client.Message.send_text_message(r.content,emit_delay_milliseconds=n);break;case"file":Crisp.Library.crisp.client.Message.send_file_message(r.content.name,r.content.url,r.content.type,emit_delay_milliseconds=n);break;case"animation":Crisp.Library.crisp.client.Message.send_animation_message(r.content.url,r.content.type,emit_delay_milliseconds=n);break;case"audio":Crisp.Library.crisp.client.Message.send_audio_message(r.content.url,r.content.type,r.content.duration,emit_delay_milliseconds=n);break;case"picker":Crisp.Library.crisp.client.Message.send_picker_message(r.content.id,r.content.text,r.content.choices,emit_delay_milliseconds=n);break;case"field":Crisp.Library.crisp.client.Message.send_field_message(r.content.id,r.content.text,r.content.explain,emit_delay_milliseconds=n)}Crisp.Chat._start_maximized()}})},e.prototype.do_message_show=function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Crisp.Base._ensure_socket(function(){var n=i.__generate_message(e,t);null!==n.type&&null!==n.content&&Crisp.Chat.Message._dispatch_local(n.type,n.content,r,s)})},e.prototype.do_message_read=function(){Crisp.Chat._is_initialized===!0&&Crisp.Library.crisp.client.Message.mark_messages_as_read()},e.prototype.do_session_reset=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Crisp.Base._update_socket_cookie_key(!1,!0),Crisp.Library.crisp.client.Storage.clear_stamp_local(),Crisp.Library.crisp.client.Session.clear(),e===!1?Crisp.Base._uninsert_client():document.location.reload(!1)},e.prototype.do_trigger_run=function(e){if(Crisp.Trigger._run(e)!==!0)throw new Error("Trigger does not exist")},e.prototype.is_chat_opened=function(){return!(Crisp.Chat.Interface._is_maximized!==!0||Crisp.Chat._is_initialized!==!0)},e.prototype.is_chat_closed=function(){return this.is_chat_opened()===!1&&!0},e.prototype.is_chat_visible=function(){return this.is_chat_hidden()===!1&&!0},e.prototype.is_chat_hidden=function(){return(null===Crisp.Base._container_sel||"none"===Crisp.Base._container_sel.css("display"))&&!0},e.prototype.is_chat_small=function(){return Crisp.Base._is_full_view()===!1&&!0},e.prototype.is_chat_large=function(){return this.is_chat_small()===!1&&!0},e.prototype.is_session_ongoing=function(){return(Crisp.Chat.Message._has_sent_messages===!0||Crisp.Chat.Message._has_received_messages===!0)&&!0},e.prototype.is_website_available=function(){return Crisp.Availability._users_available&&!0},e.prototype.get_chat_unread_count=function(){return Crisp.Chat.Notification._unread_count||0},e.prototype.get_message_text=function(){return Crisp.Chat._is_initialized===!0?Crisp.Chat.Selector.get("form_textarea_message").val()||"":""},e.prototype.get_session_identifier=function(){return Crisp.Broker._session_id||null},e.prototype.get_session_data=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Crisp.Library.crisp.client.Session.get_data(e)||null},e.prototype.get_user_email=function(){return Crisp.Library.crisp.client.Session.get_email()||null},e.prototype.get_user_phone=function(){return Crisp.Library.crisp.client.Session.get_phone()||null},e.prototype.get_user_nickname=function(){return Crisp.Library.crisp.client.Session.get_nickname()||null},e.prototype.get_user_avatar=function(){return Crisp.Library.crisp.client.Session.get_avatar()||null},e.prototype.get_user_company=function(){var e=Crisp.Library.crisp.client.Session.get_company()||null;return((e||{}).employment||{}).title&&(e.employment=[e.employment.title,e.employment.role]),((e||{}).geolocation||{}).country&&(e.geolocation=[e.geolocation.country,e.geolocation.city||null]),e},e.prototype.set_message_text=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof e)throw new Error("Invalid message text");var t=Crisp.Chat.Selector.get("form_textarea_message");t&&t.is(":disabled")!==!0&&(t.val(e),t.trigger("keypress"))},e.prototype.set_session_data=function(e,t){Crisp.Base._ensure_socket(function(){for(var i=e instanceof Array&&e[0]instanceof Array?e:[[e,t]],r={},s=0;s1&&void 0!==arguments[1]&&arguments[1];Crisp.Base._ensure_socket(function(){if(!e||Crisp.Validate.are_segments(e)!==!0)throw new Error("Invalid segments value");Crisp.Library.crisp.client.Session.set_segments(e,t)},!0)},e.prototype.set_session_event=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Crisp.Base._ensure_socket(function(){var r=e instanceof Array&&e[0]instanceof Array?e:[[e,t,i]];if(Crisp.Validate.are_events(r)!==!0)throw new Error("Invalid event text or data");Crisp.Library.crisp.client.Session.send_event(r);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||Crisp.Validate.is_email(e)!==!0)throw new Error("Invalid email");if(null!==t&&this.__verify_signature_regex.test(t)!==!0)throw new Error("Invalid verify signature (should be lowercase HMAC-SHA256)");Crisp.Library.crisp.client.Session.set_email(e,!1,t),this.__trigger_identity_set(),this._event("user:email:changed",e)},e.prototype.set_user_phone=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("number"==typeof e&&(e=""+e),!e||Crisp.Validate.is_phone(e)!==!0)throw new Error("Invalid phone");Crisp.Library.crisp.client.Session.set_phone(e),this.__trigger_identity_set(),this._event("user:phone:changed",e)},e.prototype.set_user_nickname=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof e||!e)throw new Error("Invalid nickname");Crisp.Library.crisp.client.Session.set_nickname(e),this._event("user:nickname:changed",e)},e.prototype.set_user_avatar=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e||Crisp.Validate.is_avatar(e)!==!0)throw new Error("Invalid avatar");Crisp.Library.crisp.client.Session.set_avatar(e),this._event("user:avatar:changed",e)},e.prototype.set_user_company=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)throw new Error("Invalid company name");var i=t?Crisp.Utility.clone(t):{};i.name=e,((t||{}).employment||[])[0]&&(i.employment={title:t.employment[0],role:t.employment[1]}),((t||{}).geolocation||[])[0]&&(i.geolocation={country:t.geolocation[0],city:t.geolocation[1]||null}),Crisp.Library.crisp.client.Session.set_company(i)},e.prototype.config_availability_tooltip=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Base._update_configuration("availability_tooltip",e)},e.prototype.config_hide_vacation=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Base._update_configuration("hide_vacation",e)},e.prototype.config_hide_on_away=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Base._update_configuration("hide_on_away",e)},e.prototype.config_hide_on_mobile=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Base._update_configuration("hide_on_mobile",e)},e.prototype.config_position_reverse=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Base._update_configuration("position_reverse",e)},e.prototype.config_sound_mute=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Crisp.Sound.mute(e)},e.prototype.config_color_theme=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Crisp.Base._insert_style({color:{theme:e}})},e.prototype.config_container_index=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Crisp.Base._insert_style({other:{container_index:e}})},e.prototype.config_show_operator_count=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];Crisp.Base._insert_style({other:{show_operator_count:e}})},e.prototype._on_event=function(e,t){if("function"!=typeof t)throw new Error("Handler must be a function");this.__event_register[e]=t},e.prototype._off_event=function(e){"undefined"!=typeof this.__event_register[e]&&delete this.__event_register[e]},e.prototype._event=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this._events.indexOf(e)===-1)throw new Error("Event namespace not recognized: "+e);if("function"==typeof this.__event_register[e])try{this.__event_register[e].apply(window,t instanceof Array?t:"undefined"!=typeof t?[t]:[])}catch(e){}},e.prototype._unstack_pending=function(){var e="_unstack_pending";try{var t=Crisp.Base._dollar_crisp.__spool.pending_actions;if(delete Crisp.Base._dollar_crisp.__spool.pending_actions,t&&t.length>0)for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:[];return this.__pipe_target("get",e,this.__args(t))},e.prototype.set=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.__pipe_target("set",e,this.__args(t))},e.prototype.is=function(e){return this.__pipe_target("is",e)},e.prototype.do=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.__pipe_target("do",e,this.__args(t))},e.prototype.on=function(e,t){return this.__pipe_event("on",e,[e,t])},e.prototype.off=function(e){return this.__pipe_event("off",e,[e])},e.prototype.config=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.__pipe_target("config",e,this.__args(t))},e.prototype.safe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if("boolean"!=typeof e)throw new Error("Safe mode value must be 'true' or 'false'.");this._safe_mode=e},e.prototype.help=function(){var e=[];for(var t in Crisp.Action)"_"!==t[0]&&"function"==typeof Crisp.Action[t]&&e.push("$crisp."+t.replace("_","('").replace(/_/g,":")+"')");for(var i=["on","off"],r=0;r2&&void 0!==arguments[2]?arguments[2]:[];try{var r=e+"_"+(t||"").replace(/:/g,"_");if("function"==typeof Crisp.Action[r])return Crisp.Action[r].apply(Crisp.Action,i);this.__namespace_error(t)}catch(e){if(this._safe_mode!==!0)throw e}},e.prototype.__pipe_event=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];try{var r="_"+e+"_event";if("function"!=typeof Crisp.Action[r])throw new Error("No such event method for action: "+e);if(Crisp.Action._events.indexOf(t)!==-1)return Crisp.Action[r].apply(Crisp.Action,i);this.__namespace_error(t)}catch(e){if(this._safe_mode!==!0)throw e}},e.prototype.__namespace_error=function(e){throw new Error("No such namespace: "+e+" - Call $crisp.help() for a list of available actions.")},e}()),Crisp.Validate=new(function(){function e(){var e="constructor";try{this.ns="CrispValidate",this.__segment_max_length=80,this.__email_regex=/^(([^\s@]+)@([^\s@]+)\.([^\s@]+))$/,this.__phone_regex=new RegExp(["^(?:(?:\\(?(?:00|\\+)([1-4]\\d\\d|[1-9]\\d?)\\)?)?","[\\-\\.\\ \\\\\\/]?)?((?:\\(?\\d{1,}\\)?[\\-\\.\\ \\\\\\/]?){0,})","(?:[\\-\\.\\ \\\\\\/]?(?:#|ext\\.?|extension|x)[\\-\\.\\ \\\\/]?","(\\d+))?$"].join(""),"i"),this.__avatar_regex=/^https?:\/\/(.+)$/,this.__data_key_regex=/^([A-Za-z0-9_\\-]+)$/}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.is_email=function(e){var t="is_email",i=!1;try{e.match(this.__email_regex)&&(i=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.is_phone=function(e){var t="is_phone",i=!1;try{e.match(this.__phone_regex)&&(i=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.is_avatar=function(e){ var t="is_avatar",i=!1;try{e.match(this.__avatar_regex)&&(i=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.is_data=function(e){var t="is_data",i=!1;try{if(e instanceof Object){i=Crisp.Utility.keys(e).length>0&&!0;for(var r in e){var s=e[r];("string"!=typeof r||this.__data_key_regex.test(r)!==!0||"string"!=typeof s&&"boolean"!=typeof s&&"number"!=typeof s)&&(i=!1)}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.are_events=function(e){var t="are_events",i=!1;try{if(e instanceof Array){i=e.length>0&&!0;for(var r=0;rthis.__segment_max_length||r.indexOf(n)!==-1){i=!1;break}r.push(n)}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Date=new(function(){function e(){var e="constructor";try{this.ns="CrispDate",this.__watch_interval=15,this.__days_map=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],this.__months_map=["january","february","march","april","may","june","july","august","september","october","november","december"],this.__second_in_milliseconds=1e3,this.__minutes_in_hour=60,this.__hours_in_day=24,this.__seconds_in_minute=60,this.__seconds_in_hour=this.__minutes_in_hour*this.__seconds_in_minute,this.__seconds_in_day=this.__hours_in_day*this.__seconds_in_hour}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.timestamp_to_iso=function(e){var t="timestamp_to_iso";try{return new Date(e).toISOString()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.iso_to_timestamp=function(e){var t="iso_to_timestamp";try{return new Date(e).getTime()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.timestamp_to_properties=function(e){var t="timestamp_to_properties",i={day:"none",month:"none",year:"none",title:null};try{if(e>0){var r=new Date(e),s=Crisp.Locale.text("days",this.__days_map[r.getDay()]),n=Crisp.Locale.text("months",this.__months_map[r.getMonth()]);i.day=""+r.getDate(),i.month=""+(r.getMonth()+1),i.year=""+r.getFullYear(),i.title=s+", "+r.getDate()+" "+n,(new Date).getYear()!==r.getYear()&&(i.title+=" ("+i.year+")")}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.seconds_in_timestamp=function(e){var t="seconds_in_timestamp",i=0;try{if(isNaN(e))throw new Error("Timestamp is not a number");i=Math.floor(parseInt(e,10)/this.__second_in_milliseconds)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.timestamp=function(){var e="timestamp";try{return(new Date).getTime()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.difference=function(e,t){var i="difference",r=-1;try{var s=this.iso_to_timestamp(e),n=this.iso_to_timestamp(t);r=s-n}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.equal=function(e,t){var i="equal",r=!1;try{r=0===this.difference(e,t)&&!0}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.format_time=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="format_time",r="0:00";try{if(e>=0){e=Math.round(e);var s=Math.floor(e/this.__seconds_in_hour),n=Math.floor(e%this.__seconds_in_hour/this.__seconds_in_minute),a=e%this.__seconds_in_minute%this.__seconds_in_hour;r=s>0||t===!0?s+":"+Crisp.Utility.pad_number(n,"00")+":"+Crisp.Utility.pad_number(a,"00"):n+":"+Crisp.Utility.pad_number(a,"00")}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.format_date=function(e){var t="format_date",i=null;try{var r=new Date,s=new Date(e),n=r.getTime()-s.getTime(),a=this.__render_select(n);a.type||(a.type="far_away",a.data={date_full:s.toLocaleDateString()});var o=Crisp.Library.dom(Crisp.Template.render("date_"+a.type,a.data));if(i=o.text(),!i)throw new Error("Empty parsed date for ISO string: "+e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.format_duration=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="format_duration",r=null;try{var s=this.__render_select(e,t);s.type||(s.type="days");var n=Crisp.Library.dom(Crisp.Template.render("duration_"+s.type,s.data));if(r=n.text(),!r)throw new Error("Empty parsed duration for duration: "+e)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.digest=function(){var e=this,t="digest";try{null!==Crisp.Base._container_sel&&Crisp.Base._container_sel.find('[data-date-iso][data-date-watch="true"]').each(function(t,i,r){var s=r.eq(i),n=s.attr("data-date-iso"),a=s.attr("data-date-format"),o=e.format_date(n);a&&(o=Crisp.Library.crisp.web.Parse.replace(a,[Crisp.Utility.lower_string_first(o)])),s.text(o)})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.watch=function(){var e=this,t="watch";try{setTimeout(function(){try{e.digest(),e.watch()}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":timeout",i)}},this.__watch_interval*this.__second_in_milliseconds)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__render_select=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="__render_select",r={};try{var s=Math.round(e/this.__second_in_milliseconds);s<10&&t===!0?r.type="now":s1&&void 0!==arguments[1]&&arguments[1],i="colors",r={};try{var s=void 0,n=void 0;s=t!==!0?Crisp.Plugin.get_customization("color","chatbox"):{},n=this.__available_colors[e]||this.__available_colors[this.__default_color],this.__filter_colors_map_with_defaults(s,n);for(var a in s)r[a]={hex:s[a],rgba:this.__generate_color_rgba.__crisp_bind(this,s[a])}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.__filter_colors_map_with_defaults=function(e,t){var i="__filter_colors_map_with_defaults";try{for(var r in t)e[r]||(e[r]=t[r])}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__generate_color_rgba=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i="__generate_color_rgba",r="rgba(0, 0, 0, 1)";try{var s=[0,0,0],n=e.match(this.__color_hex_regex);n&&(s[0]=parseInt(n[1],this.__color_hex_to_number_base),s[1]=parseInt(n[2],this.__color_hex_to_number_base),s[2]=parseInt(n[3],this.__color_hex_to_number_base)),r="rgba("+(s[0]+", ")+(s[1]+", ")+(s[2]+", ")+(""+t)+")"}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e}()),Crisp.Plugin=new(function(){function e(){var e="constructor";try{this.ns="CrispPlugin"}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.get_triggers=function(){var e="get_triggers",t={};try{t=((Crisp.Base._website_configuration.plugins["urn:crisp.im:triggers:0"]||{}).settings||{}).triggers||{}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}finally{return t}},e.prototype.get_customization=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r="get_customization",s=null;try{s=(((Crisp.Base._website_configuration.plugins["urn:crisp.im:customization:0"]||{}).settings||{})[e]||{})[t]||{},i&&(s=s[i]||null)}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e}()),Crisp.Sound=new(function(){function e(){var e="constructor";try{this.ns="CrispSound",this.__vibration_duration=200,this.__subsets={events:["chat-message-receive"],call:["call-established","call-hangup","call-ring"]},this.__is_playback_allowed=!0,this.__is_muted=!1,this.__audio_context=null,this.__last_audio=null,this.__last_subset=null,this.__last_name=null,this.__sounds={},this.__fetch_handlers={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.allow=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="allow";try{this.__is_playback_allowed=e}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.mute=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="mute";try{this.__is_muted=e}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.initialize=function(e){var t="initialize";try{if(this.__is_playback_allowed===!1)return;this.__sounds[e]=this.__sounds[e]||{};for(var i=this.__subsets[e],r=0;r2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,n="start";try{if(this.__is_playback_allowed===!1)return;if(Crisp.Feature.has_html_audio()===!0&&this.__can_play_now(e)===!0){var a=this.__subsets[e];if("undefined"==typeof a)throw new Error("Subset does not exist: "+e);if(a.indexOf(t)===-1)throw new Error("Sound does not exist: "+t+" in subset "+e);this.stop(),this.__fetch(e,t,function(n){if(null!==i.__audio_context){"suspended"===i.__audio_context.state&&i.__audio_context.resume();var a=i.__audio_context.createGain();a.gain.setValueAtTime(s/100,0),a.connect(i.__audio_context.destination),i.__last_audio=i.__audio_context.createBufferSource(),i.__last_audio.buffer=n,i.__last_audio.loop=r,i.__last_audio.connect(a),i.__last_audio.start(),i.__last_subset=e,i.__last_name=t}},function(e){})}}catch(e){Crisp.Library.logger.error(this.ns+"."+n,e)}},e.prototype.stop=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i="stop";try{null===this.__last_audio||null!==e&&e!==this.__last_subset||null!==t&&t!==this.__last_name||(this.__last_audio.stop(),this.__last_audio=null,this.__last_subset=null,this.__last_name=null)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__fetch=function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},n="__fetch";try{if(this.__sounds[e]=this.__sounds[e]||{},this.__fetch_handlers[e]=this.__fetch_handlers[e]||{},"undefined"==typeof this.__fetch_handlers[e][t])if(this.__fetch_handlers[e][t]={success:[r],error:[s]},"undefined"!=typeof this.__sounds[e][t])this.__handle_fetch("success",e,t,this.__sounds[e][t]);else{var a=this.__generate_sound_url(e,t);if(a){var o=new XMLHttpRequest;o.open("GET",a,!0),o.responseType="arraybuffer",o.onload=function(){null===i.__audio_context&&(i.__audio_context=i.__initiate_audio_context()),null!==i.__audio_context?i.__audio_context.decodeAudioData(o.response,function(r){i.__sounds[e][t]=r,i.__handle_fetch("success",e,t,r)},function(r){i.__handle_fetch("error",e,t,r)}):i.__handle_fetch("error",e,t)},o.onerror=function(r){i.__handle_fetch("error",e,t,r)},o.send()}}else this.__fetch_handlers[e][t].success.push(r),this.__fetch_handlers[e][t].error.push(s)}catch(e){Crisp.Library.logger.error(this.ns+"."+n,e)}},e.prototype.__handle_fetch=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=(this.__fetch_handlers[t]||{})[i];if("undefined"!=typeof s){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t="detect",i=this.__default_locale;try{var r=void 0,s=void 0,n=!1,a=[];for(e.length&&(this.__allowed_locales=Crisp.Utility.intersect(e,this.__available_locales),this.__allowed_locales.length>0&&this.__allowed_locales.indexOf(i)===-1&&(i=this.__default_locale=this.__allowed_locales[0])),r=0;r2&&void 0!==arguments[2]?arguments[2]:[],r="text",s=null;try{var n=void 0,a=void 0;if("object"===("undefined"==typeof t?"undefined":_typeof(t))?(n=t[0],a=t[1]):n=a=t,null===this.__data)throw new Error("Cannot get locale text, locale data not loaded");if("undefined"==typeof this.__data._strings[e])throw new Error("Locale text group not found: "+e);if("undefined"==typeof this.__data._strings[e][a])throw new Error("Locale text namespace not found in group: "+(a+" in "+e));s=Crisp.Plugin.get_customization("text",e,n)||this.__data._strings[e][a],s=Crisp.Library.crisp.web.Parse.replace(s,i),s=this.__convert_to_iso(s)}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e.prototype.__handle_locale_injection=function(e,t,i){var r="__handle_locale_injection",s=null;try{if(null!==this.__data)throw new Error("Locale has already been loaded (double requested handled?)");if("object"!==("undefined"==typeof t?"undefined":_typeof(t)))throw new Error("Did not receive a proper locale data file");if(t._meta.locale_code!==e)throw new Error("Received a mismatching locale code, expected: "+e);this.__data=t,"function"==typeof i&&i()}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e.prototype.__convert_to_iso=function(e){var t="__convert_to_iso",i=null;try{try{i=decodeURIComponent(escape(e))}catch(t){i=e}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Avatar=new(function(){function e(){var e="constructor";try{this.ns="CrispAvatar",this.__active_operators_maximum=3,this.__other_operators_maximum=99}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.url=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s="url",n="";try{n=r?r.substring(0,Crisp.Base._url_image.length)===Crisp.Base._url_image?r:Crisp.Base._url_image+"/process/thumbnail/?url="+encodeURIComponent(r)+("&width="+e+"&height="+e)+("&"+Crisp.Base._website_configuration.website.buster):Crisp.Base._url_image+"/avatar/"+t+"/"+((i||"default")+"/"+e+"/")+("?"+Crisp.Base._website_configuration.website.buster)}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}finally{return n}},e.prototype.active_operators=function(e,t){var i="active_operators",r=[];try{var s=t.website.active_operators;if(s.length>0)for(var n=0;nr&&(i=Math.min(this.__other_operators_maximum,e.website.count_operators-r))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}());var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Crisp.Template=new(function(){function e(){var e="constructor";try{this.ns="CrispTemplate"}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.render=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r="render",s="";try{if("function"!=typeof Crisp.Library.jade.client[e])throw new Error("No such template: "+e);if("object"!==("undefined"==typeof t?"undefined":_typeof(t)))throw new Error("Object argument is not an object");if(t._e=Crisp.Locale.text.__crisp_bind(Crisp.Locale),t._f=Crisp.Library.crisp.web.Parse.format.__crisp_bind(Crisp.Library.crisp.web.Parse),t._n=Crisp.Library.crisp.web.Name.parse_first_name.__crisp_bind(Crisp.Library.crisp.web.Name),t._a=Crisp.Avatar.url.__crisp_bind(Crisp.Avatar),Crisp.Utility.is_empty(i)===!1)for(var n in i)"undefined"==typeof t[n]&&(t[n]=i[n]);s=Crisp.Library.jade.client[e](t).trim()}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}finally{return s}},e}()),Crisp.Broker=new(function(){function e(){var e="constructor";try{this.ns="CrispBroker",this.__maximum_session_create_retry=1,this._default_session_configuration={chat:{country:null,locale:"en",theme:"default",theme_text:"default",theme_welcome:"default",tile:"default",allowed_pages:[],blocked_pages:[],blocked_locales:[],last_operator_face:!1,ongoing_operator_face:!0,activity_metrics:!0,operator_privacy:!1,availability_tooltip:!1,hide_vacation:!1,hide_on_away:!1,hide_on_mobile:!1,position_reverse:!1,email_visitors:!0,phone_visitors:!1,force_identify:!1,ignore_privacy:!1,visitor_compose:!0,file_transfer:!0,helpdesk_link:!0,status_health_dead:!0,wait_game:!0},website:{name:"",domain:"",mailer:"",buster:1,count_operators:0,active_operators:[],response_metrics:{},last_available:Crisp.Date.timestamp(),status:null,trial:!1},channels:{},plugins:{}},this._session_id=null,this._session_hash=null,this._socket_connected=!0,this._response_ids_spool={},this._fn_initialize={master:null,actions:[]},this.__newly_created_session=!1,this.__newly_joined_session=!0,this.__initialization_sequence_step=0,this.__initialization_sequence_done=!1,this.__initialization_sequence_stack=[],this.__count_session_create_retry=0}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(e,t,i,r,s,n,a,o,_,c,l,p,h,u){var d=!(arguments.length>14&&void 0!==arguments[14])||arguments[14],f="init";try{Crisp.Library.crisp.client.init({environment:e,url_relay_client:t,url_relay_stream:i,url_go:r,website_domain:s,website_id:n,token_id:a,cookie_expire:o,cookie_domain:_,useragent:c,timezone:l,capabilities:p,locales:h,runtime_configuration:u,connect_socket:d,platform_name:"crisp-client",platform_signature_key:"25/2z/2h/3e/33/34/2g/20/2i/1v/2t/24/24/3c/2s/22"}),Crisp.Base._configure_console_sink(),this.__event_socket_state(),this.__event_session_created(),this.__event_session_joined(),this.__event_session_state(),this.__event_session_error(),this.__event_session_request_initiate(),this.__event_session_request_purge(),this.__event_website_users_available(),this.__event_message_received(),this.__event_message_received_local(),this.__event_message_send(),this.__event_message_sent(),this.__event_message_compose_received(),this.__event_message_compose_send(),this.__event_message_acknowledge_pending(),this.__event_message_acknowledge_read_send(),this.__event_message_acknowledge_read_received(),this.__event_history_message_received(),this.__event_history_message_sent(),this.__event_call_request_initiate(),this.__event_call_action_stopped(),this.__event_call_peer_local_error(),this.__event_call_peer_remote_error(),this.__event_call_media_local_success(),this.__event_call_media_local_error(),this.__event_call_media_remote_success(),this.__event_browsing_request_initiate(),this.__event_browsing_assist_started(),this.__event_browsing_assist_stopped(),this.__event_browsing_assist_mouse(),this.__event_browsing_assist_scroll(),this.__event_browsing_assist_click(),this.__event_bucket_url_upload_generate(),this.__event_bucket_url_upload_generated(),this.__event_media_animation_list(),this.__event_media_animation_listed(),this.__event_helpdesk_article_search(),this.__event_helpdesk_article_searched(),this.__event_helpdesk_article_suggest(),this.__event_helpdesk_article_suggested(),this.__event_storage_sync_update(),this.__event_storage_sync_updated(),this.__event_trigger_fired(),this.__event_issue_report(),this.__event_window_history()}catch(e){Crisp.Library.logger.error(this.ns+"."+f,e)}},e.prototype.__event_socket_state=function(){var e=this,t="__event_socket_state";try{Crisp.Library.crisp.client.event.subscribe("socket:state",function(t,i){Crisp.Chat._is_initialized===!0&&i.connected!==e._socket_connected&&(e._socket_connected=i.connected||!1,Crisp.Chat.Interface._toggle_socket_state(e._socket_connected))})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__event_session_created=function(){var e=this,t="__event_session_created";try{Crisp.Library.crisp.client.event.subscribe("session:created",function(i,r){r.error?"invalid_website_id"===r.error&&Crisp.Locale.load(e._default_session_configuration.chat.locale,function(){Crisp.Base.spawn_client(e._default_session_configuration),Crisp.Minimized.init(can_launch=!0,is_initial=!1,is_unauthorized=!0)}):r.session_id?e.__newly_created_session=!0:Crisp.Library.logger.error(e.ns+"."+t+":event","Unrecognized session creation error")})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__event_session_joined=function(){var e=this,t="__event_session_joined";try{Crisp.Library.crisp.client.event.subscribe("session:joined",function(t,i){i.error?"invalid_session"===i.error&&++e.__count_session_create_retry<=e.__maximum_session_create_retry&&Crisp.Library.crisp.client.Session.clear(function(){Crisp.Library.crisp.client.Session.create()},function(){}):(e._session_id=i.session_id||null,e._session_hash=i.session_hash||null,i.socket===!1&&i.initiated!==!0&&Crisp.Base._update_socket_cookie_key(!0),e.__newly_joined_session===!0?(e.__newly_joined_session=!1,Crisp.Base._load_website_settings(i,function(e,t,i){i!==!0&&(Crisp.Base.spawn_client(e),Crisp.Library.crisp.client.Website.get_users_available())})):Crisp.Chat._is_initialized===!0&&Crisp.Chat.Message._synchronize())})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__event_session_state=function(){var e=this,t="__event_session_state";try{Crisp.Library.crisp.client.event.subscribe("session:state",function(t,i){if(1===e.__initialization_sequence_step&&(e.__initialization_sequence_step++,e.__initialization_sequence_done=!0),Crisp.Chat._is_initialized===!1){if(null!==e._fn_initialize.master){e._fn_initialize.master(Crisp.Utility.is_empty(i)?null:i);for(var r=0;r0;)this.__initialization_sequence_stack.shift()()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}()),Crisp.Availability=new(function(){function e(){var e="constructor";try{this.ns="CrispAvailability",this._users_available=!1,this._was_availability_online=!1}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.receive=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="receive";try{if(this._users_available=e,t===!0){var r=Crisp.Date.timestamp();Crisp.Base._website_configuration.website.last_available=r;var s=Crisp.Chat.Selector.get("header_status_type_away");s&&s.attr("data-date-iso",Crisp.Date.timestamp_to_iso(r)),Crisp.Date.digest()}Crisp.Action._event("website:availability:changed",this._users_available)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.apply=function(){var e="apply";try{var t=this._users_available===!0?"online":"away";null!==Crisp.Base._container_sel&&(Crisp.Base._container_sel.attr("data-availability",t),this._was_availability_online===!1&&"online"===t&&(this._was_availability_online=!0,Crisp.Base._container_sel.attr("data-was-availability-online","true")))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}()),Crisp.Event=new(function(){function e(){var e="constructor";try{this.ns="CrispEvent",this.__inactivity_timeout=12e5,this.__is_inactive=!1,this.__inactivity_timeout_wait=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(e){var t="init";try{this.__bind()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__bind=function(){var e="__bind";try{this.__bind_window_resize(),this.__bind_watch_activity()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_window_resize=function(){var e=this,t="__bind_window_resize";try{window.addEventListener("resize",function(){try{Crisp.Chat._is_initialized===!0?Crisp.Chat.Interface._apply_dynamic_sizing_properties():Crisp.Base._apply_sizing()}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":resize:self",i)}})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__bind_watch_activity=function(){var e="__bind_watch_activity";try{this.__become_active(),window.addEventListener("click",this.__become_active.__crisp_bind(this),!1),window.addEventListener("mousemove",this.__become_active.__crisp_bind(this),!1),window.addEventListener("keydown",this.__become_active.__crisp_bind(this),!1),window.addEventListener("focus",this.__become_active.__crisp_bind(this),!1),window.addEventListener("blur",this.__become_active.__crisp_bind(this),!1)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__become_active=function(){var e=this,t="__become_active";try{null!==this.__inactivity_timeout_wait&&clearTimeout(this.__inactivity_timeout_wait),this.__inactivity_timeout_wait=setTimeout(function(){e.__become_inactive()},this.__inactivity_timeout),this.__is_inactive===!0&&Crisp.Library.crisp.client.socket.connect(),this.__is_inactive=!1,Crisp.Library.crisp.client.Session.mark_active()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__become_inactive=function(){var e="__become_inactive";try{Crisp.Library.crisp.client.socket.connected===!0&&(this.__is_inactive=!0,Crisp.Library.crisp.client.socket.disconnect())}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}());var _slicedToArray=function(){function e(e,t){var i=[],r=!0,s=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){s=!0,n=e}finally{try{!r&&o.return&&o.return()}finally{if(s)throw n}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();Crisp.Trigger=new(function(){function e(){var e="constructor";try{this.ns="CrispTrigger",this.__second_in_milliseconds=1e3,this.__visit_duration_expire=18e5,this.__store_stamp_type="trigger",this.__store_stamp_processed="1",this.__event_leave_check_types=["page","url_parameter"],this._processed=[],this.__triggers=null,this.__readiness_ensured=!1,this.__event_mouse_inside=!1,this.__event_mouse_defer=null,this.__event_mouse_top_margin=10,this.__doable_events_register={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(e){var t="init";try{this.__triggers=e,this.__listen()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._run=function(e){var t="_run",i=!1;try{var r=(this.__triggers||{})[e];r&&r.enabled===!0&&(this.__actions(e,r),i=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype._do_event=function(e,t){var i="_do_event";try{for(var r=this.__doable_events_register[e]||[],s=0;s0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="__generate_settings_after",r=100;try{e===!0&&t.after&&t.after>0&&(r=t.after*this.__second_in_milliseconds)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.__event_delay=function(e,t,i,r){var s="__event_delay";try{if(r.after&&r.after>0){var n=!1;for(var a in i)if("delay"!==a&&i[a].enabled===!0){n=!0;break}n===!1&&this.__defer_proceed_actions(e,t,{enabled:!0,settings:r})}}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype.__event_leave=function(e,t,i,r){var s=this,n="__event_leave";try{for(var a=!0,o=0;o0&&document.addEventListener("click",function(a){try{if(a&&a.target&&"a"===(a.target.nodeName||"").toLowerCase())for(var o=0;o0&&this.__register_doable_event("user_data",function(n){n.key&&n.value&&r.points[n.key]===n.value&&s.__defer_proceed_actions(e,t,i.delay)})}catch(e){Crisp.Library.logger.error(this.ns+"."+n,e)}},e.prototype.__event_user_event=function(e,t,i,r){var s=this,n="__event_user_event";try{r.texts&&r.texts.length>0&&this.__register_doable_event("user_event",function(n){r.texts.indexOf(n.text)!==-1&&s.__defer_proceed_actions(e,t,i.delay)})}catch(e){Crisp.Library.logger.error(this.ns+"."+n,e)}},e.prototype.__action_message=function(e,t,i){var r="__action_message";try{if(i){var s=(i[Crisp.Locale.code()]||i.default||"").trim();if(s){var n=Crisp.Utility.to_hashcode("trigger/"+e),a=!1;this.__has_behavior(t,"show_as_website")===!0&&(a=!0),Crisp.Action.do_message_show("text",s,n,a)}}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__action_open=function(e,t,i){var r="__action_open";try{Crisp.Action.do_chat_open()}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__action_sound=function(e,t,i){var r="__action_sound";try{Crisp.Sound.start("events","chat-message-receive")}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__check_page_rules_matches=function(e){var t="__check_page_rules_matches",i=!1;try{var r=(e.page||{}).settings;r&&r.urls&&r.urls.length>0&&(i=Crisp.Utility.compare_page_rules(Crisp.Base._page_url,r.urls))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.__check_url_parameter_rules_matches=function(e){var t="__check_url_parameter_rules_matches",i=!1;try{var r=(e.url_parameter||{}).settings||{};if(Crisp.Utility.keys(r.parameters||{}).length>0){for(var s=document.location.search||"",n=s.slice(s.indexOf("?")+1).split("&"),a={},o=0;o2&&void 0!==arguments[2]?arguments[2]:{},s="__defer_proceed_actions",n=null;try{n=setTimeout(function(){i.__actions(e,t)},this.__generate_settings_after((r||{}).enabled,(r||{}).settings))}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}finally{return n}},e.prototype.__register_doable_event=function(e,t){var i="__register_doable_event";try{this.__doable_events_register[e]=this.__doable_events_register[e]||[],this.__doable_events_register[e].push(t)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__has_behavior=function(e,t){var i="__has_behavior",r=!1;try{((e.behaviors||{})[t]||{}).enabled===!0&&(r=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.__is_processed=function(e){var t="__is_processed",i=!1;try{if(i=this._processed.indexOf(e)!==-1&&!0,i!==!0){var r=Crisp.Library.crisp.client.Storage.get_stamp_local(this.__store_stamp_type,[Crisp.Base._website_id,"status",e]);i=r===this.__store_stamp_processed&&!0}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.__accept_platform=function(e,t){var i="__accept_platform",r=!0;try{((e.platforms||{})[t]||{}).enabled===!1&&(r=!1)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return r}},e.prototype.__process_visit=function(){var e="__process_visit";try{var t=this.__get_visit_store_namespace("last"),i=this.__get_visit_store_namespace("count"),r=parseInt(Crisp.Library.crisp.client.Storage.get_stamp_local(this.__store_stamp_type,t)||"0",10),s=parseInt(Crisp.Library.crisp.client.Storage.get_stamp_local(this.__store_stamp_type,i)||"0",10),n=Crisp.Date.timestamp();(isNaN(r)||isNaN(s)||s<=0||n-r>=this.__visit_duration_expire)&&(s+=1,r=n,Crisp.Library.crisp.client.Storage.set_stamp_local(this.__store_stamp_type,i,""+s)),Crisp.Library.crisp.client.Storage.set_stamp_local(this.__store_stamp_type,t,""+n)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__get_visit_store_namespace=function(e){var t="__get_visit_store_namespace",i=[];try{i=[Crisp.Base._website_id,"visit",e]}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}());var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};Crisp.Base=new(function(){function e(){var e="constructor";try{this.ns="CrispBase",this._client_sel=null,this._style_sel=null,this._container_sel=null,this.__full_view_width_threshold=560,this.__small_view_height_threshold=620,this.__large_view_height_threshold=740,this.__activity_outdated_after=6e5,this.__hasnt_socket_cookie_expires_after=6e5,this.__has_socket_cookie_expires_after=1728e5,this.__re_insert_delay=1e3,this.__issue_report_interval_limit=1e4,this.__toggle_config_namespace_regex=/_/g,this.__default_prelude_configuration={socket:!0,buster:1},this.__default_styles={other:{container_index:1e6,show_operator_count:!0}},this.__observer_options={childList:!0,attributes:!1,subtree:!1,characterData:!1},this.__domain_regex=/^(?:https?:[\/]*)?([^\/]+)(?:\/.*)?$/i,this._is_initialized=!1,this._website_configuration={},this._dollar_crisp=null,this._project_name=null,this._url_relay_client=null,this._url_relay_stream=null,this._url_settings=null,this._url_website=null,this._url_go=null,this._url_image=null,this._url_game=null,this._url_assets=null,this._rtc_ice=null,this._client_environment=null,this._client_revision=null,this._website_domain=null,this._website_id=null,this._token_id=null,this._cookie_expire=null,this._cookie_domain=null,this._page_url=null,this._page_domain=null,this._browser_useragent=null,this._browser_timezone=null,this._browser_capabilities=null,this._browser_locales=null,this._prelude_buster=1,this._prelude_socket_state=!0,this._is_blocked_page=!1,this._is_blocked_locale=!1,this._ready_trigger=null,this._runtime_configuration={},this.__issue_report_last_date=0,this.__re_insert_timeout=null,this.__style_overrides={color:{},other:{}},this.__observers={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i="init";try{this._is_initialized===!1&&(this._is_initialized=!0,this._dollar_crisp=t.dollar_crisp||null,this._project_name=t.project_name||null,this._url_relay_client=t.url_relay_client||null,this._url_relay_stream=t.url_relay_stream||null,this._url_settings=t.url_settings||null,this._url_website=t.url_website||null,this._url_go=t.url_go||null,this._url_image=t.url_image||null,this._url_game=t.url_game||null,this._url_assets=t.url_assets||null,this._rtc_ice=t.rtc_ice||null,this._client_environment=t.client_environment||null,this._client_revision=t.client_revision||null,this._website_domain=t.website_domain||null,this._website_id=t.website_id||null,this._token_id=t.token_id||null,this._cookie_expire=t.cookie_expire||null,this._cookie_domain=t.cookie_domain||null,this._page_url=t.page_url||null,this._page_domain=t.page_domain||null,this._browser_useragent=t.browser_useragent||null,this._browser_timezone=t.browser_timezone||null,this._browser_capabilities=t.browser_capabilities||null,this._browser_locales=t.browser_locales||null,this._ready_trigger=t.ready_trigger||null,this._runtime_configuration=t.runtime_configuration||{},Crisp.Polyfill.schedule_warn_incompatible(),this.__load_website_prelude(function(t){e._prelude_socket_state=t.socket,e._prelude_buster=t.buster||1;var i=document.cookie.indexOf(e.__socket_cookie_key(!0))===-1&&e._prelude_socket_state!==!1&&!0;i===!1&&e._runtime_configuration.lock_maximized===!0&&(i=!0),i===!1&&e._prelude_socket_state===!1&&document.cookie.indexOf(e.__socket_cookie_key(!1))!==-1&&(i=!0),i===!0?e.__run_launch():e.__run_static(),Crisp.Event.init()}))}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.spawn_client=function(e){var t="spawn_client";try{this.__unappend_client(),this._website_configuration=e,Crisp.Library.crisp.web.init({template:Crisp.Template,config:{url:{crisp_image:this._url_image},runtime:this._runtime_configuration}}),Crisp.Library.crisp.client.Config.set_ignore_privacy(this._website_configuration.chat.ignore_privacy),Crisp.Library.crisp.client.Config.set_visitor_compose(this._website_configuration.chat.visitor_compose),Crisp.Trigger.init(Crisp.Plugin.get_triggers());var i=this._process_blocked_states();this._client_sel=Crisp.Library.dom(Crisp.Template.render("client",{lang:Crisp.Locale.code(),direction:Crisp.Locale.direction(),blocked:i||!1,lock_maximized:this._runtime_configuration.lock_maximized||!1,last_operator_face:this._website_configuration.chat.last_operator_face===!0&&this._website_configuration.website.active_operators.length>0,availability_tooltip:this._website_configuration.chat.availability_tooltip,hide_vacation:this._website_configuration.chat.hide_vacation,hide_on_away:this._website_configuration.chat.hide_on_away,hide_on_mobile:this._website_configuration.chat.hide_on_mobile,position_reverse:this._website_configuration.chat.position_reverse,full_view:this._is_full_view(),small_view:this._is_small_view(),large_view:this._is_large_view()})),this._style_sel=this._client_sel.find(".crisp-1o7uamv"),this._container_sel=this._client_sel.find(".crisp-1rjpbb7"),this._insert_style(),this.__insert_client()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._apply_sizing=function(){var e="_apply_sizing";try{null!==this._container_sel&&(this._container_sel.attr("data-full-view",this._is_full_view()===!0?"true":"false"),this._container_sel.attr("data-small-view",this._is_small_view()===!0?"true":"false"),this._container_sel.attr("data-large-view",this._is_large_view()===!0?"true":"false"))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._is_full_view=function(){var e="_is_full_view";try{return this._runtime_configuration.lock_full_view===!0||(window.innerHeight=this.__large_view_height_threshold||window.innerWidth=this.__large_view_height_threshold}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._is_small_view=function(){var e="_is_small_view";try{return window.innerHeight0&&Crisp.Date.timestamp()-Crisp.Chat.Message._message_last_timestamp>=this.__activity_outdated_after}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._process_blocked_states=function(){var e="_process_blocked_states";try{var t=Crisp.Locale.code();return this._is_blocked_page=!(!(this._website_configuration.chat.allowed_pages.length>0)||Crisp.Utility.compare_page_rules(this._page_url,this._website_configuration.chat.allowed_pages)&&!0)||Crisp.Utility.compare_page_rules(this._page_url,this._website_configuration.chat.blocked_pages)&&!0,this._is_blocked_locale=this._website_configuration.chat.blocked_locales.indexOf(t)!==-1&&!0||!1,this._is_blocked()||!1}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._trigger_session_loaded=function(){var e="_trigger_session_loaded";try{if("function"==typeof this._ready_trigger)try{this._ready_trigger(),this._ready_trigger=null}catch(e){}Crisp.Action._unstack_pending(),Crisp.Action._event("session:loaded",Crisp.Broker._session_id)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._update_socket_cookie_key=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__update_socket_cookie_key";try{var r=this.__socket_cookie_key(e),s=void 0;if(t===!0)s=new Date(0);else{var n=e===!0?"hasnt":"has";s=new Date((new Date).getTime()+this["__"+n+"_socket_cookie_expires_after"])}document.cookie=r+"; expires="+s.toUTCString()+"; path=/;"}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._update_configuration=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="_update_configuration";try{if(_typeof((this._website_configuration.chat||{})[e])===("undefined"==typeof t?"undefined":_typeof(t))&&(this._website_configuration.chat[e]=t,null!==this._container_sel)){var r=e.replace(this.__toggle_config_namespace_regex,"-");this._container_sel.attr("data-"+r,t===!0?"true":"false")}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._insert_style=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="_insert_style";try{var i=this.__style_overrides;for(var r in e)if(e.hasOwnProperty(r)){i[r]=i[r]||{};var s=e[r];if(null!==s)for(var n in s)s.hasOwnProperty(n)&&(i[r][n]=s[n])}this._style_sel.empty(),this._style_sel.append(Crisp.Library.dom(Crisp.Template.render("style_color",{colors:Crisp.Theme.colors(i.color.theme||this._website_configuration.chat.theme,!!i.color.theme)}))),this._style_sel.append(Crisp.Library.dom(Crisp.Template.render("style_other",{container_index:"number"==typeof i.other.container_index?i.other.container_index:this.__default_styles.other.container_index,show_operator_count:"boolean"==typeof i.other.show_operator_count?i.other.show_operator_count:this.__default_styles.other.show_operator_count})));var a=Crisp.Plugin.get_customization("position","chatbox");Crisp.Utility.is_empty(a)||this._style_sel.append(Crisp.Library.dom(Crisp.Template.render("style_position",{position:a})))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._load_dependency=function(e,t,i){var r=this,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a="_load_dependency";try{var o=e+"_handler",_=document.createElement("script");if(_.type="text/javascript",_.async=1,s===!0){var c="window.$crisp.__spool."+o,l=t+"?callback="+encodeURIComponent(c);n&&(l+="&"+encodeURIComponent(n)),_.src=l}else _.src=[this._url_assets+"/static/javascripts/"+t,"?"+this._client_revision].join("");this._dollar_crisp.__spool[o]=function(e){_.parentNode.removeChild(_),delete r._dollar_crisp.__spool[o],"function"==typeof i&&i(e)};var p=document.getElementsByTagName("head");p&&p[0]&&p[0].appendChild(_)}catch(e){Crisp.Library.logger.error(this.ns+"."+a,e)}},e.prototype._load_website_settings=function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s="_load_website_settings";try{this._load_dependency("website",[this._url_settings+"/client/website/",encodeURIComponent(this._website_id)+"/"].join(""),function(r){var s=!(r&&!r.error);r=r||{},r.settings=r.settings||{};var n={website:{name:r.website||"",domain:Crisp.Utility.extract(i.__domain_regex,r.domain,i._website_domain,1),mailer:r.mailer||"",buster:e.buster||1,count_operators:e.count_operators||0,active_operators:e.active_operators||r.operators||[],response_metrics:e.response_metrics||{},last_available:e.last_available||Crisp.Date.timestamp(),status:e.status||null,trial:r.trial||!1},channels:r.channels||{},plugins:r.plugins||{},chat:{country:Crisp.Utility.get_or_fallback((e.context||{}).country,null),locale:Crisp.Locale.detect(r.settings.locale?[r.settings.locale]:[]),theme:Crisp.Utility.get_or_fallback(r.settings.color_theme,"default"),allowed_pages:Crisp.Utility.get_or_fallback(r.settings.allowed_pages,[]),blocked_pages:Crisp.Utility.get_or_fallback(r.settings.blocked_pages,[]),blocked_locales:Crisp.Utility.get_or_fallback(r.settings.blocked_locales,[]),tile:Crisp.Utility.get_or_fallback(r.settings.tile,"default","string"),last_operator_face:Crisp.Utility.get_or_fallback(r.settings.last_operator_face,!1,"boolean"),ongoing_operator_face:Crisp.Utility.get_or_fallback(r.settings.ongoing_operator_face,!0,"boolean"),activity_metrics:Crisp.Utility.get_or_fallback(r.settings.activity_metrics,!0,"boolean"),operator_privacy:Crisp.Utility.get_or_fallback(r.settings.operator_privacy,!1,"boolean"),availability_tooltip:Crisp.Utility.get_or_fallback(r.settings.availability_tooltip,!0,"boolean"),hide_vacation:Crisp.Utility.get_or_fallback(r.settings.hide_vacation,!1,"boolean"),hide_on_away:Crisp.Utility.get_or_fallback(r.settings.hide_on_away,!1,"boolean"),hide_on_mobile:Crisp.Utility.get_or_fallback(r.settings.hide_on_mobile,!1,"boolean"),position_reverse:Crisp.Utility.get_or_fallback(r.settings.position_reverse,!1,"boolean"),email_visitors:Crisp.Utility.get_or_fallback(r.settings.email_visitors,!0,"boolean"),phone_visitors:Crisp.Utility.get_or_fallback(r.settings.phone_visitors,!0,"boolean"),force_identify:Crisp.Utility.get_or_fallback(r.settings.force_identify,!1,"boolean"),ignore_privacy:Crisp.Utility.get_or_fallback(r.settings.ignore_privacy,!1,"boolean"),visitor_compose:Crisp.Utility.get_or_fallback(r.settings.visitor_compose,!0,"boolean"),file_transfer:Crisp.Utility.get_or_fallback(r.settings.file_transfer,!0,"boolean"),helpdesk_link:Crisp.Utility.get_or_fallback(r.settings.helpdesk_link,!0,"boolean"),status_health_dead:Crisp.Utility.get_or_fallback(r.settings.status_health_dead,!0,"boolean"),wait_game:Crisp.Utility.get_or_fallback(r.settings.wait_game,!1,"boolean"),theme_text:Crisp.Utility.get_or_fallback(r.settings.text_theme,"default"),theme_welcome:Crisp.Utility.get_or_fallback(r.settings.welcome_message,"default")}};Crisp.Locale.load(n.chat.locale,function(){t(n,r,s)})},!0,r||e.buster)}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype._ensure_socket=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Crisp.Library.crisp.client.socket.connected===!0?e():this._prelude_socket_state!==!1&&(Crisp.Broker._fn_initialize.actions.push(e),null===Crisp.Broker._fn_initialize.master&&(Crisp.Broker._fn_initialize.master=function(){t===!0&&Crisp.Minimized.init(can_launch=!0,is_initial=!1,is_unauthorized=!1,do_animate=!1)}),Crisp.Library.crisp.client.socket.connect())},e.prototype._configure_console_sink=function(){var e=this,t="_configure_console_sink";try{"production"===this._client_environment&&(Crisp.Library.crisp.client.Issue.configure({project:this._project_name,revision:this._client_revision,environment:this._client_environment,useragent:this._browser_useragent,page:this._page_url}),Crisp.Library.logger.set_log_sink(function(t,i,r){if("error"===t){e._dollar_crisp.__spool.error_last={ns:i,value:r};var s=Crisp.Date.timestamp();s-e.__issue_report_last_date>=e.__issue_report_interval_limit&&(e.__issue_report_last_date=s,Crisp.Library.crisp.client.Issue.report(t,i,r))}}))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._uninsert_client=function(){var e="_uninsert_client";try{"MutationObserver"in window&&(this.__unbind_observer("html"),this.__unbind_observer("body")),Crisp.Library.crisp.client.socket.disconnect(),this.__unappend_client()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__load_website_prelude=function(e){var t=this,i="__load_website_prelude";try{var r=new Date,s=r.getFullYear()+"-"+r.getMonth()+"-"+r.getDate()+"-"+(r.getHours()+"-"+r.getMinutes());this._load_dependency("website",[this._url_settings+"/client/website/",encodeURIComponent(this._website_id)+"/prelude/"].join(""),function(i){e(!i||i.error?t.__default_prelude_configuration:i)},!0,s)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__insert_client=function(){var e="__insert_client";try{this.__append_client(),"MutationObserver"in window&&(this.__bind_observer_html(document.documentElement),this.__bind_observer_body(document.body))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__append_client=function(){var e="__append_client";try{var t=Crisp.Library.dom("body")||[];t.length>0&&t.append(this._client_sel)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__unappend_client=function(){var e="__unappend_client";try{null!==this._client_sel&&(this._client_sel.remove(),this._client_sel=null)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__run_launch=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,"__run_launch");try{this.__setup_broker(!0)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__run_static=function(){var e=this,t="__run_static";try{this.__setup_broker(!1),this._load_website_settings({},function(t,i,r){r!==!0&&Crisp.Availability.receive(i.online||!1,!1),e.spawn_client(t),Crisp.Minimized.init(!1,!1,r),e._trigger_session_loaded()},this._prelude_buster)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__setup_broker=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="__setup_broker";try{Crisp.Broker.init(this._client_environment,this._url_relay_client,this._url_relay_stream,this._url_go,this._website_domain,this._website_id,this._token_id,this._cookie_expire,this._cookie_domain,this._browser_useragent,this._browser_timezone,this._browser_capabilities,this._browser_locales,this._runtime_configuration,e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__bind_observer_html=function(e){var t=this,i="__bind_observer_html";try{this.__unbind_observer("html"),this.__observers.html=new MutationObserver(function(e){for(var i=0;i<(e||[]).length;i++){var r=e[i];if("childList"===r.type&&r.addedNodes)for(var s=0;s0&&void 0!==arguments[0])||arguments[0],t="__socket_cookie_key",i=null;try{i=encodeURIComponent("crisp-client/socket/"+this._website_id)+"="+encodeURIComponent(e===!0?"0":"1")}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Minimized=new(function(){function e(){var e="constructor";try{this.ns="CrispMinimized",this._is_initialized=!1}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s="init";try{this.__initialize_children(),this.__launch(t=t,i=i,e=e,r=r),this._is_initialized=!0}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype.__initialize_children=function(){var e="__initialize_children";try{var t=void 0,i=[Crisp.Minimized.Interface,Crisp.Minimized.Selector,Crisp.Minimized.Event];for(t=0;t0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s="__launch";try{t!==!0?Crisp.Minimized.Interface._pane_authorized(e=e,i=i,r=r):Crisp.Minimized.Interface._pane_unauthorized(e=e,r=r),Crisp.Base._runtime_configuration.lock_maximized===!0&&Crisp.Minimized.Interface._pane_open_handler()}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e}()),Crisp.Minimized.Event=new(function(){function e(){var e="constructor";try{this.ns="CrispMinimizedEvent"}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._pane_click=function(e){var t=this,i="_pane_click";try{Crisp.Minimized.Selector._minimized_sel.on("click",function(e){try{var r=e.target?Crisp.Library.dom(e.target):null,s=".crisp-bz13r8",n=r?r.attr("data-pop"):null;if(r&&!n){var a=r.parents("[data-pop]");a&&a[0]&&(n=a.attr("data-pop")||null)}n?"spotlight"===n&&Crisp.Action.do_helpdesk_search():r&&r.is(s)?Crisp.Minimized.Interface._conceal_general_entice():Crisp.Minimized.Interface._pane_open_handler()}catch(e){Crisp.Library.logger.error(t.ns+"."+i,e)}finally{return!1}}),Crisp.Minimized.Selector._minimized_sel[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e}()),Crisp.Minimized.Interface=new(function(){function e(){var e="constructor";try{this.ns="CrispMinimizedInterface",this.__second_in_milliseconds=1e3,this.__tooltip_short_show_delay=.25,this.__tooltip_full_show_delay=2,this.__animate_initial_pane_timeout=1e3,this.__animate_general_entice_tooltip_timeout=500,this.__pane_open_connect_timeout=12e3,this.__entice_stamp_type="minimized",this.__entice_stamp_concealed="1",this._pane_open_handler=function(){}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{this.__launch()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._pane_authorized=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s="_pane_authorized";try{var n=!1,a={conceal_general_entice:!1,helpdesk:{url:null}};Crisp.Base._website_configuration.chat.availability_tooltip===!0&&(a.conceal_general_entice=Crisp.Library.crisp.client.Storage.get_stamp_local(this.__entice_stamp_type,[Crisp.Base._website_id,"general_entice","conceal"])===this.__entice_stamp_concealed&&!0),Crisp.Base._website_configuration.chat.helpdesk_link===!0&&Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Base._page_domain!==Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Library.crisp.client.socket.connected===!0&&(a.helpdesk.url=Crisp.Chat.Interface._generate_channel_link("helpdesk")),this.__spawn_pane("minimized_authorized",is_clickable=!0,e=e,r=r,params=a),this._pane_open_handler=function(){if(n===!1)if(n=!0,i===!1){t.__toggle_pane_wait(!0);var e=setTimeout(function(){Crisp.Broker._session_id||(alert(Crisp.Locale.text("chat","minimized_connect_alert_failure")),Crisp.Library.crisp.client.socket.disconnect(),t.__toggle_pane_wait(!1),Crisp.Action.do_chat_hide())},t.__pane_open_connect_timeout);Crisp.Broker._fn_initialize.master=function(t){clearTimeout(e),Crisp.Chat.init(t=t)},Crisp.Library.crisp.client.socket.connect()}else Crisp.Chat.init()},Crisp.Availability.apply(),Crisp.Minimized.Event._pane_click()}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype._pane_unauthorized=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="_pane_unauthorized";try{this.__spawn_pane("minimized_unauthorized",is_clickable=!1,e=e,t=t),this._pane_open_handler=function(){},Crisp.Minimized.Event._pane_click()}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._conceal_general_entice=function(){var e="_conceal_general_entice";try{var t=Crisp.Minimized.Selector._tooltips_sel.find([".crisp-1xaupiq",'[data-id="general_entice"]'].join(""));t&&t.attr("data-is-concealed","true"),Crisp.Library.crisp.client.Storage.set_stamp_local(this.__entice_stamp_type,[Crisp.Base._website_id,"general_entice","conceal"],this.__entice_stamp_concealed)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__spawn_pane=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this,s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a="__spawn_pane";try{var o={configuration:Crisp.Base._website_configuration,methods:{active_operators:Crisp.Avatar.active_operators.__crisp_bind(Crisp.Avatar)},website:{id:Crisp.Base._website_id}};for(var _ in n)o[_]=n[_];if(Crisp.Minimized.Selector._excerpt_sel=Crisp.Library.dom(Crisp.Template.render(e,o)),Crisp.Base._container_sel.empty(),Crisp.Base._container_sel.append(Crisp.Minimized.Selector._excerpt_sel),Crisp.Minimized.Selector._bind(),t===!0){var c=Crisp.Minimized.Selector._tooltips_sel.find([".crisp-1xaupiq",'[data-id="general_entice"]'].join(""));if(s===!0&&Crisp.Feature.has_css_animations()){if(i===!0){var l="crisp-oi3b9v";Crisp.Minimized.Selector._minimized_sel.addClass(l),setTimeout(function(){Crisp.Minimized.Selector._minimized_sel.removeClass(l)},this.__animate_initial_pane_timeout)}if(Crisp.Base._is_full_view()!==!0){var p=i===!0?"full":"short";setTimeout(function(){c.safe_css_text("display","block");var e="full"===p?"crisp-161sdx3":"crisp-ge53v6";c.addClass(e),setTimeout(function(){c.removeClass(e)},r.__animate_general_entice_tooltip_timeout)},this["__tooltip_"+p+"_show_delay"]*this.__second_in_milliseconds)}}else Crisp.Base._is_full_view()!==!0&&c.safe_css_text("display","block")}}catch(e){Crisp.Library.logger.error(this.ns+"."+a,e)}},e.prototype.__toggle_pane_wait=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="__toggle_pane_wait";try{var i=e===!0?"none":"block",r=e===!0?"block":"none";Crisp.Minimized.Selector._minimized_sel.find(".crisp-101bp3x").safe_css_text("display",i),Crisp.Minimized.Selector._minimized_sel.find(".crisp-1t2kwsy").safe_css_text("display",r)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__launch=function(){var e="__launch";try{Crisp.Library.crisp.client.Message.get_message_history()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}())(Crisp),Crisp.Minimized.Selector=new(function(){function e(){var e="constructor";try{this.ns="CrispMinimizedSelector",this._excerpt_sel=null,this._minimized_sel=null,this._tooltips_sel=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._bind=function(){var e="_bind";try{this.__bind_main(),this.__bind_tooltips()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_main=function(){var e="__bind_main";try{this._minimized_sel=this._excerpt_sel.find(".crisp-kquevr")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_tooltips=function(){var e="__bind_tooltips";try{this._tooltips_sel=this._minimized_sel.find(".crisp-1059tj2")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}()),Crisp.Chat=new(function(){function e(){var e="constructor";try{this.ns="CrispChat",this._is_initialized=!1}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="init";try{this.__initialize_children(),null!==e&&Crisp.Chat.State._restore(e),null===e&&Crisp.Action._event("chat:initiated"),this.__launch(),Crisp.Base._update_socket_cookie_key(!1),this._is_initialized=!0}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._start_minimized=function(){var e="_start_minimized";try{this.__start_state(!1)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._start_maximized=function(){var e="_start_maximized";try{this.__start_state(!0)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__start_state=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="__start_state";try{this._is_initialized!==!0&&(this.init({maximized:e}),Crisp.Chat.State.propagate("maximized",e,force=!0))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__initialize_children=function(){var e="__initialize_children";try{var t=void 0,i=[Crisp.Chat.Alert,Crisp.Chat.Intent,Crisp.Chat.Field,Crisp.Chat.Interface,Crisp.Chat.Message,Crisp.Chat.Misc,Crisp.Chat.Notification,Crisp.Chat.Scroll,Crisp.Chat.State,Crisp.Chat.Selector,Crisp.Chat.Event,Crisp.Chat.Viewport];for(t=0;t1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="_update";try{if(this.__intents.indexOf(e)===-1)throw new Error("Unknown intent: "+e);if(i===!0||this._states[e]!==!1){var s=Crisp.Utility.clone(this._states);t||t===!1?s[e]=t:delete s[e],Crisp.Chat.State.propagate("intent",s)}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._cleanup=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="_cleanup";try{var i=void 0,r=void 0;for(i=0;i1&&void 0!==arguments[1]?arguments[1]:"default",i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r="_toggle";try{this.__intents.indexOf(e)!==-1&&this["__toggle_"+e](t,i)}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__toggle_identity=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="__toggle_identity";try{e?"default"===e?Crisp.Chat.Message._show_identity(t):Crisp.Chat.Message._show_identity_field(e,t):Crisp.Chat.Message._hide_identity()}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__toggle_game=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="__toggle_game";try{e?Crisp.Chat.Message._show_game(t):Crisp.Chat.Message._hide_game()}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e}()),Crisp.Chat.Picker=new(function(){function e(){var e="constructor";try{this.ns="CrispChatPicker",this.__items_gif_maximum=10,this.__visible=null,this.__last_search_query=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._is_open=function(){var e="_is_open",t=!1;try{t=null!==this.__visible&&!0}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}finally{return t}},e.prototype._toggle=function(e){var t="_toggle";try{var i=Crisp.Chat.Selector.get("pickers").find([".crisp-ex82av",'[data-type="'+e+'"]'].join(""));if(i.length>0){var r=this._is_open();this._reset(),Crisp.Chat.Selector.get("pickers").attr("data-has-animation",r===!1?"true":"false"),this.__show(e,i),Crisp.Chat.Field._focus_on_foreground()}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._reset=function(){var e="_reset";try{this.__last_search_query=null,null!==this.__visible&&(Crisp.Chat.Selector.get("pickers_inner_one").safe_css_text("display","none"),Crisp.Chat.Selector.get("content").removeAttr("data-has-picker-"+this.__visible),Crisp.Chat.Selector.get("pickers_selector_one").removeClass("crisp-ws3gf1"),Crisp.Chat.Selector.get("pickers_selector_one").addClass("crisp-1jrqqbm"),Crisp.Library.dom([".crisp-vsw3z4",'[data-removable="true"]'].join("")).remove(),this.__visible=null)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._load_data_gif=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="_load_data_gif";try{if(null!==Crisp.Chat.Event._search_defer_timeout&&(clearTimeout(Crisp.Chat.Event._search_defer_timeout),Crisp.Chat.Event._search_defer_timeout=null),this.__last_search_query!==e){this.__last_search_query=e;var i=Crisp.Chat.Selector.get("pickers_gif").find(".crisp-jjpxo8"),r=Crisp.Chat.Selector.get("pickers_gif").find(".crisp-19d061p"),s=Crisp.Template.render("chat_picker_gif_item");i.empty(),r.safe_css_text("display","none"),i.safe_css_text("display","block"),Crisp.Chat.Selector.get("pickers_gif").attr("data-has-search",e?"true":"false"),Crisp.Chat.Selector.get("pickers_search_input").val()!==e&&Crisp.Chat.Selector.get("pickers_search_input").val(e||"");for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],t="_handle_data_gif";try{var i=Crisp.Chat.Selector.get("pickers_gif").find(".crisp-vsw3z4"),r=0;i&&i.length>0&&(i.each(function(t,i,s){var n=s.eq(i);e[i]&&e[i].type&&e[i].url?(n.attr("data-type",e[i].type),n.attr("data-url",e[i].url),n.safe_css_text("background-image","url('"+Crisp.Base._url_image+"/process/original/"+("?url="+encodeURIComponent(e[i].url)+"')")),n.removeAttr("data-loading"),r++):n.remove()}),0===r&&(Crisp.Chat.Selector.get("pickers_gif").find(".crisp-jjpxo8").safe_css_text("display","none"),Crisp.Chat.Selector.get("pickers_gif").find(".crisp-19d061p").safe_css_text("display","block")))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__show=function(e,t){var i="__show";try{t.safe_css_text("display","block"),Crisp.Chat.Selector.get("content").attr("data-has-picker-"+e,"true");var r=Crisp.Chat.Selector.get("pickers").find([".crisp-19foly0",'[data-type="'+e+'"]'].join(""));r.removeClass("crisp-1jrqqbm"),r.addClass("crisp-ws3gf1"),this.__visible=e;var s=this["__trigger_show_"+e];"function"==typeof s&&s.__crisp_bind(this)()}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__trigger_show_gif=function(){ var e="__trigger_show_gif";try{this._load_data_gif()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}()),Crisp.Chat.Event=new(function(){function e(){var e="constructor";try{this.ns="CrispChatEvent",this.__textarea_height_safety_margin=120,this.__scroll_propagate_defer_wait=500,this.__gif_search_defer_wait=500,this.__spotlight_debounce_delay=100,this.__spotlight_suggest_min_length=2,this.__textarea_propagate_defer_wait=1e3,this.__textarea_change_multiplier_gap=.2,this.__file_name_default="File",this.__file_type_default="application/octet-stream",this.__file_send_delay=2e3,this.__file_change_stack=[],this._search_defer_timeout=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._bind=function(){var e="_bind";try{this.__chat_click_fuzzy(),this.__chat_pane_minimize(),this.__chat_pane_toggle(),this.__chat_flow_scroll(),this.__channels_click(),this.__pickers_click(),this.__picker_smiley(),this.__picker_gif(),this.__alert_warn_reply(),this.__alert_email_invalid(),this.__textarea_submit(),this.__textarea_change(),this.__file_drop(),this.__file_paste(),this.__file_submit(),this.__file_change(),this.__page_scroll(),this.__page_change()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._message_actions_common=function(e){var t="_message_actions_common";try{if(Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Base._page_domain!==Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Feature.has_screen_touch()!==!0){var i=Crisp.Utility.acquire_channel_url_regex("helpdesk","article","([^/]+)/article/([^/]+)/.*");if(null!==i){var r=e.find("a[href]")||[];r.length>0&&r.each(function(e){var t=e.getAttribute("href");if(t){var r=t.match(i);r&&r[1]&&r[2]&&(e.onclick=function(){return Crisp.Chat.Interface._article(r[1],r[2]),!1})}})}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._message_actions_welcome_helpdesk=function(e){var t="_message_actions_welcome_helpdesk";try{var i=e.find('.crisp-69413k[data-target="helpdesk"]')||[];i.length>0&&i.each(function(e){e.onclick=function(){return Crisp.Action.do_helpdesk_search(),!1}})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._message_actions_text=function(e){var t=this,i="_message_actions_file";try{var r=e.find('.crisp-69413k[data-type="embed"], .crisp-l8xfsa')||[];if(r.length>0){r.on("click",function(){try{Crisp.Chat.Interface._magnify("embed",r.attr("href"))}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return!1}}),this.__touch_as_click(r);for(var s=0;s0&&(r.on("click",function(){try{Crisp.Chat.Interface._magnify("file",r.attr("href"),r.attr("data-name"),e.attr("data-fingerprint"))}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return!1}}),this.__touch_as_click(r),r[0].onclick=function(){return!1})}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._message_actions_audio=function(e,t){var i=this,r="_message_actions_audio";try{var s=e.find(".crisp-1xzy2f3")||[],n=e.find(".crisp-fn1uvp")||[],a=e.find(".crisp-1d99ccw")||[],o=e.find(".crisp-wfghsc")||[],_=e.find(".crisp-16zfdx")||[];o.length>0&&(s.length>0&&(o[0].addEventListener("play",function(){s.attr("data-state","loading")}),o[0].addEventListener("pause",function(){s.attr("data-state","paused")}),o[0].addEventListener("canplay",function(){s.attr("data-state","playing")}),o[0].addEventListener("stalled",function(){s.attr("data-state","none")})),_.length>0&&a.length>0&&o[0].addEventListener("timeupdate",function(e){if(e.target){var i=Math.ceil(e.target.currentTime/e.target.duration*100),r=i<100?i:0,s=0===r?t.content.duration||0:Math.floor(e.target.currentTime);a.text(Crisp.Date.format_time(s)),_.safe_css_text("width",r+"%")}})),n.length>0&&(n.on("click",function(){try{o.length>0&&(o[0].paused?Crisp.Utility.play_media(o[0]):o[0].pause())}catch(e){Crisp.Library.logger.error(i.ns+"."+r+":click",e)}finally{return!1}}),this.__touch_as_click(n),n[0].onclick=function(){return!1})}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._message_actions_picker=function(e,t,i){var r=this,s="_message_actions_picker";try{var n=e.find(".crisp-1l7cjwq")||[];if(n.length>0){n.on("click",function(n){try{if(n.stopPropagation(),"from"===t){var a=n.target?Crisp.Library.dom(n.target):null;if(a){for(var o=a.attr("data-value"),_=!1,c=null,l=0;l0&&n.length>0){var o=function(){var e=n.val().trim();e&&(t.content.value=e,"function"==typeof t.content.handler?t.content.handler(e):Crisp.Library.crisp.client.Message.update_message(t.fingerprint,t.content))};s.on("submit",function(){try{o()}catch(e){Crisp.Library.logger.error(i.ns+"."+r+":submit",e)}finally{return!1}}),a.on("click",function(e){try{e.stopPropagation(),o()}catch(e){Crisp.Library.logger.error(i.ns+"."+r+":click",e)}finally{return!1}}),this.__touch_as_click(a),s[0].onsubmit=function(){return!1},a[0].onclick=function(){return!1}}if(t.content.previous){var _=e.find(".crisp-fa9drr")||[];if(_.length>0){_.on("click",function(e){try{e.stopPropagation(),Crisp.Chat.Intent._update(t.content.previous)}catch(e){Crisp.Library.logger.error(i.ns+"."+r+":click",e)}finally{return!1}}),this.__touch_as_click(_);for(var c=0;c<_.length;c++)_[c].onclick=function(){return!1}}}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._message_actions_sent=function(e,t){var i=this,r="_message_actions_sent";try{var s=e.find(".crisp-1kmmu74");s.on("click",function(s){try{s.stopPropagation(),Crisp.Broker._socket_connected===!0&&(Crisp.Chat.Message._remove(e),Crisp.Action.do_message_send(t.type,t.content))}catch(e){Crisp.Library.logger.error(i.ns+"."+r+":click",e)}finally{return!1}}),this.__touch_as_click(s),s[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._game_actions=function(e){var t=this,i="_game_actions";try{var r=e.find(".crisp-1fun30a"),s=e.find(".crisp-1mma1jj");r.on("load",function(){try{e.attr("data-loaded","true")}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":load",e)}}),s.on("click",function(){try{Crisp.Chat.Game.stop()}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return!1}}),this.__touch_as_click(s),s[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._article_actions=function(e){var t=this,i="_article_actions";try{var r=e.find(".crisp-vlpcuq");r.on("load",function(s){try{e.attr("data-state","loaded"),setTimeout(function(){r[0].focus()},0)}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":load",e)}}),e[0].onclick=function(r){var s=!0;try{var n=r.target?Crisp.Library.dom(r.target):null;n&&(n.is(".crisp-3vy3u9")||n.is(".crisp-1qkb7mn")||n.is(".crisp-17po6l6"))&&(s=!1,e.remove(),Crisp.Chat.Field._focus_on_foreground())}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return s}},this.__touch_as_click(e)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._spotlight_actions=function(e){var t=this,i="_spotlight_actions";try{var r="",s=null,n=e.find(".crisp-f2mp3n"),a=function(){e.remove(),Crisp.Chat.Interface._spotlight_current_sel=null,Crisp.Chat.Field._focus_on_foreground()};n.on("keyup",function(n){try{var a=(n.target.value||"").trim();a!==r&&(null!==s&&(clearTimeout(s),s=null),a?(e.attr("data-state","loading"),s=setTimeout(function(){if(s=null,r=a,Crisp.Action.do_helpdesk_query(a),a){var e=a.substring(a.lastIndexOf(" ")+1).trim();e&&e.length>=t.__spotlight_suggest_min_length&&Crisp.Library.crisp.client.Helpdesk.get_article_suggest(e,Crisp.Locale.code())}},t.__spotlight_debounce_delay)):(delete Crisp.Broker._response_ids_spool.helpdesk_article_search,delete Crisp.Broker._response_ids_spool.helpdesk_article_suggest,r="",Crisp.Chat.Interface._handle_spotlight_articles([],!1),Crisp.Chat.Interface._handle_spotlight_autocomplete([])))}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":keyup",e)}}),e[0].onkeydown=function(r){var s=!0;try{var o=27,_=13,c=38,l=40,p=9;switch(r.keyCode){case o:a(),s=!1;break;case _:Crisp.Chat.Interface._select_spotlight_article(e),s=!1;break;case c:Crisp.Chat.Interface._move_spotlight_article(e,-1),s=!1;break;case l:Crisp.Chat.Interface._move_spotlight_article(e,1),s=!1;break;case p:Crisp.Chat.Interface._expand_spotlight_autocomplete(e,n),s=!1;break;default:r.shiftKey!==!0&&r.metaKey!==!0&&r.ctrlKey!==!0&&r.altKey!==!0&&Crisp.Chat.Interface._handle_spotlight_autocomplete([])}}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":keydown",e)}finally{return s}},e[0].onclick=function(e){var r=!0;try{var s=e.target?Crisp.Library.dom(e.target):null;s&&(s.is(".crisp-1katy8x")||s.is(".crisp-6lqafc")||s.is(".crisp-1t9kggz")?(r=!1,a()):s.is("a")===!1&&n[0].focus())}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return r}},this.__touch_as_click(e.find(".crisp-1t9kggz"))}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._spotlight_articles_actions=function(e){var t=this,i="_spotlight_articles_actions";try{var r=e.find(".crisp-15ms4d7"),s=r.find(".crisp-joczs8"),n=0,a=function(e){0!==e&&(r[0].scrollTop+=e)};r.on("wheel",function(e){try{a(e.deltaY||0)}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":wheel",e)}}),r.on("touchstart",function(e){try{n=((e.touches||[])[0]||{}).pageY||0}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":touchmove",e)}}),r.on("touchmove",function(e){try{var r=((e.touches||[])[0]||{}).pageY||0;a(n-r),n=r}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":touchmove",e)}}),s.on("mouseenter",function(r){try{Crisp.Chat.Interface._toggle_active_spotlight_article(e,r.target,!0)}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":mouseenter",e)}}),s.on("mouseleave",function(r){try{Crisp.Chat.Interface._toggle_active_spotlight_article(e,r.target,!1)}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":mouseleave",e)}}),s.on("click",function(r){try{if(Crisp.Feature.has_screen_touch()!==!0){r.preventDefault();var s=Crisp.Library.dom(r.target).parents(".crisp-yk3ixu")||[];s.length>0&&(Crisp.Chat.Interface._article(s.attr("data-locale"),s.attr("data-slug")),e.remove(),Crisp.Chat.Interface._spotlight_current_sel=null)}}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return!1}}),r[0].onscroll=function(e){e.preventDefault(),e.stopPropagation()},r[0].ontouchmove=function(e){e.stopPropagation()}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._magnify_actions=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="_magnify_actions";try{var s=e.find(".crisp-l4y9av"),n=function(){e.remove(),Crisp.Chat.Field._focus_on_foreground()},a=function(e){var t=i[e];if(t){var r=Crisp.Chat.Selector.get("flow_messages").find([".crisp-bhspdv",'[data-fingerprint="'+t+'"]'].join(""))||[];if(r.length>0){var s=r.find(".crisp-jzm1tb")||[];s.length>0&&s[0].click()}}};e.on("keydown",function(e){try{var i=27,s=37,o=39;switch(e.keyCode){case i:n();break;case s:a("previous");break;case o:a("next")}}catch(e){Crisp.Library.logger.error(t.ns+"."+r+":keydown",e)}}),s.on("load",function(){try{e.attr("data-state","loaded")}catch(e){Crisp.Library.logger.error(t.ns+"."+r+":load",e)}}),e[0].onclick=function(e){var i=!1;try{var s=null,o=e.target?Crisp.Library.dom(e.target):null;switch(o&&o.is(".crisp-1249zjg")&&(s=o.attr("data-action")),s){case"download":i=!0;break;case"next":case"previous":a(s);break;default:n()}}catch(e){Crisp.Library.logger.error(t.ns+"."+r+":click",e)}finally{return i}},this.__touch_as_click(e)}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._picker_actions_gif_items=function(e){var t=this,i="_picker_actions_gif_items";try{var r=e.find(".crisp-vsw3z4")||[];if(r.length>0){r.on("click",function(e){try{if(e.stopPropagation(),Crisp.Broker._socket_connected===!0){var r=e.target?Crisp.Library.dom(e.target):null;if(r){var s=r.attr("data-type"),n=r.attr("data-url");n&&s&&(Crisp.Action.do_message_send("animation",{type:s,url:n}),Crisp.Chat.Picker._reset())}}}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":click",e)}finally{return!1}}),this.__touch_as_click(r);for(var s=0;s0&&" "!==n[_-1]&&(s=" "+s),_0&&(i.on("click",function(){try{Crisp.Chat.Picker._load_data_gif()}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":click",i)}finally{return!1}}),this.__touch_as_click(i),i[0].onclick=function(){return!1})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__alert_warn_reply=function(){var e=this,t="__alert_warn_reply";try{Crisp.Chat.Selector.get("alerts_warn_reply").on("click",function(){try{Crisp.Base._website_configuration.chat.phone_visitors===!0&&Crisp.Base._website_configuration.chat.email_visitors!==!0?Crisp.Chat.Intent._update("identity","phone"):Crisp.Chat.Intent._update("identity","email")}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":click",i)}finally{return!1}}),this.__touch_as_click(Crisp.Chat.Selector.get("alerts_warn_reply")),Crisp.Chat.Selector.get("alerts_warn_reply")[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__alert_email_invalid=function(){var e=this,t="__alert_email_invalid";try{Crisp.Chat.Selector.get("alerts_email_invalid").on("click",function(){try{Crisp.Chat.Intent._update("identity","email",force=!0)}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":click",i)}finally{return!1}}),this.__touch_as_click(Crisp.Chat.Selector.get("alerts_email_invalid")),Crisp.Chat.Selector.get("alerts_email_invalid")[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__textarea_submit=function(){var e=this,t="__textarea_submit";try{var i=Crisp.Chat.Selector.get("form_textarea_message"),r=function(){Crisp.Chat.Message.send()};i.on("keydown",function(i){try{if(13===i.keyCode&&!i.shiftKey)return r(),!1;if(70===i.keyCode&&i.ctrlKey&&Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Base._page_domain!==Crisp.Base._website_configuration.channels.helpdesk)return Crisp.Action.do_helpdesk_search(),!1}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":keydown",i)}}),Crisp.Chat.Selector.get("form_button_send").on("click",function(){try{r()}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":click",i)}finally{return!1}}),this.__touch_as_click(Crisp.Chat.Selector.get("form_button_send")),i[0].onkeydown=function(e){if(e.stopPropagation(),13===e.keyCode&&!e.shiftKey)return!1},Crisp.Chat.Selector.get("form_message")[0].onsubmit=function(){return!1},Crisp.Chat.Selector.get("form_button_send")[0].onclick=function(){return!1}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__textarea_change=function(){var e=this,t="__textarea_change";try{var i=1,r=null,s=parseInt(Crisp.Chat.Selector.get("form_textarea_message").attr("rows"),10),n=function(){null!==r&&clearTimeout(r),r=setTimeout(function(){Crisp.Chat.State.propagate("textarea",Crisp.Action.get_message_text())},e.__textarea_propagate_defer_wait)},a=function(r){try{if(_textarea_val="",13!==r.keyCode||r.shiftKey)if(_textarea_val=Crisp.Action.get_message_text(),n(),_textarea_val){var a=8.5*_textarea_val.length,o=a/Crisp.Chat.Interface._textarea_base_width;o+=(_textarea_val.match(/\n/g)||[]).length;var _=Math.ceil(o);if(_-o0&&e.__handle_file_change(t.dataTransfer.files),!1})}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__file_paste=function(){var e=this,t="__file_paste";try{Crisp.Base._website_configuration.chat.file_transfer===!0&&Crisp.Chat.Selector.get("form_textarea_message").on("paste",function(i){try{var r=(i.clipboardData||i.originalEvent.clipboardData||{}).items||[];if(r.length>0){for(var s=[],n=0;n0){i.preventDefault();var o=confirm(Crisp.Locale.text("chat","chat_form_attach_confirm_upload"));o===!0&&e.__handle_file_change(s)}}}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":paste",i)}})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__file_submit=function(){var e=this,t="__file_submit";try{Crisp.Base._website_configuration.chat.file_transfer===!0&&Crisp.Chat.Selector.get("form_message").on("event:attach",function(){try{var i=void 0,r=void 0,s=void 0,n=void 0,a=function(){i&&(i.removeEventListener("progress",c,!1),i.removeEventListener("error",_,!1),i.removeEventListener("abort",_,!1),i.removeEventListener("load",o,!1)),Crisp.Chat.Selector.get("form_input_attach")[0].value=null,Crisp.Chat.Selector.get("form_button_attach").attr("data-state","none"),e.__file_change_stack.shift(),e.__file_change_stack.length>0&&e.__handle_file_change(e.__file_change_stack)},o=function(){e.__file_change_stack.length>0&&s&&setTimeout(function(){Crisp.Action.do_message_send("file",{url:s,name:e.__file_change_stack[0].name||e.__file_name_default,type:e.__file_change_stack[0].type||e.__file_type_default}),a()},e.__file_send_delay)},_=function(){e.__file_change_stack.length>0&&alert(Crisp.Locale.text("chat","chat_form_attach_alert_error")),a()},c=function(e){Crisp.Chat.Selector.get("form_button_attach").attr("data-state","uploading")};if(r=Crisp.Chat.Selector.get("form_message").attr("data-action"),s=Crisp.Chat.Selector.get("form_message").attr("data-resource"),n=parseInt(Crisp.Chat.Selector.get("form_message").attr("data-size-limit"),10),!e.__file_change_stack[0])return void a();if(!r||!s)return alert(Crisp.Locale.text("chat","chat_form_attach_alert_quota")),void a();if(e.__file_change_stack[0].size>=n)return alert(Crisp.Locale.text("chat","chat_form_attach_alert_size")),void a();i=new XMLHttpRequest,i.file=e.__file_change_stack[0],i.addEventListener("progress",c,!1),i.addEventListener("error",_,!1),i.addEventListener("abort",_,!1),i.addEventListener("load",o,!1),i.open("PUT",r,!0),i.setRequestHeader("Content-Disposition","attachment"),i.send(e.__file_change_stack[0])}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":submit",i)}finally{return!1}})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__file_change=function(){var e=this,t="__file_change";try{Crisp.Base._website_configuration.chat.file_transfer===!0&&Crisp.Chat.Selector.get("form_input_attach").on("change",function(t){return!!(t.target.files&&t.target.files.length>0)&&e.__handle_file_change(t.target.files)})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__page_scroll=function(){var e=this,t="__page_scroll";try{document.addEventListener("wheel",function(i){try{var r=i.target?Crisp.Library.dom(i.target):null;if(r&&"number"==typeof i.wheelDelta&&Crisp.Action.is_chat_opened()===!0&&(r.parents(".crisp-client").length>0||r.is(".crisp-client"))){var s=Crisp.Chat.Selector.get("flow"),n=".crisp-18wo6ed";if(s&&s[0]&&(r.parents(n).length>0||r.is(n))){var a=s[0].scrollTop-i.wheelDelta;s[0].scrollTop=a>=0?a:0}i.stopPropagation(),i.preventDefault(),i.returnValue=!1}}catch(i){Crisp.Library.logger.error(e.ns+"."+t+":wheel",i)}})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__page_change=function(){var e="__page_change";try{window.addEventListener("beforeunload",function(e){var t=null;Crisp.Library.crisp.client.Message.is_sending_messages()===!0&&(t=Crisp.Locale.text("chat","chat_message_send_abort_warn"));var i=Crisp.Chat.Selector.get("form_button_attach").attr("data-state");if(["preparing","uploading"].indexOf(i)!==-1&&(t=Crisp.Locale.text("chat","chat_form_attach_abort_warn")),Crisp.Library.crisp.client.Call.is_ongoing()===!0&&(t=Crisp.Locale.text("call","call_abort_warn")),t)return e.returnValue=t})}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__touch_as_click=function(e){var t=this,i="__touch_as_click";try{e.on("touchstart",function(e){try{e.preventDefault()}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":touchstart",e)}}),e.on("touchend",function(e){try{e.preventDefault(),e.target&&"function"==typeof e.target.click&&e.target.click()}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":touchend",e)}})}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__handle_file_change=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t="__handle_file_change";try{if(Crisp.Broker._socket_connected===!0){var i=Crisp.Chat.Selector.get("form_button_attach").attr("data-state");if(e.length>0&&"none"===i){this.__file_change_stack=[];for(var r=0;r0&&void 0!==arguments[0]&&arguments[0],t="_focus_on_foreground";try{if((e===!0||!Crisp.Feature.has_screen_touch())&&Crisp.Chat.Interface._chat_is_visible()){var i=Crisp.Chat.Selector.get("flow_messages");if(i){var r=null,s=i.find(".crisp-16r0df5");r=s.length>0?s:Crisp.Chat.Picker._is_open()===!0?Crisp.Chat.Selector.get("pickers_search_input"):Crisp.Chat.Selector.get("form_textarea_message"),r&&r.length>0&&r[0].focus()}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._blur_from_foreground=function(){var e="_blur_from_foreground";try{for(var t=Crisp.Base._container_sel.find("input"),i=0;i0&&void 0!==arguments[0]?arguments[0]:"pane",i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="_toggle_visibility";try{var s="chat"===t?"true":"false",n=function(t){var i="close"===t?"maximize":"minimize",r="close"===t?"minimize":"maximize";null!==e.__toggle_clean_timeout_wait&&clearTimeout(e.__toggle_clean_timeout_wait),Crisp.Chat.Selector._minimized_sel&&(Crisp.Chat.Selector._minimized_sel.removeClass(e._visibility_animate_classes.minimized[i]),Crisp.Chat.Selector._minimized_sel.addClass(e._visibility_animate_classes.minimized[r])),Crisp.Chat.Selector._shade_sel&&(Crisp.Chat.Selector._shade_sel.removeClass(e._visibility_animate_classes.shade[i]),Crisp.Chat.Selector._shade_sel.addClass(e._visibility_animate_classes.shade[r])),Crisp.Chat.Selector._chat_sel&&(Crisp.Chat.Selector._chat_sel.removeClass(e._visibility_animate_classes.chat[i]),Crisp.Chat.Selector._chat_sel.addClass(e._visibility_animate_classes.chat[r])),e.__toggle_clean_timeout_wait=setTimeout(function(){a(t)},e.__toggle_clean_timeout)},a=function(t){var i=!(t&&"open"!==t),r=!(t&&"close"!==t);i===!0&&(Crisp.Chat.Selector._minimized_sel&&(Crisp.Chat.Selector._minimized_sel.attr("data-maximized","true"),Crisp.Chat.Selector._minimized_sel.removeClass(e._visibility_animate_classes.minimized.maximize)),Crisp.Chat.Selector._shade_sel&&Crisp.Chat.Selector._shade_sel.removeClass(e._visibility_animate_classes.shade.maximize),Crisp.Chat.Selector._chat_sel&&Crisp.Chat.Selector._chat_sel.removeClass(e._visibility_animate_classes.chat.maximize)),r===!0&&(Crisp.Chat.Selector._shade_sel&&Crisp.Chat.Selector._shade_sel.attr("data-visible","false"),Crisp.Chat.Selector._chat_sel&&Crisp.Chat.Selector._chat_sel.attr("data-visible","false"),Crisp.Chat.Selector._minimized_sel&&Crisp.Chat.Selector._minimized_sel.removeClass(e._visibility_animate_classes.minimized.minimize),Crisp.Chat.Selector._shade_sel&&Crisp.Chat.Selector._shade_sel.removeClass(e._visibility_animate_classes.shade.minimize),Crisp.Chat.Selector._chat_sel&&Crisp.Chat.Selector._chat_sel.removeClass(e._visibility_animate_classes.chat.minimize))};"pane"===t?this._is_maximized=!1:this._is_maximized=!0,this.__apply_focus(),this.__schedule_scroll_toggle("true"===s),i===!0&&Crisp.Feature.has_css_animations()?"pane"===t?(Crisp.Chat.Selector._minimized_sel&&Crisp.Chat.Selector._minimized_sel.attr("data-maximized",s),n("close")):(Crisp.Chat.Selector._shade_sel&&Crisp.Chat.Selector._shade_sel.attr("data-visible",s),Crisp.Chat.Selector._chat_sel&&Crisp.Chat.Selector._chat_sel.attr("data-visible",s),n("open")):(a(),Crisp.Chat.Selector._shade_sel&&Crisp.Chat.Selector._shade_sel.attr("data-visible",s),Crisp.Chat.Selector._chat_sel&&Crisp.Chat.Selector._chat_sel.attr("data-visible",s),Crisp.Chat.Selector._minimized_sel&&Crisp.Chat.Selector._minimized_sel.attr("data-maximized",s))}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._toggle_socket_state=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i="_toggle_socket_state";try{null!==this.__toggle_socket_state_timeout&&clearTimeout(this.__toggle_socket_state_timeout),this.__toggle_socket_state_timeout=setTimeout(function(){e.__toggle_socket_state_timeout=null,t===!1?Crisp.Chat.Selector.get("content").attr("data-has-offline","true"):Crisp.Chat.Selector.get("content").removeAttr("data-has-offline")},this.__toggle_socket_state_delay)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._minimize=function(){var e="_minimize";try{Crisp.Base._runtime_configuration.lock_maximized!==!0&&Crisp.Chat.State.propagate("maximized",!1)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._maximize=function(){var e="_maximize";try{Crisp.Chat.State.propagate("maximized",!0,force=!1,function(){Crisp.Chat.Scroll._to()})}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._chat_is_visible=function(){var e="_chat_is_visible",t=!0;try{t=this._is_maximized}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}finally{return t}},e.prototype._pane=function(){var e="_pane";try{var t=Crisp.Base._website_configuration||{},i=t.website||{};Crisp.Chat.Selector._excerpt_sel=Crisp.Library.dom(Crisp.Template.render("chat",{activity:{metrics:i.response_metrics&&i.response_metrics.mean&&i.response_metrics.mean>=this.__metric_reply_min&&i.response_metrics.mean0?{format:Crisp.Utility.lower_string_first(Crisp.Date.format_date(Crisp.Date.timestamp_to_iso(i.last_available))),raw:Crisp.Date.timestamp_to_iso(i.last_available)}:null},configuration:t,environment:{smileys:this.__smileys,url:{crisp_web:Crisp.Base._url_website}},methods:{active_operators:Crisp.Avatar.active_operators.__crisp_bind(Crisp.Avatar),count_other_operators:Crisp.Avatar.count_other_operators.__crisp_bind(Crisp.Avatar),generate_channel_link:this._generate_channel_link.__crisp_bind(this)},website:{id:Crisp.Base._website_id,domain:Crisp.Base._website_configuration.website.domain,name:Crisp.Base._website_configuration.website.name},chatbox:{blocked:Crisp.Base._is_blocked(),runtime:Crisp.Base._runtime_configuration,helpdesk:{search:Crisp.Base._website_configuration.chat.helpdesk_link&&Crisp.Base._website_configuration.channels.helpdesk&&Crisp.Base._page_domain!==Crisp.Base._website_configuration.channels.helpdesk&&!0}},status:{url:this._generate_channel_link("status")}})),Crisp.Base._container_sel.empty(),Crisp.Base._container_sel.append(Crisp.Chat.Selector._excerpt_sel),Crisp.Chat.Selector._bind(),Crisp.Chat.Event._bind(),this._apply_dynamic_sizing_properties(!0),this.__force_chat_hide(),Crisp.Chat.State._trigger_default_all(ignored_ns=["intent"])}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._generate_channel_link=function(e){var t="_generate_channel_link",i="";try{var r=Crisp.Base._website_configuration.channels[e]||null;switch(e){case"email":var s=Crisp.Broker._session_hash;if(s){var n=Crisp.Base._website_configuration.website.name,a="s."+s+".i@"+Crisp.Base._website_configuration.website.mailer;i="mailto:",n&&(i+='"'+encodeURI(n)+'"'),i+="<"+encodeURI(a)+">"}else r&&(i="mailto:"+r);break;case"phone":r&&(i="tel:"+r);break;case"messenger":r&&(i="https://web.archive.org/web/20190510100347/https://m.me/"+encodeURI(r));break;case"telegram":r&&(i="https://web.archive.org/web/20190510100347/https://telegram.me/"+encodeURI(r));break;case"twitter":r&&(i="https://web.archive.org/web/20190510100347/https://twitter.com/"+encodeURI(r));break;case"helpdesk":case"status":if(r){var o="production"===Crisp.Base._client_environment?"https":"http";i=o+"://"+r+"/"}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype._apply_dynamic_sizing_properties=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="_apply_dynamic_sizing_properties";try{if(Crisp.Action.is_chat_visible()===!0){if(Crisp.Base._is_large_view()===!0?(this.__effective_chat_height=this.__desktop_large_chat_height,this.__effective_chat_width=this.__desktop_large_chat_width):Crisp.Base._is_small_view()===!0?(this.__effective_chat_height=this.__desktop_small_chat_height,this.__effective_chat_width=this.__desktop_small_chat_width):(this.__effective_chat_height=this.__desktop_regular_chat_height,this.__effective_chat_width=this.__desktop_regular_chat_width),Crisp.Base._apply_sizing(),Crisp.Base._is_full_view()===!0&&(this.__effective_chat_height=window.innerHeight,this.__effective_chat_width=window.innerWidth,this.__effective_chat_height-=Crisp.Chat.Selector.get("header").height()),Crisp.Chat._is_initialized===!0||e===!0){var i="rtl"===Crisp.Locale.direction()?"right":"left",r="rtl"===Crisp.Locale.direction()?"left":"right",s=parseInt(Crisp.Chat.Selector.get("form_textarea_message").css(i).replace("px",""),10),n=parseInt(Crisp.Chat.Selector.get("form_act").css(r).replace("px",""),10),a=this.__effective_chat_width-this.__textarea_width_sefety-s-n-Crisp.Chat.Selector.get("form_act")[0].offsetWidth;Crisp.Chat.Selector._chat_sel.safe_css_text("width",this.__effective_chat_width+"px"),Crisp.Chat.Selector.get("content").safe_css_text("height",this.__effective_chat_height+"px"),Crisp.Chat.Selector.get("form_textarea_message").safe_css_text("width",a+"px"),this._flow_height=Crisp.Chat.Selector.get("flow").height(),this._textarea_base_width=Crisp.Chat.Selector.get("form_textarea_message").width(),0===this._form_container_height&&(this._form_container_height=Crisp.Chat.Selector.get("form_container").height()),0===this._textarea_base_line_height&&(this._textarea_base_line_height=parseInt(Crisp.Chat.Selector.get("form_textarea_message").css("line-height").replace("px",""),10)),Crisp.Chat.Scroll._margin=this._flow_height,Crisp.Base._is_full_view()&&this._chat_is_visible()===!0?Crisp.Chat.Viewport._adapt():Crisp.Chat.Viewport._unadapt(),Crisp.Chat.Selector.get("form_textarea_message").trigger("keyup")}Crisp.Sound.allow(!Crisp.Base._is_full_view()&&!0)}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._has_focus=function(){var e="_has_focus";try{return this.__has_window_focus&&this._chat_is_visible()&&!0}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._article=function(e,t){var i="_article";try{var r=Crisp.Base._container_sel.find(".crisp-3vy3u9"),s=Crisp.Library.dom(Crisp.Template.render("article",{frame:{url:""+this._generate_channel_link("helpdesk")+(e+"/article/"+t)}}));Crisp.Chat.Event._article_actions(s),0===r.length?Crisp.Base._container_sel.append(s):r[0].parentNode.replaceChild(s[0],r[0]),setTimeout(function(){s[0].focus()},this.__article_focus_timeout)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._spotlight=function(){var e=this,t="_spotlight",i=!1;try{var r=this._generate_channel_link("helpdesk");r&&(i=!0,null===this._spotlight_current_sel&&(this._spotlight_current_sel=Crisp.Library.dom(Crisp.Template.render("spotlight",{url:r})),Crisp.Chat.Event._spotlight_actions(this._spotlight_current_sel),Crisp.Base._container_sel.append(this._spotlight_current_sel),Crisp.Action.do_helpdesk_query(""),setTimeout(function(){var t=e._spotlight_current_sel.find(".crisp-f2mp3n");t&&t[0]&&t[0].focus()},this.__spotlight_focus_timeout)))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype._magnify=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s="_magnify";try{var n=Crisp.Base._container_sel.find(".crisp-fpuyn"),a=Crisp.Chat.Message._get_magnify_file_fingerprints("file"===e?r:null),o=Crisp.Library.dom(Crisp.Template.render("magnify",{type:e,source:t,name:i,fingerprints:a}));Crisp.Chat.Event._magnify_actions(o,a),0===n.length?Crisp.Base._container_sel.append(o):n[0].parentNode.replaceChild(o[0],n[0]),setTimeout(function(){o[0].focus()},this.__magnify_focus_timeout)}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype._expand_spotlight_autocomplete=function(e,t){var i="_expand_spotlight_autocomplete";try{var r=e.find(".crisp-1qbkq97"),s=(r.text()||"").trim();s&&(t.val(""+(t.val()||"")+s),this._handle_spotlight_autocomplete([]))}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._select_spotlight_article=function(e){var t="_select_spotlight_article";try{var i=e.find(".crisp-joczs8[data-active='true']");i&&i.length>0&&i[0].click()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._move_spotlight_article=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i="_move_spotlight_article";try{var r=e.find(".crisp-joczs8")||[];if(r.length>0){for(var s=-1,n=0;n=r.length&&(s=0),s>-1&&this._toggle_active_spotlight_article(e,r[s],!0)}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._toggle_active_spotlight_article=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="_toggle_active_spotlight_article";try{e.find(".crisp-joczs8").attr("data-active","false"),null!==t&&Crisp.Library.dom(t).attr("data-active",i===!0?"true":"false")}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._handle_spotlight_articles=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i="_handle_spotlight_articles";try{if(null!==this._spotlight_current_sel){var r=this._spotlight_current_sel.find(".crisp-15ms4d7");if(r&&r.remove(),t===!0){var s=Crisp.Library.dom(Crisp.Template.render("spotlight_results",{base_url:this._generate_channel_link("helpdesk"),results:e,has_active:!Crisp.Feature.has_screen_touch()&&!0})),n=this._spotlight_current_sel.find(".crisp-7xnvwa");n.prepend(s),Crisp.Chat.Event._spotlight_articles_actions(this._spotlight_current_sel)}this._spotlight_current_sel.attr("data-state","loaded"),this._spotlight_current_sel.attr("data-has-results",t===!0?"true":"false")}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._handle_spotlight_autocomplete=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t="_handle_spotlight_autocomplete";try{if(null!==this._spotlight_current_sel){var i=this._spotlight_current_sel.find(".crisp-1qbkq97"),r=(e[0]||"").toLowerCase(),s=null,n=null;if(r){var a=this._spotlight_current_sel.find(".crisp-f2mp3n");n=a.val()||"";var o=n.substring(n.lastIndexOf(" ")+1).trim().toLowerCase();o&&o.length0&&void 0!==arguments[0]&&arguments[0],i="__schedule_scroll_toggle";try{null!==this.__scroll_toggle_defer_timeout&&(clearTimeout(this.__scroll_toggle_defer_timeout),this.__scroll_toggle_defer_timeout=null),Crisp.Base._is_full_view()===!0&&window.scroll&&(t===!0?Crisp.Base._is_full_view()===!0&&(this.__scroll_toggle_defer_timeout=setTimeout(function(){e.__scroll_toggle_defer_timeout=null,e._chat_is_visible()===!0&&(e.__scroll_toggle_position===-1&&(e.__scroll_toggle_position=window.scrollY),window.scroll(window.scrollX,document.body.scrollHeight))},this.__scroll_toggle_defer_wait)):this.__scroll_toggle_position>-1&&(window.scroll(window.scrollX,this.__scroll_toggle_position),this.__scroll_toggle_position=-1))}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__apply_focus=function(){var e="__apply_focus";try{var t=this._has_focus();Crisp.Library.crisp.client.Message.set_messages_in_view(t)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__watch_focus=function(){var e=this,t="__watch_focus";try{this.__has_window_focus=(!window.hasFocus||window.hasFocus())&&!0,window.addEventListener("focus",function(){e.__has_window_focus=!0,e.__apply_focus()},!1),window.addEventListener("blur",function(){e.__has_window_focus=!1,e.__apply_focus()},!1)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__force_chat_hide=function(){var e="__force_chat_hide";try{this._is_maximized=!1,Crisp.Chat.Selector._shade_sel.attr("data-visible","false"),Crisp.Chat.Selector._chat_sel.attr("data-visible","false")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}());var _slicedToArray=function(){function e(e,t){var i=[],r=!0,s=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){s=!0,n=e}finally{try{!r&&o.return&&o.return()}finally{if(s)throw n}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();if(Crisp.Chat.Message=new(function(){function e(){var e="constructor";try{this.ns="CrispChatMessage",this.__show_identity_after=1500,this.__focus_from_identity_after=500,this.__acknowledgement_timeout=3e4,this.__reply_default_after=6e4,this.__reply_fast_after=3e4,this.__animate_entrance_timeout=400,this.__compose_expire_interval=5e3,this.__compose_expire_max_age=12e4,this.__receive_mirror_type="urn:crisp.im:triggers:0",this.__website_message_sources=["welcome","identity","game"],this.__source_identity_types=["email","phone"],this.__file_preview_types=["image/jpg","image/jpeg","image/png"],this.__message_replace_targets=[".crisp-1o2g4mc",".crisp-1ie92q9"],this._has_messages=!1,this._has_received_messages=!1,this._has_sent_messages=!1,this._message_last_timestamp=0,this.__has_local_messages=!1,this.__is_activity_ongoing=!1,this.__acknowledgement_queue=[],this.__sent_read_fingerprints=[],this.__receive_mirror_fingerprints=[],this.__show_identity_timeout=null,this.__reply_timeout=null,this.__message_compose_timestamp=null,this.__website_messages_parts={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{this.__register_unread_handler()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.send=function(){var e="send";try{if(Crisp.Broker._socket_connected===!0){var t=Crisp.Action.get_message_text();t=t.trim(),t&&(Crisp.Action.do_message_send("text",t),Crisp.Action.set_message_text(""),Crisp.Chat.Selector.get("form_textarea_message").trigger("keyup"))}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.received=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n="received";try{var a=this.__show("from",e),o=_slicedToArray(a,2),_=o[0],c=o[1];t===!0&&Crisp.Chat.Interface._has_focus()===!1&&Crisp.Sound.start("events","chat-message-receive"),r===!0&&Crisp.Chat.Scroll._to_last_message(direction="from"),i===!0&&c===!1&&this.__animate_entrance(_),e.user&&this.__website_message_sources.indexOf(e.user.source)===-1&&Crisp.Chat.Misc._update_operator_details(e.user),s===!1&&Crisp.Chat.Game.stop(),this.__message_compose_timestamp&&e.timestamp>0&&this.__message_compose_timestamp0&&void 0!==arguments[0])||arguments[0],t="_show_identity";try{for(var i="**"+Crisp.Locale.text("chat","chat_message_text_identity_main")+"**\n"+("_"+Crisp.Locale.text("chat","chat_message_text_identity_ask")+"_"),r=function(e){return function(){Crisp.Chat.Intent._update("identity",e)}},s=[],n=0;n0&&this.__show_website_message("identity","default","picker",{id:"ask-identity",text:i,choices:s},with_animations=e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._hide_identity=function(){var e="_hide_identity";try{this.__hide_website_message("identity")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._show_identity_field=function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="_show_identity_field";try{if(this.__source_identity_types.indexOf(e)!==-1){var s="chat_message_text_identity_ask_"+e,n="chat_message_text_identity_ask_field_"+e;this.__show_website_message("identity",e,"field",{id:"identity-"+e,text:"_"+Crisp.Locale.text("chat",s)+"_",explain:Crisp.Locale.text("chat",n),previous:"identity",handler:function(i){try{Crisp.Action["set_user_"+e](i)}catch(e){}setTimeout(function(){Crisp.Chat.Field._focus_on_foreground()},t.__focus_from_identity_after)}},with_animations=i)}}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype._show_game=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="_show_game";try{var i="**"+Crisp.Locale.text("chat","chat_message_text_game_main")+"**\n"+("_"+Crisp.Locale.text("chat","chat_message_text_game_ask")+"_");this.__show_website_message("game","default","picker",{id:"ask-game",text:i,choices:[{value:"play",selected:!1,label:Crisp.Locale.text("chat","chat_message_text_game_pick_yes"),handler:function(e){Crisp.Chat.Game.start(),Crisp.Chat.Intent._update("game",!1)}},{value:"ignore",selected:!1,label:Crisp.Locale.text("chat","chat_message_text_game_pick_no"),handler:function(e){Crisp.Chat.Intent._update("game",!1)}}]},with_animations=e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._hide_game=function(){var e="_hide_game";try{this.__hide_website_message("game")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._show_compose=function(e){var t="_show_compose";try{var i=(Crisp.Chat.Selector._chat_sel?Crisp.Chat.Selector._chat_sel.find(".crisp-fsijn1"):null)||[];this.__message_compose_timestamp=e,0===i.length&&(i=Crisp.Library.dom(Crisp.Template.render("chat_bubble_composing")),Crisp.Chat.Selector.get("flow_events").append(i),Crisp.Chat.Scroll._to_last_message(direction=null),this.__check_compose_expire())}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._hide_compose=function(){var e="_hide_compose";try{var t=Crisp.Chat.Selector._chat_sel?Crisp.Chat.Selector._chat_sel.find(".crisp-fsijn1"):null;this.__message_compose_timestamp=null,t&&t.length>0&&t.remove()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._acknowledge_read_send=function(e){var t=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],"_acknowledge_read_send");try{if(Crisp.Base._website_configuration.chat.operator_privacy!==!0){var i=null;if(e.length>0)for(var r=Crisp.Chat.Selector.get("flow_messages").find(".crisp-bhspdv"),s=r.length-1;s>=0;s--){var n=r[s].getAttribute("data-fingerprint");if(n&&(isNaN(n)||(n=parseInt(n,10)),e.indexOf(n)!==-1)){i=n;break}}else{var a=Crisp.Chat.Selector.get("flow_messages").find('.crisp-bhspdv[data-from="visitor"]');a.length>0&&(i=a.last().attr("data-fingerprint")||null)}null!==i&&(Crisp.Chat.Selector.get("flow_messages").find(".crisp-12qaym5").safe_css_text("display","none"),Crisp.Chat.Selector.get("flow_messages").find([".crisp-bhspdv",'[data-fingerprint="'+i+'"]'].join("")).find(".crisp-12qaym5").safe_css_text("display","inline-block"))}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._trigger_will_send_hooks=function(){var e="_trigger_will_send_hooks",t=!1;try{for(var i=[],r=Crisp.Library.crisp.client.Message.get_cached_messages(),s=r.length-1;s>=0&&"local"===(r[s].user||{}).source;s--)i.push(r[s]);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s="_dispatch_local";try{var n=Crisp.Base._website_configuration.website.active_operators||[],a={source:"local"};n[0]&&r!==!0?(a.user_id=n[0].user_id,a.nickname=n[0].nickname,n[0].avatar&&(a.avatar=n[0].avatar)):(a.type="website",a.user_id=Crisp.Base._website_id,a.nickname=Crisp.Base._website_configuration.website.name),Crisp.Library.crisp.client.Message.receive_message_local(e,t,a,i)}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype._remove=function(e){var t="_remove";try{var i=e.parents(".crisp-dqw9ko");if(1===i.find(".crisp-bhspdv").length){var r=e.parents(".crisp-lgu84d");1===r.find(".crisp-dqw9ko").length?r.remove():i.remove()}else e.remove()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._restore=function(){var e="_restore";try{Crisp.Chat.Message._show_welcome(),this._synchronize()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._synchronize=function(){var e="_synchronize";try{Crisp.Library.crisp.client.Message.get_message_compose(),Crisp.Library.crisp.client.Message.get_unread_messages(),Crisp.Library.crisp.client.Message.get_message_history(),0===Crisp.Library.crisp.client.Message.count_message_history()&&this.__history_restore_done()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._get_magnify_file_fingerprints=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="_get_magnify_file_fingerprints",i={previous:null,next:null};try{if(null!==e&&!isNaN(e))for(var r=parseInt(e,10),s=Crisp.Library.crisp.client.Message.get_cached_messages(),n=0;n0)for(var a=n-1;a>=0;a--){var o=s[a];if(this.__is_previewable_file(o)===!0){i.previous=o.fingerprint;break}}if(n=this.__compose_expire_max_age?this._hide_compose():setTimeout(function(){e.__check_compose_expire()},this.__compose_expire_interval))}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__display=function(e,t,i,r,s,n,a){var o="__display",_=null,c=!1;try{var l="from"===t?"operator":"visitor",p="operator"===l?i.avatar||i.user_id:"session",h="",u="";s>0&&(h=Crisp.Date.timestamp_to_iso(s),u=Crisp.Date.format_date(h)),_=Crisp.Library.dom(Crisp.Template.render("chat_message_"+e,{from:l,user:i,content:r,date_iso:h,date_formatted:u,fingerprint:n,metas:a,configuration:Crisp.Base._website_configuration,format_context:{methods:{filter_link_safe:Crisp.Utility.filter_link_safe.__crisp_bind(Crisp.Utility)}},environment:{types:{file_preview:this.__file_preview_types},url:{crisp_image:Crisp.Base._url_image}}}));var d=Crisp.Chat.Selector.get("flow_messages").find([".crisp-bhspdv",'[data-fingerprint="'+n+'"]'].join(""));if(0===d.length){var f=Crisp.Date.timestamp_to_properties(s),g=Crisp.Chat.Selector.get("flow_messages").children().last(),m=g.filter(".crisp-lgu84d").length>0&&!0;(!m||"none"!==f.day&&g.attr("data-day")!==f.day||"none"!==f.month&&g.attr("data-month")!==f.month||"none"!==f.year&&g.attr("data-year")!==f.year)&&(g=Crisp.Library.dom(Crisp.Template.render("chat_bubble_thread",f)),Crisp.Chat.Selector.get("flow_messages").append(g));var y=g.find(".crisp-1ohjrf0"),v=y.children().last(),b=v.filter(".crisp-dqw9ko").length>0&&!0;b&&(!b||v.attr("data-from")===l&&v.attr("data-user-marker")===p)||(v=Crisp.Library.dom(Crisp.Template.render("chat_bubble_group",{from:l,user_marker:p})),y.append(v)),v.append(_),v.append(Crisp.Template.render("clear")),Crisp.Chat.Selector._last_message_height=_.height()}else{for(var C=0;C0&&i>this.__message_compose_timestamp&&this._hide_compose(),i>0&&s===!0&&(Crisp.Chat.Alert._update("wait_reply","lock"),Crisp.Chat.Intent._update("game",!1))),i>0&&(this._has_messages=!0,this._message_last_timestamp=i,s===!0&&("operator"===e?this._has_received_messages=!0:this._has_sent_messages=!0),this.__check_mark_is_activity_ongoing()),this.__has_local_messages===!1&&"local"===t.source&&(this.__has_local_messages=!0,Crisp.Base._container_sel.attr("data-has-local-messages","true"))}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__check_mark_is_activity_ongoing=function(){var e="__check_mark_is_activity_ongoing";try{var t=this._has_messages===!0&&Crisp.Base._is_activity_outdated()!==!0;this.__is_activity_ongoing!==t&&(this.__is_activity_ongoing=t,Crisp.Base._container_sel.attr("data-is-activity-ongoing",this.__is_activity_ongoing===!0?"true":"false"),Crisp.Chat.Interface._apply_dynamic_sizing_properties())}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__animate_entrance=function(e){var t="__animate_entrance";try{if(Crisp.Feature.has_css_animations()){var i="crisp-1madyxq";e.addClass(i),setTimeout(function(){e.removeClass(i)},this.__animate_entrance_timeout)}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__show=function(e,t){var i="__show",r=null,s=!1;try{var n=!1,a={},o=null;switch(t.type){case"text":t.content&&(n=!0,a={preview:t.preview},o=function(){Crisp.Chat.Event._message_actions_text(r)});break;case"file":t.content&&t.content.url&&(n=!0,o=function(){Crisp.Chat.Event._message_actions_file(r)});break;case"animation":t.content&&t.content.url&&(n=!0);break;case"audio":t.content&&t.content.url&&t.content.duration&&(n=!0,a={duration:Crisp.Date.format_time(t.content.duration)},o=function(){Crisp.Chat.Event._message_actions_audio(r,t)});break;case"picker":t.content&&t.content.id&&t.content.text&&(t.content.choices||[]).length>0&&(n=!0,a={has_selected:this.__check_picker_has_selected_choice(t.content)},o=function(){Crisp.Chat.Event._message_actions_picker(r,e,t)});break;case"field":t.content&&t.content.id&&t.content.text&&t.content.explain&&(n=!0,o=function(){Crisp.Chat.Event._message_actions_field(r,t),Crisp.Chat.Field._focus_on_foreground(do_force=!0)});break;default:throw new Error("Got an unsupported message (with type: "+t.type+")")}if(n!==!0)throw new Error("Got an invalid "+type+" message, dropping it");t.edited===!0&&(a.edited=!0),t.translated===!0&&(a.translated=!0);var _=this.__display(t.type,e,t.user||{},t.content,t.timestamp,t.fingerprint,a),c=_slicedToArray(_,2);r=c[0],s=c[1],Crisp.Chat.Event._message_actions_common(r),"welcome"===(t.user||{}).source&&"helpdesk"===((t.preview||[])[0]||{}).variant&&Crisp.Chat.Event._message_actions_welcome_helpdesk(r),"function"==typeof o&&o()}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}finally{return[r,s]}},e.prototype.__history_restore_done=function(){var e="__history_restore_done";try{this.__sent_read_fingerprints.length>0&&(this._acknowledge_read_send(this.__sent_read_fingerprints,!0),this.__sent_read_fingerprints=[]),Crisp.Chat.State._retrigger("intent"),Crisp.Chat.State._retrigger("scroll"),this.__schedule_reply_check(!0)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__register_unread_handler=function(){var e="__register_unread_handler";try{Crisp.Library.crisp.client.Message.set_unread_messages_callback(function(e,t,i){setTimeout(function(){Crisp.Chat.Notification._update_unread(e,t,i)},0)})}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__schedule_acknowledgement_check=function(e){var t=this,i="__schedule_acknowledgement_check";try{this.__acknowledgement_queue.push(e),setTimeout(function(){try{var r=t.__acknowledgement_queue.indexOf(e);if(r===-1);else{var s=Crisp.Chat.Selector.get("flow_messages").find([".crisp-bhspdv",'[data-fingerprint="'+e+'"]'].join(""));s.find(".crisp-mkirz6").safe_css_text("display","none"),s.find(".crisp-1kmmu74").safe_css_text("display","block")}t.__acknowledgement_queue.splice(r,1)}catch(e){Crisp.Library.logger.error(t.ns+"."+i+":timeout",e)}},this.__acknowledgement_timeout)}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__schedule_reply_check=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i="__schedule_reply_check";try{Crisp.Chat.Intent._states.game||Crisp.Chat.Intent._states.game===!1||this._has_sent_messages!==!0||this._has_received_messages===!0||null===this.__reply_timeout&&(this.__reply_timeout=setTimeout(function(){try{e.__reply_timeout=null,e._has_received_messages!==!0&&Crisp.Base._website_configuration.chat.wait_game===!0&&Crisp.Chat.Intent._update("game")}catch(t){Crisp.Library.logger.error(e.ns+"."+i+":timeout",t)}},t===!0?this.__reply_fast_after:this.__reply_default_after))}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__check_picker_has_selected_choice=function(e){var t="__check_picker_has_selected_choice",i=!1;try{for(var r=0;r4&&void 0!==arguments[4]&&arguments[4],n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],o="__show_website_message";try{if(this.__website_message_sources.indexOf(e)===-1)throw new Error("Source "+e+" not allowed");this.__website_messages_parts[e]!==t&&(this.__website_messages_parts[e]=t,this.received({type:i,timestamp:0,content:r,fingerprint:"$"+e,preview:a,user:{source:e,type:"website",user_id:Crisp.Base._website_id,nickname:Crisp.Base._website_configuration.website.name}},with_sounds=!1,s=s,n=n,is_locally_generated=!0))}catch(e){Crisp.Library.logger.error(this.ns+"."+o,e)}},e.prototype.__hide_website_message=function(e){var t="__hide_website_message";try{if(this.__website_message_sources.indexOf(e)===-1)throw new Error("Source "+e+" not allowed");if(this.__website_messages_parts[e]){delete this.__website_messages_parts[e];var i=Crisp.Chat.Selector.get("flow_messages").find([".crisp-bhspdv",'[data-fingerprint="$'+e+'"]'].join(""));i&&1===i.length&&this._remove(i)}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__is_previewable_file=function(e){var t="__is_previewable_file",i=!1;try{i="file"===e.type&&this.__file_preview_types.indexOf((e.content||{}).type)!==-1&&!0}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Chat.Misc=new(function(){function e(){var e="constructor";try{this.ns="CrispChatMisc",this._operator_details={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._update_operator_details=function(e){var t="_update_operator_details";try{Crisp.Utility.is_equal(e,this._operator_details)||Crisp.Chat.State.propagate("operator",e)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e}()),Crisp.Chat.Notification=new(function(){function e(){var e="constructor";try{this.ns="CrispChatNotification",this.__preview_stack_maximum=5,this._unread_count=0,this.__second_in_milliseconds=1e3,this.__tooltip_show_delay=.1,this.__tooltip_show_delay_timeout_wait=null,this.__preview_stack_last_fingerprint=null,this.__page_title_current=null,this.__animate_new_messages_tooltip_timeout=500,this.__animate_extended_preview_timeout=1e3}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._update_unread=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s="_update_unread";try{var n="crisp-161sdx3";if(this._unread_count=e,e>0){Crisp.Chat.Selector.get("pane_unread").text(e);var a="none"===Crisp.Chat.Selector.get("tooltips_new_messages").css("display")&&!0,o=this.__show_unread_preview(e,i,r,a);null===this.__page_title_current&&(this.__page_title_current=document.title),this.__page_title_current&&Crisp.Base._is_invisible()!==!0&&(document.title="💬"+e+" - "+this.__page_title_current),a===!0&&(Crisp.Feature.has_css_animations()?(null!==this.__tooltip_show_delay_timeout_wait&&clearTimeout(this.__tooltip_show_delay_timeout_wait),this.__tooltip_show_delay_timeout_wait=setTimeout(function(){t.__tooltip_show_delay_timeout_wait=null,Crisp.Chat.Selector.get("tooltips_new_messages").safe_css_text("display","block"),Crisp.Chat.Selector.get("tooltips_new_messages").addClass(n),o.length>0&&(Crisp.Chat.Selector._shade_sel.attr("data-visible-subtle","true"),Crisp.Action.is_chat_closed()===!0&&Crisp.Chat.Selector._shade_sel.addClass(Crisp.Chat.Interface._visibility_animate_classes.shade.maximize)),setTimeout(function(){Crisp.Chat.Selector._shade_sel.removeClass(Crisp.Chat.Interface._visibility_animate_classes.shade.maximize),Crisp.Chat.Selector.get("tooltips_new_messages").removeClass(n)},t.__animate_new_messages_tooltip_timeout)},this.__tooltip_show_delay*this.__second_in_milliseconds)):(Crisp.Chat.Selector.get("tooltips_new_messages").safe_css_text("display","block"),o.length>0&&Crisp.Chat.Selector._shade_sel.attr("data-visible-subtle","true")),Crisp.Chat.Selector.get("pane_unread").safe_css_text("display","block"))}else null!==this.__tooltip_show_delay_timeout_wait&&clearTimeout(this.__tooltip_show_delay_timeout_wait),Crisp.Chat.Selector.get("tooltips_new_messages").removeClass(n),Crisp.Chat.Selector.get("tooltips_new_messages").safe_css_text("display","none"),Crisp.Chat.Selector.get("pane_unread").safe_css_text("display","none"),Crisp.Chat.Selector._shade_sel.attr("data-visible-subtle","false"),Crisp.Chat.Selector.get("tooltips_extended_actions").safe_css_text("display","none"),Crisp.Chat.Selector.get("tooltips_extended_preview").empty(),this.__page_title_current&&(document.title=this.__page_title_current)}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}},e.prototype._check_clearance=function(){var e="_check_clearance";try{var t=Crisp.Chat.Selector.get("flow")[0].scrollTop,i=Crisp.Chat.Selector.get("flow")[0].scrollHeight,r=Crisp.Chat.Selector.get("flow")[0].clientHeight;r+t>=i-Crisp.Chat.Interface._last_message_height&&Crisp.Chat.Alert._update("new_messages","hide")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__show_unread_preview=function(e,t,i,r){var s="__show_unread_preview",n=[];try{var a=null,o=!1,_=[];Crisp.Chat.Selector.get("tooltips_extended_actions").safe_css_text("display","none"),Crisp.Chat.Selector.get("tooltips_extended_preview").empty();for(var c=i.length-1;c>=0&&!(t.indexOf(i[c].fingerprint)!==-1&&(n.unshift(i[c]),n.length>=this.__preview_stack_maximum));c--);for(var l=0;l0&&(o=!0,p.appendTo(Crisp.Chat.Selector.get("tooltips_extended_preview")),l===n.length-1&&null===a&&(a=n[l].fingerprint),null===a&&null!==this.__preview_stack_last_fingerprint||_.push(p))}if(o===!0&&Crisp.Chat.Selector.get("tooltips_extended_actions").safe_css_text("display","inline-block"),null!==a&&(this.__preview_stack_last_fingerprint=a),Crisp.Feature.has_css_animations()&&_.length>0){for(var h="crisp-1n62bbn",u=0;u<_.length;u++)_[u].addClass(h);setTimeout(function(){for(var e=0;e<_.length;e++)_[e].removeClass(h)},(r===!0?this.__tooltip_show_delay*this.__second_in_milliseconds:0)+this.__animate_extended_preview_timeout)}}catch(e){Crisp.Library.logger.error(this.ns+"."+s,e)}finally{return n}},e}()),Crisp.Chat.Scroll=new(function(){function e(){var e="constructor";try{this.ns="CrispChatScroll",this._margin=0,this._position=0}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._to=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="_to";try{if(null===e){var i=Crisp.Chat.Selector.get("flow")[0];e=i.scrollHeight-i.clientHeight}Crisp.Chat.State.propagate("scroll",e),Crisp.Chat.Notification._check_clearance()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._to_last_message=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"to",t="_to_last_message",i=!1;try{if(Crisp.Chat.Interface._chat_is_visible()===!0){var r=Crisp.Chat.Selector.get("flow")[0].scrollTop,s=Crisp.Chat.Selector.get("flow")[0].scrollHeight,n=Crisp.Chat.Selector.get("flow")[0].clientHeight;(!r||n+r>=s-this._margin)&&(i=!0,this._to()),i===!1&&"from"===e&&Crisp.Chat.Alert._is_visible("warn_reply")===!1&&Crisp.Chat.Alert._is_visible("email_invalid")===!1&&Crisp.Chat.Alert._is_visible("wait_reply")===!1&&Crisp.Chat.Alert._update("new_messages","show")}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Chat.Selector=new(function(){function e(){var e="constructor";try{this.ns="CrispChatSelector",this.__namespaced_class_names={pane_icon:"crisp-101bp3x",pane_avatar_resource:"crisp-1g35dz5",pane_unread:"crisp-rnyzmb",header:"crisp-1xmtdlg",header_avatar:"crisp-1hyr9km",header_avatar_resource:"crisp-djkbfv",header_operator:"crisp-1ynli6s",header_status_type_away:"crisp-12oua0m",header_channel:"crisp-znyp7j",drop_over:"crisp-11bl9dt",content:"crisp-zyxrmn",flow:"crisp-18wo6ed",flow_messages:"crisp-g5n37j",flow_events:"crisp-19gcql3",pickers:"crisp-wa6k7c",pickers_selector_one:"crisp-19foly0",pickers_inner_one:"crisp-ex82av",pickers_search_input:"crisp-1x1a5mu",pickers_smiley:["crisp-ex82av",'[data-type="smiley"]'].join(""),pickers_gif:["crisp-ex82av",'[data-type="gif"]'].join(""),alerts:"crisp-ytjf1x",alerts_one:"crisp-s842tw",alerts_new_messages:["crisp-s842tw",'[data-type="new_messages"]'].join(""),alerts_warn_reply:["crisp-s842tw",'[data-type="warn_reply"]'].join(""),alerts_email_invalid:["crisp-s842tw",'[data-type="email_invalid"]'].join(""),form_container:"crisp-1sps3eb",form_message:"crisp-1vd2grm",form_act:"crisp-1npy87v",form_button_send:"crisp-1lij8sv",form_button_smiley:["crisp-i1cf3t",'[data-type="smiley"]'].join(""),form_button_attach:["crisp-i1cf3t",'[data-type="file"]'].join(""),form_textarea_message:"crisp-12w4w1a",form_input_attach:"crisp-1dipuxs",tooltips_new_messages:["crisp-1xaupiq",'[data-id="new_messages"]'].join(""),tooltips_new_messages_text:["crisp-apgle8",'[data-for-id="new_messages"]'].join(""),tooltips_extended_actions:"crisp-p7nyfw",tooltips_extended_preview:"crisp-1wceo6w"},this._viewport_sel=null,this._excerpt_sel=null,this._shade_sel=null,this._chat_sel=null,this._minimized_sel=null,this.__cache={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.get=function(e){var t="get",i=null;try{if("undefined"!=typeof this.__cache[e])i=this.__cache[e];else{if("undefined"==typeof this.__namespaced_class_names[e])throw new Error("Selector with namespace "+e+" not found");if(this._excerpt_sel){if(i=this._excerpt_sel.find("."+this.__namespaced_class_names[e]),0===i.length)throw new Error("Could not select the element with namespace: "+e);this.__cache[e]=i}}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype._bind=function(){var e="_bind";try{this.__bind_page(),this.__bind_main()}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_page=function(){var e="__bind_page";try{this._viewport_sel=Crisp.Library.dom('head meta[name="viewport"]')}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_main=function(){var e="__bind_main";try{this._shade_sel=this._excerpt_sel.find(".crisp-1ok0k6k"),this._chat_sel=this._excerpt_sel.find(".crisp-ewasyx"),this._minimized_sel=this._excerpt_sel.find(".crisp-kquevr")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e}()),Crisp.Chat.State=new(function(){function e(){var e="constructor";try{this.ns="CrispChatState",this.__propagate_wait=250,this.__avatar_size=240,this.__register={trigger:this.__handle_trigger,alert:this.__handle_alert,intent:this.__handle_intent,operator:this.__handle_operator,scroll:this.__handle_scroll,maximized:this.__handle_maximized,textarea:this.__handle_textarea},this._is_restored=!1,this._session={},this.__pending={},this.__restored_state=[],this.__pending_timeout=null,this.__default={trigger:Crisp.Trigger._processed,alert:Crisp.Chat.Alert._states,intent:Crisp.Chat.Intent._states,operator:Crisp.Chat.Misc._operator_details,scroll:Crisp.Chat.Scroll._position,maximized:Crisp.Chat.Interface._is_maximized,textarea:Crisp.Chat.Field._textarea_val}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.receive=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="receive";try{var r=void 0,s=void 0,n=0,a=[];for(r in e)e.hasOwnProperty(r)&&(Crisp.Utility.is_equal(e[r],this._session[r])||(a.push(r),this._session[r]=e[r],t===!1&&"undefined"!=typeof this.__pending[r]&&delete this.__pending[r]));for(s=0;s2&&void 0!==arguments[2]&&arguments[2],r=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},a="propagate";try{if(i!==!0&&Crisp.Utility.is_equal(this._session[e],t))"function"==typeof s&&s(!1);else{this.__pending[e]=t,null!==this.__pending_timeout&&(clearTimeout(this.__pending_timeout),this.__pending_timeout=null);var o=Crisp.Utility.clone(this._session);o[e]=t,this.receive(o,!0),this.__pending_timeout=setTimeout(function(){if(Crisp.Utility.is_empty(r.__pending))"function"==typeof s&&s(!1);else{var e=Crisp.Utility.clone(r.__pending);r.__pending={},r.__pending_timeout=null,Crisp.Library.crisp.client.Session.set_state(e,function(e){e?"function"==typeof n&&n():"function"==typeof s&&s(!0)})}},this.__propagate_wait)}}catch(e){Crisp.Library.logger.error(this.ns+"."+a,e)}},e.prototype._restore=function(e){var t="_restore";try{Crisp.Base._is_full_view()===!0&&(e.maximized=!1);for(var i in this.__default)"undefined"==typeof e[i]&&(e[i]=this.__default[i]);this._is_restored=!0,this._session=e,this.__restored_state=Crisp.Utility.keys(this._session)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._retrigger=function(e){var t="_retrigger";try{this._trigger_default(e,this.__default[e])}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._trigger_default_all=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t="_trigger_default_all";try{var i=void 0;for(i in this.__default)this.__default.hasOwnProperty(i)&&this._trigger_default(i,this.__default[i],is_ignored=e.indexOf(i)!==-1)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._trigger_default=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="_trigger_default";try{if("function"!=typeof this.__register[e])throw new Error("No such state handler: "+e);"undefined"==typeof this._session[e]&&(this._session[e]=t),this.__register[e].__crisp_bind(this)(this._session[e],i)}catch(e){Crisp.Library.logger.error(this.ns+"."+r,e)}},e.prototype.__is_popped_restored_state=function(e){var t="__is_popped_restored_state",i=!1;try{var r=this.__restored_state.indexOf(e);r!==-1&&(this.__restored_state.splice(r,1),i=!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e.prototype.__handle_trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__handle_trigger";try{if(t===!1){this.__is_popped_restored_state("trigger");if(e&&e.length>0)for(var r=0;r1&&void 0!==arguments[1]&&arguments[1],i="__handle_alert";try{if(t===!1){var r=(this.__is_popped_restored_state("alert"),void 0),s=void 0,n=void 0,a=void 0,o=void 0,_=void 0,c=void 0,l=[["show","unlock"],["unlock","show"],["hide","lock"],["lock","hide"],["lock","show"]];for(s in e)if(e.hasOwnProperty(s)){if(n=e[s],o=Crisp.Chat.Alert._states[s],a=Crisp.Chat.Selector.get("alerts").find([".crisp-s842tw",'[data-type="'+s+'"]'].join("")),r=!1,o===n)r=!0;else if("unlock"!==n&&"lock"===o)r=!0;else for(_=0;_0&&r===!1){if("show"===n||"unlock"===n)Crisp.Chat.Selector.get("alerts_one").safe_css_text("display","none"),a.safe_css_text("display","inline-block"),Crisp.Chat.Selector.get("content").attr("data-has-alert-"+s,"true"),Crisp.Chat.Alert._hook("show",s);else{if("hide"!==n&&"lock"!==n)throw new Error("Unknown action: "+n);a.safe_css_text("display","none"),Crisp.Chat.Selector.get("content").removeAttr("data-has-alert-"+s),Crisp.Chat.Alert._hook("hide",s)}Crisp.Chat.Alert._states[s]=n,Crisp.Chat.Field._focus_on_foreground()}else Crisp.Chat.Alert._states[s]=n}}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__handle_intent=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__handle_intent";try{if(Crisp.Chat.Intent._states=e,t===!1){var r=this.__is_popped_restored_state("intent"),s=void 0;for(s in e)Crisp.Chat.Intent._toggle(s,e[s],is_new=!r);Crisp.Chat.Intent._cleanup(e)}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__handle_operator=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__handle_operator";try{if(t===!1){var r=(this.__is_popped_restored_state("operator"),void 0),s=void 0,n=void 0,a=void 0,o=void 0,_=void 0;if(Crisp.Chat.Misc._operator_details=e||{},Crisp.Utility.is_empty(Crisp.Chat.Misc._operator_details)?(r="initial",n="website",a=Crisp.Base._website_id):(r="ongoing",n=e.type||"operator",a=e.user_id,o=e.avatar,s="website"===e.type?e.nickname:Crisp.Library.crisp.web.Name.parse_first_name(e.nickname)),(o||a)&&(_=Crisp.Avatar.url(this.__avatar_size,n,a,o)),_){if("ongoing"===r){for(var c=Crisp.Chat.Selector.get("header_avatar").first().siblings()||[],l=Crisp.Chat.Selector.get("header_avatar").find(".crisp-15yizem"),p=0;p1&&void 0!==arguments[1]&&arguments[1],i="__handle_scroll";try{if(t===!1){var r=this.__is_popped_restored_state("scroll");r===!1&&(Crisp.Chat.Scroll._position=e,Crisp.Chat.Selector.get("flow")[0].scrollTop=Crisp.Chat.Scroll._position)}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__handle_maximized=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__handle_maximized";try{if(t===!1){var r=this.__is_popped_restored_state("maximized"),s=r!==!0&&!0;Crisp.Base._runtime_configuration.lock_maximized===!0&&(e=!0),e===!1?(Crisp.Chat.Interface._toggle_visibility(visible_target="pane",width_animations=s),Crisp.Chat.Field._blur_from_foreground(),Crisp.Chat.Viewport._unadapt(),Crisp.Chat.Picker._reset(),Crisp.Action._event("chat:closed")):(Crisp.Chat.Interface._toggle_visibility(visible_target="chat",width_animations=s),Crisp.Chat.Field._focus_on_foreground(),Crisp.Chat.Viewport._adapt(),Crisp.Chat.Notification._check_clearance(),Crisp.Action._event("chat:opened"))}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype.__handle_textarea=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i="__handle_textarea";try{if(t===!1){this.__is_popped_restored_state("textarea");Crisp.Action.set_message_text(e)}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e}()),Crisp.Chat.Viewport=new(function(){function e(){var e="constructor";try{this.ns="CrispChatViewport",this.__content_regex=/;/g,this.__is_adapted=!1,this.__page_meta_values=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.init=function(){var e="init";try{}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._adapt=function(){var e="_adapt";try{if(Crisp.Base._is_full_view()===!0){if(this.__is_adapted===!1){null===this.__page_meta_values&&(this.__page_meta_values=this.__parse());var t=Crisp.Utility.clone(this.__page_meta_values);t.width="device-width",t["initial-scale"]="1",t["maximum-scale"]="1",t["user-scalable"]="0";var i=this.__generate_content_value(t);null!==Crisp.Chat.Selector._viewport_sel&&Crisp.Chat.Selector._viewport_sel.length>0?Crisp.Chat.Selector._viewport_sel.attr("content",i):(Crisp.Chat.Selector._viewport_sel=Crisp.Library.dom(Crisp.Template.render("viewport",{content:i})),Crisp.Library.dom("head").append(Crisp.Chat.Selector._viewport_sel))}this.__is_adapted=!0}else this.__is_adapted=!1}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._unadapt=function(){var e="_unadapt";try{if(this.__is_adapted===!0){if(null!==Crisp.Chat.Selector._viewport_sel&&Crisp.Chat.Selector._viewport_sel.length>0){var t=this.__generate_content_value(this.__page_meta_values);t?Crisp.Chat.Selector._viewport_sel.attr("content",t):(Crisp.Chat.Selector._viewport_sel.remove(),Crisp.Chat.Selector._viewport_sel=null)}this.__is_adapted=!1}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__parse=function(){var e="__parse",t={};try{if(t={},Crisp.Chat.Selector._viewport_sel.length>0){var i=Crisp.Chat.Selector._viewport_sel.attr("content");if(i=i.trim(),i=i.replace(this.__content_regex,",")){var r=void 0,s=void 0,n=void 0,a=void 0,o=void 0,_=void 0;for(_=i.indexOf(",")!==-1?i.split(","):[i],r=0;r<_.length;r++)s=_[r],s.indexOf("=")!==-1&&(n=s.split("="),a=n[0].trim(),o=n[1].trim(),a&&o&&(t[a]=o))}}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}finally{return t}},e.prototype.__generate_content_value=function(e){var t="__generate_content_value",i="";try{var r=void 0,s=[];for(r in e)e.hasOwnProperty(r)&&s.push([r,e[r]].join("="));i=s.join(", ")}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}finally{return i}},e}()),Crisp.Browsing=new function(){var e="constructor";try{this.ns="CrispBrowsing",this._browsing_sel=null,this._browsing_type=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},Crisp.Browsing.Assist=new(function(){function e(){var e="constructor";try{this.ns="CrispBrowsingAssist",this.__assist_mouse_sel=null,this.__type="assist",this.__scroll_smooth_time=500,this.__scroll_smooth_finish_time=750,this.__scroll_smooth_passes=100,this.__click_offset_x=5,this.__click_animation_duration=600,this.__scroll_smooth_timeout=null,this.__scroll_smooth_finish_timeout=null,this.__click_animation_timeout=null}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.start=function(){var e="start";try{null===Crisp.Browsing._browsing_type&&(Crisp.Browsing._browsing_type=this.__type,Crisp.Browsing._browsing_sel=Crisp.Library.dom(Crisp.Template.render("browsing_assist",{configuration:Crisp.Base._website_configuration})),this.__assist_mouse_sel=Crisp.Browsing._browsing_sel.find(".crisp-u8ko69"),Crisp.Base._container_sel.append(Crisp.Browsing._browsing_sel))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.stop=function(){var e="stop";try{Crisp.Browsing._browsing_type===this.__type&&(Crisp.Browsing._browsing_type=null,Crisp.Browsing._browsing_sel.remove(),Crisp.Browsing._browsing_sel=null,this.__assist_mouse_sel=null)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype._pipe_mouse=function(e){var t="_pipe_mouse";try{Crisp.Browsing._browsing_type===this.__type&&null!==this.__assist_mouse_sel&&e.mouse&&this.__assist_mouse_sel.safe_css_text({display:"inline-block",left:e.mouse.x+"px",top:e.mouse.y+"px"})}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype._pipe_scroll=function(e){var t=this,i="_pipe_scroll";try{if(Crisp.Browsing._browsing_type===this.__type&&e.scroll&&window.scroll){null!==this.__scroll_smooth_timeout&&clearInterval(this.__scroll_smooth_timeout);var r={x:window.scrollX,y:window.scrollY},s={x:0,y:0};for(var n in s)s.hasOwnProperty(n)&&(s[n]=(e.scroll[n]-r[n])/this.__scroll_smooth_passes);var a=0,o=this.__scroll_smooth_time/this.__scroll_smooth_passes;o>0&&(0!==s.x||0!==s.y)&&(Crisp.Library.crisp.client.Browsing.toggle_ignore_scroll_event(!0),this.__scroll_smooth_timeout=setInterval(function(){r.x+=s.x,r.y+=s.y,window.scroll(r.x,r.y),++a>=t.__scroll_smooth_passes&&(clearInterval(t.__scroll_smooth_timeout),t.__scroll_smooth_timeout=null,null!==t.__scroll_smooth_finish_timeout&&clearTimeout(t.__scroll_smooth_finish_timeout),t.__scroll_smooth_finish_timeout=setTimeout(function(){t.__scroll_smooth_finish_timeout=null,Crisp.Library.crisp.client.Browsing.toggle_ignore_scroll_event(!1)},t.__scroll_smooth_finish_time))},o))}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e.prototype._pipe_click=function(e){var t=this,i="_pipe_click";try{if(Crisp.Browsing._browsing_type===this.__type&&(null!==this.__assist_mouse_sel&&(this.__assist_mouse_sel.attr("data-is-clicking","true"),null!==this.__click_animation_timeout&&clearTimeout(this.__click_animation_timeout),this.__click_animation_timeout=setTimeout(function(){t.__click_animation_timeout=null,t.__assist_mouse_sel.removeAttr("data-is-clicking")},this.__click_animation_duration)),e.click)){var r=e.click.x-this.__click_offset_x,s=e.click.y;r<0&&(r=0);var n=document.elementFromPoint(r,s),a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0,window,null,e.click.x,e.click.y,0,0,!1,!1,!1,!1,0,null),a._from_crisp=!0,n&&n.dispatchEvent(a)}}catch(e){Crisp.Library.logger.error(this.ns+"."+i,e)}},e}()),Crisp.Call=new(function(){function e(){var e="constructor";try{this.ns="CrispCall",this.__call_screen_move_offset=20,this.__second_in_milliseconds=1e3,this.__call_view_sel=null,this.__call_view_mode=null,this.__mode=null,this.__duration_seconds=0,this.__duration_interval=null,this.__caller_user={}}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}}return e.prototype.ring=function(e){var t="ring";try{this.__ensure_clear(),Crisp.Sound.initialize("call"),this.__bind_caller_user(e.user),this.__mode=e.mode,this.__call_view_sel=Crisp.Library.dom(Crisp.Template.render("call_ring",{configuration:Crisp.Base._website_configuration,mode:this.__mode,user:this.__caller_user})),this.__ring_events(),Crisp.Base._container_sel.append(this.__call_view_sel),Crisp.Sound.start("call","call-ring",!0)}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.screen=function(){var e="screen";try{this.__ensure_clear(),this.__call_view_sel=Crisp.Library.dom(Crisp.Template.render("call_screen",{configuration:Crisp.Base._website_configuration,mode:this.__mode,user:this.__caller_user })),this.__screen_events(),this.__toggle_state("connecting"),Crisp.Base._container_sel.append(this.__call_view_sel)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.stop=function(){var e="stop";try{this.__ensure_clear(),Crisp.Sound.start("call","call-hangup")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.success=function(e){var t="success";try{switch(e){case"media_remote":this.__bind_media_remote();break;case"media_local":this.__bind_media_local()}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.error=function(e){var t="error";try{this.__ensure_clear(),Crisp.Sound.start("call","call-hangup")}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__ensure_clear=function(){var e="__ensure_clear";try{null!==this.__call_view_sel&&(this.__call_view_sel.remove(),this.__call_view_sel=null,this.__call_view_mode=null,this.__stop_duration_counter(),Crisp.Sound.stop("call","call-ring"))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_media_local=function(){var e="__bind_media_local";try{this.__bind_media_stream("local")}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_media_remote=function(){var e="__bind_media_remote";try{this.__bind_media_stream("remote")===!0&&(this.__toggle_state("ongoing"),Crisp.Sound.start("call","call-established"))}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__bind_media_stream=function(e){var t=this.__call_view_sel.find('.crisp-15i4dc0[data-type="'+e+'"] video')||[],i=Crisp.Library.crisp.client.Call.get_stream(e);return t.length>0&&null!==i&&(t[0].srcObject=i,!0)},e.prototype.__bind_caller_user=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="__bind_caller_user";try{this.__caller_user={user_id:e.user_id||Crisp.Base._website_id,nickname:e.nickname||Crisp.Base._website_configuration.website.name,type:e.user_id?"operator":"website"}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__toggle_state=function(e){var t="__toggle_state";try{var i=this.__call_view_sel.find(".crisp-1pbz8t4")||[],r=this.__call_view_sel.find([".crisp-1pbz8t4",'[data-state="'+e+'"]'].join(""))||[],s=this.__call_view_sel.find(".crisp-23qbhk[data-state]")||[];i.length>0&&r.length>0&&(i.safe_css_text("display","none"),r.safe_css_text("display","inline-block")),s.length>0&&s.safe_css_text("display","ongoing"===e?"inline-block":"none"),"ongoing"===e&&this.__start_duration_counter()}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__toggle_media=function(e){var t="__toggle_media";try{var i=this.__call_view_sel.find('.crisp-23qbhk[data-type="'+e+'"]')||[],r=this.__call_view_sel.find('.crisp-v3vqhl[data-type="'+e+'"]')||[],s=Crisp.Library.crisp.client.Call["toggle_"+e](),n=s===!1?"inline-block":"none";if(i.length>0&&i.attr("data-state",s===!0?"true":"false"),r.length>0&&r.safe_css_text("display",n),"audio"===e){var a=this.__call_view_sel.find(".crisp-7n3076")||[];a.length>0&&a.safe_css_text("display",n)}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__start_duration_counter=function(){var e=this,t="__start_duration_counter";try{if(this.__stop_duration_counter(),null===this.__duration_interval){var i=this.__call_view_sel.find(".crisp-6hruf7")||[];this.__duration_seconds=0,this.__duration_interval=setInterval(function(){e.__duration_seconds++,i.length>0&&i.text(Crisp.Date.format_time(e.__duration_seconds,!0))},this.__second_in_milliseconds)}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e.prototype.__stop_duration_counter=function(){var e="__stop_duration_counter";try{null!==this.__duration_interval&&(clearInterval(this.__duration_interval),this.__duration_interval=null)}catch(t){Crisp.Library.logger.error(this.ns+"."+e,t)}},e.prototype.__ring_events=function(){var e=this,t="__ring_events";try{var i=this.__call_view_sel.find(".crisp-qqb65d")||[];if(i.length>0){i.on("click",function(i){try{var r=i.target?Crisp.Library.dom(i.target):[];if(r.length>0){var s=r.parents(".crisp-b38hq")||[];s.length>0&&("accept"===s.attr("data-action")?(Crisp.Library.crisp.client.Call.accept(),Crisp.Call.screen()):Crisp.Library.crisp.client.Call.decline())}}catch(i){Crisp.Library.logger.error(e.ns+"."+t,i)}finally{return!1}});for(var r=0;r0){i.on("click",function(i){try{var s=i.target?Crisp.Library.dom(i.target):[];if(s.length>0)switch(s.attr("data-type")){case"video":e.__toggle_media("video");break;case"audio":e.__toggle_media("audio");break;case"hangup":Crisp.Library.crisp.client.Call.stop();break;case"toggle":e.__call_view_mode="minimized"===e.__call_view_mode?"maximized":"minimized",r.attr("data-mode",e.__call_view_mode),r.safe_css_text(null)}}catch(i){Crisp.Library.logger.error(e.ns+"."+t,i)}finally{return!1}});for(var s=0;s0){var n=void 0,a=void 0,o=void 0,_=void 0,c=function(t){var i=a+(t.clientY-_),s=n+(t.clientX-o);if(!(s<=-1*e.__call_screen_move_offset||s>=window.innerWidth-r[0].clientWidth+e.__call_screen_move_offset||i<=-1*e.__call_screen_move_offset||i>=window.innerHeight-r[0].clientHeight+e.__call_screen_move_offset))return r.safe_css_text({top:i+"px",left:s+"px"}),!1},l=function e(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",e)};r[0].addEventListener("mousedown",function(t){"minimized"===e.__call_view_mode&&(n=r.prop("offsetLeft"),a=r.prop("offsetTop"),o=t.clientX,_=t.clientY,document.addEventListener("mousemove",c),document.addEventListener("mouseup",l))})}}catch(e){Crisp.Library.logger.error(this.ns+"."+t,e)}},e}()),_dollar_crisp={push:Crisp.Pipeline.push.__crisp_bind(Crisp.Pipeline),get:Crisp.Pipeline.get.__crisp_bind(Crisp.Pipeline),set:Crisp.Pipeline.set.__crisp_bind(Crisp.Pipeline),is:Crisp.Pipeline.is.__crisp_bind(Crisp.Pipeline),on:Crisp.Pipeline.on.__crisp_bind(Crisp.Pipeline),off:Crisp.Pipeline.off.__crisp_bind(Crisp.Pipeline),do:Crisp.Pipeline.do.__crisp_bind(Crisp.Pipeline),config:Crisp.Pipeline.config.__crisp_bind(Crisp.Pipeline),safe:Crisp.Pipeline.safe.__crisp_bind(Crisp.Pipeline),help:Crisp.Pipeline.help.__crisp_bind(Crisp.Pipeline)},Object.defineProperty(_dollar_crisp,"__init",{enumerable:!1,value:Crisp.Base.init.__crisp_bind(Crisp.Base)}),Object.defineProperty(_dollar_crisp,"__spool",{enumerable:!1,value:{}}),Object.defineProperty(_dollar_crisp,"__debug",{enumerable:!1,value:Crisp}),_dollar_crisp.__spool.pending_actions=[],"object"==typeof window.$crisp&&window.$crisp.length>0)for(var _i=0;_i