(()=>{"use strict";class t{static setCommonConstants(){this.script=document.currentScript,this.loadedCss=[],this.loadedJs=[]}static addCSS(t,e,i=!1,s=null){if(void 0===this.loadedCss&&(this.loadedCss=[]),!t||-1!==this.loadedCss.indexOf(t))return e?e():null;let r=document.createElement("link");return r.type="text/css",r.rel="stylesheet",r.href=t,i&&window!==window.parent&&this.isCrossDomainIframe()?window.parent.document.head.appendChild(r):document.head.appendChild(r),document.head.appendChild(r),"function"==typeof e&&r.addEventListener("load",e),"function"==typeof s&&r.addEventListener("error",s),this.loadedCss.push(t)}static addJS(t,e,i=!1){if(void 0===this.loadedJs&&(this.loadedJs=[]),!t||-1!==this.loadedJs.indexOf(t))return e?e():null;let s=document.createElement("script");return s.type="text/javascript",s.src=t,i&&window!==window.parent&&this.isCrossDomainIframe()?window.parent.document.head.appendChild(s):document.head.appendChild(s),e&&s.addEventListener("load",e),this.loadedJs.push(t)}static openWindow(t){let e=document.createElement("a");return e.href=t,e.target="_blank",e.rel="noopener noreferrer nofollow",e.click()}static getScriptSelector(t){return'[src*=".trustindex."][src*="'+t+'.js"],[data-src*=".trustindex."][data-src*="'+t+'.js"]'}static getScriptKey(t){let e=t.getAttribute("data-src")||t.getAttribute("src"),i=e.replace(/.+\?([^&]+)/,"$1");return i&&i!==e&&-1===i.indexOf("=")?i:null}static getCDNUrl(){if(void 0!==this.cdnUrl&&this.cdnUrl)return this.cdnUrl;let t="https://cdn.trustindex.io/";if(this.script&&this.script.src){let e=this.script.src.split("/");e.pop(),t=e.join("/")+"/"}return-1===t.indexOf("trustindex.")&&(t="https://cdn.trustindex.io/"),this.cdnUrl=t,t}static getWidgetUrl(t){return void 0===t?null:this.getCDNUrl()+"widgets/"+t.substring(0,2)+"/"+t+"/"}static getDecodedHtml(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static getRelativeTime(t,e){let i=e.split("|"),s=i.shift(),r=i.shift(),o=[86400,604800,2419200,31536e3],a=(new Date).getTime()/1e3-t;for(let t=o.length-1;t>=0;t--)if(a>=o[t]){let e=Math.floor(a/o[t]),r=2*t;return e>1&&r++,s.replace("%d",e).replace("%s",i[r])}return r}static getDevicePixelRatio(){let t=1;return void 0!==window.screen.systemXDPI&&void 0!==window.screen.logicalXDPI&&window.screen.systemXDPI>window.screen.logicalXDPI?t=window.screen.systemXDPI/window.screen.logicalXDPI:void 0!==window.devicePixelRatio&&(t=window.devicePixelRatio),Math.min(t,2)}static getDefaultAvatarUrl(){let t=Math.floor(10*Math.random())+1;return this.getCDNUrl()+"assets/default-avatar/noprofile-"+(t<10?"0":"")+t+".svg"}static getPageLanguage(){return(document.documentElement.lang||"en").substr(0,2).toLowerCase()}static getUserLanguage(){return(navigator.language||navigator.userLanguage||this.getPageLanguage()).substr(0,2).toLowerCase()}static isAdminUrl(t){let e=t?new URL(t):location;return/(admin|test)\.trustindex/.test(e.hostname)&&-1===e.href.indexOf("test/widget.html")}static isAdminEditUrl(t){return void 0===t&&(t=location.href),-1!==t.indexOf("widget/edit")}static isCrossDomainIframe(){if(window.parent===window)return!1;let t=new URL(window.parent.location);return t.protocol!==location.protocol||t.hostname!==location.hostname||t.port!==location.port}static isMobileDevice(){return this.isAdminUrl()&&!this.isAdminEditUrl()?!!document.querySelector(".widget-editor.mobile"):/mobi/i.test(navigator.userAgent||navigator.vendor||window.opera)}static isWebpSupported(t){if(void 0!==this.cacheWebpSupported)return t(this.cacheWebpSupported);let e=e=>(this.cacheWebpSupported=e,t(e)),i=new Image;i.onload=()=>e(i.width>0&&i.height>0),i.onerror=()=>e(!1),i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}static waitForVisibility(t,e,i=0){if(t.offsetWidth>0)return i?setTimeout(e,i):e();new ResizeObserver((function(t){t[0].target.offsetWidth>0&&(e(),this.disconnect())})).observe(t)}}var e=(t,e,i)=>new Promise(((s,r)=>{var o=t=>{try{n(i.next(t))}catch(t){r(t)}},a=t=>{try{n(i.throw(t))}catch(t){r(t)}},n=t=>t.done?s(t.value):Promise.resolve(t.value).then(o,a);n((i=i.apply(t,e)).next())}));class i extends t{static resize_widgets(){}static init(){}static init_pager(){-1!==decodeURIComponent(location.href).indexOf("page=testimonial-widgets/tabs/create-widget.php")&&(this.destroyWidgets(),this.initWidgetsFromDom(!0))}static setConstants(){this.setCommonConstants(),this.svgs={good:'',bad:''},this.additionalLogoStyles={"header-logo":{Google:"height: 25px; top: -2px",Facebook:"height: 17px",Trustindex:"height: 19px",Tripadvisor:"height: 24px; top: -2px",Airbnb:"height: 26px; top: -3px",Yelp:"height: 32px; top: -8px",Amazon:"height: 13px; top: 1px",Arukereso:"height: 17px; top: 5px",Vrbo:"height: 20px; top: -2px",BBB:"height: 25px; top: -2px",Expedia:"height: 25px; top: -3px",Ebay:"height: 25px; top: -2px",Sitejabber:"height: 20px; top: 1px",Thumbtack:"height: 25px; top: -3px",Provenexpert:"height: 25px; top: 1px",Hotels:"height: 22px; top: -1px",Zillow:"height: 17px",Yell:"height: 18px",Checkatrade:"height: 15px; top: 2px",Capterra:"height: 15px; top: 2px",Etsy:"height: 20px; top: 1px",WordpressPlugin:"height: 13px; top: 1px",AngiesList:"height: 24px; top: -1px",OnlinePenztarca:"height: 30px; top: -3px",ConsumerAffairs:"height: 30px; top: -3px",Reviewsio:"height: 20px; top: 0px",Foursquare:"height: 15px; top: 3px",Justdial:"height: 15px; top: 3px",Houzz:"height: 20px; top: -3px",Indeed:"height: 17px; top: 0px"},"large-logo":{Facebook:"width: 145px; height: 28px",Google:"width: 110px; height: 35px",Yelp:"width: 95px; height: 46px; top: -5px",Airbnb:"width: 120px; height: 38px",Tripadvisor:"width: 155px; height: 33px",Trustpilot:"width: 140px; height: 34px",Hotels:"width: 152px; height: 30px",Amazon:"width: 120px; height: 25px",Bookatable:"height: 27px; left: 7px",Foursquare:"height: 20px; top: 3px",Trustindex:"width: 152px; height: 26px; top: 3px",Booking:"height: 25px",Opentable:"height: 35px",Capterra:"height: 34px",Thumbtack:"height: 34px",Fresha:"height: 21px",Expedia:"height: 44px",Mobilede:"height: 35px",Checkatrade:"height: 22px",Pricerunner:"height: 21px",Easyweddings:"height: 50px; top: 3px",Whichtrustedtraders:"width: 80px; height: 55px; top: -15px; left: 10px",Abia:"width: 100px; height: 41px",WordpressPlugin:"height: 35px",Zoover:"height: 22px",Arukereso:"height: 25px","Arukereso-ro":"height: 29px",Pricespy:"height: 39px","Pricespy-dk":"height: 42px","Pricespy-fi":"height: 35px","Pricespy-fr":"height: 31px","Pricespy-no":"height: 43px",Szallashu:"height: 26px","Szallashu-com":"height: 29px","Szallashu-cz":"height: 47px","Szallashu-pl":"height: 34px","Szallashu-ro":"height: 29px"},"small-logo":{Facebook:"width: 72px; height: 15px; top: 0px",Google:"width: 62px; height: 20px; top: 1px",Yelp:"width: 45px; height: 22px; top: -3px",Airbnb:"width: 64px; height: 20px",Tripadvisor:"width: 97px; height: 21px; top: 1px",Trustpilot:"width: 65px; top: 2px",Hotels:"width: 100px; height: 20px",Amazon:"width: 68px; height: 20px;",Bookatable:"width: 83px; height: 15px; top: 1px",Foursquare:"width: 98px; height: 13px; top: 3px",Trustindex:"width: 95px; top: 2px",Booking:"width: 89px; height: 15px; top: 2px",Opentable:"width: 100px; height: 23px; top: -1px",Capterra:"width: 79px; height: 18px; top: 1px",Thumbtack:"width: 88px; height: 20px",Fresha:"width: 93px; height: 13px; top: 2px; left: 1px",Expedia:"width: 69px; height: 20px; top: 1px",Zillow:"width: 76px",Reco:"width: 76px",Mobilede:"width: 68px; top: 2px",Checkatrade:"width: 110px",Pricerunner:"width: 102px; height: 14px; top: 1px",Easyweddings:"width: 60px; height: 20px",Whichtrustedtraders:"width: 34px; height: 23px; top: -1px",Abia:"width: 40px",Ebay:"top: 2px",WordpressPlugin:"height: 12px; top: 1px",Arukereso:"width: 92px; height: 15px; top: 3px","Arukereso-bg":"width: 89px; height: 15px; top: 3px","Arukereso-ro":"width: 77px; height: 15px; top: 3px",Pricespy:"width: 69px; height: 18px","Pricespy-dk":"width: 64px; height: 18px","Pricespy-fi":"width: 77px; height: 18px","Pricespy-fr":"width: 88px; height: 18px","Pricespy-no":"width: 63px; height: 18px","Pricespy-nu":"width: 63px; height: 18px",Szallashu:"width: 76px; height: 13px; top: 2px","Szallashu-com":"width: 95px; height: 18px","Szallashu-cz":"width: 61px; height: 19px; top: 3px","Szallashu-pl":"width: 74px; height: 17px; top: 3px","Szallashu-ro":"width: 100px; height: 19px"}},this.richSnippetLoaded=document.querySelectorAll('script[src*=".trustindex.io/assets/js/richsnippet.js"], script[type="application/ld+json"][data-trustindex="1"]').length>0}static loadWidgetsFromDom(){return e(this,null,(function*(){document.querySelectorAll(this.getScriptSelector("loader")).forEach((t=>{if(t.getAttribute("data-ti-widget-inited"))return;t.setAttribute("data-ti-widget-inited",!0);let i=this.getScriptKey(t);if(!i)return;let s=Boolean(t.getAttribute("data-enable-delay-load"));if("SCRIPT"===t.tagName){let e=document.createElement("div");e.key=t.key,t.replaceWith(e),t=e}t.key=i,t.isTriggerLoad=function(t=600){let e=this.getBoundingClientRect();return e.right<=(window.innerWidth||document.documentElement.clientWidth)+t&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)+t},(t=>{e(this,null,(function*(){let e=yield this.getWidgetHtml(t);if(!1===e)return t.innerHTML='\n\t\t\t\t\t\tWidget not found! Probably it is already deleted or there is typo in its ID.\n\t\t\t\t\t\tWe suggest that you log in to the Trustindex system and follow the widget configuration instructions.\n\t\t\t\t\t\tOr, if you don\'t have an account, create one for free at www.trustindex.io\n\t\t\t\t\t';if(!e)return t.replaceWith(document.createComment("Trustindex widget ("+t.key+") is empty here."));if(/style="[^"]*border: 4px dashed red[^"]*"/.test(e))return t.innerHTML=e;s||(s=-1!==e.indexOf('data-delay-load="1" class="ti-widget'));let i=/(?:data-layout-category="[^"]*floating[^"]*"|data-layout-id="(?:17|21|52|53)")/.test(e);if(!t.closest("head")||i){if(t.contentHtml=e,!this.richSnippetLoaded){let t=/data-rich-snippet="([^"]+)"/.exec(e);t&&t[1]&&(this.richSnippetLoaded=!0,this.addJS(this.getCDNUrl()+"assets/js/richsnippet.js?"+t[1]))}t.isTriggerLoad(100)?s?window.tiElementToWaitForActivity.push(t):new TrustindexWidget(null,t):i?new TrustindexWidget(null,t):(t.isWaitForVisibility=!0,window.tiElementToWaitForActivity.push(t))}}))})(t)}))}))}static initWidgetsFromDom(t=!1,e,i){let s=this.widgetsForInit||document.querySelectorAll(".ti-widget:not(.ti-certificate):not(.ti-feed-widget)"+(t?"":":not([data-trustindex-widget])"));void 0!==e&&s.length?(void 0===this.widgetsForInit&&(this.widgetsForInit=s),new TrustindexWidget(s[e]),++ethis.initWidgetsFromDom(t,e,i)),20):(delete this.widgetsForInit,i&&i())):(s.forEach((t=>new TrustindexWidget(t))),i&&i())}static getWidgetHtml(t){return e(this,null,(function*(){let e=this.getWidgetUrl(t.key)+"content.html";if("wp-widget"===t.key){let i=t.getAttribute("data-template-id");if(i){let e=document.getElementById(i);if(e)return t.removeAttribute("data-template-id"),e.remove(),e.innerHTML.replace(/decoding="async"/g,"").replace(/ (?:src|srcset|data-src|data-srcset|data-ti-src|data-ti-srcset|consent-original-src-_|consent-original-srcset-_|consent-original-data-src-_|consent-original-data-srcset-_)="(?!http)[^"]*"/g,"").replace(/data-ti-src="[^"]+lazy\.(png|jpg|jpeg|gif|svg)"/g,"").replace(/consent-original-class-_="/g,'class="').replace(/consent-original-src-_="/g,'src="').replace(/consent-original-srcset-_="/g,'srcset="').replace(/consent-original-data-src-_="/g,'data-src="').replace(/consent-original-data-srcset="/g,'data-srcset="').replace(/