function SupportChat(){window.top.fcWidget.isOpen()?fcPreChatform.on_fc_pre_form_close():window.top.fcWidget.open()}window.fcPreChatform=function(){return{chatCustomData:{userCreated:!1,userOnLoad:!1,userCreatedfromTrigger:!1,userCreatedfromForm:!1,formCreated:!1},addCss:function(n){var i=document.head,t=document.createElement("link");t.type="text/css";t.rel="stylesheet";t.href=n;i.appendChild(t)},generateOptions:function(n){for(var i='<option value="">...<\/option>',t=0;t<n.options.length;t++)i+='<option value="'+n.options[t]+'">'+n.options[t]+"<\/option>";return i},generatePreChatHTML:function(n){for(var f=this,e='<div class="chat-fc-form-outer"><p class="fc-header">'+(typeof n=="undefined"?"Freshchat":n.heading)+'<span class="fc-minimize" onclick="fcPreChatform.on_fc_pre_form_close()">X<\/span><\/p><div class="fc-form" dir="auto"><p>'+(typeof n=="undefined"?"We can't wait to talk to you. But first, please take a couple of moments to tell us a bit about yourself.":n.textBanner)+'<\/p><form class="chat-fc-form"><ul>',o='<\/ul><\/form><a href="#" class="fc-button" onclick="fcPreChatform.on_fc_pre_form_submit(); return false;">'+(typeof n=="undefined"?"Submit":n.SubmitLabel)+"<\/a><\/div><\/div>",i=n.fields,r=Object.keys(i),u="",t=0;t<r.length;t++)t<=4&&(u+='<li class="pre-fc-field"><label>'+i[r[t]].label+"<span>"+(i[r[t]].required==="yes"?" *":"")+"<\/span><\/label><"+(i[r[t]].type==="dropdown"?"select ":"input ")+'type="'+(i[r[t]].type==="phone"?"text":i[r[t]].type)+'" id="chat-fc-'+i[r[t]].label.replace(/ /g,"").toLowerCase()+'" '+(i[r[t]].type==="dropdown"?"onChange":"onBlur")+'="fcPreChatform.fc_validate_on_blur(event);" '+(i[r[t]].required==="yes"?"required ":"")+""+(i[r[t]].type==="phone"?'pattern="[0-9-+# ]{5,20}"':"")+"/>"+(i[r[t]].type==="dropdown"?f.generateOptions(i[r[t]]):"")+"<\/"+(i[r[t]].type==="dropdown"?"select":"input")+'><div class="pre-fc-error fc-hide" id="chat-fc-'+i[r[t]].label.replace(/ /g,"").toLowerCase()+'-error">'+i[r[t]].error+"<\/div><\/li>");return e+u+o},createPreChatForm:function(n,t){if(document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="hidden",this.chatCustomData.formCreated===!1){var i=document.createElement("div"),r=this;i.innerHTML=t;document.body.appendChild(i.children[0]);document.querySelector(".chat-fc-form-outer p.fc-header").style.backgroundColor=typeof n.mainbgColor!="undefined"?n.mainbgColor:"";document.querySelector(".chat-fc-form-outer .fc-button").style.backgroundColor=typeof n.mainbgColor!="undefined"?n.mainbgColor:"";document.querySelector(".chat-fc-form-outer p.fc-header").style.color=typeof n.mainbgColor!="undefined"?n.maintxColor:"";document.querySelector(".chat-fc-form-outer .fc-button").style.color=typeof n.mainbgColor!="undefined"?n.maintxColor:"";r.chatCustomData.formCreated=!0}else document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="hidden",document.querySelector(".chat-fc-form-outer")===null?null:document.querySelector(".chat-fc-form-outer").style.visibility="visible"},fcWidgetInit:function(n){var t=this,i;this.addCss("https://snippets.freshchat.com/css/fc-pre-chat-form-v2.css");i=this.generatePreChatHTML(n);this.fields=n.fields;window.fcWidget.on("user:created",function(t){t.success===!1?console.log("User Not Created"):t.success===!0&&t.data===null?(console.log("User Exists on Load"),n.classicLiveChatMode==="enabled"&&window.fcWidget.user.clear(function(){console.log("User will be cleared")})):Object.keys(t.data).length===3&&console.log("User Created")});window.fcWidget.on("widget:opened",function(){var f=n.workWithAwayExperience?n.workWithAwayExperience:"null";if(f==="enabled"){var r="HH:mm:ss",u=moment().utc().format("dddd"),y=moment().utc(),e=moment().utc().format(r);if(typeof n.business_hours_config[u]!="undefined"){var o=moment(n.business_hours_config[u].from,["h:mm A"]),s=moment(n.business_hours_config[u].to,["h:mm A"]),h=moment(n.business_hours_config[u].from,["h:mm A"]).format(r),c=moment(n.business_hours_config[u].to,["h:mm A"]).format(r),l=moment(e,r),a=moment(h,r),v=moment(c,r);l.isBetween(a,v)===!0&&moment(moment()).isBetween(o,s)===!0?(console.log("Within Business Hours"),window.fcWidget.user.isExists(function(r){r.data===!1?(t.chatCustomData.userCreated=!1,document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="hidden",t.createPreChatForm(n,i)):(t.chatCustomData.userCreated=!0,window.fcWidget.user.get(function(r){r.data.isNameGenerated===!0?t.createPreChatForm(n,i):(document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="visible",document.querySelector(".chat-fc-form-outer")===null?null:document.querySelector(".chat-fc-form-outer").style.visibility="hidden")}))})):(console.log("Outside Business Hours"),document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="visible")}else console.log("Business Hours Not Configured for "+u+" so widget will be always shown"),document.querySelector("."+window.fcSettings.config.cssNames.widget).style.visibility="visible"}else window.fcWidget.user.isExists(function(r){r.data===!1?(t.chatCustomData.userCreated=!1,document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="hidden",t.createPreChatForm(n,i)):(t.chatCustomData.userCreated=!0,window.fcWidget.user.get(function(r){r.data.isNameGenerated===!0?t.createPreChatForm(n,i):(document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="visible",document.querySelector(".chat-fc-form-outer")===null?null:document.querySelector(".chat-fc-form-outer").style.visibility="hidden")}))})})},on_fc_pre_form_submit:function(){var t=this,e=document.querySelector(".chat-fc-form"),f,u,n;if(e.classList.add("submitted"),e.checkValidity()){f=document.querySelector(".chat-fc-form-outer .fc-button");f.classList.add("submitted");var i=Object.keys(t.fields),r=[],o=[];for(n=0;n<i.length;n++)n<=4&&(typeof t.fields[i[n]].fieldId=="undefined"?(t.fields[i[n]].label.replace(/ /g,"").toLowerCase()==="name"?r.push("firstName"):t.fields[i[n]].label.replace(/ /g,"").toLowerCase()==="firstname"?r.push("firstName"):t.fields[i[n]].label.replace(/ /g,"").toLowerCase()==="lastname"?r.push("lastName"):r.push(t.fields[i[n]].label.replace(/ /g,"").toLowerCase()),o.push(document.getElementById("chat-fc-"+t.fields[i[n]].label.replace(/ /g,"").toLowerCase()).value)):(t.fields[i[n]].fieldId.replace(/ /g,"").toLowerCase()==="name"?r.push("firstName"):t.fields[i[n]].fieldId.replace(/ /g,"").toLowerCase()==="firstname"?r.push("firstName"):t.fields[i[n]].fieldId.replace(/ /g,"").toLowerCase()==="lastname"?r.push("lastName"):r.push(t.fields[i[n]].fieldId.replace(/ /g,"").toLowerCase()),o.push(document.getElementById("chat-fc-"+t.fields[i[n]].label.replace(/ /g,"").toLowerCase()).value)));for(u={},n=0;n<r.length;n++)u[r[n]]=o[n];for(n=0;n<Object.keys(u).length;n++)u[Object.keys(u)[n]]===""?delete u[Object.keys(u)[n]]:u[Object.keys(u)[n]];window.fcWidget.user.setProperties(u,function(n){n.success===!0?(t.chatCustomData.userCreated=!0,document.querySelector(".chat-fc-form-outer").style.visibility="hidden",document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="visible",f.classList.remove("submitted"),e.classList.remove("submitted")):(f.classList.remove("submitted"),console.log("error setting user properties"))})}else this.fc_validate_on_submit()},fc_validate_on_blur:function(n){var t=n.target.id,i=t+"-error";n.type!=="change"?document.getElementById(t).value==""?(document.getElementById(i).style.display="none",document.getElementById(t).style.borderColor="#ddd"):document.getElementById(t).checkValidity()===!1?document.getElementById(i).style.display="block":(document.getElementById(i).style.display="none",document.getElementById(t).style.borderColor="#ddd"):document.getElementById(t).value===""?document.getElementById(t).checkValidity()===!1&&(document.getElementById(i).style.display="block"):(document.getElementById(i).style.display="none",document.getElementById(t).style.borderColor="#ddd")},fc_validate_on_submit:function(){for(var t,r,f=this,u=Object.keys(this.fields),i=[],n=0;n<u.length;n++)n<=4&&f.fields[u[n]].required==="yes"&&i.push(f.fields[u[n]].label.replace(/ /g,"").toLowerCase());for(n=0;n<i.length;n++)t="chat-fc-"+i[n],r="chat-fc-"+i[n]+"-error",document.getElementById(t).value===""||document.getElementById(t).value.trim()===""?(document.getElementById(r).style.display="block",document.getElementById(t).style.borderColor="red"):document.getElementById(t).checkValidity()===!1?(document.getElementById(r).style.display="block",document.getElementById(t).style.borderColor="red"):(document.getElementById(r).style.display="none",document.getElementById(t).style.borderColor="#ddd")},on_fc_pre_form_close:function(){window.fcWidget.close();document.querySelector(".chat-fc-form-outer").style.visibility="hidden";document.querySelector("."+window.fcSettings.config.cssNames.widget+" iframe").style.visibility="visible"}}}();var preChatTemplate={mainbgColor:"#29306c",maintxColor:"#fff",heading:"Live Chat",textBanner:"We can't wait to talk to you. But first, please take a couple of moments to tell us a bit about yourself.",SubmitLabel:"Start Chat",fields:{field2:{type:"name",label:"Name",fieldId:"name",required:"yes",error:"Please Enter a valid name"},field3:{type:"email",label:"Email",fieldId:"email",required:"yes",error:"Please Enter a valid Email"},field4:{type:"phone",label:"Phone",fieldId:"phone",required:"no"},field5:{type:"All information supplied in this form will be used to provide customer support",label:"All information supplied in this form will be used to provide customer support",fieldId:"messages",required:"no"}}};window.fcSettings={token:"6a086d40-7979-4991-8e74-cda3f6d55987",host:"https://wchat.freshchat.com",siteId:"TheSSLStore.com",tags:["sales","tech"],config:{hideFAQ:!0,agent:{hidePic:!0,hideBio:!0},headerProperty:{appName:"The SSL Store Assistant",appLogo:"https://d1qb2nb5cznatu.cloudfront.net/startups/i/2473-2c38490d8e4c91660d86ff54ba5391ea-medium_jpg.jpg?buster=1518574527",backgroundColor:"#29306c"},cssNames:{widget:"custom_fc_frame",expanded:"custom_fc_expanded"},headers:{chat:"Chat with Us",chat_help:"Reach out to us if you have any questions",push_notification:"Don't miss out on any replies! Allow push notifications?",csat_question:"Did we address your concerns??",csat_yes_question:"How would you rate this interaction?",csat_no_question:"How could we have helped better?",csat_thankyou:"Thanks for the response",csat_rate_here:"Submit your rating here",channel_response:{offline:"We are currently away. Please leave us a message",online:{minutes:{one:"Currently replying in X minutes ",more:"Currently replies in X minutes"},hours:{one:"Currently replying in X hour",more:"Currently replies in X hours"}}}}},onInit:function(){if(fcPreChatform.fcWidgetInit(preChatTemplate),window.navigator.userAgent.indexOf("Firefox")>0&&window.fcWidget)window.fcWidget.on("widget:loaded",function(){chatLocation=window.location.href;window.history.pushState({isChat:!0},"chat",window.location.href);window.onpopstate=function(){window.location.href!=chatLocation&&window.location.href.indexOf("#")>0||window.history.go(-2)}})}};$(document).ready(function(){jQuery("body").on("click","a.openfdchat",function(){window.fcWidget.isOpen()?fcPreChatform.on_fc_pre_form_close():window.fcWidget.open()})}),function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){return u(t[f][1][n]||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}}()({1:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}var r,u,e;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;r=f(n("./../obj/constants"));u=f(n("./../utils/common/dom"));e=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n=function(n){27===n.keyCode&&this.destroy()};return{create:function(t){var i=document,s=i.body,u=i.createElement("DIV"),f=i.createElement("IMG"),e=i.createElement("DIV"),o=i.createElement("DIV");u.setAttribute("id",r.default.modalDivId);u.onclick=this.destroy;f.setAttribute("src",t);f.onclick=this.destory;o.appendChild(f);o.className="image-cell";e.appendChild(o);e.className="image-wrapper";u.appendChild(e);s.appendChild(u);window.addEventListener?window.addEventListener("keydown",n.bind(this),!1):window.attachEvent("keydown",n.bind(this),!1)},destroy:function(){var i=document,f=i.body,t=i.getElementById(r.default.modalDivId);t&&(u.default.purge(t),f.removeChild(t));window.removeEventListener?window.removeEventListener("keydown",n.bind(this)):window.detachEvent("keydown",n.bind(this))}}}.bind(void 0)();i.default=e},{"./../obj/constants":7,"./../utils/common/dom":11}],2:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}var r,u,e;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;r=f(n("./omni/transition"));u=f(n("./omni/activity"));e={init:function(){r.default.start();u.default.start()},destroy:function(){r.default.stop();u.default.stop()}};i.default=e},{"./omni/activity":3,"./omni/transition":5}],3:[function(n,t,i){"use strict";function e(n){return n&&n.__esModule?n:{"default":n}}function u(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var f,r,o;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;f=e(n("./../../utils/frame"));r=e(n("./../../utils/common/dom"));o=function(){u(this,this);var n=null,t=null,o=null,h=function(){u(this,this);f.default.postMessage({action:"track_activity",payload:{seen:t}})}.bind(this),i=function(){u(this,this);t=(new Date).getTime()}.bind(this),c=function(n){u(this,this);r.default.unbindEvent("keypress",i);r.default.unbindEvent("mousemove",i);r.default.unbindEvent("click",i);n&&(r.default.bindEvent("keypress",i),r.default.bindEvent("mousemove",i),r.default.bindEvent("click",i))}.bind(this),v=function(){u(this,this);var i=(new Date).getTime();null===o||null===t||n&&(i<n||t<n||i-n<59e3||t>n&&t<i&&h());n=i}.bind(this),l=function(){u(this,this);o&&clearInterval(o);o=null;t=null;n=null}.bind(this),s=function(){u(this,this);l();c(!0);n=(new Date).getTime();o=setInterval(v,6e4)}.bind(this),e=function(){u(this,this);t=(new Date).getTime();h();l();c(!1)}.bind(this),a=function(){u(this,this);"hidden"===document.visibilityState&&e()}.bind(this);return{start:function(){s();r.default.bindEvent("focus",s);r.default.bindEvent("blur",e);r.default.bindEvent("beforeunload",e);r.default.bindEvent("visibilitychange",a)},stop:function(){e();r.default.unbindEvent("focus",s);r.default.unbindEvent("blur",e);r.default.unbindEvent("beforeunload",e);r.default.unbindEvent("visibilitychange",a)}}}.bind(void 0)();i.default=o},{"./../../utils/common/dom":11,"./../../utils/frame":15}],4:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r,u=(r=n("./../../utils/msg_handler"))&&r.__esModule?r:{"default":r},f={track:function(n,t){u.default.subscribe("track_event",{eventName:n,data:t})}};i.default=f},{"./../../utils/msg_handler":18}],5:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}var r,u,e;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;r=f(n("./../../utils/common/observe"));u=f(n("./../../utils/frame"));e=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var i,t,f,e=function(n){i=n.oldValue;t=n.newValue;f=n.title;u.default.postMessage({action:"track_location",payload:{pageUrl:n}})},n=function(){var n=window.location.href;t!==n&&(i=t,t=n,f=document.title,e({oldValue:i,newValue:t,title:f}))};return{start:function(){t=window.location.href;e({newValue:t,title:document.title});r.default.attach(window.history,"pushState",n);r.default.attach(window.history,"replaceState",n);window.addEventListener?(window.addEventListener("hashchange",n,!1),window.addEventListener("popstate",n,!1)):(window.attachEvent("hashchange",n,!1),window.attachEvent("popstate",n,!1))},stop:function(){i=t=void 0;r.default.detach(window.history,"pushState");r.default.detach(window.history,"replaceState");window.removeEventListener?(window.removeEventListener("hashchange",n),window.removeEventListener("popstate",n)):(window.detachEvent("hashchange",n),window.detachEvent("popstate",n))},track:e}}.bind(void 0)();i.default=e},{"./../../utils/common/observe":13,"./../../utils/frame":15}],6:[function(n){"use strict";var t,u,r=(t=n("./widget"))&&t.__esModule?t:{"default":t},i;(window.fcWidget||(window.fcWidget=r.default),window.fcSettings)&&("complete"===document.readyState?(i=window.fcSettings.onInit,i&&"function"==typeof i&&i(),r.default.init(window.fcSettings)):document.onreadystatechange=(u=r.default,function(){if("complete"===document.readyState){var n=window.fcSettings.onInit;n&&"function"==typeof n&&n();u.init(window.fcSettings)}}))},{"./widget":23}],7:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;i.default={SAMPLE_TOKEN:"WEB_CHAT_TOKEN",frameDivId:"fc_frame",frameId:"fc_widget",pushFrameDivId:"fc_push_frame",pushFrameId:"fc_push",modalDivId:"fc_web_modal",classes:{fullscreenClass:"fc-widget-fullscreen"},AJAX_URL:{canary:"/app/services/app/webchat/{token}/canary"},canaryRoutes:{feature:"canary",rts:"rtscanary"}}},{}],8:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n=!1,t=!1,i=!1,r=!1,u=[],f={};return{isLoaded:function(){return n},loaded:function(t){n=t},isInitialized:function(){return t},initialized:function(n){t=n},isOpened:function(){return i},opened:function(n){i=n},doOpen:function(){return r},openOnLoad:function(n){r=n},getTags:function(){return u},setTags:function(n){u=n},getFaqTags:function(){return f},setFaqTags:function(n){f=n},reset:function(){n=!1;t=!1;i=!1;r=!1;u=[];f={}}}}.bind(void 0)();i.default=r},{}],9:[function(n,t,i){"use strict";function r(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var u=function(){r(this,this);var t=null,i=null,f=null,e=null,o=null,s=!1,u={},n={},h=["firstName","lastName","email","phone","phoneCountry","locale"];return{getFlowId:function(){return f},setFlowId:function(n){f=n},getFlowVersionId:function(){return e},setFlowVersionId:function(n){e=n},getPreviewMode:function(){return o},setPreviewMode:function(n){o=n},getExternalId:function(){return t},setExternalId:function(n){t=n},getRestoreId:function(){return i},setRestoreId:function(n){i=n},setIdentifyByReferenceId:function(n){s=n},getIdentifyByReferenceId:function(){return s},getConfig:function(){return u},setConfig:function(n){u=n},getProperties:function(){return n},setProperties:function(t){t&&(h.forEach(function(i){r(this,this);t[i]&&(n[i]=t[i])}.bind(this)),t.meta&&this.setUserMeta(t.meta))},setFirstName:function(t){n.firstName=t},setLastName:function(t){n.lastName=t},setEmail:function(t){n.email=t},setPhone:function(t){n.phone=t},setPhoneCountry:function(t){n.phoneCountry=t},setUserMeta:function(t){if(n.meta=n.meta||{},t)for(var i in t)t.hasOwnProperty(i)&&(n.meta[i]=t[i])},setLocale:function(t){n.locale=t},reset:function(){t=null;i=null;u={};n={}},getJSON:function(){return{externalId:t,restoreId:i,customConfig:u,properties:n}}}}.bind(void 0)();i.default=u},{}],10:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r,u=(r=n("./common/dom"))&&r.__esModule?r:{"default":r},f=function(){return function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}(this,this),{init:function(n){var t=document.createElement("script"),i=u.default.cdn_url()?u.default.cdn_url():n.host;t.type="text/javascript";t.src=i+"/js/co-browsing.js";(document.body?document.body:document.getElementsByTagName("head")[0]).appendChild(t);window.fc_cobrowse={host:n.host,locale:n.locale}}}}.bind(void 0)();i.default=f},{"./common/dom":11}],11:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var h,c=(h=n("../../../config/cb_environment"))&&h.__esModule?h:{"default":h},a,u,l,v,o,r,e,f,s,y={url_domain:function(n){var t=document.createElement("a");return t.href=n,t.origin},getElementStyle:function(n,t){return window.getComputedStyle(n)[t]},setAttr:function(n,t){for(var i in t)t.hasOwnProperty(i)&&n.setAttribute(i,t[i]);return n},remove:function(n){var i=document,r=i.body,t=i.getElementById(n);t&&(this.purge(t),r.removeChild(t))},purge:function(n){var t,r,u,i=n.attributes;if(i)for(t=i.length-1;t>=0;t-=1)"function"==typeof n[u=i[t].name]&&(n[u]=null);if(i=n.childNodes)for(r=i.length,t=0;t<r;++t)this.purge(n.childNodes[t])},cdn_url:function(){if(c.default&&c.default.config){var t=c.default.config.type,n=c.default.config.cdn;return n.protocol[t]+(n.enabled.forAssets?n.assets:"")+n.domain[t]}},bindEvent:function(n,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];window.addEventListener?window.addEventListener(n,t,i):window.attachEvent(n,t,i)},unbindEvent:function(n,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];window.removeEventListener?window.removeEventListener(n,t,i):window.detachEvent(n,t,i)},parseJSON:function(n){var t;if(n){try{t=JSON.parse(n)}catch(i){}return t}},stringifyJSON:function(n){var i=null,t;if(n){try{t=window.ItilUtil&&window.ItilUtil.jsonStringifyWrapper;i=t&&"function"==typeof t&&t(n)||JSON.stringify(n)}catch(r){}return i}},storageAvailable:function(){var i,t;try{return t="__storage_test__",(i=window.localStorage).setItem(t,t),i.removeItem(t),!0}catch(n){return n instanceof DOMException&&(22===n.code||1014===n.code||"QuotaExceededError"===n.name||"NS_ERROR_DOM_QUOTA_REACHED"===n.name)&&0!==i.length}}(),isPushSupportedByBrowser:function(){var t,i,r,u,n,f,e,o,s=!1,h=!1;u=window.chrome;n=window.navigator;f=n.vendor;e=n.userAgent.indexOf("OPR")>-1;o=n.userAgent.indexOf("Edge")>-1;null!=u&&"Google Inc."===f&&!1===e&&!1===o&&(t=!!(r=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./))&&parseInt(r[2],10))&&(s=t>=50);navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(i=function(){var t=navigator.userAgent,i=t.indexOf("Firefox"),n=t.substring(i+8).split(".");return!(!n||!n.length)&&parseInt(n[0],10)}())&&(h=i>=44);var c="serviceWorker"in navigator,l=function(){var n=!1;try{ServiceWorkerRegistration&&"showNotification"in ServiceWorkerRegistration.prototype&&(n=!0)}catch(t){}return n}(),a="PushManager"in window;return c&&l&&a&&(s||h)},getAgent:(o=navigator.appVersion,r=navigator.userAgent,e=navigator.appName,f=""+parseFloat(o),s=parseInt(o,10),-1!==r.indexOf("Station")&&(v="Station"),-1!==(u=r.indexOf("Opera"))?(e="Opera",f=r.substring(u+6),-1!==(u=r.indexOf("Version"))&&(f=r.substring(u+8))):-1!==(u=r.indexOf("MSIE"))?(e="Microsoft Internet Explorer",f=r.substring(u+5)):-1!==(u=r.indexOf("Edge"))?(e="Edge",f=r.substring(u+5)):-1!==(u=r.indexOf("Trident"))?(e="Trident",f=r.substring(u+8)):-1!==(u=r.indexOf("Chrome"))?(e="Chrome",f=r.substring(u+7)):-1!==(u=r.indexOf("Safari"))?(e="Safari",f=r.substring(u+7),-1!==(u=r.indexOf("Version"))&&(f=r.substring(u+8))):-1!==(u=r.indexOf("Firefox"))?(e="Firefox",f=r.substring(u+8)):-1===(u=r.indexOf("Mobile"))||-1===r.indexOf("iPad")&&-1===r.indexOf("iPhone")&&-1===r.indexOf("iPod")&&-1===r.indexOf("wv")?(a=r.lastIndexOf(" ")+1)<(u=r.lastIndexOf("/"))&&(e=r.substring(a,u),f=r.substring(u+1),e.toLowerCase()===e.toUpperCase()&&(e=navigator.appName)):(e="WebView",f=r.substring(u+8)),-1!==(l=f.indexOf(";"))&&(f=f.substring(0,l)),-1!==(l=f.indexOf(" "))&&(f=f.substring(0,l)),s=parseInt(""+f,10),isNaN(s)&&(f=""+parseFloat(o),s=parseInt(o,10)),{name:e,appName:v,version:s,versionx:f,os:navigator.platform}),isSafariBrowser:function(){return!(!this.getAgent||"Safari"!==this.getAgent.name)}};i.default=y},{"../../../config/cb_environment":24}],12:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;i.default={isFunction:function(n){return!(!n||"function"!=typeof n)}}},{}],13:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n={};return{attach:function(t,i,r){var u="".concat(i).concat("_fc_observer");t[i]&&r&&(void 0===t[u]||t[u]!==r)&&(t[u]=r,function(t,i){n[i]=t[i];t[i]=function(){var u=n[i].apply(t,arguments),r=t["".concat(i).concat("_fc_observer")];return"function"==typeof r&&r(),u}}(t,i))},detach:function(t,i){var r="".concat(i).concat("_fc_observer");t[i]&&t[r]&&(t[r]=void 0,function(t,i){n[i]&&(delete t[i],t[i]=n[i],delete n[i])}(t,i))}}}.bind(void 0)();i.default=r},{}],14:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r,u=(r=n("./common/js_util"))&&r.__esModule?r:{"default":r},f=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n={},t=["widget:opened","widget:closed","widget:loaded","dialog:opened","dialog:closed","widget:destroyed","frame:statechange","user:statechange","user:created","user:cleared","user:authenticated","message:sent","message:received","unreadCount:notify","push:subscribed","readReceipts:update","csat:received","csat:updated","csat:show","anchorLink:clicked","faq:clicked","download:file","rts:connected","rts:disconnected"];return{clear:function(){n={}},valid:function(n){return!(!n||!t)&&-1!==t.indexOf(n)},subscribe:function(t,i){this.valid(t)&&(void 0===n[t]&&(n[t]=[]),n[t].push(i))},unsubscribe:function(t,i){var e,f,r,o;if(this.valid(t)&&(f=n&&n[t],f))for(r=0,o=f.length;r<o;r++)if(e=f[r],u.default.isFunction(e)&&(!i||e.name===i.name)){n[t].splice(r,1);break}},publish:function(t,i,r){var u,e;if(this.valid(t)&&(u=n&&n[t],u))for(var o=function(n){return function(){i?n(i):n()}},f=0,s=u.length;f<s;f++)e=o(u[f]),r?setTimeout(e,0):e()}}}.bind(void 0)();i.default=f},{"./common/js_util":12}],15:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}function o(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var s;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r=f(n("./../obj/constants")),e=f(n("./../obj/user")),u=f(n("./common/dom"));s=function(){o(this,this);var f=null,t=null,s=null,v=null,n=null,i=null,h=!1,c=!1,l=null,a=!1,y=null,p=null,w=null,b=null,k=["get_user_uuid"];return{getHost:function(){return n},getToken:function(){return t},getReferrer:function(){return s},getSiteId:function(){return v},getSettings:function(){return i},setSettings:function(n){h=!!((i=n).userAuthConfig&&i.userAuthConfig.jwtAuthEnabled&&i.userAuthConfig.strictModeEnabled);c=!(!i.userAuthConfig||!i.userAuthConfig.jwtAuthEnabled)},isJWTStrictMode:function(){return h},isJWTEnabled:function(){return c},getJWTAuthToken:function(){return l},setJWTAuthToken:function(n){l=n},isLoaded:function(){return a},loaded:function(n){a=n},loadingActions:function(){return k},init:function(i){t=i.token;s=i.referrer;n=i.host;v=i.siteId;h=!1;c=!1;l=i.jwtAuthToken;a=!1;y=i.flowId;p=i.flowVersionId;w=i.previewMode;b=i.cspNonce},reset:function(){t=s=n=v=h=c=l=a=y=p=w=void 0},getJSON:function(){return{token:t,flowId:y,flowVersionId:p,previewMode:w,referrer:s,host:n,siteId:v,jwtStrictMode:h,jwtEnabled:c,jwtAuthToken:l,loaded:a}},load:function(n,t,i){if(u.default.isSafariBrowser()&&b){var r=document.createElement("script");r.nonce=b;r.textContent='window.location = "'.concat(n,'"');f=i.contentWindow;i.contentDocument.body.appendChild(r)}else f=window.open(n,t)},postMessage:function(t){f&&f.postMessage(t,n)},dispatch:function(n,t){n&&t&&"function"==typeof n&&n(t)},unload:function(){this.postMessage({action:"push_subscribe_destroy"})},add:function(){var i=document,s=i.body,n=i.getElementById(r.default.frameDivId),f=i.createElement("IFRAME"),t=e.default.getConfig(),o=t&&t.cssNames,h=t&&t.widgetCanary;n&&"DIV"===n.tagName||(n=i.createElement("DIV"),s.appendChild(n));u.default.setAttr(n,{id:r.default.frameDivId,"class":o&&o.widget||""});n.classList.add("fc_dn");t&&t.headerProperty?("ltr"===t.headerProperty.direction&&n.classList.add("fc_l2r"),t.headerProperty.hideChatButton||n.classList.remove("fc_dn")):n.classList.remove("fc_dn");u.default.setAttr(f,{id:r.default.frameId,name:r.default.frameId,title:"Chat",frameborder:"0",allowFullScreen:"true",webkitallowfullscreen:"true",mozallowfullscreen:"true"});n.appendChild(f);h?this.loadCanaryWidget(r.default.canaryRoutes.feature,f):this.loadRTSCanaryWidget(f)},loadRTSCanaryWidget:function(i){var f=new XMLHttpRequest,e=r.default.AJAX_URL.canary.replace("{token}",t);e=n+e;f.open("GET",e,!0);f.onreadystatechange=function(){if(o(this,this),4===f.readyState){var n=u.default.parseJSON(f.response),t=n&&n.canary_enabled?r.default.canaryRoutes.rts:"";this.loadCanaryWidget(t,i)}}.bind(this);f.send()},loadCanaryWidget:function(i,u){this.load("".concat(n,"/widget/").concat(i,"?token=").concat(t,"&referrer=").concat(s),r.default.frameId,u)},remove:function(n){u.default.remove(n);f=null},setFrameSize:function(){var i=this.getSettings(),n=e.default.getConfig();if(null===i)return"";var t=i.widgetSize,o=!(!n||!n.fullscreen)&&n.fullscreen,u="fc-widget-normal",f=document.getElementById(r.default.frameDivId);!0===o&&f.classList.add(r.default.classes.fullscreenClass);t&&t.length>0&&(u="fc-widget-"+t.toLowerCase());f.classList.add(u)},setWidgetDisplayStyle:function(){var t=document.body,i=document.getElementById(r.default.frameDivId),n=u.default.getElementStyle(t,"display");n&&-1!==["flex","grid"].indexOf(n)&&u.default.setAttr(i,{style:"display: ".concat(n)})}}}.bind(void 0)();i.default=s},{"./../obj/constants":7,"./../obj/user":9,"./common/dom":11}],16:[function(n,t,i){"use strict";function s(n){return n&&n.__esModule?n:{"default":n}}function a(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}var v,y;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var c=s(n("./common/dom")),r=s(n("./frame")),u=s(n("./events")),e=s(n("../obj/constants")),h=s(n("../obj/state")),f=s(n("../obj/user")),p=s(n("./msg_handler")),o=s(n("./push_frame")),w=s(n("../helpers/modal")),l=s(n("../helpers/omni")),b=s(n("./msg_processor")),k=s(n("./cb"));y={onMessageCB:function(){return v||(v=this.onMessage.bind(this))},onVisibilityChangeCB:function(){var n;return function(){return n||(n=this.onVisibilityChange.bind(this))}}(),subscribe:function(){window.addEventListener?(window.addEventListener("message",this.onMessageCB(),!1),window.addEventListener("focus",this.onVisibilityChangeCB(),!1),window.addEventListener("blur",this.onVisibilityChangeCB(),!1)):(window.attachEvent("onmessage",this.onMessageCB()),window.attachEvent("focus",this.onVisibilityChangeCB()),window.attachEvent("blur",this.onVisibilityChangeCB()))},unsubscribe:function(){window.removeEventListener?(window.removeEventListener("message",this.onMessageCB(),!1),window.removeEventListener("focus",this.onVisibilityChangeCB(),!1),window.removeEventListener("blur",this.onVisibilityChangeCB(),!1)):(window.detachEvent("onmessage",this.onMessageCB()),window.detachEvent("focus",this.onVisibilityChangeCB()),window.detachEvent("blur",this.onVisibilityChangeCB()))},onVisibilityChange:function(n){switch(n.type){case"focus":r.default.postMessage({action:"widget_focus"});break;case"blur":r.default.postMessage({action:"widget_blur",payload:{title:document.title,location:window.location.href}});o.default.postMessage({action:"widget_location",openWindow:!1,payload:window.location.href})}},onUserCreate:function(n){u.default.publish("user:created",n)},loadWidget:function(){var u,o;if(!1===h.default.isInitialized()){h.default.initialized(!0);var n=r.default.getJSON(),s=f.default.getProperties(),i=f.default.getConfig(),l=h.default.getTags(),v=h.default.getFaqTags();if(n.externalId=f.default.getExternalId(),n.restoreId=f.default.getRestoreId(),n.flowId=f.default.getFlowId(),n.flowVersionId=f.default.getFlowVersionId(),n.previewMode=f.default.getPreviewMode(),n.identifyByReferenceId=f.default.getIdentifyByReferenceId(),s&&(n.properties=s),i&&(n.config=i),l&&(n.tags=l),v&&(n.faqTags=v),n.userAgent=c.default.getAgent,c.default.storageAvailable){var e=n.token,y=localStorage.getItem(e),t=n.siteId?"".concat(n.token,"_").concat(n.siteId):null,p=t?localStorage.getItem(t):null;((y||t&&p)&&(n.storage={},n.storage[e]=y||JSON.stringify({}),t&&(n.storage[t]=p||JSON.stringify({}))),i&&i.overrideDS)&&(u="lsds_".concat(t||e),o=localStorage.getItem(u),o?n.lsds=a({},u,o):(n.lsds=a({},u,JSON.stringify({})),n.migrateLFDS=!0))}r.default.setFrameSize();r.default.setWidgetDisplayStyle();r.default.postMessage({action:"load_widget",payload:n})}},unloadWidget:function(){o.default.isLoaded()&&o.default.unload();h.default.reset();f.default.reset();l.default.destroy();r.default.reset();r.default.remove(e.default.frameDivId);this.unsubscribe();u.default.publish("widget:destroyed",null,!0);u.default.clear()},updateFrameSettings:function(n){if(null!==r.default.getSettings()||void 0===n)return!1;r.default.setSettings(n)},onMessage:function(n){var vt=n.origin||n.originalEvent.origin,yt=f.default.getConfig(),v=yt&&yt.cssNames,t,nt,s,ut,d,et,a,y,rt,g,ot,dt,st,ht,ct,lt,at;if((vt===r.default.getHost()||vt===o.default.getHostOrigin())&&(t=n.data,nt=t&&t.action,this.updateFrameSettings(t.settingsPayload),nt)){s=document.getElementById(e.default.frameDivId);ut=v&&v.expanded||"expanded";switch(nt){case"push_subscribe_destroy_response":this.unloadWidget();break;case"push_user_meta":u.default.publish("push:subscribed",t.data);r.default.postMessage(t);break;case"toggle_dialog":t.data?u.default.publish("dialog:opened"):u.default.publish("dialog:closed");break;case"notify_frame":var tt=t.data,i=document.getElementById(e.default.frameDivId),ft=v&&v.open||"fc-open";"expand"===tt?(i.removeAttribute("style"),i.classList.add("h-open-notify"),i.classList.add(ft),i.classList.add(tt)):"close"===tt?(i.removeAttribute("style"),i.classList.remove("h-open-notify"),i.classList.remove(ft),i.classList.remove("expand")):"mobile-view"===tt?i.classList.add("fc-mobile-view"):(i.classList.add("h-open-notify"),i.classList.add(ft));break;case"resize_frame":d=document.getElementsByTagName("BODY")[0];et=v&&v.open||"fc-open";h.default.opened(t.isOpen);h.default.isOpened()?(s.classList.add("h-open-container"),s.classList.add(et),u.default.publish("widget:opened"),d&&d.classList.add("fc-widget-open")):(s.removeAttribute("style"),s.classList.remove("h-open-container"),s.classList.remove(et),u.default.publish("widget:closed"),d&&d.classList.remove("fc-widget-open"));break;case"toggle_frame":t.show?s.classList.remove("hide"):-1===s.className.trim().indexOf("hide")&&s.classList.add("hide");break;case"push_frame_loaded":o.default.loaded(!0);o.default.setSource(n&&n.source);o.default.postMessage({action:"widget_location",openWindow:!1,payload:window.location.href});r.default.postMessage({action:"widget_location",payload:{title:document.title,location:window.location.href}});break;case"frame_state_change":var pt=document.getElementById(e.default.frameDivId),wt=t&&t.data,it=wt&&wt.frameState,bt=r.default.getSettings()&&r.default.getSettings().enabledFeatures;u.default.publish("frame:statechange",t);"initialized"===it&&(r.default.isJWTEnabled()&&r.default.isJWTStrictMode()&&pt.classList.add("fc_dn"),this.loadWidget(),bt&&-1!==bt.indexOf("COBROWSING")&&k.default.init({host:r.default.getHost(),locale:f.default.getProperties().locale}));"loaded"===it&&r.default.loaded(!0);"authenticated"!==it&&"not_authenticated"!==it||r.default.isJWTEnabled()&&r.default.isJWTStrictMode()&&(t.success?pt.classList.remove("fc_dn"):304!==t.status&&this.unloadWidget());break;case"widget_loaded":h.default.loaded(!0);u.default.publish("widget:loaded");o.default.isLoaded()||o.default.init({host:t.pushDomain+"?ref="+btoa(window.location.origin),hostOrigin:c.default.url_domain(t.pushDomain),appLogoPath:t.appLogoPath,locale:t.locale});h.default.doOpen()&&r.default.postMessage({action:"open_chat"});r.default.postMessage({action:"widget_location",payload:{title:document.title,location:window.location.href}});break;case"datastore_loaded":r.default.postMessage({action:"load_rules"});break;case"rules_loaded":l.default.init();b.default.start();break;case"enlarge_image":w.default.create(t.picUrl);break;case"expand_all":document.getElementById(e.default.frameDivId).classList.add("expanded-modal");document.getElementById(e.default.frameDivId).classList.add(ut);break;case"expand_article_view":document.getElementById(e.default.frameDivId).classList.toggle("expanded-article_view");break;case"set_bubble_height":document.getElementById(e.default.frameDivId).style.height=t.height+"px";break;case"collapse_all":document.getElementById(e.default.frameDivId).classList.remove("expanded-modal");document.getElementById(e.default.frameDivId).classList.remove(ut);document.getElementById(e.default.frameDivId).classList.add("avoid-jitter");setTimeout(function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);document.getElementById(e.default.frameDivId).classList.remove("avoid-jitter")}.bind(this),300);break;case"user_state_change":u.default.publish("user:statechange",t);break;case"user_authenticated":u.default.publish("user:authenticated",t);break;case"user_created":if(a=t.data,h.default.isLoaded())a&&f.default.setRestoreId(a.restoreId),this.onUserCreate(t);else if(t.success){var gt=a&&a.externalId,ni=a&&a.restoreId,kt=f.default.getExternalId();kt?kt===gt&&(f.default.setRestoreId(ni),this.onUserCreate(t)):this.onUserCreate(t)}else this.onUserCreate(t);break;case"user_cleared":u.default.publish("user:cleared");o.default.postMessage({action:"clear:subscription",openWindow:!1});f.default.reset();break;case"message_sent":u.default.publish("message:sent",t);break;case"message_received":u.default.publish("message:received",t);break;case"read_receipts_update":u.default.publish("readReceipts:update",t);break;case"csat_updated":u.default.publish("csat:updated",t);break;case"csat_received":u.default.publish("csat:received",t);break;case"anchor_link_clicked":u.default.publish("anchorLink:clicked",t);break;case"faq_clicked":u.default.publish("faq:clicked",t);break;case"download_file":u.default.publish("download:file",t);break;case"ask_permission":o.default.postMessage({action:"ask:permission",openWindow:!0});break;case"clear_subscription":o.default.postMessage({action:"clear:subscription",openWindow:!1});break;case"unread_count_notify":u.default.publish("unreadCount:notify",t.data);break;case"message_from_agent":u.default.publish("message:received",t.data);break;case"message_from_user":u.default.publish("message:sent",t.data);break;case"set_storage_item":c.default.storageAvailable&&(y=t.data,y&&y.key&&y.value&&localStorage.setItem(y.key,JSON.stringify(y.value)));break;case"remove_storage_item":c.default.storageAvailable&&(rt=t.data,rt&&rt.key&&localStorage.removeItem(rt.key));break;case"startScreenShare":window.fc_cobrowse&&window.fc_cobrowse.allowScreenShare(n);break;case"set_lsds_item":c.default.storageAvailable&&(g=t.data,ot=g&&g.key,ot&&(dt=g&&g.value,localStorage.setItem(ot,c.default.stringifyJSON(dt))));break;case"get_lsds_item":c.default.storageAvailable&&(st=t.data,ht=st&&st.key,ht&&localStorage.getItem(ht));break;case"remove_lsds_item":c.default.storageAvailable&&(ct=t.data,lt=ct&&ct.key,lt&&localStorage.removeItem(lt));break;case"requestForAudioCall":window.fc_cobrowse&&window.fc_cobrowse.requestForAudioCall(n);break;case"rts_connected":u.default.publish("rts:connected",t.data);break;case"rts_disconnected":u.default.publish("rts:disconnected",t.data);break;case"stack_max_height":at=screen.height<=568?screen.height:screen.height-250;document.getElementById(e.default.frameDivId).style.maxHeight=at+"px";r.default.postMessage({action:"stacked_max_height",payload:{height:at}});break;default:p.default.publish(nt,t)}}},syncResponse:function(n,t){var i=n&&n.status;i?r.default.dispatch(t,{success:200===i,status:i}):r.default.dispatch(t,{success:!1,status:400})}};i.default=y},{"../helpers/modal":1,"../helpers/omni":2,"../obj/constants":7,"../obj/state":8,"../obj/user":9,"./cb":10,"./common/dom":11,"./events":14,"./frame":15,"./msg_handler":18,"./msg_processor":19,"./push_frame":21}],17:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r,u=(r=n("./msg_handler"))&&r.__esModule?r:{"default":r},f={send:function(n,t,i){t&&"function"==typeof t&&(i=t,t=null);u.default.subscribe(n,t,i)}};i.default=f},{"./msg_handler":18}],18:[function(n,t,i){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}var f;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r=u(n("./frame")),e=u(n("./../obj/state")),o=u(n("./queue"));f=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n={};return{subscribe:function(t,i,u){e.default.isLoaded()||r.default.isLoaded()&&-1!==r.default.loadingActions().indexOf("get_user_uuid")?(n[t+"_ack"]=u,r.default.postMessage({action:t,payload:i})):o.default.enque({action:t,payload:i,handler:u})},publish:function(t,i){r.default.dispatch(n[t],{success:i.success,status:i.status,data:i.data})}}}.bind(void 0)();i.default=f},{"./../obj/state":8,"./frame":15,"./queue":22}],19:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}function e(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var r,u,o;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;r=f(n("./queue"));u=f(n("./msg_handler"));o={start:function(){r.default.isEmpty()||r.default.isLocked()||(r.default.toggleLock(!0),this.run())},run:function(){var n=r.default.deque();n?this.process(n):r.default.toggleLock(!1)},process:function(n){n.handler?u.default.subscribe(n.action,n.payload,function(t){e(this,this);"function"==typeof n.handler&&n.handler(t);this.run()}.bind(this)):(u.default.subscribe(n.action,n.payload),setTimeout(function(){e(this,this);this.run()}.bind(this),0))}};i.default=o},{"./msg_handler":18,"./queue":22}],20:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r,u=(r=n("./msg_handler"))&&r.__esModule?r:{"default":r},f={send:function(n,t){return new Promise(function(i,r){u.default.subscribe(n,t,function(n){var t=n&&n.status,u=n&&n.success;200===t||u?i(n):r(n)})})}};i.default=f},{"./msg_handler":18}],21:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}var u,r,e;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;u=f(n("./common/dom"));r=f(n("../obj/constants"));e=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n=null,t=null,i=null,f=!1,o=null,e=null;return{isLoaded:function(){return f},loaded:function(n){f=n},getSource:function(){return e},setSource:function(n){e=n},getHost:function(){return n},getHostOrigin:function(){return t},getLogoPath:function(){return i},init:function(r){n=r.host;t=r.hostOrigin;i=r.appLogoPath;o=r.locale;this.load()},reset:function(){n=null;t=null;i=null;o=null;f=!1;e=null},postMessage:function(t){t.openWindow?window.open(n+"&action="+btoa(t.action)+"&appLogoPath="+btoa(i)+"&locale="+btoa(o),"_blank","toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400"):f&&this.post({action:t.action,payload:t.payload})},post:function(n){e.postMessage(n,t)},add:function(){var i=document,e=i.body,t=i.getElementById(r.default.pushFrameDivId),f=i.createElement("IFRAME");t&&"DIV"===t.tagName||(t=i.createElement("DIV"),e.appendChild(t));t.setAttribute("id",r.default.pushFrameDivId);u.default.setAttr(f,{id:r.default.pushFrameId,src:n,frameborder:"0"});t.appendChild(f)},load:function(){u.default.isPushSupportedByBrowser()&&this.add()},unload:function(){u.default.remove(r.default.pushFrameDivId);this.reset()}}}.bind(void 0)();i.default=e},{"../obj/constants":7,"./common/dom":11}],22:[function(n,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var r=function(){(function(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");})(this,this);var n=[],t=!1;return{enque:function(i){t||(void 0===n&&(n=[]),n.push(i))},deque:function(){if(n&&n.length)return n.shift()},toggleLock:function(n){t=n},isLocked:function(){return t},isEmpty:function(){return!n||!n.length}}}.bind(void 0)();i.default=r},{}],23:[function(n,t,i){"use strict";function f(n){return n&&n.__esModule?n:{"default":n}}function v(n,t){if(n!==t)throw new TypeError("Cannot instantiate an arrow function");}var p;Object.defineProperty(i,"__esModule",{value:!0});i.default=void 0;var c=f(n("./obj/constants")),u=f(n("./obj/state")),r=f(n("./obj/user")),e=f(n("./utils/msg_promise")),o=f(n("./utils/msg_callback")),h=f(n("./utils/msg_handler")),l=f(n("./utils/common/dom")),s=f(n("./utils/frame")),y=f(n("./utils/message")),a=f(n("./utils/events")),w=f(n("./utils/push_frame")),b=f(n("./helpers/omni/analytics")),k=f(n("./helpers/omni/transition")),d=f(n("./helpers/omni"));p=function(){return v(this,this),{init:function(n){var f,i,o,t,h=-1!==["Chrome","Firefox","Safari","Edge","Trident","WebView"].indexOf(l.default.getAgent.name),v=-1!==["Station"].indexOf(l.default.getAgent.appName),e;!h||v||this.isInitialized()||(e=n&&n.token,e&&e.toUpperCase()!==c.default.SAMPLE_TOKEN&&(window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),n.referrer=btoa(window.location.origin),void 0===n.open&&(n.open=!1),t=n,u.default.reset(),r.default.reset(),d.default.destroy(),y.default.unsubscribe(),s.default.init({host:t.host.trim(),token:t.token.trim(),referrer:t.referrer,siteId:t.siteId,flowId:t.flowId,flowVersionId:t.flowVersionId,previewMode:t.previewMode,jwtAuthToken:t.jwtAuthToken,cspNonce:t.cspNonce}),u.default.openOnLoad(t.open),t.identifyByReferenceId&&r.default.setIdentifyByReferenceId(!0),t.flowId&&r.default.setFlowId(t.flowId),t.flowVersionId&&r.default.setFlowVersionId(t.flowVersionId),t.previewMode&&r.default.setPreviewMode(t.previewMode),t.externalId&&(r.default.setExternalId(t.externalId),r.default.setRestoreId(t.restoreId)),t.tags&&t.tags.length&&u.default.setTags(t.tags),t.faqTags&&u.default.setFaqTags(t.faqTags),r.default.setProperties({firstName:t.firstName,lastName:t.lastName,email:t.email,phone:t.phone,phoneCountry:t.phoneCountryCode,locale:t.locale,meta:t.meta}),r.default.setConfig(t.config),t.onLoad&&a.default.subscribe("widget:loaded",t.onLoad),s.default.add(),y.default.subscribe(),f=document,i=f.createElement("link"),o=l.default.cdn_url()?l.default.cdn_url():s.default.getHost(),i.href=o+"/css/widget.css?t="+(new Date).getTime(),i.rel="stylesheet",f.getElementsByTagName("head")[0].appendChild(i)))},destroy:function(){w.default.unload();s.default.unload()},isOpen:function(){return u.default.isOpened()},isInitialized:function(){return!!s.default.getToken()},isLoaded:function(){return u.default.isLoaded()},on:function(n,t){a.default.subscribe(n,t)},off:function(n,t){a.default.unsubscribe(n,t)},open:function(n){n?h.default.subscribe("open_channel",n):h.default.subscribe("open_chat")},close:function(){h.default.subscribe("close_chat")},show:function(){h.default.subscribe("show_chat")},hide:function(){h.default.subscribe("hide_chat")},setTags:function(n){u.default.isLoaded()&&(n&&n.length?u.default.setTags(n):u.default.setTags([]),h.default.subscribe("set_tags",{tags:u.default.getTags(),force:!0}))},setFaqTags:function(n){u.default.isLoaded()&&(n?u.default.setFaqTags(n):u.default.setFaqTags({}),h.default.subscribe("set_faq_tags",{faqTags:u.default.getFaqTags(),force:!0}))},setExternalId:function(n,t){var i={};if(n){if("string"==typeof n?i.externalId=n:i=n,!(void 0===window.Promise||t&&"function"==typeof t))return e.default.send("set_external_id",i);o.default.send("set_external_id",i,t)}},setConfig:function(n){var t=document.getElementById(c.default.frameDivId);t&&n&&(void 0!==n.fullscreen&&(t.classList.remove(c.default.classes.fullscreenClass),!0===n.fullscreen&&t.classList.add(c.default.classes.fullscreenClass)),n.headerProperty&&(void 0!==n.headerProperty.direction&&(t.classList.remove("fc_l2r"),"ltr"===n.headerProperty.direction&&t.classList.add("fc_l2r")),void 0!==n.headerProperty.hideChatButton&&(t.classList.remove("fc_dn"),n.headerProperty.hideChatButton&&t.classList.add("fc_dn"))));h.default.subscribe("set_custom_config",n)},user:{get:function(n){if(!(void 0===window.Promise||n&&"function"==typeof n))return e.default.send("get_user");o.default.send("get_user",n)},isExists:function(n){if(!(void 0===window.Promise||n&&"function"==typeof n))return e.default.send("user_exists");o.default.send("user_exists",n)},update:function(n,t){if(n.jwtAuthToken?s.default.setJWTAuthToken(n.jwtAuthToken):(n.firstName&&r.default.setFirstName(n.firstName),n.lastName&&r.default.setLastName(n.lastName),n.email&&r.default.setEmail(n.email),n.phone&&r.default.setPhone(n.phone),n.phoneCountry&&r.default.setPhoneCountry(n.phoneCountry),n.meta&&r.default.setUserMeta(n.meta)),!(void 0===window.Promise||t&&"function"==typeof t))return e.default.send("update_user",n);o.default.send("update_user",n,t)},setProperties:function(n,t){var i={};if(n.jwtAuthToken?(s.default.setJWTAuthToken(n.jwtAuthToken),i=n):(n.firstName&&(i.firstName=n.firstName,n.firstName=void 0),n.lastName&&(i.lastName=n.lastName,n.lastName=void 0),n.email&&(i.email=n.email,n.email=void 0),n.phone&&(i.phone=n.phone,n.phone=void 0),n.phoneCountryCode&&(i.phoneCountry=n.phoneCountryCode,n.phoneCountryCode=void 0),n.locale&&(i.locale=n.locale,n.locale=void 0),i.meta=n,r.default.setProperties(i)),!(void 0===window.Promise||t&&"function"==typeof t))return e.default.send("set_user_properties",i);o.default.send("set_user_properties",i,t)},setFirstName:function(n,t){var i={};if(n){if("string"==typeof n?i.firstName=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},setLastName:function(n,t){var i={};if(n){if("string"==typeof n?i.lastName=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},setEmail:function(n,t){var i={};if(n){if("string"==typeof n?i.email=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},setPhone:function(n,t){var i={};if(n){if("string"==typeof n?i.phone=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},setPhoneCountryCode:function(n,t){var i={};if(n){if("string"==typeof n?i.phoneCountryCode=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},setMeta:function(n,t){if(!t)return this.setProperties(n);this.setProperties(n,t)},setLocale:function(n,t){var i={};if(n){if("string"==typeof n?i.locale=n:i=n,!t)return this.setProperties(i);this.setProperties(i,t)}},clear:function(n){if(!(void 0===window.Promise||n&&"function"==typeof n))return e.default.send("reset_user");o.default.send("reset_user",n)},create:function(n,t){if("function"==typeof n&&(t=n,n=null),!(void 0===window.Promise||t&&"function"==typeof t))return e.default.send("create_user",n);o.default.send("create_user",n,t)},clone:function(n,t){if("function"==typeof n&&(t=n,n=null),!(void 0===window.Promise||t&&"function"==typeof t))return e.default.send("clone_user",n);o.default.send("clone_user",n,t)},getUUID:function(n){if(!(void 0===window.Promise||n&&"function"==typeof n))return e.default.send("get_user_uuid");o.default.send("get_user_uuid",n)},generateUUID:function(n){if(!(void 0===window.Promise||n&&"function"==typeof n))return e.default.send("generate_user_uuid");o.default.send("generate_user_uuid",n)}},track:b.default.track,trackPage:function(n,t){k.default.track({newValue:n,title:t,force:!0})},authenticate:function(n){if(s.default.isJWTEnabled()){var i=function(){v(this,this);s.default.setJWTAuthToken(n);s.default.postMessage({action:"authenticate_user",payload:n})}.bind(this),t=function(t){v(this,this);t&&200===t.status?this.user.update({jwtAuthToken:n}):i()}.bind(this);this.isLoaded()?void 0===window.Promise?this.user.get(t):this.user.get().then(t,t):i()}}}}.bind(void 0)();i.default=p},{"./helpers/omni":2,"./helpers/omni/analytics":4,"./helpers/omni/transition":5,"./obj/constants":7,"./obj/state":8,"./obj/user":9,"./utils/common/dom":11,"./utils/events":14,"./utils/frame":15,"./utils/message":16,"./utils/msg_callback":17,"./utils/msg_handler":18,"./utils/msg_promise":20,"./utils/push_frame":21}],24:[function(n,t,i){i.config={type:"production",cdn:{enabled:{forAssets:!1,forApi:!1},assets:"assetscdn-",api:"apicdn-",domain:{production:"wchat.freshchat.com",staging:"webchat-msgreen.freshpori.com",local:"localhost:8580"},subDomain:"",protocol:{local:"http://",production:"https://",staging:"https://"}}}},{}]},{},[6])