diff --git a/+/styles/public/minimal/base.css b/+/styles/public/minimal/base.css index 3b1bb0d7..c21a83b0 100644 --- a/+/styles/public/minimal/base.css +++ b/+/styles/public/minimal/base.css @@ -31,7 +31,7 @@ } :root .glsr-fade-out { opacity: 0 !important; - transition: visibility 0s cubic-bezier(0,0,.2,1) var(--glsr-duration-slow), + transition: visibility 0s cubic-bezier(0,0,0.2,1) var(--glsr-duration-slow), opacity var(--glsr-duration-slow) !important; visibility: hidden !important; } diff --git a/+/styles/public/minimal/modal.css b/+/styles/public/minimal/modal.css index c032e618..b8e2c6cc 100644 --- a/+/styles/public/minimal/modal.css +++ b/+/styles/public/minimal/modal.css @@ -48,10 +48,10 @@ width: 480px; } :root [aria-hidden="false"] .glsr-modal__dialog { - animation: gl-zoomIn var(--glsr-duration-slow) cubic-bezier(0,0,.2,1); + animation: gl-zoomIn var(--glsr-duration-slow) cubic-bezier(0,0,0.2,1); } :root [aria-hidden="true"] .glsr-modal__dialog { - animation: gl-zoomOut var(--glsr-duration-fast) cubic-bezier(0,0,.2,1); + animation: gl-zoomOut var(--glsr-duration-fast) cubic-bezier(0,0,0.2,1); } :root .glsr-modal__header { font-weight: 600; @@ -130,7 +130,7 @@ } :root .glsr-modal .glsr-modal__overlay { - animation-timing-function: cubic-bezier(0,0,.2,1); + animation-timing-function: cubic-bezier(0,0,0.2,1); } :root .glsr-modal[aria-hidden="false"] .glsr-modal__overlay { animation-duration: var(--glsr-duration-slow); diff --git a/assets/scripts/site-reviews.js b/assets/scripts/site-reviews.js index 69e15fb1..7ea66afb 100644 --- a/assets/scripts/site-reviews.js +++ b/assets/scripts/site-reviews.js @@ -1 +1 @@ -!function(){"use strict";let e;const t=function(e){return"json"===this.responseType||!0===this.json?e({message:this.statusText},!1):"text"===this.responseType?e(this.statusText):void console.error(this)},i=function(e){if(0===this.status||this.status>=200&&this.status<300||304===this.status){if("json"===this.responseType)return e(this.response.data,this.response.success);if("text"===this.responseType)return e(this.responseText);if(!0===this.json){const t=JSON.parse(this.response);return e(t.data,t.success)}}else t.bind(this,e)},s=e=>{let t=new FormData;const i=Object.prototype.toString.call(e);return"[object FormData]"===i&&(t=e),"[object HTMLFormElement]"===i&&(t=new FormData(e)),"[object Object]"===i&&Object.keys(e).forEach((i=>t.append(i,e[i]))),t.append("action",GLSR.action),t.append("_ajax_request",!0),t},n=s=>{e=new XMLHttpRequest,e.addEventListener("load",i.bind(e,s)),e.addEventListener("error",t.bind(e,s))},r=t=>{(t=t||{})["X-Requested-With"]="XMLHttpRequest";for(let i in t)t.hasOwnProperty(i)&&e.setRequestHeader(i,t[i])};var o={data:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={};t._action=e;for(let e of Object.keys(t))i[`${GLSR.nameprefix}[${e}]`]=t[e];return i},get:(t,i,s)=>{n(i),e.open("GET",t,!0),e.responseType="text",r(s),e.send()},post:(t,i,o)=>{n(i),e.open("POST",GLSR.ajaxurl,!0),e.responseType="json",e.json=!0,r(o),e.send(s(t))}};const a={},l=function(e,t){const i=a[e]||[],s=[];t&&[].forEach.call(i,(e=>{t!==e.fn&&t!==e.fn.once&&s.push(e)})),s.length?a[e]=s:delete a[e]},c=function(e,t,i){(a[e]||(a[e]=[])).push({fn:t,context:i})};var d={events:a,off:l,on:c,once:function(e,t,i){const s=function(){l(e,s),t.apply(i,arguments)};s.once=t,c(e,s,i)},trigger:function(e){const t=[].slice.call(arguments,1),i=(a[e]||[]).slice();[].forEach.call(i,(e=>e.fn.apply(e.context,t)))}};const h="function",u="isNode",p=(e,t)=>typeof e===t,f=(e,t)=>{null!==t&&(Array.isArray(t)?t.map((t=>f(e,t))):(v[u](t)||(t=document.createTextNode(t)),e.appendChild(t)))};function v(e,t){let i,s,n=arguments,r=1;if(!v.isElement(e)){let t=~["svg","line","path","rect","mask","radialGradient","stop"].indexOf(e)?"2000/svg":"1999/xhtml";e=document.createElementNS(`http://www.w3.org/${t}`,e)}if("string"==typeof t&&(t={class:t}),p(t,"object")&&!v[u](t)&&!Array.isArray(t))for(i in r++,t)s=t[i],i=v.attrMap[i]||i,p(i,h)?i(e,s):p(s,h)?e[i]=s:e.setAttribute(i,s);for(;re instanceof Element,v[u]=e=>e instanceof Node;const g="glsr-read-more",m=".glsr-hidden-text",_=".glsr-tag-value";class w{constructor(e){this.events={click:this._onClick.bind(this)},(e||document).querySelectorAll(m).forEach((e=>this.init(e)))}init(e){const t=this._insertLink(e);t&&("expand"===e.dataset.trigger&&(t.dataset.text=e.dataset.showLess,t.removeEventListener("click",this.events.click),t.addEventListener("click",this.events.click)),"modal"===e.dataset.trigger&&(t.dataset.glsrTrigger="glsr-modal-review"))}_insertLink(e){let t=e.parentElement.querySelector("."+g);t&&t.parentElement.removeChild(t);const i=v("a",{href:"#"},e.dataset.showMore),s=v("span",{class:g},i);return e.appendChild(s).querySelector("a")}_onClick(e){e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=t.closest(_),n=s.querySelector(m),r=t.dataset.text,o=t.innerText;t.dataset.text=o,t.innerText=r,t.removeEventListener("click",this.events.click),"false"===s.dataset.expanded?(s.querySelector("p:last-of-type").appendChild(i),s.dataset.expanded="true"):(n.appendChild(i),s.dataset.expanded="false"),t.addEventListener("click",this.events.click),"false"===s.dataset.expanded&&t.focus()}}var y=e=>({el:e,loading:()=>{"false"===e.getAttribute("aria-busy")&&(e.setAttribute("aria-busy",!0),e.setAttribute("disabled",""),e.dataset.text=e.innerText,e.innerHTML=''+(e.dataset.loading||e.dataset.text))},loaded:()=>{"true"===e.getAttribute("aria-busy")&&(e.innerHTML=e.dataset.text,e.setAttribute("aria-busy",!1),e.removeAttribute("data-text"),e.removeAttribute("disabled"))}});class b{constructor(e){this.Form=e,this.captcha={friendlycaptcha:"friendlyChallenge",hcaptcha:"hcaptcha",procaptcha:"procaptcha",recaptcha_v2_invisible:"grecaptcha",recaptcha_v3:"grecaptcha",turnstile:"turnstile"}[GLSR.captcha.type],this.captchaEl=!1,this.containerEl=this.Form.form.querySelector(".glsr-captcha-holder"),this.loaded=!1,this.token=null,this.widget=-1,this.fixCompatibility()}execute(){if(this.captchaEl&&this.isWidgetLoaded())try{this["execute_"+GLSR.captcha.type]()}catch(e){console.error(e),this.Form.submitForm()}else this.Form.submitForm()}execute_friendlycaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.token?this.Form.submitForm():setTimeout((()=>this.execute_friendlycaptcha()),100)}execute_hcaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.token?this._submitFormWithToken(this.token):window[this.captcha].execute(this.widget,{action:"submit_review",async:!0}).then((e=>{let{response:t}=e;this._submitFormWithToken(t)})).catch((e=>{console.error(e)}))}execute_procaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.Form.submitForm()}execute_recaptcha_v2_invisible(){this.execute_recaptcha_v3()}execute_recaptcha_v3(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):window[this.captcha].execute(this.widget,{action:"submit_review"})}execute_turnstile(){let e=window[this.captcha].getResponse(this.widget);1==+this.captchaEl.dataset.error||this.token||void 0===e?this.Form.submitForm():setTimeout((()=>this.execute_turnstile()),100)}fixCompatibility(){"hcaptcha"===GLSR.captcha.type&&void 0!==window.hCaptchaOnLoad&&document.body.click()}isLoaded(e){for(let t=0;t{if(void 0===e||this.isLoaded(e))i();else{const n=document.createElement("script");n.onload=i,n.onerror=s,n.src=e,n.type="module"===t?"module":"text/javascript","module"!==t&&void 0!==GLSR.captcha.urls.module&&n.setAttribute("nomodule",""),n.setAttribute("async",""),n.setAttribute("defer",""),document.head.append(n)}}))}render(){if(this.Form.form.onsubmit=null,this.containerEl&&!this.isWidgetLoaded())if(void 0===window[this.captcha])this.loaded?setTimeout((()=>this.render()),50):this.load(GLSR.captcha.urls.module,"module").then((()=>{this.load(GLSR.captcha.urls.nomodule,"nomodule")})).then((()=>this.loaded=!0)).then((()=>setTimeout((()=>this.render()),100))).catch((e=>console.error(e)));else{this.reset(),this._buildContainer();try{this["render_"+GLSR.captcha.type]()}catch(e){this.captchaEl.dataset.error=1,console.error(e)}}}render_friendlycaptcha(){this.widget=new window[this.captcha].WidgetInstance(this.captchaEl,{doneCallback:e=>this.token=e,errorCallback:e=>{console.error(e),this.captchaEl.dataset.error=1}})}render_hcaptcha(){var e;void 0!==(null===(e=window[this.captcha])||void 0===e?void 0:e.render)?this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this.token=e,"chalexpired-callback":()=>this.reset(),"close-callback":()=>this.Form.button.loaded(),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset()}):setTimeout((()=>this.render_hcaptcha()),100)}render_procaptcha(){this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this.token=e,captchaType:GLSR.captcha.captcha_type,language:GLSR.captcha.language,siteKey:GLSR.captcha.sitekey,theme:GLSR.captcha.theme,"chalexpired-callback":()=>this.reset(),"close-callback":()=>this.Form.button.loaded(),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset()})||1}render_recaptcha_v2_invisible(){this.render_recaptcha_v3()}render_recaptcha_v3(){var e;void 0!==(null===(e=window[this.captcha])||void 0===e?void 0:e.render)?this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this._submitFormWithToken(e),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset(),isolated:!0}):setTimeout((()=>this.render_recaptcha_v3()),100)}render_turnstile(){this.widget=window[this.captcha].render(this.captchaEl,{action:"submit_review",callback:e=>this.token=e,"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset(),sitekey:GLSR.captcha.sitekey,theme:GLSR.captcha.theme})}reset(){this.token=null,this.captchaEl&&(this.captchaEl.dataset.error=0),this.isWidgetLoaded()&&("friendlycaptcha"===GLSR.captcha.type?this.widget.reset():window[this.captcha].reset(this.widget))}_buildContainer(){"friendlycaptcha"===GLSR.captcha.type&&this.isWidgetLoaded()&&this.widget.destroy(),Array.from(this.containerEl.getElementsByClassName(GLSR.captcha.class)).forEach((e=>e.remove())),this.captchaEl=v("div",{class:GLSR.captcha.class,"data-badge":GLSR.captcha.badge,"data-captcha-type":GLSR.captcha.captcha_type,"data-lang":GLSR.captcha.language,"data-isolated":!0,"data-sitekey":GLSR.captcha.sitekey,"data-size":GLSR.captcha.size,"data-theme":GLSR.captcha.theme,"data-type":GLSR.captcha.type}),this.containerEl.appendChild(this.captchaEl)}_submitFormWithToken(e){["frc-captcha-solution","g-recaptcha-response","h-captcha-response"].forEach((t=>{this.Form.form[t]&&e&&(this.Form.form[t].value=e)})),this.Form.submitForm()}}const E=(e,t,i)=>{e&&t.split(" ").forEach((t=>{e.classList[i?"add":"remove"](t)}))},L=e=>"."+e.trim().split(" ").join("."),S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=null;return function(){clearTimeout(i);for(var s=arguments.length,n=new Array(s),r=0;r{try{return[null,JSON.parse(e)]}catch(t){return[t,e]}},k={contains:(e,t)=>e.includes(t),equals:(e,t)=>{if(Array.isArray(e)){let i=t.split(/\s*(?:,|$)\s*/);return e.sort().toString()===i.sort().toString()}return A(t)?R(e)===+t:e===t},greater:(e,t)=>!!A(t)&&R(e)>+t,less:(e,t)=>!!A(t)&&R(e)<+t,not:(e,t)=>!k.equals(e,t)},T=e=>String(e.getAttribute("type")||e.nodeName).toLowerCase(),R=e=>isNaN(e)?e.length:+e,A=e=>!isNaN(parseInt(e));class F{constructor(e){this.config=GLSR.validationconfig,this.elements=Array.from(e.form.elements),this.event=this.onChange.bind(this),this.Form=e}init(){this.eventListeners("add"),this.elements.forEach((e=>e.conditions={criteria:"always",observes:[],triggers:[]})),this._setConditionObserves(),this._setConditionTriggers()}destroy(){this.eventListeners("remove"),this.elements.forEach((e=>delete e.conditions))}eventListeners(e){this.elements.forEach((t=>t[e+"EventListener"](this.eventName(t),this.event)))}eventName(e){return["radio","checkbox","select"].includes(T(e))?"change":"input"}onChange(e){e.currentTarget.conditions.triggers.forEach((e=>{let t=[];e.conditions.observes.forEach((e=>t.push(this.test(e)))),t=t.filter((e=>e));const i=t.length===e.conditions.observes.length,s=t.length&&"any"===e.conditions.criteria,n=e.closest(L(this.config.field));i||s?(n.classList.remove(this.config.field_hidden),this.Form.validation.initField(e)):(e.validation&&this.Form.validation.destroyField(e.validation),this.resetValue(e),n.classList.add(this.config.field_hidden))}))}resetValue(e){const t=T(e);if("select"===t)Array.from(e.options).forEach((e=>e.selected=e.defaultSelected));else if(["checkbox","radio"].includes(t)){let t=this.Form.form.elements[e.name];Array.from(t.length?t:[t]).forEach((e=>e.checked=e.defaultChecked))}else e.value=e.defaultValue||"";e.dispatchEvent(new Event(this.eventName(e)))}test(e){return!k.hasOwnProperty(e.operator)||k[e.operator](this.value(e.el),e.value)}value(e){const t=e.getAttribute("name"),i=T(e),s=this.Form.form.elements[t];return"radio"===i?s.value:["checkbox","select"].includes(i)?Array.from(s.length?s:[s]).filter((e=>e["checkbox"===i?"checked":"selected"])).map((e=>e.value)):new String(e.value)}_setConditionObserves(){this.elements.filter((e=>e.dataset.conditions)).forEach((e=>{var t;let[i,s]=x(e.dataset.conditions);null===i&&null!=s&&null!==(t=s.conditions)&&void 0!==t&&t.length&&(s.conditions.forEach((t=>{const i=this.elements.filter((e=>e.closest(`[data-field="${t.name}"]`))).shift();i&&e.conditions.observes.push({el:i,...t})})),e.conditions.observes.length&&(e.conditions.criteria=s.criteria))}))}_setConditionTriggers(){this.elements.forEach((e=>{this.elements.filter((e=>e.dataset.conditions)).forEach((t=>{t.conditions.observes.forEach((i=>{i.el.getAttribute("name")===e.getAttribute("name")&&e.conditions.triggers.push(t)}))}))}))}}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t,i){return t&&function(e,t){for(var i=0;i0&&t.push({index:e.index,text:e.text,value:i})})),t.sort((function(e,t){return e.value-t.value}))}(t),this.widgetEl=null,this.el.widget&&this.el.widget.destroy(),s=this.values.length,n=1,r=this.props.maxStars,/^\d+$/.test(s)&&n<=s&&s<=r?this.build():this.destroy()}return N(e,[{key:"build",value:function(){this.destroy(),this.buildWidget(),this.selectValue(this.indexSelected=this.selected(),!1),this.handleEvents("add"),this.el.widget=this}},{key:"buildWidget",value:function(){var e=this,t=null,i=null;this.props.prebuilt&&(t=this.el.parentNode,i=t.querySelector("."+this.props.classNames.base+"--stars")),null===i&&((t=P(this.el,!1,{class:this.props.classNames.base})).appendChild(this.el),i=P(this.el,!0,{class:this.props.classNames.base+"--stars"}),this.values.forEach((function(t,s){var n=M({"data-index":s,"data-value":t.value});"function"==typeof e.props.stars&&e.props.stars.call(e,n,t,s),[].forEach.call(n.children,(function(e){return e.style.pointerEvents="none"})),i.innerHTML+=n.outerHTML}))),t.dataset.starRating="",t.classList.add(this.props.classNames.base+"--"+this.direction),this.props.tooltip&&i.setAttribute("role","tooltip"),this.widgetEl=i}},{key:"changeIndexTo",value:function(e,t){var i=this;if(this.indexActive!==e||t){if([].forEach.call(this.widgetEl.children,(function(t,s){C(t,s<=e,i.props.classNames.active),C(t,s===i.indexSelected,i.props.classNames.selected)})),this.widgetEl.setAttribute("data-rating",e+1),"function"==typeof this.props.stars||this.props.prebuilt||(this.widgetEl.classList.remove("s"+10*(this.indexActive+1)),this.widgetEl.classList.add("s"+10*(e+1))),this.props.tooltip){var s,n=e<0?this.props.tooltip:null===(s=this.values[e])||void 0===s?void 0:s.text;this.widgetEl.setAttribute("aria-label",n)}this.indexActive=e}this.ticking=!1}},{key:"destroy",value:function(){this.indexActive=null,this.indexSelected=this.selected();var e=this.el.parentNode;e.classList.contains(this.props.classNames.base)&&(this.props.prebuilt?(this.widgetEl=e.querySelector("."+this.props.classNames.base+"--stars"),e.classList.remove(this.props.classNames.base+"--"+this.direction),delete e.dataset.starRating):e.parentNode.replaceChild(this.el,e),this.handleEvents("remove")),delete this.el.widget}},{key:"eventListener",value:function(e,t,i,s){var n=this;i.forEach((function(i){return e[t+"EventListener"](i,n.events[i],s||!1)}))}},{key:"handleEvents",value:function(e){var t=this.el.closest("form");t&&"FORM"===t.tagName&&this.eventListener(t,e,["reset"]),this.eventListener(this.el,e,["change"]),"add"===e&&this.el.disabled||(this.eventListener(this.el,e,["keydown"]),this.eventListener(this.widgetEl,e,["mousedown","mouseleave","mousemove","touchend","touchmove"],!1))}},{key:"indexFromEvent",value:function(e){var t,i,s=(null===(t=e.touches)||void 0===t?void 0:t[0])||(null===(i=e.changedTouches)||void 0===i?void 0:i[0])||e,n=document.elementFromPoint(s.clientX,s.clientY);return n.parentNode===this.widgetEl?[].slice.call(n.parentNode.children).indexOf(n):this.indexActive}},{key:"onChange",value:function(){this.changeIndexTo(this.selected(),!0)}},{key:"onKeyDown",value:function(e){var t=e.key.slice(5);if(~["Left","Right"].indexOf(t)){e.preventDefault();var i="Left"===t?-1:1;"rtl"===this.direction&&(i*=-1);var s=this.values.length-1,n=Math.min(Math.max(this.selected()+i,-1),s);this.selectValue(n,!0)}}},{key:"onPointerDown",value:function(e){e.preventDefault();var t=this.indexFromEvent(e);this.props.clearable&&t===this.indexSelected&&(t=-1),this.selectValue(t,!0)}},{key:"onPointerLeave",value:function(e){var t=this;e.preventDefault(),cancelAnimationFrame(this.tick),requestAnimationFrame((function(){return t.changeIndexTo(t.indexSelected)}))}},{key:"onPointerMove",value:function(e){var t=this;e.preventDefault(),this.ticking||(this.tick=requestAnimationFrame((function(){return t.changeIndexTo(t.indexFromEvent(e))})),this.ticking=!0)}},{key:"onReset",value:function(){var e,t=this.valueIndex(null===(e=this.el.querySelector("[selected]"))||void 0===e?void 0:e.value);this.selectValue(t||-1,!1)}},{key:"selected",value:function(){return this.valueIndex(this.el.value)}},{key:"selectValue",value:function(e,t){var i;this.el.value=(null===(i=this.values[e])||void 0===i?void 0:i.value)||"",this.indexSelected=this.selected(),!1===t?this.changeIndexTo(this.selected(),!0):this.el.dispatchEvent(new Event("change"))}},{key:"valueIndex",value:function(e){return this.values.findIndex((function(t){return t.value===+e}))}}]),e}(),D=function(){function e(t,i){G(this,e),this.destroy=this.destroy.bind(this),this.props=i,this.rebuild=this.rebuild.bind(this),this.selector=t,this.widgets=[],this.build()}return N(e,[{key:"build",value:function(){var e=this;this.queryElements(this.selector).forEach((function(t){var i=q(O,e.props,JSON.parse(t.getAttribute("data-options")));"SELECT"!==t.tagName||t.widget||(!i.prebuilt&&t.parentNode.classList.contains(i.classNames.base)&&e.unwrap(t),e.widgets.push(new H(t,i)))}))}},{key:"destroy",value:function(){this.widgets.forEach((function(e){return e.destroy()})),this.widgets=[]}},{key:"queryElements",value:function(e){return"HTMLSelectElement"===j(e)?[e]:"NodeList"===j(e)?[].slice.call(e):"String"===j(e)?[].slice.call(document.querySelectorAll(e)):[]}},{key:"rebuild",value:function(){this.destroy(),this.build()}},{key:"unwrap",value:function(e){var t=e.parentNode,i=t.parentNode;i.insertBefore(e,t),i.removeChild(t)}}]),e}();const V={classNames:{base:"glsr-star-rating"},clearable:!1,tooltip:!1};const I=["required","max","maxlength","min","minlength","pattern"],W=e=>{const t=e.getAttribute("name");return e.validation.form.querySelectorAll(`input[name="${t}"]:checked`).length},$={email:{fn:function(e){return!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}},max:{fn:function(e,t){return!e||("checkbox"===this.type?W(this)<=parseInt(t):parseFloat(e)<=parseFloat(t))}},maxlength:{fn:function(e,t){return!e||e.length<=parseInt(t)}},min:{fn:function(e,t){return!e||("checkbox"===this.type?W(this)>=parseInt(t):parseFloat(e)>=parseFloat(t))}},minlength:{fn:function(e,t){return!e||e.length>=parseInt(t)}},number:{fn:function(e){return!e||!isNaN(parseFloat(e))},priority:2},pattern:{fn:function(e,t){let i=t.match(new RegExp("^/(.*?)/([gimy]*)$"));return!e||new RegExp(i[1],i[2]).test(e)}},required:{fn:function(e){return~["checkbox","radio"].indexOf(this.type)?W(this):null!=e&&String(e).replace(/\s/g,"").length>0},priority:99,halt:!0},tel:{fn:function(e){let t=e.replace(/[^0-9]/g,"").length;return!e||4<=t&&15>=t&&new RegExp("^[+]?[\\d\\s()-]*$").test(e)}},url:{fn:function(e){return!e||new RegExp("^(https?)://([\\p{L}\\p{N}\\p{S}\\-_.])+(.?([\\p{L}\\p{N}]|xn--[\\p{L}\\p{N}\\-]+)+.?)(:[0-9]+)?(?:/(?:[\\p{L}\\p{N}\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*(?:\\?(?:[\\p{L}\\p{N}\\-._~!$&'\\[\\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[\\p{L}\\p{N}\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$","iu").test(e)}}};class B{constructor(e){this.config=GLSR.validationconfig,this.event=this._onChange.bind(this),this.fields=[],this.form=e,this.form.setAttribute("novalidate",""),this.strings=GLSR.validationstrings}destroy(){for(;this.fields.length;)this.destroyField(this.fields[0])}destroyField(e){this.resetField(e),this._eventListener("remove",e.input),delete e.input.validation,this.fields=this.fields.filter((t=>t.input!==e.input))}init(){this.form.querySelectorAll("input:not([type=hidden]):not([type=submit]), select, textarea, [data-glsr-validate]").forEach((e=>this.initField(e)))}initField(e){if(this.fields.find((t=>t.input.name===e.name&&"radio"!==e.type&&!e.name.endsWith("[]"))))return;const t=e.closest(L(this.config.field));null!=t&&t.offsetParent&&this.fields.push(this._initField(e))}reset(){this.fields.forEach((e=>this.resetField(e)))}resetField(e){let t=e.input.closest(L(this.config.field));E(e.input,this.config.input_error,!1),E(e.input,this.config.input_valid,!1),t&&(E(t,this.config.field_error,!1),E(t,this.config.field_valid,!1)),e.errors=[]}setErrors(e,t){e.hasOwnProperty("validation")||this._initField(e),e.validation.errors=t}setInvalid(e){this.toggleError(e,!0)}setValid(e){this.toggleError(e,!1)}toggleError(e,t){let i=e.input.closest(L(this.config.field)),s=[e.input];if(void 0!==e.input.form&&(s=e.input.form.querySelectorAll(`[name="${e.input.name}"]`)),s.forEach((e=>{E(e,this.config.input_error,t),E(e,this.config.input_valid,!t)})),i){E(i,this.config.field_error,t),E(i,this.config.field_valid,!t);let s=i.querySelector(L(this.config.field_message));s&&(s.innerHTML=t?e.errors.join("
"):"",s.style.display=t?"":"none")}}validate(e){let t=!0,i=this.fields;return e instanceof HTMLElement&&e.hasOwnProperty("validation")&&(i=[e.validation]),i.forEach((e=>{this._validateField(e)?this.toggleError(e,!1):(this.toggleError(e,!0),t=!1)})),t}_addValidators(e,t,i){[].forEach.call(e,(e=>{let s=e.name.replace("data-","");~I.indexOf(s)?this._addValidatorToField(t,i,s,e.value):"type"===e.name&&this._addValidatorToField(t,i,e.value)}))}_addValidatorToField(e,t,i,s){if($.hasOwnProperty(i)&&($[i].name=i,e.push($[i]),s)){let e="pattern"===i?[s]:s.split(",");e.unshift(null),t[i]=e}}_eventListener(e,t){const i=t.getAttribute("type")||t.nodeName,s=~["radio","checkbox","SELECT"].indexOf(i)?"change":"input";t[e+"EventListener"](s,this.event)}_onChange(e){this.validate(e.currentTarget)}_initField(e){let t={},i=[];return null!==e.offsetParent&&(this._addValidators(e.attributes,i,t),this._sortValidators(i),this._eventListener("add",e)),e.validation={form:this.form,input:e,params:t,validate:()=>this.validate(e),validators:i}}_sortValidators(e){e.sort(((e,t)=>(t.priority||1)-(e.priority||1)))}_validateField(e){let t=[],i=!0;for(let s in e.validators){if(!e.validators.hasOwnProperty(s))continue;let n=e.validators[s],r=e.params[n.name]?e.params[n.name]:[];if(r[0]=e.input.value,!n.fn.apply(e.input,r)){i=!1;let e=this.strings[n.name];if(t.push(e.replace(/(\%s)/g,r[1])),!0===n.halt)break}}return e.errors=t,i}}class Y{constructor(e,t){var i,s;this.button=y(t),this.config=GLSR.validationconfig,this.events={reset:this._onReset.bind(this),submit:this._onSubmit.bind(this)},this.form=e,this.isActive=!1,this.stars=(()=>{let e=null;const t=()=>!!e&&(e.rebuild(),!0);return{init:function(i){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t()||(e=new D(i,Object.assign({},V,s))),e},destroy:()=>!!e&&(e.destroy(),!0),rebuild:t}})(),this.strings=GLSR.validationstrings,this.captcha=new b(this),this.conditions=new F(this),this.validation=new B(e),this.reviewsEl=document.getElementById(null===(i=e.closest(".glsr"))||void 0===i||null===(s=i.dataset)||void 0===s?void 0:s.reviews_id)}destroy(){this._destroyForm(),this.stars.destroy(),this.captcha.reset(),this.isActive=!1}init(){this.isActive||(this._initForm(),this.stars.init(this.form.querySelectorAll(".glsr-field-rating select"),GLSR.starsconfig),this.captcha.render(),this.isActive=!0)}submitForm(){this.button.loading(),GLSR.ajax.post(this._data(),this._handleResponse.bind(this))}_data(){const e=new FormData(this.form);if(this.reviewsEl&&this.reviewsEl.classList.contains("glsr"))try{const t=JSON.parse(JSON.stringify(this.reviewsEl.dataset));for(let i of Object.keys(t)){let s;try{s=JSON.parse(t[i])}catch(e){s=t[i]}e.append(`${GLSR.nameprefix}[_reviews_atts][${i}]`,s)}e.append([`${GLSR.nameprefix}[_pagination_atts][page]`],1),e.append([`${GLSR.nameprefix}[_pagination_atts][url]`],location.href)}catch(e){console.error(e)}return e}_destroyForm(){this.form.removeEventListener("reset",this.events.reset),this.form.removeEventListener("submit",this.events.submit),this._resetErrors(),this.conditions.destroy(),this.validation.destroy()}_handleResponse(e,t){const i=!0===t&&void 0!==e;if(this.captcha.reset(),i&&this.form.reset(),this._showFieldErrors(null==e?void 0:e.errors),this._showResults(null==e?void 0:e.message,i),this.button.loaded(),GLSR.Event.trigger("site-reviews/form/handle",e,this.form),i){if(e.redirect&&""!==e.redirect)return void(window.location=e.redirect);if(this.reviewsEl&&e.reviews){if(this.reviewsEl.innerHTML=e.reviews,GLSR.urlparameter){let e=new URL(location.href);e.searchParams.delete(GLSR.urlparameter),window.history.replaceState({},"",e.toString())}GLSR.Event.trigger("site-reviews/pagination/init")}}}_initForm(){this._destroyForm(),this.form.addEventListener("reset",this.events.reset),this.form.addEventListener("submit",this.events.submit),this.conditions.init(),this.validation.init()}_onReset(e){this.conditions.destroy(),this.conditions.init()}_onSubmit(e){if(!this.validation.validate())return e.preventDefault(),void this._showResults(this.strings.errors,!1);e.preventDefault(),this._resetErrors(),this.button.loading(),this.captcha.execute()}_resetErrors(){E(this.form,this.config.form_error,!1),this._showResults("",null),this.validation.reset()}_showFieldErrors(e){if(e)for(let t in e){if(!e.hasOwnProperty(t))continue;const i=GLSR.nameprefix?GLSR.nameprefix+"["+t+"]":t,s=this.form.querySelector('[name="'+i+'"]');s&&(this.validation.setErrors(s,e[t]),this.validation.toggleError(s.validation,"add"))}}_showResults(e,t){if(!e)return;const i=this.form.querySelector(L(this.config.form_message));null!==i&&(E(this.form,this.config.form_error,!1===t),E(i,this.config.form_message_failed,!1===t),E(i,this.config.form_message_success,!0===t),i.innerHTML=e)}}var J=function(){return"undefined"==typeof window},K=function(e){e=e||navigator.userAgent;var t=/(iPad).*OS\s([\d_]+)/.test(e);return{ios:!t&&/(iPhone\sOS)\s([\d_]+)/.test(e)||t,android:/(Android);?[\s/]+([\d.]+)?/.test(e)}};function X(e){if(J())return!1;if(!e)throw new Error("options must be provided");var t=!1,i={get passive(){t=!0}},s=function(){},n="__TUA_BSL_TEST_PASSIVE__";window.addEventListener(n,s,i),window.removeEventListener(n,s,i);var r=e.capture;return t?e:void 0!==r&&r}function U(e){return!e&&(null!==e&&("production"!==process.env.NODE_ENV&&("test"!==process.env.NODE_ENV&&console.warn("If scrolling is also required in the floating layer, the target element must be provided."),!0)))}function z(){return"__BSL_PREVENT_DEFAULT__"in window||(window.__BSL_PREVENT_DEFAULT__=function(e){e.cancelable&&e.preventDefault()}),window.__BSL_PREVENT_DEFAULT__}function Q(e){return e?Array.isArray(e)?e:[e]:[]}var Z={lockedNum:0,lockedElements:[],unLockCallback:null,documentListenerAdded:!1,initialClientPos:{clientX:0,clientY:0}};function ee(e){if(J())return Z;if(!(null==e?void 0:e.useGlobalLockState))return ee.lockState;var t="__BSL_LOCK_STATE__"in window?Object.assign(Object.assign({},Z),window.__BSL_LOCK_STATE__):Z;return window.__BSL_LOCK_STATE__=t,t}function te(e,t){if(!J()){U(e);var i,s,n,r,o,a=K(),l=ee(t);a.ios?(Q(e).filter((function(e){return-1===l.lockedElements.indexOf(e)})).forEach((function(e){e.ontouchstart=function(e){var t=e.targetTouches[0],i=t.clientX,s=t.clientY;l.initialClientPos={clientX:i,clientY:s}},e.ontouchmove=function(t){!function(e,t,i){if(t){var s=t.scrollTop,n=t.scrollLeft,r=t.scrollWidth,o=t.scrollHeight,a=t.clientWidth,l=t.clientHeight,c=e.targetTouches[0].clientX-i.clientX,d=e.targetTouches[0].clientY-i.clientY,h=Math.abs(d)>Math.abs(c);if(h&&(d>0&&0===s||d<0&&s+l+1>=o)||!h&&(c>0&&0===n||c<0&&n+a+1>=r))return z()(e)}e.stopPropagation()}(t,e,l.initialClientPos)},l.lockedElements.push(e)})),function(e){if(!K().ios)return;if(e.documentListenerAdded)return;document.addEventListener("touchmove",z(),X({passive:!1})),e.documentListenerAdded=!0}(l)):l.lockedNum<=0&&(l.unLockCallback=a.android?(i=document.documentElement,s=document.body,n=i.scrollTop||s.scrollTop,r=Object.assign({},i.style),o=Object.assign({},s.style),i.style.height="100%",i.style.overflow="hidden",s.style.top="-".concat(n,"px"),s.style.width="100%",s.style.height="auto",s.style.position="fixed",s.style.overflow="hidden",function(){i.style.height=r.height||"",i.style.overflow=r.overflow||"",["top","width","height","overflow","position"].forEach((function(e){s.style[e]=o[e]||""})),"scrollBehavior"in document.documentElement.style?window.scrollTo({top:n,behavior:"instant"}):window.scrollTo(0,n)}):function(){var e=document.documentElement,t=Object.assign({},e.style),i=window.innerWidth-e.clientWidth,s=parseInt(window.getComputedStyle(e).paddingRight,10);return e.style.overflow="hidden",e.style.boxSizing="border-box",e.style.paddingRight="".concat(i+s,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(i){e.style[i]=t[i]||""}))}}()),l.lockedNum+=1}}function ie(e,t){if(!J()){U(e);var i=ee(t);i.lockedNum-=1,i.lockedNum>0||function(e){return!K().ios&&("function"==typeof e.unLockCallback&&(e.unLockCallback(),!0))}(i)||(Q(e).forEach((function(e){var t=i.lockedElements.indexOf(e);-1!==t&&(e.ontouchmove=null,e.ontouchstart=null,i.lockedElements.splice(t,1))})),function(e){if(!e.documentListenerAdded)return;document.removeEventListener("touchmove",z(),X({passive:!1})),e.documentListenerAdded=!1}(i))}}ee.lockState=Z;const se=["[contenteditable]",'[tabindex]:not([tabindex^="-"])',"a[href]","button:not([disabled]):not([aria-hidden])",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])"],ne={focus:!1,onClose:()=>{},onOpen:()=>{}},re="data-glsr-close",oe="glsr-modal",ae="is-open",le="data-glsr-trigger",ce=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.class=oe+"__"+e,t};class de{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.events={_open:this._openModal.bind(this),mouseup:this._onClick.bind(this),keydown:this._onKeydown.bind(this),touchstart:this._onClick.bind(this)},this.id=e,this.triggers=[],this._config(t),this._reset()}header(e,t){return this._insertHtml(this.dom.header,e,t)}content(e,t){return this._insertHtml(this.dom.content,e,t)}footer(e,t){return this._insertHtml(this.dom.footer,e,t)}_closeModal(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(e.preventDefault(),e.stopPropagation());const t=()=>{this.root.removeEventListener("animationend",t,!1),this.root.classList.remove(ae),he.open.pop(),this.config.onClose(this,e),GLSR.Event.trigger("site-reviews/modal/close",this,e),S((()=>this._reset()))()};this.root.addEventListener("animationend",t,!1),this.root.setAttribute("aria-hidden","true"),this._eventHandler("remove"),ie(this.dom.content),this.trigger&&this.trigger.focus&&this.trigger.focus()}_config(e){return this.config=Object.assign({},ne,e),this}_eventHandler(e){this._eventListener(this.dom.close,e,["keydown"]),this._eventListener(this.root,e,["mouseup","touchstart"]),this._eventListener(document,e,["keydown"])}_eventListener(e,t,i){e&&i.forEach((i=>e[t+"EventListener"](i,this.events[i])))}_focusableNodes(){return[].slice.call(this.root.querySelectorAll(se))}_insertHtml(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e&&null!==t){if(""!==t){const e=v("div",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});e.innerHTML=t,t=e.outerHTML}e.innerHTML=t}return e}_insertModal(){var e;const t=v("button",ce("close",{"aria-label":GLSR.text.closemodal,"data-glsr-close":""})),i=v("div",ce("content",{tabindex:-1})),s=v("div",ce("header")),n=v("div",ce("footer")),r=v("div",ce("dialog",{"aria-modal":!0,role:"dialog"}),t,s,i,n),o=v("div",{class:oe,id:this.id,"aria-hidden":!0},v("div",ce("overlay",{tabindex:-1,"data-glsr-close":""}),r));this.dom={...this.dom,close:t,content:i,dialog:r,footer:n,header:s};const a=null!==(e=document.querySelector("body > #page.site"))&&void 0!==e?e:document.body;this.root=a.appendChild(o)}_onClick(e){e.target.hasAttribute(re)&&this._closeModal(e)}_onKeydown(e){~[13,32].indexOf(e.keyCode)&&e.target===this.dom.close&&this._closeModal(e),27===e.keyCode&&he.open.slice(-1)[0]===this.id&&this._closeModal(e),9===e.keyCode&&this._retainFocus(e)}_openModal(e){he.open.push(this.id),this.trigger=document.activeElement,e&&(e.preventDefault(),this.trigger=e.currentTarget),this._insertModal(),te(this.dom.content),this.config.onOpen(this,e),GLSR.Event.trigger("site-reviews/modal/open",this,e),this.root.setAttribute("aria-hidden","false"),this.root.classList.add(ae),this._eventHandler("add");const t=()=>{this.root.removeEventListener("animationend",t,!1),this._setFocusToFirstNode()};this.root.addEventListener("animationend",t,!1)}_registerTrigger(e){this._removeTrigger(e),e.addEventListener("click",this.events._open),this.triggers.push(e)}_removeTrigger(e){this.triggers.filter((t=>t!==e)),e.removeEventListener("click",this.events._open)}_removeTriggers(){this.triggers.forEach((e=>this._removeTrigger(e))),this.triggers=[]}_reset(){this.dom={close:null,content:null,footer:null,header:null},this.root&&this.root.remove(),this.root=null,this.trigger=null}_retainFocus(e){let t=this._focusableNodes();if(0!==t.length)if(t=t.filter((e=>null!==e.offsetParent)),this.root.contains(document.activeElement)){const i=t.indexOf(document.activeElement);e.shiftKey&&0===i?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&t.length>0&&i===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}_setFocusToFirstNode(){if(!this.config.focus)return;const e=this._focusableNodes();if(0===e.length)return;const t=e.filter((e=>!e.hasAttribute(re)));t.length>0?t[0].focus():0===t.length&&e[0].focus()}}const he={active:{},open:[]};var ue={close:e=>{if(e)he.active[e]&&he.active[e]._closeModal();else for(let e in he.active)he.active[e]._closeModal()},init:(e,t)=>{let i;return he.active[e]?(i=he.active[e],i._removeTriggers(),t&&i._config(t)):i=new de(e,t),document.querySelectorAll("["+le+"]").forEach((t=>{e===t.attributes[le].value&&i._registerTrigger(t)})),he.active[e]=i,he.active},modals:he,modify:(e,t)=>{e&&he.active[e]&&t(he.active[e])},open:(e,t)=>{let i;he.active[e]?(i=he.active[e],i.root&&i._eventHandler("remove"),t&&i._config(t)):i=new de(e,t),he.active[e]=i,i._openModal()}};const pe="glsr-hide",fe=16,ve=468,ge="button.glsr-button-loadmore",me=".glsr-pagination a[data-page]",_e=".glsr-reviews, [data-reviews]";class we{constructor(e,t){this.events={button:{click:this._onLoadMore.bind(this)},link:{click:this._onPaginate.bind(this)},window:{popstate:this._onPopstate.bind(this)}},this.paginationEl=t,this.reviewsEl=e.querySelector(_e),this.wrapperEl=e}destroy(){this._eventHandler("remove")}init(){this._eventHandler("add");const e=this.paginationEl.querySelector(".current");if(e){const t=this._data(e),i=e.nextElementSibling;t&&i&&2==+i.dataset.page&&GLSR.urlparameter&&window.history.replaceState(t,"",window.location)}}_data(e){try{const i=JSON.parse(JSON.stringify(this.paginationEl.dataset)),s={page:e.dataset.page||1,schema:!1,url:e.href||location.href};for(var t of Object.keys(i)){let e;try{e=JSON.parse(i[t])}catch(s){e=i[t]}s[`atts][${t}`]=e}return GLSR.ajax.data("fetch-paged-reviews",s)}catch(e){return console.error("Invalid pagination config."),!1}}_eventHandler(e){this._eventListener(window,e,this.events.window),this.wrapperEl.querySelectorAll(ge).forEach((t=>{this._eventListener(t,e,this.events.button)})),this.wrapperEl.querySelectorAll(me).forEach((t=>{this._eventListener(t,e,this.events.link)}))}_eventListener(e,t,i){Object.keys(i).forEach((s=>e[t+"EventListener"](s,i[s])))}_handleLoadMore(e,t,i,s){s?(e.loaded(),this.destroy(),this.paginationEl.innerHTML=i.pagination,this.reviewsEl.insertAdjacentHTML("beforeend",i.reviews),this.init(),GLSR.Event.trigger("site-reviews/pagination/handle",i,this)):window.location=location}_handlePagination(e,t,i,s){s?(this._paginate(i),GLSR.urlparameter&&window.history.pushState(t,"",e.href)):window.location=e.href}_handlePopstate(e,t,i){i?this._paginate(t):console.error(t)}_loaded(){const e=this.paginationEl.querySelector(".glsr-spinner");e&&this.paginationEl.removeChild(e),this.wrapperEl.classList.remove(pe)}_loading(){this.wrapperEl.classList.add(pe),this.paginationEl.insertAdjacentHTML("beforeend",'
')}_onLoadMore(e){const t=e.currentTarget,i=this._data(t);if(i){const s=y(t);s.loading(),e.preventDefault(),GLSR.ajax.post(i,this._handleLoadMore.bind(this,s,i))}}_onPaginate(e){const t=e.currentTarget,i=this._data(t);i&&(this._loading(),e.preventDefault(),GLSR.ajax.post(i,this._handlePagination.bind(this,t,i)))}_onPopstate(e){GLSR.Event.trigger("site-reviews/pagination/popstate",e,this),e.state&&e.state[`${GLSR.nameprefix}[_action]`]&&(this._loading(),GLSR.ajax.post(e.state,this._handlePopstate.bind(this,e.state)))}_paginate(e){this.destroy(),this.paginationEl.innerHTML=e.pagination,this.reviewsEl.innerHTML=e.reviews,this.init(),this._scrollToTop(),this._loaded(),GLSR.Event.trigger("site-reviews/pagination/handle",e,this)}_scrollStep(e){const t=Math.min(1,(window.performance.now()-e.startTime)/ve),i=.5*(1-Math.cos(Math.PI*t)),s=e.startY+(e.endY-e.startY)*i;window.scroll(0,e.offset+s),s!==e.endY&&window.requestAnimationFrame(this._scrollStep.bind(this,e))}_scrollToTop(){let e=fe;[].forEach.call(GLSR.ajaxpagination,(t=>{const i=document.querySelector(t);i&&"fixed"===window.getComputedStyle(i).getPropertyValue("position")&&(e+=i.clientHeight)}));const t=this.reviewsEl.getBoundingClientRect().top-e;t>0||this._scrollStep({endY:t,offset:window.pageYOffset,startTime:window.performance.now(),startY:this.reviewsEl.scrollTop})}}const ye="site-reviews/excerpts/init",be="site-reviews/forms/init",Ee="site-reviews/init",Le="site-reviews/loaded",Se="site-reviews/modal/init",xe="site-reviews/pagination/init";window.hasOwnProperty("GLSR")||(window.GLSR={}),window.GLSR.ajax=o,window.GLSR.forms=[],window.GLSR.pagination=[],window.GLSR.Event=d,window.GLSR.Modal=ue,window.GLSR.Utils={debounce:S,dom:v,isEmpty:e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length,parseJson:x},d.on(ye,(e=>{new w(e),d.trigger(Se)})),d.on(be,(()=>{GLSR.forms=GLSR.forms.filter((e=>!!e.form.closest("body"))),document.querySelectorAll("form.glsr-review-form").forEach((e=>{const t=e.querySelector("[type=submit]");if(t){let i,s=GLSR.forms.findIndex((t=>t.form===e));-1!==s?(i=GLSR.forms[s],i.destroy()):(i=new Y(e,t),GLSR.forms.push(i)),i.init()}}))})),d.on(Se,(()=>{GLSR.Modal.init("glsr-modal-review",{onOpen:e=>{const t=e.trigger.closest(".glsr").cloneNode(!0),i=e.trigger.closest(".glsr-review").cloneNode(!0);i.querySelectorAll('[data-expanded="false"]').forEach((e=>{e.dataset.expanded="true"})),i.removeAttribute("id"),t.innerHTML="",t.appendChild(i),e.dom.content.appendChild(t)}})})),d.on(xe,(()=>{GLSR.pagination.forEach((e=>e.destroy())),GLSR.pagination=[],document.querySelectorAll(".glsr").forEach((e=>{const t=e.querySelector(".glsr-pagination");if(t&&(t.classList.contains("glsr-ajax-loadmore")||t.classList.contains("glsr-ajax-pagination"))){const i=new we(e,t);i.init(),GLSR.pagination.push(i)}}))})),d.on(Ee,(()=>{document.querySelectorAll(".glsr").forEach((e=>{const t="glsr-"+window.getComputedStyle(e,null).getPropertyValue("direction");e.classList.add(t)})),d.trigger(ye),d.trigger(be),d.trigger(xe),d.trigger(Le)})),d.on("site-reviews/pagination/handle",((e,t)=>{d.trigger(ye,t.wrapperEl)})),document.addEventListener("DOMContentLoaded",(()=>{setTimeout((()=>d.trigger(Ee)),5),setTimeout((()=>(()=>{let e=new URL(location.href);if(!e.searchParams.has("review_id")||!e.searchParams.has("verified"))return;let t=["form","review_id","theme","verified"],i={};t.forEach((t=>{e.searchParams.has(t)&&(i[t]=e.searchParams.get(t))})),GLSR.ajax.post(GLSR.ajax.data("verified-review",i),((s,n)=>{n?GLSR.Modal.open("glsr-modal-verified",{onClose:i=>{t.forEach((t=>e.searchParams.delete(t))),history.pushState({},"",e.href)},onOpen:e=>{const t=v("p",{style:"margin:0;padding:0;"});t.innerHTML=s.message,e.footer(t.outerHTML),e.content(s.review,s.attributes),e.dom.content.querySelectorAll('[data-expanded="false"]').forEach((e=>{e.dataset.expanded="true"}))}}):console.error({request:i,response:s})}))})()),10)}))}(); +!function(){"use strict";let e;const t=function(e){return"json"===this.responseType||!0===this.json?e({message:this.statusText},!1):"text"===this.responseType?e(this.statusText):void console.error(this)},i=function(e){if(0===this.status||this.status>=200&&this.status<300||304===this.status){if("json"===this.responseType)return e(this.response.data,this.response.success);if("text"===this.responseType)return e(this.responseText);if(!0===this.json){const t=JSON.parse(this.response);return e(t.data,t.success)}}else t.bind(this,e)},s=e=>{let t=new FormData;const i=Object.prototype.toString.call(e);return"[object FormData]"===i&&(t=e),"[object HTMLFormElement]"===i&&(t=new FormData(e)),"[object Object]"===i&&Object.keys(e).forEach((i=>t.append(i,e[i]))),t.append("action",GLSR.action),t.append("_ajax_request",!0),t},n=s=>{e=new XMLHttpRequest,e.addEventListener("load",i.bind(e,s)),e.addEventListener("error",t.bind(e,s))},r=t=>{(t=t||{})["X-Requested-With"]="XMLHttpRequest";for(let i in t)t.hasOwnProperty(i)&&e.setRequestHeader(i,t[i])};var o={data:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={};t._action=e;for(let e of Object.keys(t))i[`${GLSR.nameprefix}[${e}]`]=t[e];return i},get:(t,i,s)=>{n(i),e.open("GET",t,!0),e.responseType="text",r(s),e.send()},post:(t,i,o)=>{n(i),e.open("POST",GLSR.ajaxurl,!0),e.responseType="json",e.json=!0,r(o),e.send(s(t))}};const a={},l=function(e,t){const i=a[e]||[],s=[];t&&[].forEach.call(i,(e=>{t!==e.fn&&t!==e.fn.once&&s.push(e)})),s.length?a[e]=s:delete a[e]},c=function(e,t,i){(a[e]||(a[e]=[])).push({fn:t,context:i})};var d={events:a,off:l,on:c,once:function(e,t,i){const s=function(){l(e,s),t.apply(i,arguments)};s.once=t,c(e,s,i)},trigger:function(e){const t=[].slice.call(arguments,1),i=(a[e]||[]).slice();[].forEach.call(i,(e=>e.fn.apply(e.context,t)))}};const h="function",u="isNode",p=(e,t)=>typeof e===t,f=(e,t)=>{null!==t&&(Array.isArray(t)?t.map((t=>f(e,t))):(v[u](t)||(t=document.createTextNode(t)),e.appendChild(t)))};function v(e,t){let i,s,n=arguments,r=1;if(!v.isElement(e)){let t=~["svg","line","path","rect","mask","radialGradient","stop"].indexOf(e)?"2000/svg":"1999/xhtml";e=document.createElementNS(`http://www.w3.org/${t}`,e)}if("string"==typeof t&&(t={class:t}),p(t,"object")&&!v[u](t)&&!Array.isArray(t))for(i in r++,t)s=t[i],i=v.attrMap[i]||i,p(i,h)?i(e,s):p(s,h)?e[i]=s:e.setAttribute(i,s);for(;re instanceof Element,v[u]=e=>e instanceof Node;const g="glsr-read-more",m=".glsr-hidden-text",w=".glsr-tag-value";class _{constructor(e){this.events={click:this._onClick.bind(this)},(e||document).querySelectorAll(m).forEach((e=>this.init(e)))}init(e){const t=this._insertLink(e);t&&("expand"===e.dataset.trigger&&(t.dataset.text=e.dataset.showLess,t.removeEventListener("click",this.events.click),t.addEventListener("click",this.events.click)),"modal"===e.dataset.trigger&&(t.dataset.glsrTrigger="glsr-modal-review"))}_insertLink(e){let t=e.parentElement.querySelector("."+g);t&&t.parentElement.removeChild(t);const i=v("a",{href:"#"},e.dataset.showMore),s=v("span",{class:g},i);return e.appendChild(s).querySelector("a")}_onClick(e){e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=t.closest(w),n=s.querySelector(m),r=t.dataset.text,o=t.innerText;t.dataset.text=o,t.innerText=r,t.removeEventListener("click",this.events.click),"false"===s.dataset.expanded?(s.querySelector("p:last-of-type").appendChild(i),s.dataset.expanded="true"):(n.appendChild(i),s.dataset.expanded="false"),t.addEventListener("click",this.events.click),"false"===s.dataset.expanded&&t.focus()}}var y=e=>({el:e,loading:()=>{"false"===e.getAttribute("aria-busy")&&(e.setAttribute("aria-busy",!0),e.setAttribute("disabled",""),e.dataset.text=e.innerText,e.innerHTML=''+(e.dataset.loading||e.dataset.text))},loaded:()=>{"true"===e.getAttribute("aria-busy")&&(e.innerHTML=e.dataset.text,e.setAttribute("aria-busy",!1),e.removeAttribute("data-text"),e.removeAttribute("disabled"))}});class b{constructor(e){this.Form=e,this.captcha={friendlycaptcha:"friendlyChallenge",hcaptcha:"hcaptcha",procaptcha:"procaptcha",recaptcha_v2_invisible:"grecaptcha",recaptcha_v3:"grecaptcha",turnstile:"turnstile"}[GLSR.captcha.type],this.captchaEl=!1,this.containerEl=this.Form.form.querySelector(".glsr-captcha-holder"),this.loaded=!1,this.token=null,this.widget=-1,this.fixCompatibility()}execute(){if(this.captchaEl&&this.isWidgetLoaded())try{this["execute_"+GLSR.captcha.type]()}catch(e){console.error(e),this.Form.submitForm()}else this.Form.submitForm()}execute_friendlycaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.token?this.Form.submitForm():setTimeout((()=>this.execute_friendlycaptcha()),100)}execute_hcaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.token?this._submitFormWithToken(this.token):window[this.captcha].execute(this.widget,{action:"submit_review",async:!0}).then((e=>{let{response:t}=e;this._submitFormWithToken(t)})).catch((e=>{console.error(e)}))}execute_procaptcha(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):this.Form.submitForm()}execute_recaptcha_v2_invisible(){this.execute_recaptcha_v3()}execute_recaptcha_v3(){1==+this.captchaEl.dataset.error?this._submitFormWithToken("sitekey_invalid"):window[this.captcha].execute(this.widget,{action:"submit_review"})}execute_turnstile(){let e=window[this.captcha].getResponse(this.widget);1==+this.captchaEl.dataset.error||this.token||void 0===e?this.Form.submitForm():setTimeout((()=>this.execute_turnstile()),100)}fixCompatibility(){"hcaptcha"===GLSR.captcha.type&&void 0!==window.hCaptchaOnLoad&&document.body.click()}isLoaded(e){for(let t=0;t{if(void 0===e||this.isLoaded(e))i();else{const n=document.createElement("script");n.onload=i,n.onerror=s,n.src=e,n.type="module"===t?"module":"text/javascript","module"!==t&&void 0!==GLSR.captcha.urls.module&&n.setAttribute("nomodule",""),n.setAttribute("async",""),n.setAttribute("defer",""),document.head.append(n)}}))}render(){if(this.Form.form.onsubmit=null,this.containerEl&&!this.isWidgetLoaded())if(void 0===window[this.captcha])this.loaded?setTimeout((()=>this.render()),50):this.load(GLSR.captcha.urls.module,"module").then((()=>{this.load(GLSR.captcha.urls.nomodule,"nomodule")})).then((()=>this.loaded=!0)).then((()=>setTimeout((()=>this.render()),100))).catch((e=>console.error(e)));else{this.reset(),this._buildContainer();try{this["render_"+GLSR.captcha.type]()}catch(e){this.captchaEl.dataset.error=1,console.error(e)}}}render_friendlycaptcha(){this.widget=new window[this.captcha].WidgetInstance(this.captchaEl,{doneCallback:e=>this.token=e,errorCallback:e=>{console.error(e),this.captchaEl.dataset.error=1}})}render_hcaptcha(){var e;void 0!==(null===(e=window[this.captcha])||void 0===e?void 0:e.render)?this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this.token=e,"chalexpired-callback":()=>this.reset(),"close-callback":()=>this.Form.button.loaded(),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset()}):setTimeout((()=>this.render_hcaptcha()),100)}render_procaptcha(){this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this.token=e,captchaType:GLSR.captcha.captcha_type,language:GLSR.captcha.language,siteKey:GLSR.captcha.sitekey,theme:GLSR.captcha.theme,"chalexpired-callback":()=>this.reset(),"close-callback":()=>this.Form.button.loaded(),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset()})||1}render_recaptcha_v2_invisible(){this.render_recaptcha_v3()}render_recaptcha_v3(){var e;void 0!==(null===(e=window[this.captcha])||void 0===e?void 0:e.render)?this.widget=window[this.captcha].render(this.captchaEl,{callback:e=>this._submitFormWithToken(e),"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset(),isolated:!0}):setTimeout((()=>this.render_recaptcha_v3()),100)}render_turnstile(){this.widget=window[this.captcha].render(this.captchaEl,{action:"submit_review",callback:e=>this.token=e,"error-callback":()=>this.captchaEl.dataset.error=1,"expired-callback":()=>this.reset(),sitekey:GLSR.captcha.sitekey,theme:GLSR.captcha.theme})}reset(){this.token=null,this.captchaEl&&(this.captchaEl.dataset.error=0),this.isWidgetLoaded()&&("friendlycaptcha"===GLSR.captcha.type?this.widget.reset():window[this.captcha].reset(this.widget))}_buildContainer(){"friendlycaptcha"===GLSR.captcha.type&&this.isWidgetLoaded()&&this.widget.destroy(),Array.from(this.containerEl.getElementsByClassName(GLSR.captcha.class)).forEach((e=>e.remove())),this.captchaEl=v("div",{class:GLSR.captcha.class,"data-badge":GLSR.captcha.badge,"data-captcha-type":GLSR.captcha.captcha_type,"data-lang":GLSR.captcha.language,"data-isolated":!0,"data-sitekey":GLSR.captcha.sitekey,"data-size":GLSR.captcha.size,"data-theme":GLSR.captcha.theme,"data-type":GLSR.captcha.type}),this.containerEl.appendChild(this.captchaEl)}_submitFormWithToken(e){["frc-captcha-solution","g-recaptcha-response","h-captcha-response"].forEach((t=>{this.Form.form[t]&&e&&(this.Form.form[t].value=e)})),this.Form.submitForm()}}const E=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{delay:0,direction:"normal",easing:"cubic-bezier(0.54,1.5,0.38,1.11)",endDelay:0,fill:"forwards",iterations:1};return new Promise((n=>{t.animate([{opacity:"in"===e?0:1},{opacity:"in"===e?1:0}],{duration:i,...s}).onfinish=()=>n()}))},L=(e,t,i)=>{e&&t.split(" ").forEach((t=>e.classList[i?"add":"remove"](t)))},S=e=>"."+e.trim().split(" ").join("."),x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,i=null;return function(){clearTimeout(i);for(var s=arguments.length,n=new Array(s),r=0;r{try{return[null,JSON.parse(e)]}catch(t){return[t,e]}},T={contains:(e,t)=>e.includes(t),equals:(e,t)=>{if(Array.isArray(e)){let i=t.split(/\s*(?:,|$)\s*/);return e.sort().toString()===i.sort().toString()}return F(t)?A(e)===+t:e===t},greater:(e,t)=>!!F(t)&&A(e)>+t,less:(e,t)=>!!F(t)&&A(e)<+t,not:(e,t)=>!T.equals(e,t)},R=e=>String(e.getAttribute("type")||e.nodeName).toLowerCase(),A=e=>isNaN(e)?e.length:+e,F=e=>!isNaN(parseInt(e));class G{constructor(e){this.config=GLSR.validationconfig,this.elements=Array.from(e.form.elements),this.event=this.onChange.bind(this),this.Form=e}init(){this.eventListeners("add"),this.elements.forEach((e=>e.conditions={criteria:"always",observes:[],triggers:[]})),this._setConditionObserves(),this._setConditionTriggers()}destroy(){this.eventListeners("remove"),this.elements.forEach((e=>delete e.conditions))}eventListeners(e){this.elements.forEach((t=>t[e+"EventListener"](this.eventName(t),this.event)))}eventName(e){return["radio","checkbox","select"].includes(R(e))?"change":"input"}onChange(e){e.currentTarget.conditions.triggers.forEach((e=>{let t=[];e.conditions.observes.forEach((e=>t.push(this.test(e)))),t=t.filter((e=>e));const i=t.length===e.conditions.observes.length,s=t.length&&"any"===e.conditions.criteria,n=e.closest(S(this.config.field));i||s?(n.classList.remove(this.config.field_hidden),this.Form.validation.initField(e)):(e.validation&&this.Form.validation.destroyField(e.validation),this.resetValue(e),n.classList.add(this.config.field_hidden))}))}resetValue(e){const t=R(e);if("select"===t)Array.from(e.options).forEach((e=>e.selected=e.defaultSelected));else if(["checkbox","radio"].includes(t)){let t=this.Form.form.elements[e.name];Array.from(t.length?t:[t]).forEach((e=>e.checked=e.defaultChecked))}else e.value=e.defaultValue||"";e.dispatchEvent(new Event(this.eventName(e)))}test(e){return!T.hasOwnProperty(e.operator)||T[e.operator](this.value(e.el),e.value)}value(e){const t=e.getAttribute("name"),i=R(e),s=this.Form.form.elements[t];return"radio"===i?s.value:["checkbox","select"].includes(i)?Array.from(s.length?s:[s]).filter((e=>e["checkbox"===i?"checked":"selected"])).map((e=>e.value)):new String(e.value)}_setConditionObserves(){this.elements.filter((e=>e.dataset.conditions)).forEach((e=>{var t;let[i,s]=k(e.dataset.conditions);null===i&&null!=s&&null!==(t=s.conditions)&&void 0!==t&&t.length&&(s.conditions.forEach((t=>{const i=this.elements.filter((e=>e.closest(`[data-field="${t.name}"]`))).shift();i&&e.conditions.observes.push({el:i,...t})})),e.conditions.observes.length&&(e.conditions.criteria=s.criteria))}))}_setConditionTriggers(){this.elements.forEach((e=>{this.elements.filter((e=>e.dataset.conditions)).forEach((t=>{t.conditions.observes.forEach((i=>{i.el.getAttribute("name")===e.getAttribute("name")&&e.conditions.triggers.push(t)}))}))}))}}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t,i){return t&&function(e,t){for(var i=0;i0&&t.push({index:e.index,text:e.text,value:i})})),t.sort((function(e,t){return e.value-t.value}))}(t),this.widgetEl=null,this.el.widget&&this.el.widget.destroy(),s=this.values.length,n=1,r=this.props.maxStars,/^\d+$/.test(s)&&n<=s&&s<=r?this.build():this.destroy()}return O(e,[{key:"build",value:function(){this.destroy(),this.buildWidget(),this.selectValue(this.indexSelected=this.selected(),!1),this.handleEvents("add"),this.el.widget=this}},{key:"buildWidget",value:function(){var e=this,t=null,i=null;this.props.prebuilt&&(t=this.el.parentNode,i=t.querySelector("."+this.props.classNames.base+"--stars")),null===i&&((t=q(this.el,!1,{class:this.props.classNames.base})).appendChild(this.el),i=q(this.el,!0,{class:this.props.classNames.base+"--stars"}),this.values.forEach((function(t,s){var n=P({"data-index":s,"data-value":t.value});"function"==typeof e.props.stars&&e.props.stars.call(e,n,t,s),[].forEach.call(n.children,(function(e){return e.style.pointerEvents="none"})),i.innerHTML+=n.outerHTML}))),t.dataset.starRating="",t.classList.add(this.props.classNames.base+"--"+this.direction),this.props.tooltip&&i.setAttribute("role","tooltip"),this.widgetEl=i}},{key:"changeIndexTo",value:function(e,t){var i=this;if(this.indexActive!==e||t){if([].forEach.call(this.widgetEl.children,(function(t,s){M(t,s<=e,i.props.classNames.active),M(t,s===i.indexSelected,i.props.classNames.selected)})),this.widgetEl.setAttribute("data-rating",e+1),"function"==typeof this.props.stars||this.props.prebuilt||(this.widgetEl.classList.remove("s"+10*(this.indexActive+1)),this.widgetEl.classList.add("s"+10*(e+1))),this.props.tooltip){var s,n=e<0?this.props.tooltip:null===(s=this.values[e])||void 0===s?void 0:s.text;this.widgetEl.setAttribute("aria-label",n)}this.indexActive=e}this.ticking=!1}},{key:"destroy",value:function(){this.indexActive=null,this.indexSelected=this.selected();var e=this.el.parentNode;e.classList.contains(this.props.classNames.base)&&(this.props.prebuilt?(this.widgetEl=e.querySelector("."+this.props.classNames.base+"--stars"),e.classList.remove(this.props.classNames.base+"--"+this.direction),delete e.dataset.starRating):e.parentNode.replaceChild(this.el,e),this.handleEvents("remove")),delete this.el.widget}},{key:"eventListener",value:function(e,t,i,s){var n=this;i.forEach((function(i){return e[t+"EventListener"](i,n.events[i],s||!1)}))}},{key:"handleEvents",value:function(e){var t=this.el.closest("form");t&&"FORM"===t.tagName&&this.eventListener(t,e,["reset"]),this.eventListener(this.el,e,["change"]),"add"===e&&this.el.disabled||(this.eventListener(this.el,e,["keydown"]),this.eventListener(this.widgetEl,e,["mousedown","mouseleave","mousemove","touchend","touchmove"],!1))}},{key:"indexFromEvent",value:function(e){var t,i,s=(null===(t=e.touches)||void 0===t?void 0:t[0])||(null===(i=e.changedTouches)||void 0===i?void 0:i[0])||e,n=document.elementFromPoint(s.clientX,s.clientY);return n.parentNode===this.widgetEl?[].slice.call(n.parentNode.children).indexOf(n):this.indexActive}},{key:"onChange",value:function(){this.changeIndexTo(this.selected(),!0)}},{key:"onKeyDown",value:function(e){var t=e.key.slice(5);if(~["Left","Right"].indexOf(t)){e.preventDefault();var i="Left"===t?-1:1;"rtl"===this.direction&&(i*=-1);var s=this.values.length-1,n=Math.min(Math.max(this.selected()+i,-1),s);this.selectValue(n,!0)}}},{key:"onPointerDown",value:function(e){e.preventDefault();var t=this.indexFromEvent(e);this.props.clearable&&t===this.indexSelected&&(t=-1),this.selectValue(t,!0)}},{key:"onPointerLeave",value:function(e){var t=this;e.preventDefault(),cancelAnimationFrame(this.tick),requestAnimationFrame((function(){return t.changeIndexTo(t.indexSelected)}))}},{key:"onPointerMove",value:function(e){var t=this;e.preventDefault(),this.ticking||(this.tick=requestAnimationFrame((function(){return t.changeIndexTo(t.indexFromEvent(e))})),this.ticking=!0)}},{key:"onReset",value:function(){var e,t=this.valueIndex(null===(e=this.el.querySelector("[selected]"))||void 0===e?void 0:e.value);this.selectValue(t||-1,!1)}},{key:"selected",value:function(){return this.valueIndex(this.el.value)}},{key:"selectValue",value:function(e,t){var i;this.el.value=(null===(i=this.values[e])||void 0===i?void 0:i.value)||"",this.indexSelected=this.selected(),!1===t?this.changeIndexTo(this.selected(),!0):this.el.dispatchEvent(new Event("change"))}},{key:"valueIndex",value:function(e){return this.values.findIndex((function(t){return t.value===+e}))}}]),e}(),I=function(){function e(t,i){N(this,e),this.destroy=this.destroy.bind(this),this.props=i,this.rebuild=this.rebuild.bind(this),this.selector=t,this.widgets=[],this.build()}return O(e,[{key:"build",value:function(){var e=this;this.queryElements(this.selector).forEach((function(t){var i=j(C,e.props,JSON.parse(t.getAttribute("data-options")));"SELECT"!==t.tagName||t.widget||(!i.prebuilt&&t.parentNode.classList.contains(i.classNames.base)&&e.unwrap(t),e.widgets.push(new D(t,i)))}))}},{key:"destroy",value:function(){this.widgets.forEach((function(e){return e.destroy()})),this.widgets=[]}},{key:"queryElements",value:function(e){return"HTMLSelectElement"===H(e)?[e]:"NodeList"===H(e)?[].slice.call(e):"String"===H(e)?[].slice.call(document.querySelectorAll(e)):[]}},{key:"rebuild",value:function(){this.destroy(),this.build()}},{key:"unwrap",value:function(e){var t=e.parentNode,i=t.parentNode;i.insertBefore(e,t),i.removeChild(t)}}]),e}();const V={classNames:{base:"glsr-star-rating"},clearable:!1,tooltip:!1};const W=["required","max","maxlength","min","minlength","pattern"],$=e=>{const t=e.getAttribute("name");return e.validation.form.querySelectorAll(`input[name="${t}"]:checked`).length},B={email:{fn:function(e){return!e||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}},max:{fn:function(e,t){return!e||("checkbox"===this.type?$(this)<=parseInt(t):parseFloat(e)<=parseFloat(t))}},maxlength:{fn:function(e,t){return!e||e.length<=parseInt(t)}},min:{fn:function(e,t){return!e||("checkbox"===this.type?$(this)>=parseInt(t):parseFloat(e)>=parseFloat(t))}},minlength:{fn:function(e,t){return!e||e.length>=parseInt(t)}},number:{fn:function(e){return!e||!isNaN(parseFloat(e))},priority:2},pattern:{fn:function(e,t){let i=t.match(new RegExp("^/(.*?)/([gimy]*)$"));return!e||new RegExp(i[1],i[2]).test(e)}},required:{fn:function(e){return~["checkbox","radio"].indexOf(this.type)?$(this):null!=e&&String(e).replace(/\s/g,"").length>0},priority:99,halt:!0},tel:{fn:function(e){let t=e.replace(/[^0-9]/g,"").length;return!e||4<=t&&15>=t&&new RegExp("^[+]?[\\d\\s()-]*$").test(e)}},url:{fn:function(e){return!e||new RegExp("^(https?)://([\\p{L}\\p{N}\\p{S}\\-_.])+(.?([\\p{L}\\p{N}]|xn--[\\p{L}\\p{N}\\-]+)+.?)(:[0-9]+)?(?:/(?:[\\p{L}\\p{N}\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*(?:\\?(?:[\\p{L}\\p{N}\\-._~!$&'\\[\\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[\\p{L}\\p{N}\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$","iu").test(e)}}};class Y{constructor(e){this.config=GLSR.validationconfig,this.event=this._onChange.bind(this),this.fields=[],this.form=e,this.form.setAttribute("novalidate",""),this.strings=GLSR.validationstrings}destroy(){for(;this.fields.length;)this.destroyField(this.fields[0])}destroyField(e){this.resetField(e),this._eventListener("remove",e.input),delete e.input.validation,this.fields=this.fields.filter((t=>t.input!==e.input))}init(){this.form.querySelectorAll("input:not([type=hidden]):not([type=submit]), select, textarea, [data-glsr-validate]").forEach((e=>this.initField(e)))}initField(e){if(this.fields.find((t=>t.input.name===e.name&&"radio"!==e.type&&!e.name.endsWith("[]"))))return;const t=e.closest(S(this.config.field));null!=t&&t.offsetParent&&this.fields.push(this._initField(e))}reset(){this.fields.forEach((e=>this.resetField(e)))}resetField(e){let t=e.input.closest(S(this.config.field));L(e.input,this.config.input_error,!1),L(e.input,this.config.input_valid,!1),t&&(L(t,this.config.field_error,!1),L(t,this.config.field_valid,!1)),e.errors=[]}setErrors(e,t){e.hasOwnProperty("validation")||this._initField(e),e.validation.errors=t}setInvalid(e){this.toggleError(e,!0)}setValid(e){this.toggleError(e,!1)}toggleError(e,t){let i=e.input.closest(S(this.config.field)),s=[e.input];if(void 0!==e.input.form&&(s=e.input.form.querySelectorAll(`[name="${e.input.name}"]`)),s.forEach((e=>{L(e,this.config.input_error,t),L(e,this.config.input_valid,!t)})),i){L(i,this.config.field_error,t),L(i,this.config.field_valid,!t);let s=i.querySelector(S(this.config.field_message));s&&(s.innerHTML=t?e.errors.join("
"):"",s.style.display=t?"":"none")}}validate(e){let t=!0,i=this.fields;return e instanceof HTMLElement&&e.hasOwnProperty("validation")&&(i=[e.validation]),i.forEach((e=>{this._validateField(e)?this.toggleError(e,!1):(this.toggleError(e,!0),t=!1)})),t}_addValidators(e,t,i){[].forEach.call(e,(e=>{let s=e.name.replace("data-","");~W.indexOf(s)?this._addValidatorToField(t,i,s,e.value):"type"===e.name&&this._addValidatorToField(t,i,e.value)}))}_addValidatorToField(e,t,i,s){if(B.hasOwnProperty(i)&&(B[i].name=i,e.push(B[i]),s)){let e="pattern"===i?[s]:s.split(",");e.unshift(null),t[i]=e}}_eventListener(e,t){const i=t.getAttribute("type")||t.nodeName,s=~["radio","checkbox","SELECT"].indexOf(i)?"change":"input";t[e+"EventListener"](s,this.event)}_onChange(e){this.validate(e.currentTarget)}_initField(e){let t={},i=[];return null!==e.offsetParent&&(this._addValidators(e.attributes,i,t),this._sortValidators(i),this._eventListener("add",e)),e.validation={form:this.form,input:e,params:t,validate:()=>this.validate(e),validators:i}}_sortValidators(e){e.sort(((e,t)=>(t.priority||1)-(e.priority||1)))}_validateField(e){let t=[],i=!0;for(let s in e.validators){if(!e.validators.hasOwnProperty(s))continue;let n=e.validators[s],r=e.params[n.name]?e.params[n.name]:[];if(r[0]=e.input.value,!n.fn.apply(e.input,r)){i=!1;let e=this.strings[n.name];if(t.push(e.replace(/(\%s)/g,r[1])),!0===n.halt)break}}return e.errors=t,i}}class J{constructor(e,t){var i,s;this.button=y(t),this.config=GLSR.validationconfig,this.events={reset:this._onReset.bind(this),submit:this._onSubmit.bind(this)},this.form=e,this.isActive=!1,this.stars=(()=>{let e=null;const t=()=>!!e&&(e.rebuild(),!0);return{init:function(i){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t()||(e=new I(i,Object.assign({},V,s))),e},destroy:()=>!!e&&(e.destroy(),!0),rebuild:t}})(),this.strings=GLSR.validationstrings,this.captcha=new b(this),this.conditions=new G(this),this.validation=new Y(e),this.reviewsEl=document.getElementById(null===(i=e.closest(".glsr"))||void 0===i||null===(s=i.dataset)||void 0===s?void 0:s.reviews_id)}destroy(){this._destroyForm(),this.stars.destroy(),this.captcha.reset(),this.isActive=!1}init(){this.isActive||(this._initForm(),this.stars.init(this.form.querySelectorAll(".glsr-field-rating select"),GLSR.starsconfig),this.captcha.render(),this.isActive=!0)}submitForm(){this.button.loading(),GLSR.ajax.post(this._data(),this._handleResponse.bind(this))}_data(){const e=new FormData(this.form);if(this.reviewsEl&&this.reviewsEl.classList.contains("glsr"))try{const t=JSON.parse(JSON.stringify(this.reviewsEl.dataset));for(let i of Object.keys(t)){let s;try{s=JSON.parse(t[i])}catch(e){s=t[i]}e.append(`${GLSR.nameprefix}[_reviews_atts][${i}]`,s)}e.append([`${GLSR.nameprefix}[_pagination_atts][page]`],1),e.append([`${GLSR.nameprefix}[_pagination_atts][url]`],location.href)}catch(e){console.error(e)}return e}_destroyForm(){this.form.removeEventListener("reset",this.events.reset),this.form.removeEventListener("submit",this.events.submit),this._resetErrors(),this.conditions.destroy(),this.validation.destroy()}_handleResponse(e,t){const i=!0===t&&void 0!==e;if(this.captcha.reset(),i&&this.form.reset(),this._showFieldErrors(null==e?void 0:e.errors),this._showResults(null==e?void 0:e.message,i),this.button.loaded(),GLSR.Event.trigger("site-reviews/form/handle",e,this.form),i){if(e.redirect&&""!==e.redirect)return void(window.location=e.redirect);if(this.reviewsEl&&e.reviews){if(this.reviewsEl.innerHTML=e.reviews,GLSR.urlparameter){let e=new URL(location.href);e.searchParams.delete(GLSR.urlparameter),window.history.replaceState({},"",e.toString())}GLSR.Event.trigger("site-reviews/pagination/init")}}}_initForm(){this._destroyForm(),this.form.addEventListener("reset",this.events.reset),this.form.addEventListener("submit",this.events.submit),this.conditions.init(),this.validation.init()}_onReset(e){this.conditions.destroy(),this.conditions.init()}_onSubmit(e){if(!this.validation.validate())return e.preventDefault(),void this._showResults(this.strings.errors,!1);e.preventDefault(),this._resetErrors(),this.button.loading(),this.captcha.execute()}_resetErrors(){L(this.form,this.config.form_error,!1),this._showResults("",null),this.validation.reset()}_showFieldErrors(e){if(e)for(let t in e){if(!e.hasOwnProperty(t))continue;const i=GLSR.nameprefix?GLSR.nameprefix+"["+t+"]":t,s=this.form.querySelector('[name="'+i+'"]');s&&(this.validation.setErrors(s,e[t]),this.validation.toggleError(s.validation,"add"))}}_showResults(e,t){if(!e)return;const i=this.form.querySelector(S(this.config.form_message));null!==i&&(L(this.form,this.config.form_error,!1===t),L(i,this.config.form_message_failed,!1===t),L(i,this.config.form_message_success,!0===t),i.innerHTML=e)}}var K=function(){return"undefined"==typeof window},X=function(e){e=e||navigator.userAgent;var t=/(iPad).*OS\s([\d_]+)/.test(e);return{ios:!t&&/(iPhone\sOS)\s([\d_]+)/.test(e)||t,android:/(Android);?[\s/]+([\d.]+)?/.test(e)}};function U(e){if(K())return!1;if(!e)throw new Error("options must be provided");var t=!1,i={get passive(){t=!0}},s=function(){},n="__TUA_BSL_TEST_PASSIVE__";window.addEventListener(n,s,i),window.removeEventListener(n,s,i);var r=e.capture;return t?e:void 0!==r&&r}function z(e){return!e&&(null!==e&&("production"!==process.env.NODE_ENV&&("test"!==process.env.NODE_ENV&&console.warn("If scrolling is also required in the floating layer, the target element must be provided."),!0)))}function Q(){return"__BSL_PREVENT_DEFAULT__"in window||(window.__BSL_PREVENT_DEFAULT__=function(e){e.cancelable&&e.preventDefault()}),window.__BSL_PREVENT_DEFAULT__}function Z(e){return e?Array.isArray(e)?e:[e]:[]}var ee={lockedNum:0,lockedElements:[],unLockCallback:null,documentListenerAdded:!1,initialClientPos:{clientX:0,clientY:0}};function te(e){if(K())return ee;if(!(null==e?void 0:e.useGlobalLockState))return te.lockState;var t="__BSL_LOCK_STATE__"in window?Object.assign(Object.assign({},ee),window.__BSL_LOCK_STATE__):ee;return window.__BSL_LOCK_STATE__=t,t}function ie(e,t){if(!K()){z(e);var i,s,n,r,o,a=X(),l=te(t);a.ios?(Z(e).filter((function(e){return-1===l.lockedElements.indexOf(e)})).forEach((function(e){e.ontouchstart=function(e){var t=e.targetTouches[0],i=t.clientX,s=t.clientY;l.initialClientPos={clientX:i,clientY:s}},e.ontouchmove=function(t){!function(e,t,i){if(t){var s=t.scrollTop,n=t.scrollLeft,r=t.scrollWidth,o=t.scrollHeight,a=t.clientWidth,l=t.clientHeight,c=e.targetTouches[0].clientX-i.clientX,d=e.targetTouches[0].clientY-i.clientY,h=Math.abs(d)>Math.abs(c);if(h&&(d>0&&0===s||d<0&&s+l+1>=o)||!h&&(c>0&&0===n||c<0&&n+a+1>=r))return Q()(e)}e.stopPropagation()}(t,e,l.initialClientPos)},l.lockedElements.push(e)})),function(e){if(!X().ios)return;if(e.documentListenerAdded)return;document.addEventListener("touchmove",Q(),U({passive:!1})),e.documentListenerAdded=!0}(l)):l.lockedNum<=0&&(l.unLockCallback=a.android?(i=document.documentElement,s=document.body,n=i.scrollTop||s.scrollTop,r=Object.assign({},i.style),o=Object.assign({},s.style),i.style.height="100%",i.style.overflow="hidden",s.style.top="-".concat(n,"px"),s.style.width="100%",s.style.height="auto",s.style.position="fixed",s.style.overflow="hidden",function(){i.style.height=r.height||"",i.style.overflow=r.overflow||"",["top","width","height","overflow","position"].forEach((function(e){s.style[e]=o[e]||""})),"scrollBehavior"in document.documentElement.style?window.scrollTo({top:n,behavior:"instant"}):window.scrollTo(0,n)}):function(){var e=document.documentElement,t=Object.assign({},e.style),i=window.innerWidth-e.clientWidth,s=parseInt(window.getComputedStyle(e).paddingRight,10);return e.style.overflow="hidden",e.style.boxSizing="border-box",e.style.paddingRight="".concat(i+s,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(i){e.style[i]=t[i]||""}))}}()),l.lockedNum+=1}}function se(e,t){if(!K()){z(e);var i=te(t);i.lockedNum-=1,i.lockedNum>0||function(e){return!X().ios&&("function"==typeof e.unLockCallback&&(e.unLockCallback(),!0))}(i)||(Z(e).forEach((function(e){var t=i.lockedElements.indexOf(e);-1!==t&&(e.ontouchmove=null,e.ontouchstart=null,i.lockedElements.splice(t,1))})),function(e){if(!e.documentListenerAdded)return;document.removeEventListener("touchmove",Q(),U({passive:!1})),e.documentListenerAdded=!1}(i))}}te.lockState=ee;const ne=["[contenteditable]",'[tabindex]:not([tabindex^="-"])',"a[href]","button:not([disabled]):not([aria-hidden])",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])"],re={focus:!1,onClose:()=>{},onOpen:()=>{}},oe="data-glsr-close",ae="glsr-modal",le="is-open",ce="data-glsr-trigger",de=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.class=ae+"__"+e,t};class he{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.events={_open:this._openModal.bind(this),mouseup:this._onClick.bind(this),keydown:this._onKeydown.bind(this),touchstart:this._onClick.bind(this)},this.id=e,this.triggers=[],this._config(t),this._reset()}header(e,t){return this._insertHtml(this.dom.header,e,t)}content(e,t){return this._insertHtml(this.dom.content,e,t)}footer(e,t){return this._insertHtml(this.dom.footer,e,t)}_closeModal(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!ue.open.includes(this.id))return;e&&(e.preventDefault(),e.stopPropagation());const t=()=>{this.root.removeEventListener("animationend",t,!1),this.root.classList.remove(le),ue.open.pop(),this.config.onClose(this,e),GLSR.Event.trigger("site-reviews/modal/close",this,e),x((()=>this._reset()))()};this.root.addEventListener("animationend",t,!1),this.root.setAttribute("aria-hidden","true"),this._eventHandler("remove"),se(this.dom.content),this.trigger&&this.trigger.focus&&this.trigger.focus()}_config(e){return this.config=Object.assign({},re,e),this}_eventHandler(e){this._eventListener(this.dom.close,e,["keydown"]),this._eventListener(this.root,e,["mouseup","touchstart"]),this._eventListener(document,e,["keydown"])}_eventListener(e,t,i){e&&i.forEach((i=>e[t+"EventListener"](i,this.events[i])))}_focusableNodes(){return[].slice.call(this.root.querySelectorAll(ne))}_insertHtml(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e&&null!==t){if(""!==t){const e=v("div",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});e.innerHTML=t,t=e.outerHTML}e.innerHTML=t}return e}_insertModal(){var e;const t=v("button",de("close",{"aria-label":GLSR.text.closemodal,"data-glsr-close":""})),i=v("div",de("content",{tabindex:-1})),s=v("div",de("header")),n=v("div",de("footer")),r=v("div",de("dialog",{"aria-modal":!0,role:"dialog"}),t,s,i,n),o=v("div",{class:ae,id:this.id,"aria-hidden":!0},v("div",de("overlay",{tabindex:-1,"data-glsr-close":""}),r));this.dom={...this.dom,close:t,content:i,dialog:r,footer:n,header:s};const a=null!==(e=document.querySelector("body > #page.site"))&&void 0!==e?e:document.body;this.root=a.appendChild(o)}_onClick(e){e.target.hasAttribute(oe)&&this._closeModal(e)}_onKeydown(e){~[13,32].indexOf(e.keyCode)&&e.target===this.dom.close&&this._closeModal(e),27===e.keyCode&&ue.open.slice(-1)[0]===this.id&&this._closeModal(e),9===e.keyCode&&this._retainFocus(e)}_openModal(e){ue.open.push(this.id),this.trigger=document.activeElement,e&&(e.preventDefault(),this.trigger=e.currentTarget),this._insertModal(),ie(this.dom.content),this.config.onOpen(this,e),GLSR.Event.trigger("site-reviews/modal/open",this,e),this.root.setAttribute("aria-hidden","false"),this.root.classList.add(le),this._eventHandler("add");const t=()=>{this.root.removeEventListener("animationend",t,!1),this._setFocusToFirstNode()};this.root.addEventListener("animationend",t,!1)}_registerTrigger(e){this._removeTrigger(e),e.addEventListener("click",this.events._open),this.triggers.push(e)}_removeTrigger(e){this.triggers.filter((t=>t!==e)),e.removeEventListener("click",this.events._open)}_removeTriggers(){this.triggers.forEach((e=>this._removeTrigger(e))),this.triggers=[]}_reset(){this.dom={close:null,content:null,footer:null,header:null},this.root&&this.root.remove(),this.root=null,this.trigger=null}_retainFocus(e){let t=this._focusableNodes();if(0!==t.length)if(t=t.filter((e=>null!==e.offsetParent)),this.root.contains(document.activeElement)){const i=t.indexOf(document.activeElement);e.shiftKey&&0===i?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&t.length>0&&i===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}_setFocusToFirstNode(){if(!this.config.focus)return;const e=this._focusableNodes();if(0===e.length)return;const t=e.filter((e=>!e.hasAttribute(oe)));t.length>0?t[0].focus():0===t.length&&e[0].focus()}}const ue={active:{},open:[]};var pe={close:e=>{if(e)ue.active[e]&&ue.active[e]._closeModal();else for(let e in ue.active)ue.active[e]._closeModal()},init:(e,t)=>{let i;return ue.active[e]?(i=ue.active[e],i._removeTriggers(),t&&i._config(t)):i=new he(e,t),document.querySelectorAll("["+ce+"]").forEach((t=>{e===t.attributes[ce].value&&i._registerTrigger(t)})),ue.active[e]=i,ue.active},modals:ue,modify:(e,t)=>{e&&ue.active[e]&&t(ue.active[e])},open:(e,t)=>{let i;ue.active[e]?(i=ue.active[e],i.root&&i._eventHandler("remove"),t&&i._config(t)):i=new he(e,t),ue.active[e]=i,i._openModal()}};const fe="glsr-hide",ve=16,ge=468,me="button.glsr-button-loadmore",we=".glsr-pagination a[data-page]",_e=".glsr-reviews, [data-reviews]";class ye{constructor(e,t){this.events={button:{click:this._onLoadMore.bind(this)},link:{click:this._onPaginate.bind(this)},window:{popstate:this._onPopstate.bind(this)}},this.paginationEl=t,this.reviewsEl=e.querySelector(_e),this.wrapperEl=e}destroy(){this._eventHandler("remove")}init(){this._eventHandler("add");const e=this.paginationEl.querySelector(".current");if(e){const t=this._data(e),i=e.nextElementSibling;t&&i&&2==+i.dataset.page&&GLSR.urlparameter&&window.history.replaceState(t,"",window.location)}}_data(e){try{const i=JSON.parse(JSON.stringify(this.paginationEl.dataset)),s={page:e.dataset.page||1,schema:!1,url:e.href||location.href};for(var t of Object.keys(i)){let e;try{e=JSON.parse(i[t])}catch(s){e=i[t]}s[`atts][${t}`]=e}return GLSR.ajax.data("fetch-paged-reviews",s)}catch(e){return console.error("Invalid pagination config."),!1}}_eventHandler(e){this._eventListener(window,e,this.events.window),this.wrapperEl.querySelectorAll(me).forEach((t=>{this._eventListener(t,e,this.events.button)})),this.wrapperEl.querySelectorAll(we).forEach((t=>{this._eventListener(t,e,this.events.link)}))}_eventListener(e,t,i){Object.keys(i).forEach((s=>e[t+"EventListener"](s,i[s])))}_handleLoadMore(e,t,i,s){s?(e.loaded(),this.destroy(),this.paginationEl.innerHTML=i.pagination,this.reviewsEl.insertAdjacentHTML("beforeend",i.reviews),this.init(),GLSR.Event.trigger("site-reviews/pagination/handle",i,this)):window.location=location}_handlePagination(e,t,i,s){s?(this._paginate(i),GLSR.urlparameter&&window.history.pushState(t,"",e.href)):window.location=e.href}_handlePopstate(e,t,i){i?this._paginate(t):console.error(t)}_loaded(){const e=this.paginationEl.querySelector(".glsr-spinner");e&&this.paginationEl.removeChild(e),this.wrapperEl.classList.remove(fe)}_loading(){this.wrapperEl.classList.add(fe),this.paginationEl.insertAdjacentHTML("beforeend",'
')}_onLoadMore(e){const t=e.currentTarget,i=this._data(t);if(i){const s=y(t);s.loading(),e.preventDefault(),GLSR.ajax.post(i,this._handleLoadMore.bind(this,s,i))}}_onPaginate(e){const t=e.currentTarget,i=this._data(t);i&&(this._loading(),e.preventDefault(),GLSR.ajax.post(i,this._handlePagination.bind(this,t,i)))}_onPopstate(e){GLSR.Event.trigger("site-reviews/pagination/popstate",e,this),e.state&&e.state[`${GLSR.nameprefix}[_action]`]&&(this._loading(),GLSR.ajax.post(e.state,this._handlePopstate.bind(this,e.state)))}_paginate(e){this.destroy(),this.paginationEl.innerHTML=e.pagination,this.reviewsEl.innerHTML=e.reviews,this.init(),this._scrollToTop(),this._loaded(),GLSR.Event.trigger("site-reviews/pagination/handle",e,this)}_scrollStep(e){const t=Math.min(1,(window.performance.now()-e.startTime)/ge),i=.5*(1-Math.cos(Math.PI*t)),s=e.startY+(e.endY-e.startY)*i;window.scroll(0,e.offset+s),s!==e.endY&&window.requestAnimationFrame(this._scrollStep.bind(this,e))}_scrollToTop(){let e=ve;[].forEach.call(GLSR.ajaxpagination,(t=>{const i=document.querySelector(t);i&&"fixed"===window.getComputedStyle(i).getPropertyValue("position")&&(e+=i.clientHeight)}));const t=this.reviewsEl.getBoundingClientRect().top-e;t>0||this._scrollStep({endY:t,offset:window.pageYOffset,startTime:window.performance.now(),startY:this.reviewsEl.scrollTop})}}const be="site-reviews/excerpts/init",Ee="site-reviews/forms/init",Le="site-reviews/init",Se="site-reviews/loaded",xe="site-reviews/modal/init",ke="site-reviews/pagination/init";window.hasOwnProperty("GLSR")||(window.GLSR={}),window.GLSR.ajax=o,window.GLSR.forms=[],window.GLSR.pagination=[],window.GLSR.Event=d,window.GLSR.Modal=pe,window.GLSR.Utils={debounce:x,dom:v,fadeIn:async(e,t,i)=>E("in",e,t,i),fadeOut:async(e,t,i)=>E("out",e,t,i),isEmpty:e=>[Object,Array].includes((e||{}).constructor)&&!Object.entries(e||{}).length,parseJson:k},d.on(be,(e=>{new _(e),d.trigger(xe)})),d.on(Ee,(()=>{GLSR.forms=GLSR.forms.filter((e=>!!e.form.closest("body"))),document.querySelectorAll("form.glsr-review-form").forEach((e=>{const t=e.querySelector("[type=submit]");if(t){let i,s=GLSR.forms.findIndex((t=>t.form===e));-1!==s?(i=GLSR.forms[s],i.destroy()):(i=new J(e,t),GLSR.forms.push(i)),i.init()}}))})),d.on(xe,(()=>{GLSR.Modal.init("glsr-modal-review",{onOpen:e=>{const t=e.trigger.closest(".glsr").cloneNode(!0),i=e.trigger.closest(".glsr-review").cloneNode(!0);i.querySelectorAll('[data-expanded="false"]').forEach((e=>{e.dataset.expanded="true"})),i.removeAttribute("id"),t.innerHTML="",t.appendChild(i),e.dom.content.appendChild(t)}})})),d.on(ke,(()=>{GLSR.pagination.forEach((e=>e.destroy())),GLSR.pagination=[],document.querySelectorAll(".glsr").forEach((e=>{const t=e.querySelector(".glsr-pagination");if(t&&(t.classList.contains("glsr-ajax-loadmore")||t.classList.contains("glsr-ajax-pagination"))){const i=new ye(e,t);i.init(),GLSR.pagination.push(i)}}))})),d.on(Le,(()=>{document.querySelectorAll(".glsr").forEach((e=>{const t="glsr-"+window.getComputedStyle(e,null).getPropertyValue("direction");e.classList.add(t)})),d.trigger(be),d.trigger(Ee),d.trigger(ke),d.trigger(Se)})),d.on("site-reviews/pagination/handle",((e,t)=>{d.trigger(be,t.wrapperEl)})),document.addEventListener("DOMContentLoaded",(()=>{setTimeout((()=>d.trigger(Le)),5),setTimeout((()=>(()=>{let e=new URL(location.href);if(!e.searchParams.has("review_id")||!e.searchParams.has("verified"))return;let t=["form","review_id","theme","verified"],i={};t.forEach((t=>{e.searchParams.has(t)&&(i[t]=e.searchParams.get(t))})),GLSR.ajax.post(GLSR.ajax.data("verified-review",i),((s,n)=>{n?GLSR.Modal.open("glsr-modal-verified",{onClose:i=>{t.forEach((t=>e.searchParams.delete(t))),history.pushState({},"",e.href)},onOpen:e=>{const t=v("p",{style:"margin:0;padding:0;"});t.innerHTML=s.message,e.footer(t.outerHTML),e.content(s.review,s.attributes),e.dom.content.querySelectorAll('[data-expanded="false"]').forEach((e=>{e.dataset.expanded="true"}))}}):console.error({request:i,response:s})}))})()),10)}))}(); diff --git a/languages/site-reviews-en_US.po b/languages/site-reviews-en_US.po index df9333d1..60d2a5c7 100644 --- a/languages/site-reviews-en_US.po +++ b/languages/site-reviews-en_US.po @@ -1929,32 +1929,32 @@ msgctxt "admin-text" msgid "Set the color theme of the CAPTCHA widget." msgstr "Set the color theme of the CAPTCHA widget." -#: config/settings.php:1014 +#: config/settings.php:1015 msgctxt "admin-text" msgid "CAPTCHA Usage" msgstr "CAPTCHA Usage" -#: config/settings.php:1016 +#: config/settings.php:1017 msgctxt "admin-text" msgid "Use for everyone" msgstr "Use for everyone" -#: config/settings.php:1017 +#: config/settings.php:1018 msgctxt "admin-text" msgid "Use only for guest users" msgstr "Use only for guest users" -#: config/settings.php:1020 +#: config/settings.php:1021 msgctxt "admin-text" msgid "Choose who you want to load the CAPTCHA for." msgstr "Choose who you want to load the CAPTCHA for." -#: config/settings.php:1025 +#: config/settings.php:1026 msgctxt "admin-text" msgid "Enable Akismet" msgstr "Enable Akismet" -#: config/settings.php:1027 +#: config/settings.php:1028 msgctxt "admin-text" msgid "" "The Akismet plugin " @@ -1967,12 +1967,12 @@ msgstr "" "setting to have any affect, you will need to first install and activate the " "Akismet plugin and set up a WordPress.com API key." -#: config/settings.php:1033 +#: config/settings.php:1034 msgctxt "admin-text" msgid "Prevent Duplicates" msgstr "Prevent Duplicates" -#: config/settings.php:1035 +#: config/settings.php:1036 msgctxt "admin-text" msgid "" "This will prevent people from submitting multiple reviews with the same " @@ -1981,22 +1981,22 @@ msgstr "" "This will prevent people from submitting multiple reviews with the same " "content." -#: config/settings.php:1041 +#: config/settings.php:1042 msgctxt "admin-text" msgid "Blacklist" msgstr "Blacklist" -#: config/settings.php:1043 +#: config/settings.php:1044 msgctxt "admin-text" msgid "Use the Site Reviews Blacklist" msgstr "Use the Site Reviews Blacklist" -#: config/settings.php:1044 +#: config/settings.php:1045 msgctxt "admin-text" msgid "Use the WordPress Disallowed Comment Keys" msgstr "Use the WordPress Disallowed Comment Keys" -#: config/settings.php:1047 +#: config/settings.php:1048 msgctxt "admin-text" msgid "" "Choose which Blacklist you would prefer to use for reviews. The %s option " @@ -2005,17 +2005,17 @@ msgstr "" "Choose which Blacklist you would prefer to use for reviews. The %s option " "can be found in the WordPress Discussion Settings page." -#: config/settings.php:1048 +#: config/settings.php:1049 msgctxt "admin-text" msgid "Disallowed Comment Keys" msgstr "Disallowed Comment Keys" -#: config/settings.php:1057 +#: config/settings.php:1058 msgctxt "admin-text" msgid "Review Blacklist" msgstr "Review Blacklist" -#: config/settings.php:1060 +#: config/settings.php:1061 msgctxt "admin-text" msgid "" "One entry or IP address per line. When a review contains any of these " @@ -2028,22 +2028,22 @@ msgstr "" "rejected. It is case-insensitive and will match partial words, so \"press\" " "will match \"WordPress\"." -#: config/settings.php:1066 +#: config/settings.php:1067 msgctxt "admin-text" msgid "Blacklist Action" msgstr "Blacklist Action" -#: config/settings.php:1068 +#: config/settings.php:1069 msgctxt "admin-text" msgid "Require approval" msgstr "Require approval" -#: config/settings.php:1069 +#: config/settings.php:1070 msgctxt "admin-text" msgid "Reject submission" msgstr "Reject submission" -#: config/settings.php:1072 +#: config/settings.php:1073 msgctxt "admin-text" msgid "Choose the action that should be taken when a review is blacklisted." msgstr "Choose the action that should be taken when a review is blacklisted." diff --git a/languages/site-reviews.pot b/languages/site-reviews.pot index db0dd1df..dc441abc 100644 --- a/languages/site-reviews.pot +++ b/languages/site-reviews.pot @@ -1304,97 +1304,97 @@ msgctxt "admin-text" msgid "Set the color theme of the CAPTCHA widget." msgstr "" -#: config/settings.php:1014 +#: config/settings.php:1015 msgctxt "admin-text" msgid "CAPTCHA Usage" msgstr "" -#: config/settings.php:1016 +#: config/settings.php:1017 msgctxt "admin-text" msgid "Use for everyone" msgstr "" -#: config/settings.php:1017 +#: config/settings.php:1018 msgctxt "admin-text" msgid "Use only for guest users" msgstr "" -#: config/settings.php:1020 +#: config/settings.php:1021 msgctxt "admin-text" msgid "Choose who you want to load the CAPTCHA for." msgstr "" -#: config/settings.php:1025 +#: config/settings.php:1026 msgctxt "admin-text" msgid "Enable Akismet" msgstr "" -#: config/settings.php:1027 +#: config/settings.php:1028 msgctxt "admin-text" msgid "The Akismet plugin integration provides spam-filtering for your reviews. In order for this setting to have any affect, you will need to first install and activate the Akismet plugin and set up a WordPress.com API key." msgstr "" -#: config/settings.php:1033 +#: config/settings.php:1034 msgctxt "admin-text" msgid "Prevent Duplicates" msgstr "" -#: config/settings.php:1035 +#: config/settings.php:1036 msgctxt "admin-text" msgid "This will prevent people from submitting multiple reviews with the same content." msgstr "" -#: config/settings.php:1041 +#: config/settings.php:1042 msgctxt "admin-text" msgid "Blacklist" msgstr "" -#: config/settings.php:1043 +#: config/settings.php:1044 msgctxt "admin-text" msgid "Use the Site Reviews Blacklist" msgstr "" -#: config/settings.php:1044 +#: config/settings.php:1045 msgctxt "admin-text" msgid "Use the WordPress Disallowed Comment Keys" msgstr "" -#: config/settings.php:1047 +#: config/settings.php:1048 msgctxt "admin-text" msgid "Choose which Blacklist you would prefer to use for reviews. The %s option can be found in the WordPress Discussion Settings page." msgstr "" -#: config/settings.php:1048 +#: config/settings.php:1049 msgctxt "admin-text" msgid "Disallowed Comment Keys" msgstr "" -#: config/settings.php:1057 +#: config/settings.php:1058 msgctxt "admin-text" msgid "Review Blacklist" msgstr "" -#: config/settings.php:1060 +#: config/settings.php:1061 msgctxt "admin-text" msgid "One entry or IP address per line. When a review contains any of these entries in its title, content, name, email, or IP address, it will be rejected. It is case-insensitive and will match partial words, so \"press\" will match \"WordPress\"." msgstr "" -#: config/settings.php:1066 +#: config/settings.php:1067 msgctxt "admin-text" msgid "Blacklist Action" msgstr "" -#: config/settings.php:1068 +#: config/settings.php:1069 msgctxt "admin-text" msgid "Require approval" msgstr "" -#: config/settings.php:1069 +#: config/settings.php:1070 msgctxt "admin-text" msgid "Reject submission" msgstr "" -#: config/settings.php:1072 +#: config/settings.php:1073 msgctxt "admin-text" msgid "Choose the action that should be taken when a review is blacklisted." msgstr ""