!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";window.__JSSDK_VERSION__={SDKVersion:"3.1.2",SDKCDNVersion:"1.5.16",CommitHash:""};var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var i,r,o,a=t(n((function(e){function t(e,t,n,i,r,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(i,r)}e.exports=function(e){return function(){var n=this,i=arguments;return new Promise((function(r,o){var a=e.apply(n,i);function s(e){t(a,r,o,s,c,"next",e)}function c(e){t(a,r,o,s,c,"throw",e)}s(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0}))),s=n((function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=t&&t.prototype instanceof g?t:g,o=Object.create(r.prototype),a=new T(i||[]);return o._invoke=function(e,t,n){var i=f;return function(r,o){if(i===h)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===f)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=h;var c=l(e,t,n);if("normal"===c.type){if(i=n.done?p:d,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=p,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",v={};function g(){}function m(){}function _(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(x([])));w&&w!==n&&i.call(w,o)&&(y=w);var k=_.prototype=g.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(r,o,a,s){var c=l(e[r],e,o);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var r;this._invoke=function(e,i){function o(){return new t((function(t,r){n(e,i,t,r)}))}return r=r?r.then(o,o):o()}}function E(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var r=l(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,v;var o=r.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(z,this),this.reset(!0)}function x(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),u=i.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;I(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:x(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),c=n((function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}))),f=t(n((function(e){e.exports=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i=0||(r[n]=e[n]);return r},e.exports.default=e.exports,e.exports.__esModule=!0})));!function(e){e.userCaptureScreenObserved="userCaptureScreenObserved",e.onWatermarkChangeObserved="onWatermarkChange",e.onDownloadTaskStateChange="onDownloadTaskStateChange",e.nfcFoundDevice="nfcFoundDevice"}(i||(i={})),function(e){e.IOS="ios",e.ANDROID="android",e.MAC="mac",e.WINDOWS="windows"}(r||(r={})),function(e){e.CDN="cdn",e.NPM="npm",e.DEV="dev"}(o||(o={}));var d=function(e){var t;if(e.includes("Lark")||e.includes("Feishu"))return null==(t=e.match(/(lark|feishu|lark-staging|feishu-staging|lark-prerelease|feishu-prerelease|lark-oversea)\/([\d.]+)/i))?void 0:t[2]},h={versions:function(){var e=navigator.userAgent,t=navigator.platform,n=/(Android|iPhone|iPad|iPod|iOS)/i.test(e),i=d(e),r=e.includes("Lark")||e.includes("Feishu"),o=i&&m(i,"3.46.0")<0,a=i&&m(i,"3.46.0")>=0&&e.includes("WebApp");return{trident:e.includes("Trident"),presto:e.includes("Presto"),webKit:e.includes("AppleWebKit"),gecko:e.includes("Gecko")&&!e.includes("KHTML"),mobile:!!e.match(/AppleWebKit.*Mobile.*/)||!!e.match(/AppleWebKit/),ios:!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:e.includes("Android")||e.includes("Linux"),iPhone:e.includes("iPhone")||e.includes("Mac"),iPad:e.includes("iPad"),webApp:!e.includes("Safari"),PCFeishu:!n&&r&&(o||a),mobileFeishu:n&&r,larkVersion:d(e),mac:t.includes("Mac"),win:t.includes("Win")}}()};function p(){return new Promise((function(e){var t=0;!function n(){var i,r;(null==(i=window.webkit)||null==(r=i.messageHandlers)?void 0:r.invoke)||window.WebViewJavascriptBridge||t>100?e(0):(setTimeout(n,10+t),t++)}()}))}function v(e){return Object.prototype.toString.call(e).slice(8,-1)}function g(e,t){t?console.warn("銆怘5-JS-SDK銆�: "+e):console.error("銆怘5-JS-SDK銆�: "+e)}function m(e,t){for(var n=e.replace(/-\d*$/,"").split(".").map((function(e){return+e})),i=t.replace(/-\d*$/,"").split(".").map((function(e){return+e})),r=0;ri[r])return 1;if(n[r]255||(i=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255)throw new TypeError('Failed to execute "btoa" on "Window": The string '+e+" to be encoded contains characters outside of the Latin1 range.");o+=C.charAt((t=n<<16|i<<8|r)>>18&63)+C.charAt(t>>12&63)+C.charAt(t>>6&63)+C.charAt(63&t)}return s?o.slice(0,s-3)+"===".substring(s):o},T=z.atob||function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!E.test(e))throw new TypeError('Failed to execute "atob" on "Window": The string '+e+" to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,i,r="",o=0;o>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return r};function x(e){for(var t="",n=new Uint8Array(e),i=n.byteLength,r=0;r0){for(var o=0;o=1?1:0},t._getMatchedRuleInOrderedRules=function(e){return this._orderedRules.find((function(t){return t.match(e)}))},t._parseRules=function(e){return Array.isArray(e)?e=e.map((function(e){if(ee.object(e)){var t=e[H.priority],n=e[H.sampleRate],i=e[H.filters];return ee.number(t)||(t=0),ee.number(n)||(n=void 0),i=Array.isArray(i)?i.map((function(e){if(ee.object(e)){var t=e,n=t[H.key],i=t[H.values];return ee.string(n)&&Array.isArray(i)?e=new oe({key:n,values:i}):void 0}})).filter((function(e){return e})):[],new re({priority:t,sampleRate:n,filters:i})}})).filter((function(e){return e})):[]},e}(),se=function(){function e(t){var n=this;if(this._domainToNameRegistry=new Map,this._domainToParamInjectorRegistry=new Map,this._domainToNameCache=new Map,t instanceof e)return t;var i=t||{},r=i.defaultName,o=void 0===r?Q:r,a=i.log,s=i.report,c=void 0===s?X:s,u=i.commonMetrics,l=void 0===u?{}:u,f=i.commonCategories,d=void 0===f?{}:f,h=i.commonTags,p=void 0===h?[]:h,v=i.defaultPlatform,g=void 0===v?"Slardar":v,m=i.domainToNameMap,_=i.domainToParamInjectorMap;this.defaultName=String(o),this.defaultPlatform=g,this._log=a,this._report=c,this.commonMetrics=l,this.commonCategories=d,this.commonTags=new Set(p),m&&Object.entries(m).forEach((function(e){var t=e[0],i=e[1];n.registerEvent(i,t)})),_&&Object.entries(_).forEach((function(e){var t=e[0],i=e[1];n.registerParamInjector(t,i)}))}var t=e.prototype;return t.setRemoteConfig=function(e){this._remoteConfig=e},t.getRemoteConfig=function(){return this._remoteConfig?this._remoteConfig:this.constructor.globalRemoteConfig},t.log=function(e){ee.function(this._log)&&this._log(e)},t.report=function(e){var t,n=this.getRemoteConfig(),i=e.name,r=e.metrics,o=e.categories,a=Object.assign(Object.assign(((t={})[$]=i,t),r),o);n.getSampleRate(a)<1||this._report(e)},t.registerEvent=function(e,t){if(this._domainToNameRegistry.get(t)!==e){this._domainToNameRegistry.set(t,e);for(var n,i=l(this._domainToNameCache.keys());!(n=i()).done;){var r=n.value;r.startsWith(t)&&this._domainToNameCache.delete(r)}}},t.getNameByDomain=function(e){return this._findName(e)||this.defaultName},t.registerParamInjector=function(e,t){this._domainToParamInjectorRegistry.set(e,t)},t.applyParamInjectorByDomain=function(e,t){for(var n=e.split("."),i=n.length,r=1;r<=i;r++){var o=n.slice(0,r).join("."),a=this._domainToParamInjectorRegistry.get(o);ee.function(a)&&a(t)}},t._findName=function(e){if(this._domainToNameCache.has(e))return this._domainToNameCache.get(e);for(var t,n=e.split("."),i=n.length,r=0;r=20||c&&c>=j.error?s():this.waitingForReport||(this.waitingForReport=!0,r=ie().setTimeout((function(){s()}),2e3))}},t.invokeLog=function(e){ee.function(this.config.log)&&this.config.log(e)},t.invokeReport=function(e){ee.function(this.config.report)&&this.config.report(e)},t._setConfig=function(e){this.config=new se(e)},t._getName=function(e){var t=e.getValue(B.monitorDomain);return e.getName()||t&&this.config.getNameByDomain(String(t))||this.config.defaultName},t._getPlatform=function(e){return e.platform||this.config.defaultPlatform},e}();ce.default=new ce;var ue,le,fe=function(){function e(t){if(t instanceof e)return t;var n=t||{},i=n.domain,r=n.code,o=n.level,a=n.message;ne(this,"version",1),ne(this,"domain",String(i)),ne(this,"code",Number(r)),ne(this,"ID",String(this.generateID())),ne(this,"level",o),ne(this,"message",String(a))}var t=e.prototype;return t.equals=function(t){return t instanceof e&&t.ID===this.ID},t.toJSON=function(){return{domain:this.domain,code:this.code,level:this.level,message:this.message}},t.generateID=function(){return this.version+"-"+this.domain+"-"+this.code},e}(),de=function(){function e(e){this.metrics={},this.categories={},this.internalData={},this.tags=new Set,this._time=0,this._startTime=0,this._endTime=0,this._flushed=!1;var t=e||{},n=t.service,i=t.name,r=void 0===i?Q:i,o=t.code,a=t.platform,s=t.metrics,c=t.categories,u=t.internalData;this.service=n?new ce(n):ce.default,this.name=r,this._platform=a,o&&(this.code=new fe(o)),this.categories=Object.assign(Object.assign({},this.service.getConfig().commonCategories),c),this.metrics=Object.assign(Object.assign({},this.service.getConfig().commonMetrics),s),this.tags=new Set(this.service.getConfig().commonTags),this.internalData=Object.assign({},u)}var t=e.prototype;return t.addMetricValue=function(e,t){return ee.undefined(t)||(this.metrics[e]=t),this},t.addCategoryValue=function(e,t){return ee.undefined(t)||(this.categories[e]=t),this},t.addTag=function(e){return ee.undefined(e)||this.tags.add(e),this},t.addMap=function(e){var t=this;return void 0===e&&(e={}),Object.entries(e).forEach((function(e){var n=e[0],i=e[1];ee.undefined(i)||(ee.number(i)?t.metrics[n]=i:t.categories[n]=i)})),this},t.tracing=function(e){return ee.undefined(e)||this.addCategoryValue(B.traceId,e),this},t.flush=function(e){if(!this._flushed){this._flushed=!0;var t=this.getInternalData(),n=t.logEnabled,i=void 0===n||n,r=t.reportEnabled,o=void 0===r||r,a=this.code||(this.hasErrorInfo()?this.codeIfError:void 0);ee.undefined(this.level)&&a&&a.level&&this.setLevel(a.level),a&&(this.addCategoryValue(B.monitorDomain,a.domain),this.addMetricValue(B.monitorCode,a.code),this.addCategoryValue(B.monitorMessage,a.message)),this.tags&&this.addCategoryValue(B.monitorTags,this.tagsInline()),this.time<=0&&this.setTime(Date.now()),o&&(e||this.service).reportTo(this),i&&this.service.log(this)}},t.flushWithThrottle=function(){this._flushed||(this._flushed=!0,this.service.flushWithThrottle(this))},t.setMonitorCode=function(e){return ee.undefined(e)||(this.code=new fe(e)),this},t.setMonitorCodeIfError=function(e){return ee.undefined(e)||(this.codeIfError=new fe(e)),this},t.setLevel=function(e){return ee.undefined(e)||(this.level=e,this.addMetricValue(B.monitorLevel,e)),this},t.setErrorCode=function(e){return ee.undefined(e)||this.addCategoryValue(B.errorCode,String(e)),this},t.setErrorMessage=function(e){return ee.undefined(e)||this.addCategoryValue(B.errorMsg,String(e)),this},t.setError=function(e){if(ee.undefined(e))return this;var t=e.message,n=e.fileName,i=e.lineNumber,r=e.columnNumber,o=e.stack,a=e.code,s=e.monitorCode;return ee.string(t)&&this.addCategoryValue(B.errorMsg,t),ee.string(n)&&this.addCategoryValue(B.monitorFile,n),ee.string(o)&&this.addCategoryValue(B.monitorStack,o),ee.number(a)&&this.addMetricValue(B.errorCode,a),ee.number(i)&&this.addMetricValue(B.monitorLine,i),ee.number(r)&&this.addMetricValue(B.monitorColumn,r),s&&this.setMonitorCode(s),this},t.setTime=function(e){return ee.undefined(e)||(this._time=e,this.addMetricValue(B.time,e)),this},t.setPlatform=function(e){return e&&(this._platform=e),this},t.timing=function(e){var t=Date.now();return this._startTime>0?(this._endTime=t,this.addMetricValue(e||B.duration,this._endTime-this._startTime)):this._startTime=t,this},t.setDuration=function(e){return ee.undefined(e)||this.addMetricValue(B.duration,e),this},t.getCode=function(){return this.code},t.getName=function(){return this.name},t.getMetrics=function(){return Object.assign({},this.metrics)},t.getCategories=function(){return Object.assign({},this.categories)},t.getInternalData=function(){return this.internalData},t.getData=function(){return Object.assign(Object.assign({},this.metrics),this.categories)},t.getValue=function(e){return this.metrics[e]||this.categories[e]},t.setResultType=function(e){return this.addCategoryValue(B.resultType,e),this},t.setResultTypeSuccess=function(){return this.setResultType(R.success),this},t.setResultTypeFail=function(){return this.setResultType(R.fail),this},t.setResultTypeCancel=function(){return this.setResultType(R.cancel),this},t.setResultTypeTimeout=function(){return this.setResultType(R.timeout),this},t.getLevel=function(){return this.level},t.getMonitorId=function(){return this.code&&this.code.ID},t.getMonitorDomain=function(){return this.code&&this.code.domain},t.toJSON=function(){return{name:this.name,categories:this.getCategories(),metrics:this.getMetrics()}},t.addInternalData=function(e){return Object.assign(this.internalData,e),this},t.hasErrorInfo=function(){return!ee.undefined(this.getValue(B.errorCode))||!ee.undefined(this.getValue(B.errorMsg))},t.tagsInline=function(){return 0===this.tags.size?"":Array.from(this.tags).reduce((function(e,t){return""+e+(t?K+t:"")}))},q(e,[{key:"time",get:function(){return this._time}},{key:"platform",get:function(){return this._platform}}]),e}();!function(e){e.getSdkConfigTimeout="h5jssdk_get_sdk_config_timeout",e.getSdkConfigError="h5jssdk_get_sdk_config_error",e.authenticationFailure="h5jssdk_authentication_failure"}(ue||(ue={})),function(e){e.success="success",e.fail="fail",e.cancel="cancel",e.timeout="timeout"}(le||(le={}));var he,pe="js.open_platform.web",ve=((he={})[ue.getSdkConfigTimeout]={domain:pe+".op_web_js_script_error",code:10001,level:j.error,message:"h5jssdk_get_sdk_config_timeout"},he[ue.getSdkConfigError]={domain:pe+".op_web_js_script_error",code:10002,level:j.error,message:"h5jssdk_get_sdk_config_error"},he[ue.authenticationFailure]={domain:pe+".op_web_js_script_error",code:10003,level:j.error,message:"h5jssdk_authentication_failure"},he[le.success]={domain:pe+".api",code:1e4,level:j.normal,message:"api_success"},he[le.fail]={domain:pe+".api",code:10002,level:j.error,message:"api_fail"},he[le.cancel]={domain:pe+".api",code:10001,level:j.warn,message:"api_cancel"},he[le.timeout]={domain:pe+".api",code:10003,level:j.error,message:"api_timeout"},he.DEFAULT={domain:pe,code:1e4,level:j.warn,message:"undefined_default_code"},he),ge="op_web_js_script_error",me="op_web_api_invoke_result",_e=[],ye=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=ve.DEFAULT),new de(e?{name:e,code:new fe(t)}:{name:"undefined_default_code",code:new fe(ve.DEFAULT)})},be=function(){return(be=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function ke(){for(var e=[],t=0;t>e/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,Je)}var He=function(){return Je().replace(/-/g,"").slice(0,19)},Ke=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof n){var i,r=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);i=e.split(o);for(var a=0;a7344e6)return void this._requestWebId();if(r>432e7)return void this._updateWebId(e)}this._complete(e,t,n)},e.prototype._complete=function(e,t,n){this.cfg.envInfo.user.ssid=n,this.cfg.envInfo.user.web_id=e,this.cfg.envInfo.user.user_unique_id=t,this.tokenReady=!0},e.prototype._requestWebId=function(){this.isNoWebid?this._setTokenId(He(),"","",!0):this._fetchWebId(this.fetchUrl,!1)},e.prototype._updateWebId=function(e){var t=""+this.domain+Oe+"/"+e+"/update";this._fetchWebId(t,!0)},e.prototype._fetchWebId=function(e,t){var n=this;this.isGetWebId=!0,qe(e,5e3,{app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""},this.config.app_key,(function(e){n.isGetWebId=!1,e&&0===e.e?(n.web_id=e.web_id,n.uuidQueue.length?n._requestSsId(n.uuidQueue[0]):n._setTokenId(e.web_id,"",t?n.ssid:e.ssid,!0)):(n.hook.emit("token-error"),console.warn("[]appid: "+n.config.app_id+", get webid error, init error~"))}),(function(){n.isGetWebId=!1,n.hook.emit("token-error"),console.warn("[]appid: "+n.config.app_id+", get webid error, init error~")}),!0)},e.prototype._setTokenId=function(e,t,n,i){var r=this.cfg.envInfo.user.web_id||e,o={web_id:r,ssid:n,user_unique_id:t||r,timestamp:Date.now()};this.enableCookie&&this.storage.setCookie(this.cookieKey,encodeURIComponent(JSON.stringify(o)),this.expiresTime,this.cookieDomain),this.storage.setItem(this.tokensKey,o),this.cfg.envInfo.user.ssid=n,this.cfg.envInfo.user.web_id=r,this.cfg.envInfo.user.user_unique_id=t||r,this.uuid=t||r,this.web_id=r,this.ssid=n,i&&(this.tokenReady=!0,this.hook.emit("token-ready"))},e.prototype._getSsid=function(e){e&&-1===["0","Null","None","","undefined"].indexOf(e)&&this.uuid!==e&&(this.uuidQueue.push(e),this.uuid=e,this.cfg.envInfo.user.user_unique_id=e,-1===this.uuidQueue.indexOf(e)&&this.uuidQueue.push(e),this.isNoSsid||this.isGetWebId||(this.tokenReady=!1,this._requestSsId(e),this.sendQueue.push(e)),this.session._resetSessionId())},e.prototype._requestSsId=function(e){var t=this;if(!this.sendQueue.length){var n=this.domain+"/v1/user/ssid";qe(n,5e3,{app_key:this.config.app_key,app_id:this.config.app_id,web_id:this.web_id,user_unique_id:e},this.config.app_key,(function(n){t.sendQueue=[],t.uuidQueue.length&&t.uuidQueue.splice(t.uuidQueue.indexOf(e),1),n&&0===n.e?(t._setTokenId(t.web_id,e,n.ssid,0===t.uuidQueue.length),t.uuidQueue.length&&t._requestSsId(t.uuidQueue[0])):(t.tokenReady=!0,t.hook.emit("token-ready"),console.warn("[]appid: "+t.config.app_id+", get ssid error"))}),(function(){t.tokenReady=!0,t.hook.emit("token-ready")}),!0)}},e.prototype.isTokenReady=function(){return this.tokenReady},e}(),Ge=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},$e=function(e,t,n){void 0===e&&(e=[]),void 0===t&&(t=function(e){return e}),void 0===n&&(n=20);var i,r=[],o=0;return e.forEach((function(e){var a=t(e);void 0===i?i=a:(a!==i||r[o].length>=n)&&(o+=1,i=a),r[o]=r[o]||[],r[o].push(e)})),r},Xe=function(){function e(e,t,n,i,r,o,a){this.collect=e,this.cfg=n,this.config=t,this._token=i,this.appInfo=t.app_id||t.app_key,this.debugMode=!!t.log,this.evtDataKey=Fe(this.appInfo,!1);var s=t.channel_domain||Ke(xe[t.channel]);if(this.reportUrl=t.report_url?t.report_url:""+s+Ae,this.storage=new Te(!0),this.EventStorage=new Te(!1),this.maxStorage=t.max_storage_num||-1,this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.closeStorage=!0,this.plugin=r,this.session=o,this.filter=a,this.plugin){var c=t.enable_storage,u=t.disable_storage;(c||!1===u)&&(this.closeStorage=!1)}this.addListener()}return e.prototype.addListener=function(){var e=this;window.addEventListener("unload",(function(){e.report(!0)}),!1),Ge((function(){e.report(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.report(!0)}),!1)},e.prototype.setReady=function(){this.isReady=!0,this.closeStorage||this.checkStorageEvent(),this.report()},e.prototype.event=function(e){var t=this;void 0===e&&(e=[]);try{var n=ke(e,this.storage.getItem(this.evtDataKey)||[]);this.storage.setItem(this.evtDataKey,n),this.reportTimer&&clearTimeout(this.reportTimer),n.length>=this.maxReport?this.report(!1):this.reportTimer=setTimeout((function(){t.report(!1),t.reportTimer=null}),this.reportTime)}catch(e){}},e.prototype.beconEvent=function(e){void 0===e&&(e=[]);var t=this._mergeEvents(e);this._dealData(t,!0)},e.prototype.report=function(e){if(void 0===e&&(e=!1),!this.collect.destroyInstance&&this._token.isTokenReady()&&this.isReady){var t=this.storage.getItem(this.evtDataKey)||[],n=this._mergeEvents(t);this.storage.removeItem(this.evtDataKey),this._dealData(n,e)}},e.prototype._mergeEvents=function(e){var t=this;if(!e.length)return e;var n=this.cfg.get();return n.header.custom=JSON.stringify(n.header.custom),$e(e,(function(e){return!t.closeStorage&&!!e.params.__disable_storage__}),this.maxReport).map((function(e){return be({events:e.map((function(e){try{if(e.event&&"applog_trace"!==e.event){var n=be({},t.cfg.get("evtParams"),e.params);delete n.__disable_storage__;var i=[];return t.plugin&&t.plugin.ab&&t.plugin.ab.versions&&t.plugin.ab.extVersions&&(i=[],i=t.config.enable_multilink||-1!==window.location.href.indexOf("multilink=true")?t.plugin.ab.mulilinkVersions.concat(t.plugin.ab.extVersions):t.plugin.ab.versions.concat(t.plugin.ab.extVersions)),be({},e,{params:JSON.stringify(n),ab_sdk_version:i.join(","),session_id:t.session._getSessionId()})}return be({},e,{params:JSON.stringify(e.params)})}catch(t){return be({},e,{params:JSON.stringify(e.params)})}})),user:n.user,header:n.header},t.closeStorage?{}:{__disable_storage__:e[0].params.__disable_storage__},{verbose:t.debugMode?1:void 0,local_time:parseInt(""+(new Date).getTime()/1e3)})}))},e.prototype._dealData=function(e,t){var n=this;if(!e.length)return e;var i=[];i=$e(e,(function(e){return!!e.__disable_storage__}),this.maxReport),!this.closeStorage&&this.plugin.maxStorage&&this.plugin.maxStorage(i,this.maxStorage,this.evtDataKey,this.storage);var r={};i.forEach((function(e){var i=He(),o=e;try{n.filter&&(o=n.filter(e))}catch(e){}if(!n.closeStorage&&!e[0].__disable_storage__){var a=JSON.parse(JSON.stringify(e));a&&a[0]&&(a[0].header.__storage_index__=Date.now()),r[i]=a,n.EventStorage.setItem(n.evtDataKey,r)}n._send(i,o,t)}))},e.prototype._send=function(e,t,n){var i=this;this.isSending=!0;var r=function(){i.isSending=!1};if(!this.closeStorage)try{t&&t[0]&&t[0].header.__storage_index__&&delete(t=JSON.parse(JSON.stringify(t)))[0].header.__storage_index__}catch(e){}this.plugin&&this.plugin.et_test&&this.plugin.et_test.send(t),qe(this.reportUrl,this.timeout,t,this.config.app_key,(function(t,n){if(r(),i.plugin&&!i.closeStorage){var o=i.EventStorage.getItem(i.evtDataKey)||{};Object.keys(o).length?(delete o[e],i.EventStorage.setItem(i.evtDataKey,o)):i.EventStorage.removeItem(i.evtDataKey)}t&&0!==t.e&&i.collect&&i.collect.tracer&&1!==i.cfg.staging&&i.collect.tracer.addErrorCount(n,"f_data",t.e,t)}),(function(e,t){r(),i.cfg.get("reportErrorCallback")(e,t),i.collect&&i.collect.tracer&&1!==i.cfg.staging&&i.collect.tracer.addErrorCount(e,"f_net",t),i.plugin&&i.plugin.monitor&&i.plugin.monitor.sdkError(i.config.app_key,i.reportUrl,e,t)}),!1,n,r),this.plugin&&this.plugin.monitor&&this.plugin.monitor.sdkOnload(this.config.app_key,this.reportUrl,t)},e.prototype.checkStorageEvent=function(){var e=this;try{var t=this.EventStorage.getItem(this.evtDataKey)||{},n=Object.keys(t);n.length>0&&setTimeout((function i(){for(var r=[],o=0;o0&&r.push(n.shift());r.length>0&&r.forEach((function(n){e._send(n,t[n],!1)})),setTimeout(i,5)}),5)}catch(e){}},e}(),Ye=void 0,Ze=(new Date).getTimezoneOffset(),et=parseInt(""+-Ze/60,10),tt=60*Ze,nt=function(){function e(e,t,n){this.cookieDomain=t.cookie_domain||"",this.initConfig=t;var i=function(e,t){var n,i,r=function(e){var t=document.createElement("a");return t.href=e,t},o=window.screen.width,a=window.screen.height,s=window.navigator.appVersion,c=window.navigator.userAgent,u=window.navigator.language,l=document.referrer,f=l?r(l).hostname:"",d=function(e){var t=r(e).search;t=t.slice(1);var n={};return t.split("&").forEach((function(e){var t,i,r=e.split("=");r.length&&(t=r[0],i=r[1]);try{n[t]=decodeURIComponent(void 0===i?"":i)}catch(e){n[t]=i}})),n}(window.location.href),h="",p="",v="",g=""+parseFloat(s);-1!==(n=c.indexOf("Opera"))&&(v="Opera",g=c.substring(n+6),-1!==(n=c.indexOf("Version"))&&(g=c.substring(n+8))),-1!==(n=c.indexOf("Edge"))?(v="Microsoft Edge",g=c.substring(n+5)):-1!==(n=c.indexOf("MSIE"))?(v="Microsoft Internet Explorer",g=c.substring(n+5)):-1!==(n=c.indexOf("Lark"))?(v="Lark",g=c.substring(n+5,n+11)):-1!==c.indexOf("Chrome")?-1!==(n=c.indexOf("MicroMessenger"))?(v="weixin",g=c.substring(n+15,n+20)):-1!==(n=c.indexOf("MQQBrowser"))?(v="qqbrowser",g=c.substring(n+11,n+15)):-1!==(n=c.indexOf("360"))?(v="360browser",g=c.substring(c.indexOf("Chrome")+7)):-1!==c.indexOf("baidubrowser")||-1!==c.indexOf("BIDUBrowser")?(-1!==c.indexOf("baidubrowser")?(n=c.indexOf("baidubrowser"),g=c.substring(n+13,n+16)):-1!==c.indexOf("BIDUBrowser")&&(n=c.indexOf("BIDUBrowser"),g=c.substring(n+12,n+15)),v="baidubrowser"):-1!==(n=c.indexOf("xiaomi"))?-1!==c.indexOf("openlanguagexiaomi")?(v="openlanguage xiaomi",g=c.substring(n+7,n+13)):(v="xiaomi",g=c.substring(n-7,n-1)):-1!==(n=c.indexOf("TTWebView"))?(v="TTWebView",g=c.substring(n+10,n+23)):-1!==(n=c.indexOf("Chrome"))&&(v="Chrome",g=c.substring(n+7)):-1!==c.indexOf("Safari")?-1!==(n=c.indexOf("QQ"))?(v="qqbrowser",g=c.substring(n+10,n+16)):-1!==(n=c.indexOf("Safari"))&&(v="Safari",g=c.substring(n+7),-1!==(n=c.indexOf("Version"))&&(g=c.substring(n+8))):-1!==(n=c.indexOf("Firefox"))?(v="Firefox",g=c.substring(n+8)):-1!==(n=c.indexOf("MicroMessenger"))?(v="weixin",g=c.substring(n+15,n+20)):-1!==(n=c.indexOf("QQ"))&&(v="qqbrowser",g=c.substring(n+3,n+8)),-1!==(i=g.indexOf(";"))&&(g=g.substring(0,i)),-1!==(i=g.indexOf(" "))&&(g=g.substring(0,i)),-1!==(i=g.indexOf(")"))&&(g=g.substring(0,i));for(var m,_,y=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(s)?"wap":"web",b=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],w=0;w-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e){var n=navigator.userAgent.replace("Mozilla/5.0 (",""),i=n.indexOf(";");t=n.slice(0,i)}}catch(e){}return t.trim()}(h),language:u,referrer:l,referrer_host:f,utm_source:C.utm_source,utm_medium:C.utm_medium,utm_campaign:C.utm_campaign,utm_term:C.utm_term,utm_content:C.utm_content,tracer_data:C.tracer_data}}(e,this.cookieDomain);this.configKey=function(e){return"__tea_cache_config_"+e}(""+e),this.sessionStorage=new Te(!1,"session"),this.localStorage=new Te(!1,"local"),n&&(this.storage=1===n?this.sessionStorage:this.localStorage),this.envInfo={user:{user_unique_id:Ye,user_type:Ye,user_id:Ye,user_is_auth:Ye,user_is_login:Ye,device_id:Ye,web_id:Ye,ip_addr_id:Ye,ssid:Ye},header:{app_id:Ye,app_name:Ye,app_install_id:Ye,install_id:Ye,app_package:Ye,app_channel:Ye,app_version:Ye,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:Ye,ab_version:Ye,ab_sdk_version:Ye,traffic_type:Ye,client_ip:Ye,device_brand:Ye,os_api:Ye,access:Ye,language:i.language,region:Ye,app_language:Ye,app_region:Ye,creative_id:Ye,ad_id:Ye,campaign_id:Ye,log_type:Ye,rnd:Ye,platform:i.platform,sdk_version:Le,sdk_lib:"js",province:Ye,city:Ye,timezone:et,tz_offset:tt,tz_name:Ye,sim_region:Ye,carrier:Ye,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm_term,utm_content:i.utm_content,utm_source:i.utm_source,utm_medium:i.utm_medium,utm_campaign:i.utm_campaign,tracer_data:JSON.stringify(i.tracer_data),custom:{}}},this.evtParams={},this.reportErrorCallback=function(){}}return e.prototype.set=function(e,t){var n=this;if(null==t&&(this.delete(e),t=void 0),"evtParams"===e||"_staging_flag"===e){var i;i="evtParams"===e?t:{_staging_flag:Number(t)};var r=be({},i);Object.keys(r).forEach((function(e){n.evtParams[e]=r[e]}))}else if("reportErrorCallback"===e&&"function"==typeof t)this.reportErrorCallback=t;else{var o="";if(e.indexOf(".")>-1){var a=e.split(".");o=a[0],e=a[1]}if("user_unique_id"===e){if(!t)return;if(-1!==["0","Null","None","","undefined"].indexOf(t))return}if("os_version"===e&&(e=""+t),"web_id"===e){if(!t)return;(!this.envInfo.user.user_unique_id||this.envInfo.user.user_unique_id&&this.envInfo.user.user_unique_id===this.envInfo.user.web_id)&&(this.envInfo.user.user_unique_id=t)}o?"user"===o||"header"===o?this.envInfo[o][e]=t:this.envInfo.header.custom[e]=t:this.envInfo.user.hasOwnProperty(e)?["user_type","ip_addr_id"].indexOf(e)>-1?this.envInfo.user[e]=t?Number(t):t:["user_id","web_id","user_unique_id","ssid"].indexOf(e)>-1?this.envInfo.user[e]=t?String(t):t:["user_is_auth","user_is_login"].indexOf(e)>-1?this.envInfo.user[e]=Boolean(t):"device_id"===e&&(this.envInfo.user[e]=t):this.envInfo.header.hasOwnProperty(e)?this.envInfo.header[e]=t:this.envInfo.header.custom[e]=t}},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error ")}},e.prototype.setStore=function(e){try{var t=this.storage.getItem(this.configKey);if(Object.keys(e).length){var n=Object.assign(e,t);this.storage.setItem(this.configKey,n)}}catch(e){}},e.prototype.getStore=function(){try{var e=this.storage.getItem(this.configKey);return Object.keys(e).length?e:null}catch(e){return null}},e.prototype.delete=function(e){try{var t=this.storage.getItem(this.configKey);t&&t.hasOwnProperty(e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){}},e}(),it=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}var t=e.prototype;return t.info=function(e){this.isLog&&console.log("["+this.name+"] "+e)},t.warn=function(e){this.isLog&&console.warn("["+this.name+"] "+e)},t.error=function(e){this.isLog&&console.error("["+this.name+"] "+e)},t.throw=function(e){throw this.error(this.name),new Error(e)},e}(),rt=function(){function e(){this._hooks={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var n=this;e&&t&&"function"==typeof t&&this.on(e,(function i(r){t(r),n.off(e,i)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&ke(this._hooks[e]).forEach((function(e){try{e(t)}catch(e){}}))},e}(),ot=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},at=function(){function e(e,t){this.storage=new Te(!1,"session"),this.sessionKey=function(e){return"__tea_session_id_"+e}(e),this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||this._setSessionId()}return e.prototype._updateSessionId=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:ot(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this._resetExpTime()}},e.prototype._setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:ot(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e._checkEXp()}),this.expireTime)},e.prototype._getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype._resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e._checkEXp()}),this.expireTime))},e.prototype._resetSessionId=function(){var e={sessionId:ot(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype._checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:ot(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),st={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},ct=function(){function e(e,t,n,i){this.count={pv:0,sdk:0,autotrack:0,log:0},this.limit={pv:1,sdk:10,autotrack:10,log:3},this.errorCode={f_net:0,f_data:0},this.errorInfo={pv:{f_net:0,f_data:0},sdk:{f_net:0,f_data:0},autotrack:{f_net:0,f_data:0},log:{f_net:0,f_data:0}},this.collect=e,this.disable_tracer=t.disable_tracer||t.channel_domain,this.ready=!(!t.app_id||this.disable_tracer),this.appid=t.app_id,this.process=n,this.event=i;var r=t.channel_domain||Ke(xe[t.channel]);this.reportUrl=t.report_url?t.report_url:""+r+Ae,this.listener()}return e.prototype.addCount=function(e){try{if(!this.ready)return;if(this.count[e]++,this.count[e]>=this.limit[e]){var t=[];for(var n in t=ke(t,this.processTracer(this.count[e],e,"net")),this.errorInfo[e])this.errorInfo[n]&&(t=ke(t,this.processTracer(this.errorInfo[e][n],e,n)));t.length&&this.sendTracer(t,!0,e,!1)}}catch(e){}},e.prototype.addErrorCount=function(e,t,n,i){var r=this;try{if(!this.ready)return;if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(i&&i.hasOwnProperty("sc")?this.errorInfo.log.f_data=o.length-i.sc:this.errorInfo.log.f_data=o.length,this.errorCode.f_data=n):o.forEach((function(e){var t="log";for(var i in st)if(-1!==st[i].indexOf(e.event)){t=i;break}r.errorInfo[t].f_net++,r.errorCode.f_net=n})))}}catch(e){}},e.prototype.clearCount=function(e){try{e?(this.count[e]=0,this.errorInfo[e]={f_net:0,f_data:0}):(this.count={pv:0,sdk:0,autotrack:0,log:0},this.errorInfo={pv:{f_net:0,f_data:0},sdk:{f_net:0,f_data:0},autotrack:{f_net:0,f_data:0},log:{f_net:0,f_data:0}})}catch(e){}},e.prototype.sendTracer=function(e,t,n,i){try{if(!this.ready)return;if(this.collect.staging)return;var r=this.event._mergeEvents(e);i&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify(r)):qe(this.reportUrl,3e5,r,""),t?this.clearCount(n):this.clearCount()}catch(e){}},e.prototype.processTracer=function(e,t,n){try{var i={count:e,state:n,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:Le};"f_net"!==n&&"f_data"!==n||(i.errorCode=this.errorCode[n]);var r=[];if(r.push(this.process("applog_trace",i,!0)),r&&r.length)return delete r[0].is_bav,r}catch(e){}},e.prototype.listener=function(){var e=this;this.ready&&(document.addEventListener("visibilitychange",(function(){e.leavePage()})),Ge((function(){e.leavePage()})))},e.prototype.leavePage=function(){if(this.ready)try{var e=[];for(var t in this.count)if(this.count[t]){var n=this.errorInfo[t];for(var i in e=ke(e,this.processTracer(this.count[t],t,"net")),n)n[i]&&(e=ke(e,this.processTracer(n[i],t,i)))}e&&e.length&&this.sendTracer(e,!1,"",!0)}catch(e){}},e}(),ut=function(){function e(e){this.logger=e}var t=e.prototype;return t.bridgeInject=function(){try{return AppLogBridge?(this.logger.info("AppLogBridge is injected"),!0):(this.logger.info("AppLogBridge is not inject"),!1)}catch(e){return this.logger.info("AppLogBridge is not inject"),!1}},t.hasStarted=function(e){var t=this;try{this.bridgeInject()?AppLogBridge.hasStarted((function(n){t.logger.info("AppLogBridge is started? : "+n),e(n)})):e(0)}catch(t){this.logger.info("AppLogBridge, error:"+JSON.stringify(t.stack)),e(0)}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){this.logger.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){this.logger.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){this.logger.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){this.logger.error("removeHeaderInfo error")}},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t)}catch(e){this.logger.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){this.logger.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){this.logger.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){this.logger.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){this.logger.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){this.logger.error("profileAppend error")}},e}(),lt=function(){function e(e,t,n){this.processEvent=e,this._event=t,this.cache={},this.duration=6e4,this.profileReady=!1,this.reportUrl=(n.channel_domain||Ke(xe[n.channel]))+"/profile/list"}return e.prototype.start=function(){this.profileReady=!0},e.prototype.report=function(e,t){void 0===t&&(t={});try{var n=[];n.push(this.processEvent(e,t));var i=this._event._mergeEvents(n);qe(this.reportUrl,3e5,i)}catch(e){}},e.prototype.setProfile=function(e){var t=this._formatParams(e);t&&Object.keys(t).length&&(this._pushCache(t),this.report("__profile_set",be({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this._formatParams(e,!0);t&&Object.keys(t).length&&(this._pushCache(t),this.report("__profile_set_once",be({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",be({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",be({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var n in e)"string"==typeof e[n]||"Array"===Object.prototype.toString.call(e[n]).slice(8,-1)?t[n]=e[n]:console.warn("please check the value of param: "+n+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",be({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype._pushCache=function(e){var t=this;Object.keys(e).forEach((function(n){t.cache[n]={val:t._clone(e[n]),timestamp:Date.now()}}))},e.prototype._formatParams=function(e,t){var n=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var i={};for(var r in e)"string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1)?i[r]=e[r]:console.warn("please check the value of params:"+r+", must be string,number,Array !!!");var o=Object.keys(i);if(!o.length)return;var a=Date.now();return o.filter((function(i){var r=n.cache[i];return t?!r:!(r&&n._compare(r.val,e[i])&&a-r.timestampn.options.maxDuration||(n.event("predefine_page_alive",be({},ft(n.url_path,n.title,n.url),{duration:t,is_support_visibility_change:n.options.sup_vis_change?1:0,startTime:n.sessionStartTime}),"sdk"),n.sessionStartTime=dt())},this._setUpTimer=function(){return n.timerHandler&&clearInterval(n.timerHandler),setInterval((function(){dt()-n.sessionStartTime>n.options.aliveDTime&&n._sendEvent(!0)}),1e3)},this._visibilitychange=function(){"hidden"===document.visibilityState?n.timerHandler&&(clearInterval(n.timerHandler),n._sendEvent()):"visible"===document.visibilityState&&(n.sessionStartTime=dt(),n.timerHandler=n._setUpTimer())},this._beforeunload=function(){document.hidden||n._sendEvent()},this._wtest=function(){document.getElementById("wtest").innerHTML="visibilitychange"},this._dtest=function(){document.getElementById("dtest").innerHTML="dvisibilitychange"},this.event=e,this.config=t,this.isSupVisChange=pt(),this.options={maxDuration:432e5,aliveDTime:6e4,sup_vis_change:pt()},this.pageStartTime=ht(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,this.disableCallback=function(){}}return e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this._enablePageAlive()},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype._enablePageAlive=function(){var e=this;return this.timerHandler=this._setUpTimer(),document.addEventListener("visibilitychange",this._visibilitychange),Ge(this._beforeunload),function(){e._beforeunload(),document.removeEventListener("visibilitychange",e._visibilitychange),window.removeEventListener("beforeunload",e._beforeunload),window.removeEventListener("pagehide",e._beforeunload)}},e}(),gt=function(){function e(e,t){var n=this;this._visibilitychange=function(){"hidden"===document.visibilityState?n.activeEndTime=dt():"visible"===document.visibilityState&&(n.activeEndTime&&(n.totalTime+=n.activeEndTime-n.activeStartTime,n.activeTimes+=1),n.activeEndTime=void 0,n.activeStartTime=dt())},this._beforeunload=function(){if(n.totalTime+=(n.activeEndTime||dt())-n.activeStartTime,n.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:n.totalTime,page_title:document.title||location.pathname}))}catch(e){}n._sendEventPageClose()},this.event=e,this.config=t,this.isSupVisChange=pt(),this.options={sup_vis_change:this.isSupVisChange},this.maxDuration=t.maxDuration||864e5,this.disableCallback=function(){},this.pageStartTime=ht(),this._resetData()}return e.prototype.enable=function(e,t,n){this.url_path=e,this.url=n,this.title=t,this.disableCallback=this._enablePageClose()},e.prototype.disable=function(){this.disableCallback()},e.prototype._resetData=function(){this.activeStartTime=void 0===this.activeStartTime?ht():Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0},e.prototype._sendEventPageClose=function(){var e=dt()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||(this.event("predefine_page_close",be({},ft(this.url_path,this.title,this.url),{active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:this.options.sup_vis_change?1:0}),"sdk"),this.pageStartTime=Date.now(),this._resetData())},e.prototype._enablePageClose=function(){var e=this;return document.addEventListener("visibilitychange",this._visibilitychange),Ge(this._beforeunload),function(){e._beforeunload(),document.removeEventListener("visibilitychange",e._visibilitychange),window.removeEventListener("beforeunload",e._beforeunload),window.removeEventListener("pagehide",e._beforeunload)}},e}(),mt=function(){function e(e,t){this.pageAlive=new vt(e,t),this.pageClose=new gt(e,t),this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this._enable(this.url_path,this.title,this.url)}return e.prototype._enable=function(e,t,n){this.pageAlive.enable(e,t,n),this.pageClose.enable(e,t,n)},e.prototype._disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.reset=function(e,t,n){this._disable(),this._enable(e,t,n)},e}(),_t=function(){function e(e){var t=this;this._setInterval=function(){t._clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var n,i=Date.now()+t;return n=window.setTimeout((function r(){var o=Date.now()-i;e(),i+=t,n=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(n)}}((function(){t._isSessionhasEvent&&t._endCurrentSession()}),t.sessionInterval)},this._clearInterval=function(){t._clearIntervalFunc&&t._clearIntervalFunc()},this.sessionInterval=6e4,this._eventSenderFunc=e,this._startTime=0,this._lastTime=0,this._setInterval()}return e.prototype._endCurrentSession=function(){this._eventSenderFunc("_be_active",{start_time:this._startTime,end_time:this._lastTime,url:window.location.href,referrer:window.document.referrer},"sdk"),this._isSessionhasEvent=!1,this._startTime=0},e.prototype.process=function(){this._isSessionhasEvent||(this._isSessionhasEvent=!0,this._startTime=+new Date);var e=this._lastTime||+new Date;this._lastTime=+new Date,this._lastTime-e>this.sessionInterval&&(this._clearInterval(),this._endCurrentSession(),this._setInterval())},e}(),yt=function(){function e(){}return e.prototype.sdkOnload=function(e,t,n){if(!this.sdkReady){this.sdkReady=!0;try{if(0===n.length)return;var i=n[0],r=i.header,o=i.user,a=r.app_id,s=r.app_name,c=r.sdk_version,u=o.web_id,l={events:[{event:"onload",params:JSON.stringify({app_key:e,app_id:a,app_name:s||"",sdk_version:c}),local_time_ms:Date.now()}],user:{user_unique_id:u},header:{}};setTimeout((function(){qe(t,3e4,[l],"566f58151b0ed37e")}),16)}catch(e){}}},e.prototype.sdkError=function(e,t,n,i){try{var r=n[0],o=r.user,a=r.header,s=[];n.forEach((function(e){e.events.forEach((function(e){s.push(e)}))}));var c={events:s.map((function(t){return{event:"on_error",params:JSON.stringify({error_code:i,app_key:e,app_id:a.app_id,app_name:a.app_name||"",error_event:t.event,sdk_version:a.sdk_version,local_time_ms:t.local_time_ms,tea_event_index:Date.now(),params:t.params,header:JSON.stringify(a),user:JSON.stringify(o)}),local_time_ms:Date.now()}})),user:{user_unique_id:o.user_unique_id},header:{}};setTimeout((function(){qe(t,3e4,[c],"566f58151b0ed37e")}),16)}catch(e){}},e}(),bt=new Te(!1),wt=function(e){return"__tea_sdk_ab_version_"+e},kt=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date};try{t=bt.getItem(wt(e))||t}catch(e){}return t},St=function(e,t){try{var n=kt(e);bt.setItem(wt(e),be({},n,t))}catch(e){}},Ct=function(e,t,n){void 0===n&&(n=!1);var i=n?{ab_ext_version:t,timestamp:Date.now()}:{ab_version:t,timestamp:Date.now()};St(e,i)},Et={},zt=[],It=function(e){e.length&&e.forEach((function(e){zt.push(e)}))};function Tt(e,t,n,i){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||i||"*",a={type:t,payload:n};r.postMessage(JSON.stringify(a),o)}function xt(e,t){Et[e]=Et[e]||[],Et[e].push(t)}function Ot(e){if(zt.some((function(e){return"*"===e}))||zt.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var n=t.type,i=t.payload;Et[n]&&Et[n].forEach((function(t){"function"==typeof t&&t(e,i)}))}}function At(e,t){(window.opener||window.parent).postMessage("[tea-sdk]ready","*"),(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:e,version:t},"*"),window.addEventListener("message",Ot,!1)}function Lt(e,t,n){var i=document.createElement("script");i.src=e,i.onerror=function(){n(e)},i.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(i)}window.TEAVisualEditor=window.TEAVisualEditor||{};var Mt="",Nt=!1;function Dt(e){var t=e.event,n=e.editorUrl;e.collectInstance,e.fromSession,Nt||(Nt=!0,Lt(n,(function(){Tt(t,"abEditorScriptloadSuccess")}),(function(){t&&Tt(t,"abEditorScriptloadError"),Nt=!1})))}var Pt,jt,Bt=Ke("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z18z19z49z1jz1mz18z1bz1cz20z4az1hz21")+"?query="+Date.now();!function(e){e[e.No=0]="No",e[e.Ing=1]="Ing",e[e.Complete=2]="Complete"}(Pt||(Pt={})),function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(jt||(jt={}));var Ft=function(){function e(e,t,n){this.appId=0,this.user={},this.header={},this.domain="",this.protocal=location.protocol,this.fetchStatus=Pt.No,this.callbacks=[],this.data=null,this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.collector=e;var i=this.collector._initConfig,r=i.app_id,o=i.channel,a=i.enable_multilink,s=i.multilink_timeout_ms,c=i.ab_channel_domain,u=i.channel_domain,l=i.enable_ab_visual,f=i.ab_timeout;if(this.appId=r,this.timeout=f||3e3,this.domain=c||Ke(Re[o||"cn"]),this.domain){this.needOverlay=a||l||!1,this.enable_ab_visual=l,this.enable_multilink=a,this.closeTime=s||500,this.Hook=t;var d=u||Ke(xe[o]);if(this.reportUrl=""+d+Ae,l){!function(e,t,n,i){It(["*"]);var r,o="";At(i,Le);var a="";try{var s=window.performance.getEntriesByType("resource");if(s&&s.length&&(s.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(a=e.name)})),a||document.currentScript&&(a=document.currentScript.src),a&&(r=a.split("/"))&&r.length)){o="https:/";for(var c=2;c=2592e6){try{bt.removeItem("__tea_sdk_ab_version")}catch(e){}return null}return t}(this.appId);if(t){var n=t.ab_version,i=t.data,r=t.ab_ext_version,o=t.ab_version_multilink;this.mulilinkVersions=o||[],this.extVersions=r,n&&n.length&&(this.versions=n,this.data=i,setTimeout((function(){e._configVersions()})))}},e.prototype.wait=function(){var e=this;this.needOverlay&&(this.isWait||(this.openOverlayer(),this.isWait=!0),setTimeout((function(){e.closeOverlayer()}),this.closeTime))},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:jt.All};this.fetchStatus===Pt.Complete?this._getAllVars(t):this.callbacks.push(t)},e.prototype._getAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{})},e.prototype.getVids=function(){try{var e=kt(this.appId).ab_version,t="";return e&&e.length&&(t=e.join(",")),t}catch(e){return""}},e.prototype.getAbSdkVersion=function(e){e(this.getVids())},e.prototype.getVar=function(e,t,n){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof n)throw new Error("callback must be a function");var i={name:e,defaultValue:t,callback:n,type:jt.Var};if(this.fetchStatus===Pt.Complete){this._getVar(i,e);try{this.Hook.emit("onAbSdkVersionChange",this.getVids())}catch(e){}}else this.callbacks.push(i)},e.prototype._getVar=function(e,t){var n=e.name,i=e.defaultValue,r=e.callback,o=this.data;if(o){if("object"==typeof o[n]&&void 0!==o[n].val){var a=o[n].vid;return"$ab_url"===t?(-1===this.mulilinkVersions.indexOf(a)&&this.mulilinkVersions.push(a),this._updateMultilinkVersions()):(-1===this.versions.indexOf(a)&&this.versions.push(a),this._updateVersions()),this._abEvent(a,t,i),void r(o[n].val)}r(i)}else r(i)},e.prototype._abEvent=function(e,t,n){var i=this;try{if(e){var r={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.appId,ab_url:"$ab_url"===t?n:window.location.href}),local_time_ms:Date.now()},o=this.collector._config.get(),a=o.header,s=o.user;a.ab_sdk_version=""+e,a.custom=JSON.stringify(a.custom);var c={events:[r],user:s,header:a};"$ab_url"===t?window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify([c])):qe(this.reportUrl,2e4,[c],""):setTimeout((function(){qe(i.reportUrl,2e4,[c],"")}),16)}}catch(e){}},e.prototype.openOverlayer=function(){!function(){if(!document.getElementById(Ve)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.id=Ve,n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)}}()},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(Ve))&&e.parentElement.removeChild(e)},e.prototype._setAbVersion=function(e){this.extVersions=[e],Ct(this.appId,this.extVersions,!0)},e.prototype._updateVersions=function(){Ct(this.appId,this.versions),this._configVersions()},e.prototype._updateMultilinkVersions=function(){var e,t;e=this.appId,t={ab_version_multilink:this.mulilinkVersions,timestamp:Date.now()},St(e,t)},e.prototype._configVersions=function(){var e=this.versions.join(",");e&&this.collector.config({ab_sdk_version:e})},e.prototype._getABconfig=function(e,t){var n=Object.keys(e);n&&n.length&&this.collector.config(e),this.init(this.collector._config.get(),t)},e.prototype._fetchComplete=function(e){var t=this;if(e){!function(e,t){St(e,{data:t})}(this.appId,e),this.data=e;var n=[];Object.keys(e).forEach((function(t){var i=e[t].vid;i&&n.push(i)})),-1!==window.location.href.indexOf("multilink=true")||(this.versions=this.versions.filter((function(e){return-1!==n.indexOf(e)})));var i=e.$ab_url,r=e.$ab_modification;if(r&&r.val&&this.enable_ab_visual){if(this.collector.destroyInstance)return;this.getVar("$ab_modification",window.location.href,(function(){var e;e=r.val,window.TEAVisualEditor.__ab_config=e,Lt(Bt,(function(){console.log("load visual render success")}),(function(){console.log("load visual render fail")}))}))}else if(i&&this.enable_multilink){var o=i.val,a=i.vid;o&&a&&this.getVar("$ab_url",o,(function(){var e=window.location.href;-1!==e.indexOf("multilink=true")&&(e=t.filterUrl(e)),o!==e?setTimeout((function(){if(!t.collector.destroyInstance){var e=""+o;-1!==(e=-1===e.indexOf("http")?"https://"+e:e).indexOf("?")?e+="&multilink=true":e+="?multilink=true",window.location.href=e}}),50):t.closeOverlayer()}))}else this.closeOverlayer()}this.callbacks.forEach((function(e){t[e.type===jt.Var?"_getVar":"_getAllVars"](e,"")})),this.callbacks=[],this._updateVersions();try{this.Hook.emit("onAbSdkVersionChange",this.getVids())}catch(e){}this.isWait||this.closeOverlayer()},e.prototype._fetch=function(e,t){var n=this,i=void 0===t?{}:t,r=i.success,o=void 0===r?function(){}:r,a=i.fail,s=void 0===a?function(){}:a;this.fetchStatus=Pt.Ing;var c=this.domain+"/service/2/abtest_config/",u=window.location.href,l=!1;-1!==u.indexOf("multilink=true")&&(u=this.filterUrl(u),l=!0);var f=l?this.mulilinkVersions:this.versions;We(c,{header:be({aid:this.appId},this.user||{},e||{},{ab_sdk_version:f.join(","),ab_url:u})},(function(e){n.fetchStatus=Pt.Complete;var t=e.data;"success"===e.message?(n._fetchComplete(t),o(t)):(n._fetchComplete(null),s())}),(function(){n.fetchStatus=Pt.Complete,s(),n._fetchComplete(null)}),"",this.timeout)},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true");var n=new RegExp(t,"g");e=e.replace(n,"")}catch(e){}return e},e}(),Rt=function(e,t,n,i){if(t){var r=e.filter((function(e){return!e[0].__disable_storage__})).length;if(r>0)try{var o=i.getItem(n);if(o){var a=Object.keys(o),s=a.length+r-t;if(s>0){for(var c=a.map((function(e){var t=o[e];return{id:e,index:t&&t[0]?t[0].header.__storage_index__:+new Date}})).sort((function(e,t){return e.index-t.index})),u=0;u0?i+"?"+r:i}function Gt(){var e="";try{e=document.referrer?document.referrer:Kt.getItem("__tea_cache_refer_key")===location.href?"":Kt.getItem("__tea_cache_refer_key")}catch(e){}return{is_html:1,page_key:location.href,refer_page_key:e,page_manual_key:"",refer_page_manual_key:""}}function $t(e,t){var n=Gt();return n.is_back=0,n}function Xt(e,t){void 0===t&&(t=!1),function(e){var t,n;t=window.history,n=t.pushState,t.pushState=function(i){"function"==typeof t.onpushstate&&t.onpushstate({state:i}),e("pushState",i,c);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a1?r-1:0),a=1;a0}))}return!0}(t))})(e.target)&&n.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){n.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){n.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t,i){"pushState"===e?n.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:0}):n.eventHandel({eventType:"dom",eventName:"page_view"},i)},this.getPageLoadEvent=function(e){n.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=t.getConfig().eventConfig,this.options=e,this.beatTime=e.beat,this.statistics=!1}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e&&(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv&&("complete"===document.readyState?Xt(this.getPageViewEvent,this.options.hashTag||this.config.hashTag):window.addEventListener("DOMContentLoaded",(function(){Xt(t.getPageViewEvent,t.options.hashTag||t.config.hashTag)}))),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var n=0,i=null;window.addEventListener("scroll",(function(){clearTimeout(i),i=setTimeout(r,500),n=document.documentElement.scrollTop||document.body.scrollTop}));var r=function(){(document.documentElement.scrollTop||document.body.scrollTop)==n&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var o=window.performance&&window.performance.getEntriesByType("paint");o&&o.length?(new PerformanceObserver((function(e){var n=e.getEntries(),i=n[n.length-1],r=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(o[0].startTime||0),t.statistics=!0)}),2e3)):this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var n;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(n=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),Ge((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(n)}))}catch(e){}},e}(),Zt={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},en=function(){function e(e){this.config=e}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function tn(e,t){var n={element_path:"",positions:[],texts:[]},i=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(t),r=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,r=t.left,o=t.top;return{touch_x:Math.floor(n-r),touch_y:Math.floor(i-o)}}(e,i),o=i.element_width,a=i.element_height,s=r.touch_x,c=r.touch_y,u=function(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var n=[],i=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,n=e.parentElement;if(n)for(var i=n.children,r=0;r0)for(var r=t.childNodes,o=0;o0)for(var r=t.childNodes,o=0;o0?r:0)),t.page_start_ms=i.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key="";try{e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error "+JSON.stringify(e))}return e},e}(),on=function(){function e(e,t){this.logFunc=e,this.logFuncBecon=t,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){e.eventName;var n=e.eventSend,i=t.event;delete t.event,n&&"becon"===n?this.logFuncBecon(i,t,"autotrack"):this.logFunc(i,t,"autotrack")},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),an="_TEA_VE_OPEN",sn="_TEA_VE_APIHOST",cn="lang",un="_VISUAL_EDITOR_V",ln="_VISUAL_EDITOR_U";function fn(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||Ce.get(cn),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||Ce.get(sn),n=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||Ce.get(un),i=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||Ce.get(ln),r=+new Date,o=new Date(r+18e5);Ce.set(an,"1",{expires:o}),Ce.set(sn,t,{expires:o}),Ce.set(ln,i,{expires:o}),Ce.set(cn,e,{expires:o}),Ce.set(un,n||"",{expires:o})}catch(e){console.log("set cookie err")}}window.TEAVisualEditor=window.TEAVisualEditor||{};var dn="",hn=window.TEAVisualEditor.__editor_url||Ke("1fz22z22z1nz21z4mz4bz4bz21z4fz4az1nz21z22z18z22z1nz4az1az1mz1kz4bz1nz1ez1az4bz22z1cz1az1fz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z1cz1bz1gz22z1mz20z4az1hz21");hn=hn+"?query="+Date.now();var pn=Ke("1fz22z22z1nz21z4mz4bz4bz1jz1dz49z1az1bz1lz49z22z1mz21z4az19z27z22z1cz21z1az1kz4az1az1mz1kz4bz1mz19z1hz4bz21z22z18z22z1gz1az4bz1jz1mz1ez49z21z1bz1iz4bz1az1mz1jz1jz1cz1az22z4bz24z1gz21z23z18z1jz49z1cz1bz1gz22z1mz20z49z20z18z1lz1ez1cz20z21z4az1hz21")+"?query="+Date.now(),vn=!1;function gn(e){var t=e.event,n=e.editorUrl,i=e.autoTrackInstance;e.fromSession,vn||(vn=!0,Lt(n,(function(){Tt(t,"editorScriptloadSuccess"),i.destroy()}),(function(){t&&Tt(t,"editorScriptloadError"),vn=!1})))}function mn(e,t){window.TEAVisualEditor.appId=t.app_id;var n=t.channel_domain,i="";if(It(["*"]),n){var r,o="";try{var a=window.performance.getEntriesByType("resource");if(a&&a.length&&(a.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(o=e.name)})),o||document.currentScript&&(o=document.currentScript.src),o&&(r=o.split("/"))&&r.length)){i="https:/";for(var s=2;s-1?(r=t.colloctor)[a].apply(r,n.slice(1)):(o=t.colloctor).event.apply(o,n)})),this.cmdQueue=[],this.name=e,this.colloctor=new Sn(e),this._isProcess=!1,this._alias={},this._processCmd(),wn.forEach((function(e){t._exportCollect[e]=t._exportCollect.bind(t,e)})),this._exportCollect},zn={},In={},Tn=function(e){return In[e]||(In[e]=[]),In[e]},xn=function(e){try{var t=we(e),n=t[0],i=t.slice(1);if(!n)return void console.error("the eventName is: "+n+", error, stop report, please check");var r=n.split(".");if(1===r.length)Tn("default").push(ke([n],i));else if(2===r.length)"event"===r[0]?Tn("default").push(ke([n],i)):Tn(r[0]).push(ke([r[1]],i));else{var o=r[0],a=[r[1],r[2]].join(".");Tn(o).push(ke([a],i))}}catch(e){console.log(e)}},On=function(){An.q.forEach((function(e){var t=[].slice.call(e);"Array"===Object.prototype.toString.call(t[0]).slice(8,-1)?t.forEach((function(e){xn(e)})):xn(t)})),Object.keys(In).forEach((function(e){In[e].forEach((function(t){(function(e){return zn[e]||(zn[e]=new En(e)),zn[e]})(e).apply(void 0,ke(t))})),In[e]=[]})),An.q=[]},An=function e(){for(var t=[],n=0;n=0&&(null!=(Vn=window)&&Vn.Lark_Bridge||null!=(Wn=window)&&null!=(Un=Wn.webkit)&&null!=(qn=Un.messageHandlers)&&qn.invokeNative)?(window.isNewBridge=!0,Xn=new U):Xn=Gn.getBridge():Xn=window.__LarkPCSDK__?window.__LarkPCSDK__.bridge:{invoke:function(){},config:function(){}};var Yn={__v2__:!0},Zn=0,ei=function(e,t){return function(){return e(t.apply(void 0,arguments))}},ti=function(){};var ni={},ii={},ri=function(e,t,n,i){var r={api_name:e};return t===le.success?(_e.includes(e)&&"monitorReport"!==e&&ye(me,ve[le.success]).addMap(r).setResultType(le.success).flush(),ci(n,e,le.success,"")):t===le.fail?("monitorReport"!==e&&ye(me,ve[le.fail]).addMap(r).setError(_(i)).setResultType(le.fail).flush(),ci(n,e,le.fail,i)):("monitorReport"!==e&&ye(me,ve[t]).addMap(r).setResultType(t).flush(),ci(n,e,t,i)),i};Xn.on=function(e,t,n){if("function"==typeof n)if(ii[e]=ii[e]||[],0===ii[e].length){var i={keep:!0,onSuccess:function(){for(var t=arguments.length,n=new Array(t),i=0;i0?ii[e].push(n):ii[e]=[n],window.isNewBridge){var i={success:n};Object.assign(i,{isListener:!0,eventName:e,progress:n}),si.invoke(t,i)}},unsubscribe:function(e,t,n){var i=ii[e]||[];ii[e]=i.filter((function(e){return e!==n})),0===ii[e].length&&delete ni[e],window.isNewBridge&&ai.removeListener(e,n)},subscribeHandler:function(e,t){var n=ii[e]||[];t=D(t),n.length&&n.forEach((function(e){"function"==typeof e&&e(t)}))}};function ci(e,t,n,i){var r,o,a,s;Rn("h5jssdk_call_api",{api_name:t,begin_time:e,timecost:+new Date-e,result:n,error:_(i),url:null==(r=window)||null==(o=r.location)?void 0:o.href,host:null==(a=window)||null==(s=a.location)?void 0:s.host,client:w(h),larkVersion:h.versions.larkVersion,platform:navigator.platform,browser:navigator.userAgent,app_id:b()})}var ui=16e4;function li(e){if("string"==typeof e){if(e.length<814)throw new Error("闈炴硶鐨刡ase64String");return~~((e.length-814)/1.37)}return 0}var fi,di={navigation:new(function(){function e(){}var t=e.prototype;return t.setTitle=function(e){ai.invoke("biz.navigation.setTitle",e)},t.setLeft=function(e){ai.invoke("biz.navigation.setLeft",{control:e.control,text:e.text,isShowIcon:e.isShowIcon},{onSuccess:e.onSuccess,keep:!0})},t.setRight=function(e){ai.invoke("biz.navigation.setRight",e)},t.setMenu=function(e){(function(e){for(var t,n=l(e);!(t=n()).done;){var i=t.value;if(i.imageBase64&&li(i.imageBase64)>ui)throw new Error("imageSize瓒呰繃160000");if(i.imageBase64&&i.text)throw new Error("text鍜宨mageBase64鍙兘浼犱竴涓�")}return!0})(e.items)&&(ai.off("biz.navigation.setMenu"),ai.invoke("biz.navigation.setMenu",{items:e.items},{onSuccess:e.onSuccess,keep:!0}))},t.goBack=function(e){ai.invoke("biz.navigation.goBack",{},{onSuccess:e.onSuccess})},t.close=function(e){ai.invoke("biz.navigation.close",{},{onSuccess:e.onSuccess})},e}()),util:new(function(){function e(){}var t=e.prototype;return t.uploadImage=function(e){ai.invoke("biz.util.uploadImage",{multiple:e.multiple,max:e.max},{onSuccess:e.onSuccess})},t.copyText=function(e){ai.invoke("biz.util.copyText",e)},t.share=function(e){var t=e.url,n=e.title,i=e.content,r=e.image,o=e.onSuccess;ai.invoke("biz.util.share",{url:t,title:n,content:i,image:r},{onSuccess:o})},t.getCookies=function(e){ai.invoke("biz.util.getCookies",{},{onSuccess:e.onSuccess})},t.scan=function(e){void 0===e&&(e={});var t={};e.type&&(t.type="string"==typeof e.type?[e.type]:e.type),void 0!==e.barCodeInput&&(t.barCodeInput=e.barCodeInput),ai.invoke("biz.util.scan",t,{onSuccess:e.onSuccess})},t.datePicker=function(e){ai.invoke("biz.util.datePicker",{format:e.format,value:e.value},{onSuccess:e.onSuccess})},t.timePicker=function(e){ai.invoke("biz.util.timePicker",{format:e.format,value:e.value},{onSuccess:e.onSuccess})},t.dateTimePicker=function(e){ai.invoke("biz.util.dateTimePicker",{format:e.format,value:e.value},{onSuccess:e.onSuccess})},t.chosen=function(e){ai.invoke("biz.util.chosen",{source:e.source,selectedKey:e.selectedKey},{onSuccess:e.onSuccess})},t.multiSelect=function(e){ai.invoke("biz.util.multiSelect",{options:e.options,selectOption:e.selectOption},{onSuccess:e.onSuccess})},t.getAppLanguage=function(e){ai.invoke("biz.util.getAppLanguage",{},{onSuccess:e.onSuccess})},t.setAuthenticationInfo=function(e){ai.invoke("biz.util.setAuthenticationInfo",JSON.parse(JSON.stringify(e)),{onSuccess:e.onSuccess,onFail:e.onFail})},t.startBiometrics=function(e){ai.invoke("biz.util.startBiometrics",JSON.parse(JSON.stringify(e)),{onSuccess:e.onSuccess,onFail:e.onFail})},t.savePageSnapshot=function(e){ai.invoke("biz.util.savePageSnapshot",{},{onSuccess:e.onSuccess,onFail:e.onFail})},t.sharePageSnapshot=function(e){ai.invoke("biz.util.sharePageSnapshot",{},{onSuccess:e.onSuccess,onFail:e.onFail})},t.downloadFile=function(e){var t="downloadFile"+Date.now()+"_"+Math.floor(1e4*Math.random());return ai.invoke("biz.util.downloadFile",{url:e.url,taskId:t},{onSuccess:e.onSuccess,onFail:e.onFail,onProgress:e.onProgress}),{abort:function(){ai.invoke("biz.util.cancelDownloadFile",{taskId:t})}}},e}()),reporter:new(function(){function e(){}return e.prototype.sendEvent=function(e,t,n){ai.invoke("biz.reporter.sendEvent",{category:e,action:t,params:n})},e}()),chat:new(function(){function e(){}var t=e.prototype;return t.openSingleChat=function(e){ai.invoke("biz.chat.openSingleChat",{chatterId:e.chatterId},{onSuccess:e.onSuccess})},t.toConversation=function(e){ai.invoke("biz.chat.toConversation",{chatId:e.chatId},{onSuccess:e.onSuccess})},e}()),contact:new(function(){function e(){}return e.prototype.choose=function(e){ai.invoke("biz.contact.choose",JSON.parse(JSON.stringify(e)),{onSuccess:e.onSuccess})},e}())},hi=new(function(){function e(){}var t=e.prototype;return t.showPreloader=function(e){ai.invoke("device.notification.showPreloader",e)},t.hidePreloader=function(){ai.invoke("device.notification.hidePreloader",{})},t.confirm=function(e){ai.invoke("device.notification.confirm",{message:e.message,title:e.title,buttonLabels:e.buttonLabels},{onSuccess:e.onSuccess})},t.alert=function(e){ai.invoke("device.notification.alert",e)},t.toast=function(e){ai.invoke("device.notification.toast",Object.assign({},e,{duration:2}))},t.prompt=function(e){ai.invoke("device.notification.prompt",{message:e.message,title:e.title,buttonLabels:e.buttonLabels},{onSuccess:e.onSuccess})},t.vibrate=function(e){ai.invoke("device.notification.vibrate",{duration:e.duration},{onSuccess:e.onSuccess})},t.actionSheet=function(e){ai.invoke("device.notification.actionSheet",{title:e.title,cancelButton:e.cancelButton,otherButtons:e.otherButtons},{onSuccess:e.onSuccess})},e}());!function(e){e.wifi="wifi",e.lbs="lbs",e.gps="gps"}(fi||(fi={}));var pi,vi=new(function(){function e(){}var t=e.prototype;return t.get=function(e){ai.invoke("device.geolocation.get",{useCache:e.useCache},{onSuccess:e.onSuccess,onFail:e.onFail})},t.start=function(e){var t=e.useCache,n=e.interval,i=e.sceneId,r=e.onSuccess,o=e.onFail;ai.invoke("device.geolocation.start",{useCache:t,interval:n,sceneId:i},{onSuccess:r,onFail:o,keep:!0})},t.stop=function(e){ai.invoke("device.geolocation.stop",{sceneId:e.sceneId},{onSuccess:e.onSuccess,onFail:e.onFail})},e}()),gi=new(function(){function e(){}var t=e.prototype;return t.getNetworkType=function(e){ai.invoke("device.connection.getNetworkType",{},{onSuccess:e.onSuccess,onFail:e.onFail})},t.scanBluetoothDevice=function(e){ai.invoke("device.connection.scanBluetoothDevice",{scanTimeout:e.scanTimeout},{onSuccess:e.onSuccess})},t.getBluetoothDeviceState=function(e){ai.invoke("device.connection.getBluetoothDeviceState",{},{onSuccess:e.onSuccess})},t.connectBluetoothDevice=function(e){ai.invoke("device.connection.connectBluetoothDevice",{id:e.id,uuid:e.uuid},{onSuccess:e.onSuccess})},e}());!function(e){e.captureScreen="event.user.captureScreen",e.networkStatusChange="event.connection.networkStatusChange"}(pi||(pi={}));var mi={notification:hi,geolocation:vi,connection:gi,base:new(function(){function e(){}var t=e.prototype;return t.getInterface=function(e){ai.invoke("device.base.getInterface",{},{onSuccess:e.onSuccess})},t.getWifiStatus=function(e){ai.invoke("device.base.getWifiStatus",{},{onSuccess:e.onSuccess})},t.getWifiList=function(e){ai.invoke("device.base.getWifiList",{},{onSuccess:e.onSuccess})},t.getDeviceInfo=function(e){ai.invoke("device.base.getDeviceInfo",{},{onSuccess:e.onSuccess})},t.onUserCaptureScreen=function(e){ai.on(pi.captureScreen,"device.base.onUserCaptureScreen",e)},t.offUserCaptureScreen=function(e){ai.off(pi.captureScreen,"device.base.offUserCaptureScreen",e)},e}()),screen:new(function(){function e(){}var t=e.prototype;return t.lockViewOrientation=function(e){ai.invoke("device.screen.lockViewOrientation",{toHorizontal:e.toHorizontal,clockwise:e.clockwise},{onSuccess:e.onSuccess,onFail:e.onFail})},t.unlockViewOrientation=function(e){ai.invoke("device.screen.unlockViewOrientation",{},{onSuccess:e.onSuccess,onFail:e.onFail})},e}())};var _i,yi=Object.freeze({__proto__:null,getRecentApplications:function(e){ai.invoke("appCenter.getAppList",{},{onSuccess:e.onSuccess,keep:!0})},putRecentApplication:function(e){var t=e.appId,n=e.appType;ai.invoke("appCenter.putAppRecent",{appId:t,appType:n},{onSuccess:e.onSuccess,keep:!0})}}),bi=document.createElement("iframe");bi.style.display="none",null==(_i=document.body)||_i.appendChild(bi);var wi,ki=function(e,t){return new Promise((function(n,i){var r=setTimeout((function(){i(new Error("h5jssdk_getSDKConfig_timeout")),Rn("h5jssdk_getSDKConfig_timeout"),ye(ge,ve[ue.getSdkConfigTimeout]).flush()}),3e3);ai.invoke("getSDKConfig",{param:JSON.stringify({build:t})},{onSuccess:function(t){r&&clearTimeout(r);try{"android"===e&&t.apiInfoList?n(t.apiInfoList.map((function(e){return e.name}))):0===t.code?n(t.data.apiInfoList.map((function(e){return e.name}))):n(!0)}catch(e){i(e),Rn("h5jssdk_getSDKConfigErr",e),ye(ge,ve[ue.getSdkConfigError]).setError(_(e)).flush()}},onFail:function(e){r&&clearTimeout(r),i(e),Rn("h5jssdk_getSDKConfigErr",e),ye(ge,ve[ue.getSdkConfigError]).setError(_(e)).flush()}})}))},Si=function(){var e=a(s.mark((function e(t,n,i){var r,o,a,c,u,l,f;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},e.prev=1,e.next=4,ki(t,i);case 4:(o=e.sent)&&(r={openList:o,byteList:[]}),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:if(c=(a=r).openList,u=void 0===c?[]:c,l=a.byteList,f=void 0===l?[]:l,"cdn"!==i){e.next=13;break}return e.abrupt("return",u);case 13:return e.abrupt("return",u.concat(f));case 14:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n,i){return e.apply(this,arguments)}}(),Ci=function(e){var t=e.api,n=e.browser,i=e.SDK,r=e.build;return wi=wi||new Promise((function(e,o){if(n.versions.mobileFeishu||n.versions.PCFeishu){var a=w(n),s=n.versions.larkVersion;if(!a||!s)return o(new Error("please use h5-js-sdk in Feishu or Lark APP"));Si(a,s,r).then((function(n){void 0===n&&(n=[]),n.length?function(e,t,n){e.map((function(e){return e.split(".")})).forEach((function(e){e.reduce((function(t,n,i){if(null===t)return t;var r=t.feishu,o=t.api;return void 0===o[n]?null:e.length===i+1?(r[n]=o[n],null):(void 0===r[n]&&(r[n]={}),{feishu:r[n],api:o[n]})}),{feishu:t,api:n})}))}(n,i,t):Object.keys(t).forEach((function(e){i[e]=t[e]})),e()})).catch((function(e){Object.keys(t).forEach((function(e){i[e]=t[e]})),o(e)}))}else o(new Error("please use h5-js-sdk in Feishu or Lark APP"))}))},Ei={onSuccess:{type:"Function"},onFail:{type:"Function"}},zi=[{name:"device.base.getSystemInfo",args:Ei},{name:"biz.util.getClipboardInfo",args:Ei},{name:"biz.util.openDocument",args:Object.assign({url:{type:"String",required:!0},method:{type:"String"},fileType:{type:"String"},header:{type:"Object"},body:{type:"String"},onProgress:{type:"Function"}},Ei)},{name:"biz.contact.open",args:Object.assign({mode:{type:"String",default:"look",required:!0}},Ei)},{name:"biz.user.getUserInfo",args:Ei},{name:"biz.user.openDetail",args:Object.assign({openId:{type:"String",required:!0},position:{type:"Object"}},Ei)},{name:"biz.user.getUserInfoEx",args:Ei},{name:"device.health.getStepCount",args:Ei},{name:"device.connection.getConnectedWifi",args:Ei},{name:"device.connection.getGatewayIP",args:Ei},{name:"biz.util.previewImage",args:Object.assign({urls:{type:"Array"},current:{type:"String"},requests:{type:"Array"}},Ei)},{name:"biz.util.openLink",args:Object.assign({url:{type:"String",required:!0},title:{type:"String"},newTab:{type:"Boolean"}},Ei)}];function Ii(e,t){return t.forEach((function(t){var n=t.name,i=t.service,r=t.eventName,o=void 0===r?"":r,a=n.split("."),s=e;a.forEach((function(e,r){if(r===a.length-1){if(s[e])return g("the API ["+n+"] has exist, please check and modify");var c=e.match(/^(on|off)[A-Z]/),u=c?ai[c[1]]:ai.invoke,l=[null!=i?i:n];c&&l.unshift(o),s[e]=function(e){if(!t.args||(i=e,r=t.args,o=n,a=!0,s="",f=v(i),d=r.type||v(r),"Undefined"===f?"Object"===d?i={}:r.required&&(s="銆�"+o+"銆戯細the argument expect a "+d+" but received a "+f,a=!1):f!==d&&(s="銆�"+o+"銆戯細the argument expect a "+d+" but received a "+f,a=!1),a&&"Object"===d&&Object.keys(r).forEach((function(e){var t=r[e];t.default&&void 0===i[e]&&(i[e]=t.default),t.alias&&(i[t.alias]=i[e]);var n=v(i[e]);"Undefined"===n?t.required&&(s="銆�"+o+"銆戯細the param ["+e+"] is required and must be "+t.type,a=!1):t.type!==n&&(s="銆�"+o+"銆戯細the param ["+e+"] expect "+t.type+" but received "+n,a=!1)})),a||(i&&"function"==typeof i.onFail?i.onFail({errorCode:1015,errorMessage:s}):g(s)),a)){var i,r,o,a,s,f,d;if(c)return u.call.apply(u,[ai].concat(l,[e]));var h=function(e){var t={},n={};return Object.keys(e).forEach((function(i){"function"==typeof e[i]?n[i]=e[i]:t[i]=e[i]})),{normal:t,callbacks:n}}(e||{}),p=h.normal,m=h.callbacks;return u.call.apply(u,[ai].concat(l,[p,m]))}}}else s=s[e]||(s[e]={})}))})),e}var Ti=t(n((function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0}))),xi=n((function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0})),Oi=n((function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0})),Ai=n((function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0})),Li=n((function(e){e.exports=function(e){return xi(e)||Oi(e)||u(e)||Ai()},e.exports.default=e.exports,e.exports.__esModule=!0})),Mi=n((function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),Ni=n((function(e){var t=Mi.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,n||"default");if("object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.default=e.exports,e.exports.__esModule=!0})),Di=n((function(e){var t=Mi.default;e.exports=function(e){var n=Ni(e,"string");return"symbol"===t(n)?n:String(n)},e.exports.default=e.exports,e.exports.__esModule=!0})),Pi=t(n((function(e){function t(){t=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(n){t.forEach((function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach((function(i){t.forEach((function(t){var r=t.placement;if(t.kind===i&&("static"===r||"prototype"===r)){var o="static"===r?e:n;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var i=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===i?void 0:i.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],i=[],o={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,o)}),this),e.forEach((function(e){if(!r(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),i.push.apply(i,t.finishers)}),this),!t)return{elements:n,finishers:i};var a=this.decorateConstructor(n,t);return i.push.apply(i,a.finishers),a.finishers=i,a},addElementPlacement:function(e,t,n){var i=t[e.placement];if(!n&&-1!==i.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");i.push(e.key)},decorateElement:function(e,t){for(var n=[],i=[],r=e.decorators,o=r.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,r[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&i.push(c.finisher);var u=c.extras;if(u){for(var l=0;l=0;i--){var r=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[i])(r)||r);if(void 0!==o.finisher&&n.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a255||(i=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255)throw new TypeError('Failed to execute "btoa" on "Window": The string '+e+" to be encoded contains characters outside of the Latin1 range.");o+=Bi.charAt((t=n<<16|i<<8|r)>>18&63)+Bi.charAt(t>>12&63)+Bi.charAt(t>>6&63)+Bi.charAt(63&t)}return s?o.slice(0,s-3)+"===".substring(s):o},Vi=ji.atob||function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Fi.test(e))throw new TypeError('Failed to execute "atob" on "Window": The string '+e+" to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,i,r="",o=0;o>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return r};function Wi(e){for(var t="",n=new Uint8Array(e),i=n.byteLength,r=0;r0?e.split("/"):[],r=0,o=n.length;r1?i-1:0),o=1;o= "+t.sdkVersion+" 鍚庣Щ闄�):"].concat(r))};for(var t,n=l(Hi);!(t=n()).done;){var i=t.value;this[i]=this.createLogMethod(i)}for(var r,o=l(Qi);!(r=o()).done;){var a=r.value;this[a]=this.createControlMethod(a)}}var t=e.prototype;return t.setPrefix=function(e){this.prefix=e},t.createLogMethod=function(e){var t=this;if(!Ki.includes(e))return function(){};var n=e.toUpperCase();return function(){for(var i,r=arguments.length,o=new Array(r),a=0;a0){for(var o=0;o0)return;e.on(t,i),f()}},off:function(n){if(void 0===n)e.off(t);else if("function"==typeof n){var i,r=null!=(i=u.get(n))?i:n;r&&e.off(t,r)}f()}}}function bo(e){return void 0===e&&(e={}),function(t,n){var i=t.key;t.finisher=function(t){t.exportApi(i,e)}}}var wo=function(e){S(n,e),n.exportApi=function(e,t){this.hasOwnProperty("exports")||Object.defineProperty(this,"exports",{enumerable:!1,writable:!0,configurable:!0,value:this.exports?this.exports.slice():[]}),this.exports.push({name:e,options:t})};var t=n.prototype;function n(t){var n;return(n=e.call(this)||this).container=t,n.beforeInvoke=lo,n.beforeInvokeFail=fo,n.checkUrlInConfig=po,n.createInvokeMethodApi=_o,n._eventEmitter=void 0,n}return t.createEventApi=function(e,t){return yo(this.emitter,e,t)},t.createNativeEventApi=function(e,t){var n=this,i="__internal_"+e+"__";return this.addSetupHandler((function(){n.onMethod(e,(function(e){var r,o=null!=(r=null==t||null==t.transformData?void 0:t.transformData(e))?r:e;null==t||null==t.whenEventEmit||t.whenEventEmit(o),n.emitter.emit(i,e),null==t||null==t.whenEventEmitted||t.whenEventEmitted(o)}))})),yo(this.emitter,i,t)},q(n,[{key:"invokeMethod",get:function(){return this.container.bridge.invokeMethod}},{key:"subscribe",get:function(){return this.container.bridge.subscribe}},{key:"onMethod",get:function(){return this.container.bridge.onMethod}},{key:"publish",get:function(){return this.container.bridge.publish}},{key:"emitter",get:function(){var e=this;return this._eventEmitter||(this._eventEmitter=new Yi({wrapper:function(t){return Vr(t,{context:null,errMsg:"at tt event api",data:e.container})}})),this._eventEmitter}}]),n}(or);function ko(e,t){var n=e+"() { [native code] }";Object.defineProperty(t,"toString",{configurable:!0,writable:!0,enumerable:!1,value:function(){return n}})}wo.exports=void 0;var So=function(e){function t(t,n){var i;return(i=e.call(this)||this).container=t,i.exports=void 0,i.instance=new Map,i.apis=void 0,i.apis=Array.from(new Set(n)),i}S(t,e),t.getExports=function(e,n){var i=new t(e,n);return ar(i),i.exports};var n=t.prototype;return n.setup=function(){this.exports=this.composeAPIs(this.apis)},n.teardown=function(){for(var e,t=l(this.instance.values());!(e=t()).done;){var n=e.value;n._runTeardown()}},n.composeAPIs=function(e){for(var t,n={},i=l(e);!(t=i()).done;){var r=t.value,o=new r(this.container);this.instance.set(r,o),ar(o);var a=o.constructor.exports;if(a)for(var s,c=l(a);!(s=c()).done;){var u=s.value.name,f=o[u];if("function"==typeof f){var d=Gr(f.bind(o),"at tt."+u);ko(u,d),n[u]=d}else if(null!=f)if(f.on){var h=f,p=h.on,v=h.off,g=u[0].toUpperCase()+u.slice(1),m="on"+g;if(n[m]=p,ko(m,p),v){var _="off"+g;n[_]=v,ko(_,v)}}else n[u]=f}}return n},t}(or),Co=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o=t)return e.substring(0,i);return e}(e.title,14),this.invokeMethod("showToast",e,{beforeAll:function(e){e.errMsg=e.errMsg.replace("showToast","showLoading")}}))}},{kind:"method",decorators:[bo()],key:"hideLoading",value:function(e){void 0===e&&(e={}),this.invokeMethod("hideToast",e,{beforeAll:function(e){e.errMsg=e.errMsg.replace("hideToast","hideLoading")}})}}]}}),wo);var Bo=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o6?this.beforeInvokeFail("showActionSheet",e,"param.itemList should has at most 6 items"):this.invokeMethod("showActionSheet",e))}}]}}),wo),Fo=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o8?this.beforeInvokeFail("showModal",e,"confirmText length should not larger than 4 Chinese characters"):to(e.cancelText)>8?this.beforeInvokeFail("showModal",e,"cancelText length should not larger than 4 Chinese characters"):this.invokeMethod("showModal",e))}}]}}),wo);var Ro=function(e){return"string"==typeof e?e.replace(/[^\u0000-\u00ff]/g,"aa").length:0},Vo=Pi(null,(function(e,t){var n=function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o0)this.continueShowCount++;else Date.now()-this.lastCloseTime<500?this.continueShowCount++:this.reset();this.continueShowCount>=3?this.tryShowTipModal(e):this.showNormalModal(e)}}},{kind:"field",key:"getShowModalTipInfo",value:function(){return this.createInvokeMethodApi("getShowModalTipInfo")}},{kind:"method",key:"tryShowTipModal",value:function(e){var t=this;void 0===e&&(e={}),this.getShowModalTipInfo({success:function(e){t.showTipModal(e)},fail:function(n){t.showNormalModal(e)}})}},{kind:"method",key:"showNormalModal",value:function(e){var t=this;void 0===e&&(e={});var n=(e=Object.assign({},e)).success,i=e.fail;e.success=function(e){t.lastCloseTime=Date.now(),t.currentShowCount--,n&&n(e)},e.fail=function(e){t.currentShowCount--,i&&i(e)},this.currentShowCount++,this.original.showModal(e)}},{kind:"method",key:"showTipModal",value:function(e){var t=this;this.isTipShowed=!0,this.original.showModal({title:e.title,cancelText:e.cancelText,confirmText:e.confirmText,success:function(e){var n,i=e.confirm,r=e.cancel;if(t.isTipShowed=!1,i){t.reset();var o=t.currentShowCount;t.currentShowCount=0,void 0===(n={fail:function(){t.reset(),t.currentShowCount=o}})&&(n={}),oo("exitMiniProgram",n)}r&&t.reset()},fail:function(e){t.isTipShowed=!1}})}},{kind:"method",key:"reset",value:function(){this.continueShowCount=0,this.lastCloseTime=0,this.isTipShowed=!1}}]}}),wo),Wo=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o30?e.beforeInvokeFail("showPrompt",t,"title length should not larger than 15 Chinese characters"):Ro(t.confirmText)>8?e.beforeInvokeFail("showPrompt",t,"confirmText length should not larger than 4 Chinese characters"):Ro(t.cancelText)>8?e.beforeInvokeFail("showPrompt",t,"cancelText length should not larger than 4 Chinese characters"):(t.maxLength=function(e){return"number"!=typeof e||isNaN(e)?140:e>=-1?e:140}(t.maxLength),e.invokeMethod("showPrompt",t))}}}]}}),wo),Uo=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o0?oo("docsPicker",e):fo("docsPicker",e,"no valid maxNum")}}]}}),wo),Yo=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;oi&&(t.beforeInvokeFail("enableLeaveConfirm",e,"invalid parameter: "+n+" length can not exceed "+i+" characters"),!0)};this.beforeInvoke("enableLeaveConfirm",e,{effect:[],title:"String",content:"String",confirmText:"String",cancelText:"String",confirmColor:"String",cancelColor:"String"})&&(0===e.effect.length?this.beforeInvokeFail("enableLeaveConfirm",e,"invalid parameter: effect length can not be empty"):e.title||e.content?n("title",16)||n("content",80)||n("confirmText",8)||n("cancelText",8)||this.invokeMethod("enableLeaveConfirm",e,{beforeSuccess:function(){t._leaveConfirmConfig=e}}):this.beforeInvokeFail("enableLeaveConfirm",e,"invalid parameter: title and content can not be empty at the same time"))}},{kind:"field",decorators:[bo()],key:"disableLeaveConfirm",value:function(){var e=this;return this.createInvokeMethodApi("disableLeaveConfirm",{beforeSuccess:function(){e._leaveConfirmConfig={}}})}},{kind:"field",decorators:[bo()],key:"LeaveConfirmCancel",value:function(){return this.createNativeEventApi("onLeaveConfirmCancel")}},{kind:"field",key:"composeSafariCache",value:function(){var e=this;return function(){return{leaveConfirmConfig:e._leaveConfirmConfig}}}}]}}),wo),na=function(){function e(){}var t=e.prototype;return t._reportUndefinedDefaultCode=function(){var e={domain:"js.open_platform.gadget",code:1e4,level:j.warn,message:"undefined_default_code"};return new de({name:"undefined_default_code",code:e})},t._buildParams=function(e,t){var n;return void 0===t&&(t={}),(n={}).biz_event_name=e,n.biz_data=t,n.common_data={},n},t.report=function(e,t,n,i){void 0===n&&(n={}),e||this._reportUndefinedDefaultCode();var r=new de({name:"op_biz_event",code:new fe(t)});null!=i&&i.traceId&&r.tracing(i.traceId);var o=this._buildParams(e,n);return r.addMap(o).flush()},e}(),ia=Pi(null,(function(e,t){return{F:function(t){function n(){for(var n,i=arguments.length,r=new Array(i),o=0;o0;)if(o===e[a])return i;r(t)}}Object.assign(p.prototype,{subscribe:function(e,t,n){var i=this,r=this._target,o=this._emitter,a=this._listeners,s=function(){var i=d.apply(null,arguments),a={data:i,name:t,original:e};if(n){var s=n.call(r,a);!1!==s&&o.emit.apply(o,[a.name].concat(i))}else o.emit.apply(o,[t].concat(i))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!i._onNewListener?(this._onNewListener=function(n){n===t&&null===a[e]&&(a[e]=s,i._on.call(r,e,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!o.hasListeners(n)&&a[e]&&(a[e]=null,i._off.call(r,e,s))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=s,i._on.call(r,e,s))},unsubscribe:function(e){var t,n,i,r=this,o=this._listeners,a=this._emitter,s=this._off,u=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function l(){r._onNewListener&&(a.off("newListener",r._onNewListener),a.off("removeListener",r._onRemoveListener),r._onNewListener=null,r._onRemoveListener=null);var e=w.call(a,r);a._observers.splice(e,1)}if(e){if(!(t=o[e]))return;s.call(u,e,t),delete o[e],--this._listenersCount||l()}else{for(i=(n=c(o)).length;i-- >0;)e=n[i],s.call(u,e,o[e]);this._listeners={},this._listenersCount=0,l()}}});var _=m(["function"]),y=m(["object","function"]);function b(e,t,n){var i,r,o,a=0,s=new e((function(c,u,l){function f(){r&&(r=null),a&&(clearTimeout(a),a=0)}n=v(n,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),i=!n.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof l;var d=function(e){f(),c(e)},h=function(e){f(),u(e)};i?t(d,h,l):(r=[function(e){h(e||Error("canceled"))}],t(d,h,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");r.push(e)})),o=!0),n.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),u(e)}),n.timeout))}));return i||(s.cancel=function(e){if(r){for(var t=r.length,n=1;n0;)"_listeners"!==(h=_[s])&&(y=k(e,t,n[h],i+1,r))&&(b?b.push.apply(b,y):b=y);return b}if("**"===w){for((m=i+1===r||i+2===r&&"*"===S)&&n._listeners&&(b=k(e,t,n,r,r)),s=(_=c(n)).length;s-- >0;)"_listeners"!==(h=_[s])&&("*"===h||"**"===h?(n[h]._listeners&&!m&&(y=k(e,t,n[h],r,r))&&(b?b.push.apply(b,y):b=y),y=k(e,t,n[h],i,r)):y=k(e,t,n[h],h===S?i+2:i,r),y&&(b?b.push.apply(b,y):b=y));return b}if(n[w]&&(b=k(e,t,n[w],i+1,r)),(p=n["*"])&&k(e,t,p,i+1,r),v=n["**"])if(i0;)"_listeners"!==(h=_[s])&&(h===S?k(e,t,v[h],i+2,r):h===w?k(e,t,v[h],i+1,r):((g={})[h]=v[h],k(e,t,{"**":g},i+1,r)));else v._listeners?k(e,t,v,r,r):v["*"]&&v["*"]._listeners&&k(e,t,v["*"],r,r);return b}function S(e,t,n){var i,r,o=0,a=0,s=this.delimiter,c=s.length;if("string"==typeof e)if(-1!==(i=e.indexOf(s))){r=new Array(5);do{r[o++]=e.slice(a,i),a=i+c}while(-1!==(i=e.indexOf(s,a)));r[o++]=e.slice(a)}else r=[e],o=1;else r=e,o=e.length;if(o>1)for(i=0;i+10&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,f.call(this,l._listeners.length,u))):l._listeners=t,!0;return!0}function C(e,t,n,i){for(var r,o,a,s,u=c(e),l=u.length,f=e._listeners;l-- >0;)r=e[o=u[l]],a="_listeners"===o?n:n?n.concat(o):[o],s=i||"symbol"==typeof o,f&&t.push(s?a:a.join(this.delimiter)),"object"==typeof r&&C.call(this,r,t,a,s);return t}function E(e){for(var t,n,i,r=c(e),o=r.length;o-- >0;)(t=e[n=r[o]])&&(i=!0,"_listeners"===n||E(t)||delete e[n]);return i}function z(e,t,n){this.emitter=e,this.event=t,this.listener=n}function I(e,n,i){if(!0===i)a=!0;else if(!1===i)o=!0;else{if(!i||"object"!=typeof i)throw TypeError("options should be an object or true");var o=i.async,a=i.promisify,c=i.nextTick,u=i.objectify}if(o||c||a){var l=n,f=n._origin||n;if(c&&!r)throw Error("process.nextTick is not supported");a===t&&(a="AsyncFunction"===n.constructor.name),(n=function(){var e=arguments,t=this,n=this.event;return a?c?Promise.resolve():new Promise((function(e){s(e)})).then((function(){return t.event=n,l.apply(t,e)})):(c?process.nextTick:s)((function(){t.event=n,l.apply(t,e)}))})._async=!0,n._origin=f}return[n,u?new z(this,e,n):this]}function T(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,l.call(this,e)}z.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},T.EventEmitter2=T,T.prototype.listenTo=function(e,n,r){if("object"!=typeof e)throw TypeError("target musts be an object");var o=this;function a(t){if("object"!=typeof t)throw TypeError("events must be an object");var n,i=r.reducers,a=w.call(o,e);n=-1===a?new p(o,e,r):o._observers[a];for(var s,u=c(t),l=u.length,f="function"==typeof i,d=0;d0;)i=n[r],e&&i._target!==e||(i.unsubscribe(t),o=!0);return o},T.prototype.delimiter=".",T.prototype.setMaxListeners=function(e){e!==t&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},T.prototype.getMaxListeners=function(){return this._maxListeners},T.prototype.event="",T.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},T.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},T.prototype._once=function(e,t,n,i){return this._many(e,1,t,n,i)},T.prototype.many=function(e,t,n,i){return this._many(e,t,n,!1,i)},T.prototype.prependMany=function(e,t,n,i){return this._many(e,t,n,!0,i)},T.prototype._many=function(e,t,n,i,r){var o=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");function a(){return 0==--t&&o.off(e,a),n.apply(this,arguments)}return a._origin=n,this._on(e,a,i,r)},T.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||u.call(this);var e,t,n,i,r,a,s=arguments[0],c=this.wildcard;if("newListener"===s&&!this._newListener&&!this._events.newListener)return!1;if(c&&(e=s,"newListener"!==s&&"removeListener"!==s&&"object"==typeof s)){if(n=s.length,o)for(i=0;i3)for(t=new Array(f-1),r=1;r3)for(n=new Array(d-1),a=1;a0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,f.call(this,this._events[e].length,e))):this._events[e]=n,a)},T.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var o="string"==typeof e?e.split(this.delimiter):e.slice();if(!(r=k.call(this,null,o,this.listenerTree,0)))return this}else{if(!this._events[e])return this;n=this._events[e],r.push({_listeners:n})}for(var a=0;a0){for(n=0,i=(t=this._all).length;n0;)"function"==typeof(i=s[n[o]])?r.push(i):r.push.apply(r,i);return r}if(this.wildcard){if(!(a=this.listenerTree))return[];var u=[],l="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,u,l,a,0),u}return s&&(i=s[e])?"function"==typeof i?[i]:i:[]},T.prototype.eventNames=function(e){var t=this._events;return this.wildcard?C.call(this,this.listenerTree,[],null,e):t?c(t):[]},T.prototype.listenerCount=function(e){return this.listeners(e).length},T.prototype.hasListeners=function(e){if(this.wildcard){var n=[],i="string"==typeof e?e.split(this.delimiter):e.slice();return k.call(this,n,i,this.listenerTree,0),n.length>0}var r=this._events,o=this._all;return!!(o&&o.length||r&&(e===t?c(r).length:r[e]))},T.prototype.listenersAny=function(){return this._all?this._all:[]},T.prototype.waitFor=function(e,n){var i=this,r=typeof n;return"number"===r?n={timeout:n}:"function"===r&&(n={filter:n}),b((n=v(n,{timeout:0,filter:t,handleError:!1,Promise:Promise,overload:!1},{filter:_,Promise:g})).Promise,(function(t,r,o){function a(){var o=n.filter;if(!o||o.apply(i,arguments))if(i.off(e,a),n.handleError){var s=arguments[0];s?r(s):t(d.apply(null,arguments).slice(1))}else t(d.apply(null,arguments))}o((function(){i.off(e,a)})),i._on(e,a,!1)}),{timeout:n.timeout,overload:n.overload})};var x=T.prototype;Object.defineProperties(T,{defaultMaxListeners:{get:function(){return x._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");x._maxListeners=e},enumerable:!0},once:{value:function(e,t,n){return b((n=v(n,{Promise:Promise,timeout:0,overload:!1},{Promise:g})).Promise,(function(n,i,r){var o;if("function"==typeof e.addEventListener)return o=function(){n(d.apply(null,arguments))},r((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,s=function(){a&&e.removeListener("error",a),n(d.apply(null,arguments))};"error"!==t&&(a=function(n){e.removeListener(t,s),i(n)},e.once("error",a)),r((function(){a&&e.removeListener("error",a),e.removeListener(t,s)})),e.once(t,s)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(x,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),e.exports=T}()}));function ga(e){void 0===e&&(e={}),oo("checkWatermark",e)}var ma=new va,_a="_onWatermarkChange";function ya(e){var t,n,i;if(e)if("function"==typeof e?t=e:"object"==typeof e&&("function"==typeof e.callback&&(t=e.callback),"function"==typeof e.success&&(n=e.success),"function"==typeof e.fail&&(i=e.fail)),t)if(0===ma.listenerCount(_a)){oo("onWatermarkChange",{success:function(e){ma.on(_a,t),n&&n(e)},fail:i})}else ma.on(_a,t),n&&n();else i&&i("have no callback")}function ba(e){var t,n,i;if(e)if("function"==typeof e?t=e:"object"==typeof e&&("function"==typeof e.callback&&(t=e.callback),"function"==typeof e.success&&(n=e.success),"function"==typeof e.fail&&(i=e.fail)),t){n&&n();var r=ma.listenerCount(_a);ma.off(_a,t),1===r&&0===ma.listenerCount(_a)&&oo("offWatermarkChange",{})}else i&&i("have no callback")}function wa(e){void 0===e&&(e={});lo("setAuthenticationInfo",e,{mobile:"String",identifyCode:"String",identifyName:"String"})&&oo("setAuthenticationInfo",e)}function ka(e){void 0===e&&(e={}),oo("startFaceIdentify",e)}function Sa(e){void 0===e&&(e={});lo("startFaceVerify",e,{userId:"String"})&&oo("startFaceVerify",e)}ao("onWatermarkChange",(function(e){void 0===e&&(e={}),ma.emit(_a,e)}));var Ca=0,Ea=[],za=_o("getLocation",{beforeAll:function(){Ca=0},afterAll:function(e){Ea.forEach((function(t){"function"==typeof t.complete&&$r(t.complete,"at getLocation complete callback function")(e)})),Ea=[]},afterSuccess:function(e){Ea.forEach((function(t){"function"==typeof t.success&&$r(t.success,"at getLocation success callback function")(e)}))},afterFail:function(e){Ea.forEach((function(t){"function"==typeof t.fail&&$r(t.fail,"at getLocation fail callback function")(e)}))}}),Ia=function(e){var t;Ca?(Ea.push(e),Date.now()-Ca>=1e4&&(t=Date.now()-Ca,Or(mr,Sr).addMap({api_name:"getLocation",api_queue_length:Ea.length,api_timeout:t}).flush())):(Ca=Date.now(),za(e))},Ta=_o("openLocation",{checkParams:{latitude:0,longitude:0}}),xa=_o("chooseLocation"),Oa=_o("getLocationStatus"),Aa=new va.EventEmitter2,La="onLocationChange";ao("onLocationChange",(function(e){void 0===e&&(e={}),Aa.emit(La,e)}));var Ma=_o("startLocationUpdate"),Na=_o("stopLocationUpdate"),Da=Xr(Aa,La,(function(e){return $r(e)})),Pa=Da.on,ja=Da.off,Ba=["ascii","base64","binary","hex","ucs2","ucs-2","utf16le","utf-16le","utf-8","utf8","latin1"],Fa=function(){function e(e){var t=e.mode,n=void 0===t?0:t,i=e.size,r=void 0===i?0:i,o=e.lastAccessedTime,a=void 0===o?"":o,s=e.lastModifiedTime,c=void 0===s?"":s;this.mode=n,this.size=r,this.lastAccessedTime=a,this.lastModifiedTime=c}var t=e.prototype;return t._checkModeProperty=function(e){return(61440&this.mode)===e},t.isFile=function(){return this._checkModeProperty(32768)},t.isDirectory=function(){return this._checkModeProperty(16384)},e}(),Ra=new(function(){function e(){}var t=e.prototype;return t.getFileInfo=function(e){void 0===e&&(e={}),lo("getFileInfo",e,{filePath:""})&&oo("getFileInfo",e)},t.getSavedFileList=function(e){void 0===e&&(e={}),oo("getSavedFileList",e)},t.removeSavedFile=function(e){void 0===e&&(e={}),lo("removeSavedFile",e,{filePath:""})&&oo("removeSavedFile",e)},t.getSavedFileInfo=function(e){void 0===e&&(e={}),lo("getSavedFileInfo",e,{filePath:""})&&oo("getSavedFileInfo",e)},t.saveFile=function(e){void 0===e&&(e={}),lo("saveFile",e,{tempFilePath:""})&&oo("saveFile",e)},t.saveFileSync=function(e,t){if(!e||"string"!=typeof e)throw new TypeError("tempFilePath must be a string");var n,i;if(oo("saveFileSync",{tempFilePath:e,filePath:t,success:function(e){i=e.savedFilePath},fail:function(e){n=e.errMsg}}),n)throw new Error(n);return i},t.readFile=function(e){void 0===e&&(e={}),lo("readFile",e,{filePath:""})&&oo("readFile",e)},t.readFileSync=function(e,t){if(!e||"string"!=typeof e)throw new TypeError("filePath must be a string");if(t&&"string"!=typeof t)throw new TypeError("encoding must be a string");var n,i,r={filePath:e};if(t&&(r.encoding=t),oo("readFileSync",Object.assign({},r,{success:function(e){i=e.data},fail:function(e){n=e.errMsg}})),n)throw new Error(n);return i},t.writeFile=function(e){void 0===e&&(e={}),lo("writeFile",e,{filePath:""})&&(e.encoding&&-1===Ba.indexOf(e.encoding)?fo("writeFile",e,'invalid encoding "'+e.encoding+'"'):oo("writeFile",e,{}))},t.writeFileSync=function(e,t,n){if(!e||"string"!=typeof e)throw new TypeError("filePath must be a string");if(n&&-1===Ba.indexOf(n))throw new Error('invalid encoding "'+n+'"');var i;if(oo("writeFileSync",{filePath:e,data:t,encoding:n,fail:function(e){i=e.errMsg}}),i)throw new Error(i)},t.mkdir=function(e){void 0===e&&(e={}),lo("mkdir",e,{dirPath:""})&&oo("mkdir",e)},t.mkdirSync=function(e,t){if(void 0===t&&(t=!1),!e||"string"!=typeof e)throw new TypeError("dirPath must be a string");var n;if(oo("mkdirSync",{dirPath:e,recursive:t,fail:function(e){n=e.errMsg}}),n)throw new Error(n)},t.readdir=function(e){void 0===e&&(e={}),lo("readdir",e,{dirPath:""})&&oo("readdir",e)},t.readdirSync=function(e){if(!e||"string"!=typeof e)throw new TypeError("dirPath must be a string");var t,n;if(oo("readdirSync",{dirPath:e,success:function(e){n=e.files},fail:function(e){t=e.errMsg}}),t)throw new Error(t);return n},t.rmdir=function(e){void 0===e&&(e={recursive:!1}),lo("rmdir",e,{dirPath:""})&&oo("rmdir",e)},t.rmdirSync=function(e,t){if(void 0===t&&(t=!1),!e||"string"!=typeof e)throw new TypeError("dirPath must be a string");var n;if(oo("rmdirSync",{dirPath:e,recursive:t,fail:function(e){n=e.errMsg}}),n)throw new Error(n)},t.access=function(e){void 0===e&&(e={});/^(ttfile|http):\/\/(user|temp)$/.test(e.path)&&(e.path+="/"),lo("access",e,{path:""})&&oo("access",e)},t.accessSync=function(e){if(!e||"string"!=typeof e)throw new TypeError("path must be a string");var t;if(/^(ttfile|http):\/\/(user|temp)$/.test(e)&&(e+="/"),oo("accessSync",{path:e,fail:function(e){t=e.errMsg}}),t)throw new Error(t)},t.unlink=function(e){void 0===e&&(e={}),lo("unlink",e,{filePath:""})&&oo("unlink",e)},t.unlinkSync=function(e){if(!e||"string"!=typeof e)throw new TypeError("filePath must be a string");var t;if(oo("unlinkSync",{filePath:e,fail:function(e){t=e.errMsg}}),t)throw new Error(t)},t.stat=function(e){void 0===e&&(e={}),lo("stat",e,{path:""})&&oo("stat",e,{beforeSuccess:function(e){e.stats=e.stat=new Fa(e.stat)}})},t.statSync=function(e){if(!e||"string"!=typeof e)throw new TypeError("path must be a string");var t,n;if(oo("statSync",{path:e,success:function(e){n=new Fa(e.stat)},fail:function(e){t=e.errMsg}}),t)throw new Error(t);return n},t.rename=function(e){void 0===e&&(e={}),lo("rename",e,{oldPath:"",newPath:""})&&oo("rename",e)},t.renameSync=function(e,t){if(!e||"string"!=typeof e)throw new TypeError("oldPath must be a string");if(!t||"string"!=typeof t)throw new TypeError("newPath must be a string");var n;if(oo("renameSync",{oldPath:e,newPath:t,fail:function(e){n=e.errMsg}}),n)throw new Error(n)},t.copyFile=function(e){void 0===e&&(e={}),lo("copyFile",e,{srcPath:"",destPath:""})&&oo("copyFile",e)},t.copyFileSync=function(e,t){if(!e||"string"!=typeof e)throw new TypeError("srcPath must be a string");if(!t||"string"!=typeof t)throw new TypeError("destPath must be a string");var n;if(oo("copyFileSync",{srcPath:e,destPath:t,fail:function(e){n=e.errMsg}}),n)throw new Error(n)},t.unzip=function(e){void 0===e&&(e={}),lo("unzip",e,{zipFilePath:"",targetPath:""})&&oo("unzip",e,{})},e}());function Va(){return Ra}var Wa=Ra.saveFile;Ra.getFileInfo;var Ua,qa=Ra.getSavedFileList,Ja=Ra.removeSavedFile;!function(e){e[e.Cancelled=1000001]="Cancelled",e[e.InvalidParam=104]="InvalidParam",e[e.InternalError=102]="InternalError"}(Ua||(Ua={}));var Ha=function(){function e(t,n){var i=this;if(void 0===n&&(n=!1),this.taskId=eo(),this.bizInvokeTime=(new Date).valueOf(),this.illegal=!1,this.abort=function(){i.illegal||oo("downloadFileAbort",{payload:JSON.stringify({downloadTaskId:i.taskId})})},this.onProgressUpdate=function(t){i.illegal||"function"!=typeof t||e.eventNexus.on(i.taskId,(function(e){$r(t,"at downloadTask.onProgressUpdate callback function")(e)}))},n)this.illegal=!0;else{var r=Object.assign({},t,{taskId:this.taskId});oo("downloadFile",{payload:JSON.stringify(Object.assign({},t,{downloadTaskId:this.taskId})),fail:e.callBackWrapper(r,this.bizInvokeTime,"fail"),success:e.callBackWrapper(r,this.bizInvokeTime,"success")})}}return e.reportResult=function(e){var t=e.errCode===Ua.Cancelled||e.errMsg.toLocaleLowerCase().startsWith("downloadFile:fail canceled"),n=t?Ir:zr,i=t?"cancel":e.resultType,r=Date.now()-e.bizInvokeTime,o={request_version:"v2",request_trace:e.taskId,request_url:"string"==typeof e.url?e.url.split("?")[0]:qi(e.url),request_biz_invoke_time:e.bizInvokeTime,error_msg:e.errMsg||"",duration:r,result_type:i,api_name:"downloadFile"};Or(_r,n).setPlatform("TeaSlardar").addMap(o).flush()},e.callBackWrapper=function(t,n,i){return function(r){var o=t.taskId,a=t.success,s=t.fail,c=t.complete,u=r.payload,l=r.errCode,f=null,d=r.errMsg;if("string"==typeof u)try{f=JSON.parse(u)}catch(e){d="downloadFile:fail sdk parse payload error",Gi.error("[js-sdk-downloadFile] biz callback payload json parse error")}var h=f?Object.assign({},f,{trace:o,errMsg:d}):{errMsg:d,trace:o};if("success"===i&&f&&"function"==typeof a)a(h);else if("function"==typeof s){s(void 0===l?h:Object.assign({},h,{errCode:l}))}"function"==typeof c&&c(h),e.eventNexus.off(t.taskId),e.reportResult({resultType:i,errMsg:d,bizInvokeTime:n,errCode:l,taskId:t.taskId,url:t.url})}},e}();function Ka(e){void 0===e&&(e={});var t={resultType:"fail",errMsg:"downloadFile:fail",bizInvokeTime:Date.now(),taskId:"",url:e.url};if(!lo("downloadFile",e,{url:""}))return t.errMsg="downloadFile:fail invalid param.url type",void Ha.reportResult(t);var n,i,r="";if(n=e.url,void 0===i&&(i="http"),("http"===i?/^(http|https):\/\/.*/i.test(n):"websocket"===i?/^(ws|wss):\/\/.*/i.test(n):void 0)||(r='invalid url "'+e.url+'"'),!r&&("string"!=typeof e.method&&e.method||0===e.method)&&(r="param.method should pass string, not "+typeof e.method),r)return t.errMsg="downloadFile:fail "+r,Ha.reportResult(t),void fo("downloadFile",e,r);var o=!1,a=e.filePath;if(null==a||""===a?delete e.filePath:"string"!=typeof a&&(t.errMsg="downloadFile:fail invalid param.filePath type",Ha.reportResult(t),fo("downloadFile",e,"filePath could only be string or null/undefined"),o=!0),o)return new Ha(e,!0);var s,c=Object.assign({},e);if("object"==typeof c.header&&null!==c.header||(Gi.warn("downloadFile: header must be an object"),c.header={}),c.header=(s=c.header,Object.keys(s).reduce((function(e,t){return"string"==typeof s[t]?e[t]=s[t]:"number"==typeof s[t]||"boolean"==typeof s[t]?e[t]=""+s[t]:e[t]=Object.prototype.toString.apply(s[t]),e}),{})),["success","fail","complete"].forEach((function(e){var t=c[e];"function"==typeof t&&(c[e]=$r(t,"at api downloadFile "+e+" callback function"))})),c.method||(c.method="GET"),"string"==typeof c.method&&(c.method=c.method.toUpperCase()),"GET"===c.method)c.url=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&Object.keys(t).length>0){var n=function(e){if("string"==typeof e){var t=e.split("?");return{urlQueryObj:(t[1]||"").split("&").reduce((function(e,t){if("string"==typeof t&&t.length>0){var n=t.split("=");e[n[0]]=n[1]}return e}),{}),prefix:t[0]}}return{}}(e),i=n.urlQueryObj,r=void 0===i?{}:i,o=n.prefix;return(void 0===o?"":o)+"?"+Hr(Kr(r,Object.keys(t).reduce((function(e,n){return"object"==typeof t[n]?e[encodeURIComponent(n)]=encodeURIComponent(JSON.stringify(t[n])):e[encodeURIComponent(n)]=encodeURIComponent(t[n]),e}),{})))}return e}(c.url,c.data),c.data&&delete c.data;else{var u,l,f=void 0;void 0===c.data||(f="string"==typeof c.data||c.data instanceof ArrayBuffer?c.data:null!=(u=c.header["content-type"])&&u.includes("application/x-www-form-urlencoded")?Hr(c.data,!0):null!=(l=c.header["content-type"])&&l.includes("application/json")||"object"==typeof c.data?JSON.stringify(c.data):c.data.toString()),c.data=f}["success","fail","complete"].forEach((function(e){var t=c[e];"function"==typeof t&&(c[e]=$r(t,"at api downloadFile "+e+" callback function"))}));var d=rr.pack(c);try{return new Ha(d)}catch(n){var h;t.errMsg="downloadFile:fail create downloadFile instant catch error",Ha.reportResult(t),fo("downloadFile",e,null!=(h=null==n?void 0:n.message)?h:"create downloadFile instant catch error")}}Ha.eventNexus=new Yi,Ha.progressCacheMap=new Map,ao("onDownloadFileProgress",(function(e){var t;void 0===e&&(e={});var n=e,i=n.progress,r=n.downloadTaskId,o=n.totalBytesExpectedToWrite,a=n.totalBytesWritten;r&&!isNaN(i)&&(Number(i)<(null!=(t=Ha.progressCacheMap.get(r))?t:0)||(Ha.progressCacheMap.set(r,Number(i)),Ha.eventNexus.emit(r,{progress:i,totalBytesWritten:a,totalBytesExpectedToWrite:o})))}));var Qa="waiting",Ga="sending",$a="done",Xa="aborted",Ya="created",Za="in_queue",es=0,ts=0;function ns(){var e=cs.get(this);ss.set(this,Ga),ps.set(this,Date.now());var t,n=this,i=(new Date).valueOf()%1e6;ts===i?es++:(ts=i,es=0);var r=+(""+i+(es<10?"0"+es:es));es>=99&&(es=0),as.set(n,r||i),oo("createDownloadTask",{url:e.url,header:e.header,data:e.data,method:e.method,filePath:e.filePath,taskId:r,success:function(e){ls.set(n,e.trace),as.set(n,e.downloadTaskId),gs+=1,_s[e.downloadTaskId]=n},fail:function(e){ls.set(n,e.trace),t=e.errMsg,bs(n,"fail",t)},complete:function(){ss.set(n,$a)}}),t?setTimeout((function(){var n={errMsg:t.replace("createDownloadTask","downloadFile")};"function"==typeof e.fail&&e.fail(n),"function"==typeof e.complete&&e.complete(n)}),0):(Gi.log("taskID",this,as.get(this)),ys.on(as.get(this)+"success",(function(t){t.errMsg="downloadFile:ok",t.statusCode=parseInt(t.statusCode,10),-1===[200,304].indexOf(t.statusCode)&&delete t.tempPath,delete t.timeInterval,"function"==typeof e.success&&e.success(t),"function"==typeof e.complete&&e.complete(t)})),ys.on(as.get(this)+"fail",(function(t){t.errMsg="downloadFile:fail "+t.errMsg,"function"==typeof e.fail&&e.fail(t),"function"==typeof e.complete&&e.complete(t)})))}var is=0,rs=new WeakMap,os=new WeakMap,as=new WeakMap,ss=new WeakMap,cs=new WeakMap,us=new WeakMap,ls=new WeakMap,fs=new WeakMap,ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,vs=new WeakMap,gs=0,ms=[],_s={},ys=new va.EventEmitter2;function bs(e,t,n){var i=vs.get(e),r=ss.get(e)===Xa,o=r?Ir:zr,a=r?"cancel":t,s=cs.get(e),c=us.get(e),u=Date.now()-c,l={request_version:"v1",request_trace:ls.get(e)||"",request_url:s.url.split("?")[0],request_method:s.method||"GET",request_biz_invoke_time:us.get(e),request_push_queue_time:fs.get(e)||0,request_shift_queue_time:hs.get(e)||0,request_queue_length:ds.get(e)||0,request_abort_type:i||"",error_msg:n||"",duration:u,result_type:a,api_name:"downloadFile"};Or(_r,o).setPlatform("TeaSlardar").addMap(l).flush()}ao("onDownloadTaskStateChange",(function(e){void 0===e&&(e={}),"string"==typeof e&&(e=JSON.parse(e));var t=e.state,n=e.downloadTaskId;if(delete e.state,delete e.downloadTaskId,ys.emit(""+n+t,e),"success"===t||"fail"===t){if(gs=Math.max(gs-1,0),ms.length>0){var i=ms.shift();hs.set(i.item,Date.now()),ns.call(i.item)}var r=_s[n];if(r){try{bs(r,t,e.errMsg)}catch(e){}delete _s[n],ys.removeAllListeners(n+"success"),ys.removeAllListeners(n+"fail"),ys.removeAllListeners(n+"progressUpdate")}}}));var ws,ks=function(e){var t=this;this.abort=function(){var e=ss.get(t),n=cs.get(t);if(ss.set(t,Xa),e===Qa){var i=ms.findIndex((function(e){return e.id===rs.get(t)}));i>-1&&ms.splice(i,1),vs.set(t,Za),setTimeout((function(){var e="downloadFile:fail abort";"function"==typeof n.fail&&n.fail({errMsg:e}),bs(t,"cancel",e),"function"==typeof n.complete&&n.complete({errMsg:e})}),0)}else e!==Xa&&(vs.set(t,Ya),oo("operateDownloadTask",{downloadTaskId:as.get(t),operationType:"abort"}))},this.onProgressUpdate=function(e){ys.on(as.get(t)+"progressUpdate",(function(t){"function"==typeof e&&$r(e,"at DownloadTask.onProgressUpdate callback function")(t)}))},us.set(this,Date.now());var n,i,r,o=is++;os.set(this,o),rs.set(this,o),ss.set(this,Qa),["success","fail","complete"].forEach((function(t){var n=e[t];"function"==typeof n&&(e[t]=$r(n,"at api downloadFile "+t+" callback function"))})),cs.set(this,e),gs>=5?(fs.set(this,Date.now()),ds.set(this,ms.length),ms.push({id:o,item:this}),n=this,i=cs.get(n),r={request_trace:ls.get(n)||"",request_url:i.url.split("?")[0],request_method:i.method||"GET",request_queue_length:5+ms.length,request_type:"downloadFile"},Or(_r,Tr).setPlatform("TeaSlardar").addMap(r).flush()):ns.call(this)};function Ss(e,t,n){var i=Er,r={request_url:"string"==typeof e?e.split("?")[0]:qi(e),request_method:"string"==typeof t?t:qi(t),error_msg:n,result_type:"fail",request_version:"v1",api_name:"downloadFile"};Or(_r,i).setPlatform("TeaSlardar").addMap(r).flush()}function Cs(e){if(void 0===e&&(e={}),((null==void 0?void 0:undefined.agent)||{}).useNewDownloadAPI)return Ka(e);if(lo("downloadFile",e,{url:""}))try{return new ks(e)}catch(t){Ss(e.url,e.method,"downloadFile:fail create downloadFile instant catch error "),fo("downloadFile",e,t.message)}else Ss(e.url,e.method,"downloadFile:fail invalid param.url type")}function Es(e){void 0===e&&(e={}),oo("getBlockActionSourceDetail",e)}var zs={NDEF:"NDEF",A:"NFC-A",B:"NFC-B",F:"NFC-F",V:"NFC-V",MIFARE_CLASSIC:"MIFARE-Classic",MIFARE_ULTRALIGHT:"MIFARE-Ultralight",ISO_DEP:"ISO-DEP"},Is=new va,Ts=new WeakMap,xs="discovered";ao("nfcFoundDevice",(function(e){Is.emit(xs,e)}));var Os=function(){function e(e){this.tech=e}var t=e.prototype;return t.connect=function(e){oo("nfcConnect",Object.assign({tech:this.tech},e))},t.close=function(e){oo("nfcClose",Object.assign({tech:this.tech},e))},t.setTimeout=function(e){oo("nfcSetTimeout",Object.assign({tech:this.tech},e))},t.transceive=function(e){oo("nfcTransceive",Object.assign({tech:this.tech},e))},t.getMaxTransceiveLength=function(e){oo("nfcMaxTransceiveLength",Object.assign({tech:this.tech},e))},e}(),As=function(e){function t(){return e.call(this,zs.A)||this}S(t,e);var n=t.prototype;return n.getAtqa=function(e){oo("nfcGetAtqa",e)},n.getSak=function(e){oo("nfcGetSak",e)},t}(Os),Ls=function(e){function t(){return e.call(this,zs.V)||this}return S(t,e),t}(Os),Ms=function(e){function t(){return e.call(this,zs.MIFARE_CLASSIC)||this}return S(t,e),t}(Os),Ns=((ws={})[zs.A]=As,ws[zs.MIFARE_CLASSIC]=Ms,ws[zs.V]=Ls,ws),Ds={};function Ps(e){return function(){return function(e){return Ds[e]||(Ds[e]=new Ns[e]),Ds[e]}(e)}}var js={tech:zs,getNfcA:Ps(zs.A),getNfcV:Ps(zs.V),getMifareClassic:Ps(zs.MIFARE_CLASSIC),onDiscovered:function(e){var t=Ts.get(e)||$r(e,"NFCAdapter.Discovered");Ts.set(e,t),Is.on(xs,t)},offDiscovered:function(e){var t=Ts.get(e);t&&Is.off(xs,t)},startDiscovery:function(e){oo("nfcStartDiscovery",e)},stopDiscovery:function(e){oo("nfcStopDiscovery",e)}};function Bs(){return js}var Fs=!1,Rs=[];function Vs(e){void 0===e&&(e={}),Fs=!0,oo("enableAccelerometer",Object.assign({},e,{enable:Fs}),{beforeAll:function(e){e.errMsg=e.errMsg.replace("enableAccelerometer","startAccelerometer")}})}function Ws(e){void 0===e&&(e={}),Fs=!1,oo("enableAccelerometer",Object.assign({},e,{enable:Fs}),Object.assign({},e,{beforeAll:function(e){e.errMsg=e.errMsg.replace("enableAccelerometer","stopAccelerometer")}}))}function Us(e){"function"==typeof e&&(Fs||oo("enableAccelerometer",{enable:Fs=!0}),Rs.push($r(e,"onAccelerometerChange")))}ao("onAccelerometerChange",(function(e){void 0===e&&(e={});for(var t=0;tCu[t.sampleRate][1]||t.encodeBitRate6e5||t.duration<0)&&(t.duration=6e4),zu(t)},pause:function(){zu({operationType:"pause",fail:function(e){Su.emit("onRecorderStateChange_error",e)}})},resume:function(){zu({operationType:"resume",fail:function(e){Su.emit("onRecorderStateChange_error",e)}})},stop:function(){zu({operationType:"stop",fail:function(e){Su.emit("onRecorderStateChange_error",e)}})},onStart:function(e){Su.removeAllListeners("onRecorderStateChange_start"),Su.on("onRecorderStateChange_start",(function(t){"function"==typeof e&&$r(e,"at recorderManager.onStart callback function")(t)}))},onResume:function(e){Su.removeAllListeners("onRecorderStateChange_resume"),Su.on("onRecorderStateChange_resume",(function(t){"function"==typeof e&&$r(e,"at recorderManager.onResume callback function")(t)}))},onPause:function(e){Su.removeAllListeners("onRecorderStateChange_pause"),Su.on("onRecorderStateChange_pause",(function(t){"function"==typeof e&&$r(e,"at recorderManager.onPause callback function")(t)}))},onStop:function(e){Su.removeAllListeners("onRecorderStateChange_stop"),Su.on("onRecorderStateChange_stop",(function(t){"function"==typeof e&&$r(e,"at recorderManager.onStop callback function")(t)}))},onFrameRecorded:function(e){Su.removeAllListeners("onRecorderStateChange_frameRecorded"),Su.on("onRecorderStateChange_frameRecorded",(function(t){if("function"==typeof e){var n=t.frameBuffer;"string"==typeof n&&(t.frameBuffer=Ui(n)),$r(e,"at recorderManager.onFrameRecorded callback function")(t)}}))},onError:function(e){Su.removeAllListeners("onRecorderStateChange_error"),Su.on("onRecorderStateChange_error",(function(t){"function"==typeof e&&$r(e,"at recorderManager.onError callback function")(t)}))}};function Tu(){return Iu}var xu=new va.EventEmitter2,Ou=Symbol("beacon_service_change"),Au=Symbol("beacon_update");ao("beaconServiceChange",(function(){for(var e=arguments.length,t=new Array(e),n=0;n=20||u>=j.error?n():t||(t=setTimeout((function(){n()}),4e3))},log:function(e){}});ce.setup(i)}();var el=function(e){var t,n,i,r;Rn("h5jssdk_enter",{url:null==(t=window)||null==(n=t.location)?void 0:n.href,host:null==(i=window)||null==(r=i.location)?void 0:r.host,eventType:e,client:w(h),larkVersion:h.versions.larkVersion,platform:navigator.platform,browser:navigator.userAgent,time:+new Date,app_id:b()})};el(Ln.START_LOAD_SDK),window.dispatchEvent(new CustomEvent("WebViewJSBridgeReady"));var tl={biz:di,device:mi,appCenter:yi};Ii(tl,zi);var nl,il,rl,ol=null,al=[];if(window.ttJSBridge=null,h.versions.mobileFeishu||h.versions.PCFeishu){(rl=null==Xu?void 0:Xu.updateMeta)(),new MutationObserver((function(e){(function(e){for(var t=!1,n=0;n=0?ai.invoke("config",t,{onSuccess:function(t){i(t),"function"==typeof e.onSuccess&&e.onSuccess(t)},onFail:function(t){r(t),"function"==typeof e.onFail&&al.push(e.onFail),al.forEach((function(e){"function"==typeof e&&e(t)})),Rn("h5jssdk_authentication_failure",{error:JSON.stringify(t)}),ye(ge,ve[ue.authenticationFailure]).setError(_(t)).flush()}}):i();case 1:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())},ready:(il=a(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Fn(),e.prev=1,e.next=4,Ci({api:tl,browser:h,build:"cdn",SDK:sl});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),g(null==e.t0?void 0:e.t0.message,!0);case 9:if(!ol){e.next=19;break}return e.prev=10,e.next=13,ol;case 13:e.next=17;break;case 15:e.prev=15,e.t1=e.catch(10);case 17:e.next=20;break;case 19:g("please invoke h5sdk.config before invoke h5sdk.ready锛宱therwise the interface call may fail",!0);case 20:el(Ln.SDK_READY),t();case 22:case"end":return e.stop()}}),e,null,[[1,6],[10,15]])}))),function(e){return il.apply(this,arguments)}),error:(nl=a(s.mark((function e(t){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:al.push(t);case 1:case"end":return e.stop()}}),e)}))),function(e){return nl.apply(this,arguments)}),updateMeta:function(){null==Xu||Xu.updateMeta()}};Ci({api:tl,browser:h,build:"cdn",SDK:sl}),window.lark?Object.assign(window.lark,sl):window.lark=sl,window.h5sdk?Object.assign(window.h5sdk,sl):window.h5sdk=sl,window.tt?Object.assign(window.tt,Xu):window.tt=Xu,window.ttJSBridge=si}}));