PageSourceSearch

https://palauregistries.pw/bundles/js/login?v=50JkqchG38i4Ck6CRvATHSmOi5KFNAF_l2EMS-u8gEU1

js palauregistries.pw collected 2026-10-07 06:01:38 UTC 6,350 bytes, 152 lines download raw bytes

1/* Minification failed. Returning unminified contents.
2(3,7-15): run-time error JS1004: Expected ';': function
3(4,23-29): run-time error JS1004: Expected ';': crypto
4(5,61-62): run-time error JS1195: Expected expression: >
5(5,98-99): run-time error JS1004: Expected ';': )
6(50,27-28): run-time error JS1195: Expected expression: )
7(50,30-31): run-time error JS1195: Expected expression: >
8(56,6-7): run-time error JS1195: Expected expression: )
9 */
10// Computes the SHA-256 digest of a string with Web Crypto converted to a hex representation
11// Source: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
12async function sha256(str) {
13    const buf = await crypto.subtle.digest("SHA-256", new TextEncoder("utf-8").encode(str));
14    return Array.prototype.map.call(new Uint8Array(buf), x => (('00' + x.toString(16)).slice(-2))).join('');
15}
16
17function initiateAuthentication(showConfirmationDialogOnLogin, rememberConfirmationDialogConfirmation, showAccountSignupAgreement, tokenFieldId, loginButtonId, userNameFieldId, passwordFieldId, hashPassword, hdnPassword) {
18    userNameFieldId = userNameFieldId + '_ctl';
19    passwordFieldId = passwordFieldId + '_ctl';
20
21    loginConfirmationModal(showConfirmationDialogOnLogin, rememberConfirmationDialogConfirmation);
22
23    var loginButton = document.getElementById(loginButtonId);
24    if (loginButton) {
25        loginButton.addEventListener('click', function (e) {
26            if (!Page_ClientValidate()) {
27                return;
28            }
29
30            if (hashPassword) {
31                sha256($("#" + passwordFieldId).val()).then(function (hashedPassword) {
32                    hdnPassword.value = hashedPassword;
33                    // Need to do this because passwordFieldId is required on the server and some text has to be there
34                    $("#" + passwordFieldId).val("plaintext");
35
36                    e.preventDefault();
37                    accountSignupAgreementModal(showAccountSignupAgreement, loginButtonId, userNameFieldId, passwordFieldId, tokenFieldId);
38                    return false;
39                });
40            }
41            else {
42                e.preventDefault();
43                accountSignupAgreementModal(showAccountSignupAgreement, loginButtonId, userNameFieldId, passwordFieldId, tokenFieldId);
44                return false;
45            }
46        });
47    }
48}
49
50function loginConfirmationModal(showConfirmationDialogOnLogin, rememberConfirmationDialogConfirmation) {
51    var confirmationLocalStorageKey = "paDisplayAuthConfirmationDialog";
52    var confirmationModal = $("#LoginConfirmationDialog");
53    var confirmationOK = $("#btnLoginConfirmationOk");
54
55    if (showConfirmationDialogOnLogin && confirmationModal.length > 0 && !localStorage.getItem(confirmationLocalStorageKey)) {
56        confirmationModal.modal('show');
57    }
58
59    confirmationOK.click(() => {
60        if (rememberConfirmationDialogConfirmation) {
61            localStorage.setItem(confirmationLocalStorageKey, true);
62        }
63
64        confirmationModal.modal('hide');
65    });
66}
67
68function accountSignupAgreementModal(showAccountSignupAgreement, loginButtonId, userNameFieldId, passwordFieldId, tokenFieldId) {
69    var loginBtn = $("#" + loginButtonId);
70    var loginNameAttrVal = loginBtn.attr("name");
71    var userName = document.getElementById(userNameFieldId).value;
72    var password = document.getElementById(passwordFieldId).value;
73
74    toggleBtnState(loginBtn, false);
75
76    if (!showAccountSignupAgreement || !userName || !password) {
77        toggleBtnState(loginBtn, true);
78        __doPostBack(loginNameAttrVal, '');
79        return;
80    }
81
82    var token = document.getElementById(tokenFieldId).value;
83    var modalEl = $('#dialogTos');
84    var modalBody = $('#dialogTosBody');
85    var modalCancelBtn = $('#btnDialogTosCancel');
86    var agreementCheckbox = $('input[name="HasUserAcceptedTerms"]');
87    var continueBtn = $('#btnDialogTosContinue');
88
89    $.post('/Api/WebService/GetAccountSignupAgreementStatus', { UserName: userName, Token: token })
90        .done(function (response) {
91            if (response && response.Content) {
92                if (response.FileType === 'text/html') {
93                    var html = $.parseHTML(response.Content.trim());
94
95                    // Prevent script injection attacks
96                    $(html).find('script').remove();
97                    $(html).find('*').each(function () {
98                        $(this).removeAttr('onclick onkeypress onkeydown onkeyup onmousedown onmouseup onmouseenter onmouseleave onmousemove onmouseover onmouseout onwheel onfocus onblur onchange onload onscroll onerror');
99                    });
100
101                    // Update the dialog body with sanitized HTML content
102                    modalBody.html(html);
103                } else {
104                    modalBody.text(response.content.trim());
105                }
106
107                modalEl.modal('show');
108            } else {
109                __doPostBack(loginNameAttrVal, '');
110            }
111        }).fail(function (jqXhr, status, error) {
112            showAlertPopup(error);
113        }).complete(function () {
114            toggleBtnState(loginBtn, true);
115        });
116
117    modalCancelBtn.click(function () {
118        modalEl.modal('hide');
119        modalBody.empty();
120        toggleBtnState(loginBtn, true);
121    });
122
123    agreementCheckbox.change(function (e) {
124        e.stopPropagation();
125        toggleBtnState(continueBtn, $(this).is(":checked"));
126    });
127
128    continueBtn.click(function () {
129        $.ajax({
130            url: '/Api/WebService/UpdateUserAgreementVersion',
131            type: 'POST',
132            data: { UserName: userName, Token: token }
133
134        }).done(function (result, status) {
135            modalEl.modal('hide');
136            __doPostBack(loginNameAttrVal, '');
137        }).fail(function (jqXhr, status, error) {
138            showAlertPopup(error);
139        }).complete(function () {
140            toggleBtnState(loginBtn, true);
141        });
142    });
143}
144
145function toggleBtnState(jqueryBtn, enabled) {
146    if (enabled) {
147        jqueryBtn.prop('disabled', false).removeClass('disabled');
148    }
149    else {
150        jqueryBtn.prop('disabled', true).addClass('disabled');
151    }
152};

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.