!function(){"use strict";var e={categoryMap:{request:"request"},tagMap:{actName:"act.name",actDeveloper:"act.developer"},maxBreadcrumbs:50,sampleRate:.3,autoCategoryRule:{},ignoreEventRule:[/vid_mate_check is not defined/],ignoreBreadcrumbRule:[],changeEvent:function(e){return e}},o=Object.assign({},{sampleRate:.05,costTimeLimit:2e4,api:"https://front-perf.like-video.com/api/call",reportWaitMilliseconds:2e3},{sampleRate:.2});function n(e){return!(!e||!e.countryCodeMap&&!e.pageHostMap)}function t(){if("1"==localStorage.getItem("openDebugMode")){var e=Array.prototype.slice.call(arguments),o=["%c debugLog-common-config ","border:1px solid red;color: blue; font-weight: bold;"];console.log.apply(this,o.concat(e))}}-1!=location.href.indexOf("openDebugMode=1")?localStorage.setItem("openDebugMode","1"):-1!=location.href.indexOf("openDebugMode=0")&&localStorage.removeItem("openDebugMode");var r="_remote_xhr_replace_conf_";function i(e,o,i){if(!(!1 in window)&&"function"==typeof window.XMLHttpRequest){"function"!=typeof o&&(o=function(){}),"function"!=typeof i&&(i=function(){}),e=e||"";var a=new XMLHttpRequest;a.open("GET",e,!0),a.onreadystatechange=function(){if(t("xhr.readyState",a.readyState),t("xhr.status",a.status),4===a.readyState)if(200===a.status){var e,c=a.responseText;try{"string"==typeof c&&(e=JSON.parse(c)),n(e)?(!function(e){(e=e||{}).extraOptions=e.extraOptions||{},e.extraOptions.lastFetchTimestamp=Date.now(),e.extraOptions.expireSeconds=Number(e.extraOptions.expireSeconds)||600,e.extraOptions.expireSeconds>3600&&(e.extraOptions.expireSeconds=3600),window.localStorage.setItem(r,JSON.stringify(e))}(e),o(c)):i(c)}catch(e){i(e)}}else i("respError")},a.onerror=function(){t("请求onerror",e),i("onerror")},a.timeout=1e4,a.ontimeout=function(){t("请求ontimeout",e),i("ontimeout")},a.send()}}function a(){var e={};try{e=window.localStorage.getItem(r)||"{}",e=JSON.parse(e)}catch(e){}return e}function c(e,o){var n=(a()||{}).extraOptions||{},r=Number(n.lastFetchTimestamp)||0,c=Number(n.expireSeconds)||600,s=Date.now(),d=function(){var e=["/live/transparent_cdn/HostConf.json","https://static-act.like-video.com/live/transparent_cdn/HostConf.json","https://static-act.likee.video/live/transparent_cdn/HostConf.json"],n="_remote_xhr_available_url_";e=function(e,o){var n=e.indexOf(o);if(n>-1){var t=e.splice(n);e=t.concat(e)}return e}(e,localStorage.getItem(n)),t("拉取配置顺序",JSON.stringify(e));var r=0;!function t(){if(r-1?"&":"?",c+u+d),(function(){localStorage.setItem(n,a)}),(function(){r+=1,t()}))}else"function"==typeof o&&o();var c,d,u}()};c>3600&&(c=3600),(c<0||e||(s-r)/1e3>=c)&&d()}window.initFetchXhrConfig=c;var s=(a()||{}).extraOptions||{},d=Number(s.delayFetchSeconds)||0;setTimeout((function(){c(!1,(function(){t("遍历执行完毕")}))}),1e3*d);var u={countryCodeMap:{},pageHostMap:{},extraOptions:{lastFetchTimestamp:0,expireSeconds:600,delayFetchSeconds:1}};function p(e,o){for(var n in o)o.hasOwnProperty(n)&&(o[n]instanceof Object&&n in e?p(e[n],o[n]):e[n]=o[n]);return e}function l(){var e=a(),o=p(u,e),n=p(o,window.$_XHR_REPLACE_OPTIONS||{});return window.$_FinalXhrReplaceConf=n,n}var f=function(){try{var e=navigator.userAgent,o=(e=(e=e.replace("__nimbus","")).replace("__webkit","")).match(/BIGO-baiguoyuan \((.+)\)/i);if(o){var n=o[1],t={},r=n.split("__");return["phoneName","appName","appVersion","sysName","sysVersion","appEnv","deviceid","userid","appVersionCode","countryCode"].forEach((function(e,o){t[e]=r[o]})),t}return{}}catch(e){return{}}}().countryCode;function m(e,o){var n=/^(http:\/\/|https:\/\/|wss:\/\/|\/\/)([a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?)/.exec(e),r=n&&n[2];if(!r)return e;var i,a,c,s=l(),d=!1,u=(i=o&&o.customCountryCode||f,a=(s.countryCodeMap||{})[r]||{},(c="string"==typeof a?a:a[i])?e.replace(r,c):a.other?e.replace(r,a.other):""),p=function(){var o=(s.pageHostMap||{})[r]||{},n=location.host,t=("string"==typeof o?o:o[n])||o.other;if(t){if(0===t.indexOf("/")){var i=new RegExp("^(http://|https://|wss://|//)".concat(r),"");return d=!0,e.replace(i,t)}return e.replace(r,t)}return""}(),m="";return m=f?d?p||u||e:u||p||e:p||e,t("=============== 【begin doBlockHostReplace】 ================"),t("originApiUrl",e),t("finalApiUrlFromCCMap",u),t("finalApiUrlFromHostMap",p),t("finalUrl",m),t("=============== 【endof doBlockHostReplace】 ================"),m}function v(e,o,t){var r=e,i=o;if(t=t||{},n(l())){var a=(o||"")+e;o&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(e)?i=m(o,t):r=m(e,t);var c=(i||"")+r;a!==c&&(console.info("替换前",a,"extraParams: ",JSON.stringify(t)),console.info("替换后",c))}return{url:r,baseURL:i}}window.doBlockHostReplace=v,"XMLHttpRequest"in window&&function(e,o,n){if(o in e){var t=n(e[o]);if("function"==typeof t)try{t.prototype=t.prototype||{}}catch(e){}e[o]=t}}(XMLHttpRequest.prototype,"open",(function(e){return function(){for(var o=arguments.length,n=new Array(o),t=0;t0)for(var r=0;r-1&&(i.onload=function(){o(2)},i.addEventListener("load",(function(){o(2)})))}}))}))).observe(document,{childList:!0,subtree:!0})}catch(e){console.error("【commonVendorObserver】",e)}}(),setTimeout((function(){void 0!==e&&e.disconnect&&e.disconnect()}),2e4))}(),window.$_SENTRY_OPTIONS=e,window.$_PERF_OPTIONS=o;var w=v(o&&o.api||"");w&&w.url&&(window.$_JSSDK_OPTIONS=window.$_JSSDK_OPTIONS||{},window.$_JSSDK_OPTIONS.api=w.url,window.$_PERF_OPTIONS=window.$_PERF_OPTIONS||{},window.$_PERF_OPTIONS.api=w.url)}();