(()=>{let t,o,e,a,g,w,n,i;var s,u=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","$b":"https://int-widget-events.kenect.com/api/v1","Xj":"SqkXDo90D#8iplyGTg0$"}');let M=function(e,t){var t=36e5*(t=t||24),a=new Date;return Math.abs(e.getTime()-a.getTime())>=t},d=function(e,t){var a=(a=e.getItem(t.key))?JSON.parse(a):{},n=a.updated_at;return!n||M(new Date(n),t.expiry)?(e.setItem(t.key,JSON.stringify({})),{}):a.visits},G={key:"autopluck",expiry:24};function r(e){return t||(e=e||window,t=window.localStorage),t}function c(e){var t=r(),a=d(t,o);a[e]||(a[e]=0),a[e]+=1,(e={}).visits=a,e.updated_at=(new Date).toISOString(),t.setItem(o.key,JSON.stringify(e))}function E(e,t){(a=document.querySelectorAll("#widget-style-"+t))&&a.length&&a.forEach(e=>e.parentNode.removeChild(e)),(a=document.createElement("style")).id="widget-style-"+t,a.type="text/css";var a,t=a;t.innerHTML=e,document.head.appendChild(t)}function I(e){e=e.token;return`
.reset-${e} {
  all: unset;
}
.iframe-${e} {
  border: none;
  width: 100%;
  height: 100%;
  z-index: 2147483000;
  box-sizing: border-box;
}
.display-none-${e} {
  display: none !important;
}
.hide-prompt-${e} {
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}
.shadow-${e} {
  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);
}
.visibility-hidden-${e} {
  visibility: hidden;
}
  `}function f(e){e=e.token;return`
@media only screen and (max-width: 400px) {
  .iframe-${e} {
    height: 100%;
    width: 100%;
    border-radius: 0;
    left: 0;
    top: 0;
  }
  .widget-iframe-${e} {
    max-height: 100%;
  }
  #prompt-${e} {
    max-width: 90vw;
  }
}
  `}let l="Please consider enabling localStorage, caching and/or cookies on this browser for the best user experience.";function h(e){var t,a,n,i;if(e)return i=(n=(n=y(e="widget-session-"+e))?JSON.parse(n):{})?.id,t=n?.startTime||0,n=n?.latestActivity||0,a=(new Date).getTime(),i={id:(n=n&&864e5<a-n)||!i?"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)}):i,startTime:n||!t?a:t,latestActivity:a},v(e,JSON.stringify(i)),i;throw Error("Widget token not declared for session")}function v(e,t){try{localStorage.setItem(e,t)}catch(e){console.warn(l)}}function y(e){try{return localStorage.getItem(e)}catch(e){console.warn(l)}}let p="EVENT_WIDGET_OPENED",m="EVENT_WIDGET_CLOSED",x="EVENT_SEND_MESSAGE",_="WIDGET_LOADED",b="TOGGLE_IFRAME",T="OPEN_IFRAME",S="CLOSE_IFRAME",D=(...e)=>{"true"===y("KENECT_DEBUGGING")?.toLocaleLowerCase()&&console.log(...e)};function L(e,{height:t,width:a},n,i){var e=e.token,o=document.getElementById(n),n=document.getElementById(n+"-iframe");i&&o.classList.remove("visibility-hidden-"+e),n.setAttribute("style",`height:${t}px; width:${a}px; min-height:${t}px; min-width:${a}px; `)}function k(e,t,a,n){var{token:e,buttonMessage:i}=e,o=document.getElementById(t),s=document.createElement("iframe");s.src=a,s.id=t+"-iframe",s.className="iframe-"+e,"function"==typeof n?((a=document.createElement("button")).id="widget-button-"+e,a.className="reset-"+e,a.onclick=n,a.tabIndex=0,a.title=i||"Text Us",s.tabIndex=-1,s.title=i||"Text us chat widget",s.ariaLabel="Contact Support Widget",a.appendChild(s),o.appendChild(a)):(s.title="Chat widget invitation",s.ariaLabel="Widget prompt message",o.appendChild(s))}function O(e,t,a){document.getElementById(a?t:t+"-iframe").contentWindow.postMessage({type:"WIDGET_DATA",widgetInfo:e,URLS:{icon:""+u.RL+u.sD,close:""+u.RL+u.jr,close_white:""+u.RL+u.LA}},"*")}function $(i,o,s){var{token:i,urlTrackingWords:d,buttonMessage:r}=i,c=document.getElementById("iframe-wrapper-"+i),l=document.getElementById("widget-button-"+i);if(c){let e=c.classList.contains("display-none-"+i),t=document.getElementById("prompt-"+i),a=document.getElementById("kenect-aria-live"),n=(a||((a=document.createElement("div")).id="kenect-aria-live",a.setAttribute("aria-live","assertive"),a.setAttribute("role","status"),a.style.position="absolute",a.style.left="-9999px",a.tabIndex=-1,document.body.appendChild(a)),t?.classList.add("hide-prompt-"+i),document.getElementById("iframe-"+i));e?(c.classList.remove("display-none-"+i),window.postMessage({type:p},"*"),a.textContent="Support window opened.",l&&(l.title="Close support window",l.ariaLabel="Close support window"),n&&setTimeout(()=>{n.focus()},2e3)):(c.classList.add("display-none-"+i),window.postMessage({type:m},"*"),a.textContent="Support window closed.",l&&(l.title=r||"Text Us",l.ariaLabel="Open support window")),n&&(c={type:"PAGE_DATA",href:window.location.href,width:window.innerWidth,height:window.innerHeight,stats:o.matches(d),dealerId:s},D("PAGE_DATA",c),n.contentWindow.postMessage(c,"*")),document.getElementById(`button-${i}-iframe`)?.contentWindow.postMessage({type:"TOGGLE_WIDGET"},"*")}}class W{constructor(e){this.widgetInfo=e||{},this.chatId=window.crypto.randomUUID()+":"+(new Date).toISOString()}handleEvent(e){var e=e?.data?.type,i=this.widgetInfo?.token;if(e===p){let t,a=document.getElementById("iframe-"+i),n=h(i);window.sd&&sd("getSessionId",e=>{t=e}),window.sdb&&sdb("getSessionId",e=>{t=e}),window.digitalData&&(window.digitalData.chatId=this.chatId,window.digitalData.newEvent({type:"CustomTagEvent",eventName:"sms",eventAction:"chat",attributes:{provider:"Kenect"}})),setTimeout(()=>{var e={sdSessionId:t,chatId:this.chatId,chatSessionId:window._satellite?.getVar("chatSessionId"),chatLeadId:n.startTime,formTransactionId:window._satellite?.getVar("formTransactionId")};D("WIDGET_INFO_EXTRA_DATA",e),a.contentWindow.postMessage({type:"WIDGET_INFO_EXTRA_DATA",extraData:e},"*")},150)}}}let C=(n,i=60)=>{try{n()}catch(e){let t=0,a=setInterval(()=>{if(t<i)try{n(),clearInterval(a)}catch(e){t++}else clearInterval(a)},1e3)}},R="Kenect",N="text";class P{constructor(e,t){this.collectorInfo=t,this.widgetInfo=e}handleSD(...e){D("PROCESSED_EVENT",this.collectorInfo.type,...e),this.collectorInfo.type===A?window.sd&&window.sd(...e):this.collectorInfo.type===U&&window.sdb&&window.sdb(...e)}handleEvent(n){let e=n?.data?.type,i=this.widgetInfo?.token;switch(e){case x:C(()=>{var e=n.data.data?.message,t=h(i);this.handleSD("dataLayer",{chatType:N,chatProvider:R,chatSessionId:t.id,chatLeadId:t.startTime,events:"chatUserMessage",chatMessageType:"user",chatMessageContent:e}),this.handleSD("send"),this.handleSD("dataLayer",{chatType:N,chatProvider:R,chatSessionId:t.id,chatLeadId:t.startTime,events:"chatLead"}),this.handleSD("send")});break;case"EVENT_SEND_MESSAGE_CONFIRMATION":C(()=>{var[e,t]=n.data.data?.confirmationMessages,a=h(i);this.handleSD("dataLayer",{chatType:N,chatProvider:R,chatSessionId:a.id,events:"chatUserMessage",chatMessageType:"agent",chatMessageContent:e?.text,chatLeadId:a.startTime}),this.handleSD("send"),this.handleSD("dataLayer",{chatType:N,chatProvider:R,chatSessionId:a.id,chatLeadId:a.startTime,events:"chatUserMessage",chatMessageType:"agent",chatMessageContent:t?.text}),this.handleSD("send")});break;case p:C(()=>{var e=h(i);this.handleSD("dataLayer",{chatType:N,chatSessionId:e.id,chatProvider:R,events:"chatClick"}),this.handleSD("send")});break;case m:C(()=>{var e=h(i);this.handleSD("dataLayer",{chatType:N,chatSessionId:e.id,chatProvider:R,events:"chatClosed"}),this.handleSD("send")});break;case _:C(()=>{var e=h(i);this.handleSD("dataLayer",{chatType:N,chatSessionId:e.id,chatProvider:R,events:"chatImpression"}),this.handleSD("send")})}}}class B{constructor(e){this.widgetInfo=e||{}}handleEvent(e){let t=e?.data?.type,a=h(this.widgetInfo?.token);switch(t){case x:C(()=>{this.sendEvent(a,["chat_user_message","chat_agent_message","chat_lead"])},3);break;case p:C(()=>this.sendEvent(a,["chat_click"]),3);break;case m:C(()=>this.sendEvent(a,["chat_closed"]),3);break;case _:C(()=>this.sendEvent(a,["chat_impression"]),3)}}sendEvent(e,t){var t=t.map(e=>({eventType:e})),a=this.getDeviceType(),e={sessionId:e.id,chatLeadId:e.startTime,widgetId:this.widgetInfo.token,organizationId:this.widgetInfo.organizationId,locationId:this.widgetInfo?.defaultLocationId,brandId:this.widgetInfo?.brandId,brandName:this.widgetInfo?.brandName,deviceType:a,events:t};this.httpRequest(e)}httpRequest(e){var t=new XMLHttpRequest,a=u.$b+"/widget-events",e=JSON.stringify(e);t.open("POST",a,!0),t.setRequestHeader("Content-type","application/json"),t.setRequestHeader("Authorization",u.Xj),t.send(e)}getDeviceType(){return/Mobi/.test(navigator.userAgent)?"Mobile":"Desktop"}}let A="SHIFT_DIGITAL",U="SHIFT_DIGITAL_BMW";class H{constructor(t){let e=t?.collectors||[],a=[...null==u.Xj||"SqkXDo90D#8iplyGTg0$"===u.Xj?[]:[new B(t)],...t?[new W(t)]:[]];e.forEach(e=>{switch(e.type){case U:case A:a.push(new P(t,e))}}),D("Collectors",a),this.collectors=a}handleEvent(t){this.collectors.forEach(e=>{e.handleEvent(t)})}}function z(e){c(s.location.toString()),setInterval(function(){s.location.toString()!==a&&(c(s.location.toString()),a=s.location.toString())},2e3)}function j(e){{var i=d(r(),o);e=e||[];let n=Object.keys(i=i||[]);return e.reduce((e,t)=>{let a=0;return t=(t||"").toLowerCase(),n.forEach(e=>{e.toLowerCase().match(t.toLowerCase())&&(a+=i[e])}),e[t]=a,e},{})}}g={"type":"WEB","organizationId":4418,"token":"YKVf3TTaKY6FLnLhJ8oZtz","name":"D & S Harley-Davidson","showOnMobile":true,"archived":false,"parameterFileUrl":"https://storage.googleapis.com/widget.kenect.com/instances/YKVf3TTaKY6FLnLhJ8oZtz.json","fullUrl":"https://resource.kenect.com/api/v1/widget/client-data/YKVf3TTaKY6FLnLhJ8oZtz","tinyUrl":"https://bit.ly/3i2s304","thankYou":"Thank you!","color_1":"#126ade","color_2":"#126ade","fontColor":"#FFFFFF","urlTrackingWords":["harley","davidson"],"showPrompt":true,"collectors":[{"label":"Shift Digital","type":"SHIFT_DIGITAL"}],"tcpaLanguage":"By hitting \"Send\" you authorize D&S Harley-Davidson, Inc. 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","buttonMessage":"Text us!","companyName":"D&S Harley-Davidson, Inc.","defaultLocationId":6812,"departments":[{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"name":"Sales","assignedTeamId":23730,"id":1},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"name":"Parts","assignedTeamId":23731,"id":2},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23732,"name":"Service","id":3},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23733,"name":"Motorclothes","id":4},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23793,"name":"General Questions","id":5}],"prompt":"Have a question? Text us here!","requireLastName":true},w=(s=window,e=(s=s||window).document,o=Object.assign({},G,{key:"autopluck",expiry:24}),"complete"===e.readyState||"loading"!==e.readyState&&!e.documentElement.doScroll?z():e.addEventListener("DOMContentLoaded",z),{matches:j,contains:function(e){return 0<j([e])[e]}}),n=()=>{var t=i;if({"type":"WEB","organizationId":4418,"token":"YKVf3TTaKY6FLnLhJ8oZtz","name":"D & S Harley-Davidson","showOnMobile":true,"archived":false,"parameterFileUrl":"https://storage.googleapis.com/widget.kenect.com/instances/YKVf3TTaKY6FLnLhJ8oZtz.json","fullUrl":"https://resource.kenect.com/api/v1/widget/client-data/YKVf3TTaKY6FLnLhJ8oZtz","tinyUrl":"https://bit.ly/3i2s304","thankYou":"Thank you!","color_1":"#126ade","color_2":"#126ade","fontColor":"#FFFFFF","urlTrackingWords":["harley","davidson"],"showPrompt":true,"collectors":[{"label":"Shift Digital","type":"SHIFT_DIGITAL"}],"tcpaLanguage":"By hitting \"Send\" you authorize D&S Harley-Davidson, Inc. 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","buttonMessage":"Text us!","companyName":"D&S Harley-Davidson, Inc.","defaultLocationId":6812,"departments":[{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"name":"Sales","assignedTeamId":23730,"id":1},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"name":"Parts","assignedTeamId":23731,"id":2},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23732,"name":"Service","id":3},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23733,"name":"Motorclothes","id":4},{"legalName":"D&S Harley-Davidson, Inc.","locationName":"D & S Harley-Davidson","locationId":6812,"assignedTeamId":23793,"name":"General Questions","id":5}],"prompt":"Have a question? Text us here!","requireLastName":true}===g){var e=document.getElementById("kenect-token"),a=e.getAttribute("token"),e=e.getAttribute("previewinfo"),n=u.to+`/${a}.json`;if("WIDGET_PREVIEW"===a)g={...JSON.parse(decodeURIComponent(e)),token:"WIDGET_PREVIEW",previewInfo:e},t();else{let e=new XMLHttpRequest;e.open("GET",n,!0),e.setRequestHeader("Content-Type","text/javascript"),e.onreadystatechange=function(){this.readyState!==XMLHttpRequest.DONE||200!==this.status&&204!==this.status||(g=JSON.parse(e.responseText),t())},e.send(null)}}else t()},i=()=>{var{token:e,showOnMobile:t,type:a}=g,a="OEM"===a;if(!(document.getElementById("widget-"+e)||window.innerWidth<600&&!t)){var d,t=new URL(window.location).searchParams.get("widget")===e,n=(a||(o=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div"),o.id="widget-"+e,o.className=`reset-${e} widget-container-`+e,r.id="button-"+e,r.className=`reset-${e} visibility-hidden-`+e,s.id="prompt-"+e,s.className=`reset-${e} hide-prompt-`+e,o.appendChild(s),o.appendChild(r),document.body.appendChild(o),s=""+u.RL+u.EO,k(g,"button-"+e,s,()=>$(g,w)),t)||(r=""+u.RL+u.E9,k(g,"prompt-"+e,r),(()=>{let{token:n,prompt:e,showPrompt:t}=g;if(!t)return document.getElementById("prompt-"+n).classList.add("hide-prompt-"+n);if(e){let e=document.getElementById("prompt-"+n),t=y("widget-closed-"+n),a=(new Date).getTime();(null!==t?a-t:1800001)<18e5?e.classList.add("hide-prompt-"+n):setTimeout(()=>{e.classList.remove("hide-prompt-"+n)},5e3)}})()),g),i=w,{token:o,previewInfo:s}=n,e=document.createElement("iframe"),r=document.createElement("div"),s="token="+encodeURIComponent(o)+(s?"&previewInfo="+s:"");e.src=u.Nc+"?"+s,e.className=`iframe-${o} widget-iframe-${o} shadow-`+o,e.id="iframe-"+o,e.title="Contact Support Widget",e.tabIndex=0,r.id="iframe-wrapper-"+o,r.className=`reset-${o} display-none-${o} backdrop-`+o,r.onclick=()=>$(n,i),r.append(e),document.body.append(r);{var c=g;var l=w;let t=c.token;document.addEventListener("click",e=>{e.target?.dataset?.widgetToggle===t&&$(c,l,e.target?.dataset?.dealerId)})}{var h=g;var p=w;var m=t;let a=h.token,n=(window.removeEventListener("message",window["MessageHandler_"+a]),window.toggleKenectWidget=()=>$(h,p),new H(h));window["MessageHandler_"+a]=e=>{switch(n.handleEvent(e),e.data.type){case b:case T:case S:case b+"_"+a:case T+"_"+a:case S+"_"+a:$(h,p,e.data.dealerId);break;case"EVENT_PROMPT_CLOSED":t=h.token,document.getElementById("prompt-"+t).classList.add("hide-prompt-"+t),v("widget-closed-"+t,(new Date).getTime().toString());break;case"PROMPT_PAGE_LOADED":O(h,"prompt-"+a);break;case"BUTTON_PAGE_LOADED":O(h,"button-"+a);break;case _:O(h,"iframe-"+a,!0);break;case"RESIZE_PROMPT":L(h,{...e.data,width:e.data.width,height:e.data.height},"prompt-"+a);break;case"RESIZE_BUTTON":L(h,e.data,"button-"+a,!0),m&&$(h,p)}var t},window.addEventListener("message",window["MessageHandler_"+a])}a?(e=g,t=e.token,E(`
${I(e)}
.backdrop-${t} {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.widget-iframe-${t} {
  border-radius: 10px;
  height: 640px;
  width: 320px;
  background: #f7f7f7;
  max-height: calc(100% - 100px);
}
${f(e)}
  `,t)):(d=g,a=d.token,E(`
${I(d)}

button.reset-${a} {
  background: none;
}

button.reset-${a}:hover {
  background: none;
}

.widget-iframe-${a} {
  position: fixed;
  bottom: 85px;
  right: 20px;
  border-radius: 10px;
  height: 640px;
  width: 320px;
  background: #f7f7f7;
  max-height: calc(100% - 100px);
}

#prompt-${a} {
  margin: 0 4px;
}
#prompt-${a}-iframe {
  background: transparent;
  box-shadow: none;
  margin-bottom: -16px !important;
}

.widget-container-${a} {
  transform: translateY(0);
  transition: all .1s;
  display: flex;
}
#widget-${a} {
  position: fixed;
  display: flex;
  z-index: 2147483000;
}
.btn-text-${a} {
  color: white;
}
${(()=>{let{token:e,displayCorner:t,customCSS:a}=d,n=t?t.split("_"):["BOTTOM","RIGHT"],i=n[0],o=n[1],s=a||"";return s=s+("TOP"===i?`
      #widget-${e} {
        top: 0;
      }
      .widget-container-${e} {
        flex-direction: column-reverse;
      }
      .iframe-${e} {
        top: 85px;
      }
    `:`
      #widget-${e} {
        bottom: 0;
      }
      .widget-container-${e} {
        flex-direction: column;
      }
      .iframe-${e} {
        bottom: 85px;
      }
    `)+("RIGHT"===o?`
      #widget-${e} {
        right: 0;
      }
      #button-${e} {
        align-self: flex-end;
      }
      .iframe-${e} {
        right: 16px;
      }
    `:`
      #widget-${e} {
        left: 0;
      }
      #button-${e} {
        align-self: flex-start;
      }
      .iframe-${e} {
        left: 16px;
      }
    `)})()}
${f(d)}
`,a)),D("WIDGET_INITIALIZED")}},"complete"===document.readyState?n():window.addEventListener("load",n)})();