(()=>{var e="https://app.goodreviews.io/",t="",n=sessionStorage.getItem("disableGoodReviews"),i=null,o=[],a=document.currentScript.parentElement;if("true"===n)console.log("User disabled Good Reviews");else{var s=function(e,t){var n=new XMLHttpRequest;return"withCredentials"in n||(n=new XDomainRequest),n.open("GET",e),n.onload=t,n.send(),n},r=function(e,t,n){var i=new XMLHttpRequest;return"withCredentials"in i||(i=new XDomainRequest),i.open("POST",e),i.setRequestHeader("Content-Type","application/json"),i.send(JSON.stringify({event:t,eventIp:n})),i},l=document.createElement("div");l.id="goodreviews-wrapper",l.innerHTML='';var c=new Promise((function(t,n){s(e+"api/reviews/get?id="+gro.q[0][1]+"&js=true",(function(e){var n=e.currentTarget.response||e.target.responseText;prw_data=JSON.parse(n),t("Review Data Received")}))})),d="";new Promise((function(e,t){s("https://cdn.goodreviews.io/get_ip.php",(function(t){var n=t.currentTarget.response||t.target.responseText;d=n,e("IP Data Received")}))})).then((function(){r(e+"api/reviews/event?id="+gro.q[0][1],"uniqueUser",d)}));new Promise((function(t,n){s(e+"api/reviews/style?id="+gro.q[0][1],(function(e){var n=e.currentTarget.response||e.target.responseText;JSON.parse(n).locations,i=JSON.parse(n),t("IP Datas Received")}))})).then((function(){"original"!=i.widgetType&&"badge"!=i.widgetType||(a=document.body),a.appendChild(l);var n=document.getElementById("goodreviews-widget");if(n.classList.add(i.widgetType),"badge"==i.widgetType){n.style.transition="all .5s",n.style.opacity="0";var s=document.createElement("div");s.id="badge-container",document.getElementById("goodreviews-wrapper").appendChild(s),"right-aligned"==i.horizontalAlignment?s.style.right="10px":s.style.left="10px";var p=document.createElement("img");p.src="https://app.goodreviews.io/images/google.png",document.getElementById("badge-container").appendChild(p);var v=document.createElement("h3");if(v.innerHTML="Google Rating",document.getElementById("badge-container").appendChild(v),i.displayed_stars>0){var g=document.createElement("div");g.id="badge-star",g.innerHTML="".concat("all"==i.rating?0:i.rating,"
"),document.getElementById("badge-container").appendChild(g)}var w=document.createElement("button"),m=0==i.totalReview?0:i.totalReview;w.innerHTML="Read our "+m+" reviews",document.getElementById("badge-container").appendChild(w),s.addEventListener("click",(function(){n.style.opacity="1",n.style.transform="unset"}))}var u=i.slideInterval?i.slideInterval:4e3;if(c.then((function(){var s,c,p,v,g=document.querySelector("#goodreviews-widget"),w=document.querySelector(".custom-notification"),m=document.createElement("link");m.id="prw_style",m.rel="stylesheet",m.type="text/css",m.charset="utf-8",m.href=e+"css/widgets/prw.css",document.body.appendChild(m);var y=document.createElement("div");y.id="prw_location_select",y.style.opacity="0",y.style.display="none",y.innerHTML='\n
\n \n
\n
\n
x
\n Please select a location below that you would like to review\n
\n
\n

\n Please select a location below that you would like to review\n

\n \n
\n
\n ',a.appendChild(y);var _=[],f=[];1===prw_data.length?(t=prw_data[0].review_url,prw_data.forEach((function(e,t){var n=i&&i.locationName,o=null!==e.location_suburb&&null!==e.location_suburb.locality?e.location_suburb.locality:null,a=null!==e.location_administrativeArea?e.location_administrativeArea:null;null===o&&(o=" "),null==a&&(a=" "),1===n&&(o=e.business_name,a="");var s=document.getElementById("location-list-wrapper");if(!document.getElementById("location_id_"+e.location)){var r=document.createElement("a");r.href=e.review_url+"&utm=gmb",r.target="_blank",r.className="prw_location_option",r.id="location_id_"+e.location,r.style.cssText="float: none; width: 100%;",r.innerHTML=o+" "+a+"
",s.appendChild(r)}f.push(e.review_object)}))):prw_data.forEach((function(e,t){var n=i.locationName,o=null!==e.location_suburb&&null!==e.location_suburb.locality?e.location_suburb.locality:null,a=null!==e.location_administrativeArea?e.location_administrativeArea:null;null===o&&(o=e.business_name),null==a&&(a=" "),1===n&&(o=e.business_name,a="");var s=document.getElementById("location-list-wrapper");if(!document.getElementById("location_id_"+e.location)){var r=document.createElement("a");r.href=e.review_url+"&utm=gmb",r.target="_blank",r.className="prw_location_option",r.id="location_id_"+e.location,r.style.cssText="float: none; width: 100%;",r.innerHTML=o+" "+a+"
",s.appendChild(r)}f.push(e.review_object)}));"original"!=i.widgetType&&1==i.widgetHeader&&(header_widget=document.createElement("div"),header_widget.id="widget-header",header_widget.innerHTML="
".concat("all"==i.rating?0:i.rating,"
").concat(0==i.totalReview?0:i.totalReview," reviews
\n ").concat("partial"==i.displayType?"":"
Write a review
')),g.insertAdjacentElement("afterbegin",header_widget));_=Object.keys(f).map((function(e){return f[e]}));_.forEach((function(e){return o=o.concat(e)}));var h=(o=o.sort((function(e,t){return new Date(e.date)new Date(t.date)?-1:0}))).slice(0,20),b=0,E=0;function T(e,t){for(var n=o.slice(e,t),r=function(){if(null===n[l].comment||""===n[l].comment||"null"===n[l].comment||void 0===n[l].comment)c="",v="",p="";else{var t=function(e){var t=new RegExp("Translated by Google","g"),n=e.replace(t,"Translated by Google"),i=new RegExp("Original","g");return n.replace(i,"Original")};c=n[l].comment.substring(0,70),p=n[l].comment.substring(0,41),v=n[l].comment,c=t(c),p=t(p),v=t(v),"original"!=i.widgetType?c=v:(v.length>70&&(c+=" ..."),p.length>40&&(p+=" ..."))}for((d=document.createElement("li")).classList.add("custom-notification-container"),d.id="custom-notification-container-"+(l+e),"original"==i.widgetType?d.innerHTML='\n
\n \n
\n
\n

\n ').concat(n[l].name,'\n \x3c!-- --\x3e\n \n

\n \n ').concat(c,'\n ').concat(v,"\n ").concat(p,'
x
\n read our reviews \n \n \n
\n "):"carousel"==i.widgetType?d.innerHTML='\n \n
\n
\n

\n \x3c!-- --\x3e\n \n

\n \n '.concat(c,'\n ').concat(v,"\n ").concat(p,'
x
\n \n
\n
\n
\n \n
\n
\n ').concat(n[l].name,'\n \n
\n
\n
\n
\n \n \n "):d.innerHTML='\n \n
\n
\n
\n
\n \n
\n
\n ').concat(n[l].name,'\n \n
\n
\n

\n \x3c!-- --\x3e\n \n

\n \n ').concat(""!=c?''.concat(c,""):"","\n ").concat(""!=v?''.concat(v,""):"","\n ").concat(""!=p?" ").concat(p,"
x
"):"","\n \n
\n
\n "),w.appendChild(d),s=document.querySelector("#custom-notification-container-"+(l+b)+" .prw-stars"),g=0;g',(m=document.createElement("span")).innerHTML='',s.appendChild(m)},l=0;l=1336&&(u="18.4%"),a.offsetWidth<=1336&&(u="30%"),a.offsetWidth<=650&&(u="45%"),a.offsetWidth<=570&&(u="100%"),document.querySelectorAll(".custom-notification-container").forEach((function(e){e.style.maxWidth=u}))}}function L(e){e=(e=new Date(e)).getTime();var t=Math.floor((new Date-e)/1e3),n=t/31536e3;return n>1?Math.floor(n)+" years":(n=t/2592e3)>1?Math.floor(n)+" months":(n=t/86400)>1?Math.floor(n)+" days":(n=t/3600)>1?Math.floor(n)+" hours":(n=t/60)>1?Math.floor(n)+" minutes":Math.floor(t)+" seconds"}E="original"!=i.widgetType&&"masonry"!=i.widgetType&&"carousel"!=i.widgetType?5:"masonry"==i.widgetType?10:20,T(b,E);var k,x=null!=(k=new RegExp("grid_view"+"=([^;]+)").exec(document.cookie))?unescape(k[1]):null;if(0===h.length||x&&i&&"partial"!==i.displayType){var A=document.createElement("li");A.classList.add("custom-notification-container"),A.id="custom-notification-container",A.innerHTML='\n
\n \n
\n
\n

\n Welcome Back!\n

\n\n We\'d love for you to review us!\n We\'d love for you to review us!\n\n \n
\n "),w.insertAdjacentElement("afterbegin",A)}else{!function(e,t,n){var i=new Date;i.setTime(i.getTime()+864e5*n),document.cookie=e+"="+t+";path=/;expires="+i.toGMTString()}("grid_view","user",1)}var M=document.querySelector("#goodreview_close_widget_mobile");M&&M.addEventListener("click",(function(e){e.stopPropagation(),sessionStorage.setItem("disableGoodReviews",!0),l.remove()}),!1);var R=document.createElement("div");R.id="goodreview_close",R.innerHTML="x",R.style.display="none",g.insertAdjacentElement("afterbegin",R);var S=document.getElementById("review-location-content"),I=document.createElement("div");I.id="goodreview_loc_close",I.innerHTML="x",I.style.display="none",S.insertAdjacentElement("afterbegin",I);var q=document.querySelectorAll(".custom-notification-container"),B=document.querySelectorAll(".custom-notification .custom-notification-container"),P=0;if("original"==i.widgetType)var C=setInterval(H,u);function H(){"original"==i.widgetType&&(B[P].className="custom-notification-container",P=(P+1)%B.length,B[P].className="custom-notification-container showing")}function W(){!0,C=setInterval(H,u)}function N(){q=document.querySelectorAll(".custom-notification-container");for(var t=0;t Leave A Review '):G.innerText="Leave A Review",w.appendChild(G)}function j(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))}var D,O=j();(D=j(),style_data=i,O)?"original"!=i.widgetType&&O&&(rev_button=document.createElement("div"),rev_button.id="goodreview_actions",rev_button.innerHTML=""+("original"==i.widgetType?"See More Reviews":"Load More")+"",rev_button.style.display="block",g.insertAdjacentElement("beforeend",rev_button)):("partial"===style_data.displayType?(rev_button=document.createElement("div"),rev_button.id="goodreview_actions","original"!=i.widgetType?rev_button.innerHTML=""+("original"==i.widgetType?"See More Reviews":"Load More")+"":rev_button.innerHTML=""+("original"==i.widgetType?"See More Reviews":"Load More")+"",rev_button.style.display="original"==i.widgetType?"none":"block",g.insertAdjacentElement("beforeend",rev_button)):"original"==i.widgetType?1===prw_data.length?(rev_button=document.createElement("div"),rev_button.id="goodreview_actions",rev_button.innerHTML="See More ReviewsLeave A Review",rev_button.style.display="original"==i.widgetType?"none":"block",g.insertAdjacentElement("beforeend",rev_button)):(rev_button=document.createElement("div"),rev_button.id="goodreview_actions",rev_button.innerHTML=""+("original"==i.widgetType?"See More Reviews":"Load More")+"Leave A Review",rev_button.style.display="original"==i.widgetType?"none":"block",g.insertAdjacentElement("beforeend",rev_button)):(rev_button=document.createElement("div"),rev_button.id="goodreview_actions",rev_button.innerHTML=""+("original"==i.widgetType?"See More Reviews":"Load More")+"",g.insertAdjacentElement("beforeend",rev_button)),(F=document.querySelector("#goodreview_close_widget")).addEventListener("click",(function(e){e.stopPropagation(),sessionStorage.setItem("disableGoodReviews",!0),l.remove()}),!1));if(visual_options=document.getElementById("visual_options"),goodreview_actions=document.getElementById("goodreview_actions"),hearder=document.getElementById("widget-header"),"right-aligned"===style_data.horizontalAlignment)switch(right_align=document.getElementById("goodreviews-widget"),i.widgetType){case"grid":right_align.className="prw grid";break;case"masonry":right_align.className="prw masonry";break;case"badge":right_align.className="prw badge";break;case"carousel":right_align.className="prw carousel";break;default:right_align.className="prw right-aligned"}if("desktop"===style_data.deviceType&&!1===D||"mobile"===style_data.deviceType&&!0===D?(visual_options.style.display="block",goodreview_actions.style.display="block","original"!=i.widgetType&&(hearder.style.display="block")):("desktop"===style_data.deviceType&&!0===D||"mobile"===style_data.deviceType&&!1===D)&&(visual_options.style.display="none",goodreview_actions.style.display="none","original"!=i.widgetType&&(hearder.style.display="none")),showAllReviews=document.querySelector("#gr_more_reviews"),leaveAReview=document.querySelector("#gr_leave_review"),O||"original"!=i.widgetType||(g.addEventListener("mouseenter",(function(){w.classList.contains("prw-showAll")||(rev_button.style.display="block"),F.style.display="block"})),g.addEventListener("mouseleave",(function(){rev_button.style.display="none",F.style.display="none"}))),"badge"==i.widgetType&&(R.addEventListener("click",(function(e){e.stopPropagation(),n.style.opacity="0",n.style.transform="translateX(-100%) translateZ(0px)"}),!1),window.addEventListener("click",(function(e){document.getElementById("badge-container").contains(e.target)||document.getElementById("goodreviews-widget").contains(e.target)||(console.log("22222"),n.style.opacity="0",n.style.transform="translateX(-100%) translateZ(0px)")}))),!O){showAllReviews.addEventListener("click",(function(){w.classList.contains("prw-showAll")?(w.classList.remove("prw-showAll"),R.style.display="none"):("original"!=i.widgetType?(T(b,b+5),N(),b>=o.length&&(document.getElementById("gr_more_reviews").parentElement.style.display="none")):(w.classList.add("prw-showAll"),R.style.display="block",rev_button.style.display="none"),r(e+"api/reviews/event?id="+gro.q[0][1],"seeMoreReviews",d))})),document.addEventListener("click",(function(){l.style.opacity="1",w.classList.contains("prw-showAll")&&(w.classList.remove("prw-showAll"),R.style.display="none"),y.classList.contains("showing-locations")&&(y.style.opacity="0",y.style.display="none",I.style.display="none",y.style.filter="alpha(opacity=0)")})),l.addEventListener("click",(function(e){e.stopPropagation()}),!1),y.addEventListener("click",(function(e){e.stopPropagation()}),!1),R.addEventListener("click",(function(e){e.stopPropagation(),w.classList.contains("prw-showAll")&&"original"==i.widgetType&&(w.classList.remove("prw-showAll"),R.style.display="none")}),!1),"partial"!==style_data.displayType&&("left-aligned"!==style_data.horizontalAlignment?""===t&&leaveAReview.addEventListener("click",(function(){y.style.opacity="1",y.style.display="block",l.style.opacity="0",y.className="showing-locations right-aligned",I.style.display="block",y.style.filter="alpha(opacity=100)"})):""===t&&leaveAReview.addEventListener("click",(function(){y.style.opacity="1",y.style.display="block",l.style.opacity="0",y.className="showing-locations",I.style.display="block",y.style.filter="alpha(opacity=100)"})));for(var z=y.getElementsByClassName("prw_location_option"),X=0,J=z.length;X=o.length&&(document.getElementById("gr_more_reviews").parentElement.style.display="none"),N(),r(e+"api/reviews/event?id="+gro.q[0][1],"seeMoreReviews",d))})),q=document.querySelectorAll(".custom-notification-container");for(X=0;X0){var e=function(){v||(p.marginLeft==(r*i-r*s).toFixed()+"px"?l.style.marginLeft="calc(0px)":l.style.marginLeft="calc("+p.marginLeft+" - "+r+"px)",v=!0,setTimeout((function(){v=!1}),500))},t=function(t){if(!g)return g=!0,setInterval(e,t);n()},n=function(){clearInterval(w),g=!1},i=3,s=o.length;i=s>=20?a.offsetWidth>=1336?5:a.offsetWidth>=991?4:a.offsetWidth>600?3:a.offsetWidth>480?2:1:s>=10?a.offsetWidth>=991?4:a.offsetWidth>600?3:a.offsetWidth>480?2:1:s>=5?a.offsetWidth>=991?3:a.offsetWidth>480?2:1:1,document.getElementById("gr_more_reviews").parentElement.style.display="none";var r=(visual_options.offsetWidth/i).toFixed(),l=document.getElementsByClassName("custom-notification")[0];l.style.width="calc("+s+"* "+r+"px)";var c=document.createElement("div");c.id="prev-review",c.innerHTML="‹";var d=document.createElement("div");d.id="next-review",d.innerHTML="›",visual_options.appendChild(c),visual_options.appendChild(d);var p=window.getComputedStyle(l,null);visual_options.style.opacity="1";var v=!1,g=!1,w=t(2500);c.addEventListener("click",(function(e){v||("0px"==p.marginLeft?l.style.marginLeft="calc("+r*i+"px - "+r*s+"px)":l.style.marginLeft="calc("+p.marginLeft+" + "+r+"px)",v=!0,setTimeout((function(){v=!1}),500)),n(),g||setTimeout((function(){w=t(2500)}),5e3)})),d.addEventListener("click",(function(){e(),n(),g||setTimeout((function(){w=t(2500)}),5e3)})),l.addEventListener("mouseenter",(function(e){n()}),!1),clearInterval(y)}}),500)}))}})();