1(function () { 2 'use strict'; 3 4 var reducedMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)'); 5 var duration = 280; 6 7 document.querySelectorAll('.wp-block-limosuite-faq-accordion .limosuite-faq-items').forEach(function (group) { 8 var rows = Array.prototype.slice.call(group.querySelectorAll('details')); 9 var animations = new WeakMap(); 10 var desired = new WeakMap(); 11 12 rows.forEach(function (details) { 13 // Keep native one-open behavior when JavaScript is unavailable. Once loaded, 14 // manage it here so the browser does not snap the old row shut immediately. 15 details.removeAttribute('name'); 16 desired.set(details, details.open); 17 }); 18 19 function settle(details, open) { 20 var running = animations.get(details); 21 if (running) running.cancel(); 22 animations.delete(details); 23 details.style.height = ''; 24 details.style.overflow = ''; 25 details.open = open; 26 desired.set(details, open); 27 } 28 29 function setOpen(details, open) { 30 if (desired.get(details) === open) return; 31 desired.set(details, open); 32 33 var from = details.getBoundingClientRect().height; 34 var running = animations.get(details); 35 if (running) running.cancel(); 36 animations.delete(details); 37 38 if (reducedMotion && reducedMotion.matches || typeof details.animate !== 'function') { 39 settle(details, open); 40 return; 41 } 42 43 if (open) details.open = true; 44 details.style.height = from + 'px'; 45 details.style.overflow = 'hidden'; 46 var to = open ? details.scrollHeight : details.querySelector('summary').getBoundingClientRect().height; 47 var animation = details.animate( 48 [{ height: from + 'px' }, { height: to + 'px' }], 49 { duration: duration, easing: 'cubic-bezier(.22, .72, .24, 1)' } 50 ); 51 animations.set(details, animation); 52 animation.onfinish = function () { 53 if (animations.get(details) === animation) settle(details, open); 54 }; 55 } 56 57 rows.forEach(function (details) { 58 var summary = details.querySelector('summary'); 59 if (!summary) return; 60 summary.addEventListener('click', function (event) { 61 event.preventDefault(); 62 var opening = !desired.get(details); 63 if (opening) rows.forEach(function (other) { 64 if (other !== details) setOpen(other, false); 65 }); 66 setOpen(details, opening); 67 }); 68 }); 69 }); 70})();
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.