"use strict";function ownKeys(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,i,r,c=[],d=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(c.push(o.value),c.length!==t);d=!0);}catch(e){s=!0,a=e}finally{try{if(!d&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(s)throw a}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _typeof(e){return(_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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);t=n.call(e,t||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){var t,a,g=JSON.parse('{"RL":"https://storage.googleapis.com/widget.kenect.com/","Nc":"https://storage.googleapis.com/widget.kenect.com/build/index.html.gz","EO":"resources/button.html.gz","E9":"resources/prompt.html.gz","sD":"resources/comment.svg.gz","jr":"resources/close.svg.gz","LA":"resources/close-white.svg.gz","to":"https://storage.googleapis.com/widget.kenect.com/instances","WG":"resources/scripts/newRelic.js.gz","$b":"https://int-widget-events.kenect.com/api/v1","Xj":"SqkXDo90D#8iplyGTg0$"}'),i=function(e,t){var n,o,a=(o=e.getItem(t.key))?JSON.parse(o):{},i=a.updated_at;return!i||(n=new Date(i),o=t.expiry,i=36e5*(o=o||24),o=new Date,Math.abs(n.getTime()-o.getTime())>=i)?(e.setItem(t.key,JSON.stringify({})),{}):a.visits},r={key:"autopluck",expiry:24};function c(e){return t||(e=e||window,t=window.localStorage),t}function d(e){var t=c(),n=i(t,a);n[e]||(n[e]=0),n[e]+=1,(e={}).visits=n,e.updated_at=(new Date).toISOString(),t.setItem(a.key,JSON.stringify(e))}function e(e,t){function n(e){d(t.location.toString()),setInterval(function(){t.location.toString()!==l&&(d(t.location.toString()),l=t.location.toString())},2e3)}function o(t){return function(o,e){o=o||[],e=t||[];var a=Object.keys(o);return e.reduce(function(e,t){var n=0;return t=(t||"").toLowerCase(),a.forEach(function(e){e.toLowerCase().match(t.toLowerCase())&&(n+=o[e])}),e[t]=n,e},{})}((e=c(),i(e,a)),t);var e}return t=t||window,s=t.document,a=Object.assign({},r,e),"complete"===s.readyState||"loading"!==s.readyState&&!s.documentElement.doScroll?n():s.addEventListener("DOMContentLoaded",n),{matches:o,contains:function(e){return 0<o([e])[e]}}}var s,l;function m(e,t){(n=document.querySelectorAll("#widget-style-".concat(t)))&&n.length&&n.forEach(function(e){return e.parentNode.removeChild(e)});var n,t=(n=t,(t=document.createElement("style")).id="widget-style-".concat(n),t.type="text/css",t);t.innerHTML=e,document.head.appendChild(t)}function E(e){e=e.token;return"\n.reset-".concat(e," {\n  all: unset;\n}\n.iframe-").concat(e," {\n  border: none;\n  width: 100%;\n  height: 100%;\n  z-index: 2147483000;\n  box-sizing: border-box;\n}\n.display-none-").concat(e," {\n  display: none !important;\n}\n.hide-prompt-").concat(e," {\n  height: 0 !important;\n  width: 0 !important;\n  overflow: hidden !important;\n}\n.shadow-").concat(e," {\n  box-shadow: 0px 6px 10px rgba(26, 26, 26, 0.14), 0px 1px 18px rgba(26, 26, 26, 0.12), 0px 4px 4px rgba(26, 26, 26, 0.2);\n}\n.visibility-hidden-").concat(e," {\n  visibility: hidden;\n}\n  ")}function _(e){e=e.token;return"\n@media only screen and (max-width: 400px) {\n  .iframe-".concat(e," {\n    height: 100%;\n    width: 100%;\n    border-radius: 0;\n    left: 0;\n    top: 0;\n  }\n  .widget-iframe-").concat(e," {\n    max-height: 100%;\n  }\n  #prompt-").concat(e," {\n    max-width: 90vw;\n  }\n}\n  ")}var n="Please consider enabling localStorage, caching and/or cookies on this browser for the best user experience.";function u(e){if(!e)throw new Error("Widget token not declared for session");var t="widget-session-".concat(e),n=b(t),o=n?JSON.parse(n):{},a=null==o?void 0:o.id,e=(null==o?void 0:o.startTime)||0,n=(null==o?void 0:o.latestActivity)||0,o=(new Date).getTime(),n=n&&864e5<o-n,o={id:n||!a?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}):a,startTime:n||!e?o:e,latestActivity:o};return I(t,JSON.stringify(o)),o}function I(e,t){try{localStorage.setItem(e,t)}catch(e){console.warn(n)}}function b(e){try{return localStorage.getItem(e)}catch(e){console.warn(n)}}var f="EVENT_WIDGET_OPENED",p="EVENT_WIDGET_CLOSED",h="EVENT_SEND_MESSAGE",T="EVENT_PROMPT_CLOSED",S="WIDGET_LOADED",k="TOGGLE_IFRAME",D="OPEN_IFRAME",x="CLOSE_IFRAME",O=function(){var e;"true"===(null===(e=b("KENECT_DEBUGGING"))||void 0===e?void 0:e.toLocaleLowerCase())&&(e=console).log.apply(e,arguments)};function L(e,t,n,o){var a=t.height,i=t.width,t=e.token,e=document.getElementById(n),n=document.getElementById("".concat(n,"-iframe"));o&&e.classList.remove("visibility-hidden-".concat(t)),n.setAttribute("style","height:".concat(a,"px; width:").concat(i,"px; min-height:").concat(a,"px; min-width:").concat(i,"px; "))}function A(e,t,n,o){var a=e.token,i=e.buttonMessage,r=document.getElementById(t),e=document.createElement("iframe");e.src=n,e.id="".concat(t,"-iframe"),e.className="iframe-".concat(a),"function"==typeof o?((t=document.createElement("button")).className="reset-".concat(a),t.onclick=o,t.tabIndex=0,t.title=i||"Text Us",t.appendChild(e),r.appendChild(t)):r.appendChild(e)}function C(e,t,n){document.getElementById(n?t:"".concat(t,"-iframe")).contentWindow.postMessage({type:"WIDGET_DATA",widgetInfo:e,URLS:{icon:"".concat(g.RL).concat(g.sD),close:"".concat(g.RL).concat(g.jr),close_white:"".concat(g.RL).concat(g.LA)}},"*")}function P(e,t,n){var o=e.token,a=e.urlTrackingWords,i=document.getElementById("iframe-wrapper-".concat(o)),r=i.classList.contains("display-none-".concat(o)),e=document.getElementById("prompt-".concat(o));e&&e.classList.add("hide-prompt-".concat(o)),r?(i.classList.remove("display-none-".concat(o)),window.postMessage({type:f},"*")):(i.classList.add("display-none-".concat(o)),window.postMessage({type:p},"*"));i=document.getElementById("iframe-".concat(o));i&&(n={type:"PAGE_DATA",href:window.location.href,width:window.innerWidth,height:window.innerHeight,stats:t.matches(a),dealerId:n},O("PAGE_DATA",n),i.contentWindow.postMessage(n,"*"));o=document.getElementById("button-".concat(o,"-iframe"));o&&o.contentWindow.postMessage({type:"TOGGLE_WIDGET"},"*")}function v(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:60;try{t()}catch(e){var o=0,a=setInterval(function(){if(o<n)try{t(),clearInterval(a)}catch(e){o++}else clearInterval(a)},1e3)}}var y=_createClass(function e(t){_classCallCheck(this,e),this.widgetInfo=t||{},this.chatId="".concat(window.crypto.randomUUID(),":").concat((new Date).toISOString())},[{key:"handleEvent",value:function(e){var t,n,o,a=this,e=null==e||null===(i=e.data)||void 0===i?void 0:i.type,i=null===(i=this.widgetInfo)||void 0===i?void 0:i.token;e===f&&(t=document.getElementById("iframe-".concat(i)),n=u(i),window.sd&&sd("getSessionId",function(e){o=e}),window.sdb&&sdb("getSessionId",function(e){o=e}),window.digitalData&&(window.digitalData.chatId=this.chatId,window.digitalData.newEvent({type:"CustomTagEvent",eventName:"sms",eventAction:"chat",attributes:{provider:"Kenect"}})),setTimeout(function(){var e={sdSessionId:o,chatId:a.chatId,chatSessionId:null===(e=window._satellite)||void 0===e?void 0:e.getVar("chatSessionId"),chatLeadId:n.startTime,formTransactionId:null===(e=window._satellite)||void 0===e?void 0:e.getVar("formTransactionId")};O("WIDGET_INFO_EXTRA_DATA",e),t.contentWindow.postMessage({type:"WIDGET_INFO_EXTRA_DATA",extraData:e},"*")},150))}}]),o=setTimeout,w="undefined"!=typeof setImmediate?setImmediate:null;function N(e){return Boolean(e&&void 0!==e.length)}function R(){}function j(e){if(!(this instanceof j))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],B(e,this)}function M(n,o){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,j._immediateFn(function(){var e,t=1===n._state?o.onFulfilled:o.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void W(o.promise,e)}G(o.promise,e)}else(1===n._state?G:W)(o.promise,n._value)})):n._deferreds.push(o)}function G(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==_typeof(t)||"function"==typeof t)){var n=t.then;if(t instanceof j)return e._state=3,e._value=t,void H(e);if("function"==typeof n)return void B((o=n,a=t,function(){o.apply(a,arguments)}),e)}e._state=1,e._value=t,H(e)}catch(t){W(e,t)}var o,a}function W(e,t){e._state=2,e._value=t,H(e)}function H(e){2===e._state&&0===e._deferreds.length&&j._immediateFn(function(){e._handled||j._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)M(e,e._deferreds[t]);e._deferreds=null}function V(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function B(e,t){var n=!1;try{e(function(e){n||(n=!0,G(t,e))},function(e){n||(n=!0,W(t,e))})}catch(e){if(n)return;n=!0,W(t,e)}}j.prototype.catch=function(e){return this.then(null,e)},j.prototype.then=function(e,t){var n=new this.constructor(R);return M(this,new V(e,t,n)),n},j.prototype.finally=function(t){var n=this.constructor;return this.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){return n.reject(e)})})},j.all=function(t){return new j(function(a,i){if(!N(t))return i(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return a([]);var c=r.length;for(var e=0;e<r.length;e++)!function t(n,e){try{if(e&&("object"==_typeof(e)||"function"==typeof e)){var o=e.then;if("function"==typeof o)return o.call(e,function(e){t(n,e)},i),0}r[n]=e,0==--c&&a(r)}catch(n){i(n)}}(e,r[e])})},j.allSettled=function(n){return new this(function(a,e){if(!n||void 0===n.length)return e(new TypeError(_typeof(n)+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(n);if(0===i.length)return a([]);var r=i.length;for(var t=0;t<i.length;t++)!function t(n,e){if(e&&("object"==_typeof(e)||"function"==typeof e)){var o=e.then;if("function"==typeof o)return o.call(e,function(e){t(n,e)},function(e){i[n]={status:"rejected",reason:e},0==--r&&a(i)}),0}i[n]={status:"fulfilled",value:e},0==--r&&a(i)}(t,i[t])})},j.resolve=function(t){return t&&"object"==_typeof(t)&&t.constructor===j?t:new j(function(e){e(t)})},j.reject=function(n){return new j(function(e,t){t(n)})},j.race=function(a){return new j(function(e,t){if(!N(a))return t(new TypeError("Promise.race accepts an array"));for(var n=0,o=a.length;n<o;n++)j.resolve(a[n]).then(e,t)})},j._immediateFn="function"==typeof w?function(e){w(e)}:function(e){o(e,0)},j._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var U,F,K=j,z="".concat(g.RL).concat(g.WG),q=_createClass(function e(t){_classCallCheck(this,e),this.widgetInfo=t||{},window.Promise=K;t=document.createElement("script");t.type="text/javascript",t.src=z,document.head.appendChild(t)},[{key:"handleEvent",value:function(t){var e,n=this;switch(null==t||null===(e=t.data)||void 0===e?void 0:e.type){case h:v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_SEND_MESSAGE",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case f:v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_WIDGET_OPENED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case p:v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_WIDGET_CLOSED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case"EVENT_LOCATION_SELECTED":v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_LOCATION_SELECTED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case"EVENT_DEPARTMENT_SELECTED":v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_DEPARTMENT_SELECTED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case T:v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_PROMPT_CLOSED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case"EVENT_KENECT_LOGO_PRESSED":v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_KENECT_LOGO_PRESSED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case"EVENT_KENECT_LOGO_PRESSED_WITH_FORM_FILLED":v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("EVENT_KENECT_LOGO_PRESSED_WITH_FORM_FILLED",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case"EVENT_WIDGET_ERROR":v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.noticeError("EVENT_WIDGET_ERROR",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,eventData:t.data.data,session:u(null===(e=n.widgetInfo)||void 0===e?void 0:e.token)})});break;case S:v(function(){var e;return null===(e=window.newrelic)||void 0===e?void 0:e.addPageAction("IMPRESSION",{widgetType:n.widgetInfo.type,token:n.widgetInfo.token,session:u(null===(e=widgetInfo)||void 0===e?void 0:e.token)})})}}}]),J="Kenect",X="text",Z=_createClass(function e(t,n){_classCallCheck(this,e),this.collectorInfo=n,this.widgetInfo=t},[{key:"handleSD",value:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];O.apply(void 0,["PROCESSED_EVENT",this.collectorInfo.type].concat(n)),this.collectorInfo.type===Y?window.sd&&(e=window).sd.apply(e,n):this.collectorInfo.type===Q&&window.sdb&&(e=window).sdb.apply(e,n)}},{key:"handleEvent",value:function(o){var e,a=this,t=null==o||null===(e=o.data)||void 0===e?void 0:e.type,i=null===(e=this.widgetInfo)||void 0===e?void 0:e.token;switch(t){case h:v(function(){var e=null===(t=o.data.data)||void 0===t?void 0:t.message,t=u(i);a.handleSD("dataLayer",{chatType:X,chatProvider:J,chatSessionId:t.id,chatLeadId:t.startTime,events:"chatUserMessage",chatMessageType:"user",chatMessageContent:e}),a.handleSD("send"),a.handleSD("dataLayer",{chatType:X,chatProvider:J,chatSessionId:t.id,chatLeadId:t.startTime,events:"chatLead"}),a.handleSD("send")});break;case"EVENT_SEND_MESSAGE_CONFIRMATION":v(function(){var e=_slicedToArray(null===(n=o.data.data)||void 0===n?void 0:n.confirmationMessages,2),t=e[0],n=e[1],e=u(i);a.handleSD("dataLayer",{chatType:X,chatProvider:J,chatSessionId:e.id,events:"chatUserMessage",chatMessageType:"agent",chatMessageContent:null==t?void 0:t.text,chatLeadId:e.startTime}),a.handleSD("send"),a.handleSD("dataLayer",{chatType:X,chatProvider:J,chatSessionId:e.id,chatLeadId:e.startTime,events:"chatUserMessage",chatMessageType:"agent",chatMessageContent:null==n?void 0:n.text}),a.handleSD("send")});break;case f:v(function(){var e=u(i);a.handleSD("dataLayer",{chatType:X,chatSessionId:e.id,chatProvider:J,events:"chatClick"}),a.handleSD("send")});break;case p:v(function(){var e=u(i);a.handleSD("dataLayer",{chatType:X,chatSessionId:e.id,chatProvider:J,events:"chatClosed"}),a.handleSD("send")});break;case S:v(function(){var e=u(i);a.handleSD("dataLayer",{chatType:X,chatSessionId:e.id,chatProvider:J,events:"chatImpression"}),a.handleSD("send")})}}}]),$=_createClass(function e(t){_classCallCheck(this,e),this.widgetInfo=t||{}},[{key:"handleEvent",value:function(e){var t,n=this,e=null==e||null===(t=e.data)||void 0===t?void 0:t.type,o=u(null===(t=this.widgetInfo)||void 0===t?void 0:t.token);switch(e){case h:v(function(){n.sendEvent(o,["chat_user_message","chat_agent_message","chat_lead"])},3);break;case f:v(function(){return n.sendEvent(o,["chat_click"])},3);break;case p:v(function(){return n.sendEvent(o,["chat_closed"])},3);break;case S:v(function(){return n.sendEvent(o,["chat_impression"])},3)}}},{key:"sendEvent",value:function(e,t){var n=t.map(function(e){return{eventType:e}}),t=this.getDeviceType(),n={sessionId:e.id,chatLeadId:e.startTime,widgetId:this.widgetInfo.token,organizationId:this.widgetInfo.organizationId,locationId:null===(e=this.widgetInfo)||void 0===e?void 0:e.defaultLocationId,brandId:null===(e=this.widgetInfo)||void 0===e?void 0:e.brandId,brandName:null===(e=this.widgetInfo)||void 0===e?void 0:e.brandName,deviceType:t,events:n};this.httpRequest(n)}},{key:"httpRequest",value:function(e){var t=new XMLHttpRequest,n="".concat(g.$b,"/widget-events"),e=JSON.stringify(e);t.open("POST",n,!0),t.setRequestHeader("Content-type","application/json"),t.setRequestHeader("Authorization",g.Xj),t.send(e)}},{key:"getDeviceType",value:function(){return/Mobi/.test(navigator.userAgent)?"Mobile":"Desktop"}}]),Y="SHIFT_DIGITAL",Q="SHIFT_DIGITAL_BMW",ee=_createClass(function e(t){_classCallCheck(this,e);var n=(null==t?void 0:t.collectors)||[],o=[].concat(_toConsumableArray(null!=t&&t.hideNewRelic?[]:[new q(t)]),_toConsumableArray(null==g.Xj||"SqkXDo90D#8iplyGTg0$"===g.Xj?[]:[new $(t)]),_toConsumableArray(t?[new y(t)]:[]));n.forEach(function(e){switch(e.type){case Q:case Y:o.push(new Z(t,e))}}),O("Collectors",o),this.collectors=o},[{key:"handleEvent",value:function(t){this.collectors.forEach(function(e){e.handleEvent(t)})}}]);function te(){var t,e,n,o,a;t=ne,{"type":"WEB","organizationId":3874,"token":"Zi9p46UkIIUJpA4EIPFLbs","name":"The Urbatsch Law Firm, P.C.","showOnMobile":true,"archived":false,"parameterFileUrl":"https://storage.googleapis.com/widget.kenect.com/instances/Zi9p46UkIIUJpA4EIPFLbs.json","fullUrl":"https://resource.kenect.com/api/v1/widget/client-data/Zi9p46UkIIUJpA4EIPFLbs","tinyUrl":"https://bit.ly/3csLdcU","thankYou":"Thank you!","color_1":"#1e73be","color_2":"#1e73be","fontColor":"#FFFFFF","urlTrackingWords":[],"showPrompt":true,"overwriteTeamAssignment":true,"tcpaLanguage":"By hitting \"Send\" you authorize The Urbatsch Law Firm P.C. to send text messages and marketing content to the mobile number provided, sometimes using automated technology. Consent is not a condition of purchase. Message & data rates apply. Message frequency may vary. Text HELP for support or more information. Text STOP to opt out at any time.","displayCorner":"BOTTOM_RIGHT","companyName":"The Urbatsch Law Firm P.C.","buttonMessage":"Text us!","defaultLocationId":5881,"departments":[{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22251,"name":"Prospective Client","id":1},{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22252,"name":"Existing Client","id":2},{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22253,"name":"Other","id":3}],"prompt":"Have a question? Text us here!","requireLastName":true}===U?(e=(o=document.getElementById("kenect-token")).getAttribute("token"),n=o.getAttribute("previewinfo"),o="".concat(g.to,"/").concat(e,".json"),"WIDGET_PREVIEW"===e?(U=_objectSpread(_objectSpread({},JSON.parse(decodeURIComponent(n))),{},{token:"WIDGET_PREVIEW",previewInfo:n}),t()):((a=new XMLHttpRequest).open("GET",o,!0),a.setRequestHeader("Content-Type","text/javascript"),a.onreadystatechange=function(){var e;this.readyState!==XMLHttpRequest.DONE||200!==this.status&&204!==this.status||(e=JSON.parse(a.responseText),U=e,t())},a.send(null))):t()}function ne(){var e,t,n,o,a,i,r,c,d,s,l,u,f,p,h=U,v=h.token,y=h.showOnMobile,w="OEM"===h.type;document.getElementById("widget-".concat(v))||window.innerWidth<600&&!y||(e=!w,o=new URL(window.location).searchParams.get("widget")===v,e&&(h=document.createElement("div"),y=document.createElement("div"),e=document.createElement("div"),h.id="widget-".concat(v),h.className="reset-".concat(v," widget-container-").concat(v),y.id="button-".concat(v),y.className="reset-".concat(v," visibility-hidden-").concat(v),e.id="prompt-".concat(v),e.className="reset-".concat(v," hide-prompt-").concat(v),h.appendChild(e),h.appendChild(y),document.body.appendChild(h),h="".concat(g.RL).concat(g.EO),A(U,"button-".concat(v),h,function(){return P(U,F)}),o||(u="".concat(g.RL).concat(g.E9),A(U,"prompt-".concat(v),u),n=(p=U).token,f=p.prompt,p.showPrompt?f&&(t=document.getElementById("prompt-".concat(n)),p=b("widget-closed-".concat(n)),f=(new Date).getTime(),(null!==p?f-p:1800001)<18e5?t.classList.add("hide-prompt-".concat(n)):setTimeout(function(){t.classList.remove("hide-prompt-".concat(n))},5e3)):document.getElementById("prompt-".concat(n)).classList.add("hide-prompt-".concat(n)))),l=F,v=(s=U).token,u=s.previewInfo,f=document.createElement("iframe"),p=document.createElement("div"),u="token=".concat(encodeURIComponent(v)).concat(u?"&previewInfo="+u:""),f.src="".concat(g.Nc,"?").concat(u),f.className="iframe-".concat(v," widget-iframe-").concat(v," shadow-").concat(v),f.id="iframe-".concat(v),p.id="iframe-wrapper-".concat(v),p.className="reset-".concat(v," display-none-").concat(v," backdrop-").concat(v),p.onclick=function(){return P(s,l)},p.append(f),document.body.append(p),c=F,d=(r=U).token,document.addEventListener("click",function(e){var t;(null===(t=e.target)||void 0===t||null===(t=t.dataset)||void 0===t?void 0:t.widgetToggle)===d&&(e=null===(e=e.target)||void 0===e||null===(e=e.dataset)||void 0===e?void 0:e.dealerId,P(r,c,e))}),function(n,o,a){var i=n.token;window.removeEventListener("message",window["MessageHandler_".concat(i)]),window.toggleKenectWidget=function(){return P(n,o)};var r=new ee(n);window["MessageHandler_".concat(i)]=function(e){switch(r.handleEvent(e),e.data.type){case k:case D:case x:case"".concat(k,"_").concat(i):case"".concat(D,"_").concat(i):case"".concat(x,"_").concat(i):P(n,o,e.data.dealerId);break;case T:t=n.token,document.getElementById("prompt-".concat(t)).classList.add("hide-prompt-".concat(t)),I("widget-closed-".concat(t),(new Date).getTime().toString());break;case"PROMPT_PAGE_LOADED":C(n,"prompt-".concat(i));break;case"BUTTON_PAGE_LOADED":C(n,"button-".concat(i));break;case S:C(n,"iframe-".concat(i),!0);break;case"RESIZE_PROMPT":L(n,_objectSpread(_objectSpread({},e.data),{},{width:e.data.width,height:e.data.height}),"prompt-".concat(i));break;case"RESIZE_BUTTON":L(n,e.data,"button-".concat(i),!0),a&&P(n,o)}var t},window.addEventListener("message",window["MessageHandler_".concat(i)])}(U,F,o),w?(i=(a=U).token,m("\n".concat(E(a),"\n.backdrop-").concat(i," {\n  position: fixed;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  z-index: 2147483000;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n.widget-iframe-").concat(i," {\n  border-radius: 10px;\n  height: 640px;\n  width: 320px;\n  background: #f7f7f7;\n  max-height: calc(100% - 100px);\n}\n").concat(_(a),"\n  "),i)):(o=(p=U).token,m("\n".concat(E(p),"\n\nbutton.reset-").concat(o," {\n  background: none;\n}\n\nbutton.reset-").concat(o,":hover {\n  background: none;\n}\n\n.widget-iframe-").concat(o," {\n  position: fixed;\n  bottom: 85px;\n  right: 20px;\n  border-radius: 10px;\n  height: 640px;\n  width: 320px;\n  background: #f7f7f7;\n  max-height: calc(100% - 100px);\n}\n\n#prompt-").concat(o," {\n  margin: 0 4px;\n}\n#prompt-").concat(o,"-iframe {\n  background: transparent;\n  box-shadow: none;\n  margin-bottom: -16px !important;\n}\n\n.widget-container-").concat(o," {\n  transform: translateY(0);\n  transition: all .1s;\n  display: flex;\n}\n#widget-").concat(o," {\n  position: fixed;\n  display: flex;\n  z-index: 2147483000;\n}\n.btn-text-").concat(o," {\n  color: white;\n}\n").concat((w=p.token,a=p.displayCorner,i=p.customCSS,a=a?a.split("_"):["BOTTOM","RIGHT"],i=i||"",i+="TOP"===a[0]?"\n      #widget-".concat(w," {\n        top: 0;\n      }\n      .widget-container-").concat(w," {\n        flex-direction: column-reverse;\n      }\n      .iframe-").concat(w," {\n        top: 85px;\n      }\n    "):"\n      #widget-".concat(w," {\n        bottom: 0;\n      }\n      .widget-container-").concat(w," {\n        flex-direction: column;\n      }\n      .iframe-").concat(w," {\n        bottom: 85px;\n      }\n    "),i+="RIGHT"===a[1]?"\n      #widget-".concat(w," {\n        right: 0;\n      }\n      #button-").concat(w," {\n        align-self: flex-end;\n      }\n      .iframe-").concat(w," {\n        right: 16px;\n      }\n    "):"\n      #widget-".concat(w," {\n        left: 0;\n      }\n      #button-").concat(w," {\n        align-self: flex-start;\n      }\n      .iframe-").concat(w," {\n        left: 16px;\n      }\n    ")),"\n").concat(_(p),"\n"),o)),O("WIDGET_INITIALIZED"))}U={"type":"WEB","organizationId":3874,"token":"Zi9p46UkIIUJpA4EIPFLbs","name":"The Urbatsch Law Firm, P.C.","showOnMobile":true,"archived":false,"parameterFileUrl":"https://storage.googleapis.com/widget.kenect.com/instances/Zi9p46UkIIUJpA4EIPFLbs.json","fullUrl":"https://resource.kenect.com/api/v1/widget/client-data/Zi9p46UkIIUJpA4EIPFLbs","tinyUrl":"https://bit.ly/3csLdcU","thankYou":"Thank you!","color_1":"#1e73be","color_2":"#1e73be","fontColor":"#FFFFFF","urlTrackingWords":[],"showPrompt":true,"overwriteTeamAssignment":true,"tcpaLanguage":"By hitting \"Send\" you authorize The Urbatsch Law Firm P.C. to send text messages and marketing content to the mobile number provided, sometimes using automated technology. Consent is not a condition of purchase. Message & data rates apply. Message frequency may vary. Text HELP for support or more information. Text STOP to opt out at any time.","displayCorner":"BOTTOM_RIGHT","companyName":"The Urbatsch Law Firm P.C.","buttonMessage":"Text us!","defaultLocationId":5881,"departments":[{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22251,"name":"Prospective Client","id":1},{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22252,"name":"Existing Client","id":2},{"legalName":"The Urbatsch Law Firm P.C.","locationName":"The Urbatsch Law Firm, P.C.","locationId":5881,"assignedTeamId":22253,"name":"Other","id":3}],"prompt":"Have a question? Text us here!","requireLastName":true},F=e({key:"autopluck",expiry:24},window),"complete"===document.readyState?te():window.addEventListener("load",te)}();