1(function( $ ) { 2 'use strict'; 3 4 <!-- Start of Talkdesk Code --> 5 6 var webchat; 7 ((window, document, node, props, configs) => { 8 if (window.TalkdeskChatSDK) { 9 console.error("TalkdeskChatSDK already included"); 10 return; 11 } 12 var divContainer = document.createElement("div"); 13 divContainer.id = node; 14 document.body.appendChild(divContainer); 15 var src = `https://talkdeskchatsdk.talkdeskapp.com/talkdeskchatsdk.js`; 16 var script = document.createElement("script"); 17 var firstScriptTag = document.getElementsByTagName("script")[0]; 18 script.type = "text/javascript"; 19 script.charset = "UTF-8"; 20 script.id = "tdwebchatscript"; 21 script.src = src; 22 script.async = true; 23 firstScriptTag.parentNode.insertBefore(script, firstScriptTag); 24 script.onload = () => { 25 webchat = TalkdeskChatSDK(node, props); 26 webchat.init(configs); 27 /* 28 * Send custom data from your website to TalkDesk! 29 * If you would like to do it, you need to remove the following commented code and 30 * modify the webchat.setContextParam parameters to pass in the data you need. 31 */ 32 function setContext() { 33 webchat.setContextParam({ "Customer_id": Customer_id, "Customer_ref": Customer_ref, "Department": Department }) 34 } 35 // Send data when the chat conversation is initiated 36 webchat.onConversationStart = function() { 37 setContext() 38 } 39 // Send data when the chat widget is open 40 webchat.onOpenWebchat = function() { 41 setContext() 42 } 43 }; 44 })( 45 window, 46 document, 47 "tdWebchat", 48 { touchpointId: touchpointId, accountId: "", region: "td-us-1" }, 49 { enableValidation: false, enableEmoji: true, enableUserInput: true, enableAttachments: true } 50 ); 51 52<!-- End of Talkdesk Code --> 53 54})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.