PIPEDA Compliance

[CDATA] [ /* SLIDE UP */ let slideUp = (target, duration = 500) => { target.style.transitionProperty = 'height, margin, padding'; target.style.transitionDuration = duration + 'ms'; target.style.boxSizing = 'border-box'; target.style.height = target.offsetHeight + 'px'; target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; window.setTimeout(() => { target.style.display = 'none'; target.style.removeProperty('height'); target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }, duration); // On closing the Data Portability section, set the request type value back to an empty string if (target.getAttribute('id') === 'form-pipeda-data-account-request') { document.querySelector('#form-pipeda-data-account-request-request-type').value = ''; } } /* SLIDE DOWN */ let slideDown = (target, duration = 500) => { setTimeout(function () { target.style.removeProperty('display'); let display = window.getComputedStyle(target).display; if (display === 'none') display = 'block'; target.style.display = display; let height = target.offsetHeight; target.style.overflow = 'hidden'; target.style.height = 0; target.style.paddingTop = 0; target.style.paddingBottom = 0; target.style.marginTop = 0; target.style.marginBottom = 0; target.offsetHeight; target.style.boxSizing = 'border-box'; target.style.transitionProperty = "height, margin, padding"; target.style.transitionDuration = duration + 'ms'; target.style.height = height + 'px'; target.style.removeProperty('padding-top'); target.style.removeProperty('padding-bottom'); target.style.removeProperty('margin-top'); target.style.removeProperty('margin-bottom'); window.setTimeout(() => { target.style.removeProperty('height'); target.style.removeProperty('overflow'); target.style.removeProperty('transition-duration'); target.style.removeProperty('transition-property'); }, duration); }, 100) } /* TOOGLE */ var slideToggle = (target, duration = 500) => { if (window.getComputedStyle(target).display === 'none') { return slideDown(target, duration); } else { return slideUp(target, duration); } } /* FADE */ var toggleFadeiSense = (elem, show) => { if (show) { elem.style.display = "block"; setTimeout(function () { elem.classList.add('show-isense'); elem.classList.remove('hide-isense'); }, 20) } else { elem.classList.remove('show-isense'); elem.classList.add('hide-isense'); setTimeout(() => { elem.style.display = 'none'; }, 400) } } var pipedaSlideUpAll = function () { slideUp(document.querySelector('#form-pipeda-edit-account-request'), 100); slideUp(document.querySelector('#form-pipeda-data-account-request'), 100); slideUp(document.querySelector('#form-pipeda-personal-data-report-request'), 100); document.querySelector('#pipeda_page button').setAttribute("aria-expanded", "false"); }; var email, type, consentGiven = false; var verificationModalContent = '

I give my consent on collecting my email and IP address for the purpose of processing this request. For more check Privacy Policy & Terms of Service.

'; var pipedaSendRequest = function (callback) { fetch('https://www.cloudflare.com/cdn-cgi/trace', { method: 'GET', headers: { 'Content-Type': 'text/plain', }, }) .then(resp => resp.text()) .then(resp => { if (!resp.error) { let ipInfo = resp; let formData = new FormData(); formData.append('shop', Shopify.shop); formData.append('email', email); formData.append('type', type); formData.append('sourceOfRequest', 4); formData.append('ipAddress', ipInfo); formData.append('consentGiven', consentGiven); formData.append('page', 'pipeda'); formData.append('lang', Shopify.locale ? Shopify.locale : ''); formData.append('gtranslateLang', isenseGDPR.Cookies.get('googtrans') ? isenseGDPR.Cookies.get('googtrans') : ''); fetch('https://gdpr.apps.isenselabs.com/gdprRequests/submitRequest', { method: 'POST', body: formData }) .then(resp => resp.json()) .then(resp => { if (!resp.error) { pipedaSlideUpAll(); if (resp.message.length) { alert(resp.message); } else { alert('Your request has been submitted successfully. Please check your email for more information.'); } } else { alert(resp.message); } if (typeof callback == 'function') { callback(resp); } }) .catch(error => { alert(error.message); }) } else { alert(resp.message); } }) } //Append modal to body, because otherwise it will not stay centered(even if position is fixed) document.querySelector("body").insertAdjacentHTML('beforeend', verificationModalContent); document.addEventListener("DOMContentLoaded", function () { // When the user clicks on (x), close the modal document.querySelector('.data-verification-close').addEventListener('click', function (e) { e.preventDefault(); closeVerificationModal(); // Focus the button of the request type that was picked let pipedaForms = document.querySelectorAll('.form-pipeda-request'); pipedaForms.forEach(function(pipedaForm) { if (pipedaForm.style.display !== "none") { let pipedaFormLinks = pipedaForm.previousElementSibling.querySelectorAll('li'); if (pipedaFormLinks.length === 1) { pipedaFormLinks] [0] [0] [1] [2]