https://www.spotlight.com/wp-content/plugins/spotlight-features/as…/view.js?ver=b8e8facd351b1370ae3b
1import{getElement as t,store as e,withSyncEvent as n}from"@wordpress/interactivity";const r=".wp-block-spotlight-features-faq-item",i=".spotlight-faq-item__question",o=".spotlight-faq-item__question-text",s=".spotlight-faq-item__answer",a=["a[href]","input","select","textarea","label","summary"].join(", ");let l=0;const u=new WeakMap,c=new WeakMap,d=t=>{const e=c.get(t);void 0!==e&&(t.removeEventListener("transitionend",e),c.delete(t))},g=t=>{t.style.maxHeight=`${t.scrollHeight}px`},f=t=>({questionTrigger:t.querySelector(i)||t.querySelector(o),questionText:t.querySelector(o),answer:t.querySelector(s)}),p=t=>{const{questionTrigger:e}=f(t);return null!==e&&"true"===e.getAttribute("aria-expanded")},m=(t,e)=>{const{questionTrigger:n,questionText:r}=f(e),i=(t=>t?t.textContent.replace(/\s+/g," ").trim():"")(r||n);var o;((t,e)=>{var n;""!==e&&(n={event:"accordion_open",accordionType:t,accordionItem:e},window.spotlightIsProduction&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push(n)))})((o=t)?o.closest?.(".faq-media")?"feature":(o.closest?.(".spotlight-faq"),"faq"):"faq",i)},q=(t,e,n,r,i,o=!0)=>{const s=i?"true":"false";if(e.setAttribute("aria-expanded",s),null!==n&&n.setAttribute("aria-expanded",s),(t=>{(t=>{const e=u.get(t);void 0!==e&&(window.clearTimeout(e),u.delete(t))})(t),d(t)})(r),!0===i){r.hidden=!1,r.style.maxHeight="0px",window.requestAnimationFrame(()=>{r.hidden=!1,t.classList.add("is-open"),g(r)});const e=t=>{r===t.target&&"max-height"===t.propertyName&&(r.style.maxHeight="none",d(r))};return r.addEventListener("transitionend",e),void c.set(r,e)}if(!1===o)return t.classList.remove("is-open"),r.hidden=!0,void(r.style.maxHeight="0px");r.hidden=!1,"none"!==r.style.maxHeight&&""!==r.style.maxHeight||g(r),r.offsetHeight,t.classList.remove("is-open"),r.style.maxHeight="0px";const a=window.setTimeout(()=>{u.delete(r),!1===t.classList.contains("is-open")&&(r.hidden=!0)},480);u.set(r,a)},h=(t,e,n=!1,i=!0)=>{Array.from(t.querySelectorAll(r)).forEach(t=>{const{questionTrigger:r,questionText:o,answer:s}=f(t);if(null===r||null===s)return;if(t!==e)return void q(t,r,o,s,!1,i);const a="true"===r.getAttribute("aria-expanded");q(t,r,o,s,!0===n||!1===a,i)})},y=(t,e)=>{if(null===e||void 0===e.closest)return null;const n=e.closest(`${i}, ${o}, ${s}`);return null===n||!1===t.contains(n)?null:n.closest(r)},w=(t,e)=>{if(null===e||void 0===e.closest)return!1;const n=e.closest(a);return null!==n&&t.contains(n)};e("spotlight-features/faq-accordion",{actions:{onClick:n(e=>{const{ref:n}=t();if(null===n)return;if(w(n,e.target))return;const r=y(n,e.target);if(null===r)return;const i=!1===p(r);e.preventDefault(),h(n,r),i&&m(n,r)}),onKeydown:n(e=>{if("Enter"!==e.key&&" "!==e.key)return;const{ref:n}=t();if(null===n)return;if(w(n,e.target))return;const r=y(n,e.target);if(null===r)return;const{questionTrigger:i}=f(r);if(null!==i&&"BUTTON"===i.tagName)return;const o=!1===p(r);e.preventDefault(),h(n,r),o&&m(n,r)})},callbacks:{initAccordion:()=>{const{ref:e}=t();if(null===e)return;const n=(t=>{const e=t.getAttribute("data-spotlight-faq-runtime-id");if(null!==e)return e;l+=1;const n=String(l);return t.setAttribute("data-spotlight-faq-runtime-id",n),n})(e),i=Array.from(e.querySelectorAll(r));let o=null;i.forEach((t,e)=>{const{questionTrigger:r,questionText:i,answer:s}=f(t);null!==r&&null!==s&&(((t,e,n,r,i,o)=>{const s=`spotlight-faq-question-${i}-${o}`,a=`spotlight-faq-answer-${i}-${o}`;null!==n?n.id=s:e.id=s,"BUTTON"===e.tagName?e.setAttribute("type","button"):(e.setAttribute("role","button"),e.setAttribute("tabindex","0")),e.setAttribute("aria-controls",a),r.id=a,r.setAttribute("role","region"),r.setAttribute("aria-labelledby",s),q(t,e,n,r,!1,!1)})(t,r,i,s,n,e),null===o&&(o=t))}),null!==o&&h(e,o,!0,!1);let s=!1;e.addEventListener("pointerdown",()=>{s=!0}),e.addEventListener("focusin",t=>{if(s)return void(s=!1);const n=y(e,t.target);if(null===n)return;const{questionTrigger:r}=f(n);null!==r&&"true"===r.getAttribute("aria-expanded")||h(e,n,!0)})}}});
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.