//noinspection BadExpressionStatementJS
(function(window){
var replaceUrl = false;
var url = new URL(window.location.href);
var searchParams = new URLSearchParams(url.search);
if ('undefined' === typeof window.kuuid) {
setUuidParam();
}
if ('undefined' === typeof window.kll) {
setKllParam();
}
if ('undefined' === typeof window.kref) {
setKrefParam();
}
setKaffParam();
if (replaceUrl) {
window.history.replaceState(
null,
null,
url.toString()
);
}
function getCookie(name) {
var cookieRegex = '(?:(?:^|.*; *)' + name + ' *= *([^;]*).*$)|^.*$';
var cookie = document.cookie.match(cookieRegex)[1];
if (cookie) {
return decodeURIComponent(cookie);
}
}
function setCookie(name, value, options) {
if (options && options.days) {
options['max-age'] = options.days * 60 * 60 * 24;
delete options.days;
}
var optionString = '';
Object.keys(options).map(function(key) {
optionString += '; ' + key + '=' + options[key];
});
document.cookie = name + '=' + encodeURIComponent(value) + optionString + "; path=/; domain=" + getMainDomain();
}
function getMainDomain() {
var parts = document.domain.split('.').reverse();
var mainDomain = parts[1] + '.' + parts[0];
return mainDomain;
}
function generateUUID() {
var d = new Date().getTime();
var d2 = (
'undefined' !== typeof performance
&& performance.now
&& (performance.now() * 1000)
)
|| 0;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16;
if (d > 0) {
r = (d + r) % 16 | 0;
d = Math.floor(d / 16);
} else {
r = (d2 + r) % 16 | 0;
d2 = Math.floor(d2 / 16);
}
return (
c === 'x'
? r
: (r & 0x3 | 0x8)
).toString(16);
});
}
function generateKuuid() {
var uuid = generateUUID();
var currentUnixTimestamp = Math.floor(Date.now() / 1000);
return uuid + '-' + currentUnixTimestamp;
}
function isInIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
function validateKuuid(uuid) {
// Explode the string by the dash
var segments = uuid.split('-');
// Check if the 6th segment exists & is a valid UNIX timestamp
if (
segments.length >= 6
&& segments[5]
) {
return isValidUnixTimestamp(segments[5]);
}
// If no 6th segment, check the current time against the threshold
var currentTimestamp = Math.floor(Date.now() / 1000); // Current UNIX timestamp in seconds
var thresholdTimestamp = 1728950400; // 15 Oct 2024 00:00:00 UNIX timestamp
// Validate if the current timestamp is before the threshold
return currentTimestamp < thresholdTimestamp;
}
function setUuidParam() {
var inIframe = isInIframe();
var uuid;
if (inIframe) {
if (searchParams.has('kuid')) {
uuid = searchParams.get('kuid');
} else {
uuid = getCookie('kuuid');
}
} else {
uuid = getCookie('kuuid');
if (!uuid) {
var kartraReferrer = searchParams.get('kref');
var kartraLid = searchParams.get('lid');
if (
searchParams.has('kuid')
&& kartraReferrer
&& (
document.referrer
|| kartraLid
)
) {
uuid = searchParams.get('kuid');
}
}
}
if (
!uuid
|| !validateKuuid(uuid)
) {
uuid = generateKuuid();
}
window.kuuid = uuid;
if (searchParams.has('kuid')) {
url.searchParams.delete('kuid');
replaceUrl = true;
}
}
function setKllParam() {
var kll = getCookie('kll');
if (!kll) {
if (searchParams.has('kll')) {
kll = searchParams.get('kll');
}
}
window.kll = kll;
if (searchParams.has('kll')) {
url.searchParams.delete('kll');
replaceUrl = true;
}
}
function setKrefParam() {
var referrer;
var inIframe = isInIframe();
if (inIframe) {
if (searchParams.has('referrer')) {
referrer = searchParams.get('referrer');
}
} else {
referrer = (document.referrer && document.referrer.split('?')[0]) || '';
}
if (searchParams.has('kref')) {
referrer = searchParams.get('kref');
replaceUrl = true;
url.searchParams.delete('kref');
}
window.kref = referrer;
}
function setKaffParam() {
if (
searchParams.has('kaff')
&& searchParams.has('kmid')
) {
var affiliateHash = searchParams.get('kaff');
var memberHash = searchParams.get('kmid');
var cookieName = 'kaff_' + memberHash;
url.searchParams.delete('kaff');
url.searchParams.delete('kmid');
setCookie(
cookieName,
affiliateHash,
{
path: '/',
days: 30,
secure: true,
samesite: 'none',
}
);
replaceUrl = true;
}
}
function isValidUnixTimestamp(timestamp) {
var timestampInteger = parseInt(timestamp, 10);
return !isNaN(timestampInteger)
&& timestampInteger > 0
&& timestamp.length === 10;
}
}(window));
;(function(window) {
'use strict';
window['kartra'] = 'undefined' === typeof window['kartra']
? []
: window['kartra'];
window['kartra']['video-embeds'] = 'undefined' === typeof window['kartra']['video-embeds']
? []
: window['kartra']['video-embeds'];
var stickySensitivity = 100,
jQ;
/** Pages video **/
window['kartra']['pages'] = 'undefined' === typeof window['kartra']['pages']
? []
: window['kartra']['pages'];
window['kartra']['pages']['init'] = 'undefined' === typeof window['kartra']['pages']['init']
? []
: window['kartra']['pages']['init'];
if ('undefined' !== typeof window['kartra']['video-embeds']['GM7Aeb5nQCCpmaccc']) {
return false;
}
loadCss();
loadAnalytics();
jQuery(document).ready(function() {
jQ = jQuery.noConflict();
var $videoContainer = jQ('.kartra_video_containerGM7Aeb5nQCCp[data-random_str="maccc"]');
if ($videoContainer.parents('[data-delay-duration]').not('.js_delay_loaded').length < 1) {
initEmbedGM7Aeb5nQCCpmaccc();
} else {
// works with delay code in pages-skeleton.js
$videoContainer
.attr('data-video-hashed-rnd', 'GM7Aeb5nQCCpmaccc')
.attr('data-delayed-type', 'video')
.addClass('js_delayed');
window['kartra']['pages']['init']['video'] = function($container) {
window['kartra']['video-embeds'][$container.attr('data-video-hashed-rnd')]();
jQ(window).trigger('resize');
}
}
});
window['kartra']['video-embeds']['GM7Aeb5nQCCpmaccc'] = initEmbedGM7Aeb5nQCCpmaccc;
function loadAnalytics() {
var analyticsScript = document.createElement('script');
analyticsScript.type = 'text/javascript';
analyticsScript.src = 'https://app.kartra.com/resources/js/analytics/DpwQLxk7';
document.body.appendChild(analyticsScript);
}
function loadCss() {
var cssPath = 'https://app.kartra.com/css/new/css/v5/stylesheets_frontend/video/video_wrapper/styles.css',
existingCssScript = document.querySelector('link[href="' + cssPath + '"]');
if (!existingCssScript) {
var cssLink = document.createElement('link');
cssLink.type = 'text/css';
cssLink.rel = 'stylesheet';
cssLink.href = cssPath;
document.head.appendChild(cssLink);
}
}
function loadJquery() {
var jqueryPath = 'https://app.kartra.com/js/node_modules/kartra-jquery/jquery-1.10.2/jquery-1.10.2.min.js';
if (
window.jQuery
) {
jQ = window.jQuery;
jQ(document).ready(function() {
initEmbedGM7Aeb5nQCCp();
});
} else {
var jQueryScript = document.createElement('script');
jQueryScript.type = 'text/javascript';
jQueryScript.src = jqueryPath;
jQueryScript.onload = function() {
jQ = window.jQuery.noConflict(true);
jQ(document).ready(function() {
initEmbedGM7Aeb5nQCCp();
});
}
document.body.appendChild(jQueryScript);
}
}
function initEmbedGM7Aeb5nQCCpmaccc() {
var $videoContainer,
modalEmbedType = !!0;
$videoContainer = jQ('.kartra_video_containerGM7Aeb5nQCCp[data-random_str="maccc"]');
if (modalEmbedType) {
createModalVideo($videoContainer);
} else {
createRegularVideo($videoContainer);
}
}
function createRegularVideo($videoContainers) {
var styleString = '\
';
$videoContainers.each(function(i, el) {
var $container = jQ(el);
var $videoOuterWrapper = jQ('');
var $videoEmbedWrapper = jQ('');
var $videoPlaceholder = jQ('');
var memberHash = $container.attr('data-kt-owner') || '';
var $iframe = generateIframe(false, memberHash);
$container.empty();
// For the same video, embed styling only once in page
if (0 === i) {
$container.append(styleString);
}
$videoEmbedWrapper.append($iframe);
$videoOuterWrapper.append($videoEmbedWrapper);
$container
.addClass('js_kartra_video_container')
.append($videoOuterWrapper)
.append($videoPlaceholder);
if (
window['kartra']
&& window['kartra']['pages']
) {
var $videoShadow = jQ('');
$container.append($videoShadow);
}
$iframe.on('load', function() {
var videoHeight = $container.outerHeight(),
position = videoHeight/2 + $container.offset().top + stickySensitivity;
position = Math.round(position);
// Make it from the bottom half of the video
$container.attr('data-original-position', position);
$container.addClass('js_video_embed_loaded');
});
});
jQ(window).on('message', function(event) {
var messageData = event.originalEvent.data;
if ('undefined' !== typeof(messageData)) {
if (
'kt-video-play-GM7Aeb5nQCCp' === messageData['message']
|| 'kt-video-play-sticky-GM7Aeb5nQCCp' === messageData['message']
|| 'kt-video-pause-GM7Aeb5nQCCp' === messageData['message']
|| 'kt-video-complete-GM7Aeb5nQCCp' === messageData['message']
|| 'kt-video-loaded' === messageData['message']
) {
if (
'undefined' === typeof messageData['payload']
|| 'undefined' === typeof messageData['payload']['frame']
) {
return false;
}
var $videoIframe = jQ('.js_kartra_video_container iframe[name="' + messageData['payload']['frame'] + '"]');
if ($videoIframe.length) {
var $videoContainer = $videoIframe.closest('.js_kartra_video_container'),
$stickyVideo = jQ('.js_kartra_video_container.kartra-video-sticky-top, .js_kartra_playlist_container.kartra-video-sticky-top'),
frameWindow = $videoIframe[0].contentWindow ?
$videoIframe[0].contentWindow : $videoIframe[0].contentDocument.defaultView;
switch(messageData['message']) {
case 'kt-video-play-sticky-GM7Aeb5nQCCp':
$videoContainer.addClass('js_video_enable_sticky');
if (
$stickyVideo.length
&& !$stickyVideo.is($videoContainer)
) {
closeStickyVideo($stickyVideo, true);
}
break;
case 'kt-video-pause-GM7Aeb5nQCCp':
case 'kt-video-complete-GM7Aeb5nQCCp':
$videoContainer.removeClass('js_video_enable_sticky');
break;
case 'kt-video-loaded':
frameWindow.postMessage({
message: 'kt-video-embed-domain',
payload: {
location: window.location.href
}
}, '*');
break;
default:
if ($stickyVideo.length) {
closeStickyVideo($stickyVideo, true);
}
}
}
}
}
});
}
function createModalVideo($videoContainers) {
var $meta = jQ(''),
$overlay = jQ(''),
$overlayInner = jQ(''),
$innerWrapper = jQ(''),
$iframe = generateIframe(true, 'DpwQLxk7'),
styleString = '\