1var __extends = (this && this.__extends) || (function () { 2 var extendStatics = function (d, b) { 3 extendStatics = Object.setPrototypeOf || 4 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 5 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 6 return extendStatics(d, b); 7 }; 8 return function (d, b) { 9 if (typeof b !== "function" && b !== null) 10 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 11 extendStatics(d, b); 12 function __() { this.constructor = d; } 13 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 14 }; 15})(); 16var landingpages; 17(function (landingpages) { 18 var sharing; 19 (function (sharing) { 20 var UtilFunctions = (function () { 21 function UtilFunctions() { 22 } 23 UtilFunctions.bindEvent = function (target, event, method) { 24 if (target.addEventListener) { 25 target.addEventListener(event, method, false); 26 } 27 else if (target['attachEvent']) { 28 target['attachEvent']('on' + event, method); 29 } 30 }; 31 UtilFunctions.unbindEvent = function (target, event, method) { 32 if (target.removeEventListener) { 33 target.removeEventListener(event, method, false); 34 } 35 else if (target['detachEvent']) { 36 target['detachEvent']('on' + event, method); 37 } 38 }; 39 UtilFunctions.preventDefault = function (event) { 40 event = event || window.event; 41 if (event.preventDefault) 42 event.preventDefault(); 43 event.returnValue = false; 44 }; 45 UtilFunctions.disableMouseWheel = function () { 46 var _this = this; 47 for (var i = 0; i < this.wheelEvents.length; i++) 48 this.bindEvent(window, this.wheelEvents[i], function (event) { return _this.preventDefault(event); }); 49 }; 50 UtilFunctions.enableMouseWheel = function () { 51 var _this = this; 52 for (var i = 0; i < this.wheelEvents.length; i++) 53 this.unbindEvent(window, this.wheelEvents[i], function (event) { return _this.preventDefault(event); }); 54 }; 55 UtilFunctions.extend = function (trgt, src) { 56 for (var prop in src) 57 trgt[prop] = src[prop]; 58 }; 59 UtilFunctions.viewport = function () { 60 var el = window, param = 'inner'; 61 if (!('innerWidth' in window)) { 62 el = document.documentElement || document.body; 63 param = 'client'; 64 } 65 return { width: el["".concat(param, "Width")], height: el["".concat(param, "Height")] }; 66 }; 67 UtilFunctions.currentProtocol = function () { 68 var re = /^https:/i, protocol = re.test(location.protocol) ? "https:" : "http:"; 69 if (document.getElementsByTagName) { 70 var baseElements = document.getElementsByTagName("base"); 71 if (baseElements.length) { 72 var baseHref = baseElements[0].href; 73 if (baseHref && baseHref.length >= 6) 74 protocol = re.test(baseHref) ? "https:" : "http:"; 75 } 76 } 77 return protocol; 78 }; 79 UtilFunctions.wheelEvents = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll']; 80 return UtilFunctions; 81 }()); 82 sharing.UtilFunctions = UtilFunctions; 83 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 84})(landingpages || (landingpages = {})); 85var landingpages; 86(function (landingpages) { 87 var sharing; 88 (function (sharing) { 89 var Properties = (function () { 90 function Properties(pageDomain, pageId, appearance, autoShow, keyDismiss, delay, showMobile, surveyWidth, transparent, shroudColor, shroudOpacity, attach, description, closeButtonLabel, screenreader, openOnExitIntent, reopenAfterDismissedDelay, openAfterNumberOfPagesViewed, showAfterDismissed, openOnScrollDepth, hideAfterSubmission, unidentifiedVisitorsOnly, previewToken, defaultCookiesExpiryLengthInDays) { 91 if (attach === void 0) { attach = ""; } 92 this.pageDomain = pageDomain; 93 this.shroudColor = shroudColor; 94 this.attach = attach; 95 this.appearance = 0; 96 this.autoShow = true; 97 this.keyDismiss = false; 98 this.showMobile = false; 99 this.surveyWidth = 600; 100 this.transparent = false; 101 this.screenreader = false; 102 this.defaultExpiryLengthInDays = 365; 103 this.reopenAfterDismissedDays = 0; 104 this.delay = 0; 105 this.openOnExitIntent = false; 106 this.openAfterNumberOfPagesViewed = 0; 107 this.showAfterDismissed = false; 108 this.openOnScrollDepth = 0; 109 this.hideAfterSubmission = false; 110 this.unidentifiedVisitorsOnly = false; 111 this.pageId = pageId.split('/')[0]; 112 if (appearance) 113 this.appearance = appearance === 'uc' ? 'uc' : parseInt(appearance); 114 if (/false/i.test(autoShow)) 115 this.autoShow = false; 116 if (/true/i.test(keyDismiss)) 117 this.keyDismiss = true; 118 if (delay) 119 this.delay = parseInt(delay); 120 if (/true/i.test(showMobile)) 121 this.showMobile = true; 122 if (surveyWidth) 123 this.surveyWidth = parseInt(surveyWidth) || this.surveyWidth; 124 if (/true/i.test(transparent)) 125 this.transparent = true; 126 if (/true/i.test(screenreader)) 127 this.screenreader = true; 128 if (/true/i.test(openOnExitIntent)) 129 this.openOnExitIntent = true; 130 if (!!parseInt(reopenAfterDismissedDelay)) 131 this.reopenAfterDismissedDays = parseInt(reopenAfterDismissedDelay); 132 if (!!parseInt(openAfterNumberOfPagesViewed)) 133 this.openAfterNumberOfPagesViewed = parseInt(openAfterNumberOfPagesViewed); 134 if (!!/true/i.test(showAfterDismissed)) 135 this.showAfterDismissed = true; 136 if (!!parseInt(openOnScrollDepth)) 137 this.openOnScrollDepth = parseInt(openOnScrollDepth); 138 if (!!/true/i.test(hideAfterSubmission)) 139 this.hideAfterSubmission = true; 140 if (!!/true/i.test(unidentifiedVisitorsOnly)) 141 this.unidentifiedVisitorsOnly = true; 142 this.shroudOpacity = parseInt(shroudOpacity) || 0; 143 this.description = description; 144 this.closeButtonLabel = closeButtonLabel; 145 this.previewToken = previewToken; 146 if (!!parseInt(defaultCookiesExpiryLengthInDays)) 147 this.defaultExpiryLengthInDays = parseInt(defaultCookiesExpiryLengthInDays); 148 } 149 Properties.create = function (script) { 150 if (/\?.*sharing=lp-/.test(script.src)) { 151 return this.createFromSrc(script.src); 152 } 153 else { 154 return this.createFromAttributes(script); 155 } 156 }; 157 Properties.createFromSrc = function (src) { 158 var query = src.match(/\?(.+)#?/)[1].split(/&/), values = {}; 159 for (var i = 0; i < query.length; i++) { 160 var split = query[i].split(/=/); 161 if (split.length === 2) 162 values[split[0]] = decodeURIComponent(split[1]); 163 } 164 return this.parseAndCreate(values); 165 }; 166 Properties.parseAndCreate = function (values) { 167 return new Properties(values['domain'] || '', values['id'] || '', values['appearance'], values['auto'], values['keydismiss'], values['delay'], values['mobile'], values['width'], values['transparent'], values['shroudcolor'], values['shroudopacity'], values['attach'], values['description'], values['closebuttonlabel'], values['screenreader'], values['open-on-exit-intent'], values['reopen-dismissed-days'], values['open-after-number-of-pages-viewed'], values['show-after-dismissed'], values['open-on-scroll-depth'], values['hide-after-submission'], values['unidentified-visitors-only'], values['previewtoken'], values['default-cookie
167s-expiry-length-in-days']); 168 }; 169 Properties.createFromAttributes = function (script) { 170 return new Properties(script.getAttribute('data-page-domain'), script.getAttribute('data-page-id'), script.getAttribute('data-appearance'), script.getAttribute('auto'), script.getAttribute('data-key-dismiss'), script.getAttribute('data-delay'), script.getAttribute('data-mobile'), null, null, null, null, null, null, null, null, script.getAttribute('open-on-exit-intent'), script.getAttribute('reopen-dismissed-days'), script.getAttribute('open-after-number-of-pages-viewed'), script.getAttribute('show-after-dismissed'), script.getAttribute('open-on-scroll-depth'), script.getAttribute('hide-after-submission'), script.getAttribute('unidentified-visitors-only'), script.getAttribute('data-preview-token'), script.getAttribute('data-default-cookies-expiry-length-in-days')); 171 }; 172 return Properties; 173 }()); 174 sharing.Properties = Properties; 175 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 176})(landingpages || (landingpages = {})); 177var landingpages; 178(function (landingpages) { 179 var sharing; 180 (function (sharing) { 181 var SharingBase = (function () { 182 function SharingBase(script) { 183 this.script = script; 184 this.sandbox = 'allow-modals allow-downloads allow-top-navigation allow-forms allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation'; 185 this.properties = sharing.Properties.create(script); 186 this.iframe = document.createElement('iframe'); 187 if (!window.ecPF) 188 window.ecPF = new landingpages.sharing.EmbeddingAPI(this.properties.pageDomain); 189 window.ecPF._register(this, this.properties.pageId); 190 } 191 SharingBase.getScripts = function (selector) { 192 return document.querySelectorAll("script[src*=\"sharing=lp-".concat(selector, "\"],script[data-sharing=lp-").concat(selector, "]")); 193 }; 194 return SharingBase; 195 }()); 196 sharing.SharingBase = SharingBase; 197 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 198})(landingpages || (landingpages = {})); 199var landingpages; 200(function (landingpages) { 201 var sharing; 202 (function (sharing) { 203 var EmbeddingAPI = (function () { 204 function EmbeddingAPI(pageDomain) { 205 var _this = this; 206 this.pages = []; 207 this.complete = []; 208 window.lpXD.receiveMessage(function (msg) { return _this.messageRecieved(msg); }, landingpages.sharing.UtilFunctions.currentProtocol() + pageDomain); 209 } 210 EmbeddingAPI.prototype._register = function (form, pageId) { 211 this.pages.push({ form: form, pageId: this.getId(pageId) }); 212 }; 213 EmbeddingAPI.prototype.messageRecieved = function (message) { 214 var data = null; 215 try { 216 data = JSON.parse(message.data); 217 } 218 catch (e) { } 219 if (data && data.complete && data.name) 220 this.processComplete(data); 221 }; 222 EmbeddingAPI.prototype.processComplete = function (data) { 223 this.complete.filter(function (x) { return x.pageId === data.name || x.pageId === ''; }).forEach(function (x) { return x.method(data.formData); }); 224 if (data && data.formData && data.formData.contactEmail && window.dmPt) { 225 try { 226 window.dmPt('identify', data.formData.contactEmail); 227 } 228 catch (e) { } 229 } 230 }; 231 EmbeddingAPI.prototype.onComplete = function (fn, pageId) { 232 if (pageId === void 0) { pageId = ''; } 233 this.complete.push({ pageId: this.getId(pageId), method: fn }); 234 }; 235 EmbeddingAPI.prototype.open = function (pageId) { 236 if (pageId === void 0) { pageId = ''; }
237 this.getForms(pageId).forEach(function (x) { return x.form.open(); }); 238 }; 239 EmbeddingAPI.prototype.close = function (pageId) { 240 if (pageId === void 0) { pageId = ''; } 241 this.getForms(pageId).forEach(function (x) { return x.form.close(); }); 242 }; 243 EmbeddingAPI.prototype.getForms = function (name) { 244 var _this = this; 245 var forms = this.pages; 246 if (name) { 247 forms = forms.filter(function (x) { return x.pageId === _this.getId(name); }); 248 } 249 return forms; 250 }; 251 EmbeddingAPI.prototype.getId = function (pageId) { 252 return pageId.split('/')[0]; 253 }; 254 return EmbeddingAPI; 255 }()); 256 sharing.EmbeddingAPI = EmbeddingAPI; 257 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 258})(landingpages || (landingpages = {})); 259var landingpages; 260(function (landingpages) { 261 var sharing; 262 (function (sharing) { 263 if (!window.lpXD) { 264 window.lpXD = function () { 265 var interval_id, last_hash, cache_bust = 1, attached_callback; 266 return { 267 postMessage: function (message, target_url, target) { 268 if (!target_url) { 269 return; 270 } 271 target = target || parent; 272 if (/dsid=/.test(location.search)) { 273 var dsid = location.search.replace(/.*dsid=([^&]+)/, '$1'); 274 message = message.replace(/\}\s*$/, ",\"islpsurvey\":true, \"dsid\":\"".concat(dsid, "\"}")); 275 } 276 if (window['postMessage']) { 277 target['postMessage'](message, target_url.replace(/([^:]+:\/\/[^\/]+).*/, '$1')); 278 } 279 else if (target_url) { 280 target.location = target_url.replace(/#.*$/, '') + '#' + (+new Date) + (cache_bust++) + '&' + message; 281 } 282 }, 283 receiveMessage: function (callback, source_origin) { 284 if (window['postMessage']) { 285 if (callback) { 286 attached_callback = function (e) { 287 if ((Object.prototype.toString.call(source_origin) === "[object Function]" && source_origin(e.origin) === !1)) { 288 return !1; 289 } 290 callback(e); 291 }; 292 } 293 if (window['addEventListener']) { 294 window[callback ? 'addEventListener' : 'removeEventListener']('message', attached_callback, !1); 295 } 296 else { 297 window[callback ? 'attachEvent' : 'detachEvent']('onmessage', attached_callback); 298 } 299 } 300 else { 301 interval_id && clearInterval(interval_id); 302 interval_id = null; 303 if (callback) { 304 interval_id = setInterval(function () { 305 var hash = document.location.hash, re = /^#?\d+&/; 306 if (hash !== last_hash && re.test(hash)) { 307 last_hash = hash; 308 callback({ data: hash.replace(re, '') }); 309 } 310 }, 100); 311 } 312 } 313 } 314 }; 315 }(); 316 } 317 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 318})(landingpages || (landingpages = {})); 319var landingpages; 320(function (landingpages) { 321 var sharing; 322 (function (sharing) { 323 var CookieManager = (function () { 324 function CookieManager(id) { 325 this.completeName = "".concat(id, "-Completed"); 326 this.dismissedName = "".concat(id, "-Dismissed"); 327 this.reopenAfterDismissedDelayInDays = "".concat(id, "-ReopenDismissedDays"); 328 this.pageViewsName = "".concat(id, "-PageViews"); 329 } 330 CookieManager.prototype.read = function (name) { 331 var nameEQ = "".concat(name, "="), cookies = document.cookie.split(';'); 332 for (var i = 0; i < cookies.length; i++) { 333 var cookie = cookies[i]; 334 while (cookie.charAt(0) === ' ') 335 cookie = cookie.substring(1, cookie.length); 336 if (cookie.indexOf(nameEQ) === 0) 337 return cookie.substring(nameEQ.length, cookie.length); 338 } 339 return null; 340 }; 341 CookieManager.prototype.write = function (name, value, days) { 342 var expires = ""; 343 if (days) { 344 var date = new Date(); 345 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 346 expires = "; expires=".concat(date.toUTCString()); 347 } 348 document.cookie = "".concat(name, "=").concat(value).concat(expires, ";secure=true; path=/; SameSite=None;"); 349 }; 350 CookieManager.prototype.clear = function (name) { 351 document.cookie = "".concat(name, "=;secure=true; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=None;"); 352 }; 353 return CookieManager; 354 }()); 355 sharing.CookieManager = CookieManager; 356 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 357})(landingpages || (landingpages = {})); 358var landingpages; 359(function (landingpages) { 360 var sharing; 361 (function (sharing) { 362 var EmbedCookieManager = (function () { 363 function EmbedCookieManager(pageId) { 364 this.pageId = pageId; 365 this.cookieManager = new sharing.CookieManager(this.pageId); 366 } 367 EmbedCookieManager.prototype.setCompletedCookie = function () { 368 this.cookieManager.write(this.cookieManager.completeName, 'true', 365); 369 }; 370 EmbedCookieManager.prototype.hasBeenCompleted = function () { 371 return this.cookieManager.read(this.cookieManager.completeName) == 'true'; 372 }; 373 return EmbedCookieManager; 374 }());
375 sharing.EmbedCookieManager = EmbedCookieManager; 376 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 377})(landingpages || (landingpages = {})); 378var landingpages; 379(function (landingpages) { 380 var sharing; 381 (function (sharing) { 382 var SharingEmbed = (function (_super) { 383 __extends(SharingEmbed, _super); 384 function SharingEmbed(script) { 385 var _this = _super.call(this, script) || this; 386 _this.script = script; 387 if (window.__dmProcessedPages.indexOf(_this.properties.pageId) > -1) 388 return _this; 389 window.__dmProcessedPages.push(_this.properties.pageId); 390 _this.cookieManager = new sharing.EmbedCookieManager(_this.properties.pageId); 391 if (_this.properties.autoShow) 392 _this.open(); 393 window.lpXD.receiveMessage(function (msg) { 394 try { 395 var message = JSON.parse(msg.data); 396 if (message.name === _this.properties.pageId) { 397 if (message.complete) 398 _this.cookieManager.setCompletedCookie(); 399 if (message.height) 400 _this.setHeight(message.height.toString()); 401 } 402 } 403 catch (e) { } 404 }, sharing.UtilFunctions.currentProtocol() + _this.properties.pageDomain); 405 return _this; 406 } 407 SharingEmbed.create = function () { 408 window.__dmProcessedPages = window.__dmProcessedPages || []; 409 var scripts = _super.getScripts.call(this, 'embed'); 410 for (var i = 0; i < scripts.length; i++) 411 new SharingEmbed(scripts[i]); 412 }; 413 SharingEmbed.prototype.open = function () { 414 this.setAttributes(); 415 var attach = this.properties.attach ? document.querySelector(this.properties.attach) : null; 416 if (!attach) 417 attach = this.script.parentElement; 418 attach.appendChild(this.iframe); 419 }; 420 SharingEmbed.prototype.close = function () { 421 this.iframe.parentNode.removeChild(this.iframe); 422 }; 423 SharingEmbed.prototype.setAttributes = function () { 424 var completed = this.cookieManager.hasBeenCompleted() ? '/?__lpcomplete=true' : ''; 425 this.iframe.setAttribute('src', "//".concat(this.properties.pageDomain, "/p/").concat(this.properties.pageId).concat(completed, "#").concat(document.location.href)); 426 this.iframe.setAttribute('id', this.properties.pageId); 427 this.iframe.setAttribute('class', '_lpSurveyEmbed'); 428 this.iframe.setAttribute('name', this.properties.pageId); 429 this.iframe.setAttribute('width', '100%'); 430 this.iframe.setAttribute('frameborder', '0'); 431 this.iframe.setAttribute('scrolling', 'no'); 432 this.iframe.setAttribute('allow', 'geolocation'); 433 this.iframe.setAttribute('sandbox', this.sandbox); 434 this.iframe.setAttribute('style', SharingEmbed.baseStyle); 435 if (this.properties.description) { 436 this.iframe.setAttribute('title', this.properties.description); 437 } 438 this.script.setAttribute('data-iframe-loaded', 'true'); 439 }; 440 SharingEmbed.prototype.setHeight = function (height) { 441 this.iframe.setAttribute('height', height); 442 this.iframe.setAttribute('max-height', height); 443 }; 444 SharingEmbed.openned = []; 445 SharingEmbed.baseStyle = 'border:none 0!important;margin:0!important;padding:0!important;'; 446 return SharingEmbed; 447 }(sharing.SharingBase)); 448 SharingEmbed.create(); 449 })(sharing = landingpages.sharing || (landingpages.sharing = {})); 450})(landingpages || (landingpages = {}));
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.