CINXE.COM

Data Subject Request Form

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Data Subject Request Form</title> <link href="/favicon.ico?v=@generated.version@" rel="icon" type="image/x-icon" /> <script type="text/javascript" src="/v1.1/js/jquery-3.5.0.min.js"></script> <script type="text/javascript" src="/v1/js/handlebars-4.7.7.min.js"></script> <link type="text/css" href="/v1/css/bootstrap-3.4.1.min.css" rel="stylesheet"/> <script type="text/javascript" src="/v1/js/bootstrap-3.4.1.min.js"></script> <link href="/webpage/css/wrapper.css?v=@generated.version@" rel="stylesheet"> <!-- alpaca --> <link type="text/css" href="/v1/css/bootstrap-alpaca-1.5.24.min.css" rel="stylesheet"/> <script type="text/javascript" src="/v1/js/alpaca-1.5.24.min.js"></script> <!-- alpaca date plugin --> <script type="text/javascript" src="/v1/js/moment-with-locales-2.24.0.min.js"></script> <link type="text/css" href="/v1/css/bootstrap-datetimepicker-4.17.47.min.css" rel="stylesheet"/> <script type="text/javascript" src="/v1/js/bootstrap-datetimepicker-4.17.47.min.js"></script> <!-- Include bootstrap multi-select css and js --> <link type="text/css" href="/v1/css/bootstrap-multiselect-1.1.1.min.css" rel="stylesheet"/> <script type="text/javascript" src="/v1/js/bootstrap-multiselect-1.1.1.min.js"></script> <style> .intake-color-red { color:red; } .confirmation-body { height: 100px; } #form1 .checkbox a { font-weight: bold; } @media only screen and (max-device-width : 767px) { .alpaca-form-button-reset{ width: 100% !important; } .alpaca-form-button-submit{ margin-top: 10px; width: 100% !important; } #form1{ padding-bottom: 55px; } .container, .alpaca-field-object{ padding-right: 0 !important; padding-left: 0 !important; } .uploadDropZone{ height: auto !important; line-height: normal !important; padding: 10px; } .uploadDropInfoMsg { font-size: 16px; color: #004676; } .multi-value-field-mobile{ display: flex; margin-top: 10px; } } .uploadDropZone,.uploadDropInfo { height: 50px; margin-bottom: 0px; color: #035801; border: 2px dashed #ccc; line-height: 50px; text-align: center; overflow: hidden; white-space: nowrap; } .uploadDropZoneDrop { color: #222; border-color: #222; } .uploadDropZone a { cursor: pointer; color: #044e8e; } .uploadDropInfoMsg { font-size: 14px; text-overflow: ellipsis; color: #004676; } .modal-body { position: relative; display: table; overflow-y: auto; overflow-x: auto; height: 100%; width: auto; } .glyphicon-large { font-size: 25px; } .glyphicon-medium { font-size: 20px; } .alert-info{ display: flex; align-items: center; color: #214a5f; } .alert-info span{ text-align: justify; } a { color: #224f77; } .btn-primary.focus,.btn-primary:focus{ background-color:#214f78; } .modal-title { font-size: 18px; } .multi-value-pane { margin-top: .5em; margin-bottom: .5em; margin-right: -10%; } .multi-value-trash { margin-left: -4%; margin-top: .5em; cursor: pointer; } .multi-value-pane > .multi-value-field { margin-top: .5em; } .multi-value-add { cursor: pointer; } #companyName, #header{ text-align: center; } .col-md-6{ padding-bottom: 15px; } .captchaBox-mobile { margin-bottom: 30px; transition: none !important; position: static !important; background-color: #4a90e2 !important; width: 100% !important; display: inline-block; } .alpaca-form-buttons-container { margin-bottom: 30px; } </style> <script type="text/javascript"> function onRecaptchaLoadCallback() { if(!GOOGLE_RECAPTCHA_V3_ENABLED){ return; } //WCAG 2 Compliance $('.grecaptcha-badge textarea').attr('aria-label', 'form1'); $('.grecaptcha-badge iframe').attr('aria-hidden', true); $('.grecaptcha-badge iframe').attr('title', 'grecaptcha iframe'); //Move captcha badge inside form container div for easier handling on mobile devices $(".grecaptcha-badge").insertBefore($(".alpaca-form-buttons-container")); //On load, resize recaptcha resizeRecaptcha(); window.addEventListener('resize', function() { resizeRecaptcha(); }); } function resizeRecaptcha() { const captchas = document.getElementsByClassName("grecaptcha-badge"); if(!captchas || captchas.length === 0){ console.log('[irm form] cannot find element with class: grecaptcha-badge'); return; } const captchaBadge = captchas[0]; if(window.innerWidth <= 785) { captchaBadge.classList.add("captchaBox-mobile"); } else { captchaBadge.classList.remove("captchaBox-mobile"); } } </script> <script src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallback&amp;render=6LdSn6gUAAAAAKZ5SiEQ8PdCUOgV9sf1ei4utXrB"></script> <script type="text/javascript"> if (typeof NodeList.prototype.forEach !== 'function') { NodeList.prototype.forEach = Array.prototype.forEach; } if (!String.prototype.includes) { //To check browser supports or not String.prototype.includes = function (str) { //If not supported, then define the method return this.indexOf(str) !== -1; } } if (!Array.prototype.includes) { Array.prototype.includes = function (elem){ return this.indexOf(elem) !== -1; } } const getUrlParameterByName = function (name) { const url = window.location.href name = name.replace(/[\[\]]/g, '\\$&'); const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); } const nullSafeGet = function (p, o) { return p.reduce( function (xs, x) { return (xs && xs[x]) ? xs[x] : null; } , o ); }; const ALPACA_CUSTOM_EMAIL_REGEX = /^[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+(?:\.[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i; const locale = "en"; const authType = "CAPTCHA"; const CAPTCHA_TYPES = ["GOOGLE_RECAPTCHA_V3"]; const GOOGLE_RECAPTCHA_V3_ENABLED = authType === 'CAPTCHA' && CAPTCHA_TYPES.includes('GOOGLE_RECAPTCHA_V3'); const TRUSTARC_CAPTCHA_ENABLED = authType === 'CAPTCHA' && CAPTCHA_TYPES.includes('TRUSTARC'); const noSubmit = authType === 'NONE'; const formId = "393ceb80-cbe8-4e90-b404-4970788e1212"; const requestId = null; const suppValidationId = null; const sourceWebsite = null; const ipAddress = "8.222.208.146"; const gpcEnabled = isGPCEnabled(); (function($) { $.fn.visible = function() { return this.css('visibility', 'visible'); }; $.fn.invisible = function() { return this.css('visibility', 'hidden'); }; var Alpaca = $.alpaca; $.alpaca.Fields.StaticField = $.alpaca.Fields.TextField.extend({ getFieldType: function() { return "static"; }, getDescription: function() { return "Static Field."; } }); Alpaca.registerFieldClass("static", Alpaca.Fields.StaticField); Alpaca.registerDefaultFormatFieldMapping("static", "string"); $.alpaca.Fields.EndField = $.alpaca.Fields.TextField.extend({ getFieldType: function() { return "end"; }, getDescription: function() { return "End of Submission Field."; }, onShow: function() { this.base(); this.schema.required = true; this.triggerUpdate(); $('div[alpaca-layout-binding-field-name="'+ this.name +'"] ~ div').hide(); hideTrustArcCaptcha() }, onHide: function() { this.base(); this.schema.required = false; this.triggerUpdate(); $('div[alpaca-layout-binding-field-name="'+ this.name +'"] ~ div').show(); showTrustArcCaptcha() } }); Alpaca.registerFieldClass("end", Alpaca.Fields.EndField); Alpaca.registerDefaultFormatFieldMapping("end", "string"); $.alpaca.Fields.NameField = $.alpaca.Fields.TextField.extend({ setValue: function(first, last) { var name = first; if (last) { name = name + last; } this.base(name); }, getFieldType: function() { return "name"; }, getDescription: function() { return "Name Field."; }, _validateOptional: function() { var self = this; if (self.schema.nameType === 'FIRSTLAST') { var fields = $(self.control).find( self.options.fields.map(function(f) { return "input[name='" + f.id + "']"; }).join(",") ); if(!validateOptionalBaseCheck(self, fields)){ return false; } } if(!validateOptionalMultiValuesBaseCheck(self)){ return false; } return self.base(); }, addField: function() { MultiValue.addField(this, "name"); }, clear: function() { var self = this; if (self.schema.nameType === 'FIRSTLAST') { var fields = $(self.control).find( self.options.fields.map(function(f) { return "input[name='" + f.id + "']"; }).join(",") ); fields.each(function(key, elem){ elem.value = ''; }); } else if(self.schema.nameType === 'FULLNAME') { $(self.control).get(0).value = ''; } hideErrors(self); }, postRender: function(callback) { var self = this; if (self.schema.nameType === 'FIRSTLAST') { var fields = $(self.control).find( self.options.fields.map(function(f) { return "input[name='" + f.id + "']"; }).join(",") ); fields.on("change", function () { var concatval = fields.map(function () { return $(this).val(); }).get().join(" "); self.setValue(concatval); self.refreshValidationState(true); }); } MultiValue.render(this); this.base(function() { callback(); }); } }); Alpaca.registerFieldClass("name", Alpaca.Fields.NameField); $.alpaca.Fields.ExEmailField = $.alpaca.Fields.EmailField.extend({ addField: function() { MultiValue.addField(this, "text"); }, _validateOptional: function() { var self = this; if(!validateOptionalMultiValuesBaseCheck(self)){ return false; } return self.base(); }, _validatePattern: function(){ var self = this; var isValid = true; var fields = getMultiValueInputFields(self); var isRequired = self.schema.required; var val = this.getValue(); let index = 0; do { if(val === "" && !isRequired) { isValid = true; } else if(!Alpaca.testRegex(ALPACA_CUSTOM_EMAIL_REGEX, val)) { isValid = false; } if (fields.length > index) { val = fields[index].value; } } while (isValid && index++ < fields.length); return isValid; }, handleValidate: function() { var baseStatus = this.base(); var key = this.name; var field = nullSafeGet(["view", "fields", key], this); var val = this.getValue(); valueFieldMap.set(key, val); fieldTitleMap.set(key, this.options.label); var valInfo = this.validation; var status = this._validatePattern(); if (field) { valInfo["invalidPattern"] = { "message": status ? "" : field.messages.invalidPattern, "status": status }; } else { valInfo["invalidPattern"] = { "message": status ? "" : this.getMessage("invalidEmail"), "status": status }; } if (matchFieldMap.get(key) != null) { status = validateMatchField(this, val); } else { status = true; } valInfo["doesNotMatchField"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("doesNotMatchField"), [fieldTitleMap.get(matchFieldMap.get(key))]), "status": status }; return baseStatus && valInfo["doesNotMatchField"]["status"]; }, clear: function() { this.setValue(null); hideErrors(this); }, postRender: function(callback) { MultiValue.render(this); var key = this.name; isMatchFieldEnabled(this.schema, key); this.base(function() { callback(); }); } }); Alpaca.registerFieldClass("email", Alpaca.Fields.ExEmailField); $.alpaca.Fields.ExTextField = $.alpaca.Fields.TextField.extend({ addField: function() { MultiValue.addField(this, "text"); }, _validateOptional: function() { var self = this; if(!validateOptionalMultiValuesBaseCheck(self)){ return false; } return self.base(); }, clear: function() { this.setValue(null); hideErrors(this); }, postRender: function(callback) { MultiValue.render(this); this.base(function() { callback(); }); }, _validatePattern: function() { var self = this; var pattern = this.schema.pattern; if (pattern) { var fields = getMultiValueInputFields(self); var matchesPatternFunc = function() { return Alpaca.testRegex(pattern, $(this).val()); }; if (getFieldsFilterLength(fields, matchesPatternFunc) < fields.length) { return false; } } return self.base(); }, _validateMaxLength: function() { var isValid = true; if (!Alpaca.isEmpty(this.schema.maxLength)) { var val = this.getValue(); var fields = getMultiValueInputFields(this); let index = 0; do { isValid = validateMaxLength(this, val); if (fields.length > index) { val = fields[index].value; } } while (isValid && index++ < fields.length); } return isValid; }, _validateMinLength: function() { var isValid = true; if (!Alpaca.isEmpty(this.schema.minLength)) { var val = this.getValue(); var fields = getMultiValueInputFields(this); let index = 0; do { isValid = validateMinLength(this, val); if (fields.length > index) { val = fields[index].value; } } while (isValid && index++ < fields.length); } return isValid; }, handleValidate: function() { var baseStatus = this.base(); var valInfo = this.validation; var key = this.name; var field = nullSafeGet(["view", "fields", key], this); var status = this._validatePattern(); if(field){ valInfo["invalidPattern"] = { "message": status ? "" : field.messages.invalidPattern, "status": status }; } else{ valInfo["invalidPattern"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("invalidPattern"), [this.schema.pattern]), "status": status }; } status = this._validateMaxLength(); valInfo["stringTooLong"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("stringTooLong"), [this.schema.maxLength]), "status": status }; status = this._validateMinLength(); valInfo["stringTooShort"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("stringTooShort"), [this.schema.minLength]), "status": status }; return baseStatus && valInfo["invalidPattern"]["status"] && valInfo["stringTooLong"]["status"] && valInfo["stringTooShort"]["status"]; } }); Alpaca.registerFieldClass("text", Alpaca.Fields.ExTextField); Alpaca.registerView ({ "id": "base", "templates": { "control-date": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-date.html"), "control-static": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-static.html"), "control-end": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-end.html"), "control-checkbox": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-checkbox.html"), "control-file": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-file.html"), "control-name": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-name.html"), "control-text": appendBuildVersionQueryParam("/v1.1/alpaca/templates/control-text.html") }, "messages": { "en": {"captchaVerifyAriaLabel":"Verify CAPTCHA","stringBeTexts":"Field should have a value of text only.","captchaRefreshInfo":"CAPTCHA has been refreshed. Please check again.","captchaErrorInfo":"The CAPTCHA you have entered is incorrect. Click here to try again.","invalidPassword":"Invalid Password","captchaAriaLabel":"CAPTCHA Verification is required.","stringValueTooLargeExclusive":"Value of this field must be less than {0}","required":"This field is not optional.","invalidBigFiles":"Only accepts file less than {0} MB.","captchaRefreshLabel":"Refresh","notOptional":"This field is not optional.","captchaPlaySoundLabel":"Play Sound","doesNotMatchField":"This needs to match with field {0}.","stringTooLong":"This field should contain at most {0} numbers or characters","captchaSuccessInfo":"CAPTCHA has been successfully verified.","captchaInputPlaceholder":"Enter CAPTCHA value","stringTooShort":"This field should contain at least {0} numbers or characters","invalidEmail":"Invalid Email address e.g. info@example.com","captchaPlaySoundAriaLabel":"Play Sound and enter the numbers you hear in the input field","multipleFiles":"Multiple files not supported.","stringDivisibleBy":"The value must be divisible by {0}","invalidPhone":"Invalid Phone Number, e.g. (123) 456-9999","stringBeLink":"Field is not a valid hyperlink.","notEnoughItems":"The minimum number of items is {0}","captchaLabel":"CAPTCHA Verification","captchaInputAriaLabel":"Enter the numbers you hear in the input field","tooManyItems":"The maximum number of items is {0}","invalidFileTypes":"Invalid file type.","captchaRefreshAriaLabel":"Refresh CAPTCHA","invalidValueOfEnum":"This field should have one of the values in the options. Current value is: [{1}]","invalidDate":"<div>Invalid date for format {0}<\/div>","notAnArray":"This value is not an Array","disallowValue":"{0} are disallowed values.","uploadIncomplete":"File upload not yet complete.","stringValueTooSmallExclusive":"Value of this field must be greater than {0}","stringNotAnInteger":"This value is not an integer.","stringValueTooSmall":"The minimum value for this field is {0}","captchaVerifyButtonLabel":"Verify CAPTCHA","invalid":"Invalid value.","stringValueTooLarge":"The maximum value for this field is {0}","invalidFilename":"Invalid file name: {0}.","invalidPattern":"This field should have pattern {0}","stringBeNumbers":"Field should have a value of numbers only.","stringNotANumber":"This value is not a number.","captchaReloadAriaLabel":"CAPTCHA has been refreshed. Please check again","valueNotUnique":"Values are not unique"} } }); $.alpaca.Fields.ExDateField = $.alpaca.Fields.TextField.extend({ setValue: function(value, clear) { if(clear){ var dates = $(this.control).find('input'); dates.each(function (index,elem) { elem.value = value; }); } this.base(value); }, getFieldType : function() { return "date"; }, getDateFormat: function() { if (!this.options.dateFormat) { return Alpaca.defaultDateFormat; } return this.options.dateFormat; }, setup: function() { var self = this; this.base(); if (!self.options.picker) { self.options.picker = {}; } self.options.picker.format = self.getDateFormat(); if (!self.options.picker.locale) { self.options.picker.locale = locale; } }, handleValidate: function() { var baseStatus = this.base(); var valInfo = this.validation; var status = this._validateBasedOnRules(); valInfo["invalidDate"] = { "message": status ? "" : this.errorMsg, "status": status }; return baseStatus && valInfo["invalidDate"]["status"]; }, _validateOptional: function() { var self = this; var isRequired = self.isRequired() if(isRequired){ var first = self.cleanDate(self.domEl.find("input[data-index='0']").data("DateTimePicker").date()); var secondExists = self.domEl.find("input[data-index='1']").data("DateTimePicker"); var second = self.cleanDate( secondExists ? secondExists.date() : 0 ); if (self.schema.dateType == 'DATERANGE' && (!first || !second)) { return false; } else if (!first) { return false; } } return true; }, _validateBasedOnRules: function() { var self = this; var first = self.cleanDate(self.domEl.find("input[data-index='0']").data("DateTimePicker").date()); var secondExists = self.domEl.find("input[data-index='1']").data("DateTimePicker"); var second = self.cleanDate( secondExists ? secondExists.date() : 0 ); var sys = self.cleanDate(moment()); var rules = self.options.validationRules || []; if (rules.length) { if (self.schema.dateType == 'DATERANGE') { if (first && second) { for (var i in rules) { var arr = rules[i].split("_"); var t1 = self.getTime(arr[0], first, sys, second); var t2 = self.getTime(arr[2], first, sys, second); if (!self.compareTime(t1, arr[1], t2)) { self.setErrorMsg(arr); return false; } } } } else if (first) { for (var i in rules) { var arr = rules[i].split("_"); if (!self.compareTime(first, arr[1], sys)) { self.setErrorMsg(arr); return false; } } } } return true; }, setErrorMsg: function(ruleArr) { this.errorMsg = ""; switch (ruleArr[0]) { case 'DATE': this.errorMsg += "Date "; break; case 'DATEA': this.errorMsg += "'From Date' "; break; case 'DATEB': this.errorMsg += "'To Date' "; break; } this.errorMsg += "should be "; switch (ruleArr[1]) { case 'G': this.errorMsg += "greater than "; break; case 'GE': this.errorMsg += "greater than or equal to "; break; case 'L': this.errorMsg += "less than "; break; case 'LE': this.errorMsg += "less than or equal to "; break; } switch (ruleArr[2]) { case 'SYS': this.errorMsg += "today's date"; break; case 'DATEB': this.errorMsg += "'To Date'"; break; } }, cleanDate: function(date) { if (date) { var format = date.format(this.getDateFormat()); return moment(format, this.getDateFormat()) } return null; }, compareTime: function(t1, op, t2) { if (op == 'G') { return t1.isAfter(t2); } else if (op == 'GE') { return t1.isSameOrAfter(t2); } else if (op == 'L') { return t1.isBefore(t2); } else if (op == 'LE') { return t1.isSameOrBefore(t2); } }, getTime: function(rule, first, sys, second) { if (rule == 'DATEA') { return first; } else if (rule == 'DATEB') { return second; } else if (rule == 'SYS') { return sys; } }, onChange: function(e) { this.base(); this.refreshValidationState(); this.dynamicTrigger(); }, afterRenderControl: function(model, callback) { var self = this; this.base(model, function() { if ($.fn.datetimepicker) { self.domEl.find("input[data-type='date']").each(function(){ $(this).datetimepicker(self.options.picker); $(this).data("DateTimePicker"); $(this).on("dp.change", function(e) { // we use a timeout here because we want this to run AFTER control click handlers setTimeout(function() { self.onChange.call(self, e); self.triggerWithPropagation("change", e); }, 250); }); }); } callback(); }); }, clear: function() { this.setValue(null, true); this.domEl.find("input").data("DateTimePicker").clear(); this.updateObservable(); this.triggerUpdate(); hideErrors(this); } }); Alpaca.registerFieldClass("date", Alpaca.Fields.ExDateField); Alpaca.registerDefaultFormatFieldMapping("date", "date"); $.alpaca.Fields.ExCheckField = $.alpaca.Fields.CheckBoxField.extend({ onChange: function(e) { this.base(); this.dynamicTrigger(); }, clear: function() { this.setValue(null); this.updateObservable(); this.triggerUpdate(); hideErrors(this); }, dynamicTrigger: function() {} }); Alpaca.registerFieldClass("checkbox", Alpaca.Fields.ExCheckField); $.alpaca.Fields.ExSelectField = $.alpaca.Fields.SelectField.extend({ postRender: function(callback) { this.setValue(null); if (this.selectOptions.length > 0 && !this.schema.default) { delete this.selectOptions[0].selected; } if(this.options.multiple) { this.schema.type = "array"; if(this.schema.required) { $(this.control).multiselect('deselectAll'); } if(this.schema.enum.length < 1) { $(this.control).multiselect('disable'); } } this.updateObservable(); this.triggerUpdate(); this.triggerWithPropagation("change"); this.base(function() { callback(); }); }, afterSetValue: function() { var self = this; self.base(); if (self.data.length == 0) { $(self.control).val(null); } }, clear: function() { if(this.options.multiple) { $(this.control).multiselect('clearSelection'); } this.setValue(null); this.updateObservable(); this.triggerUpdate(); hideErrors(this); }, onChange: function(e) { this.base(); selectedShowFields.clear(); this.dynamicTrigger(); }, dynamicTrigger: function() {} }); Alpaca.registerFieldClass("select", Alpaca.Fields.ExSelectField); $.alpaca.Fields.ExFileField = $.alpaca.Fields.FileField.extend({ setValue: function (value, display) { var self = this; var uploadFileField = $(this.control).find('.uploadFileField'); uploadFileField.val(value); self.setInfo(display); this.base(value); }, clear: function () { this.setValue(null, null); this.clearLoading(); var uploadFileHiddenField = $(this.control).find('.uploadFileHiddenField'); uploadFileHiddenField.val(null); this.updateObservable(); this.triggerUpdate(); hideErrors(this); }, handleValidate: function () { var baseStatus = this.base(); var valInfo = this.validation; var uploadFileHiddenField = $(this.control).find('.uploadFileHiddenField'); var files = uploadFileHiddenField.prop('files'); var status = this._validateFilename(files); var fileName = files && files.length > 0 ? files[0].name : ""; valInfo["invalidFilename"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("invalidFilename"), [fileName]), "status": status }; status = this._validateMultipleFiles(files); valInfo["multipleFiles"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("multipleFiles"), []), "status": status }; status = this._validateBigFiles(files); valInfo["invalidBigFiles"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("invalidBigFiles"), [convertToMB(this.options.maxFileSize)]), "status": status }; status = this._validateInvalidFiles(uploadFileHiddenField, files); valInfo["invalidFileTypes"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("invalidFileTypes"), [this.options.accept]), "status": status }; status = !this.isUploading(); valInfo["uploadIncomplete"] = { "message": status ? "" : Alpaca.substituteTokens(this.getMessage("uploadIncomplete"), []), "status": status }; return baseStatus && valInfo["multipleFiles"]["status"] && valInfo["invalidBigFiles"]["status"] && valInfo["invalidFileTypes"]["status"] && valInfo["uploadIncomplete"]["status"]; }, _validateFilename: function (files) { var pattern = "^[ A-Za-z0-9_.()!'*\/-]*$"; if (files && files.length > 0 && !Alpaca.testRegex(pattern, files[0].name)) { return false; } return true; }, _validateMultipleFiles: function (files) { if (files && files.length > 1) { return false; } return true; }, _validateBigFiles: function (files) { if (files && files.length > 0 && files[0].size > this.options.maxFileSize) { return false; } return true; }, _validateInvalidFiles: function (uploadFileHiddenField, files) { var accept = uploadFileHiddenField.prop('accept'); if (accept && files && files.length > 0 && !accept.includes(files[0].name.split(/(?:\.([^.]+))?$/)[1])) { return false; } return true; }, postRender: function (callback) { var self = this; var uploadDropZone = $(self.control).find('.uploadDropZone'); var uploadFileHiddenField = $(self.control).find('.uploadFileHiddenField'); if (uploadDropZone && uploadFileHiddenField) { uploadDropZone.on('drop', function (e) { if (self.onCurrentUpload()) return false; e.preventDefault(); uploadDropZone.addClass('uploadDropZoneDrop'); if (uploadFileHiddenField) { uploadFileHiddenField.prop('files', e.originalEvent.dataTransfer.files); self._uploadFile(); } }); uploadDropZone.on('dragover', function (e) { if (self.onCurrentUpload()) return false; e.preventDefault(); uploadDropZone.addClass('uploadDropZoneDrop'); return false; }); uploadDropZone.on('dragleave', function (e) { if (self.onCurrentUpload()) return false; e.preventDefault(); uploadDropZone.removeClass('uploadDropZoneDrop'); return false; }); var dropZoneAnchor = (uploadDropZone).find('a').first(); if (dropZoneAnchor) { if (uploadFileHiddenField) { dropZoneAnchor.on('click', function (e) { uploadFileHiddenField.click() }); } } if (uploadFileHiddenField) { uploadFileHiddenField.on('change', function (e) { self._uploadFile(); }) } } var uploadDropInfo = $(self.control).find('.uploadDropInfo'); if (uploadDropInfo) { uploadDropInfo.find('.close').on('click', function (e) { self.clear(); enableSubmitButton(); }); } this.base(function () { self.getParent().domEl.on("reset", function (e) { self.clear(); }); callback(); }); }, clearLoading: function () { if (this.isUploading()) { this.__uploader.abort(); } var progressElem = $(this.control).find('.progress-bar').first(); progressElem.removeClass("progress-bar-danger"); progressElem.css('width', '0%'); var uploadDropZone = $(this.control).find('.uploadDropZone').first(); uploadDropZone.removeClass('uploadDropZoneDrop'); }, initLoading: function () { this.setValue('-'); this.setInfo('Uploading Files...'); this.clearLoading(); }, updateLoading: function (width) { var progressElem = $(this.control).find('.progress-bar').first(); progressElem.css('width', width + '%'); }, errorLoading: function (response) { var progressElem = $(this.control).find('.progress-bar').first(); progressElem.addClass("progress-bar-danger"); var uploadFileField = this.getFieldEl(); uploadFileField.addClass('has-error'); uploadFileField.addClass('alpaca-invalid'); uploadFileField.addClass('help-block'); this.setInfo(response); }, isValid: function (checkChildren) { var uploadFileField = this.getFieldEl(); if (uploadFileField.hasClass('has-error')) { return false; } if (checkChildren && this.children) { for (var i = 0; i < this.children.length; i++) { var child = this.children[i]; if (child.isValidationParticipant()) { if (!child.isValid(checkChildren)) { return false; } } } } if ($.isEmptyObject(this.validation)) { return true; } else { for (var key in this.validation) { if (!this.validation[key].status) { return false; } } return true; } }, setInfo: function (display) { var uploadDropZone = $(this.control).find('.uploadDropZone').first(); var uploadDropInfo = $(this.control).find('.uploadDropInfo').first() if (display) { uploadDropZone.css('display', 'none'); uploadDropInfo.css('display', 'block') uploadDropInfo.find('.uploadDropInfoMsg').first().text(wrapText(display, 50)); } else { uploadDropZone.css('display', 'block'); uploadDropInfo.css('display', 'none'); } }, __uploader: null, isUploading: function () { if (this.__uploader && (this.__uploader.readyState != 4 && this.__uploader.readyState != 0)) { return true; } return false; }, onCurrentUpload: function () { if (this.isUploading() || this.data) { return true; } return false; }, _uploadFile: function () { var self = this; var uploadFileHiddenField = $(self.control).find('.uploadFileHiddenField').first(); self.initLoading(); self.refreshValidationState(true, function () { if (!self.isValid(true)) { return; } var file = uploadFileHiddenField.prop('files')[0]; let formData = new FormData(); formData.append("file", file); formData.append("formId", formId); self.__uploader = $.ajax({ url: '/services/storage/upload', method: 'POST', type: 'POST', data: formData, contentType: false, processData: false, xhr: function () { var xhr = new window.XMLHttpRequest(); xhr.upload.addEventListener("progress", function (evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; console.log('Uploading percent complete: ', percentComplete); self.updateLoading(Math.round(percentComplete * 100)); var submitButton = $(".alpaca-form-button.alpaca-form-button-submit.btn.btn-default"); if (percentComplete < 1) { submitButton.attr('disabled', true); } else { submitButton.removeAttr('disabled'); } } }, false); return xhr; }, error: function (request) { self.errorLoading(request.responseJSON.message); }, success: function (data) { self.setValue(data.id, file.name); } }); }); } }); Alpaca.registerFieldClass("file", Alpaca.Fields.ExFileField); })(jQuery); // precompiles handlebars templates Handlebars.getTemplate = function(name) { console.log("templates function working"); if (Handlebars.templates === undefined || Handlebars.templates[name] === undefined) { console.log("template undefined"); $.ajax({ url : appendBuildVersionQueryParam('/v1.1/alpaca/assets/' + name + '.html'), success : function(data) { console.log("success compiling template"); if (Handlebars.templates === undefined) { Handlebars.templates = {}; } Handlebars.templates[name] = Handlebars.compile(data); }, async: false }); } return Handlebars.templates[name]; }; var MultiValue = { addField: function(elem, type) { var pane = elem.containerItemEl.find('.multi-value-pane'); var currCount = pane.find('.multi-value-field').length; var addField = elem.containerItemEl.find('.multi-value-add'); elem.multiValueIndex = currCount + 2; var template = Handlebars.getTemplate(type); pane.append(template(elem)); var fieldKey = $.escapeSelector(elem.id + "#" + elem.multiValueIndex + "-pane"); var multiValuePane = elem.domEl.find("#" + fieldKey); var trashBtn = multiValuePane.find('.multi-value-delete'); //Special handling for multivalue firstname/lastname if(window.matchMedia('(max-width: 767px)').matches && type === 'name' && elem.schema.nameType === 'FIRSTLAST'){ var desktopPane = pane; var multiValueFields = elem.options.fields; for(var x = 0; x < multiValueFields.length; x++){ elem.nameIndex = multiValueFields[x].id + '#' + elem.multiValueIndex; pane = elem.containerItemEl.find('#multi-value-pane-mobile-' + multiValueFields[x].id); var addedElem = $('input[name="' + elem.nameIndex + '"]'); template = Handlebars.getTemplate("FNLN-mobile"); pane.append(template(elem)); var searchString = ".multi-value-field-mobile-" + multiValueFields[x].id + $.escapeSelector('#' + elem.multiValueIndex); var field = $(searchString); field.append(addedElem); } field.append(trashBtn); desktopPane.hide(); multiValuePane = elem.domEl.find("#" + fieldKey); } var fields = pane.find("input[type='" + elem.inputType + "']"); fields.each(function(){ $(this).change(function() { elem.refreshValidationState(true); }); var field = $(this); $('button.alpaca-form-button.alpaca-form-button-reset.btn.btn-default').on('click', function() { field.val(''); multiValuePane.remove(); addField.show(); }); }); trashBtn.on('click', function() { var nIndex = multiValuePane.attr('data-index'); multiValuePane.remove(); addField.show(); while(true) { var nKey = $.escapeSelector(elem.id + "#" + (++nIndex) + "-pane"); var nPane = elem.domEl.find("#" + nKey); if (nPane.length) { nPane.each(function(){ var paneId = this.id.replace(new RegExp("#" + nIndex + "-pane$"), "#" + (nIndex-1) + "-pane"); console.log("Renaming Pane(" + this.id + " -> " + paneId); $(this).attr('id', paneId); $(this).attr('data-index', "" + (nIndex-1)); var fields = $(this).find("[id$=\\#" + nIndex + "]"); fields.each(function(){ var nId = this.id.replace(new RegExp("#" + nIndex + "$"), "#" + (nIndex-1)); var nName = this.name.replace(new RegExp("#" + nIndex + "$"), "#" + (nIndex-1)); console.log("Renaming Field(" + this.id + " -> " + nId); $(this).attr('id', nId); $(this).attr('name', nName); }); }) } else { break; } } elem.refreshValidationState(true); enableSubmitButton(); }); currCount = pane.find('.multi-value-field').length; var maxCount = elem.schema.multiValue ? elem.schema.multiValue.count : 0; if (currCount >= maxCount) { addField.hide(); return; } }, render: function(elem) { var adder = $(elem.control).find('.multi-value-add'); adder.on("click", function(){ elem.addField(); }); } }; function init() { const jsonData = {"view":{"parent":"bootstrap-create","layout":{"template":"\/v1.1\/alpaca\/templates\/logo-default.html","bindings":{"current.county.b":"column-1","prior.residence.state.multiyear":"column-1","city.of.residence":"column-1","middle.names":"column-1","street.number":"column-1","ssn.issued.in":"column-1","month.of.birth":"column-1","street.name":"column-1","vehicle.color":"column-1","person.known":"column-1","5fef5ed1-c666-4180-8192-1da230ae6b42":"column-1","00000000-0000-0000-0000-000000001005":"column-1","00000000-0000-0000-0000-000000001001":"column-1","886a7081-eb12-4faf-ae37-580b7c823599":"column-1","96b9920f-c03b-46d8-9b75-222b27e3657c":"column-1","9651d2f9-b714-4a0c-90e6-531cfeb68c38":"column-1","a5fba6f7-8495-43b1-b422-014067d626b3":"column-1","ba19691c-e6f9-45ab-aa82-54b288df1709":"column-1","1f43b46a-280b-4916-b311-6c18406a1d02":"column-1","bf34df43-ce3f-4654-b40f-d96904e0834f":"column-1","71d38f3e-f63f-4780-92c2-7956b20302f0":"column-1","b12b1bc8-4978-44c3-beab-4ae1ae2a1db8":"column-1","00000000-0000-0000-0000-000000001002":"column-1","00000000-0000-0000-0000-000000001003":"column-1","00000000-0000-0000-0000-000000001004":"column-1","00000000-0000-0000-0000-000000001007":"column-1","6febd554-caf8-468b-b829-d91902ace999":"column-1","5b8e9d95-4bb0-4c9c-82ee-f4f61a5a723c":"column-1","a74ef810-86ca-42b6-9f20-83f33d37eb3b":"column-1","986e66bd-feca-4a7e-9b57-1d6ad3d6d205":"column-1","75651ccf-3fba-45ec-909a-d19f6a432364":"column-1","564fab0a-c8dc-4a95-869e-604b47fb3f02":"column-1","5ea88078-645a-4c33-96d6-96306f614f67":"column-1","d1202f67-e8da-4f74-ab45-f977b790ea58":"column-1","99bd509b-5cbc-4665-9f08-df646d7e4d2b":"column-1","fb90bd41-bce5-40dc-a3db-adc2749e91d1":"column-1","00000000-0000-0000-0000-000000001006":"column-1","65dd4799-6219-4f13-ae32-0744ec3d7981":"column-1","a2b00265-c0bb-4084-9c83-ad54a86e8809":"column-1","ca850dfd-7010-4b8c-96d2-4fa3fd4ec680":"column-1","2ee1f590-6a22-4207-a59f-fa1c1855a451":"column-1","dc655039-cb0c-4cad-a9e4-e631ef2bf762":"column-1","f6b3f61c-4602-48e7-9728-d03027ac58cc":"column-1","9d937d67-1892-4e36-8fe8-f13d07bd1ee5":"column-1","de80a74c-402d-40b3-b671-4248727b9689":"column-1","08c77718-6306-429d-baa8-b5acd7f984ca":"column-1","b92fcc1e-18b6-4099-b4dc-9712d84615c4":"column-1","d7b94f28-ccff-4f5c-91a5-44c58757c667":"column-1","a4ef5ac2-4fcc-45cd-aaa1-00cb1561a9cd":"column-1","4c7f20cf-b1b5-427c-a967-294171bfca82":"column-1","ce3fe40a-6497-4aff-a069-319a5574d278":"column-1","711efbed-8eea-498b-903f-204e05df2a12":"column-1","c5b497d5-bfce-4857-96c9-71b78a915ea3":"column-1","prior.residence.state":"column-1"}},"fields":{"\/00000000-0000-0000-0000-000000001003":{"templates":{"control-email":"\/v1.1\/alpaca\/templates\/control-email.html"}},"\/00000000-0000-0000-0000-000000001004":{"templates":{"control-select":"\/v1.1\/alpaca\/templates\/select-tree.html"}},"\/00000000-0000-0000-0000-000000001005":{"templates":{"control-select":"\/v1.1\/alpaca\/templates\/select-rtree.html"}}},"messages":{"invalidEmail":"Invalid Email address e.g. info@example.com"}},"schema":{"type":"object","title":"SeaWorld Entertainment","properties":{"65dd4799-6219-4f13-ae32-0744ec3d7981":{"title":"This request is for:","type":"string","enum":["ecd9d10f-3fbe-4fb9-8a1f-f9c032018fd0","ebfd9875-2570-4922-a32c-7076e31ade40"],"required":true,"selectType":"NORMAL"},"00000000-0000-0000-0000-000000001001":{"title":"The Data subject in question is an:","type":"string","enum":["00000000-0000-0000-0000-000000003001","00000000-0000-0000-0000-000000003002","00000000-0000-0000-0000-000000003003"],"selectType":"DATASUBJECT","permanent":true,"required":true},"a2b00265-c0bb-4084-9c83-ad54a86e8809":{"title":"Are you over 16 years of age as of today?","type":"string","enum":["29ee25ed-0fc3-451b-96f7-01a84e934beb","8f886a61-dd43-470b-9262-1ed98ff523d9"],"required":true,"selectType":"NORMAL"},"00000000-0000-0000-0000-000000001002":{"title":"First Name","type":"string","required":true,"maxLength":100,"permanent":true,"nameType":"FULLNAME","multiValue":{"enabled":false,"count":2}},"ca850dfd-7010-4b8c-96d2-4fa3fd4ec680":{"title":"Last Name","type":"string","maxLength":null,"required":true,"minLength":null,"multiValue":{"enabled":false,"count":2},"validationRule":null},"00000000-0000-0000-0000-000000001004":{"title":"Resident of","type":"string","enum":["EU_AT","EU_BE","EU_CZ","EU_DK","EU_EE","EU_FI","EU_FR","EU_DE","EU_GR","EU_HU","EU_IS","EU_IT","EU_LV","EU_LI","EU_LT","EU_LU","EU_MT","EU_NL","EU_NO","EU_PL","EU_PT","EU_SK","EU_SI","EU_ES","EU_SE","EU_CH","NA_US","NA_US_AK","NA_US_AL","NA_US_AR","NA_US_AZ","NA_US_CA","NA_US_CO","NA_US_CT","NA_US_DC","NA_US_DE","NA_US_FL","NA_US_GA","NA_US_HI","NA_US_IA","NA_US_ID","NA_US_IL","NA_US_IN","NA_US_KS","NA_US_KY","NA_US_LA","NA_US_MA","NA_US_MD","NA_US_ME","NA_US_MI","NA_US_MN","NA_US_MO","NA_US_MS","NA_US_MT","NA_US_NC","NA_US_ND","NA_US_NE","NA_US_NH","NA_US_NJ","NA_US_NM","NA_US_NV","NA_US_NY","NA_US_OH","NA_US_OK","NA_US_OR","NA_US_PA","NA_US_PR","NA_US_RI","NA_US_SC","NA_US_SD","NA_US_TN","NA_US_TX","NA_US_UT","NA_US_VA","NA_US_VT","NA_US_WA","NA_US_WI","NA_US_WV","NA_US_WY"],"selectType":"COUNTRY","required":true,"permanent":true},"00000000-0000-0000-0000-000000001005":{"title":"What type of request would you like to make?","type":"string","enum":["00000000-0000-0000-0000-000000004005"],"selectType":"REQUEST","required":true,"permanent":true},"2ee1f590-6a22-4207-a59f-fa1c1855a451":{"title":"Please choose your preferred methods of contact, so that we may contact you about your request.","type":"string","enum":["9cc7580d-cfac-4353-8c3d-e273a0a3b379","58c2556c-41b5-488a-9582-f72931cf4b19","82039a64-d8ea-4ae3-9f4e-43ffdb927cc6"],"required":true,"selectType":"NORMAL"},"00000000-0000-0000-0000-000000001003":{"title":"Email","type":"string","format":"email","required":true,"maxLength":100,"permanent":true,"multiValue":{"enabled":false,"count":2}},"dc655039-cb0c-4cad-a9e4-e631ef2bf762":{"title":"Mailing Address","type":"string","maxLength":null,"required":false,"minLength":null,"multiValue":{"enabled":false,"count":2},"validationRule":null},"f6b3f61c-4602-48e7-9728-d03027ac58cc":{"title":"City","type":"string","maxLength":null,"required":false,"minLength":null,"multiValue":{"enabled":false,"count":2},"validationRule":null},"9d937d67-1892-4e36-8fe8-f13d07bd1ee5":{"title":"Postal Code","type":"string","maxLength":null,"required":false,"minLength":null,"multiValue":{"enabled":false,"count":2},"validationRule":null},"de80a74c-402d-40b3-b671-4248727b9689":{"title":"Phone Number","type":"string","maxLength":null,"required":false,"minLength":null,"multiValue":{"enabled":false,"count":2},"validationRule":null},"00000000-0000-0000-0000-000000001006":{"title":"Comment (max 550 characters)","type":"string","maxLength":550,"permanent":false,"required":false},"00000000-0000-0000-0000-000000001007":{"type":"boolean","required":true,"permanent":false,"notStored":true,"title":""}}},"options":{"header":{"logo":{"uri":"https:\/\/login.truste.com\/services\/resources\/storage\/images\/IMG-268d2ef140664483badf518a47958654.png"},"message":"<div class=\"ta-form-group required\"> \t<span style=\"font-family:segoe ui\"> \t\t<h1> \t\t\t<b>Do Not Sell or Share My Information Request Form<\/b> \t\t<\/h1> \t\t<br> \t\t<div class=\"ta-form-group\"> \t\t\t<\/div> \t<\/span> <\/div>","showCompanyName":false},"form":{"attributes":{"action":"\/services\/validation?v=1.1","method":"post"},"buttons":{"reset":{"title":"Reset"},"submit":{"title":"Submit"}}},"fields":{"65dd4799-6219-4f13-ae32-0744ec3d7981":{"optionLabels":["Myself","Another person for whom I am an authorized agent"],"sort":false,"type":"select","removeDefaultNone":false,"noneLabel":"--Select an option now--","multiple":false},"00000000-0000-0000-0000-000000001001":{"removeDefaultNone":false,"sort":false,"type":"select","optionLabels":["Customer","Employee","Other"],"noneLabel":"--Select an option now--","multiple":false},"a2b00265-c0bb-4084-9c83-ad54a86e8809":{"optionLabels":["Yes","No"],"sort":false,"type":"select","removeDefaultNone":false,"noneLabel":"--Select an option now--","multiple":false},"00000000-0000-0000-0000-000000001002":{"type":"name","disallowOnlyEmptySpaces":true},"ca850dfd-7010-4b8c-96d2-4fa3fd4ec680":{"disallowOnlyEmptySpaces":true,"type":"text"},"00000000-0000-0000-0000-000000001004":{"removeDefaultNone":false,"sort":false,"type":"select","idToLabelReplacer":"%%%%","optionLabels":["Austria","Belgium","Czechia","Denmark","Estonia","Finland","France","Germany","Greece","Hungary","Iceland","Italy","Latvia","Liechtenstein","Lithuania","Luxembourg","Malta","Netherlands","Norway","Poland","Portugal","Slovakia","Slovenia","Spain","Sweden","Switzerland","United States","Alaska","Alabama","Arkansas","Arizona","California","Colorado","Connecticut","District of Columbia","Delaware","Florida","Georgia","Hawaii","Iowa","Idaho","Illinois","Indiana","Kansas","Kentucky","Louisiana","Massachusetts","Maryland","Maine","Michigan","Minnesota","Missouri","Mississippi","Montana","North Carolina","North Dakota","Nebraska","New Hampshire","New Jersey","New Mexico","Nevada","New York","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Virginia","Vermont","Washington","Wisconsin","West Virginia","Wyoming"],"noneLabel":"--Select an option now--","multiple":false},"00000000-0000-0000-0000-000000001005":{"noneLabel":"--Select an option now--","removeDefaultNone":false,"sort":false,"type":"select","optionLabels":["Do Not Sell or Share My Information"],"ccmEnabledOptions":{"00000000-0000-0000-0000-000000004005":{"enabled":true}},"multiple":false},"2ee1f590-6a22-4207-a59f-fa1c1855a451":{"optionLabels":["Email","Phone","Mail"],"sort":false,"type":"select","removeDefaultNone":false,"noneLabel":"--Select an option now--","multiple":false},"00000000-0000-0000-0000-000000001003":{"type":"email"},"dc655039-cb0c-4cad-a9e4-e631ef2bf762":{"type":"text"},"f6b3f61c-4602-48e7-9728-d03027ac58cc":{"type":"text"},"9d937d67-1892-4e36-8fe8-f13d07bd1ee5":{"type":"text"},"de80a74c-402d-40b3-b671-4248727b9689":{"type":"text"},"00000000-0000-0000-0000-000000001006":{"type":"textarea"},"00000000-0000-0000-0000-000000001007":{"rightLabel":"By submitting this request, I am confirming the following: <br\/> (1) <strong>Accuracy<\/strong>: the information I have provided is true and accurate; (2) <strong>TrustArc role<\/strong>: that I understand the service is provided by TrustArc on behalf of SeaWorld Entertainment and that once TrustArc provides my request to SeaWorld Entertainment, TrustArc will retain an encrypted record of my request; (3) <strong>Privacy<\/strong>: that I understand the information will be handled by TrustArc in accordance with its <a target='_blank' href='https:\/\/www.trustarc.com\/privacy-policy\/'>Privacy Policy<\/a> and by SeaWorld Entertainment in accordance with its <a target='_blank' href='https:\/\/seaworldentertainment.com\/policies\/privacy-policy\/'>Privacy Policy<\/a>; (4) <strong>Contact<\/strong>: that SeaWorld Entertainment has the right to contact me to verify my identity and to process this request.","type":"checkbox"}}}}; const hiddenFields = [ "accountId", "locale", "authType", "authResponse", "formId", "requestId", "suppValidationId", "sourceWebsite", "ipAddress", "gpcEnabled", "captchaAnswer", "captchaInput" ]; hiddenFields.forEach(function(hiddenField) { jsonData.schema.properties[hiddenField] = { type : "string", }; jsonData.options.fields[hiddenField] = { type : "hidden" }; }); jsonData.schema.properties.accountId.default = "a1329035-5b8c-49b2-9a20-0066b99f1106"; jsonData.schema.properties.locale.default = locale; jsonData.schema.properties.formId.default = formId; jsonData.schema.properties.requestId.default = requestId; jsonData.schema.properties.suppValidationId.default = suppValidationId; jsonData.schema.properties.authResponse.default = 'no-token'; jsonData.schema.properties.authType.default = authType; jsonData.schema.properties.sourceWebsite.default = sourceWebsite; jsonData.schema.properties.ipAddress.default = ipAddress; jsonData.schema.properties.gpcEnabled.default = gpcEnabled; jsonData.schema.properties.captchaAnswer.default = ''; jsonData.schema.properties.captchaInput.default = ''; jsonData.options.form.buttons.submit.click = initSubmit; if( jsonData.view.layout && jsonData.view.layout.bindings ) { jsonData.view.layout.bindings.accountId = 'column-1'; jsonData.view.layout.bindings.locale = 'column-1'; jsonData.view.layout.bindings.formId = 'column-1'; jsonData.view.layout.bindings.requestId = 'column-1'; jsonData.view.layout.bindings.suppValidationId = 'column-1'; jsonData.view.layout.bindings.authResponse = 'column-1'; jsonData.view.layout.bindings.authType = 'column-1'; jsonData.view.layout.bindings.sourceWebsite = 'column-1'; jsonData.view.layout.bindings.ipAddress = 'column-1'; jsonData.view.layout.bindings.gpcEnabled = 'column-1'; jsonData.view.layout.bindings.captchaAnswer = 'column-1'; jsonData.view.layout.bindings.captchaInput = 'column-1'; } jsonData.postRender = postRenderer; if(jsonData.view.layout && jsonData.view.layout.template){ jsonData.view.layout.template = appendBuildVersionQueryParam(jsonData.view.layout.template); } if(jsonData.view.fields){ for (var fieldKey in jsonData.view.fields){ var field = jsonData.view.fields[fieldKey]; if(field && field.templates){ for (var templateKey in field.templates){ var template = field.templates[templateKey]; field.templates[templateKey] = appendBuildVersionQueryParam(template); } } } } jsonData.view.locale = locale; jsonData.view.messages[locale] = { "invalidEmail": jsonData.view.messages.invalidEmail } // Buttons doesn't work if (noSubmit) { for (var button in jsonData.options.form.buttons) { jsonData.options.form.buttons[button].click = function() { window.alert("Test Mode"); return; } } } // Date Locales for (var keyId in jsonData.schema.properties) { var schemaProps = jsonData.schema.properties[keyId]; var optionProps = jsonData.options.fields[keyId]; if (schemaProps.format === 'date') { if (!("picker" in optionProps)) { optionProps.picker = {}; } optionProps.picker.locale = locale; } } if(!jsonData.options.header.showCompanyName){ jsonData.schema.title = null; } //Disable autofocus on the first input field jsonData.options.focus = ""; $("#form1").alpaca(jsonData); } function submitMethod(alpaca) { const formData = alpaca.getValue(); if(GOOGLE_RECAPTCHA_V3_ENABLED){ grecaptcha.ready(function () { grecaptcha.execute("6LdSn6gUAAAAAKZ5SiEQ8PdCUOgV9sf1ei4utXrB", {action: 'homepage'}).then(function (token) { console.log("Google Token: " + token); formData.authResponse = token; alpaca.form.find("textarea.g-recaptcha-response").prop('disabled', true); if(TRUSTARC_CAPTCHA_ENABLED){ submitTrustArcCaptcha(alpaca, formData); }else{ submit(alpaca, formData); } }); }); }else if(TRUSTARC_CAPTCHA_ENABLED){ submitTrustArcCaptcha(alpaca, formData); }else if (authType === 'TRUSTARC') { formData.authResponse = trustarc.__token; Object.keys(trustarc.__data).forEach(function(key) { let value = trustarc.__data[key]; if (key && value) { if (!(key in formData) && alpaca.isValid(true)) { var input = $('<input name="' + key + '" style="display: none;">') input.val(value); alpaca.getFormEl().append(input); } formData[key] = value; } }); submit(alpaca, formData); } } function submitTrustArcCaptcha(alpaca, formData){ formData.captchaAnswer = captchaAnswer; formData.captchaInput = captchaInput; submit(alpaca, formData); } function submit(alpaca, formData){ alpaca.setValue(formData); //postmessage submit parentPostMessage(alpaca, { source: "trustarc_irm", message: "submit", data: "" }); disableSubmitButton(); alpaca.submit(); } function parentPostMessage(alpaca, data) { var requestType = nullSafeGet(['00000000-0000-0000-0000-000000001005'], alpaca.getValue()); var ccmEnabled = nullSafeGet(['options', 'fields', '00000000-0000-0000-0000-000000001005', 'ccmEnabledOptions', requestType, 'enabled'], alpaca.topControl); if (ccmEnabled === true || isGPCEnabled()) { window.parent.postMessage(JSON.stringify(data), '*'); } } var isModalConfirmInit = false; function initModal(alpaca){ if (!isModalConfirmInit) { $("#modal-btn-confirm").on("click", function(){ submitMethod(alpaca); $("#mi-modal").modal('hide'); }); $("#modal-btn-cancel").on("click", function(){ // Enable all upload File Hidden Field again after cancel updateFileUploadState(false); $("#mi-modal").modal('hide'); }); $(".close").on("click", function(){ // Enable all upload File Hidden Field again after cancel updateFileUploadState(false); }); isModalConfirmInit = true; } $("#mi-modal").modal('show'); //TODO: Find better way for late binding var confirmLabel = nullSafeGet(['00000000-0000-0000-0000-000000001005'], alpaca.getValue()); var confirmMessage = nullSafeGet(['options', 'fields', '00000000-0000-0000-0000-000000001005', 'confirmMessages', confirmLabel, 'message'], alpaca.topControl); var requestTypeLabel = nullSafeGet(['options', 'fields', '00000000-0000-0000-0000-000000001005', 'confirmMessages', confirmLabel, 'requestTypeLabel'], alpaca.topControl); confirmMessage = confirmMessage.replace('\[\[\$\{requestType\}\]\]', requestTypeLabel); $("#confirmMessage").html(confirmMessage); } function initSubmit(event, alpacaForm) { var alpaca = !alpacaForm ? this : alpacaForm; // Disable all upload File Hidden Field, so it wont be sent on submit updateFileUploadState(true); if (hasConfirm(alpaca)) { initModal(alpaca); } else { submitMethod(alpaca); } } function updateFileUploadState(disabled) { document.querySelectorAll(".uploadFileHiddenField").forEach(function(item) { item.disabled = disabled; }); document.querySelectorAll(".uploadFileField").forEach(function(item) { if (item.parentElement.classList.contains("disabled")) { item.disabled = disabled; } }); } function hasConfirm(alpaca) { var conLabels = nullSafeGet(['options', 'fields', '00000000-0000-0000-0000-000000001005', 'confirmLabels'], alpaca.topControl); var reqValue = nullSafeGet(['00000000-0000-0000-0000-000000001005'], alpaca.getValue()); if (conLabels && conLabels.includes(reqValue)) { var reqIds = nullSafeGet(['schema', 'properties', '00000000-0000-0000-0000-000000001005', 'enum'], alpaca.topControl); var reqVals = nullSafeGet(['options', 'fields', '00000000-0000-0000-0000-000000001005', 'optionLabels'], alpaca.topControl); if (reqIds && reqVals && reqIds.length == reqVals.length) { var reqIndex = reqIds.indexOf(reqValue); if (reqIndex != -1) { $('#requestTypeName').html(reqVals[reqIndex]); return true; } } } return false; } let initForm = true; let isCaptchaCorrect = false; const CAPTCHA_ANSWER_LENGTH = 5; let captchaAnswer; let captchaInput; const hideTrustArcCaptcha = function(){ if(!TRUSTARC_CAPTCHA_ENABLED){ return; } $('#captcha-container').hide(); } const showTrustArcCaptcha = function(){ if(!TRUSTARC_CAPTCHA_ENABLED){ return; } $('#captcha-container').show(); } const refreshTrustArcCaptcha = function(manualRefresh){ if(!TRUSTARC_CAPTCHA_ENABLED){ return; } const captchaInputField = $("#captcha-input"); const captchaRefresh = $('#captcha-refresh'); const captchaRefreshSection = $('#captcha-refresh-section'); captchaRefresh.prop('disabled', true); captchaRefresh.css('cursor', 'not-allowed'); captchaRefreshSection.invisible(); captchaInputField.val(''); captchaInputField.prop('disabled', true); $.getJSON("/services/validation/api/v1/captcha", function(captcha) { captchaAnswer = captcha.answer; $("#captcha-image").attr("src", captcha.image); changeTrustArcCaptchaAudio(captcha.audio); captchaRefresh.prop('disabled', false); captchaRefresh.css('cursor', 'pointer'); captchaInputField.prop('disabled', false); captchaRefreshSection.visible(); if(manualRefresh){ captchaInputField.focus(); } }).fail(function(error) { alert('Failed to load captcha!'); console.log( "[get captcha] error", error); }); } const changeTrustArcCaptchaAudio = function (sourceUrl) { if(!TRUSTARC_CAPTCHA_ENABLED){ return; } const audio = $("#captcha-audio"); $("#captcha-audio-source").attr("src", sourceUrl); audio[0].pause(); audio[0].load(); } function postRenderer(control) { $('.alpaca-required-indicator').html(('<sup class="alpaca-icon-required glyphicon glyphicon-asterisk intake-color-red"></sup>')); //WCAG 2 Compliance var count=1; $('#form1 a').each(function(){ var newId = 'tr-a-link-' + count++; var label = $("<label>").attr('id', newId); label.attr('hidden', true); label.html(newId); $(this).append(label); $(this).attr('aria-labelledby', 'form1 ' + newId); }); // ADA Compliance $('input').each(function(){ let property = control.schema.properties[this.name]; let titleValue = !!property && !!property.hasOwnProperty('title') && property.title != ''? property.title: 'No Label'; if(titleValue === 'No Label') { if($(this).prev('label').length) { titleValue = $(this).prev('label')[0].innerText; if(titleValue === '') { titleValue = 'No Label'; } } } $(this).attr('title', titleValue ); }); if (authType === 'TRUSTARC') { control.domEl.find('.alpaca-form-button').each(function() { $(this).attr('style','display: none'); }); } var rootKeys = processDynamics(control); initFields(control, rootKeys); // Reconfigure reset BUG in library control.form.domEl.find('button[data-key="reset"]').click(function(e){ e.preventDefault(); control.children.forEach(function(childElem){ childElem.clear(); hideErrors(childElem); }); selectedShowFields.clear() initForm = true; if(TRUSTARC_CAPTCHA_ENABLED && !isCaptchaCorrect){ $("#captcha-input").val(''); } initFields(control, rootKeys); }); control.form.adjustSubmitButtonState = function () { this.disableSubmitButton(); let enable = this.isFormValid(); if(TRUSTARC_CAPTCHA_ENABLED){ enable = isCaptchaCorrect && enable; } if(enable){ this.enableSubmitButton(); } } if(GOOGLE_RECAPTCHA_V3_ENABLED){ onRecaptchaLoadCallback(); } initializeTrustArcCaptcha(control); } function initializeTrustArcCaptcha(control) { if(!TRUSTARC_CAPTCHA_ENABLED){ return; } $("#captcha-refresh").click(()=>refreshTrustArcCaptcha(true)); $("#captcha-input").keyup(function () { const captchaInputField = $(this); if (captchaInputField.val().length < CAPTCHA_ANSWER_LENGTH) { return; } const captchaRefresh = $('#captcha-refresh'); captchaRefresh.prop('disabled', true); captchaInputField.prop('disabled', true); captchaInputField.val(captchaInputField.val().substr(0, CAPTCHA_ANSWER_LENGTH)); captchaInput = captchaInputField.val(); $.ajax("/services/validation/api/v1/captcha/verify", { type: 'POST', contentType: 'application/json', data: JSON.stringify({ answer: captchaAnswer, input: captchaInput }) }).done(function (data) { const correct = data.correct; if (correct) { isCaptchaCorrect = true; control.form.adjustSubmitButtonState(); captchaInputField.prop('disabled', true); captchaRefresh.hide(); $('#captcha-success').show(); } else { refreshTrustArcCaptcha(true); } }).fail(function () { refreshTrustArcCaptcha(true); }); }); refreshTrustArcCaptcha(false); const captchaContainer = $('#captcha-container'); $('.alpaca-field-object').append(captchaContainer); captchaContainer.show(); } let selectedShowFields = new Set(); function processDynamics(control) { var dynamics = control.options.dynamics || {}; var triggCnt = 0; var rootKeys = Object.keys(dynamics); Object.keys(dynamics).forEach(function (dynKey) { var triggerID = "" + triggCnt; var dynElem = dynamics[dynKey]; var dynCtrl = control.childrenByPropertyId[dynKey]; var triggers = dynElem.triggers || []; dynElem.triggerCalls = []; triggers.forEach(function (trigger) { trigger.actionCalls = []; trigger.show = function (isShown, currActionMap) { trigger.actionCalls.forEach(function(triggerCall){ var id = triggerCall.id triggerCall.show(isShown); if (currActionMap) { if (!currActionMap.get(id)) { currActionMap.set(id, isShown); } else { // An isShown(true) action is already in effect // Happens only when dynamics type is SHOW_OPTIONS return; } } var target = control.childrenByPropertyId[id]; if (target !== undefined && target.dynamicTrigger !== undefined) { if(!isShown) { target.dynamicTrigger(); } } }); }; var actions = trigger.actions || {}; if (trigger.type === 'SHOW_FIELDS') { Object.keys(actions).forEach(function (actionKey) { var elemCtrl = control.childrenByPropertyId[actionKey]; trigger.actionCalls.push({ id: actionKey, show: function(isShown) { // null means processing is not needed, so hide it if (isShown == null) { elemCtrl.hide(); elemCtrl.disable(); return; } // process if (isShown) { elemCtrl.show(); elemCtrl.enable(); if(elemCtrl.type === 'date') { elemCtrl.domEl.find("input[data-type='date']").each(function(){ $(this).datetimepicker("enable"); }); } } else { elemCtrl.hide(); elemCtrl.disable(); var field = control.childrenById[elemCtrl.id]; field.setValue(''); if(elemCtrl.type === 'select' && elemCtrl.options.multiple) { $(elemCtrl.control).multiselect('clearSelection'); } if(elemCtrl.type === 'date') { elemCtrl.domEl.find("input[data-type='date']").each(function(){ $(this).datetimepicker("disable"); }); } } } }); }); } else if (trigger.type === 'SHOW_OPTIONS') { Object.keys(actions).forEach(function (actionKey) { var action = actions[actionKey]; var acValues = action.values || []; var elemCtrl = control.childrenByPropertyId[actionKey]; if (!elemCtrl.showOptionArray) { elemCtrl.showOptionArray = {}; } elemCtrl.containerItemEl.find('option').each(function(){ var elVal = $(this).attr('value'); if (!elemCtrl.showOptionArray[elVal]) { elemCtrl.showOptionArray[elVal] = {}; } var hasClass = !$(this).hasClass('locationGroup'); elemCtrl.showOptionArray[elVal][triggerID] = hasClass; }); trigger.actionCalls.push({ id: actionKey, show: function(isShown) { // null means processing is not needed if (isShown == null) { return; } //process elemCtrl.containerItemEl.find('option').each(function(){ var elVal = $(this).attr('value'); if (elVal) { if (isShown) { elemCtrl.showOptionArray[elVal][triggerID] = acValues.includes(elVal); } else { elemCtrl.showOptionArray[elVal][triggerID] = !$(this).hasClass('locationGroup'); } } }); Object.keys(elemCtrl.showOptionArray).forEach(function(elVal) { var retShown = true; Object.keys(elemCtrl.showOptionArray[elVal]).forEach(function(triggerID) { if (retShown && !elemCtrl.showOptionArray[elVal][triggerID]) { retShown = false; } }); elemCtrl.containerItemEl.find('option[value="' + elVal +'"]').each(function(){ // Wrapping option fields in span to hide fields due to Safari/IE limitation. // It is not possible to hide options in IE/Safari let multiSelectOptionElem = elemCtrl.containerItemEl.find('input[value="' + elVal +'"]'); if(multiSelectOptionElem && elemCtrl.options.multiple) { multiSelectOptionElem = multiSelectOptionElem.parent().parent(); } else { multiSelectOptionElem = null; } if (retShown) { if(!$(this).hasClass('locationGroup')){ $(this).removeAttr('disabled'); } if( ($(this).parent().is('span')) ) { $(this).unwrap(); $(this).trigger("change"); if(multiSelectOptionElem) { multiSelectOptionElem.removeClass('hidden'); } } }else { if((!acValues.includes(elVal))){ if( !($(this).parent().is('span')) && !$(this).hasClass("locationGroup")) { $(this).wrap('<span>'); if(multiSelectOptionElem) { multiSelectOptionElem.addClass('hidden'); multiSelectOptionElem.removeClass('active'); $('option', $(this).parent()).each(function(element) { $(this).removeAttr('selected').prop('selected', false); }); $(this).trigger("change"); $(elemCtrl.control).multiselect('refresh'); } } }else if($(this).hasClass('locationGroup')){ $(this).attr('disabled', 'true'); } if (elemCtrl.getValue() === this.value) { elemCtrl.clear(); if (elemCtrl.dynamicTrigger !== undefined) { elemCtrl.dynamicTrigger(); } } } }); }); Object.keys(elemCtrl.showOptionArray).forEach(function(elVal) { let currEl = elemCtrl.containerItemEl.find('option[value="' + elVal +'"]'); if (currEl.hasClass("locationGroup")) { let stateGroup = elVal + '_'; let stateCount = elemCtrl.containerItemEl.find('option[value^="' + stateGroup +'"]').length; let hiddenStatesCount = elemCtrl.containerItemEl.find('span option[value^="' + stateGroup +'"]').length; let allHidden = stateCount === hiddenStatesCount; if (allHidden && !currEl.parent().is('span')) { currEl.wrap('<span>'); } else if(!allHidden && currEl.parent().is('span')) { currEl.unwrap(); } } }); } }); }); } Object.keys(actions).forEach(function (actionKey) { var target = dynamics[actionKey]; if (target !== undefined) { const index = rootKeys.indexOf(actionKey); if (index > -1) { rootKeys.splice(index, 1); } } }); dynElem.triggerCalls.push({ show: function(isShown, currActionMap) { trigger.show(isShown, currActionMap); }, match: function(fieldElem) { var isShown = false; var value = fieldElem.getValue(); let elemType = fieldElem.schema.type; if (!fieldElem.isVisible() && fieldElem.forceTrigger === false) { // If field is not visible isShown = null; } else if (elemType === "array") { for (let sel in value) { isShown = matchesCondition(value[sel].value, trigger.condition) if (isShown) { break; } } } else if (elemType === "boolean") { isShown = matchesCondition("" + value, trigger.condition); } else if (fieldElem.type ==="date"){ let convertedValue = convertToDefaultDateFormat(value, fieldElem.getDateFormat()); isShown = matchesCondition(convertedValue, trigger.condition); } else { isShown = matchesCondition(value, trigger.condition) } return isShown; } }); // Increase trigger counter triggCnt++; }); // Set the trigger event function dynCtrl.dynamicTrigger = function() { var self = this; var currActionMap = new Map(); dynElem.triggerCalls.forEach(function(triggerCall){ var isShown = triggerCall.match(self); if(isShown) { selectedShowFields.add(triggerCall); } else { selectedShowFields.delete(triggerCall); triggerCall.show(false, currActionMap); } }); selectedShowFields.forEach(function(field) { field.show(true, currActionMap); }); } }); return rootKeys; } function initFields(control, rootKeys) { //initial call (parent fields only) for (let i=0; i < rootKeys.length; i++) { let rootKey = rootKeys[i]; var dynElem = control.childrenByPropertyId[rootKey]; dynElem.dynamicTrigger(); } //initialization done initForm = false; } function disableSubmitButton() { var submitButton = $(".alpaca-form-button.alpaca-form-button-submit.btn.btn-default"); submitButton.attr('disabled', true); } function enableSubmitButton(){ var submitButton = $(".alpaca-form-button.alpaca-form-button-submit.btn.btn-default"); if($("#form1").alpaca('get').form.isFormValid()){ submitButton.removeAttr('disabled'); } else { submitButton.attr('disabled', true); } } function matchesCondition(value, condition) { switch (condition.type) { //For checkboxes and select fields case "OR": return condition.values.includes(value); //For Date fields case "GREATER_THAN": { let date = new Date(value); let systemDate = new Date(Date.now()); systemDate.setHours(0,0,0,0); return systemDate > calculateDateWithOffset(date, condition); } case "GREATER_THAN_OR_EQUAL": { let date = new Date(value); let systemDate = new Date(Date.now()); systemDate.setHours(0,0,0,0); return systemDate >= calculateDateWithOffset(date, condition); } case "LESS_THAN": { let date = new Date(value); let systemDate = new Date(Date.now()); systemDate.setHours(0,0,0,0); return systemDate < calculateDateWithOffset(date, condition); } case "LESS_THAN_OR_EQUAL": { let date = new Date(value); let systemDate = new Date(Date.now()); systemDate.setHours(0,0,0,0); return systemDate <= calculateDateWithOffset(date, condition); } } return false; } function calculateDateWithOffset(date, condition){ let offset = parseInt(condition.values[0]); let dateInput = new Date(date); switch (condition.dateUnit){ case "YEARS": return new Date(dateInput.setFullYear(dateInput.getFullYear() + offset)); case "MONTHS": return new Date(dateInput.setMonth(dateInput.getMonth() + offset)); case "WEEKS": return new Date(dateInput.setDate(dateInput.getDate() + (offset * 7))); case "DAYS": return new Date(dateInput.setDate(dateInput.getDate() + offset)); } } function convertToDefaultDateFormat(date, dateFormat){ if(dateFormat == "DD/MM/YYYY"){ //Unsupported format in js let dateParts = date.toString().split("/"); date = new Date(+dateParts[2], dateParts[1] - 1, +dateParts[0]); } return date; } document.addEventListener("DOMContentLoaded", function(event) { if(!isCookieAllowed()) { const href = window.location.href; const headerMessage = "Your browser is blocking essential cookie."; $(".error-title").append(headerMessage); if(inIframe()) { if(isGPCEnabled()){ const gpcMessage = "To proceed with GPC, please allow 3rd " + "party cookies for the website you are visiting."; $(".error-description").append(gpcMessage); } else { const iframeMessage = "We have detected that essential third-party cookies are blocked. Click <a href=https:\/\/submit-irm.trustarc.com\/services\/validation\/393ceb80-cbe8-4e90-b404-4970788e1212 target=_blank>here<\/a> to fill out and submit the form or enable third-party cookies in your browser and refresh the page." "essential third-party cookies are blocked. "+ "Click <a href='" + href + "' target='_blank'>here</a> to fill out and submit the form or " + "enable third-party cookies in your browser and refresh the page."; $(".error-description").append(iframeMessage); } } else { const blockedMessage = "We see that cookies are blocked. You must enable cookies in your browser and refresh the page to submit the form data." "You must enable cookies in your browser and refresh the page to submit the form data."; $(".error-description").append(blockedMessage); } $("body").css('width','100%'); $("body").css('height','100%'); $("body").css('margin','auto'); $("html").css('width','100%'); $("html").css('height','100%'); $("html").css('margin','auto'); $(".container").css('display','none'); $(".modal").css('display','none'); $(".cookie-error").css('display',''); if(GOOGLE_RECAPTCHA_V3_ENABLED){ onRecaptchaLoadCallback(); } return; } Handlebars.registerHelper('ifOptStart', function (index, array, options) { var child = quiteGetAt(array, index+1); var parent = quiteGetAt(array, index); if (child && parent && child.value.length > parent.value.length) { return options.fn(this); } return options.inverse(this); }); Handlebars.registerHelper('ifOptEnd', function(index, array, options) { var child = quiteGetAt(array, index+1); var parent = quiteGetAt(array, index); if ((child == null && parent && parent.value.length >= 5) || (child && parent && child.value.length < parent.value.length)) { return options.fn(this); } return options.inverse(this); }); Handlebars.registerHelper('ifSubOption', function(index, array, options) { var child = quiteGetAt(array, index); for(var x = 0 ; x < array.length ; x++){ if(child.value.startsWith(array[x].value) && child.value !== array[x].value){ return options.fn(this); } } return options.inverse(this); }); Handlebars.registerHelper('ifROptStart', function(index, array, options) { var child = quiteGetAt(array, index+1); var parent = quiteGetAt(array, index); if (child && parent && child.value.length > parent.value.length) { return options.fn(this); } return options.inverse(this); }); Handlebars.registerHelper('ifROptEnd', function(index, array, options) { var child = quiteGetAt(array, index+1); var parent = quiteGetAt(array, index); if ((child == null && parent && parent.value.length >= 36) || (child && parent && child.value.length < parent.value.length)) { return options.fn(this); } return options.inverse(this); }); Handlebars.registerHelper('ifEquals', function(val1, val2, options) { return (val1 === val2) ? options.fn(this): options.inverse(this); }); Handlebars.registerHelper('convertToMB', function(item) { return convertToMB(item); }); init(); }); function quiteGetAt(array, index) { if (index < 0 || array.length <= index) return null; return array[index]; } function wrapText(str, length) { if (length <= 6 ) return str; if (str.length > length) { var dot = str.lastIndexOf("."); dot = (dot == -1) ? length-3 : dot; var extStr = str.substr(dot) return str.substr(0, length-3-extStr.length) + "..." + extStr; } return str; } function convertToMB(byteSize) { return byteSize / Math.pow(1024,2) } function appendBuildVersionQueryParam(str){ if(!str || typeof str !== "string"){ return str; } if(str.length > 0 && '?' !== str[str.length - 1]){ str = str + '?'; } return str + "v=@generated.version@"; } function validateOptionalMultiValuesBaseCheck(elem){ return validateOptionalBaseCheck(elem, getMultiValueInputFields(elem)); } function getMultiValueInputFields(elem) { return elem.domEl .find('.multi-value-pane') .find("input[type='" + elem.inputType + "']"); } function validateMaxLength(elem, val) { if (val === "" && elem.options.allowOptionalEmpty && !elem.isRequired()) { return true; } if (Alpaca.isEmpty(val)) { val = ""; } if ((""+val).length > elem.schema.maxLength) { return false; } return true; } function validateMinLength(elem, val) { if(val !== val) { // NaN val = ""; } if (val === "" && elem.options.allowOptionalEmpty && !elem.isRequired()) { return true; } if (Alpaca.isEmpty(val)) { val = ""; } if ((""+val).length < elem.schema.minLength) { return false; } return true; } function validateOptionalBaseCheck(self, fields){ var hasValueFunc = function() { return $(this).val(); }; if (self.isRequired() && getFieldsFilterLength(fields, hasValueFunc) != fields.length) { return false; } var matchesWhiteSpaceFunc = function() { return Alpaca.testRegex(Alpaca.regexps.whitespace, $(this).val()); }; if (self.options.disallowOnlyEmptySpaces && getFieldsFilterLength(fields, matchesWhiteSpaceFunc) > 0) { return false; } return true; } let valueFieldMap = new Map(); let matchFieldMap = new Map(); let fieldTitleMap = new Map(); function isMatchFieldEnabled(elem, fieldSource) { if(elem.matchField != null) { if(elem.matchField.enabled) { matchFieldMap.set(fieldSource, elem.matchField.fieldId) } } } function validateMatchField(elem) { if(matchFieldMap.get(elem.name) != null) { var sourceVal = valueFieldMap.get(elem.name); var destFieldId = matchFieldMap.get(elem.name); if(sourceVal !== valueFieldMap.get(destFieldId)) { return false; } else { return true; } } } function getFieldsFilterLength(fields, func) { return (fields.filter(func).get()).length; } function isCookieAllowed() { let hostProto = "https"; let cookieName = 'irmTestCookie'; let cookieValue = 'trustarcTestCookie=' + cookieName; if(hostProto !== 'http'){ cookieValue += '; samesite=None; secure'; } document.cookie = cookieValue; return document.cookie.indexOf(cookieName) !== -1; } function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } } function isGPCEnabled () { const gpcParam = getUrlParameterByName('gpc'); return gpcParam !== null; } function hideErrors(element) { var self = element.getFieldEl(); self.removeClass('has-error'); self.children(".alpaca-message").remove(); } </script> </head> <body> <section class="ta-wrapper cookie-error" style="display:none;"> <div class="ta-content"> <div class="ta-body"> <div class="title error-title" > </div> <div class="description error-description" > </div> </div> </div> </section> <div class="container"> <div class="col-md-12 col-md-offset-1"> <div id="form1" class="col-md-8 col-md-offset-1"></div> </div> </div> <!-- Confirmation Modal --> <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id="mi-modal"> <div class="modal-dialog modal-m"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h1 class="modal-title text-center" id="myModalLabel">Request Confirmation</h1> </div> <div class="modal-body confirmation-body" id="confirmMessage"></div> <div class="modal-footer"> <button type="button" class="btn btn-default pull-left" id="modal-btn-cancel">Cancel</button> <button type="button" class="btn btn-primary pull-right" id="modal-btn-confirm">Confirm</button> </div> </div> </div> </div> <div id="captcha-container" style="display: none"> <label for="captcha-input">CAPTCHA Verification</label> <button id="captcha-refresh" type="button" style="border: none; background: none;">🔄</button> <span id="captcha-success" style="display: none">✅</span> <div id="captcha-refresh-section" style="display: flex; align-items: center;"> <img id="captcha-image" title="captcha-image" alt="Captcha" src=""/> <audio id="captcha-audio" controls style="flex-grow: 1; vertical-align: middle; margin-top: 5px; margin-bottom: 5px;"> <source id="captcha-audio-source" title="captcha-audio-source" src=""/> Your browser does not support the audio element. </audio> </div> <input id="captcha-input" type="text" class="alpaca-control form-control"/> </div> </body>