function FindApi(){var e=this;e._applicationUrl="/",e._serviceApiBaseUrl="",e._trackId="",e._trackParam="_t_",e._dontTrackQueryParam="_t_dtq",e._allowTrackingCookieName=null,e._bufferTrackRequest=!0,e.setApplicationUrl=function(t){e._applicationUrl=t},e.setServiceApiBaseUrl=function(t){e._serviceApiBaseUrl=t},e.setAllowTrackingCookieName=function(t){e._allowTrackingCookieName=t},e.setTrackParam=function(t){e._trackParam=t},e.setDontTrackQueryParam=function(t){e._dontTrackQueryParam=t},e.bindWindowEvents=function(){window.history&&(window.onbeforeunload=function(){var t=document.location.href;t.indexOf("q=")>0&&-1==t.indexOf(e._dontTrackQueryParam+"=")&&window.history.replaceState(window.history.state,window.document.title,t+(t.indexOf("?")>0?"&":"?")+e._dontTrackQueryParam+"=true")}),window.addEventListener("load",e.bindClickEvents(),!1)},e.bindClickEvents=function(){var t=e._toArray(document.getElementsByTagName("A")),r=document.createElement("A");r.href=document.location.href;for(var n=function(t){for(var n=!1,a=t.href,o=e._getTrackQueryParamsFromUrl(a),i=0;o.trackQueryParams.length>i;i++)if(0==o.trackQueryParams[i].indexOf("id")){n=!0;break}if(o.trackQueryParams.length>0&&n){var c=document.createElement("A");if(c.href=a,"/"!=e._applicationUrl&&r.hostname+e._applicationUrl!=c.hostname+"/"+c.pathname.split("/")[1]+"/"||"/"===e._applicationUrl){if(-1!=a.split("?")[0].indexOf(e._serviceApiBaseUrl+"_click"))return;t.href=e._getUriWithoutTrackParams(a,o),t.addEventListener("mousedown",function u(t){this.addEventListener("mouseup",function r(n){if(t.target==n.target&&t.which==n.which&&(1==n.which||2==n.which)){this.removeEventListener("mousedown",u),this.removeEventListener("mouseup",r);var a=e._constructTrackUrl(o.trackQueryParams);e._sendEvent(a,!0)}})})}}},a=0;t.length>a;a++)n(t[a])},window.findApiBindClickEvents=e.bindClickEvents,e.bindAClickEvent=function(){},e._getUriWithoutTrackParams=function(e,t){return t.trackQueryParams.length>0&&t.nonTrackQueryParams.length>0?e.split("?")[0]+"?"+t.nonTrackQueryParams.join("&"):t.trackQueryParams.length>0?e.split("?")[0]:void 0},e._getTrackQueryParamsFromUrl=function(t){var r=t.split("?")[1]||"",n=r.split("&"),a=[],o=[];e._bufferTrackRequest=!0;for(var i=0;n.length>i;i++){var c=n[i].split("=");if(decodeURIComponent(c[0])==e._dontTrackQueryParam&&"true"==c[1]&&(e._bufferTrackRequest=!1),decodeURIComponent(c[0]).slice(0,e._trackParam.length)==e._trackParam){var u=decodeURIComponent(c[0]).slice(e._trackParam.length);a.push(encodeURIComponent(u)+"="+c[1])}else o.push(n[i])}return{trackQueryParams:a,nonTrackQueryParams:o}},e._constructTrackUrl=function(t){return e._serviceApiBaseUrl+"_track?"+t.join("&")},e.processEventFromCurrentUri=function(){var t=document.location.href,r=e._getTrackQueryParamsFromUrl(t);r.trackQueryParams.length>0&&(e._bufferTrackRequest&&e._bufferEvent(e._constructTrackUrl(r.trackQueryParams)),window.history&&window.history.replaceState(window.history.state,window.document.title,e._getUriWithoutTrackParams(t,r)))},e._toArray=function(e){var t=[];if(!e||!e.length)return t;for(var r=0;e.length>r;r++)r in e&&t.push(e[r]);return t},e._getCookies=function(e,t){var r,n,a,o=[],i=document.cookie.split(";");for(r=0;i.length>r&&(n=i[r].substr(0,i[r].indexOf("=")),n=n.replace(/^\s+|\s+$/g,""),e&&!e(n)||(a=i[r].substr(i[r].indexOf("=")+1),o.push({name:n,value:decodeURIComponent(a)}),!t||0!==--t));r++);return o},e._getCookie=function(t){var r=e._getCookies(function(e){return t===e},1);return r.length?r[0].value:void 0},e._setCookie=function(e,t,r){var n=new Date;n.setDate(n.getDate()+r),t=encodeURIComponent(t)+"; Path=/"+(null===r?"":"; expires="+n.toUTCString()),document.cookie=e+"="+t},e._deleteCookie=function(e){document.cookie=e+"=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT"},e._debug=function(e){window.console&&console.log(e)},e._getBufferedEvents=function(){return e._getCookies(function(e){return 0===e.indexOf("_findEvent")})},e._bufferEvent=function(t){e._setCookie("_findEvent"+e._createUUID(),t,3650)},e._deleteBufferedEvent=function(t){e._deleteCookie(t)},e.sendBufferedEvents=function(){for(var t=e._getBufferedEvents(),r=0;t.length>r;r++)e._sendEvent(t[r].value,!1),e._deleteBufferedEvent(t[r].name)},e._sendEvent=function(t,r){const n="keepalive"in new Request("");if(r&&!n)return e._bufferEvent(t),void 0;if(window.fetch)return fetch(t,{method:"GET",keepalive:!0,credentials:"same-origin",headers:{Accept:"application/json"}}).then(function(e){return e.json()}).then(function(e){return e}).catch(function(e){return e}),void 0;if(window.XMLHttpRequest){var a=new XMLHttpRequest;if("withCredentials"in a)return a.open("GET",t,!1),a.send(),void 0}if(window.XDomainRequest){var o=new XDomainRequest;return o.open("GET",t),o.send(),void 0}var i=new Image(1,1);i.src=t},e._createUUID=function(){for(var t="",r=e._PRNG();32>t.length;t+=Math.floor(4294967295*r()).toString(16));return[t.substr(0,8),t.substr(8,4),"4"+t.substr(12,3),"89AB"[Math.floor(4*Math.random())]+t.substr(16,3),t.substr(20,12)].join("-")},e._PRNG=function(){return function(e){var t=0,r=0,n=0,a=1,o=[],i=0,c=4022871197,u=function(e){e=""+e;for(var t=0;e.length>t;t++){c+=e.charCodeAt(t);var r=.02519603282416938*c;c=r>>>0,r-=c,r*=c,c=r>>>0,r-=c,c+=4294967296*r}return 2.3283064365386963e-10*(c>>>0)};t=u(" "),r=u(" "),n=u(" ");for(var s=0;8>s;s++)o[s]=u(" ");0===e.length&&(e=[+new Date]);for(var f=0;e.length>f;f++)for(t-=u(e[f]),0>t&&(t+=1),r-=u(e[f]),0>r&&(r+=1),n-=u(e[f]),0>n&&(n+=1),s=0;8>s;s++)o[s]-=u(e[f]),0>o[s]&&(o[s]+=1);var d=function(){var e=2091639;i=0|8*o[i];var c=o[i],u=e*t+2.3283064365386963e-10*a;return t=r,r=n,n=u-(a=0|u),o[i]-=n,0>o[i]&&(o[i]+=1),c};return d.uint32=function(){return 4294967296*d()},d.fract53=function(){return d()+1.1102230246251565e-16*(0|2097152*d())},d.addNoise=function(){for(var e=arguments.length-1;e>=0;e--)for(s=0;8>s;s++)o[s]-=u(arguments[e]),0>o[s]&&(o[s]+=1)},d.version="Kybos 0.9",d.args=e,d}(Array.prototype.slice.call(arguments))}}