window.__lpEnvSite = "21991129"; window.__watchDogURL = "https://va-healthcheck-service.public.openaiplatform.telstra.com/codi_consumer_health"; window.__businessWatchDogURL = "https://va-healthcheck-service.public.openaiplatform.telstra.com/codi_business_health"; window.__loadLivePersonSrc = function(){ window.lpTag=window.lpTag||{},'undefined'==typeof window.lpTag._tagCount?(window.lpTag={wl:lpTag.wl||null,scp:lpTag.scp||null,site:window.__lpEnvSite||'81478844',section:lpTag.section||'',tagletSection:lpTag.tagletSection||null,autoStart:lpTag.autoStart!==!1,ovr:lpTag.ovr||{},_v:'1.10.0',_tagCount:1,protocol:'https:',events:{bind:function(t,e,i){lpTag.defer(function(){lpTag.events.bind(t,e,i)},0)},trigger:function(t,e,i){lpTag.defer(function(){lpTag.events.trigger(t,e,i)},1)}},defer:function(t,e){0===e?(this._defB=this._defB||[],this._defB.push(t)):1===e?(this._defT=this._defT||[],this._defT.push(t)):(this._defL=this._defL||[],this._defL.push(t))},load:function(t,e,i){var n=this;setTimeout(function(){n._load(t,e,i)},0)},_load:function(t,e,i){var n=t;t||(n=this.protocol+'//'+(this.ovr&&this.ovr.domain?this.ovr.domain:'lptag.liveperson.net')+'/tag/tag.js?site='+this.site);var o=document.createElement('script');o.setAttribute('charset',e?e:'UTF-8'),i&&o.setAttribute('id',i),o.setAttribute('src',n),document.getElementsByTagName('head').item(0).appendChild(o)},init:function(){this._timing=this._timing||{},this._timing.start=(new Date).getTime();var t=this;window.attachEvent?window.attachEvent('onload',function(){t._domReady('domReady')}):(window.addEventListener('DOMContentLoaded',function(){t._domReady('contReady')},!1),window.addEventListener('load',function(){t._domReady('domReady')},!1)),'undefined'===typeof window._lptStop&&this.load()},start:function(){this.autoStart=!0},_domReady:function(t){this.isDom||(this.isDom=!0,this.events.trigger('LPT','DOM_READY',{t:t})),this._timing[t]=(new Date).getTime()},vars:lpTag.vars||[],dbs:lpTag.dbs||[],ctn:lpTag.ctn||[],sdes:lpTag.sdes||[],hooks:lpTag.hooks||[],identities:lpTag.identities||[],ev:lpTag.ev||[]},lpTag.init()):window.lpTag._tagCount+=1; }; window.__disableVA = false; window.__disableBusinessVA = false; window.dtcDisabledPages = "https://www.telstra.com.au/chatnow/landing"; window.lpSettings = window.lpSettings || { "heading": "Need to talk to us?", "description": "Please tell us what you want to chat about", "persistentChat": true, "options": {"route0": {"label": "Mobile & Tablet Plans","isActive": "true","section": "telstra,service,aem,consumer","childs": {"route0": {"label": "Bill & Plan Enquiries","isActive": "true","section": "service-mobile,virtualassistant","lead": "MOB-bill-plan-addon","help": "Help & Support
I need to understand my bill
Report a payment or reconnect my service
Request a payment extension
Arrange or update direct debit
Check my upgrade and recontracting fees
"}, "route1": {"label": "Buy Online","isActive": "true","section": "sales-mobile","lead": "MOB-buy-online","help": "Help & Support
Order a new mobile
Get a SIM only plan
Check my upgrade date and fees
Track my order
Get help with a back order"}, "route2": {"label": "Existing Order","isActive": "true","section": "service-general,virtualassistant","lead": "MOB-existing-order","help": "Delays to some order deliveries

COVID-19 impacts are causing delays on some orders. Your order should arrive within 7 days in metro locations, while some regional orders may take longer. We're doing everything we can to get your order to you quickly and apologise for the inconvenience..

Help & Support
Track my order
Cancel or change my order
Confirm my plan details
Check my contract termination fees
Get help with a back order"}, "route3": {"label": "Fault","isActive": "true","section": "fault-mobile,virtualassistant","lead": "MOB-fault","help": "Help & Support
View our interactive mobile help guides
Unlock my iPhone
Check for outages"}, "route4": {"label": "SIM Replacement","isActive": "true","section": "mobile-sim-deflect","lead": "MOB-sim-rep"}, "route5": {"label": "Disconnection","isActive": "true","section": "saves","lead": "MOB-disconnection"}, "route6": {"label": "Other","isActive": "true","section": "service-general,mob-other,virtualassistant","lead": "MOB-other","help": "Help & Support
Check my contract termination fees
Track my order
I need to understand my bill
Try our online support articles"}}}, "route1": {"label": "Pre-Paid","isActive": "true","section": "telstra,service,aem,consumer","childs": {"route0": {"label": "Activate & Recharge","isActive": "true","section": "prepaid,virtualassistant","lead": "PPM-activate-recharge","help": "Help & Support
How to activate my Pre-Paid service
How to recharge my Pre-Paid service
Payment options
Check my activation status
Check out our Pre-Paid support articles"}, "route1": {"label": "Existing Order","isActive": "true","section": "prepaid,virtualassistant","lead": "PPM-existing-order","help": "Delays to some order deliveries

COVID-19 impacts are causing delays on some orders. Your order should arrive within 7 days in metro locations, while some regional orders may take longer. We're doing everything we can to get your order to you quickly and apologise for the inconvenience.

Help & Support
How to activate my Pre-Paid service
How to change my plan
Check my activation status
Check out our Pre-Paid support articles
Track my order"}, "route2": {"label": "Offers & Plans","isActive": "true","section": "prepaid,virtualassistant","lead": "PPM-my-offer-plan","help": "Help & Support
View or change my plan
Explore available plans
Pre-Paid Plus packs
Pre-Paid expiry period
International roaming"}, "route3": {"label": "Fault","isActive": "true","section": "fault-prepaid,virtualassistant","lead": "PPM-fault","help": "Help & Support
Check for outages
Unlock my Telstra mobile
Pre-Paid troubleshooting tips
Pre-Paid support articles"}, "route4": {"label": "SIM Replacement","isActive": "true","section": "prepaid-sim-deflect","lead": "PPM-sim-rep","help": "Help & Support
Unlock my Telstra mobile
Track my order
Cancel or change my order
Pre-Paid support articles"}, "route5": {"label": "Disconnection","isActive": "true","section": "saves","lead": "PPM-disconnection"}}}, "route2": {"label": "NBN & Bundles","isActive": "true","section": "telstra,service,aem,consumer","childs": {"route0": {"label": "Buy Online","isActive": "true","section": "sales-nbn","lead": "NBN-buy-online","help": "Help & Support
Order a new service
See latest offers
Check my upgrade date and fees
Track my order"}, "route1": {"label": "Bill & Plan Enquiries","isActive": "true","section": "service-nbn,virtualassistant","lead": "NBN-bill-plan-addon","help": "Help & Support
Request a payment extension
Report a payment or reconnect my service
I want to pay my bill
I need to understand my bill
Arrange or update direct debit"}, "route2": {"label": "Existing Order","isActive": "true","section": "nbn-orders,virtualassistant","lead": "NBN-existing-order","help": "Delays to some order deliveries

COVID-19 impacts are causing delays on some orders. Your order should arrive within 7 days in metro locations, while some regional orders may take longer. We're doing everything we can to get your order to you quickly and apologise for the inconvenience.

Help & Support
Track my order
Reschedule my appointment"}, "route3": {"label": "Moving Home","isActive": "true","section": "nbn-moves,virtualassistant","lead": "NBN-moving-home","help": "Help & Support
Move my service to another address
Track my order"}, "route4": {"label": "Fault","isActive": "true","section": "fault-nbn,virtualassistant","lead": "NBN-fault","help": "Help & Support
Connecting my new service
Check for outages
Troubleshooting and tech support
How to use my service
Connection speed"}, "route5": {"label": "Disconnection","isActive": "true","section": "saves","lead": "NBN-disconnection"}}}, "route3": {"label": "Broadband, Bundles & Home Phone","isActive": "true","section": "telstra,service,aem,consumer","childs": {"route0": {"label": "Buy Online","isActive": "true","section": "sales-home,virtualassistant","lead": "BBHP-buy-online","help": "Help & Support
Order a new service
See latest offers
Check my upgrade date and fees
Track my order"}, "route1": {"label": "Bill & Plan Enquiries","isActive": "true","section": "service-home,virtualassistant","lead": "BBHP-bill-plan-addon","help": "Help & Support
Request a payment extension
Report a payment or reconnect my service
I need to understand my bill
Arrange or update direct debit
I want to query a charge on my bill"}, "route2": {"label": "Existing Order","isActive": "true","section": "service-bundles-home,virtualassistant","lead": "BBHP-existing-order","help": "Delays to some order deliveries

COVID-19 impacts are causing delays on some orders. Your order should arrive within 7 days in metro locations, while some regional orders may take longer. We're doing everything we can to get your order to you quickly and apologise for the inconvenience.

Help & Support
Track my order
Reschedule my appointment"}, "route3": {"label": "Moving Home","isActive": "true","section": "copper-moves,virtualassistant","lead": "BBHP-moving-home","help": "Help & Support
Move my service to another address
Track my order"}, "route4": {"label": "Fault","isActive": "true","section": "fault-adsl,virtualassistant","lead": "BBHP-fault","help": "Help & Support
Connecting my new service
Check for outages
Troubleshooting and tech support
Mobile broadband tech support
Connection speed"}, "route5": {"label": "Disconnection","isActive": "true","section": "saves","lead": "BBHP-disconnection"}}}, "route4": {"label": "Entertainment & Apps","isActive": "true","section": "telstra,service,aem,consumer","childs": {"route0": {"label": "24x7 App","isActive": "true","section": "service-apps,virtualassistant","lead": "EAA-247-app","help": "Help & Support
Register for a Telstra ID
Retrieve my Telstra ID username
Retrieve my Telstra ID password"}, "route1": {"label": "Telstra Plus","isActive": "true","section": "telstra-plus,virtualassistant","lead": "EAA-telstraplus","help": "Help & Support
Join Telstra Plus
Find out more about Telstra Plus
View Telstra Plus FAQ
Register for a Telstra ID
Retrieve my Telstra ID username
Retrieve my Telstra ID password"}, "route2": {"label": "Email","isActive": "true","section": "fault-email,virtualassistant","lead": "EAA-email","help": "Help & Support
Troubleshoot email for PC
Troubleshoot email for mobile device
Forgot my username or password"}, "route3": {"label": "Foxtel","isActive": "true","section": "foxtel,virtualassistant","lead": "EAA-foxtel","help": "Help & Support
Foxtel FAQs
Foxtel from Telstra – Set up and configure
Foxtel Go"}, "route4": {"label": "My Account","isActive": "true","section": "service-apps,virtualassistant","lead": "EAA-my-acc","help": "Help & Support
Register for My Account
Retrieve my username
Retrieve or reset my password
Join Telstra Plus
Find out more about Telstra Plus"}, "route5": {"label": "Telstra Air","isActive": "true","section": "service-apps,virtualassistant","lead": "EAA-telstra-air","help": "Help & Support
Telstra Air – all you need to know"}, "route6": {"label": "Platinum","isActive": "true","section": "platinum","lead": "EAA-platinum","help": "Help & Support
Telstra Platinum"}}}, "route5": {"label": "Business Accounts & Products","isActive": "true","section": "telstra,service,aem,consumer,business,businessva","lead": "BAAP-none","childs": {}}}, "enableDTC": true, "enableBusinessDTC": false, "dtcSection": "tcom,non-auth,telstra,service,aem,consumer,dtc,virtualassistant", "dtcBusinessSection": "", "chatEverywhereLabel": "Message Us", "dtcLabel": "Message Us", "abcEnabled": false, "abcBusinessId": "5658cef3-b53e-11e7-847d-7b88b04daa8e", "bizIntentId": "ios_general", "bizGroupId": "", "body": "", "abcButtonDelay": "10000", "contactUsABCEnabled": false }; /* LivePerson class */ var console = console || { log: function (log1, log2) { } }; var TelstraLivePerson = function (_config) { this.data = _config; if (this.data.abcButtonDelay) { // convert to number try { this.data.abcButtonDelay = parseInt(this.data.abcButtonDelay) } catch (e) { this.data.abcButtonDelay = 100 } } this.persistentChatContainer = false; this.appleDeviceType = 'UNIDENTIFIED'; this.backMask = false; this.container = false; this.containerBox = false; this.closeBT = false; this.childElements = {}; this.siteId = false; this.section = false; this.sourceSection = false; this.authToken = false; this.isDirect = false; this.lead = false; this.urlMap = window.__lpUrlMap || false; this.callBack = false; this.callBackInterval = 1; // in second this.callBackTread = false; this.chatWindowOpen = false; // load jabuka.json using absolute url to ensure no errors if import.htm injected on page in any other domain this.jabukaUrl = window.__lpEnvSite == '21991129' ? 'https://www.telstra.com.au/content/dam/tcom/virtualassistant/config/jabuka.json' : 'https://stage.telstra.com.au/content/dam/tcom/virtualassistant/config/jabuka.json'; var initParams = {}; var _vaSection = "virtualassistant"; var _vaSection2 = "va-livechat"; var _businessVaSection = "businessva"; var _instance = this; var _defaultPersistentChatLabel = "Need help? Let's chat."; var _initCalled = false; // calculate some of the dtc params here so that they are not re-calculated unnecessarily // do not consider query params or anchor tags when checking for current page url var _dtcDisabledPage = window.dtcDisabledPages.split(","); var thisPage = window.location.href.split(/[?#]/)[0]; var isDTCDisabledPage = _dtcDisabledPage.indexOf(thisPage) != -1; var smlBusIndx = thisPage.indexOf('/small-business'); var _isUnderSmallBusiness = thisPage.indexOf('/small-business/') != -1 || (smlBusIndx!=-1 && thisPage.substring(smlBusIndx)=='/small-business'); this._watchDogURL = 'virtual-assistant-status'; if (window.__watchDogURL) { this._watchDogURL = window.__watchDogURL; } this._businessWatchDogURL = 'virtual-assistant-status'; if (window.__businessWatchDogURL) { this._businessWatchDogURL = window.__businessWatchDogURL; } this._watchDog = { "virtual-assistant-status": { "orchestrator": false, "watson-virtual-agent": false, "liveperson-agent-api": false, "watson-tone-analyzer": false } }; this._businessWatchDog = { "virtual-assistant-status": { "orchestrator": false, "watson-virtual-agent": false, "liveperson-agent-api": false, "watson-tone-analyzer": false } }; var abcUrlPrefix='https://bcrw.apple.com/urn:biz:' + _instance.data.abcBusinessId; function convertChatButtonToMessaging(){ if(!_instance.data.abcEnabled || !_instance.isABCCompatibleDevice || !_instance.data.contactUsABCEnabled){ // don't bother if abc disabled or not abc compatible device or contact us pages are not supposed to be converted to return; } try { var originalOnLoad = window.onload; window.onload = function () { var buttons = Array.from(document.getElementsByTagName('a')).filter(function(tag){return tag && /#lp:2way$/.test(tag.href)}).filter(function(tag){return tag && tag.classList && tag.innerText && tag.classList.contains('btn') && tag.classList.contains('primary') && tag.innerText=='Chat now'}); if(buttons && buttons.length>0){ buttons[0].href=abcUrlPrefix; buttons[0].text='Message Us'; } if(originalOnLoad && typeof originalOnLoad==='function'){ originalOnLoad(); } } }catch(e){ // wrapping in try catch so that no other functionality gets impacted } } // extract device type and os version var _osExtractRegex = /\((Macintosh|iPhone|iPad|(?:iPod(?:\stouch)?));.*\s((?:\d[_.]{0,1})+)[^)]*\)\s/i; var _minSupportedMacOS=[10,13,4]; var _minSupportedIOS=[11,3]; function _isMinSupportedVersion(referenceVersion, versionUnderTest){ for(var i=0;ireferenceVersion[i]){ // most significant version at this point is greater than reference so we can mark supported return true; } // most significant version at this point is equal to reference. continue loop to check next version element } // all version elements equal reference so we can mark supported return true; } var checkABCCompatibleDevice = function (){ var isCompatibleDevice=false; try { var ua = window.navigator && window.navigator.userAgent || ""; var extracted = _osExtractRegex.exec(ua); if(extracted){ var deviceType=extracted[1].toLowerCase(); var extractedOSVersion=extracted[2].replace(/_/g,'.').split('.').map(function(ver){ var intVer=0; try{ intVer=parseInt(ver); }catch(e){ // ignore parsing errors and just set it to 0 // that way, it will always be lesser than supported version } return intVer; }); if(deviceType=='macintosh'){ // this could be iPad since iPadOS returns same UA string as Mac // as of Nov 2019, no touch enabled mac laptop/desktop exists. so if this browser has touch events available, it is iPad // this is the only way at the moment to identify if this is iPad or not if(window.navigator.maxTouchPoints > 1){ // desktop/laptop won't have touch points. if touch points exists, it is a touch screen device, which at the moment implies iPadOS // all iPadOS versions will support ABC so no further checks required isCompatibleDevice=true; _instance.appleDeviceType='tablet'; } }else{ isCompatibleDevice = _isMinSupportedVersion(_minSupportedIOS, extractedOSVersion); _instance.appleDeviceType='mobile'; } } }catch(e){ // wrapped in try catch so that if any of the expressions fail in older browser, it doesn't cause issues with rest of the script } return isCompatibleDevice; }; this.isABCCompatibleDevice = checkABCCompatibleDevice(); convertChatButtonToMessaging(); this.isDTCApplicableOnPage = function () { // not applicable if relevant DTC flag is off or if relevant VA is not active if((_isUnderSmallBusiness && (!this.data.enableBusinessDTC || !this.isBusinessVAActive())) || (!_isUnderSmallBusiness && (!this.data.enableDTC || !this.isVAActive()))) { return false; } // return false if this is a DTC disabled page return !isDTCDisabledPage; }; this.isVAActive = function () { if (_instance._watchDog && ( (_instance._watchDog["virtual-assistant-status"] && _instance._watchDog["virtual-assistant-status"]["orchestrator"] && _instance._watchDog["virtual-assistant-status"]["watson-virtual-agent"] && _instance._watchDog["virtual-assistant-status"]["liveperson-agent-api"]) || _instance._watchDog["active"] == true) ) { return true; } else { return false; } }; this.isBusinessVAActive = function () { if (_instance._businessWatchDog && ( (_instance._businessWatchDog["virtual-assistant-status"] && _instance._businessWatchDog["virtual-assistant-status"]["orchestrator"] && _instance._businessWatchDog["virtual-assistant-status"]["watson-virtual-agent"] && _instance._businessWatchDog["virtual-assistant-status"]["liveperson-agent-api"]) || _instance._businessWatchDog["active"] == true) ) { return true; } else { return false; } }; // async bind var _style = ""; _style += '.telstra_live_person_back.hide, .telstra_live_person_containerBox.hide, .persistentChatContainer.hide{display:none;}'; _style += '.telstra_live_person_back{width:100%; height:1000%; position: absolute; top: 0; left: 0; background-color: #666666; opacity: 0.8;}'; _style += '.telstra_live_person_containerBox{width: 100%;position: fixed; top: 100px;font-size:14px;}'; _style += '.telstra_live_person_container{width: 80%; max-width:474px; max-height:100%; min-height: 220px; margin: 0px auto; background-color: #ffffff;color: #666666; padding: 10px;}'; _style += '.telstra_live_person_container_header{font-size: 24px; padding: 10px; border-bottom: 1px solid #dddddd;}'; _style += '.telstra_live_person_container_description{padding: 10px;}'; _style += '.telstra_live_person_container_routeLevel1{width: 90%; padding: 5px 10px; margin-bottom: 5px;}'; _style += '.telstra_live_person_container_routeLevel1>select{width: 100%; padding: 5px 0px;}'; _style += '.telstra_live_person_container_routeLevel2{width: 90%; padding: 5px 10px; margin-bottom: 5px;}'; _style += '.telstra_live_person_container_routeLevel2>select{width: 100%; padding: 5px 0px;}'; _style += '.telstra_live_person_container_chatNow_desc{width: 90%; padding: 5px 10px;}'; _style += '.telstra_live_person_container_chatNow_bt{float: right;left: -20px;}'; _style += '.persistentChatContainer{width:auto;position:fixed;bottom:0px;right:56px;}'; _style += '.persistentChatBtnContainer{max-width:1365px;margin-right:auto;margin-left:auto}'; _style += '.persistentChatBtn{background-color:#1a5199;padding:6px 10px 6px 12px;float:right;z-index:1040;text-decoration:none;cursor:pointer}'; _style += '.persistentChatBtn:hover{text-decoration:none !important}'; _style += '.persistentChatBtn:focus{color:#fff !important}'; _style += '.persistentChatLabel{padding-top:2px;font-weight:bold;font-size:16px;margin-left:36px;margin-right:5px;color:#fff}'; _style += '.persistentChatIcon{float:left;width:28px;padding:2px}'; _style += '@media only screen and (max-width:767px){.persistentChatBtnContainer{width:auto;} .persistentChatBtn{border-radius:50%;padding:18px;margin-bottom:40px;margin-right:30px} .persistentChatLabel{display:none} .persistentChatIcon{width:29px}}'; _style += '.abcChatContainerMobile {width: 47pt !important;height: 47pt !important;position: fixed;bottom: 100px !important;right: 24px !important;z-index: 1024;}'; _style += '.abcChatContainerTablet {width: 65pt !important;height: 65pt !important;position: fixed;bottom: 100px !important;right: 24px !important;z-index: 1024;}'; _style += '.abcButtonLink {cursor: pointer;width:47pt;height:47pt;}'; _style += '.abcIconMobile {width:46pt;height:46pt;}'; _style += '.abcIconTablet {width:64pt;height:64pt;}'; _style += '.fadein{opacity: 1;animation-name: fadeInOpacity;animation-iteration-count: 1;animation-timing-function: ease-in;animation-duration: 1s;}@keyframes fadeInOpacity {0% {opacity: 0;}100% {opacity: 1;}}'; _style+= '.LPMcontainer{display:none!important;}'; var _styleElement = document.createElement("STYLE"); _styleElement.innerHTML = _style; document.getElementsByTagName('head')[0].appendChild(_styleElement); var _asyncLoad = setTimeout(function () { if (document.getElementsByTagName('body').length != 0) { _instance.backMask = document.createElement('DIV'); _instance.backMask.setAttribute("class", "telstra_live_person_back hide"); _instance.container = document.createElement('DIV'); _instance.container.setAttribute("class", "telstra_live_person_container modal-content"); _instance.containerBox = document.createElement('DIV'); _instance.containerBox.setAttribute("class", "telstra_live_person_containerBox hide"); _instance.containerBox.appendChild(_instance.container); _instance.closeBT = document.createElement('BUTTON'); _instance.closeBT.setAttribute("class", "close"); _instance.closeBT.onclick = function () { _instance.hide(); }; _instance.container.appendChild(_instance.closeBT); document.getElementsByTagName('body')[0].appendChild(_instance.backMask); document.getElementsByTagName('body')[0].appendChild(_instance.containerBox); _instance.render(); clearTimeout(_asyncLoad); } }, 500); this.getPersistentSection = function (_initSetting) { return this.getInitPersistentSection(_initSetting); }; this.getInitPersistentSection = function (_initSetting) { return this.data.persistentSection || (_initSetting && _initSetting.persistentSection); }; this.getPersistentChatLabel = function (_initSetting) { if (this.isDTCApplicableOnPage()) { return this.data.dtcLabel; } else { return this.getInitPersistentChatLabel(_initSetting); } }; this.getInitPersistentChatLabel = function (_initSetting) { return _instance.data.chatEverywhereLabel; }; this.getInitPersistentChatToggle = function (_initSetting) { return this.data.persistentChat && _initSetting && _initSetting.persistentChat && this.data.persistentSection && this.data.persistentSection.length>0; }; this.init = function (_initSetting) { // store initSettings so we can use them later initParams = _initSetting; this.persistentChatToggle = this.getInitPersistentChatToggle(_initSetting); var persistentChatLabel = this.getInitPersistentChatLabel(_initSetting); this.data.persistentSection = this.getInitPersistentSection(_initSetting); this.setupPersistentChat(this.persistentChatToggle, persistentChatLabel); this.section = _initSetting.section || []; if (this.urlMap) { var _urlVal = document.URL.split("?")[0].split("#")[0]; if (this.urlMap[_urlVal]) { this.section = this.urlMap[_urlVal]; } } this.sourceSection = _initSetting.sourceSection || []; this.callBack = _initSetting.callBack || false; this.callBackInterval = _initSetting.callBackInterval || this.callBackInterval; /*Initializing TP TAG*/ window.lpTag = window.lpTag || {}; window.lpTag.section = this.section; if (window.__loadLivePersonSrc) { window.__loadLivePersonSrc(); // incase if lp overwrite sections window.lpTag.section = this.section; } this.section = JSON.parse(JSON.stringify(this.sourceSection)); window.lpTag.sdes = lpTag.sdes || []; this.isDirect = _initSetting.isDirect; var _styleLocal = ""; if (!_initSetting.onlyTcomCSS) { _styleLocal += '.telstra_live_person_container>.close {float: right;display: block;height: 26px;width: 26px;border: 0;padding: 0;cursor: pointer;background-color: #00aaf3;}'; _styleLocal += '.close:after {display: inline-block;content: "x";font-size: 18px !important;color: #fff !important;font-weight: normal !important;line-height: 26px;}'; if (_initSetting.forceButtonCss) { _styleLocal += '.button,.btn {padding: 14px 20px 14px 20px;border: none;text-decoration: none;display: inline-block;white-space: nowrap;position: relative;outline: none;line-height: normal;max-width: 100%;background-color: #1964c8;color: #fff;}'; } } else { //Tcom Specific css } var _styleLocalElement = document.createElement("STYLE"); _styleLocalElement.innerHTML = _styleLocal; document.getElementsByTagName('head')[0].appendChild(_styleLocalElement); _initCalled = true; // Add event Listener window.lpTag.events.bind("lpUnifiedWindow", "state", function (_data) { // when resume; if (_data && (_data.state === "waiting" || _data.state === "resume")) { if (_instance.callBackTread) { clearInterval(_instance.callBackTread); _instance.callBackTread = false; } else if (_instance.callBack) { _instance.callBackTread = setInterval(function () { _instance.callBack(); }, _instance.callBackInterval * 1000); } } else if (_data && _data.state === "ended") { // when ended; if (_instance.callBackTread) { clearInterval(_instance.callBackTread); _instance.callBackTread = false; } } if (_data && (_data.state === 'init' || _data.state === "waiting" || _data.state === "preChat" || _data.state === "chatting" || _data.state === "offline")) { _instance.chatWindowOpen = true; hidePersistentChatButton(); if(_instance.abcTimeoutHandle){clearTimeout(_instance.abcTimeoutHandle)} } }); window.lpTag.events.bind("lpUnifiedWindow", "windowClosed", function (_data) { _instance.chatWindowOpen = false; showPersistentChatButton(); }); }; var _runLiveChat = function () { var sdesConsumerConfig = { "type": "ctmrinfo", //MANDATORY "info": { "cstatus": "non-auth" } }; if (_instance.authToken) { sdesConsumerConfig.info.cstatus = "auth-tdi"; sdesConsumerConfig.info.customerId = _instance.authToken; } window.lpTag.sdes.push(sdesConsumerConfig); if (_instance.lead) { lpTag.sdes.push({ "type": "lead", //MANDATORY "lead": { "topic": _instance.lead + "" //Customers Level1+Level2 routing choice selection as string - REFER TO TAB3 // COLUMN E } }); } // Section Manipulation for Consumer VA if (window.__disableVA || !_instance.isVAActive()) { // remove VA section _instance.removeSection(_vaSection); _instance.removeSection(_vaSection2); } // Section Manipulation for Business VA if (window.__disableBusinessVA || !_instance.isBusinessVAActive()) { // remove VA section _instance.removeSection(_businessVaSection); } window.lpTag.newPage(document.URL, { section: _instance.section //REFER TO TAB3 COLUMN I }); _instance.section = JSON.parse(JSON.stringify(_instance.sourceSection)); var engagementId; // NOTE: The value of the var has to be an integer. var ignoreOffer = false; window.lpTag.events.bind("LP_OFFERS", "OFFER_IMPRESSION", function (data) { //This is triggered when the engagement has been displayed on the page. if (data.engagementType === 6) { // The ignoreOffer flag is added for the workaround, if it's true we don't execute the auto click code if (ignoreOffer == undefined || !ignoreOffer) { engagementId = data.engagementId; var checkForChat = setInterval(checkRendererStubReady, 500); function checkRendererStubReady() { if (window.lpTag && window.lpTag.taglets && window.lpTag.taglets.rendererStub) { var info = window.lpTag.taglets.rendererStub.getEngagementInfo(engagementId); if (info.state != "undefined" && (info.state === 1 || info.state === 2)) { window.lpTag.taglets.rendererStub.click(engagementId); clearInterval(checkForChat); } } } } else { // Turn the flag off for the next engagment impression ignoreOffer = false; } } }); // Bind to another event which triggers when the chat window state changes window.lpTag.events.bind({ appName: 'API', eventName: 'state', func: function (data) { // If received window init state, which means chat window is going to open // We set the flag to true to ignore next impress which will be delivered immediately after window close. // Adding 'ended' and 'applicationEnded' state for fallback if (data === 'init' || data === 'ended' || data === 'applicationEnded') { ignoreOffer = true; if (data === 'init') { hidePersistentChatButton(); _instance.chatWindowOpen = true; if(_instance.abcTimeoutHandle){clearTimeout(_instance.abcTimeoutHandle);} } else { showPersistentChatButton(); _instance.chatWindowOpen = false; } } else if (data === 'postChat') { _instance.chatWindowOpen = true; if(_instance.abcTimeoutHandle){clearTimeout(_instance.abcTimeoutHandle);} // ignore postChat event for persistentChat Container show/hide to avoid flickering } else { hidePersistentChatButton(); _instance.chatWindowOpen = true; if(_instance.abcTimeoutHandle){clearTimeout(_instance.abcTimeoutHandle);} } } }); }; this.show = function (_showConfig) { var _computedShowConfig = _showConfig || {}; if (_computedShowConfig.section && _computedShowConfig.section.length && _computedShowConfig.section.length > 0) { for (var _i = 0; _i < _computedShowConfig.section.length; _i++) { this.updateSection(_computedShowConfig.section[_i]); } } if (_computedShowConfig.authToken) { this.authToken = _computedShowConfig.authToken; this.updateSection("auth-tdi"); this.removeSection("non-auth"); } else { this.updateSection("non-auth"); this.removeSection("auth-tdi"); } if (_computedShowConfig.lead) { this.lead = _computedShowConfig.lead; } // DTC override if (!_computedShowConfig.isDirect && this.isDTCApplicableOnPage()) { // for 2way routing link, convert it to DTCC/DTCB _computedShowConfig.isDirect = true; if(_isUnderSmallBusiness && this.data.dtcBusinessSection!=''){ this.section = this.data.dtcBusinessSection.split(","); }else if(!_isUnderSmallBusiness && this.data.dtcSection!='') { this.section = this.data.dtcSection.split(","); }else{ _computedShowConfig.isDirect = _showConfig.isDirect; } } if (this.isDirect || _computedShowConfig.isDirect) { console.log("direct route"); _runLiveChat(); } else { //add exclude this.updateLPSection("exclude"); _instance.backMask.classList.remove('hide'); _instance.containerBox.classList.remove('hide'); hidePersistentChatButton(); } }; this.hide = function () { //Remove exclude this.removeLPSection("exclude"); _instance.backMask.classList.add('hide'); _instance.containerBox.classList.add('hide'); _instance.childElements['routeLevel1Select'].value = "0"; _instance.onSelectRouter1(_instance.childElements['routeLevel1Select'].value); showPersistentChatButton(); }; this.render = function () { this.childElements['header'] = document.createElement("DIV"); this.childElements['header'].setAttribute("class", "telstra_live_person_container_header"); this.childElements['header'].setAttribute("role", "region"); this.childElements['header'].setAttribute("aria-labelledby", "telstra_lp_container_description"); this.childElements['header'].innerHTML = this.data.heading; this.container.appendChild(this.childElements['header']); this.childElements['description'] = document.createElement("DIV"); this.childElements['description'].setAttribute("id", "telstra_lp_container_description"); this.childElements['description'].setAttribute("class", "telstra_live_person_container_description"); this.childElements['description'].setAttribute("role", "region"); this.childElements['description'].setAttribute("aria-labelledby", "telstra_lp_container_description"); this.childElements['description'].innerHTML = this.data.description; this.container.appendChild(this.childElements['description']); this.childElements['routeLevel1'] = document.createElement("DIV"); this.childElements['routeLevel1'].setAttribute("id","category_selection"); this.childElements['routeLevel1'].setAttribute("role","navigation"); this.childElements['routeLevel1'].setAttribute("aria-label", "routeLevel1"); this.childElements['routeLevel1Select'] = document.createElement("SELECT"); this.childElements['routeLevel1Select'].setAttribute("id","routeLevel1Select"); this.childElements['routeLevel1Select'].setAttribute("title","Category Selection"); var _defaultOption = document.createElement("OPTION"); _defaultOption.value = "0"; _defaultOption.innerHTML = "Choose a category"; this.childElements['routeLevel1Select'].appendChild(_defaultOption); for (var _option in this.data.options) { var _localOption = document.createElement("OPTION"); _localOption.value = _option; _localOption.innerHTML = this.data.options[_option].label; this.childElements['routeLevel1Select'].appendChild(_localOption); } this.childElements['routeLevel1Select'].onchange = function (e) { _instance.onSelectRouter1(e.target.value); }; this.childElements['routeLevel1'].setAttribute("class", "telstra_live_person_container_routeLevel1"); this.childElements['routeLevel1'].appendChild(this.childElements['routeLevel1Select']); this.container.appendChild(this.childElements['routeLevel1']); //this.container.innerHTML = "Popup"; this.childElements['routeLevel2'] = document.createElement("DIV"); this.childElements['routeLevel2'].setAttribute("class", "telstra_live_person_container_routeLevel2"); this.childElements['routeLevel2'].setAttribute("id","subcategory_selection"); this.childElements['routeLevel2'].setAttribute("role","navigation"); this.childElements['routeLevel2'].setAttribute("aria-label", "routeLevel2"); this.container.appendChild(this.childElements['routeLevel2']); // Chat now component this.childElements['chatNow'] = document.createElement("DIV"); this.childElements['chatNow'].setAttribute("class", "telstra_live_person_container_chatNow"); this.container.appendChild(this.childElements['chatNow']); }; this.onSelectRouter1 = function (_id) { console.log("Route1Selected:" + _id); //clear child while (this.childElements['routeLevel2'].firstChild) { this.childElements['routeLevel2'].removeChild(this.childElements['routeLevel2'].firstChild); } if (_id + "" != "0") { if (this.data.options[_id].childs && JSON.stringify(this.data.options[_id].childs) != JSON.stringify({})) { var _dataOptions = this.data.options[_id].childs; this.childElements['routeLevel2Select'] = document.createElement("SELECT"); this.childElements['routeLevel2Select'].setAttribute("title","Subcategory Selection"); this.childElements['routeLevel2Select'].setAttribute("id","routeLevel2Select"); this.childElements['routeLevel2'].appendChild(this.childElements['routeLevel2Select']); var _defaultOption = document.createElement("OPTION"); _defaultOption.value = "0"; _defaultOption.innerHTML = "Choose a category"; this.childElements['routeLevel2Select'].appendChild(_defaultOption); for (var _option in _dataOptions) { var _localOption = document.createElement("OPTION"); _localOption.value = _option; _localOption.innerHTML = _dataOptions[_option].label; this.childElements['routeLevel2Select'].appendChild(_localOption); } this.childElements['routeLevel2Select'].onchange = function (e) { _instance.onSelectRouter2(e.target.value); }; this.showChatNow(false, false); } else { this.childElements['routeLevel2Select'] = false; var _parentObject = false; for (var _option in this.data.options) { if (_option === _id) { _parentObject = this.data.options[_option]; _parentObject.id = _id; } } this.showChatNow(_parentObject, false); console.log("No child route found for " + _id); } } else { this.showChatNow(false, false); } }; this.onSelectRouter2 = function (_id) { var _ParentRouteId = this.childElements['routeLevel1Select'].value; var _ChildRouteId = this.childElements['routeLevel2Select']; if (_ChildRouteId) { _ChildRouteId = _ChildRouteId.value; } var _parentObject = false; var _childObject = false; for (var _option in this.data.options) { if (_option === _ParentRouteId) { _parentObject = this.data.options[_option]; _parentObject.id = _ParentRouteId; for (var _childOption in this.data.options[_option].childs) { if (_childOption === _ChildRouteId) { _childObject = this.data.options[_option].childs[_childOption]; _childObject.id = _ChildRouteId; } } } } if (_id + "" == "0") { this.showChatNow(false, false); } else { this.showChatNow(_parentObject, _childObject); } }; this.showChatNow = function (_parentObject, _childObject) { var _showableObj = _childObject || _parentObject; var _helpShowable = function (_arrString) { var __returnObj = true; if (_arrString && _arrString.length > 0) { for (var _arrStringI = 0; _arrStringI < _arrString.length; _arrStringI++) { var _sectionArr = _arrString[_arrStringI].split(','); for (var _sectionArrI = 0; _sectionArrI < _sectionArr.length; _sectionArrI++) { if (_sectionArr[_sectionArrI] == _vaSection) { //__returnObj = false; } } } } return __returnObj; }; //clear child while (this.childElements['chatNow'].firstChild) { this.childElements['chatNow'].removeChild(this.childElements['chatNow'].firstChild); } if (!_showableObj) { return; } if (_showableObj.lead) { this.lead = _showableObj.lead; } else { this.lead = false; } var _infoArray = []; _infoArray[0] = _parentObject.section; if (_childObject) { _infoArray[1] = _childObject.section; } this.childElements['chatNowDesc'] = document.createElement("DIV"); this.childElements['chatNowDesc'].setAttribute("class", "telstra_live_person_container_chatNow_desc"); this.childElements['chatNow'].appendChild(this.childElements['chatNowDesc']); if (_showableObj.help && _showableObj.help != "") { // remove if section for child or parent has _vaSection var _sectionStringArr = []; if (_parentObject && _parentObject.section) { _sectionStringArr[_sectionStringArr.length] = _parentObject.section; } if (_childObject && _childObject.section) { _sectionStringArr[_sectionStringArr.length] = _childObject.section; } if (_helpShowable(_sectionStringArr) || window.__disableVA || (!window.__disableVA && !_instance.isVAActive())) { this.childElements['chatNowDesc'].innerHTML = _showableObj.help; } } this.childElements['chatNowBt'] = document.createElement("A"); this.childElements['chatNowBt'].setAttribute("class", "telstra_live_person_container_chatNow_bt btn primary"); this.childElements['chatNowBt'].innerHTML = "Chat now"; this.childElements['chatNowBt'].setAttribute("href", "javascript:void(0);"); // Adding Chat initialisation this.childElements['chatNowBt'].onclick = function () { _instance.initChat(_infoArray); }; this.childElements['chatNow'].appendChild(this.childElements['chatNowBt']); var _clearDiv = document.createElement("DIV"); _clearDiv.style.clear = "both"; this.childElements['chatNow'].appendChild(_clearDiv); }; this.updateSection = function (_id) { var _isUnique = true; for (var _i = 0; _i < this.section.length; _i++) { if (_id === this.section[_i]) _isUnique = false; } if (_isUnique) this.section[this.section.length] = _id; }; this.removeSection = function (_id) { var _updateSections = []; var _hasSection = false; for (var _i = 0; _i < this.section.length; _i++) { if (_id !== this.section[_i]) { _updateSections[_updateSections.length] = this.section[_i]; } else { _hasSection = true; } } if (_hasSection) this.section = _updateSections; }; this.updateLPSection = function (_id) { var _isUnique = true; for (var _i = 0; _i < window.lpTag.section.length; _i++) { if (_id === window.lpTag.section[_i]) _isUnique = false; } if (_isUnique) window.lpTag.section[window.lpTag.section.length] = _id; }; this.removeLPSection = function (_id) { var _updateSections = []; var _hasSection = false; for (var _i = 0; _i < window.lpTag.section.length; _i++) { if (_id !== window.lpTag.section[_i]) { _updateSections[_updateSections.length] = window.lpTag.section[_i]; } else { _hasSection = true; } } if (_hasSection) window.lpTag.section = _updateSections; }; this.initChat = function (args) { console.log("Initiate Live Chat with Args", args); for (var _i = 0; _i < args.length; _i++) { if (args[_i].indexOf(",") === -1) { this.updateSection(args[_i]); } else { var _localArgs = args[_i].split(","); for (var _j = 0; _j < _localArgs.length; _j++) { this.updateSection(_localArgs[_j]); } } } _runLiveChat(); this.hide(); }; function getABCConfig(callback){ var abcXHR = new XMLHttpRequest(); abcXHR.onreadystatechange = function(){ if(this.readyState==4){ if(this.status==200){ try{ var _resp = JSON.parse(this.responseText); callback(null, _resp); }catch (e) { callback(new Error("failed to parse jabuka response")); } }else{ callback(new Error("could not load ABC Config")); } } }; abcXHR.open('GET',_instance.jabukaUrl, true); abcXHR.send(); } function constructABCButton(pageABCConfig){ if (!pageABCConfig.queryParams) { // if no query params avaiable, use all defaults pageABCConfig.queryParams = { "biz-intent-id": _instance.data.bizIntentId, "biz-group-id": _instance.data.bizGroupId, "body": _instance.data.body }; }else{ // use defaults for params that are not available if(!pageABCConfig.queryParams['biz-intent-id']){pageABCConfig.queryParams['biz-intent-id']=_instance.data.bizIntentId} if(!pageABCConfig.queryParams['biz-group-id']){pageABCConfig.queryParams['biz-group-id']=_instance.data.bizGroupId} if(!pageABCConfig.queryParams['body']){pageABCConfig.queryParams['body']=_instance.data.body} } var _abcUrl = abcUrlPrefix + '?'; Object.keys(pageABCConfig.queryParams).forEach(function(queryParam){ _abcUrl+=queryParam+'='+pageABCConfig.queryParams[queryParam]+'&'; }); if(_abcUrl.substring(_abcUrl.length - 1)=='&'){ _abcUrl = _abcUrl.substring(0,_abcUrl.length - 1); } if(_abcUrl.substring(_abcUrl.length - 1)=='?'){ _abcUrl = _abcUrl.substring(0,_abcUrl.length - 1); } // create abc button only if it doesn't exist if(!_instance.abcButtonLink) { _instance.abcButtonLink = document.createElement('div'); _instance.abcButtonLink.setAttribute('class', 'abcButtonLink'); _instance.abcButtonLink.setAttribute('id', 'abcButtonLink'); _instance.abcButtonLink.setAttribute('role', 'navigation'); _instance.abcButtonLink.setAttribute('aria-label', 'abcButtonLink'); _instance.abcButtonLink.setAttribute('tabindex', '0'); _instance.abcButtonLink.onclick = function () { window.open(_abcUrl); }; _instance.abcButtonImage = document.createElement('img'); _instance.abcButtonImage.setAttribute('src', 'https://www.telstra.com.au/content/dam/tcom/virtualassistant/abc/abc-floating-button.png'); _instance.abcButtonImage.setAttribute('alt', 'apple business chat icon'); if (_instance.appleDeviceType === 'tablet') { _instance.persistentChatContainer.classList.add('abcChatContainerTablet'); _instance.abcButtonImage.classList.add('abcIconTablet'); } else { _instance.persistentChatContainer.classList.add('abcChatContainerMobile'); _instance.abcButtonImage.classList.add('abcIconMobile'); } _instance.abcButtonLink.appendChild(_instance.abcButtonImage); _instance.persistentChatContainer.classList.add('fadein'); _instance.persistentChatContainer.appendChild(_instance.abcButtonLink); _instance.abcTimeoutHandle = setTimeout(showPersistentChatButton, pageABCConfig.delay || _instance.data.abcButtonDelay); } } function constructChatEverywhereButton(persistentChatLabel){ // create elements only if they don't exist if(!_instance.persistentChatBtnContainer) { _instance.persistentChatBtnContainer = document.createElement('DIV'); } if(!_instance.persistentChatBtn) { _instance.persistentChatBtn = document.createElement('DIV'); } if(!_instance.persistentChatIcon) { _instance.persistentChatIcon = document.createElement('IMG'); } if(!_instance.persistentChatLabel) { _instance.persistentChatLabel = document.createElement('DIV'); } _instance.persistentChatBtnContainer.setAttribute("class", "persistentChatBtnContainer"); _instance.persistentChatBtnContainer.setAttribute("aria-labelledby", "persistentChatLabel"); _instance.persistentChatBtn.setAttribute("class", "persistentChatBtn"); _instance.persistentChatBtn.setAttribute("role", "button"); _instance.persistentChatBtn.setAttribute("aria-labelledby", "persistentChatLabel"); _instance.persistentChatBtn.setAttribute("tabindex", "0"); _instance.persistentChatIcon.setAttribute("class", "persistentChatIcon"); _instance.persistentChatIcon.setAttribute("alt", persistentChatLabel); _instance.persistentChatIcon.src = "https://www.telstra.com.au/etc/designs/liveperson/icon-speech.png"; _instance.persistentChatLabel.setAttribute("id", "persistentChatLabel"); _instance.persistentChatLabel.setAttribute("class", "persistentChatLabel"); _instance.persistentChatLabel.innerHTML = persistentChatLabel; _instance.persistentChatBtn.onclick = function () { // Note: RetrieveChatAuthToken will call liveperson.show function. /* if (window.RetrieveChatAuthToken) { if (!_instance.data.persistentSection) { window.RetrieveChatAuthToken([], false); } else { window.RetrieveChatAuthToken(_instance.data.persistentSection, true); } } else {*/ if (!_instance.data.persistentSection || _instance.data.persistentSection.length === 0) { _instance.show(); } else { _instance.show({isDirect: true, section: _instance.data.persistentSection}); } //} }; //_instance.persistentChatBtn.href = "#"; _instance.persistentChatBtn.setAttribute("title", persistentChatLabel); _instance.persistentChatBtn.setAttribute("id", "persistentChatBtnId"); //used for omniture tracking // append only if not already appended // can rely on outermost parent check if(_instance.persistentChatContainer.childElementCount===0 || _instance.persistentChatContainer.children.length===0) { _instance.persistentChatBtn.appendChild(_instance.persistentChatIcon); _instance.persistentChatBtn.appendChild(_instance.persistentChatLabel); _instance.persistentChatBtnContainer.appendChild(_instance.persistentChatBtn); _instance.persistentChatContainer.appendChild(_instance.persistentChatBtnContainer); } } this.setupPersistentChat = function (persistentChatToggle, persistentChatLabel) { if(_instance.persistentChatContainer === false) { // create container only if not already created _instance.persistentChatContainer = document.createElement('DIV'); _instance.persistentChatContainer.setAttribute("class", "persistentChatContainer"); _instance.persistentChatContainer.setAttribute("id", "persistentChatContainer"); _instance.persistentChatContainer.setAttribute("role", "navigation"); _instance.persistentChatContainer.setAttribute("aria-label", "persistentChatContainer"); // delay showing chat everywhere button until either: // abc chat button delay amount of time has elapsed for ABC Compatible pages // or // VA health check has completed hidePersistentChatButton(); document.getElementsByTagName('body')[0].appendChild(_instance.persistentChatContainer); } if (persistentChatToggle) { if(this.isABCCompatibleDevice && this.data.abcEnabled){ // for ABC, get config and use that config to determine what needs to be done for that specific page getABCConfig(function(err, jabuka){ var _abcConfig={enabled: true}; if(err){ // assume abc enabled with defaults. if required, special error handling can be done in future }else{ // got abc config. check this page specific config if(jabuka.pageRules[thisPage]){ _abcConfig = jabuka.pageRules[thisPage]; }else { var patternList=Object.keys(jabuka.patternRules); for(var i=0;i