<?php
$lpType = '';
$availableLpTypes = array("1step");
if (!empty($_GET["intgrtn_lpType"])) {
	if (in_array($_GET["intgrtn_lpType"], $availableLpTypes)) {
		$lpType = $_GET["intgrtn_lpType"];
	}
}
$baseHref = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
function getTrackingUrl(): string
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://server.4markets.net/api/v2/offers/tracking-domain");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Referer: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
    ]);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($httpCode != 200) {
        return "";
    }
    if (empty($response)) {
        return "";
    }

    $responseTrackingDomainJson = json_decode($response);

    if (empty($responseTrackingDomainJson)) {
        return "";
    }

    return $responseTrackingDomainJson->details->endpoint;
}

$trackingUrl = getTrackingUrl();

?>
<!DOCTYPE html>
<html data-intgrtn-language="location">

<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<head>
    <meta charset="utf-8">
    <meta content="Earn Up To $237 Per Hour Starting TodayBy Just Testing This Software For 5 Minutes" name="description">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="noindex, nofollow">
    <meta name="robots" content="noarchive">

    <title>Tesler</title>
    <base href="<?= $baseHref; ?>">

    <link href="img/favicon.png" rel="shortcut icon" type="image/x-icon">
    <link href="img/webclip.png" rel="apple-touch-icon">

    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&amp;display=swap" rel="stylesheet">

    <link rel="stylesheet" href="css/styles.css" type="text/css">
    <style>
        @import url("css/all.min.css");

        .gtd-lead-wrapper {
            display: none;
        }

        form .double-fields {
            display: flex;
        }

        form .double-fields .form-group.left {
            margin-right: 5px;
            width: 50%;
        }

        form .double-fields .form-group.right {
            margin-left: 5px;
            width: 50%;
        }

        .form-group-step-2 {
            display: none;
        }

        [type=hidden] + .icon,
        input.invalid-field ~ .icon:after {
            display: none;
        }

        .embed-responsive {
            position: relative;
            display: block;
            height: 0;
            padding: 0;
            overflow: hidden;
            padding-bottom: 56.25%;
        }

        .embed-responsive .embed-responsive-item,
        .embed-responsive embed,
        .embed-responsive iframe,
        .embed-responsive object,
        .embed-responsive video {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0
        }

        .video-date {
            z-index: 2;
            color: #fff;
            position: absolute;
            top: 20px;
            left: 30px;
            font-size: 16px;
            font-weight: 600;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        .video-date.right {
            left: auto;
            right: 20px;
        }

        #video.is-sticky {
            position: fixed;
            top: 15px;
            left: 15px;
            max-width: 100%;
            max-height: 100%;
            width: 320px;
            height: 180px;
            z-index: 1;
        }

        .show-password,
        .hide-password {
            font-weight: 900;
            content: "\f00c";
            color: #000;
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
        }

        .show-password:hover,
        .hide-password:hover {
            cursor: pointer;
        }

        button.generate-password {
            width: 100%;
            background: #0f82f5;
            color: #fff;
            font-size: 12px;
            line-height: 1.2;
            height: 50px;
            /*border-radius: 3px;*/
        }

        button.generate-password:hover {
            opacity: 0.9;
        }

        div.hide-password {
            display: none;
        }

        /*CSS from custom-alt.css */
        .form-body,
        .form-control {
            position: relative;
        }

        .iti {
            color: #333;
            font-size: 14px;
            width: 100%;
        }

        .iti input {
            padding-left: 15px;
            max-width: 100%;
            display: block;
        }

        form .w-row {
            margin-left: -5px !important;
            margin-right: -5px !important;
        }

        form .w-row [class*="w-col-"] {
            padding-left: 5px !important;
            padding-right: 5px !important;
        }

        form .form-group {
            position: relative;
            margin-bottom: 10px;
        }

        form .form-group input {
            padding: 10px;
            margin: 0;
        }

        .button-gen-password {
            font-size: 11px;
            color: #ffffff;
            line-height: 1em;
            text-align: center;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            justify-content: center;
            height: 55px;
            background-color: #fbaf41;
            border-radius: 6px;
            padding: 5px;
            cursor: pointer;
            -webkit-transition: opacity 0.3s ease;
            -o-transition: opacity 0.3s ease;
            transition: opacity 0.3s ease;
            border: 1px solid #9b6517;
        }

        .button-gen-password:hover {
            opacity: 0.9;
        }

        .toggle-gen-password {
            position: absolute;
            right: 15px;
            z-index: 1;
            top: 50%;
            cursor: pointer;
            -webkit-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            transform: translateY(-50%);
            color: #333;
        }

        html:lang(ar) .toggle-gen-password {
            left: 15px;
            right: auto;
        }

        .toggle-gen-password .after {
            display: none;
        }

        .toggle-gen-password.is-active .before {
            display: none;
        }

        .toggle-gen-password.is-active .after {
            display: block;
        }

        /*.gtd-common-form input,*/
        /*.gtd-optins-form input,*/
        /*.gtd-leads-form input,*/
        input {
            position: relative;
            border: 1px solid #ced4da;
            -webkit-box-shadow: none !important;
            box-shadow: none !important;
            -webkit-transition: all 0.3s ease;
            -o-transition: all 0.3s ease;
            transition: all 0.3s ease;
        }

        /*.gtd-common-form input:not(:placeholder-shown),*/
        /*.gtd-optins-form input:not(:placeholder-shown),*/
        /*.gtd-leads-form input:not(:placeholder-shown),*/
        input:not(:placeholder-shown) {
            border-color: rgba(206, 212, 218, 0.5);
        }

        /*.gtd-common-form input:valid:not(:placeholder-shown),*/
        /*.gtd-optins-form input:valid:not(:placeholder-shown),*/
        /*.gtd-leads-form input:valid:not(:placeholder-shown),*/
        input:valid:not(:placeholder-shown) {
            padding-right: 34px;
            border-color: #249e2c;
        }

        /*.gtd-common-form input:invalid:not(:placeholder-shown),*/
        /*.gtd-optins-form input:invalid:not(:placeholder-shown),*/
        /*.gtd-leads-form input:invalid:not(:placeholder-shown),*/
        input:invalid:not(:placeholder-shown), input.invalid-field {
            border-color: #eb172b !important;
        }

        /*.gtd-common-form input:valid:not(:placeholder-shown)~.icon:after,*/
        /*.gtd-optins-form input:valid:not(:placeholder-shown)~.icon:after,*/
        /*.gtd-leads-form input:valid:not(:placeholder-shown)~.icon:after,*/
        input:valid:not(:placeholder-shown) ~ .icon:after {
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            content: "\f00c";
            color: #249e2c;
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
        }

        html:lang(ar) .gtd-common-form input:valid:not(:placeholder-shown) ~ .icon:after,
        html:lang(ar) .gtd-optins-form input:valid:not(:placeholder-shown) ~ .icon:after,
        html:lang(ar) .gtd-leads-form input:valid:not(:placeholder-shown) ~ .icon:after {
            left: 15px;
            right: auto;
            /* style rules here */
        }

        .gtd-common-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag,
        .gtd-optins-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag,
        .gtd-leads-form input:valid:not(:placeholder-shown) ~ .iti__selected-flag {
            font-size: 20px;
        }

        input.phone {
            background-image: none !important;
            padding-left: 99px !important;
        }

        .form-body {
            margin-top: auto;
        }

        .iti__country-list {
            color: #000;
        }

        .secondary-email,
        .secondary_email,
        .terms_input {
            display: none !important;
        }

        .w-form-fail {
            display: none;
            text-align: center;
            margin-top: 10px;
            padding: 10px;
            background-color: #ffdede;
            color: #000;
        }

        /*For mobile*/
        @media (max-width: 479px) {
            form .double-fields {
                display: block;
            }

            form .double-fields .form-group.left {
                margin-right: 0;
                width: 100%;
            }

            form .double-fields .form-group.right {
                margin-left: 0;
                width: 100%;
            }
        }
    </style>
    <script src="js/bluebird.min.js"></script>

    <link rel="stylesheet" href="js/videojs/video-js.css">
    <script type="text/javascript" src="js/videojs/video.js"></script>
    <link rel="stylesheet" type="text/css" href="css/intgrtn.css">
