1/*! Zippykind LLC - Proprietary and confidential. Copyright (c) Zippykind LLC. All rights reserved. 2 * zk-signature: sha256=3ef062784ec5ebb0fb39d226b18ec5ed857eff2a1a253c305d9886f9c104b03e file=zk-flow.js by=Zippykind LLC 3 */ 4/* fe-880 */ 5;(function(){var s="Zippykind LLC|zk-signature|sha256=3ef062784ec5ebb0fb39d226b18ec5ed857eff2a1a253c305d9886f9c104b03e|file=zk-flow.js";return s;})(); 6(function () { 7 'use strict'; 8 9 // fe-881 10 var ROTATE_MS = 2000; 11 12 function activate(root, step, isAuto) { 13 var i; 14 var buttons = root.querySelectorAll('.zk-flow-status'); 15 var panels = root.querySelectorAll('.zk-flowstep-panel'); 16 17 for (i = 0; i < buttons.length; i++) { 18 var on = buttons[i].getAttribute('data-zk-step') === step; 19 // fe-882 20 if (on) { buttons[i].classList.add('is-active'); } 21 else { buttons[i].classList.remove('is-active'); } 22 buttons[i].setAttribute('aria-selected', on ? 'true' : 'false'); 23 } 24 for (i = 0; i < panels.length; i++) { 25 if (panels[i].getAttribute('data-zk-step') === step) { 26 panels[i].classList.add('is-active'); 27 } else { 28 panels[i].classList.remove('is-active'); 29 } 30 } 31 32 // fe-883 33 if (isAuto) { return; } 34 if (typeof window.zkTrack === 'function') { 35 try { window.zkTrack('how_it_works_status', { status: step }); } catch (e) {} 36 } 37 } 38 39 function wire(root) { 40 var buttons = root.querySelectorAll('.zk-flow-status'); 41 if (!buttons.length) { return; } 42 43 for (var i = 0; i < buttons.length; i++) { 44 (function (btn) { 45 btn.addEventListener('click', function (ev) { 46 ev.preventDefault(); 47 // fe-884 48 takeover(root); 49 activate(root, btn.getAttribute('data-zk-step')); 50 }); 51 btn.addEventListener('keydown', function (ev) { 52 if (ev.key !== 'ArrowRight' && ev.key !== 'ArrowLeft') { return; } 53 ev.preventDefault(); 54 takeover(root); 55 var list = root.querySelectorAll('.zk-flow-status'); 56 var idx = Array.prototype.indexOf.call(list, btn); 57 var next = ev.key === 'ArrowRight' ? idx + 1 : idx - 1; 58 if (next < 0) { next = list.length - 1; } 59 if (next >= list.length) { next = 0; } 60 list[next].focus(); 61 activate(root, list[next].getAttribute('data-zk-step')); 62 }); 63 })(buttons[i]); 64 } 65 } 66 67 // fe-885 68 69 function takeover(root) { 70 if (root.zkFlowRotator) { root.zkFlowRotator.stopForGood(); } 71 } 72 73 function prefersReducedMotion() { 74 if (!window.matchMedia) { return null; } 75 try { return window.matchMedia('(prefers-reduced-motion: reduce)'); } 76 catch (e) { return null; } 77 } 78 79 function autoRotate(root) { 80 var timer = null; 81 var done = false; // fe-886 82 var hovered = false; 83 var focused = false; 84 // fe-887 85 var inView = true; 86 87 function hidden() { 88 return document.hidden === true || document.visibilityState === 'hidden'; 89 } 90 91 function runnable() { 92 return !done && !hovered && !focused && inView && !hidden(); 93 } 94 95 function stop() { 96 if (timer !== null) { window.clearInterval(timer); timer = null; } 97 } 98 99 function start() { 100 if (timer !== null || !runnable()) { return; } 101 timer = window.setInterval(tick, ROTATE_MS); 102 } 103 104 // fe-888 105 function sync() { 106 if (runnable()) { start(); } else { stop(); } 107 } 108 109 function stopForGood() { 110 done = true; 111 stop(); 112 } 113 114 function tick() { 115 var list = root.querySelectorAll('.zk-flow-status'); 116 if (!list.length) { stopForGood(); return; } 117 var current = -1; 118 for (var i = 0; i < list.length; i++) { 119 if (list[i].getAttribute('aria-selected') === 'true') { current = i; } 120 } 121 var next = current + 1; 122 if (next < 0 || next >= list.length) { next = 0; } 123 activate(root, list[next].getAttribute('data-zk-step'), true); 124 } 125 126 var mq = prefersReducedMotion(); 127 if (mq && mq.matches) { done = true; } 128 if (mq) { 129 // fe-889 130 var onMq = function () { if (mq.matches) { stopForGood(); } }; 131 if (mq.addEventListener) { mq.addEventListener('change', onMq); } 132 else if (mq.addListener) { mq.addListener(onMq); } 133 } 134 135 root.addEventListener('mouseenter', function () { hovered = true; sync(); }); 136 root.addEventListener('mouseleave', function () { hovered = false; sync(); }); 137 // fe-890 138 root.addEventListener('focusin', function () { focused = true; sync(); }); 139 root.addEventListener('focusout', function (ev) { 140 var to = ev.relatedTarget; 141 if (to && root.contains && root.contains(to)) { return; } 142 focused = false;
143 sync(); 144 }); 145 146 document.addEventListener('visibilitychange', sync); 147 // fe-891 148 window.addEventListener('pagehide', stop); 149 window.addEventListener('pageshow', sync); 150 151 if (window.IntersectionObserver) { 152 try { 153 var io = new window.IntersectionObserver(function (entries) { 154 for (var i = 0; i < entries.length; i++) { 155 inView = entries[i].isIntersecting; 156 } 157 sync(); 158 }, { threshold: 0.25 }); 159 inView = false; // fe-892 160 io.observe(root); 161 } catch (e) { 162 inView = true; 163 } 164 } 165 166 return { stopForGood: stopForGood, sync: sync }; 167 } 168 169 function init() { 170 var roots = document.querySelectorAll('.zk-flowstep'); 171 for (var i = 0; i < roots.length; i++) { 172 // fe-893 173 roots[i].zkFlowRotator = autoRotate(roots[i]); 174 wire(roots[i]); 175 roots[i].zkFlowRotator.sync(); 176 } 177 } 178 179 if (document.readyState === 'loading') { 180 document.addEventListener('DOMContentLoaded', init); 181 } else { 182 init(); 183 } 184})();
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.