Masking social security

Question:
I need to mask a social security form field but I am getting multiple errors

Product:
Wix velo code

What are you trying to achieve:
I want the social security number to be masked, only show last 4 when is complete and securely saved when submitted for me to access

What have you already tried:
this is my current code
import wixWindow from ‘wix-window’;
import wixData from ‘wix-data’; // For potential form submission (optional)
import wixForms from ‘wix-forms’;

$w.onReady(function () {
let form1 = $w(“#form1”); // Replace “myForm” with the actual ID of your Wix Form element

// Access the Social Security Number field using its field name
let socialSecurityNumberField = form1.getFieldValues(“social_security_number”);

if (socialSecurityNumberField) {
socialSecurityNumberField.onChange((event) => {
let inputValue = event.target.value.replace(/\D/g, ‘’); // Remove non-digits
let maskedValue = “”;

  if (inputValue.length > 0) {
    maskedValue = "***-**-";
  }
  if (inputValue.length > 5) {
    maskedValue += inputValue.substring(5, 9);
  }

  socialSecurityNumberField.value= maskedValue;
});

} else {
console.error(“Social Security Number field not found!”);
}

// … (Rest of your code)
});

Additional information:
NA