// 1. Create the container var qc_container = document.createElement( 'div' ); qc_container.id = 'qc-container'; document.body.appendChild( qc_container ); var widget_script = ''; var origin_url = window.document.location.origin; // 2. Create a iframe to load the react App var qc_iframe = document.createElement( 'iframe' ); qc_iframe.id = 'qc-frame'; // position: fixed; remove a white space which was added at the bottom of the page qc_iframe.style.position = 'fixed'; // Cannot use display: none; otherwise the autogrow textarea will not work qc_iframe.style.visibility = 'hidden'; document.body.appendChild( qc_iframe ); qc_iframe.contentWindow.document.write( '' + widget_script + '' ); qc_iframe.contentWindow.document.close(); qc_iframe.contentWindow.context = { baseUrl: 'https://onelocal.com', environment: 'production', merchantId: '5e6266b03d85017c3d9c0f4e', merchantName: 'Lockerby Transportation Group', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"intro":{"enabled":true,"text":"Please note, this messaging system does not accept taxi bookings, please call (705) 522-2222 or use our LockerbyGO app to book a taxi. Hi there! Thanks for contacting Lockerby Transportation, please let us know how we can assist you. Have a great day!"},"message_form":{"name_optional":false,"text":"This messaging service does not accept taxi bookings. Please call (705) 522-2222 or use our LockerbyGo app to do so. For any other reason, please send us a message and we will get back to you as soon as possible.","title":"Message Us","cta_text":"Send"},"mobile":{"call_cta_enabled":true,"text":"Please note you can not book a taxi through text, please call Lockerby or use the LockerbyGO app. For any other reason, please send us a message and we will get back to you as soon as possible.","title":"Contact Lockerby Transportation Group"},"style":{"primary_color":"#5283CC"},"auto_response":{"enabled":true,"text":"Thank-you for contacting Lockerby Transportation. We will get back you as soon as possible regarding your request. If you are looking to book a taxi please call (705) 522-2222 or use our Lockerby GO App. This inbox is only opened during the hours of 9-5 Monday-Friday, and does not take taxi bookings. \n\nHave a great day!"},"chatbot":{"auto_load":true,"enabled":false,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"phone_number":{"national_format":"(705) 242-5195","value":"+17052425195"},"call_phone_number":{"national_format":"(705) 522-2222","value":"+17055222222"},"locations":[],"location_selection":{"title":"Location Selection","text":"Select the location which you would like to contact","skip_text":"Skip"},"confirmation":{"title":"Thanks for your message","text":"We will follow up with you shortly by text message."}} }; window.addEventListener( "message", ( event ) => { if( event.origin.indexOf( origin_url ) === -1 || ! event.data?.event_name ) { return; } if( typeof gtag !== "undefined" ) { gtag( "event", event.data.event_name, { name: event.data.event_name } ); } }, false );