PageSourceSearch

https://nawigator.ai/wp-content/plugins/fluent-cart/assets/Reviews2.js?ver=1.7.0

js nawigator.ai collected 2026-10-05 14:38:43 UTC 24,977 bytes, 1 lines download raw bytes

1var Pe=r=>{throw TypeError(r)};var xe=(r,e,t)=>e.has(r)||Pe("Cannot "+t);var i=(r,e,t)=>(xe(r,e,"read from private field"),t?t.call(r):e.get(r)),u=(r,e,t)=>e.has(r)?Pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),l=(r,e,t,s)=>(xe(r,e,"write to private field"),s?s.call(r,t):e.set(r,t),t),A=(r,e,t)=>(xe(r,e,"access private method"),t);import{L as Le}from"./chunks/lightbox.js?ver=1.7.0";const be=()=>window.fluentcart_review_vars&&window.fluentcart_review_vars.trans||{};function Ie(r,e,t){const s=t.get(r);if(s&&(s.abort(),t.delete(r)),!e||!e.autoplay)return null;const a=new AbortController,o={signal:a.signal};return r.addEventListener("mouseenter",()=>e.autoplay.start(),o),r.addEventListener("mouseleave",()=>e.autoplay.stop(),o),t.set(r,a),a}const Ne=new WeakMap;function Oe(r){const e=r==="prev"?"m15 18-6-6 6-6":"m9 18 6-6-6-6",t=r==="prev"?be().prev_page||"Previous":be().next_page||"Next",s=document.createElement("button");return s.type="button",s.className=`fct-reviews-sli
1der-nav fct-reviews-slider-${r}`,s.setAttribute("aria-label",t),s.innerHTML='<svg class="fct-nav-arrow-svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="'+e+'"/></svg>',s}const $e=260,We=12,Je=120;function Qe(r){return r&&r.querySelector(".fct-review-photo-only")?Je:$e}function Ye(r,e=$e){const t={};for(let s=2;s<=r;s++)t[e*s+We*(s-1)]={slidesPerView:s};return t}function Ze(r,e){return e!=="segmented"?{el:r,clickable:!0,type:e}:{el:r,type:"custom",renderCustom(t,s,a){let o="";for(let d=1;d<=a;d++){let g="swiper-pagination-segment";d<s?g+=" is-completed":d===s&&(g+=" is-active"),o+=`<button type="button" class="${g}" data-segment-page="${d}" aria-label="${et(d,a)}"`+(d===s?' aria-current="true"':"")+"></button>"}return o+`<span class="segment-counter">${s} / ${a}</span>`}}}function et(r,e){return(be().slider_page_of||"Page %1$s of %2$s").replace("%1$s",r).replace("%2$s",e)}function tt(r,e){r.addEventListener("click",t=>{var S,c;const s=t.target.closest("[data-segment-page]");if(!s)return;const a=parseInt(s.getAttribute("data-segment-page"),10);if(!a)return;const o=(S=e.snapGrid)==null?void 0:S[a-1],d=o===void 0?-1:(c=e.slidesGrid)==null?void 0:c.indexOf(o),g=d>=0?d:a-1;if(typeof e.slideToLoop=="function"&&e.params.loop){e.slideToLoop(g);return}e.slideTo(g)})}function it(r){const e=r.nextElementSibling;e&&e.classList.contains("fct-reviews-slider-pagination-wrap")&&e.remove()}function st(r,e,t,s,a){const o=rt(r);if(o.className="fct-reviews-slider-frame is-arrows-"+s+" fct-arrows-"+a,s==="bottom"){const d=document.createElement("div");d.className="fct-reviews-slider-nav-row",d.appendChild(e),d.appendChild(t),o.appendChild(d);return}o.appendChild(e),o.appendChild(t)}function Re(r){const e=r.parentElement;!e||!e.classList.contains("fct-reviews-slider-frame")||e.replaceWith(r)}function rt(r){const e=r.parentElement;if(e&&e.classList.contains("fct-reviews-slider-frame"))return[...e.querySelectorAll(".fct-reviews-slider-nav, .fct-reviews-slider-nav-row")].forEach(s=>s.remove()),e;const t=document.createElement("div");return r.replaceWith(t),t.appendChild(r),t}function Be(r,e=null){const t=parseInt(r.getAttribute("data-reviews-slider"),10);if(Ie(r,null,Ne),it(r),!t||typeof window.Swiper!="function")return Re(r),null;e&&(e.destroy(!0,!0),r.classList.remove("swiper","fct-arrows-sm","fct-arrows-md","fct-arrows-lg"));let s={};try{s=JSON.parse(r.getAttribute("data-slider-settings")||"{}")}catch{}const a=s.arrows!=="no",o=["overlap","outside","bottom"].includes(s.arrowsPosition)?s.arrowsPosition:"overlap",d=s.pagination==="yes",g=["bullets","fraction","progressbar","segmented"].includes(s.paginationType)?s.paginationType:"bullets",S=s.autoplay||"no",c=!!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),h=Array.from(r.children).filter(p=>p.classList.contains("fct-review-item"));if(!h.length)return Re(r),null;const w=document.createElement("div");w.className="swiper-wrapper",h.forEach(p=>{const y=document.createElement("div");y.className="swiper-slide",y.appendChild(p),w.appendChild(y)}),r.innerHTML="",r.appendChild(w),r.classList.add("swiper",`fct-arrows-${s.arrowsSize||"md"}`);let m=null,E=null;a&&(m=Oe("prev"),E=Oe("next"),st(r,m,E,o,s.arrowsSize||"md"));let n=null;if(d){const p=document.createElement("div");p.className="fct-carousel-pagination fct-pagination-"+g+" fct-reviews-slider-pagination-wrap",n=document.createElement("div"),n.className="swiper-pagination fct-reviews-slider-pagination",p.appendChild(n),r.insertAdjacentElement("afterend",p)}const v=new window.Swiper(r,{slidesPerView:1,spaceBetween:We,autoHeight:!1,slidesPerGroupAuto:!0,observer:!0,observeParents:!0,loop:s.infinite==="yes",autoplay:["yes","hover"].includes(S)?{delay:Number(s.autoplayDelay)||3e3,pauseOnMouseEnter:!0,disableOnInteraction:!1,stopOnLastSlide:s.infinite!=="yes"}:!1,watchOverflow:!1,a11y:{enabled:!0},keyboard:{enabled:!0},navigation:a?{prevEl:m,nextEl:E}:!1,pagination:n?Ze(n,g):!1,on:{init(p){(S==="hover"||c)&&p.autoplay&&p.autoplay.stop()}},breakpointsBase:"container",breakpoints:Ye(t,Qe(r))});return n&&g==="segmented"&&tt(n,v),S==="hover"&&Ie(r,v,Ne),v}function at(r,e){return r-e>1}function nt(r,e){const t=parseInt(e,10);if(!t||t<1)return null;const s=String(r).trim().split(/\s+/);return s.length<=t?null:s.slice(0,t).join(" ")+"…"}function He(r,e={}){const t=!!r;return{expanded:t,label:t?e.show_less||"Show less":e.read_more||"Read more"}}function ot({expanded:r=!1,truncated:e=!1,hasToggle:t=!1}={}){return r?"leave":e?t?"none":"add":t?"remove":"none"}function lt(r,e={},t=null){r.querySelectorAll(".fct-review-item-content, .wp-block-fluent-cart-review-item-content").forEach(a=>{const o=a.nextElementSibling,d=o&&o.classList.contains("fct-review-readmore")?o:null,g=!!d&&d.getAttribute("aria-expanded")==="true",S=parseInt(a.getAttribute("data-max-words"),
110)||0;if(S){a.dataset.fullText===void 0&&(a.dataset.fullText=a.textContent);const m=nt(a.dataset.fullText,S);if(m===null){a.textContent=a.dataset.fullText,a.classList.remove("is-clamped"),d&&d.remove();return}a.classList.remove("is-clamped");const E=p=>{const y=He(p,e);return a.textContent=y.expanded?a.dataset.fullText:m,y};if(d){E(g);return}const n=document.createElement("button");n.type="button",n.className="fct-review-readmore";const v=p=>{const y=E(p);n.setAttribute("aria-expanded",y.expanded?"true":"false"),n.textContent=y.label};v(!1),n.addEventListener("click",()=>{v(n.getAttribute("aria-expanded")!=="true"),typeof t=="function"&&t()}),a.insertAdjacentElement("afterend",n);return}if(!r.matches(".fct-reviews-list--grid, .fct-reviews-list--slider"))return;g||a.classList.add("is-clamped");const c=ot({expanded:g,truncated:at(a.scrollHeight,a.clientHeight),hasToggle:!!d});if(c==="leave"||c==="none")return;if(c==="remove"){d.remove();return}const h=document.createElement("button");h.type="button",h.className="fct-review-readmore";const w=m=>{const E=He(m,e);a.classList.toggle("is-clamped",!E.expanded),h.setAttribute("aria-expanded",E.expanded?"true":"false"),h.textContent=E.label};w(!1),h.addEventListener("click",()=>{w(h.getAttribute("aria-expanded")!=="true"),typeof t=="function"&&t()}),a.insertAdjacentElement("afterend",h)})}const _e=()=>window.fluentcart_review_vars&&window.fluentcart_review_vars.trans||{},De=(()=>{let r=null,e=!1,t=null,s=[],a="";const o=()=>r?document.getElementById(r.classList.lightbox):null,d=n=>[n.classList.lightbox,n.classList.lightboxOverlay].map(v=>document.getElementById(v)).filter(Boolean),g=n=>
1{d(n).forEach(v=>{v.removeAttribute("id"),v.removeAttribute("tabindex"),s.push(v)}),Le.isBuiltOnce=!1},S=()=>{s.forEach(n=>n.remove()),s=[]},c=n=>{n.disableKeyboardNav(),window.removeEventListener("resize",n.boundSizeOverlay),n.onImageLoaded=()=>{},n.sizeContainer=()=>{},n.showImage=()=>{},n.enableKeyboardNav=()=>{},n.sizeOverlay=()=>{}},h=()=>{const n=o();return n?[...n.querySelectorAll('a[role="button"], button, [tabindex="0"]')].filter(v=>v.offsetParent!==null):[]},w=n=>{if(!e||!r)return;if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),r.end();return}if(n.key!=="Tab")return;n.stopPropagation();const v=o(),p=h();if(!v)return;if(!p.length){n.preventDefault(),v.focus();return}const y=p[0],T=p[p.length-1],Te=!v.contains(document.activeElement)||document.activeElement===v;n.shiftKey&&(Te||document.activeElement===y)?(n.preventDefault(),T.focus()):!n.shiftKey&&(Te||document.activeElement===T)&&(n.preventDefault(),y.focus())},m=n=>{const v=document.getElementById(n.classList.lightbox);if(!v)return;v.setAttribute("role","dialog"),v.setAttribute("aria-modal","true"),v.setAttribute("aria-label",_e().photo_preview||"Photo preview");const p=v.querySelector("."+n.classList.lbClose);p&&p.setAttribute("aria-label",_e().close||"Close"),v.focus();const y=document.getElementById(n.classList.lightboxOverlay);y&&y.addEventListener("focus",()=>v.focus())},E=n=>{if(n!==r||!e){n.disableKeyboardNav();return}e=!1,r=null,document.removeEventListener("keydown",w,!0),n.endLightbox(),document.body.style.overflow=a,g(n),c(n),clearTimeout(t),t=setTimeout(S,n.options.fadeDuration),n.opener&&n.opener.focus()};return{isShowing(){return e},open(n,v,p){if(clearTimeout(t),e&&r){const T=r;e=!1,r=null,document.removeEventListener("keydown",w,!0),g(T),c(T)}else a=document.body.style.overflow;S(),[...document.querySelectorAll(".fct-lightbox, .fct-lightboxOverlay")].forEach(T=>T.remove()),Le.isBuiltOnce=!1;const y=new Le({wrapAround:!0},[]);y.endLightbox=y.end.bind(y),y.end=()=>E(y),y.opener=n,r=y,e=!0,document.addEventListener("keydown",w,!0),y.setAlbum(v),y.start(p,()=>m(y))}}})();var b,k,Ae,M,P,z,Ee,B,H,I,K,N,D,$,G,U,X,J,Q,Y,Z,ee,te,ie,x,_,W,se,re,ae,ne,oe,le,de,ce,ue,he,fe,me,pe,we,F,q,C,L,O,V,f,R,ve,Fe,qe,ke,Ve,je,ze,Ke,Ce,Ge,Ue,Xe,ge;class Se{constructor(e){u(this,f);u(this,b);u(this,k);u(this,Ae);u(this,M);u(this,P);u(this,z);u(this,Ee,1);u(this,B,"created_at");u(this,H,"DESC");u(this,I,null);u(this,K,0);u(this,N,!1);u(this,D,!1);u(this,$,!1);u(this,G,!0);u(this,U,!0);u(this,X,!0);u(this,J,!0);u(this,Q,!0);u(this,Y,!0);u(this,Z,!0);u(this,ee,!0);u(this,te,!0);u(this,ie,!0);u(this,x,null);u(this,_,null);u(this,W,!1);u(this,se,"numbers");u(this,re,0);u(this,ae,0);u(this,ne,0);u(this,oe,0);u(this,le,!1);u(this,de,!1);u(this,ce,!1);u(this,ue,!1);u(this,he,!1);u(this,fe,!1);u(this,me,!0);u(this,pe,"");u(this,we,"overlay");u(this,F,"");u(this,q,null);u(this,C,null);u(this,L,null);u(this,O,new AbortController);u(this,V,{});var a;l(this,b,e),l(this,k,e.getAttribute("data-post-id")),l(this,Ae,e.getAttribute("data-product-name")||""),l(this,M,e.getAttribute("data-rest-url")),l(this,P,e.getAttribute("data-rest-nonce")),l(this,z,parseInt(e.getAttribute("data-per-page"))||10);const t=Number(e.getAttribute("data-min-rating"));l(this,K,Number.isInteger(t)&&t>=1&&t<=5?t:0),l(this,G,e.getAttribute("data-show-verified")!=="0"),l(this,U,e.getAttribute("data-show-date")!=="0"),l(this,X,e.getAttribute("data-show-reviewer")!=="0"),l(this,J,e.getAttribute("data-show-view-reply")!=="0"),l(this,Q,e.getAttribute("data-show-avatar")!=="0"),l(this,Y,e.getAttribute("data-show-title")!=="0"),l(this,Z,e.getAttribute("data-show-content")!=="0"),l(this,ee,e.getAttribute("data-show-photos")!=="0"),l(this,te,e.getAttribute("data-show-footer")!=="0"),l(this,ie,e.getAttribute("data-show-variation")!=="0"),l(this,se,e.getAttribute("data-pagination-type")||"numbers"),l(this,re,parseInt(e.getAttribute("data-max-words"),10)||0),l(this,ae,parseInt(e.getAttribute("data-media-visible"),10)||0),l(this,ne,parseInt(e.getAttribute("data-media-width"),10)||0),l(this,oe,parseInt(e.getAttribute("data-media-height"),10)||0),l(this,le,e.getAttribute("data-media-full-width")==="1"),l(this,de,e.getAttribute("data-media-flush")==="1"),l(this,ce,e.getAttribute("data-media-backdrop")==="1"),l(this,ue,e.getAttribute("data-photos-first")==="1"),l(this,he,e.getAttribute("data-rating-first")==="1"),l(this,fe,e.getAttribute("data-badge-last")==="1"),l(this,me,e.getAttribute("data-show-meta")!=="0"),l(this,pe,e.getAttribute("data-item-class")||""),l(this,we,e.getAttribute("data-media-more")||"overlay"),l(this,$,e.getAttribute("data-only-with-photos")==="1"),l(this,N,i(this,$)),l(this,F,((a=e.querySelector("[data-reviews-list]"))==null?void 0:a.getAttribute("data-client-id"))||"");const s=e.getAttribute("data-default-sort");if(s){const[o,d]=s.split("-");o&&l(this,B,o),d&&l(this,H,d)}}init(){if(i(this,b).hasAttribute("data-fluent-cart-review-summary")){document.addEventListener("fct-review-submitted",s=>{var a;String((a=s.detail)==null?void 0:a.postId)===String(i(this,k))&&A(this,f,ge).call(this)},{signal:i(this,O).signal});return}const e=i(this,b).querySelector("[data-reviews-list]");if(e&&e.querySelector("[data-review-id], [data-reviews-empty]")){A(this,f,qe).call(this,e);const s=i(this,b).querySelector("[data-reviews-pagination]");s&&A(this,f,Ce).call(this,s)}else A(this,f,R).call(this);if(A(this,f,Ue).call(this),A(this,f,Ge).call(this),window.location.hash==="#fct-product-reviews"){const s=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;requestAnimationFrame(()=>{i(this,b).scrollIntoView({behavior:s?"auto":"smooth",block:"start"})})}document.addEventListener("fct-review-submitted",s=>{var a;String((a=s.detail)==null?void 0:a.postId)===String(i(this,k))&&
1(A(this,f,R).call(this,1),A(this,f,ge).call(this))},{signal:i(this,O).signal})}destroy(){i(this,_)&&i(this,_).call(this),i(this,O).abort(),i(this,q)&&(i(this,q).abort(),l(this,q,null)),i(this,L)&&(i(this,L).abort(),l(this,L,null)),i(this,x)&&(i(this,x).destroy(!0,!0),l(this,x,null)),l(this,W,!1),l(this,V,{})}}b=new WeakMap,k=new WeakMap,Ae=new WeakMap,M=new WeakMap,P=new WeakMap,z=new WeakMap,Ee=new WeakMap,B=new WeakMap,H=new WeakMap,I=new WeakMap,K=new WeakMap,N=new WeakMap,D=new WeakMap,$=new WeakMap,G=new WeakMap,U=new WeakMap,X=new WeakMap,J=new WeakMap,Q=new WeakMap,Y=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ie=new WeakMap,x=new WeakMap,_=new WeakMap,W=new WeakMap,se=new WeakMap,re=new WeakMap,ae=new WeakMap,ne=new WeakMap,oe=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,ue=new WeakMap,he=new WeakMap,fe=new WeakMap,me=new WeakMap,pe=new WeakMap,we=new WeakMap,F=new WeakMap,q=new WeakMap,C=new WeakMap,L=new WeakMap,O=new WeakMap,V=new WeakMap,f=new WeakSet,R=function(e=1){l(this,Ee,e);const t=i(this,b).querySelector("[data-reviews-list]"),s=i(this,b).querySelector("[data-reviews-loading]");i(this,q)&&i(this,q).abort(),l(this,q,new AbortController),A(this,f,ve).call(this,t,s,!0);const a=new URLSearchParams({page:e,per_page:i(this,z),sort_by:i(this,B),sort_order:i(this,H),show_reviewer:i(this,X)?"1":"0",show_date:i(this,U)?"1":"0",show_verified:i(this,G)?"1":"0",show_view_reply:i(this,J)?"1":"0",show_avatar:i(this,Q)?"1":"0",show_title:i(this,Y)?"1":"0",show_content:i(this,Z)?"1":"0",show_photos:i(this,ee)?"1":"0",show_footer:i(this,te)?"1":"0",show_variation:i(this,ie)?"1":"0",pagination_type:i(this,se),max_words:i(this,re),media_visible:i(this,ae),media_width:i(this,ne),media_height:i(this,oe),media_full_width:i(this,le)?"1":"0",media_flush:i(this,de)?"1":"0",media_backdrop:i(this,ce)?"1":"0",photos_first:i(this,ue)?"1":"0",rating_first:i(this,he)?"1":"0",badge_last:i(this,fe)?"1":"0",show_meta:i(this,me)?"1":"0",item_class:i(this,pe),media_more:i(this,we)});i(this,F)&&a.set("client_id",i(this,F)),i(this,I)&&a.set("rating",i(this,I)),i(this,N)&&a.set("has_media","1"),i(this,D)&&a.set("verified_only","1"),fetch(`${i(this,M)}/public/reviews/${i(this,k)}${i(this,M).includes("?")?"&":"?"}${a}`,{method:"GET",headers:{"X-WP-Nonce":i(this,P)},signal:i(this,q).signal}).then(o=>{if(!o.ok)throw new Error(o.statusText);return o.json()}).then(o=>{if(A(this,f,ve).call(this,t,s,!1),o.reviews&&o.reviews.data){A(this,f,Fe).call(this,o.reviews.data,t,o.reviews_html||""),A(this,f,Ke).call(this,o.pagination_html||"");const d=i(this,b).querySelector("[data-reviews-total-count]");d&&(d.textContent=o.reviews.total.toLocaleString())}}).catch(o=>{if(o.name==="AbortError")return;A(this,f,ve).call(this,t,s,!1),t&&(t.textContent="",l(this,x,Be(t,i(this,x))));const d=i(this,b).querySelector("[data-reviews-error]");d&&(d.hidden=!1)})},ve=function(e,t,s){if(t&&(t.classList.toggle("is-visible",s),s&&e)){const a=e.getBoundingClientRect(),o=t.getBoundingClientRect();t.style.setProperty("--fct-reviews-rows-top",Math.round(a.top-o.top)+"px"),t.style.setProperty("--fct-reviews-rows-center-x",Math.round(a.left-o.left+a.width/2)+"px"),t.style.setProperty("--fct-reviews-rows-height",Math.round(a.height)+"px")}e&&(e.classList.toggle("is-loading",s),s?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"))},Fe=function(e,t,s){l(this,V,e.reduce((o,d)=>(o[d.id]=d,o),{}));const a=i(this,b).querySelector("[data-reviews-error]");a&&(a.hidden=!0),t.innerHTML=s,A(this,f,qe).call(this,t)},qe=function(e){l(this,x,Be(e,i(this,x))),A(this,f,ke).call(this,e),A(this,f,Ve).call(this),e.querySelectorAll("[data-view-replies]").forEach(t=>{t.addEventListener("click",()=>{const s=t.getAttribute("data-review-id");A(this,f,je).call(this,s)})})},ke=function(e){e&&(lt(e,be(),()=>i(this,x)&&i(this,x).update()),i(this,x)&&i(this,x).update())},Ve=function(){if(i(this,W))return;l(this,W,!0);let e=null;window.addEventListener("resize",()=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=null,A(this,f,ke).call(this,i(this,b).querySelector("[data-reviews-list]"))})},{signal:i(this,O).signal})},je=function(e){i(this,_)&&i(this,_).call(this);const t=i(this,b).querySelector("[data-review-modal-shell]")||document.querySelector("[data-review-modal-shell]");if(!t)return;t.querySelector("[data-review-modal-body]")&&i(this,C)===null&&l(this,C,t.innerHTML),i(this,C)!==null&&(t.innerHTML=i(this,C)),t.removeAttribute("hidden"),document.body.style.overflow="hidden";const a=document.activeElement,o=t.querySelector("[data-review-modal]");o&&(o.setAttribute("tabindex","-1"),requestAnimationFrame(()=>{o.focus()}));const d=()=>{t.removeEventListener("click",S),t.setAttribute("hidden",""),i(this,C)!==null&&(t.innerHTML=i(this,C)),document.body.style.overflow="",document.removeEventListener("keydown",g),a&&typeof a.focus=="function"&&a.focus(),i(this,L)&&(i(this,L).abort(),l(this,L,null)),i(this,_)===d&&l(this,_,null)};l(this,_,d);const g=c=>{var E;if(De.isShowing())return;if(c.key==="Escape"){d();return}if(c.key!=="Tab")return;const h=t.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not
1([tabindex="-1"])');if(!h.length){c.preventDefault(),(E=t.querySelector("[data-review-modal]"))==null||E.focus();return}const w=h[0],m=h[h.length-1];c.shiftKey&&document.activeElement===w?(c.preventDefault(),m.focus()):!c.shiftKey&&document.activeElement===m&&(c.preventDefault(),w.focus())},S=c=>{c.target===t&&d()};t.addEventListener("click",S),document.addEventListener("keydown",g),A(this,f,ze).call(this,e,t,d)},ze=function(e,t,s){t.querySelector("[data-review-modal]")&&(i(this,L)&&i(this,L).abort(),l(this,L,new AbortController),fetch(`${i(this,M)}/public/reviews/${i(this,k)}/${e}/modal`,{method:"GET",headers:{"X-WP-Nonce":i(this,P)},signal:i(this,L).signal}).then(o=>{if(!o.ok)throw new Error("Failed to load review");return o.json()}).then(o=>{var g;if(!o.view)throw new Error("Empty view");t.innerHTML=o.view;const d=t.querySelector("[data-review-modal]");d&&(d.setAttribute("tabindex","-1"),requestAnimationFrame(()=>d.focus())),(g=t.querySelector("[data-modal-close]"))==null||g.addEventListener("click",s),document.dispatchEvent(new CustomEvent("fct-review-modal-opened",{detail:{overlay:t,review:i(this,V)[e],reviewId:e,container:i(this,b)}}))}).catch(o=>{var S;if(o.name==="AbortError")return;const d=t.querySelector("[data-review-modal-body]")||t.querySelector("[data-review-modal]"),g=t.querySelector("[data-modal-error-template]");d&&g&&(d.replaceChildren(g.content.cloneNode(!0)),(S=d.querySelector("[data-modal-close]"))==null||S.addEventListener("click",s))}))},Ke=function(e){const t=i(this,b).querySelector("[data-reviews-pagination]");t&&(t.innerHTML=e||"",A(this,f,Ce).call(this,t))},Ce=function(e){e.querySelectorAll("[data-page]").forEach(t=>{t.disabled||t.addEventListener("click",()=>{A(this,f,R).call(this,parseInt(t.dataset.page)),i(this,b).scrollIntoView({behavior:"smooth",block:"start"})})})},Ge=function(){const e=c=>c.closest(".fct-review-media-gallery, [data-review-media]")||c.parentElement,t=c=>[...c.querySelectorAll('.fct-review-media-thumb[data-media-type="image"]')],s=(c,h,w)=>{const m=t(c);if(!m.length)return;const E=m.map(n=>({link:n.getAttribute("data-media-url"),alt:n.getAttribute("alt")||"",title:""}));De.open(w,E,Math.min(Math.max(0,h),E.length-1))},a=c=>{const h=e(c);s(h,t(h).indexOf(c),c)},o=c=>{const h=e(c),w=()=>[...h.querySelectorAll(".fct-review-media-thumb[hidden]")],m=w().filter(p=>p.getAttribute("data-media-type")==="video");m.forEach(p=>{p.hidden=!1});const E=t(h),n=E.find(p=>p.hidden);n&&s(h,E.indexOf(n),c);const v=w().length;if(!v){const p=m[0]&&m[0].querySelector(".fct-review-media-play");p&&p.focus(),c.remove();return}m.length&&d(c,v)},d=(c,h)=>{const w=c.querySelector("span");c.setAttribute("data-media-more-count",String(h)),w&&(w.textContent="+"+h);const m=_e().view_more_attachments;m?c.setAttribute("aria-label",m.replace("%s",String(h))):c.removeAttribute("aria-label")},g=c=>{const h=c.closest(".fct-review-media-video"),w=h&&h.querySelector("video");if(!w)return;
1h.classList.add("is-playing"),w.controls=!0;const m=w.play();m&&typeof m.catch=="function"&&m.catch(()=>{})},S=c=>{const h=c.closest(".fct-review-media-more");if(h)return o(h),!0;const w=c.closest(".fct-review-media-play");if(w)return g(w),!0;const m=c.closest('.fct-review-media-thumb[data-media-type="image"]');return m&&m.getAttribute("data-media-url")?(a(m),!0):!1};i(this,b).addEventListener("click",c=>{S(c.target)&&c.preventDefault()}),i(this,b).addEventListener("keydown",c=>{if(c.key!=="Enter"&&c.key!==" ")return;const h=c.target.closest('.fct-review-media-thumb[data-media-type="image"]');!h||!h.getAttribute("data-media-url")||(c.preventDefault(),a(h))})},Ue=function(){const e=i(this,b).querySelector("[data-reviews-sort]");e&&e.addEventListener("change",()=>{const[s,a]=e.value.split("-");l(this,B,s),l(this,H,a),A(this,f,R).call(this,1)});const t=i(this,b).querySelector("[data-reviews-filter-chips]");t&&t.addEventListener("click",s=>{const a=s.target.closest("[data-filter-chip]");a&&A(this,f,Xe).call(this,a.dataset.f
1ilterChip)})},Xe=function(e){const t=Number(e);Number.isInteger(t)&&t>=1&&t<i(this,K)||(l(this,I,null),l(this,N,i(this,$)),l(this,D,!1),e==="all"||(e==="has_media"?l(this,N,!0):e==="verified"?l(this,D,!0):l(this,I,parseInt(e))),i(this,b).querySelectorAll("[data-filter-chip]").forEach(s=>{const a=s.dataset.filterChip===e;s.classList.toggle("active",a),s.setAttribute("aria-pressed",a?"true":"false")}),A(this,f,R).call(this,1))},ge=function(e=!1){fetch(`${i(this,M)}/public/reviews/${i(this,k)}/summary`,{method:"GET",headers:{"X-WP-Nonce":i(this,P)}}).then(t=>t.ok?t.json():Promise.reject(new Error("summary request failed"))).then(t=>{if(!(t!=null&&t.summary))return;const s=t.summary,a=i(this,b).querySelector("[data-reviews-average]");a&&(a.textContent=s.average);const o=i(this,b).querySelector("[data-reviews-stars]");o&&t.stars_html&&(o.innerHTML=t.stars_html,t.stars_label&&o.setAttribute("aria-label",t.stars_label));const d=i(this,b).querySelector("[data-reviews-total]");if(d&&(d.textContent=d.textContent.replace(/[\d,]+/,s.total.toLocaleString())),s.breakdown)for(const g of[5,4,3,2,1]){const S=s.breakdown[g]||0,c=s.total>0?Math.round(S/s.total*100):0,w=i(this,b).querySelectorAll("[data-reviews-bar-row]")[5-g];if(w){const m=w.querySelector("[data-reviews-bar-fill]"),E=w.querySelector("[data-reviews-bar-count]");m&&(m.style.width=c+"%"),E&&(E.textContent=S.toLocaleString())}}}).catch(()=>{e||setTimeout(()=>A(this,f,ge).call(this,!0),2e3)})};const ye="[data-fluent-cart-reviews], [data-fluent-cart-review-summary]",j=new Map;function dt(){j.forEach((r,e)=>{e.isConnected||(r.destroy(),j.delete(e))})}function Me(r=document){const e=r&&typeof r.querySelectorAll=="function"?r:document;dt();const t=[...e.querySelectorAll(ye)];typeof e.matches=="function"&&e.matches(ye)&&t.unshift(e),t.forEach(s=>{if(j.has(s))return;const a=new Se(s);a.init(),j.set(s,a)})}function ct(r=document){const e=r&&typeof r.querySelectorAll=="function"?r:document,t=[...e.querySelectorAll(ye)];typeof e.matches=="function"&&e.matches(ye)&&t.unshift(e),t.forEach(s=>{const a=j.get(s);a&&(a.destroy(),j.delete(s))})}Se.reInit=Me;Se.destroy=ct;window.FluentCartProductReviews=Se;window.fluentCartInitReviews=Me;document.addEventListener("DOMContentLoaded",()=>Me(document));

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.