@apmplus/mini-program
Advanced tools
Comparing version 0.2.4 to 0.2.5-alpha.0
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).APMPlusMiniProSDK={})}(this,function(n){"use strict";function p(n){return JSON.stringify({ev_type:"batch",list:n})}var l=10,d=1e3;var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function e(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return(m=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function h(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],v=function(){return{}};function g(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function b(n){return"function"==typeof n}function u(n){return"number"==typeof n}function c(n){return"string"==typeof n}function E(n,e){var t,r,o=m({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=E(S(n[t])?n[t]:{},e[t]):a(e[t])&&a(n[t])?o[t]=function e(n,t){n=a(n)?n:[];t=a(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?E({},n):a(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function P(n,e){if(!a(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}var x=function(n,e){if(!a(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n};function k(n){return a(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function I(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function o(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}var s=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return v;var t=i[a],r=u.apply(void 0,_([t],y(n),!1)),o=r;return b(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return b(t)&&t.apply(this,e)}}),i[a]=o,function(n){n||(o===i[a]?i[a]=t:r=t)}}},f=0,j=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),(""+f++).padStart(8," ")],y(n),!1))},O=0,C=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),(""+O++).padStart(8," ")],y(n),!1))},T=function(n){return Math.random()<Number(n)},D=function(n,e){return n<Number(e)},R=function(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){j(n)}return e}};function A(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function N(){function t(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){r[n]&&r[n].forEach(function(n){t(n[1])}),r[n]=void 0}var r={};return{set:function(n,e,t){r[n]?r[n].push([e,t]):r[n]=[[e,t]]},remove:e,removeByEvType:function(e){Object.keys(r).forEach(function(n){r[n]&&r[n].forEach(function(n){n[0]===e&&t(n[1])})})},clear:function(){Object.keys(r).forEach(function(n){e(n)})}}}function M(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=I(e),o},merge:function(e){return t=m(m({},t),e),Object.keys(e).forEach(function(n){r[n]=I(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return m({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})}function V(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function L(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function q(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":u(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return P(e,n);case"neq":return!P(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function B(e,n){try{return"rule"===n.type?q(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return B(e,n)}):n.children.some(function(n){return B(e,n)})}catch(n){return!1}}function F(e){e.provide("sendEvent",function(n){n=K(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=W(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})})}var z,H=function(n,e,t,r){if(!e)return g;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,e=e.r,e=void 0===e?Math.random():e;if(P(i,n))return function(n){return V(n,1)};var c,s,f,p,l,d,m,a="session"===a,h=L(a,o,t,e,r),v=(c=u,s=a,f=o,p=t,l=e,d=r,m={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(m[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:L(s,r,p,l,d)},e&&(m[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:L(s,e,p,l,d),effectiveSampleRate:e*f,filter:n}}))):m[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),m);return function(n){if(!h())return!1;if(!(n.ev_type in v))return V(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(B(n,t[r].filter))return!!t[r].hit()&&V(n,t[r].effectiveSampleRate);return!!e.hit()&&V(n,e.effectiveSampleRate)}},U="custom",K=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,a={};for(o in i)a[o]=I(i[o]);e.categories=a}return e}},W=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:I(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=I(r[t]);e.metrics=o,e.categories=i}return e}},G=["success","fail","complete"];(Ue=z=z||{}).onLaunch="onLaunch",Ue.onShow="onShow",Ue.onHide="onHide",Ue.onError="onError",Ue.onPageNotFound="onPageNotFound",Ue.onUnhandledRejection="onUnhandledRejection";function J(n){return"[object Object]"===Object.prototype.toString.call(n)}var Y=["request","downloadFile","uploadFile"],$=["navigateTo","redirectTo","switchTab","reLaunch"],Q=_(_([],y($),!1),["navigateBack"],!1),X=_(_([],y([z.onLaunch,z.onShow,z.onHide]),!1),[z.onError,z.onPageNotFound,z.onUnhandledRejection],!1),Z=["attached","onInit"],nn=["onLoad","onShow","onReady","onUnload","onHide"],en="unknown_error_name",tn="__HOOKED__",rn=-1;var on=function(){return Date.now()};function an(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!b(n))return 0;var r,o=on();try{n.apply(this,e)}finally{r=on()}return r-o}function un(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return xn(t,((n={})[e]=null,n))})})}function cn(n,e){e.addTearDown(function(){return Pn(n,null)})}function sn(n){return kn("http")[n]}function fn(){return kn("setData")}function pn(){return!!kn("performance")}function ln(){return kn("instance")}var dn,mn=function(){},hn=y((dn="tt",[function(){return dn},function(n){return dn=n}]),2),vn=hn[0],gn=hn[1],bn=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},yn=function(n,e,r){var o=n[e];if(!o||!o[tn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){j(n)}return o.apply(this,n)}}),n[e]&&(n[e][tn]=!0),function(){n[e][tn]=!1,r=mn}},_n=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:vn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},wn="__slardar__global__0.2.4",Sn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},En=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?_n().instance:e)?e[wn]||(e[wn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=m(m({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=m({},Sn),e&&(e[wn]=t)}}}(m({},Sn)),Pn=En.setGlobalValue,xn=En.mergeGlobalValue,kn=En.getGlobalValue,In=function(n){return kn("app")[n]},jn=function(n){return kn("page")[n]},On=function(n){return kn("route")[n]},Cn=function(n){return!!kn("route")[n]},Tn=function(t,n){(n=void 0===n?Q:n).forEach(function(e){Cn(e)&&On(e).subscribe(function(n){return t(n,e)})})},Dn=function(n){return!!kn("http")[n]},Rn=function(n){xn("http",n),un("http",n)},An=function(){return kn("performance")},Nn=function(n){return kn("component")[n]},Mn=function(n){Pn("instance",n)};function Vn(n){return"function"==typeof n}function Ln(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function qn(n){return n}function Bn(t){return function(n){if((e=n)&&Vn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Fn(n){Vn(n)?n():null!=n&&n.unsubscribe()}var zn=function(n){return n instanceof Hn||n&&"closed"in n&&Vn(n.remove)&&Vn(n.add)&&Vn(n.unsubscribe)},Hn=(Un.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Vn(t)&&t(),e&&(this._finalizers=null,e.forEach(Fn)))},Un.prototype.remove=function(n){this._finalizers&&Ln(this._finalizers,n),n instanceof Un&&n._removeParent(this)},Un.prototype.add=function(n){if(n&&n!==this)if(this.closed)Fn(n);else{if(n instanceof Un){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Un.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Un.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Un.prototype._removeParent=function(n){this._parentage&&Ln(this._parentage,n)},Un);function Un(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Kn,Wn=(e(Gn,Kn=Hn),Gn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Gn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Gn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Gn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Kn.prototype.unsubscribe.call(this),this.destination=null)},Gn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Gn);function Gn(n){var e=Kn.call(this)||this;return e.isStopped=!1,e.destination=$n(n)?n:new Jn(!(n=n)||Vn(n)?{next:null!=n?n:void 0}:n),e}var Jn=(Yn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Yn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Yn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Yn);function Yn(n){this.partialObserver=n}function $n(n){return n instanceof Wn||n&&((e=n)&&Vn(e.next)&&Vn(e.error)&&Vn(e.complete))&&zn(n);var e}var Qn=(Xn.prototype.subscribe=function(n){var e=$n(n)?n:new Wn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Xn.prototype.lift=function(n){var e=new Xn;return e.source=this,e.operator=n,e},Xn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?qn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Xn.prototype._subscribe=function(n){},Xn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},Xn);function Xn(n){n&&(this._subscribe=n)}var Zn,ne=(e(ee,Zn=Qn),ee.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},ee.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},ee.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(ee.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),ee.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},ee.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},ee.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},ee.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},ee.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},ee.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?ee.EMPTY:(t.push(n),new Hn(function(){Ln(t,n)}))},ee.EMPTY=((Je=new Hn).closed=!0,Je),ee);function ee(){var n=null!==Zn&&Zn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var te=new Qn(function(n){return n.complete()});function re(r){return r<=0?function(){return te}:Bn(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function oe(r,o){return Bn(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function ie(t){return oe(function(n,e){return t<=e})}var ae,ue=(e(ce,ae=ne),ce.prototype.subscribe=function(n){var t=this,n=ae.prototype.subscribe.call(this,n);ln()&&ln()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},ce.prototype.unsubscribe=function(){ae.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},ce.prototype.addTearDown=function(n){this.tearDownFns.push(n)},ce);function ce(){var n=null!==ae&&ae.apply(this,arguments)||this;return n.tearDownFns=[],n}function se(n){return 1<n.length?n:n.length&&n[0]||{}}function fe(n){var t=n.filter(function(n){return n=n,!!!kn("app")[n]}),n=Re(t).subjectMap;xn("app",n=n),un("app",n),App=bn(App,function(e){t.forEach(function(n){var r=In(n),n=s(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:se(n),time:on()}),b(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function pe(n){return"SLARDAR"+n}function le(n){return n.route||n.__route__||n.url||n.path||""}function de(t){return{instance:t=void 0===t?_n().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:v,getSystemInfo:v,buildRequestProfile:v,componentSubject:v,setDataSubject:v,pagePerfSubscriber:v}}function me(n){function e(n,i){r.forEach(function(o){s(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Nn(o).next({that:this,param:null,time:on()});var t=i[o];if(b(t)&&t.apply(this,n),b(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=bn(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function he(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(m({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Tn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},$),jn("onLoad").pipe(ie(1)).subscribe(function(n){r.load_start=n.time}),jn("onShow").pipe(ie(1)).subscribe(function(n){r.dom_end=n.time}),jn("onReady").pipe(ie(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),In(z.onHide).subscribe(function(){!1===o&&(e(),t())})}function ve(e){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];An().subscribe(function(n){~t.indexOf(n.name)&&e(n)})}function ge(e){Nn("attached").subscribe(function(n){n=n.that;return e.call(n)})}function be(n){return"android"===n.toLowerCase()}function ye(){var n=wx.getAccountInfoSync().miniProgram,e=(l=wx.getSystemInfoSync()).model,t=l.brand,r=l.pixelRatio,o=l.screenHeight,i=l.screenWidth,a=l.windowHeight,u=l.windowWidth,c=l.language,s=l.version,f=l.system,p=l.platform,l=l.SDKVersion;return{model:e,brand:t,pixelRatio:r,screenArea:Fe({width:i,height:o}),windowArea:Fe({width:u,height:a}),language:c,osName:Be(p),osVersion:f,SDKVersion:l,appId:n.appId,miniEnv:n.envVersion,miniVersion:n.version,hostName:"wx",hostVersion:s,platform:"wx"}}function _e(n){return(c(n)?Ke:He)(n)}function we(n){void 0===n&&(n="tt");var e,t="",r="",o="";return tt.getEnvInfoSync?(r=(e=tt.getEnvInfoSync().microapp).envType,t=e.appId,o=e.mpVersion):(r=tt.env.VERSION,t=""),m({appId:t,miniEnv:r,miniVersion:o,platform:n},We())}function Se(e){var n=jn("onReady").subscribe(function(){var n;tt.performance&&(n=(tt.performance.getCurrentPageEntries()||[]).map(function(n){n.name,n.entryType;var e=h(n,["name","entryType"]),t=Ge(n);return t?m(m({},e),t):n}),e(n))});return{disconnect:function(){return n.unsubscribe()}}}function Ee(){var n="",e="",t="";my.getAccountInfoSync?(d=my.getAccountInfoSync().miniProgram,e=d.envVersion,n=d.appId,t=d.version):(n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}}));var r=(m=my.getSystemInfoSync()).model,o=m.brand,i=m.pixelRatio,a=m.screenHeight,u=m.screenWidth,c=m.windowHeight,s=m.windowWidth,f=m.language,p=m.version,l=m.system,d=m.platform,m=m.app;return{model:r,brand:o,pixelRatio:i,screenArea:Fe({pixelRatio:i,width:u,height:a,systemPlatform:d}),windowArea:Fe({width:s,height:c}),language:f,osName:Be(d),osVersion:l,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:m,hostVersion:p,platform:"my"}}function Pe(n){return n&&function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return n instanceof Error}}(n)?{name:n.name,message:n.message,stack:n.stack}:He(n)}function xe(){var n="",e="";swan.getEnvInfoSync&&(e=(d=swan.getEnvInfoSync()).env,n=d.appKey);var t=(m=swan.getSystemInfoSync()).model,r=m.brand,o=m.pixelRatio,i=m.screenHeight,a=m.screenWidth,u=m.windowHeight,c=m.windowWidth,s=m.language,f=m.version,p=m.system,l=m.platform,d=m.SDKVersion,m=m.host;return{model:t,brand:r,pixelRatio:o,screenArea:Fe({width:a,height:i}),windowArea:Fe({width:c,height:u}),language:s,osName:Be(l),osVersion:p,SDKVersion:d,appId:n,miniEnv:e,miniVersion:"",hostName:m,hostVersion:f,platform:"swan"}}function ke(){return m({appId:"",miniEnv:"",miniVersion:"",platform:Ye},We())}function Ie(n){var e=n.filter(function(n){return n=n,!!!kn("component")[n]}),n=Re(e).subjectMap;xn("component",n=n),un("component",n),Me().componentSubject(e)}function je(e){function n(n){J(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=bn(Component,n),Behavior=bn(Behavior,n)}catch(n){}}function Oe(n,e){var t=n.filter(function(n){return n=n,!!!kn("page")[n]}),n=Re(t).subjectMap;xn("page",n=n),un("page",n),n=function(e){t.forEach(function(n){var r=jn(n),n=s(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(le(this)&&r.next({that:this,param:se(n),time:on()}),b(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=bn(Page,n),je(n)}function Ce(n){var e=n.filter(function(n){return!Cn(n)}),t=Re(e).subjectMap;xn("route",n=t),un("route",n),e.forEach(function(i){var n=yn(Me().instance,i,function(o){void 0===o&&(o={}),On(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:on()}),G.forEach(function(r){s(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];On(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:se(n)||{}},time:on()}),b(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function Te(n,t){void 0===t&&(t=Me().instance);var n=n.filter(function(n){return!Dn(n)}),r=Re(n).subjectMap;Rn(r),n.forEach(function(e){var n=yn(t,e,function(n){Ze(e,n)});n&&r[e].addTearDown(n)})}var De,Re=function(n){var e=n.reduce(function(n,e){return n[e]=new ue,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}},Ae=y((De={},[function(n){if(!_n().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===_n().platform});return n&&(De=n.adapterCtor())},function(){return De}]),2),Ne=Ae[0],Me=Ae[1],Ve=function(n){n=pe(n);return!!Me().getStorage(n)},Le=["darwin","macs","mac"],qe=["windows_nt","windows","window"],Be=function(n){return be(n)?"Android":"ios"===n.toLowerCase()?"iOS":~Le.indexOf(n.toLowerCase())?"Mac":~qe.indexOf(n.toLowerCase())?"windows":"unknown"},Fe=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&be(e)&&t?r/t+" * "+n/t:r+" * "+n},ze=function(n){return function(n){var e,t={};for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&void 0!==n[e]&&null!==n[e]&&(t[e]=n[e]);return t}({domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,secureConnectionStart:n.SSLconnectionStart,connectEnd:n.connectEnd,requestStart:n.requestStart,requestEnd:n.requestEnd,responseStart:n.responseStart,responseEnd:n.responseEnd,socketReused:n.socketReused,redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,sendBytesCount:n.sendBytesCount,throughputKbps:n.throughputKbps,receivedBytedCount:n.receivedBytedCount})},He=function(n){return{name:en,message:I(n)}},Ue={platform:"wx",adapterCtor:function(){return m(m({},de()),{miniPlatform:"wx",buildError:function(n){return(c(n)?function(n){n=n.split("\n");return{name:y((n[2]&&n[2].split(":")||[]).map(function(n){return n.trim()}),1)[0],message:n&&n[1]&&n[1].trim(),stack:n.slice(2).join("\n")}}:He)(n)},getSystemInfo:ye,observePerformance:function(e){var n=wx.getPerformance&&wx.getPerformance();if(n){n=n.createObserver(function(n){n=n.getEntries().map(function(n){return m(m({},n),{name:function(n){switch(n){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return n}}(n.name)})});e(n)});return n.observe({entryTypes:n.supportedEntryTypes}),n}},performanceSubscriber:ve,buildRequestProfile:function(n){return n=ze(e=n),e.protocol&&(n.protocol=e.protocol),n;var e},componentSubject:me,pagePerfSubscriber:he,setDataSubject:ge})}},Ke=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},We=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,p=n.platform,l=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:Fe({width:i,height:o}),windowArea:Fe({width:u,height:a}),language:c,osName:Be(p),osVersion:f,SDKVersion:l,hostName:n,hostVersion:s}},Ge=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},hn={platform:"tt",adapterCtor:function(){return m(m({},de()),{miniPlatform:"tt",buildError:_e,getSystemInfo:we,observePerformance:Se,performanceSubscriber:ve,buildRequestProfile:function(n){return ze(n)},componentSubject:me,pagePerfSubscriber:he,setDataSubject:ge})}},En={platform:"my",adapterCtor:function(){return m(m({},de()),{miniPlatform:"my",buildError:function(n){return a(n)?function(n,e){n={message:n};return!e||(e=y((e=(n.stack=e).split("\n"))[0]&&e[0].split(":"),1)[0])&&(n.name=e),n}(n[0],n[1]):He(n)},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:Ee,componentSubject:function(n){var e=["onInit"],t=n.filter(function(n){return~e.indexOf(n)}),r=function(n){t.forEach(function(r){s(n,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(Nn(r).next({that:this,param:null,time:on()}),b(t))return t.apply(this,n)}})()})};Component=bn(Component,function(n){S(n)?r(n):null==n&&r(n={})})},setDataSubject:function(e){Nn("onInit").subscribe(function(n){n=n.that;return e.call(n)})},pagePerfSubscriber:he})}},Je={platform:"swan",adapterCtor:function(){return m(m({},de()),{miniPlatform:"swan",buildError:Pe,getSystemInfo:xe,componentSubject:me,setDataSubject:ge,pagePerfSubscriber:function(e){function t(n){n.navigate_name=n.navigate_name||"native",n.load_start=n.load_start||0,n.dom_end=n.dom_end||0,n.render_end=n.render_end||0,n.navigate_start&&0!==n.load_start&&(e(m({},n)),n.load_start=0,i=!0)}var r={},o={},i=!1,a=!0;Tn(function(n,e){"invoke"===n.param.name&&(i=!1,r={navigate_start:n.time,navigate_name:e},o={navigate_start:n.time,navigate_name:e})}),jn("onLoad").pipe(ie(1)).subscribe(function(n){n.that.componentName?o.dom_end=n.time:r.load_start=n.time}),jn("onShow").pipe(ie(1)).subscribe(function(n){n.that.componentName?(o.load_start=n.time,r.load_start=0):r.dom_end=n.time}),jn("onReady").pipe(ie(1)).subscribe(function(n){n.that.componentName?a?a=!1:(o.render_end=n.time,t(o)):(r.render_end=n.time,t(r),a=!1)}),In(z.onHide).subscribe(function(){i||(t(r),t(o))})}})}},Ye="lark",Qn={platform:Ye,adapterCtor:function(){return m(m({},de()),{miniPlatform:Ye,buildError:_e,getSystemInfo:ke,componentSubject:me,pagePerfSubscriber:he,setDataSubject:ge})}},$e="mars",ne={platform:$e,adapterCtor:function(){return m(m({},de()),{miniPlatform:$e,buildError:_e,getSystemInfo:we.bind(null,$e),observePerformance:Se,performanceSubscriber:ve,componentSubject:me,pagePerfSubscriber:he,setDataSubject:ge})}},Qe=function(n){n.on("init",function(){fe(X),Oe(nn),Ie(Z)})},Xe=function(n){n.on("init",function(){Ce(Q)})},Ze=function(u,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:u,request:{url:e,method:(e=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:I(r),timestamp:on()},response:{}};s(n,"complete",function(a){return function(n){var e=c.response.timestamp||on();c.duration=e-c.request.timestamp,c.completeCallbackTime=an(a,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:I(n.data),errMsg:i,timing:Me().buildRequestProfile(n.profile||{})},sn(u).next(c)}})(),s(n,"success",function(e){return function(n){c.response.timestamp=on(),c.response.status=200,c.successCallbackTime=an(e,n)}})(),s(n,"fail",function(e){return function(n){c.response.timestamp=on(),c.response.status=-1,c.failCallbackTime=an(e,n)}})()},nt=function(n,e){void 0===e&&(e=Y),n.on("init",function(){Te(e)})};function et(){var a=le(this),u=fn();var n=yn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=on();return[o,function(){var n=r[1],e=on()-i;u.next({renderTime:e,url:a,data:o,startTime:i}),n&&n.call(t)}]});n&&u.addTearDown(n)}function rt(){var n;kn("setData")||(n=(n=Re(["setData"]).getSubject)("setData"),Pn("setData",n),cn("setData",n))}function ot(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(ut.test(t)||ct.test(r))||(n[e]=o[e]),n},{})}var it=function(n){n.on("init",function(){rt(),jn("onLoad").subscribe(function(n){n=n.that;et.call(n)}),Me().setDataSubject(et)})},at=function(n){n.on("init",function(){var e,n,t,r=Me();r.observePerformance&&!pn()&&(e=(0,Re(["performance"]).getSubject)("performance"),Pn("performance",n=e),cn("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},ut=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),ct=new RegExp("(bearer|session)","i"),st=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,p=n.collectBodyOnError,l=n.extraExtractor,n=function(n){var e,t,r,o,i,a,u,c;!function(n,e){n=k(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,u=n.successCallbackTime,i=n.completeCallbackTime,e.headers=ot(e.headers||{}),c.headers=ot(c.headers||{}),a=c.errMsg,n=h(c,["errMsg"]),n=m(m({},n),{is_custom_error:!1}),a&&(n.err_msg=a),u={api:t,request:e,duration:r,cbTime:i+(o||0)+(u||0),response:n},!b(l)||(n=l(c.body,u))&&(u.extra=n,u.response.is_custom_error=!0),p&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};e&&sn("request").subscribe(n),t&&sn("downloadFile").subscribe(n),r&&sn("uploadFile").subscribe(n)}},ft=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return j("applyMonitor",n),[]}};function pt(n,e,t){Mn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?m(m({},t),e):!!e&&t}function lt(i){i.on("init",function(){var n,e,t,r,o=pt(i,vt,gt);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),nt(i,r),ft(st,o,i.report.bind(i)))})}function dt(n,e){return n&&e&&n===e}function mt(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!dt(e.message,t.message)&&!dt(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var ht,vt="http",gt={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},bt=function(f){return void 0===f&&(f=Me()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,a=n.dedupe,u=k(e),c=mt(),s=function(n,e,t){n=a?c(n):n;n&&(u&&u.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&In(z.onError).subscribe(function(n){n=n.param,n=f.buildError(n);u&&u.test(n.message)||s(n)}),o&&In(z.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=I(e.reason);u&&u.test(t)||n.catch(g).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Tn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(Ae=ht=ht||{}).history="history",Ae.manual="manual";function yt(t,n,r){var o=n,i=null,a=0,e="launch";function u(n,e){o=e,a=on(),r(e,i=e+"_"+a),t(n,e)}return In(z.onShow).pipe(ie(1)).subscribe(function(){e="show"}),Tn(function(){e="history"}),[u,function(n){n&&(u(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,on()-a))}]}function _t(t){return t.on("init",function(){var n,e=pt(t,At,Nt);e&&(e=(n=y(ft(jt,m(m({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),t}function wt(t){t.on("init",function(){var n,e=pt(t,Mt,Vt);e&&(n=Lt(t),n=y(ft(bt,e,n),1)[0],t.provide("captureException",n))})}function St(t){t.on("init",function(){var n,e=pt(t,Bt,qt);e&&(e=(n=y(ft(Ot,e,function(n){}),2))[0],n=n[1],t.provide("getBreadcrumbs",e),t.provide("addBreadcrumb",n))})}function Et(e){e.on("init",function(){var n=pt(e,Ft,zt);n&&(it(e),ft(Ct,n,e.report.bind(e)))})}function Pt(e){e.on("init",function(){var n=pt(e,Ht,Ut);n&&(at(e),ft(Tt,n,e.report.bind(e)))})}function xt(e){e.on("init",function(){var n=pt(e,Kt,Wt);n&&ft(Dt,n,e.report.bind(e))})}function kt(e){e.on("init",function(){var n=pt(e,Gt,Jt);n&&(at(e),ft(Rt,n,e.report.bind(e)))})}function It(e){return(e=void 0===e?Me():e)?{get:function(n){return Yt("GET",n,e)},post:function(n){return Yt("POST",n,e)}}:{get:v,post:v}}var jt=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(yt(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],a=n[1],n=n[2];return t!==ht.manual&&(jn("onShow").subscribe(function(n){return function(n){n=le(n),n=i(n);a(n)}(n.that)}),jn("onUnload").subscribe(n.bind(null,"unload")),jn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Ot=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=g),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=m(m({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return Y.forEach(function(n){Dn(n)&&sn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Tn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},Ct=function(){return function(n,t){var r=n.isCalculateSize;fn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(I(n)).length:2*I(n).length)),t({ev_type:"set_data",payload:e})})}},Tt=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;In(z.onLaunch).pipe(re(1)).subscribe(function(n){r.activate_start=n.time}),In(z.onShow).pipe(re(1)).subscribe(function(n){r.init_end=n.time}),jn("onLoad").pipe(re(1)).subscribe(function(n){r.page_load_start=n.time}),jn("onShow").pipe(re(1)).subscribe(function(n){r.page_dom_end=n.time});var i=pn();jn("onReady").pipe(re(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&An().pipe(oe(function(n){return"appClick"===n.name}),re(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),In(z.onHide).subscribe(function(){o||t()})}},Dt=function(){return function(n,e){Me().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},Rt=function(e){return void 0===e&&(e=Me()),function(n,t){var r,o;pn()&&e.performanceSubscriber&&(r=0,jn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},At="pageview",Nt={routeMode:ht.history,setPidAndViewId:function(n,e){}},Mt="jsError",Vt={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},Lt=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:m(m({},n),{breadcrumbs:e})})}},qt={maxBreadcrumbs:20,tap:!0},Bt="breadcrumb",Ft="setData",zt={isCalculateSize:!1},Ht="appLaunchPerf",Ut={},Kt="pagePerf",Wt={},Gt="performance",Jt={},Yt=function(n,e,t){void 0===t&&(t=Me());var r=e.url,o=e.data,i=e.success,a=void 0===i?v:i,u=e.fail,c=void 0===u?v:u,i=e.header,u={"Content-Type":"application/json"};J(e=i)&&0!==Object.keys(e).length&&Object.assign(u,i),t.request({method:n,url:r,data:o,header:u,headers:u,success:function(n){a(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})};function $t(n){return o=(t=n).transport,i=n.endpoint,a=n.size,u=void 0===a?l:a,c=void 0===(t=n.wait)?d:t,s=[],f=0,{getSize:function(){return u},getWait:function(){return c},setSize:function(n){u=n},setWait:function(n){c=n},getEndpoint:function(){return i},setEndpoint:function(n){i=n},send:function(n){s.push(n),s.length>=u&&e.call(this),clearTimeout(f),f=setTimeout(e.bind(this),c)},flush:function(){clearTimeout(f),e.call(this)},getBatchData:function(){return s.length?p(s):""},clear:function(){clearTimeout(f),s=[]},fail:function(n){r=n}};function e(){var e;s.length&&(e=this.getBatchData(),o.post({url:i,data:e,fail:function(n){r&&r(n,e)}}),s=[])}var t,r,o,i,a,u,c,s,f}function Qt(n,e){return void 0===e&&(e=nr),(n&&0<=n.indexOf("//")?"":"https://")+n+e}var Xt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:m(m({},n.extra||{}),n.overrides||{})}}},Zt="/monitor_mini/collect",nr="/settings/minipro",er="apmplus.volces.com",tr="session",rr={sample_rate:1,include_users:[],sample_granularity:tr,rules:{}},or=[Zt,nr],ir="0.2.4",ar="APM_PLUS_MINI_PROGRAM",ur=function(n){n=function(n){try{return Me().getStorage(n)}catch(n){return}}(pe(String(n)));return n&&n.userId&&n.deviceId?n:{userId:A(),deviceId:A()}},cr=function(n){return n+"_"+Date.now()},sr=function(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{Me().setStorage(n,e)}catch(n){}}(pe(String(e)),{userId:t,deviceId:n})};function fr(n){n=ur(n.aid);return{aid:0,token:"",pid:"",viewId:cr("_"),userId:n.userId,deviceId:n.deviceId,sessionId:A(),domain:er,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:or},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:rr,sdkName:ar,sdkVersion:ir}}function pr(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return m(m({},n),{plugins:t})}function lr(n){return S(n)&&"aid"in n&&"token"in n}function dr(n){return m({},n)}function mr(e){var r,o,i=e,a={},u=void 0,c=v,t=v;return{getConfig:function(){return i},setConfig:function(n){var e,t;return a=m(m({},a),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):u?f():(e=i.domain,n=i.aid,t=function(n){u=n,f()},It().get({url:Qt(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){sr(i),n()},o&&c()}};function s(){var n=m(m(m({},e),o||{}),a);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=E(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),n.sample=hr(hr(e.sample,null==o?void 0:o.sample),a.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?tr:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return m(m({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(u),Ve(String(i.aid))&&(o.userId=e.userId),s(),c()}}function hr(r,o){if(!r||!o)return r||o;var n=m(m({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=m(m({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function vr(e){function t(n){return void 0===n&&(n=Me().getSystemInfo()),e.set(m({},n))}function r(){t(),n()}var o=!1,n=br(e);e.on("start",function(){r(),o=!0}),e.on("init",function(){In(z.onLaunch).pipe(re(1)).subscribe(function(n){n=n.param.scene||rn;t({scene:n}),o&&r()}),Me().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})}function gr(n){if(!Ne(n))throw Error("Adapters imported incorrectly");var t,r,o,e,i,a,u,c,n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,a=n.createConfigManager,u=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var p=!1,l=!1,d=!1,m=[],h=[],v=N(),g={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return m},init:function(n){if(p)C("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=a(e)).setConfig(n),r.onChange(function(){b("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");b("init",p=!0)}},set:function(n){p&&n&&S(n)&&(b("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(p)return n&&S(n)&&(b("beforeConfig",!1,n),null!=r&&r.setConfig(u(n))),null==r?void 0:r.getConfig()},provide:function(n,e){P(h,n)?C("cannot provide "+n+", reserved"):(g[n]=e,b("provide",!1,n))},start:function(){var e=this;p&&(l||null!=r&&r.onReady(function(){b("start",l=!0),m.forEach(function(n){return e.build(n)}),m=[]}))},report:function(n){n&&(!(n=R(f.beforeReport)(n))||(n=R(f.report)(n))&&(l?this.build(n):m.push(n)))},build:function(n){!l||(n=R(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=R(f.build)(n))&&this.send(n))},send:function(n){!l||(n=R(f.beforeSend)(n))&&(t.send(n),b("send",!1,n))},destroy:function(){v.clear(),b("beforeDestroy",d=!0)},on:function(n,e){"init"===n&&p||"start"===n&&l||"beforeDestroy"===n&&d?e():f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:v},h=Object.keys(g);return g;function b(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:lr,initConfigNormalizer:pr,userConfigNormalizer:dr,createSender:function(n){return $t({size:20,endpoint:(n=n.domain,void 0===e&&(e=Zt),(n&&0<=n.indexOf("//")?"":"https://")+n+e),transport:It()});var e},builder:Xt,createDefaultConfig:fr,createConfigManager:mr});return M(n),o=!1,(t=n).on("init",function(){r=on(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=on())-r<wr&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})}),(e=n).on("beforeBuild",function(n){return yr(n,e.config())}),n.on("report",function(n){return _r(n)}),(i=n).on("start",function(){var n=i.config(),e=n.userId,n=n.sample,n=H(e,n,T,D);i.on("build",n)}),(a=n).on("init",function(){a.provide("_subscriptions",[]),Mn(a),Qe(a),Xe(a)}),a.on("beforeDestroy",function(){if(a._subscriptions)for(;a._subscriptions.length;)a._subscriptions.shift().unsubscribe();for(var n in a)delete a[n]}),(u=n).on("init",function(){var e=[],n=u.config();n&&n.integrations&&n.integrations.forEach(function(n){P(e,n.name)||(e.push(n.name),n.setup(u),n.tearDown&&u.on("beforeDestroy",n.tearDown))})}),(c=n).on("init",function(){In(z.onHide).subscribe(function(){var n=c.getSender();n&&n.flush()})}),vr(n),n}var br=function(t){var r="";return function(){var n=t.getSender();r=r||n.getEndpoint();var e=t.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||rn,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(r+o(e))}},yr=function(n,e){var t={};return t.aid=e.aid,t.pid=e.pid,t.view_id=e.viewId,t.user_id=e.userId,t.network_type=e.networkType,m(m({},n),{extra:m(m({},t),null!==(n=n.extra)&&void 0!==n?n:{})})},_r=function(n){var e,e={url:(e=Me().getCurrentPages().pop())?(e?le(e):"")+o(e.options):"",timestamp:on()};return m(m({},n),{extra:m(m({},e),null!==(n=n.extra)&&void 0!==n?n:{})})},wr=1e3;n.AppLaunchPerfIntegration=function(){return{name:"AppLaunchPerfIntegration",setup:function(n){Pt(n)}}},n.BreadcrumbIntegration=function(){return{name:"BreadcrumbIntegration",setup:function(n){St(n)}}},n.CustomIntegration=function(){return{name:"CustomIntegration",setup:function(n){F(n)}}},n.FrameworksAdapterIntegration=function(t){return{name:"FrameworksAdapterIntegration",setup:function(n){var e=t.Taro;e&&"my"===Me().miniPlatform&&n.on("init",function(){Te(["request"],e)})}}},n.HttpIntegration=function(){return{name:"HttpIntegration",setup:function(n){lt(n)}}},n.JsErrorIntegration=function(){return{name:"JsErrorIntegration",setup:function(n){wt(n)}}},n.LarkAdapter=Qn,n.MarsAdapter=ne,n.MyAdapter=En,n.PagePerfIntegration=function(){return{name:"PagePerfIntegration",setup:function(n){xt(n)}}},n.PageviewIntegration=function(){return{name:"PageviewIntegration",setup:function(n){_t(n)}}},n.PerformanceIntegration=function(){return{name:"PerformanceIntegration",setup:function(n){kt(n)}}},n.SetDataIntegration=function(){return{name:"SetDataIntegration",setup:function(n){Et(n)}}},n.SwanAdapter=Je,n.TtAdapter=hn,n.WxAdapter=Ue,n.createBaseMiniProgramClient=gr,n.createMiniProgramClient=function(n){n=gr(n);if(n)return F(n),_t(n),wt(n),lt(n),Et(n),St(n),Pt(n),xt(n),kt(n),n},n.setPlatform=gn,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).APMPlusMiniProSDK={})}(this,function(n){"use strict";function p(n){return JSON.stringify({ev_type:"batch",list:n})}var l=10,d=1e3;var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function e(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var m=function(){return(m=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function h(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],v=function(){return{}};function g(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function b(n){return"function"==typeof n}function u(n){return"number"==typeof n}function c(n){return"string"==typeof n}function E(n,e){var t,r,o=m({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=E(S(n[t])?n[t]:{},e[t]):a(e[t])&&a(n[t])?o[t]=function e(n,t){n=a(n)?n:[];t=a(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?E({},n):a(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function P(n,e){if(!a(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}var x=function(n,e){if(!a(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n};function k(n){return a(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function I(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function o(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}var s=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return v;var t=i[a],r=u.apply(void 0,_([t],y(n),!1)),o=r;return b(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return b(t)&&t.apply(this,e)}}),i[a]=o,function(n){n||(o===i[a]?i[a]=t:r=t)}}},f="".padStart?function(n,e){return n.padStart(e=void 0===e?8:e," ")}:function(n){return n},j=0,O=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),f(""+j++)],y(n),!1))},C=0,T=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),f(""+C++)],y(n),!1))},D=function(n){return Math.random()<Number(n)},R=function(n,e){return n<Number(e)},A=function(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){O(n)}return e}};function N(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function M(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,e,t){i[n]?i[n].push([e,t]):i[n]=[[e,t]],o&&r(t)},has:function(n){return!!i[n]},remove:e,removeByEvType:function(e){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===e&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){e(n)})}}}function V(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=I(e),o},merge:function(e){return t=m(m({},t),e),Object.keys(e).forEach(function(n){r[n]=I(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return m({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})}function L(r,o){r.on("init",function(){function n(n){n.forEach(function(n){var e=n.name;P(t,e)||(t.push(e),n.setup(r),o&&o(e,n.setup),r.destroyAgent.set(e,e,[function(){t=x(t,e),n.tearDown&&n.tearDown()}]))})}var t=[];r.provide("applyIntegrations",n);var e=r.config();e&&e.integrations&&n(e.integrations)})}function q(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function B(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function F(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":u(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return P(e,n);case"neq":return!P(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function z(e,n){try{return"rule"===n.type?F(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return z(e,n)}):n.children.some(function(n){return z(e,n)})}catch(n){return!1}}function H(e){e.provide("sendEvent",function(n){n=G(n);n&&e.report({ev_type:W,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=J(n);n&&e.report({ev_type:W,payload:n,extra:{timestamp:Date.now()}})})}var U,K=function(n,e,t,r){if(!e)return g;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,e=e.r,e=void 0===e?Math.random():e;if(P(i,n))return function(n){return q(n,1)};var c,s,f,p,l,d,m,a="session"===a,h=B(a,o,t,e,r),v=(c=u,s=a,f=o,p=t,l=e,d=r,m={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(m[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:B(s,r,p,l,d)},e&&(m[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:B(s,e,p,l,d),effectiveSampleRate:e*f,filter:n}}))):m[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),m);return function(n){if(!h())return!1;if(!(n.ev_type in v))return q(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(z(n,t[r].filter))return!!t[r].hit()&&q(n,t[r].effectiveSampleRate);return!!e.hit()&&q(n,e.effectiveSampleRate)}},W="custom",G=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,a={};for(o in i)a[o]=I(i[o]);e.categories=a}return e}},J=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:I(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=I(r[t]);e.metrics=o,e.categories=i}return e}},Y=["success","fail","complete"];(We=U=U||{}).onLaunch="onLaunch",We.onShow="onShow",We.onHide="onHide",We.onError="onError",We.onPageNotFound="onPageNotFound",We.onUnhandledRejection="onUnhandledRejection";function $(n){return"[object Object]"===Object.prototype.toString.call(n)}var Q=["request","downloadFile","uploadFile"],X=["navigateTo","redirectTo","switchTab","reLaunch"],Z=_(_([],y(X),!1),["navigateBack"],!1),nn=_(_([],y([U.onLaunch,U.onShow,U.onHide]),!1),[U.onError,U.onPageNotFound,U.onUnhandledRejection],!1),en=["attached","onInit"],tn=["onLoad","onShow","onReady","onUnload","onHide"],rn="unknown_error_name",on="__HOOKED__",an=-1;var un=function(){return Date.now()};function cn(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!b(n))return 0;var r,o=un();try{n.apply(this,e)}finally{r=un()}return r-o}function sn(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return In(t,((n={})[e]=null,n))})})}function fn(n,e){e.addTearDown(function(){return kn(n,null)})}function pn(n){return jn("http")[n]}function ln(){return jn("setData")}function dn(){return!!jn("performance")}function mn(){return jn("instance")}var hn,vn=function(){},gn=y((hn="tt",[function(){return hn},function(n){return hn=n}]),2),bn=gn[0],yn=gn[1],_n=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},wn=function(n,e,r){var o=n[e];if(!o||!o[on])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){O(n)}return o.apply(this,n)}}),n[e]&&(n[e][on]=!0),function(){n[e][on]=!1,r=vn}},Sn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:bn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},En="__slardar__global__0.2.5-alpha.0",Pn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},xn=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?Sn().instance:e)?e[En]||(e[En]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=m(m({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=m({},Pn),e&&(e[En]=t)}}}(m({},Pn)),kn=xn.setGlobalValue,In=xn.mergeGlobalValue,jn=xn.getGlobalValue,On=function(n){return jn("app")[n]},Cn=function(n){return jn("page")[n]},Tn=function(n){return jn("route")[n]},Dn=function(n){return!!jn("route")[n]},Rn=function(t,n){(n=void 0===n?Z:n).forEach(function(e){Dn(e)&&Tn(e).subscribe(function(n){return t(n,e)})})},An=function(n){return!!jn("http")[n]},Nn=function(n){In("http",n),sn("http",n)},Mn=function(){return jn("performance")},Vn=function(n){return jn("component")[n]},Ln=function(n){kn("instance",n)};function qn(n){return"function"==typeof n}function Bn(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Fn(n){return n}function zn(t){return function(n){if((e=n)&&qn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Hn(n){qn(n)?n():null!=n&&n.unsubscribe()}var Un=function(n){return n instanceof Kn||n&&"closed"in n&&qn(n.remove)&&qn(n.add)&&qn(n.unsubscribe)},Kn=(Wn.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),qn(t)&&t(),e&&(this._finalizers=null,e.forEach(Hn)))},Wn.prototype.remove=function(n){this._finalizers&&Bn(this._finalizers,n),n instanceof Wn&&n._removeParent(this)},Wn.prototype.add=function(n){if(n&&n!==this)if(this.closed)Hn(n);else{if(n instanceof Wn){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Wn.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Wn.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Wn.prototype._removeParent=function(n){this._parentage&&Bn(this._parentage,n)},Wn);function Wn(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Gn,Jn=(e(Yn,Gn=Kn),Yn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Yn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Yn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Yn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Gn.prototype.unsubscribe.call(this),this.destination=null)},Yn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Yn);function Yn(n){var e=Gn.call(this)||this;return e.isStopped=!1,e.destination=Xn(n)?n:new $n(!(n=n)||qn(n)?{next:null!=n?n:void 0}:n),e}var $n=(Qn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Qn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Qn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Qn);function Qn(n){this.partialObserver=n}function Xn(n){return n instanceof Jn||n&&((e=n)&&qn(e.next)&&qn(e.error)&&qn(e.complete))&&Un(n);var e}var Zn=(ne.prototype.subscribe=function(n){var e=Xn(n)?n:new Jn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},ne.prototype.lift=function(n){var e=new ne;return e.source=this,e.operator=n,e},ne.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Fn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},ne.prototype._subscribe=function(n){},ne.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},ne);function ne(n){n&&(this._subscribe=n)}var ee,te=(e(re,ee=Zn),re.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},re.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},re.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(re.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),re.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},re.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},re.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},re.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},re.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},re.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?re.EMPTY:(t.push(n),new Kn(function(){Bn(t,n)}))},re.EMPTY=(($e=new Kn).closed=!0,$e),re);function re(){var n=null!==ee&&ee.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var oe=new Zn(function(n){return n.complete()});function ie(r){return r<=0?function(){return oe}:zn(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function ae(r,o){return zn(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function ue(t){return ae(function(n,e){return t<=e})}var ce,se=(e(fe,ce=te),fe.prototype.subscribe=function(n){var t=this,n=ce.prototype.subscribe.call(this,n);mn()&&mn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},fe.prototype.unsubscribe=function(){ce.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},fe.prototype.addTearDown=function(n){this.tearDownFns.push(n)},fe);function fe(){var n=null!==ce&&ce.apply(this,arguments)||this;return n.tearDownFns=[],n}function pe(n){return 1<n.length?n:n.length&&n[0]||{}}function le(n){var t=n.filter(function(n){return n=n,!!!jn("app")[n]}),n=Ne(t).subjectMap;In("app",n=n),sn("app",n),App=_n(App,function(e){t.forEach(function(n){var r=On(n),n=s(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:pe(n),time:un()}),b(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function de(n){return"SLARDAR"+n}function me(n){return n.route||n.__route__||n.url||n.path||""}function he(t){return{instance:t=void 0===t?Sn().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:v,getSystemInfo:v,buildRequestProfile:v,componentSubject:v,setDataSubject:v,pagePerfSubscriber:v}}function ve(n){function e(n,i){r.forEach(function(o){s(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Vn(o).next({that:this,param:null,time:un()});var t=i[o];if(b(t)&&t.apply(this,n),b(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=_n(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function ge(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(m({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Rn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},X),Cn("onLoad").pipe(ue(1)).subscribe(function(n){r.load_start=n.time}),Cn("onShow").pipe(ue(1)).subscribe(function(n){r.dom_end=n.time}),Cn("onReady").pipe(ue(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),On(U.onHide).subscribe(function(){!1===o&&(e(),t())})}function be(e){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];Mn().subscribe(function(n){~t.indexOf(n.name)&&e(n)})}function ye(e){Vn("attached").subscribe(function(n){n=n.that;return e.call(n)})}function _e(n){return"android"===n.toLowerCase()}function we(){var n=wx.getAccountInfoSync().miniProgram,e=(l=wx.getSystemInfoSync()).model,t=l.brand,r=l.pixelRatio,o=l.screenHeight,i=l.screenWidth,a=l.windowHeight,u=l.windowWidth,c=l.language,s=l.version,f=l.system,p=l.platform,l=l.SDKVersion;return{model:e,brand:t,pixelRatio:r,screenArea:He({width:i,height:o}),windowArea:He({width:u,height:a}),language:c,osName:ze(p),osVersion:f,SDKVersion:l,appId:n.appId,miniEnv:n.envVersion,miniVersion:n.version,hostName:"wx",hostVersion:s,platform:"wx"}}function Se(n){return(c(n)?Ge:Ke)(n)}function Ee(n){void 0===n&&(n="tt");var e,t="",r="",o="";return tt.getEnvInfoSync?(r=(e=tt.getEnvInfoSync().microapp).envType,t=e.appId,o=e.mpVersion):(r=tt.env.VERSION,t=""),m({appId:t,miniEnv:r,miniVersion:o,platform:n},Je())}function Pe(e){var n=Cn("onReady").subscribe(function(){var n;tt.performance&&(n=(tt.performance.getCurrentPageEntries()||[]).map(function(n){n.name,n.entryType;var e=h(n,["name","entryType"]),t=Ye(n);return t?m(m({},e),t):n}),e(n))});return{disconnect:function(){return n.unsubscribe()}}}function xe(){var n="",e="",t="";my.getAccountInfoSync?(d=my.getAccountInfoSync().miniProgram,e=d.envVersion,n=d.appId,t=d.version):(n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}}));var r=(m=my.getSystemInfoSync()).model,o=m.brand,i=m.pixelRatio,a=m.screenHeight,u=m.screenWidth,c=m.windowHeight,s=m.windowWidth,f=m.language,p=m.version,l=m.system,d=m.platform,m=m.app;return{model:r,brand:o,pixelRatio:i,screenArea:He({pixelRatio:i,width:u,height:a,systemPlatform:d}),windowArea:He({width:s,height:c}),language:f,osName:ze(d),osVersion:l,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:m,hostVersion:p,platform:"my"}}function ke(n){return n&&function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return n instanceof Error}}(n)?{name:n.name,message:n.message,stack:n.stack}:Ke(n)}function Ie(){var n="",e="";swan.getEnvInfoSync&&(e=(d=swan.getEnvInfoSync()).env,n=d.appKey);var t=(m=swan.getSystemInfoSync()).model,r=m.brand,o=m.pixelRatio,i=m.screenHeight,a=m.screenWidth,u=m.windowHeight,c=m.windowWidth,s=m.language,f=m.version,p=m.system,l=m.platform,d=m.SDKVersion,m=m.host;return{model:t,brand:r,pixelRatio:o,screenArea:He({width:a,height:i}),windowArea:He({width:c,height:u}),language:s,osName:ze(l),osVersion:p,SDKVersion:d,appId:n,miniEnv:e,miniVersion:"",hostName:m,hostVersion:f,platform:"swan"}}function je(){return m({appId:"",miniEnv:"",miniVersion:"",platform:Qe},Je())}function Oe(n){var e=n.filter(function(n){return n=n,!!!jn("component")[n]}),n=Ne(e).subjectMap;In("component",n=n),sn("component",n),Le().componentSubject(e)}function Ce(e){function n(n){$(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=_n(Component,n),Behavior=_n(Behavior,n)}catch(n){}}function Te(n,e){var t=n.filter(function(n){return n=n,!!!jn("page")[n]}),n=Ne(t).subjectMap;In("page",n=n),sn("page",n),n=function(e){t.forEach(function(n){var r=Cn(n),n=s(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(me(this)&&r.next({that:this,param:pe(n),time:un()}),b(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=_n(Page,n),Ce(n)}function De(n){var e=n.filter(function(n){return!Dn(n)}),t=Ne(e).subjectMap;In("route",n=t),sn("route",n),e.forEach(function(i){var n=wn(Le().instance,i,function(o){void 0===o&&(o={}),Tn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:un()}),Y.forEach(function(r){s(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Tn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:pe(n)||{}},time:un()}),b(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function Re(n,t){void 0===t&&(t=Le().instance);var n=n.filter(function(n){return!An(n)}),r=Ne(n).subjectMap;Nn(r),n.forEach(function(e){var n=wn(t,e,function(n){et(e,n)});n&&r[e].addTearDown(n)})}var Ae,Ne=function(n){var e=n.reduce(function(n,e){return n[e]=new se,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}},Me=y((Ae={},[function(n){if(!Sn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===Sn().platform});return n&&(Ae=n.adapterCtor())},function(){return Ae}]),2),Ve=Me[0],Le=Me[1],qe=function(n){n=de(n);return!!Le().getStorage(n)},Be=["darwin","macs","mac"],Fe=["windows_nt","windows","window"],ze=function(n){return _e(n)?"Android":"ios"===n.toLowerCase()?"iOS":~Be.indexOf(n.toLowerCase())?"Mac":~Fe.indexOf(n.toLowerCase())?"windows":"unknown"},He=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&_e(e)&&t?r/t+" * "+n/t:r+" * "+n},Ue=function(n){return function(n){var e,t={};for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&void 0!==n[e]&&null!==n[e]&&(t[e]=n[e]);return t}({domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,secureConnectionStart:n.SSLconnectionStart,connectEnd:n.connectEnd,requestStart:n.requestStart,requestEnd:n.requestEnd,responseStart:n.responseStart,responseEnd:n.responseEnd,socketReused:n.socketReused,redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,sendBytesCount:n.sendBytesCount,throughputKbps:n.throughputKbps,receivedBytedCount:n.receivedBytedCount})},Ke=function(n){return{name:rn,message:I(n)}},We={platform:"wx",adapterCtor:function(){return m(m({},he()),{miniPlatform:"wx",buildError:function(n){return(c(n)?function(n){n=n.split("\n");return{name:y((n[2]&&n[2].split(":")||[]).map(function(n){return n.trim()}),1)[0],message:n&&n[1]&&n[1].trim(),stack:n.slice(2).join("\n")}}:Ke)(n)},getSystemInfo:we,observePerformance:function(e){var n=wx.getPerformance&&wx.getPerformance();if(n){n=n.createObserver(function(n){n=n.getEntries().map(function(n){return m(m({},n),{name:function(n){switch(n){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return n}}(n.name)})});e(n)});return n.observe({entryTypes:n.supportedEntryTypes}),n}},performanceSubscriber:be,buildRequestProfile:function(n){return n=Ue(e=n),e.protocol&&(n.protocol=e.protocol),n;var e},componentSubject:ve,pagePerfSubscriber:ge,setDataSubject:ye})}},Ge=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},Je=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,p=n.platform,l=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:He({width:i,height:o}),windowArea:He({width:u,height:a}),language:c,osName:ze(p),osVersion:f,SDKVersion:l,hostName:n,hostVersion:s}},Ye=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},gn={platform:"tt",adapterCtor:function(){return m(m({},he()),{miniPlatform:"tt",buildError:Se,getSystemInfo:Ee,observePerformance:Pe,performanceSubscriber:be,buildRequestProfile:function(n){return Ue(n)},componentSubject:ve,pagePerfSubscriber:ge,setDataSubject:ye})}},xn={platform:"my",adapterCtor:function(){return m(m({},he()),{miniPlatform:"my",buildError:function(n){return a(n)?function(n,e){n={message:n};return!e||(e=y((e=(n.stack=e).split("\n"))[0]&&e[0].split(":"),1)[0])&&(n.name=e),n}(n[0],n[1]):Ke(n)},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:xe,componentSubject:function(n){var e=["onInit"],t=n.filter(function(n){return~e.indexOf(n)}),r=function(n){t.forEach(function(r){s(n,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(Vn(r).next({that:this,param:null,time:un()}),b(t))return t.apply(this,n)}})()})};Component=_n(Component,function(n){S(n)?r(n):null==n&&r(n={})})},setDataSubject:function(e){Vn("onInit").subscribe(function(n){n=n.that;return e.call(n)})},pagePerfSubscriber:ge})}},$e={platform:"swan",adapterCtor:function(){return m(m({},he()),{miniPlatform:"swan",buildError:ke,getSystemInfo:Ie,componentSubject:ve,setDataSubject:ye,pagePerfSubscriber:function(e){function t(n){n.navigate_name=n.navigate_name||"native",n.load_start=n.load_start||0,n.dom_end=n.dom_end||0,n.render_end=n.render_end||0,n.navigate_start&&0!==n.load_start&&(e(m({},n)),n.load_start=0,i=!0)}var r={},o={},i=!1,a=!0;Rn(function(n,e){"invoke"===n.param.name&&(i=!1,r={navigate_start:n.time,navigate_name:e},o={navigate_start:n.time,navigate_name:e})}),Cn("onLoad").pipe(ue(1)).subscribe(function(n){n.that.componentName?o.dom_end=n.time:r.load_start=n.time}),Cn("onShow").pipe(ue(1)).subscribe(function(n){n.that.componentName?(o.load_start=n.time,r.load_start=0):r.dom_end=n.time}),Cn("onReady").pipe(ue(1)).subscribe(function(n){n.that.componentName?a?a=!1:(o.render_end=n.time,t(o)):(r.render_end=n.time,t(r),a=!1)}),On(U.onHide).subscribe(function(){i||(t(r),t(o))})}})}},Qe="lark",Zn={platform:Qe,adapterCtor:function(){return m(m({},he()),{miniPlatform:Qe,buildError:Se,getSystemInfo:je,componentSubject:ve,pagePerfSubscriber:ge,setDataSubject:ye})}},Xe="mars",te={platform:Xe,adapterCtor:function(){return m(m({},he()),{miniPlatform:Xe,buildError:Se,getSystemInfo:Ee.bind(null,Xe),observePerformance:Pe,performanceSubscriber:be,componentSubject:ve,pagePerfSubscriber:ge,setDataSubject:ye})}},Ze=function(n){n.on("init",function(){le(nn),Te(tn),Oe(en)})},nt=function(n){n.on("init",function(){De(Z)})},et=function(u,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:u,request:{url:e,method:(e=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:I(r),timestamp:un()},response:{}};s(n,"complete",function(a){return function(n){var e=c.response.timestamp||un();c.duration=e-c.request.timestamp,c.completeCallbackTime=cn(a,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:I(n.data),errMsg:i,timing:Le().buildRequestProfile(n.profile||{})},pn(u).next(c)}})(),s(n,"success",function(e){return function(n){c.response.timestamp=un(),c.response.status=200,c.successCallbackTime=cn(e,n)}})(),s(n,"fail",function(e){return function(n){c.response.timestamp=un(),c.response.status=-1,c.failCallbackTime=cn(e,n)}})()},rt=function(n,e){void 0===e&&(e=Q),n.on("init",function(){Re(e)})};function ot(){var a=me(this),u=ln();var n=wn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=un();return[o,function(){var n=r[1],e=un()-i;u.next({renderTime:e,url:a,data:o,startTime:i}),n&&n.call(t)}]});n&&u.addTearDown(n)}function it(){var n;jn("setData")||(n=(n=Ne(["setData"]).getSubject)("setData"),kn("setData",n),fn("setData",n))}function at(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(st.test(t)||ft.test(r))||(n[e]=o[e]),n},{})}var ut=function(n){n.on("init",function(){it(),Cn("onLoad").subscribe(function(n){n=n.that;ot.call(n)}),Le().setDataSubject(ot)})},ct=function(n){n.on("init",function(){var e,n,t,r=Le();r.observePerformance&&!dn()&&(e=(0,Ne(["performance"]).getSubject)("performance"),kn("performance",n=e),fn("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},st=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),ft=new RegExp("(bearer|session)","i"),pt=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,p=n.collectBodyOnError,l=n.extraExtractor,n=function(n){var e,t,r,o,i,a,u,c;!function(n,e){n=k(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,u=n.successCallbackTime,i=n.completeCallbackTime,e.headers=at(e.headers||{}),c.headers=at(c.headers||{}),a=c.errMsg,n=h(c,["errMsg"]),n=m(m({},n),{is_custom_error:!1}),a&&(n.err_msg=a),u={api:t,request:e,duration:r,cbTime:i+(o||0)+(u||0),response:n},!b(l)||(n=l(c.body,u))&&(u.extra=n,u.response.is_custom_error=!0),p&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};e&&pn("request").subscribe(n),t&&pn("downloadFile").subscribe(n),r&&pn("uploadFile").subscribe(n)}},lt=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return O("applyMonitor",n),[]}};function dt(n,e,t){Ln(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?m(m({},t),e):!!e&&t}function mt(i){i.on("init",function(){var n,e,t,r,o=dt(i,bt,yt);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),rt(i,r),lt(pt,o,i.report.bind(i)))})}function ht(n,e){return n&&e&&n===e}function vt(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!ht(e.message,t.message)&&!ht(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var gt,bt="http",yt={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},_t=function(f){return void 0===f&&(f=Le()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,a=n.dedupe,u=k(e),c=vt(),s=function(n,e,t){n=a?c(n):n;n&&(u&&u.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&On(U.onError).subscribe(function(n){n=n.param,n=f.buildError(n);u&&u.test(n.message)||s(n)}),o&&On(U.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=I(e.reason);u&&u.test(t)||n.catch(g).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Rn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(Me=gt=gt||{}).history="history",Me.manual="manual";function wt(t,n,r){var o=n,i=null,a=0,e="launch";function u(n,e){o=e,a=un(),r(e,i=e+"_"+a),t(n,e)}return On(U.onShow).pipe(ue(1)).subscribe(function(){e="show"}),Rn(function(){e="history"}),[u,function(n){n&&(u(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,un()-a))}]}function St(t){return t.on("init",function(){var n,e=dt(t,Mt,Vt);e&&(e=(n=y(lt(Ct,m(m({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),t}function Et(t){t.on("init",function(){var n,e=dt(t,Lt,qt);e&&(n=Bt(t),n=y(lt(_t,e,n),1)[0],t.provide("captureException",n))})}function Pt(t){t.on("init",function(){var n,e=dt(t,zt,Ft);e&&(e=(n=y(lt(Tt,e,function(n){}),2))[0],n=n[1],t.provide("getBreadcrumbs",e),t.provide("addBreadcrumb",n))})}function xt(e){e.on("init",function(){var n=dt(e,Ht,Ut);n&&(ut(e),lt(Dt,n,e.report.bind(e)))})}function kt(e){e.on("init",function(){var n=dt(e,Kt,Wt);n&&(ct(e),lt(Rt,n,e.report.bind(e)))})}function It(e){e.on("init",function(){var n=dt(e,Gt,Jt);n&<(At,n,e.report.bind(e))})}function jt(e){e.on("init",function(){var n=dt(e,Yt,$t);n&&(ct(e),lt(Nt,n,e.report.bind(e)))})}function Ot(e){return(e=void 0===e?Le():e)?{get:function(n){return Qt("GET",n,e)},post:function(n){return Qt("POST",n,e)}}:{get:v,post:v}}var Ct=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(wt(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],a=n[1],n=n[2];return t!==gt.manual&&(Cn("onShow").subscribe(function(n){return function(n){n=me(n),n=i(n);a(n)}(n.that)}),Cn("onUnload").subscribe(n.bind(null,"unload")),Cn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Tt=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=g),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=m(m({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return Q.forEach(function(n){An(n)&&pn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Rn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},Dt=function(){return function(n,t){var r=n.isCalculateSize;ln().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(I(n)).length:2*I(n).length)),t({ev_type:"set_data",payload:e})})}},Rt=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;On(U.onLaunch).pipe(ie(1)).subscribe(function(n){r.activate_start=n.time}),On(U.onShow).pipe(ie(1)).subscribe(function(n){r.init_end=n.time}),Cn("onLoad").pipe(ie(1)).subscribe(function(n){r.page_load_start=n.time}),Cn("onShow").pipe(ie(1)).subscribe(function(n){r.page_dom_end=n.time});var i=dn();Cn("onReady").pipe(ie(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&Mn().pipe(ae(function(n){return"appClick"===n.name}),ie(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),On(U.onHide).subscribe(function(){o||t()})}},At=function(){return function(n,e){Le().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},Nt=function(e){return void 0===e&&(e=Le()),function(n,t){var r,o;dn()&&e.performanceSubscriber&&(r=0,Cn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},Mt="pageview",Vt={routeMode:gt.history,setPidAndViewId:function(n,e){}},Lt="jsError",qt={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},Bt=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:m(m({},n),{breadcrumbs:e})})}},Ft={maxBreadcrumbs:20,tap:!0},zt="breadcrumb",Ht="setData",Ut={isCalculateSize:!1},Kt="appLaunchPerf",Wt={},Gt="pagePerf",Jt={},Yt="performance",$t={},Qt=function(n,e,t){void 0===t&&(t=Le());var r=e.url,o=e.data,i=e.success,a=void 0===i?v:i,u=e.fail,c=void 0===u?v:u,i=e.header,u={"Content-Type":"application/json"};$(e=i)&&0!==Object.keys(e).length&&Object.assign(u,i),t.request({method:n,url:r,data:o,header:u,headers:u,success:function(n){a(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})};function Xt(n){return o=(t=n).transport,i=n.endpoint,a=n.size,u=void 0===a?l:a,c=void 0===(t=n.wait)?d:t,s=[],f=0,{getSize:function(){return u},getWait:function(){return c},setSize:function(n){u=n},setWait:function(n){c=n},getEndpoint:function(){return i},setEndpoint:function(n){i=n},send:function(n){s.push(n),s.length>=u&&e.call(this),clearTimeout(f),f=setTimeout(e.bind(this),c)},flush:function(){clearTimeout(f),e.call(this)},getBatchData:function(){return s.length?p(s):""},clear:function(){clearTimeout(f),s=[]},fail:function(n){r=n}};function e(){var e;s.length&&(e=this.getBatchData(),o.post({url:i,data:e,fail:function(n){r&&r(n,e)}}),s=[])}var t,r,o,i,a,u,c,s,f}function Zt(n,e){return void 0===e&&(e=tr),(n&&0<=n.indexOf("//")?"":"https://")+n+e}var nr={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:m(m({},n.extra||{}),n.overrides||{})}}},er="/monitor_mini/collect",tr="/settings/minipro",rr="apmplus.volces.com",or="session",ir={sample_rate:1,include_users:[],sample_granularity:or,rules:{}},ar=[er,tr],ur="0.2.5-alpha.0",cr="APM_PLUS_MINI_PROGRAM",sr=function(n){n=function(n){try{return Le().getStorage(n)}catch(n){return}}(de(String(n)));return n&&n.userId&&n.deviceId?n:{userId:N(),deviceId:N()}},fr=function(n){return n+"_"+Date.now()},pr=function(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{Le().setStorage(n,e)}catch(n){}}(de(String(e)),{userId:t,deviceId:n})};function lr(n){n=sr(n.aid);return{aid:0,token:"",pid:"",viewId:fr("_"),userId:n.userId,deviceId:n.deviceId,sessionId:N(),domain:rr,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:ar},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:ir,sdkName:cr,sdkVersion:ur}}function dr(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return m(m({},n),{plugins:t})}function mr(n){return S(n)&&"aid"in n&&"token"in n}function hr(n){return m({},n)}function vr(e){var r,o,i=e,a={},u=void 0,c=v,t=v;return{getConfig:function(){return i},setConfig:function(n){var e,t;return a=m(m({},a),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):u?f():(e=i.domain,n=i.aid,t=function(n){u=n,f()},Ot().get({url:Zt(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){pr(i),n()},o&&c()}};function s(){var n=m(m(m({},e),o||{}),a);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=E(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),n.sample=gr(gr(e.sample,null==o?void 0:o.sample),a.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?or:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return m(m({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(u),qe(String(i.aid))&&(o.userId=e.userId),s(),c()}}function gr(r,o){if(!r||!o)return r||o;var n=m(m({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=m(m({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function br(e){function t(n){return void 0===n&&(n=Le().getSystemInfo()),e.set(m({},n))}function r(){t(),n()}var o=!1,n=_r(e);e.on("start",function(){r(),o=!0}),e.on("init",function(){On(U.onLaunch).pipe(ie(1)).subscribe(function(n){n=n.param.scene||an;t({scene:n}),o&&r()}),Le().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})}function yr(n){if(!Ve(n))throw Error("Adapters imported incorrectly");var t,r,o,e,i,a,u,n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,a=n.createConfigManager,u=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var p=!1,l=!1,d=!1,m=[],h=[],v=M(),g={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return m},init:function(n){if(p)T("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=a(e)).setConfig(n),r.onChange(function(){b("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");b("init",p=!0)}},set:function(n){p&&n&&S(n)&&(b("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(p)return n&&S(n)&&(b("beforeConfig",!1,n),null!=r&&r.setConfig(u(n))),null==r?void 0:r.getConfig()},provide:function(n,e){P(h,n)?T("cannot provide "+n+", reserved"):(g[n]=e,b("provide",!1,n))},start:function(){var e=this;p&&(l||null!=r&&r.onReady(function(){b("start",l=!0),m.forEach(function(n){return e.build(n)}),m.length=0}))},report:function(n){n&&(!(n=A(f.beforeReport)(n))||(n=A(f.report)(n))&&(l?this.build(n):m.push(n)))},build:function(n){!l||(n=A(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=A(f.build)(n))&&this.send(n))},send:function(n){!l||(n=A(f.beforeSend)(n))&&(t.send(n),b("send",!1,n))},destroy:function(){v.clear(),d=!0,b("beforeDestroy",!(m.length=0))},on:function(n,e){if("init"===n&&p||"start"===n&&l||"beforeDestroy"===n&&d)try{e()}catch(n){}else f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:v},h=Object.keys(g);return g;function b(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:mr,initConfigNormalizer:dr,userConfigNormalizer:hr,createSender:function(n){return Xt({size:20,endpoint:(n=n.domain,void 0===e&&(e=er),(n&&0<=n.indexOf("//")?"":"https://")+n+e),transport:Ot()});var e},builder:nr,createDefaultConfig:lr,createConfigManager:vr});return V(n),o=!1,(t=n).on("init",function(){r=un(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=un())-r<Er&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})}),(e=n).on("beforeBuild",function(n){return wr(n,e.config())}),n.on("report",function(n){return Sr(n)}),(i=n).on("start",function(){var n=i.config(),e=n.userId,n=n.sample,n=K(e,n,D,R);i.on("build",n)}),(a=n).on("init",function(){a.provide("_subscriptions",[]),Ln(a),Ze(a),nt(a)}),a.on("beforeDestroy",function(){if(a._subscriptions)for(;a._subscriptions.length;)a._subscriptions.shift().unsubscribe();for(var n in a)delete a[n]}),L(n),(u=n).on("init",function(){On(U.onHide).subscribe(function(){var n=u.getSender();n&&n.flush()})}),br(n),n}var _r=function(t){var r="";return function(){var n=t.getSender();r=r||n.getEndpoint();var e=t.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||an,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(r+o(e))}},wr=function(n,e){var t={};return t.aid=e.aid,t.pid=e.pid,t.view_id=e.viewId,t.user_id=e.userId,t.network_type=e.networkType,m(m({},n),{extra:m(m({},t),null!==(n=n.extra)&&void 0!==n?n:{})})},Sr=function(n){var e,e={url:(e=Le().getCurrentPages().pop())?(e?me(e):"")+o(e.options):"",timestamp:un()};return m(m({},n),{extra:m(m({},e),null!==(n=n.extra)&&void 0!==n?n:{})})},Er=1e3;n.AppLaunchPerfIntegration=function(){return{name:"AppLaunchPerfIntegration",setup:function(n){kt(n)}}},n.BreadcrumbIntegration=function(){return{name:"BreadcrumbIntegration",setup:function(n){Pt(n)}}},n.CustomIntegration=function(){return{name:"CustomIntegration",setup:function(n){H(n)}}},n.FrameworksAdapterIntegration=function(t){return{name:"FrameworksAdapterIntegration",setup:function(n){var e=t.Taro;e&&"my"===Le().miniPlatform&&n.on("init",function(){Re(["request"],e)})}}},n.HttpIntegration=function(){return{name:"HttpIntegration",setup:function(n){mt(n)}}},n.JsErrorIntegration=function(){return{name:"JsErrorIntegration",setup:function(n){Et(n)}}},n.LarkAdapter=Zn,n.MarsAdapter=te,n.MyAdapter=xn,n.PagePerfIntegration=function(){return{name:"PagePerfIntegration",setup:function(n){It(n)}}},n.PageviewIntegration=function(){return{name:"PageviewIntegration",setup:function(n){St(n)}}},n.PerformanceIntegration=function(){return{name:"PerformanceIntegration",setup:function(n){jt(n)}}},n.SetDataIntegration=function(){return{name:"SetDataIntegration",setup:function(n){xt(n)}}},n.SwanAdapter=$e,n.TtAdapter=gn,n.WxAdapter=We,n.createBaseMiniProgramClient=yr,n.createMiniProgramClient=function(n){n=yr(n);if(n)return H(n),St(n),Et(n),mt(n),xt(n),Pt(n),kt(n),It(n),jt(n),n},n.setPlatform=yn,Object.defineProperty(n,"__esModule",{value:!0})}); |
@@ -38,2 +38,3 @@ /// <reference types="wechat-miniprogram" /> | ||
set: (pluginName: string, evType: string, tearDownGroup: (() => void)[]) => void; | ||
has: (pluginName: string) => boolean; | ||
remove: (k: string) => void; | ||
@@ -534,3 +535,3 @@ removeByEvType: (k: string) => void; | ||
/** | ||
* 宿主名称: douyin、xigua、toutiao | ||
* 宿主名称 | ||
*/ | ||
@@ -661,3 +662,3 @@ hostName: string; | ||
lib_version?: string; | ||
/** @query hostname 宿主名称: douyin、xigua、toutiao */ | ||
/** @query hostname 宿主名称: xigua、toutiao */ | ||
host_name?: string; | ||
@@ -955,3 +956,3 @@ /** @query hostver 宿主版本号 */ | ||
} | ||
declare type PluginsType = HttpMonitorPluginConfig & JSErrorMonitorPluginConfig & PageviewMonitorPluginConfig & BreadcrumbMonitorPluginConfig & SetDataMonitorPluginConfig & AppLaunchPerfMonitorPluginConfig & PagePerfMonitorPluginConfig & PerformanceMonitorPluginConfig; | ||
declare type PluginsConfig = HttpMonitorPluginConfig & JSErrorMonitorPluginConfig & PageviewMonitorPluginConfig & BreadcrumbMonitorPluginConfig & SetDataMonitorPluginConfig & AppLaunchPerfMonitorPluginConfig & PagePerfMonitorPluginConfig & PerformanceMonitorPluginConfig; | ||
interface MiniProgramBaseConfig extends Partial<MiniAppInfo> { | ||
@@ -968,3 +969,3 @@ pid: string; | ||
integrations?: Integration<MiniProgramClient>[]; | ||
plugins: PluginsType; | ||
plugins: PluginsConfig; | ||
sample?: SampleConfig; | ||
@@ -1259,3 +1260,3 @@ } | ||
integrations?: Integration<MiniProgramClient>[]; | ||
plugins?: PluginsType; | ||
plugins?: PluginsConfig; | ||
sample?: SampleConfig; | ||
@@ -1283,2 +1284,2 @@ } | ||
export { AppLaunchPerfIntegration, BreadcrumbIntegration, CustomIntegration, FrameworksAdapterIntegration, HttpIntegration, JsErrorIntegration, LarkAdapter, MarsAdapter, MiniProgramClientType, MiniProgramConfig, MiniProgramInitConfig, MiniProgramUserConfig, MyAdapter, PagePerfIntegration, PageviewIntegration, PerformanceIntegration, PluginsType, SetDataIntegration, SwanAdapter, TtAdapter, WxAdapter, createBaseMiniProgramClient, createMiniProgramClient, setPlatform }; | ||
export { AppLaunchPerfIntegration, BreadcrumbIntegration, CustomIntegration, FrameworksAdapterIntegration, HttpIntegration, JsErrorIntegration, LarkAdapter, MarsAdapter, MiniProgramClientType, MiniProgramConfig, MiniProgramInitConfig, MiniProgramUserConfig, MyAdapter, PagePerfIntegration, PageviewIntegration, PerformanceIntegration, PluginsConfig, SetDataIntegration, SwanAdapter, TtAdapter, WxAdapter, createBaseMiniProgramClient, createMiniProgramClient, setPlatform }; |
@@ -1,1 +0,1 @@ | ||
function n(n){var e,t=n.transport,r=n.endpoint,o=n.size,i=void 0===o?10:o,a=n.wait,u=void 0===a?1e3:a,c=[],s=0;function f(){if(c.length){var n=this.getBatchData();t.post({url:r,data:n,fail:function(t){e&&e(t,n)}}),c=[]}}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return r},setEndpoint:function(n){r=n},send:function(n){c.push(n),c.length>=i&&f.call(this),clearTimeout(s),s=setTimeout(f.bind(this),u)},flush:function(){clearTimeout(s),f.call(this)},getBatchData:function(){return c.length?(n=c,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(s),c=[]},fail:function(n){e=n}}}var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])},e(n,t)};function t(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var r=function(){return r=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},r.apply(this,arguments)};function o(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function i(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function a(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var u=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],c=function(){return{}};function s(n){return n}function f(n){return"object"==typeof n&&null!==n}var l=Object.prototype;function p(n){if(f(n)){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(n);return e===l||null===e}return"[object Object]"===l.toString.call(n)}return!1}function d(n){return"[object Array]"===l.toString.call(n)}function m(n){return"function"==typeof n}function v(n){return"number"==typeof n}function h(n){return"string"==typeof n}function g(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function b(n,e){var t=r({},n);for(var o in e)g(e,o)&&void 0!==e[o]&&(f(e[o])&&p(e[o])?t[o]=b(f(n[o])?n[o]:{},e[o]):d(e[o])&&d(n[o])?t[o]=y(n[o],e[o]):t[o]=e[o]);return t}function y(n,e){var t=d(n)?n:[],r=d(e)?e:[];return Array.prototype.concat.call(t,r).map((function(n){return n instanceof RegExp?n:f(n)&&p(n)?b({},n):d(n)?y([],n):n}))}function _(n,e){if(!d(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function w(n){return d(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];h(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function S(n){try{return h(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}var E=function(n){return f(n)?Object.keys(n).reduce((function(e,t){return e+="&"+t+"="+n[t]}),"").replace("&","?"):""};var k=function(n,e,t,r){return void 0===r&&(r=!0),function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];if(!n)return c;var s=n[e],f=t.apply(void 0,a([s],i(o),!1)),l=f;return m(l)&&r&&(l=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return f.apply(this,n)}catch(e){return m(s)&&s.apply(this,n)}}),n[e]=l,function(t){t||(l===n[e]?n[e]=s:f=s)}}},x=0,P=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,a(["[SDK]",Date.now(),(""+x++).padStart(8," ")],i(n),!1))},O=0,j=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,a(["[SDK]",Date.now(),(""+O++).padStart(8," ")],i(n),!1))},I=function(n){return Math.random()<Number(n)},C=function(n,e){return n<Number(e)},D=function(n){return function(e){for(var t=e,r=0;r<n.length&&t;r++)try{t=n[r](t)}catch(n){P(n)}return t}};function T(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]]].join("")}(n)}function R(n){var e,t,r=n.builder,o=n.createSender,c=n.createDefaultConfig,s=n.createConfigManager,l=n.userConfigNormalizer,p=n.initConfigNormalizer,m=n.validateInitConfig,v={};u.forEach((function(n){return v[n]=[]}));var h,g,b,y=!1,w=!1,S=!1,E=[],k=[],x=(h={},g=function(n){n.length&&n.forEach((function(n){try{n()}catch(n){}})),n.length=0},{set:function(n,e,t){h[n]?h[n].push([e,t]):h[n]=[[e,t]]},remove:b=function(n){h[n]&&h[n].forEach((function(n){g(n[1])})),h[n]=void 0},removeByEvType:function(n){Object.keys(h).forEach((function(e){h[e]&&h[e].forEach((function(e){e[0]===n&&g(e[1])}))}))},clear:function(){Object.keys(h).forEach((function(n){b(n)}))}}),P={getBuilder:function(){return r},getSender:function(){return e},getPreStartQueue:function(){return E},init:function(n){if(y)j("already inited");else{if(!(n&&f(n)&&m(n)))throw new Error("invalid InitConfig, init failed");var r=c(n);if(!r)throw new Error("defaultConfig missing");var i=p(n);if((t=s(r)).setConfig(i),t.onChange((function(){O("config")})),!(e=o(t.getConfig())))throw new Error("sender missing");y=!0,O("init",!0)}},set:function(n){y&&n&&f(n)&&(O("beforeConfig",!1,n),null==t||t.setConfig(n))},config:function(n){if(y)return n&&f(n)&&(O("beforeConfig",!1,n),null==t||t.setConfig(l(n))),null==t?void 0:t.getConfig()},provide:function(n,e){_(k,n)?j("cannot provide "+n+", reserved"):(P[n]=e,O("provide",!1,n))},start:function(){var n=this;y&&(w||null==t||t.onReady((function(){w=!0,O("start",!0),E.forEach((function(e){return n.build(e)})),E=[]})))},report:function(n){if(n){var e=D(v.beforeReport)(n);if(e){var t=D(v.report)(e);t&&(w?this.build(t):E.push(t))}}},build:function(n){if(w){var e=D(v.beforeBuild)(n);if(e){var t=r.build(e);if(t){var o=D(v.build)(t);o&&this.send(o)}}}},send:function(n){if(w){var t=D(v.beforeSend)(n);t&&(e.send(t),O("send",!1,t))}},destroy:function(){x.clear(),S=!0,O("beforeDestroy",!0)},on:function(n,e){"init"===n&&y||"start"===n&&w||"beforeDestroy"===n&&S?e():v[n]&&v[n].push(e)},off:function(n,e){v[n]&&(v[n]=function(n,e){if(!d(n))return n;var t=n.indexOf(e);if(t>=0){var r=n.slice();return r.splice(t,1),r}return n}(v[n],e))},destroyAgent:x};return k=Object.keys(P),P;function O(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];v[n].forEach((function(n){try{n.apply(void 0,a([],i(t),!1))}catch(n){}})),e&&(v[n].length=0)}}var N=function(n){var e=function(){var n={},e={},t={set:function(r,o){return n[r]=o,e[r]=S(o),t},merge:function(o){return n=r(r({},n),o),Object.keys(o).forEach((function(n){e[n]=S(o[n])})),t},delete:function(r){return delete n[r],delete e[r],t},clear:function(){return n={},e={},t},get:function(n){return e[n]},toString:function(){return r({},e)}};return t}();n.provide("context",e),n.on("report",(function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n}))};var V,A=function(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n},M=function(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i},q=function(n,e,t,r){var o=function(n,e,t){for(var r,o=i(e.split(".")),a=o[0],u=o.slice(1);n&&u.length>0;)n=n[a],a=(r=i(u))[0],u=r.slice(1);if(n)return t(n,a)}(n,e,(function(n,e){return n[e]}));return void 0!==o&&function(n,e,t){switch(t){case"eq":return _(e,n);case"neq":return!_(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(o,function(n,e){return n.map((function(n){switch(e){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}}))}(r,"boolean"==typeof o?"bool":v(o)?"number":"string"),t)},L=function(n,e){try{return"rule"===e.type?q(n,e.field,e.op,e.values):"and"===e.type?e.children.every((function(e){return L(n,e)})):e.children.some((function(e){return L(n,e)}))}catch(n){return!1}},B=function(n,e,t,r){if(!e)return s;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,c=e.r,f=void 0===c?Math.random():c;if(_(i,n))return function(n){return A(n,1)};var l="session"===a,p=M(l,o,t,f,r),d=function(n,e,t,r,o,i){var a={};return Object.keys(n).forEach((function(u){var c=n[u],s=c.enable,f=c.sample_rate,l=c.conditional_sample_rules;s?(a[u]={enable:s,sample_rate:f,effectiveSampleRate:f*t,hit:M(e,f,r,o,i)},l&&(a[u].conditional_hit_rules=l.map((function(n){var a=n.sample_rate,u=n.filter;return{sample_rate:a,hit:M(e,a,r,o,i),effectiveSampleRate:a*t,filter:u}})))):a[u]={enable:s,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),a}(u,l,o,t,f,r);return function(n){if(!p())return!1;if(!(n.ev_type in d))return A(n,o);if(!d[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=d[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(L(n,t[r].filter))return!!t[r].hit()&&A(n,t[r].effectiveSampleRate);return!!e.hit()&&A(n,e.effectiveSampleRate)}},F=function(n){n.provide("sendEvent",(function(e){var t=function(n){if(n&&f(n)&&n.name&&h(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&f(n.metrics)){var t=n.metrics,r={};for(var o in t)v(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&f(n.categories)){var i=n.categories,a={};for(var o in i)a[o]=S(i[o]);e.categories=a}return e}}(e);t&&n.report({ev_type:"custom",payload:t,extra:{timestamp:Date.now()}})})),n.provide("sendLog",(function(e){var t=function(n){if(n&&f(n)&&n.content&&h(n.content)){var e={content:S(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&f(n.extra)){var t=n.extra,r={},o={};for(var i in t)v(t[i])?r[i]=t[i]:o[i]=S(t[i]);e.metrics=r,e.categories=o}return e}}(e);t&&n.report({ev_type:"custom",payload:t,extra:{timestamp:Date.now()}})}))},H=["success","fail","complete"];!function(n){n.onLaunch="onLaunch",n.onShow="onShow",n.onHide="onHide",n.onError="onError",n.onPageNotFound="onPageNotFound",n.onUnhandledRejection="onUnhandledRejection"}(V||(V={}));var z=["request","downloadFile","uploadFile"],K=["navigateTo","redirectTo","switchTab","reLaunch"],U=a(a([],i(K),!1),["navigateBack"],!1),G=a(a([],i([V.onLaunch,V.onShow,V.onHide]),!1),[V.onError,V.onPageNotFound,V.onUnhandledRejection],!1),W=["attached","onInit"],J=["onLoad","onShow","onReady","onUnload","onHide"],Y=function(n){return"[object Object]"===Object.prototype.toString.call(n)};var $=function(){return Date.now()};function Q(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!m(n))return 0;var r=$(),o=r;try{n.apply(this,e)}finally{o=$()}return o-r}var X,Z=function(){},nn=i((X="tt",[function(){return X},function(n){return X=n}]),2),en=nn[0],tn=nn[1],rn=function(n,e){function t(t){return e(t),n.call(this,t)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},on=function(n,e,t){var r=n[e];if(!r||!r.__HOOKED__)return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var o=t.apply(this,n);o&&(n=o)}catch(n){P(n)}return r.apply(this,n)}}),n[e]&&(n[e].__HOOKED__=!0),function(){n[e].__HOOKED__=!1,t=Z}},an=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:en()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},un={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},cn=function(n,e){void 0===n&&(n={}),void 0===e&&(e=an().instance);var t=e?e["__slardar__global__0.2.4"]||(e["__slardar__global__0.2.4"]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=r(r({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=r({},un),e&&(e["__slardar__global__0.2.4"]=t)}}}(r({},un)),sn=cn.setGlobalValue,fn=cn.mergeGlobalValue,ln=cn.getGlobalValue,pn=function(n,e){Object.keys(e).forEach((function(t){e[t].addTearDown((function(){var e;return fn(n,((e={})[t]=null,e))}))}))},dn=function(n,e){e.addTearDown((function(){return sn(n,null)}))},mn=function(n){return ln("app")[n]},vn=function(n){return ln("page")[n]},hn=function(n){return ln("route")[n]},gn=function(n){return!!ln("route")[n]},bn=function(n,e){void 0===e&&(e=U),e.forEach((function(e){gn(e)&&hn(e).subscribe((function(t){return n(t,e)}))}))},yn=function(n){return ln("http")[n]},_n=function(n){return!!ln("http")[n]},wn=function(){return ln("setData")},Sn=function(){return ln("performance")},En=function(){return!!ln("performance")},kn=function(n){return ln("component")[n]},xn=function(){return ln("instance")},Pn=function(n){sn("instance",n)};function On(n){return"function"==typeof n}function jn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}function In(n){return n}function Cn(n){return function(e){if(function(n){return n&&On(n.lift)}(e))return e.lift((function(e){try{return n(e,this)}catch(n){this.error(n)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Dn(n){return 0===n.length?In:1===n.length?n[0]:function(e){return n.reduce((function(n,e){return e(n)}),e)}}var Tn=function(n){On(n)?n():null==n||n.unsubscribe()},Rn=function(){function n(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var n=this;if(!this.closed){this.closed=!0;var e=this,t=e._parentage,r=e._finalizers,o=e.initialTeardown;t&&(this._parentage=null,t.forEach((function(e){return e.remove(n)}))),On(o)&&o(),r&&(this._finalizers=null,r.forEach(Tn))}},n.prototype.remove=function(e){this._finalizers&&jn(this._finalizers,e),e instanceof n&&e._removeParent(this)},n.prototype.add=function(e){if(e&&e!==this)if(this.closed)Tn(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}var t=this._finalizers;this._finalizers=t?(t.push(e),t):[e]}},n.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},n.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},n.prototype._removeParent=function(n){this._parentage&&jn(this._parentage,n)},n}(),Nn=function(n){function e(e){var t,r=n.call(this)||this;return r.isStopped=!1,r.destination=An(e)?e:new Vn(!(t=e)||On(t)?{next:null!=t?t:void 0}:t),r}return t(e,n),e.prototype.next=function(n){this.isStopped||this.destination.next(n)},e.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Rn),Vn=function(){function n(n){this.partialObserver=n}return n.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},n.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},n.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},n}();function An(n){return n instanceof Nn||n&&function(n){return n&&On(n.next)&&On(n.error)&&On(n.complete)}(n)&&function(n){return n instanceof Rn||n&&"closed"in n&&On(n.remove)&&On(n.add)&&On(n.unsubscribe)}(n)}var Mn=function(){function n(n){n&&(this._subscribe=n)}return n.prototype.subscribe=function(n){var e=An(n)?n:new Nn(n),t=this.operator,r=this.source;return e.add(t?t.call(e,r):this._trySubscribe(e)),e},n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.pipe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return Dn(n)(this)},n.prototype._subscribe=function(n){},n.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},n}(),qn=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var r;return t(e,n),e.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach((function(e){return e.next(n)}))},e.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},e.prototype.error=function(n){var e=this;this.commonJudgement((function(){var t=e.observers;for(e.hasError=!0,e.thrownError=n;t.length;)t.shift().error(n)}))},Object.defineProperty(e.prototype,"observed",{get:function(){return this.observers&&this.observers.length>0},enumerable:!1,configurable:!0}),e.prototype.complete=function(){var n=this;this.commonJudgement((function(){for(var e=n.observers;e.length;)e.shift().complete()}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},e.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._checkFinalizedStatuses=function(n){var e=this,t=e.hasError,r=e.thrownError,o=e.isStopped;t?n.error(r):o&&n.complete()},e.prototype._innerSubscribe=function(n){var t=this.isStopped,r=this.observers;return t?e.EMPTY:(r.push(n),new Rn((function(){jn(r,n)})))},e.EMPTY=((r=new Rn).closed=!0,r),e}(Mn),Ln=new Mn((function(n){return n.complete()}));function Bn(n){return n<=0?function(){return Ln}:Cn((function(e,t){var r=0;e.subscribe((function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))}))}function Fn(n,e){return Cn((function(t,r){var o=0;t.subscribe((function(t){return n.call(e,t,o++)&&r.next(t)}))}))}function Hn(n){return Fn((function(e,t){return n<=t}))}var zn,Kn=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.tearDownFns=[],e}return t(e,n),e.prototype.subscribe=function(e){var t=this,r=n.prototype.subscribe.call(this,e),o=function(){t.observed||t.unsubscribe()};xn()&&xn()._subscriptions.push(r);var i=r.unsubscribe;return r.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i.apply(this,n),o()},r},e.prototype.unsubscribe=function(){n.prototype.unsubscribe.call(this),this.tearDownFns.forEach((function(n){return n()}))},e.prototype.addTearDown=function(n){this.tearDownFns.push(n)},e}(qn),Un=function(n){var e=n.reduce((function(n,e){return n[e]=new Kn,n}),{});return{getSubject:function(n){return e[n]},subjectMap:e}},Gn=function(n){return n.length>1?n:n.length&&n[0]||{}},Wn=function(n){var e=n.filter((function(n){return e=n,!ln("app")[e];var e}));!function(n){fn("app",n),pn("app",n)}(Un(e).subjectMap),App=rn(App,(function(n){e.forEach((function(e){var t=mn(e),r=k(n,e,(function(n){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.next({that:this,param:Gn(e),time:$()}),m(n)&&n.apply(this,e)}}))();r&&t.addTearDown(r)}))}))},Jn=i((zn={},[function(n){if(!an().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;var e=n.find((function(n){return n.platform===an().platform}));return e&&(zn=e.adapterCtor())},function(){return zn}]),2),Yn=Jn[0],$n=Jn[1],Qn=function(n){return"SLARDAR"+n},Xn=function(n){return n.route||n.__route__||n.url||n.path||""},Zn=function(n){return void 0===n&&(n=an().instance),{instance:n,request:function(e){return n.request(e)},getStorage:function(e){return n.getStorageSync(e)},setStorage:function(e,t){return n.setStorageSync(e,t)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){n.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),n.onNetworkStatusChange((function(n){e&&e({networkType:n.networkType})}))},performanceSubscriber:c,getSystemInfo:c,buildRequestProfile:c,componentSubject:c,setDataSubject:c,pagePerfSubscriber:c}},ne=function(n){var e=["attached"],t=n.filter((function(n){return~e.indexOf(n)})),r=function(n,e){t.forEach((function(t){k(n,t,(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];kn(t).next({that:this,param:null,time:$()});var i=e[t];if(m(i)&&i.apply(this,r),m(n))return n.apply(this,r)}}))()}))};try{Component=rn(Component,(function(n){f(n.lifetimes)?r(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},r(n.lifetimes,n))}))}catch(n){}},ee=function(n){var e={},t=null,o=function(){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0},i=function(){e.navigate_start&&(n(r({},e)),e.navigate_name="",e.navigate_start=0,t=!0)};bn((function(n,r){"invoke"===n.param.name&&(t=!1,e={navigate_start:n.time,navigate_name:r})}),K),vn("onLoad").pipe(Hn(1)).subscribe((function(n){e.load_start=n.time})),vn("onShow").pipe(Hn(1)).subscribe((function(n){e.dom_end=n.time})),vn("onReady").pipe(Hn(1)).subscribe((function(n){e.render_end=n.time,o(),i()})),mn(V.onHide).subscribe((function(){!1===t&&(o(),i())}))},te=function(n){var e=["downloadPackage","evaluateScript","fcp","fp","fr"];Sn().subscribe((function(t){~e.indexOf(t.name)&&n(t)}))},re=function(n){kn("attached").subscribe((function(e){var t=e.that;return n.call(t)}))},oe=function(n){return"android"===n.toLowerCase()},ie=["darwin","macs","mac"],ae=["windows_nt","windows","window"],ue=function(n){return oe(n)?"Android":function(n){return"ios"===n.toLowerCase()}(n)?"iOS":function(n){return~ie.indexOf(n.toLowerCase())}(n)?"Mac":function(n){return~ae.indexOf(n.toLowerCase())}(n)?"windows":"unknown"},ce=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,o=n.height;return e&&oe(e)&&t?r/t+" * "+o/t:r+" * "+o},se=function(n){return function(n){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&void 0!==n[t]&&null!==n[t]&&(e[t]=n[t]);return e}({domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,secureConnectionStart:n.SSLconnectionStart,connectEnd:n.connectEnd,requestStart:n.requestStart,requestEnd:n.requestEnd,responseStart:n.responseStart,responseEnd:n.responseEnd,socketReused:n.socketReused,redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,sendBytesCount:n.sendBytesCount,throughputKbps:n.throughputKbps,receivedBytedCount:n.receivedBytedCount})},fe=function(n){return{name:"unknown_error_name",message:S(n)}},le=function(){var n=wx.getAccountInfoSync().miniProgram,e=wx.getSystemInfoSync(),t=e.model,r=e.brand,o=e.pixelRatio,i=e.screenHeight,a=e.screenWidth,u=e.windowHeight,c=e.windowWidth,s=e.language,f=e.version,l=e.system,p=e.platform,d=e.SDKVersion;return{model:t,brand:r,pixelRatio:o,screenArea:ce({width:a,height:i}),windowArea:ce({width:c,height:u}),language:s,osName:ue(p),osVersion:l,SDKVersion:d,appId:n.appId,miniEnv:n.envVersion,miniVersion:n.version,hostName:"wx",hostVersion:f,platform:"wx"}},pe=function(n){switch(n){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return n}},de={platform:"wx",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"wx",buildError:function(n){return h(n)?function(n){var e=n.split("\n");return{name:i((e[2]&&e[2].split(":")||[]).map((function(n){return n.trim()})),1)[0],message:e&&e[1]&&e[1].trim(),stack:e.slice(2).join("\n")}}(n):fe(n)},getSystemInfo:le,observePerformance:function(n){var e=wx.getPerformance&&wx.getPerformance();if(e){var t=e.createObserver((function(e){var t=e.getEntries().map((function(n){return r(r({},n),{name:pe(n.name)})}));n(t)}));return t.observe({entryTypes:t.supportedEntryTypes}),t}},performanceSubscriber:te,buildRequestProfile:function(n){return function(n){var e=se(n);return n.protocol&&(e.protocol=n.protocol),e}(n)},componentSubject:ne,pagePerfSubscriber:ee,setDataSubject:re})}},me=function(n){return h(n)?function(n){var e=n.split("\n"),t=i((e[0]&&e[0].split(":")||[]).map((function(n){return n.trim()})),2);return{name:t[0],message:t[1],stack:n}}(n):fe(n)},ve=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,d=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:ce({width:i,height:o}),windowArea:ce({width:u,height:a}),language:c,osName:ue(l),osVersion:f,SDKVersion:p,hostName:d,hostVersion:s}},he=function(n){void 0===n&&(n="tt");var e="",t="",o="";if(tt.getEnvInfoSync){var i=tt.getEnvInfoSync().microapp;t=i.envType,e=i.appId,o=i.mpVersion}else t=tt.env.VERSION,e="";return r({appId:e,miniEnv:t,miniVersion:o,platform:n},ve())},ge=function(n){var e=vn("onReady").subscribe((function(){if(tt.performance){var e=(tt.performance.getCurrentPageEntries()||[]).map((function(n){n.name,n.entryType;var e=o(n,["name","entryType"]),t=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}}(n);return t?r(r({},e),t):n}));n(e)}}));return{disconnect:function(){return e.unsubscribe()}}},be={platform:"tt",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"tt",buildError:function(n){return me(n)},getSystemInfo:he,observePerformance:ge,performanceSubscriber:te,buildRequestProfile:function(n){return function(n){return se(n)}(n)},componentSubject:ne,pagePerfSubscriber:ee,setDataSubject:re})}},ye=function(){var n="",e="",t="";if(my.getAccountInfoSync){var r=my.getAccountInfoSync().miniProgram;e=r.envVersion,n=r.appId,t=r.version}else n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}});var o=my.getSystemInfoSync(),i=o.model,a=o.brand,u=o.pixelRatio,c=o.screenHeight,s=o.screenWidth,f=o.windowHeight,l=o.windowWidth,p=o.language,d=o.version,m=o.system,v=o.platform,h=o.app;return{model:i,brand:a,pixelRatio:u,screenArea:ce({pixelRatio:u,width:s,height:c,systemPlatform:v}),windowArea:ce({width:l,height:f}),language:p,osName:ue(v),osVersion:m,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:h,hostVersion:d,platform:"my"}},_e={platform:"my",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"my",buildError:function(n){return d(n)?function(n,e){var t={message:n};if(e){t.stack=e;var r=e.split("\n"),o=i(r[0]&&r[0].split(":"),1)[0];o&&(t.name=o)}return t}(n[0],n[1]):fe(n)},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:ye,componentSubject:function(n){var e=["onInit"],t=n.filter((function(n){return~e.indexOf(n)})),r=function(n){t.forEach((function(e){k(n,e,(function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(kn(e).next({that:this,param:null,time:$()}),m(n))return n.apply(this,t)}}))()}))};Component=rn(Component,(function(n){f(n)?r(n):null==n&&r(n={})}))},setDataSubject:function(n){kn("onInit").subscribe((function(e){var t=e.that;return n.call(t)}))},pagePerfSubscriber:ee})}},we=function(n){return n&&function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return!0;default:return n instanceof Error}}(n)?{name:n.name,message:n.message,stack:n.stack}:fe(n)},Se=function(){var n="",e="";if(swan.getEnvInfoSync){var t=swan.getEnvInfoSync();e=t.env,n=t.appKey}var r=swan.getSystemInfoSync(),o=r.model,i=r.brand,a=r.pixelRatio,u=r.screenHeight,c=r.screenWidth,s=r.windowHeight,f=r.windowWidth,l=r.language,p=r.version,d=r.system,m=r.platform,v=r.SDKVersion,h=r.host;return{model:o,brand:i,pixelRatio:a,screenArea:ce({width:c,height:u}),windowArea:ce({width:f,height:s}),language:l,osName:ue(m),osVersion:d,SDKVersion:v,appId:n,miniEnv:e,miniVersion:"",hostName:h,hostVersion:p,platform:"swan"}},Ee={platform:"swan",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"swan",buildError:function(n){return we(n)},getSystemInfo:Se,componentSubject:ne,setDataSubject:re,pagePerfSubscriber:function(n){var e={},t={},o=!1,i=!0,a=function(e){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0,e.navigate_start&&0!==e.load_start&&(n(r({},e)),e.load_start=0,o=!0)};bn((function(n,r){"invoke"===n.param.name&&(o=!1,e={navigate_start:n.time,navigate_name:r},t={navigate_start:n.time,navigate_name:r})})),vn("onLoad").pipe(Hn(1)).subscribe((function(n){n.that.componentName?t.dom_end=n.time:e.load_start=n.time})),vn("onShow").pipe(Hn(1)).subscribe((function(n){n.that.componentName?(t.load_start=n.time,e.load_start=0):e.dom_end=n.time})),vn("onReady").pipe(Hn(1)).subscribe((function(n){if(n.that.componentName){if(i)return void(i=!1);t.render_end=n.time,a(t)}else e.render_end=n.time,a(e),i=!1})),mn(V.onHide).subscribe((function(){o||(a(e),a(t))}))}})}},ke=function(){return r({appId:"",miniEnv:"",miniVersion:"",platform:"lark"},ve())},xe={platform:"lark",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"lark",buildError:me,getSystemInfo:ke,componentSubject:ne,pagePerfSubscriber:ee,setDataSubject:re})}},Pe={platform:"mars",adapterCtor:function(){return r(r({},Zn()),{miniPlatform:"mars",buildError:me,getSystemInfo:he.bind(null,"mars"),observePerformance:ge,performanceSubscriber:te,componentSubject:ne,pagePerfSubscriber:ee,setDataSubject:re})}},Oe=function(n){var e=n.filter((function(n){return e=n,!ln("component")[e];var e}));!function(n){fn("component",n),pn("component",n)}(Un(e).subjectMap),$n().componentSubject(e)},je=function(n,e){var t=n.filter((function(n){return e=n,!ln("page")[e];var e}));!function(n){fn("page",n),pn("page",n)}(Un(t).subjectMap);var r=function(n){t.forEach((function(e){var t=vn(e),r=k(n,e,(function(n){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(Xn(this)&&t.next({that:this,param:Gn(e),time:$()}),m(n))return n.apply(this,e)}}))();r&&t.addTearDown(r)}))};!function(n){Page=rn(Page,n)}(r),function(n){var e=function(e){Y(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))};try{Component=rn(Component,e),Behavior=rn(Behavior,e)}catch(n){}}(r)},Ie=function(n){var e=n.filter((function(n){return!gn(n)})),t=Un(e).subjectMap;!function(n){fn("route",n),pn("route",n)}(t),e.forEach((function(n){var e=on($n().instance,n,(function(e){void 0===e&&(e={}),hn(n).next({that:this,param:{url:e.url,delta:e.delta,name:"invoke",value:{errMsg:"invoke"}},time:$()}),H.forEach((function(t){k(e,t,(function(r){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];hn(n).next({that:this,param:{url:e.url,delta:e.delta,name:t,value:Gn(o)||{}},time:$()}),m(r)&&r.apply(this,o)}}))()}))}));e&&t[n].addTearDown(e)}))},Ce=function(n,e){return"uploadFile"===n?"POST":"downloadFile"===n?"GET":e||"GET"},De=function(n,e){void 0===e&&(e=$n().instance);var t=n.filter((function(n){return!_n(n)})),r=Un(t).subjectMap;!function(n){fn("http",n),pn("http",n)}(r),t.forEach((function(n){var t=on(e,n,(function(e){!function(n,e){var t=e.url,r=e.method,o=e.data,i=e.header,a=e.headers,u={api:n,request:{url:t,method:Ce(n,r),headers:i||a||{},body:S(o),timestamp:$()},response:{}};k(e,"complete",(function(e){return function(t){var r=u.response.timestamp||$();u.duration=r-u.request.timestamp,u.completeCallbackTime=Q(e,t);var o,i,a,c=t.errMsg||t.errorMessage||t.error;u.response={status:(o=t.status,i=t.statusCode,a=u.response.status,o>=0?o:i>=0?i:a),timestamp:r,headers:t.header||t.headers||{},body:S(t.data),errMsg:c,timing:$n().buildRequestProfile(t.profile||{})},yn(n).next(u)}}))(),k(e,"success",(function(n){return function(e){u.response.timestamp=$(),u.response.status=200,u.successCallbackTime=Q(n,e)}}))(),k(e,"fail",(function(n){return function(e){u.response.timestamp=$(),u.response.status=-1,u.failCallbackTime=Q(n,e)}}))()}(n,e)}));t&&r[n].addTearDown(t)}))};function Te(){var n=Xn(this),e=wn();var t=on(this,"setData",(function(){for(var t=this,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=r[0],a=$(),u=function(){var o=r[1],u=$()-a;e.next({renderTime:u,url:n,data:i,startTime:a}),o&&o.call(t)};return[i,u]}));t&&e.addTearDown(t)}var Re=function(){if(!ln("setData")){var n,e=Un(["setData"]).getSubject;n=e("setData"),sn("setData",n),dn("setData",n)}},Ne=function(n){n.on("init",(function(){var n=$n();if(n.observePerformance&&!En()){var e=(0,Un(["performance"]).getSubject)("performance");!function(n){sn("performance",n),dn("performance",n)}(e);var t=n.observePerformance((function(n){n.forEach((function(n){e.next(n)}))}));t&&t.disconnect&&e.addTearDown((function(){return t.disconnect()}))}}))},Ve=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Ae=new RegExp("(bearer|session)","i"),Me=function(n){return Object.keys(n).reduce((function(e,t){var r,o;return r=t,o=n[t],r&&o&&(Ve.test(r)||Ae.test(o))||(e[t]=n[t]),e}),{})},qe=function(){return function(n,e){var t=n.hookRequest,i=n.hookDownloadFile,a=n.hookUploadFile,u=n.ignoreUrls,c=n.collectBodyOnError,s=n.extraExtractor,f=function(n){if(!function(n,e){var t=w(n||[]);return!!t&&t.test(e)}(u,n.request.url)){var t=n.response,i=n.request,a=n.api,f=n.duration,l=n.failCallbackTime,p=n.successCallbackTime,d=n.completeCallbackTime;i.headers=Me(i.headers||{}),t.headers=Me(t.headers||{});var v=t.errMsg,h=o(t,["errMsg"]),g=r(r({},h),{is_custom_error:!1});v&&(g.err_msg=v);var b,y={api:a,request:i,duration:f,cbTime:d+(l||0)+(p||0),response:g};if(m(s)){var _=s(t.body,y);_&&(y.extra=_,y.response.is_custom_error=!0)}c&&(0===(b=t.status)||b>=400)||(delete y.request.body,delete y.response.body),e({ev_type:"http",payload:y})}};t&&yn("request").subscribe(f),i&&yn("downloadFile").subscribe(f),a&&yn("uploadFile").subscribe(f)}},Le=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,a([],i(r),!1));return o&&o(e,t)||[]}catch(n){return P("applyMonitor",n),[]}};function Be(n,e,t){var o;Pn(n);var i=null===(o=n.config())||void 0===o?void 0:o.plugins[e];return f(i)?r(r({},t),i):!!i&&t}var Fe,He={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},ze=function(n){n.on("init",(function(){var e=Be(n,"http",He);if(e){var t=e.hookRequest,r=e.hookDownloadFile,o=e.hookUploadFile,i=[];t&&i.push("request"),r&&i.push("downloadFile"),o&&i.push("uploadFile"),function(n,e){void 0===e&&(e=z),n.on("init",(function(){De(e)}))}(n,i),Le(qe,e,n.report.bind(n))}}))},Ke=function(n,e){return n&&e&&n===e},Ue=function(){var n;return function(e){try{if(function(n,e){return!(!n||!e||!Ke(n.message,e.message)&&!Ke(n.stack,e.stack))}(e,n))return void(n=e)}catch(n){}return n=e,e}},Ge=function(n){return void 0===n&&(n=$n()),function(e,t){var r=e.ignoreErrors,o=e.hookOnError,i=e.hookOnUnhandledRejection,a=e.hookRouteError,u=e.dedupe,c=w(r),f=Ue(),l=function(n,e,r){var o=u?f(n):n;if(o){if(c&&c.test(o.message))return;var i={error:o};e&&(i.extra=e),r&&(i.react=r),t(i)}};o&&mn(V.onError).subscribe((function(e){var t=e.param,r=n.buildError(t);c&&c.test(r.message)||l(r)})),i&&mn(V.onUnhandledRejection).subscribe((function(n){var e=n.param||{},t=e.promise,r=S(e.reason);c&&c.test(r)||t.catch(s).then((function(n){var e={name:"UnhandledRejection",message:r};n&&n.stack&&(e.stack=n.stack),l(e)}))}));if(a&&~["tt","wx","lark"].indexOf(n.miniPlatform)){bn((function(n){return function(n){"fail"===n.name&&l({name:"RouteError",message:n.value.errMsg})}(n.param)}))}return[l]}};!function(n){n.history="history",n.manual="manual"}(Fe||(Fe={}));var We=function(){return function(n,e){var t=n.extractPid,r=n.routeMode,o=n.setPidAndViewId,a=i(function(n,e,t){var r=e,o=null,i=0,a="launch";mn(V.onShow).pipe(Hn(1)).subscribe((function(){a="show"})),bn((function(){a="history"}));var u=function(e,a){r=a,i=$(),t(a,o=a+"_"+i),n(e,a)};return[u,function(n){n&&(u(a,n),a="history")},function(e){void 0===e&&(e="hide"),o&&(t(r,o),o=null,n(e,r,$()-i))}]}((function(n,t,r){!function(n,t,r){e({ev_type:"pageview",payload:{pid:t,source:n,duration:r}})}(n,t,r)}),"",o),3),u=a[0],c=a[1],s=a[2];if(r!==Fe.manual){var f=function(n){var e,r=Xn(n),o=(e=r,t?t(e):e);c(o)};vn("onShow").subscribe((function(n){var e=n.that;return f(e)})),vn("onUnload").subscribe(s.bind(null,"unload")),vn("onHide").subscribe(s.bind(null,"hide"))}return[u.bind(null,"user_set"),s]}},Je=function(){return function(n){var e=i(function(n,e,t){void 0===n&&(n=20),void 0===e&&(e=s),void 0===t&&(t=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(u){if(e(u)){var c=r(r({},u),{timestamp:u.timestamp||Date.now()});o=n>=0&&o.length+1>n?t(a(a([],i(o),!1),[c],!1),n):a(a([],i(o),!1),[c],!1)}}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),t=e[0],o=e[1];return z.forEach((function(n){_n(n)&&yn(n).subscribe((function(n){o({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})}))})),bn((function(n,e){var t=n.param,r=n.time;"complete"===t.name&&o({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:r,data:{url:t.url||""}})})),[t,o]}},Ye=function(){return function(n,e){var t=n.isCalculateSize;wn().subscribe((function(n){var r,o={duration:n.renderTime,start_time:n.startTime};t&&(o.size=(r=n.data,TextEncoder?(new TextEncoder).encode(S(r)).length:2*S(r).length)),e({ev_type:"set_data",payload:o})}))}},$e=function(){return function(n,e){var t={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},r=!1,o=function(){e({ev_type:"app_launch_perf",payload:t}),r=!0};mn(V.onLaunch).pipe(Bn(1)).subscribe((function(n){t.activate_start=n.time})),mn(V.onShow).pipe(Bn(1)).subscribe((function(n){t.init_end=n.time})),vn("onLoad").pipe(Bn(1)).subscribe((function(n){t.page_load_start=n.time})),vn("onShow").pipe(Bn(1)).subscribe((function(n){t.page_dom_end=n.time}));var i=En();vn("onReady").pipe(Bn(1)).subscribe((function(n){t.page_render_end=n.time,i&&!t.trigger||o()})),i&&Sn().pipe(Fn((function(n){return"appClick"===n.name})),Bn(1)).subscribe((function(n){t.trigger=n.startTime,t.page_render_end&&o()})),mn(V.onHide).subscribe((function(){r||o()}))}},Qe=function(){return function(n,e){$n().pagePerfSubscriber((function(n){return e({ev_type:"page_perf",payload:n})}))}},Xe=function(n){return void 0===n&&(n=$n()),function(e,t){if(En()&&n.performanceSubscriber){var r,o=0;vn("onLoad").subscribe((function(n){r=n.time,o++}));n.performanceSubscriber((function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:o};e.duration=n.duration||(r?n.startTime-r:0),e.is_support=e.duration>=0,t({ev_type:"performance",payload:e})}))}}},Ze={routeMode:Fe.history,setPidAndViewId:function(n,e){}},nt=function(n){return n.on("init",(function(){var e=Be(n,"pageview",Ze);if(e){var t=i(Le(We,r(r({},e),{setPidAndViewId:function(e,t){n.set({pid:e,viewId:t,actionId:void 0})}}),n.report.bind(n)),2),o=t[0],a=t[1];n.provide("sendPageview",o),n.provide("sendPageviewWithHide",a)}})),n},et={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},rt=function(n){n.on("init",(function(){var e=Be(n,"jsError",et);if(e){var t=function(n){return function(e){var t=n.getBreadcrumbs&&n.getBreadcrumbs()||[];n.report({ev_type:"js_error",payload:r(r({},e),{breadcrumbs:t})})}}(n),o=i(Le(Ge,e,t),1)[0];n.provide("captureException",o)}}))},ot={maxBreadcrumbs:20,tap:!0},it=function(n){n.on("init",(function(){var e=Be(n,"breadcrumb",ot);if(e){var t=i(Le(Je,e,(function(n){})),2),r=t[0],o=t[1];n.provide("getBreadcrumbs",r),n.provide("addBreadcrumb",o)}}))},at=function(n){n.on("init",(function(){n.provide("_subscriptions",[]),Pn(n),function(n){n.on("init",(function(){Wn(G),je(J),Oe(W)}))}(n),function(n){n.on("init",(function(){Ie(U)}))}(n)})),n.on("beforeDestroy",(function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]}))},ut={isCalculateSize:!1},ct=function(n){n.on("init",(function(){var e=Be(n,"setData",ut);e&&(!function(n){n.on("init",(function(){Re(),vn("onLoad").subscribe((function(n){var e=n.that;Te.call(e)})),$n().setDataSubject(Te)}))}(n),Le(Ye,e,n.report.bind(n)))}))},st={},ft=function(n){n.on("init",(function(){var e=Be(n,"appLaunchPerf",st);e&&(Ne(n),Le($e,e,n.report.bind(n)))}))},lt={},pt=function(n){n.on("init",(function(){var e=Be(n,"pagePerf",lt);e&&Le(Qe,e,n.report.bind(n))}))},dt={},mt=function(n){n.on("init",(function(){var e=Be(n,"performance",dt);e&&(Ne(n),Le(Xe,e,n.report.bind(n)))}))},vt=function(n,e,t){void 0===t&&(t=$n());var r,o=e.url,i=e.data,a=e.success,u=void 0===a?c:a,s=e.fail,f=void 0===s?c:s,l=e.header,p={"Content-Type":"application/json"};Y(r=l)&&0!==Object.keys(r).length&&Object.assign(p,l),t.request({method:n,url:o,data:i,header:p,headers:p,success:function(n){u(n)},fail:function(n){var e=n.errMsg||"Network request failed";f(new Error(e))}})},ht=function(n){return void 0===n&&(n=$n()),n?{get:function(e){return vt("GET",e,n)},post:function(e){return vt("POST",e,n)}}:{get:c,post:c}};var gt=function(n){return{name:"FrameworksAdapterIntegration",setup:function(e){var t=n.Taro;t&&"my"===$n().miniPlatform&&e.on("init",(function(){De(["request"],t)}))}}},bt=function(){return{name:"AppLaunchPerfIntegration",setup:function(n){ft(n)}}},yt=function(){return{name:"BreadcrumbIntegration",setup:function(n){it(n)}}},_t=function(){return{name:"CustomIntegration",setup:function(n){F(n)}}},wt=function(){return{name:"HttpIntegration",setup:function(n){ze(n)}}},St=function(){return{name:"JsErrorIntegration",setup:function(n){rt(n)}}},Et=function(){return{name:"PagePerfIntegration",setup:function(n){pt(n)}}},kt=function(){return{name:"PageviewIntegration",setup:function(n){nt(n)}}},xt=function(){return{name:"PerformanceIntegration",setup:function(n){mt(n)}}},Pt=function(){return{name:"SetDataIntegration",setup:function(n){ct(n)}}},Ot={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:r(r({},n.extra||{}),n.overrides||{})}}},jt={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},It=["/monitor_mini/collect","/settings/minipro"],Ct=function(n,e){return void 0===e&&(e="/settings/minipro"),(n&&n.indexOf("//")>=0?"":"https://")+n+e},Dt=function(n){var e=function(n){try{return $n().getStorage(n)}catch(n){return}}(Qn(String(n)));return e&&e.userId&&e.deviceId?e:{userId:T(),deviceId:T()}},Tt=function(n){var e=n.aid,t=n.userId,r=n.deviceId;!function(n,e){try{$n().setStorage(n,e)}catch(n){}}(Qn(String(e)),{userId:t,deviceId:r})};function Rt(n){var e,t=Dt(n.aid);return{aid:0,token:"",pid:"",viewId:(e="_",e+"_"+Date.now()),userId:t.userId,deviceId:t.deviceId,sessionId:T(),domain:"apmplus.volces.com",plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:It},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:jt,sdkName:"APM_PLUS_MINI_PROGRAM",sdkVersion:"0.2.4"}}function Nt(n){var e=n.plugins||{};for(var t in e)e[t]&&!f(e[t])&&(e[t]={});return r(r({},n),{plugins:e})}function Vt(n){return f(n)&&"aid"in n&&"token"in n}function At(n){return r({},n)}var Mt=function(n){var e,t,o=n,i={},a=void 0,u=c,s=c;return{getConfig:function(){return o},setConfig:function(n){var c,s,p;return i=r(r({},i),n||{}),f(),e||(e=n,o.useLocalConfig||!o.aid?(t={},u()):a?l():(c=o.domain,s=o.aid,p=function(n){a=n,l()},ht().get({url:Ct(c)+"?biz_id="+s,success:function(n){p(n&&n.data&&n.data.data||{})},fail:function(){p({sample:{sample_rate:.001}})}}))),o},onChange:function(n){s=n},onReady:function(n){u=function(){Tt(o),n()},t&&u()}};function f(){var e=r(r(r({},n),t||{}),i);e.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=b(t,n[r++]);return t}(n.plugins,(null==t?void 0:t.plugins)||{},i.plugins||{}),e.sample=qt(qt(n.sample,null==t?void 0:t.sample),i.sample),o=e,s()}function l(){var e,i;t=function(n){if(!n)return{};var e=n.sample,t=n.user_id,o=n.timestamp,i=t?{userId:t}:{};if(!e)return i;var a=e.sample_rate,u=e.sample_granularity,c=void 0===u?"session":u,s=e.include_users,f=e.rules,l=void 0===f?[]:f;return r(r({},i),{sample:{include_users:s,sample_rate:a,sample_granularity:c,rules:l.reduce((function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,i=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:i},n}),{})},serverTimestamp:o})}(a),e=String(o.aid),i=Qn(e),$n().getStorage(i)&&(t.userId=n.userId),f(),u()}};function qt(n,e){if(!n||!e)return n||e;var t=r(r({},n),e);return t.include_users=a(a([],i(n.include_users||[]),!1),i(e.include_users||[]),!1),t.rules=a(a([],i(Object.keys(n.rules||{})),!1),i(Object.keys(e.rules||{})),!1).reduce((function(t,o){var u,c;return o in t||(o in(n.rules||{})&&o in(e.rules||{})?(t[o]=r(r({},n.rules[o]),e.rules[o]),t[o].conditional_sample_rules=a(a([],i(n.rules[o].conditional_sample_rules||[]),!1),i(e.rules[o].conditional_sample_rules||[]),!1)):t[o]=(null===(u=n.rules)||void 0===u?void 0:u[o])||(null===(c=e.rules)||void 0===c?void 0:c[o])),t}),{}),t}var Lt=function(n){var e=!1,t=function(n){var e="";return function(){var t=n.getSender();e||(e=t.getEndpoint());var r=n.config(),o={did:r.deviceId,sid:r.sessionId,sname:r.sdkName,sver:r.sdkVersion,soffset:r.offset||0,model:r.model,brand:r.brand,ratio:r.pixelRatio,screen:r.screenArea,window:r.windowArea,lang:r.language,osname:r.osName,osver:r.osVersion,libver:r.SDKVersion,scene:r.scene||-1,menv:r.miniEnv,mver:r.miniVersion,hostname:r.hostName,hostver:r.hostVersion,platform:r.platform,biz_id:r.aid,x_auth_token:r.token};t.setEndpoint(e+E(o))}}(n),o=function(e){return void 0===e&&(e=$n().getSystemInfo()),n.set(r({},e))},i=function(){o(),t()};n.on("start",(function(){i(),e=!0})),n.on("init",(function(){mn(V.onLaunch).pipe(Bn(1)).subscribe((function(n){var t=n.param.scene||-1;o({scene:t}),e&&i()})),$n().monitorNetworkType((function(e){var t=e.networkType;n.set({networkType:t})}))}))},Bt=function(n){n.on("beforeBuild",(function(e){return function(n,e){var t,o={};return o.aid=e.aid,o.pid=e.pid,o.view_id=e.viewId,o.user_id=e.userId,o.network_type=e.networkType,r(r({},n),{extra:r(r({},o),null!==(t=n.extra)&&void 0!==t?t:{})})}(e,n.config())}))},Ft=function(n){n.on("report",(function(n){return function(n){var e,t,o={url:(t=$n().getCurrentPages().pop(),t?(t?Xn(t):"")+E(t.options):""),timestamp:$()};return r(r({},n),{extra:r(r({},o),null!==(e=n.extra)&&void 0!==e?e:{})})}(n)}))},Ht=function(e){if(!Yn(e))throw Error("Adapters imported incorrectly");var t=R({validateInitConfig:Vt,initConfigNormalizer:Nt,userConfigNormalizer:At,createSender:function(e){return function(e){return n(e)}({size:20,endpoint:(t=e.domain,void 0===r&&(r="/monitor_mini/collect"),(t&&t.indexOf("//")>=0?"":"https://")+t+r),transport:ht()});var t,r},builder:Ot,createDefaultConfig:Rt,createConfigManager:Mt});return N(t),function(n){var e,t=!1;n.on("init",(function(){e=$(),n.on("config",(function(){var r,o=null===(r=n.config())||void 0===r?void 0:r.serverTimestamp;if(!(isNaN(o)||Number(o)<=0||t)){t=!0;var i=$();if(i-e<1e3&&o){var a=o-(i+e)/2;!isNaN(a)&&n.set({offset:a})}}}))}))}(t),Bt(t),Ft(t),function(n){n.on("start",(function(){var e=n.config(),t=e.userId,r=e.sample,o=B(t,r,I,C);n.on("build",o)}))}(t),at(t),function(n){n.on("init",(function(){var e=[],t=n.config();t&&t.integrations&&t.integrations.forEach((function(t){_(e,t.name)||(e.push(t.name),t.setup(n),t.tearDown&&n.on("beforeDestroy",t.tearDown))}))}))}(t),function(n){n.on("init",(function(){mn(V.onHide).subscribe((function(){var e=n.getSender();e&&e.flush()}))}))}(t),Lt(t),t},zt=function(n){var e=Ht(n);if(e)return F(e),nt(e),rt(e),ze(e),ct(e),it(e),ft(e),pt(e),mt(e),e};export{bt as AppLaunchPerfIntegration,yt as BreadcrumbIntegration,_t as CustomIntegration,gt as FrameworksAdapterIntegration,wt as HttpIntegration,St as JsErrorIntegration,xe as LarkAdapter,Pe as MarsAdapter,_e as MyAdapter,Et as PagePerfIntegration,kt as PageviewIntegration,xt as PerformanceIntegration,Pt as SetDataIntegration,Ee as SwanAdapter,be as TtAdapter,de as WxAdapter,Ht as createBaseMiniProgramClient,zt as createMiniProgramClient,tn as setPlatform}; | ||
function n(n){var e,t=n.transport,r=n.endpoint,o=n.size,i=void 0===o?10:o,a=n.wait,u=void 0===a?1e3:a,c=[],s=0;function f(){if(c.length){var n=this.getBatchData();t.post({url:r,data:n,fail:function(t){e&&e(t,n)}}),c=[]}}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return r},setEndpoint:function(n){r=n},send:function(n){c.push(n),c.length>=i&&f.call(this),clearTimeout(s),s=setTimeout(f.bind(this),u)},flush:function(){clearTimeout(s),f.call(this)},getBatchData:function(){return c.length?(n=c,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(s),c=[]},fail:function(n){e=n}}}var e=function(n,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])},e(n,t)};function t(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var r=function(){return r=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},r.apply(this,arguments)};function o(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function i(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function a(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var u=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],c=function(){return{}};function s(n){return n}function f(n){return"object"==typeof n&&null!==n}var l=Object.prototype;function p(n){if(f(n)){if("function"==typeof Object.getPrototypeOf){var e=Object.getPrototypeOf(n);return e===l||null===e}return"[object Object]"===l.toString.call(n)}return!1}function d(n){return"[object Array]"===l.toString.call(n)}function m(n){return"function"==typeof n}function v(n){return"number"==typeof n}function h(n){return"string"==typeof n}function g(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function b(n,e){var t=r({},n);for(var o in e)g(e,o)&&void 0!==e[o]&&(f(e[o])&&p(e[o])?t[o]=b(f(n[o])?n[o]:{},e[o]):d(e[o])&&d(n[o])?t[o]=y(n[o],e[o]):t[o]=e[o]);return t}function y(n,e){var t=d(n)?n:[],r=d(e)?e:[];return Array.prototype.concat.call(t,r).map((function(n){return n instanceof RegExp?n:f(n)&&p(n)?b({},n):d(n)?y([],n):n}))}function _(n,e){if(!d(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}var w=function(n,e){if(!d(n))return n;var t=n.indexOf(e);if(t>=0){var r=n.slice();return r.splice(t,1),r}return n};function S(n){return d(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];h(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function E(n){try{return h(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}var k=function(n){return f(n)?Object.keys(n).reduce((function(e,t){return e+="&"+t+"="+n[t]}),"").replace("&","?"):""};var x=function(n,e,t,r){return void 0===r&&(r=!0),function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];if(!n)return c;var s=n[e],f=t.apply(void 0,a([s],i(o),!1)),l=f;return m(l)&&r&&(l=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return f.apply(this,n)}catch(e){return m(s)&&s.apply(this,n)}}),n[e]=l,function(t){t||(l===n[e]?n[e]=s:f=s)}}},P="".padStart?function(n,e){return void 0===e&&(e=8),n.padStart(e," ")}:function(n){return n},O=0,j=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,a(["[SDK]",Date.now(),P(""+O++)],i(n),!1))},I=0,C=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,a(["[SDK]",Date.now(),P(""+I++)],i(n),!1))},T=function(n){return Math.random()<Number(n)},D=function(n,e){return n<Number(e)},R=function(n){return function(e){for(var t=e,r=0;r<n.length&&t;r++)try{t=n[r](t)}catch(n){j(n)}return t}};function N(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]]].join("")}(n)}function V(n){var e,t,r=n.builder,o=n.createSender,c=n.createDefaultConfig,s=n.createConfigManager,l=n.userConfigNormalizer,p=n.initConfigNormalizer,d=n.validateInitConfig,m={};u.forEach((function(n){return m[n]=[]}));var v=!1,h=!1,g=!1,b=[],y=[],S=function(){var n=!1,e={},t=function(n){n.length&&n.forEach((function(n){try{n()}catch(n){}})),n.length=0},r=function(n){e[n]&&e[n].forEach((function(n){t(n[1])})),e[n]=void 0};return{set:function(r,o,i){e[r]?e[r].push([o,i]):e[r]=[[o,i]],n&&t(i)},has:function(n){return!!e[n]},remove:r,removeByEvType:function(n){Object.keys(e).forEach((function(r){e[r]&&e[r].forEach((function(e){e[0]===n&&t(e[1])}))}))},clear:function(){n=!0,Object.keys(e).forEach((function(n){r(n)}))}}}(),E={getBuilder:function(){return r},getSender:function(){return e},getPreStartQueue:function(){return b},init:function(n){if(v)C("already inited");else{if(!(n&&f(n)&&d(n)))throw new Error("invalid InitConfig, init failed");var r=c(n);if(!r)throw new Error("defaultConfig missing");var i=p(n);if((t=s(r)).setConfig(i),t.onChange((function(){k("config")})),!(e=o(t.getConfig())))throw new Error("sender missing");v=!0,k("init",!0)}},set:function(n){v&&n&&f(n)&&(k("beforeConfig",!1,n),null==t||t.setConfig(n))},config:function(n){if(v)return n&&f(n)&&(k("beforeConfig",!1,n),null==t||t.setConfig(l(n))),null==t?void 0:t.getConfig()},provide:function(n,e){_(y,n)?C("cannot provide "+n+", reserved"):(E[n]=e,k("provide",!1,n))},start:function(){var n=this;v&&(h||null==t||t.onReady((function(){h=!0,k("start",!0),b.forEach((function(e){return n.build(e)})),b.length=0})))},report:function(n){if(n){var e=R(m.beforeReport)(n);if(e){var t=R(m.report)(e);t&&(h?this.build(t):b.push(t))}}},build:function(n){if(h){var e=R(m.beforeBuild)(n);if(e){var t=r.build(e);if(t){var o=R(m.build)(t);o&&this.send(o)}}}},send:function(n){if(h){var t=R(m.beforeSend)(n);t&&(e.send(t),k("send",!1,t))}},destroy:function(){S.clear(),g=!0,b.length=0,k("beforeDestroy",!0)},on:function(n,e){if("init"===n&&v||"start"===n&&h||"beforeDestroy"===n&&g)try{e()}catch(n){}else m[n]&&m[n].push(e)},off:function(n,e){m[n]&&(m[n]=w(m[n],e))},destroyAgent:S};return y=Object.keys(E),E;function k(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];m[n].forEach((function(n){try{n.apply(void 0,a([],i(t),!1))}catch(n){}})),e&&(m[n].length=0)}}var A=function(n){var e=function(){var n={},e={},t={set:function(r,o){return n[r]=o,e[r]=E(o),t},merge:function(o){return n=r(r({},n),o),Object.keys(o).forEach((function(n){e[n]=E(o[n])})),t},delete:function(r){return delete n[r],delete e[r],t},clear:function(){return n={},e={},t},get:function(n){return e[n]},toString:function(){return r({},e)}};return t}();n.provide("context",e),n.on("report",(function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n}))};var M,q=function(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n},L=function(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i},B=function(n,e,t,r){var o=function(n,e,t){for(var r,o=i(e.split(".")),a=o[0],u=o.slice(1);n&&u.length>0;)n=n[a],a=(r=i(u))[0],u=r.slice(1);if(n)return t(n,a)}(n,e,(function(n,e){return n[e]}));return void 0!==o&&function(n,e,t){switch(t){case"eq":return _(e,n);case"neq":return!_(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(o,function(n,e){return n.map((function(n){switch(e){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}}))}(r,"boolean"==typeof o?"bool":v(o)?"number":"string"),t)},F=function(n,e){try{return"rule"===e.type?B(n,e.field,e.op,e.values):"and"===e.type?e.children.every((function(e){return F(n,e)})):e.children.some((function(e){return F(n,e)}))}catch(n){return!1}},H=function(n,e,t,r){if(!e)return s;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,c=e.r,f=void 0===c?Math.random():c;if(_(i,n))return function(n){return q(n,1)};var l="session"===a,p=L(l,o,t,f,r),d=function(n,e,t,r,o,i){var a={};return Object.keys(n).forEach((function(u){var c=n[u],s=c.enable,f=c.sample_rate,l=c.conditional_sample_rules;s?(a[u]={enable:s,sample_rate:f,effectiveSampleRate:f*t,hit:L(e,f,r,o,i)},l&&(a[u].conditional_hit_rules=l.map((function(n){var a=n.sample_rate,u=n.filter;return{sample_rate:a,hit:L(e,a,r,o,i),effectiveSampleRate:a*t,filter:u}})))):a[u]={enable:s,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}})),a}(u,l,o,t,f,r);return function(n){if(!p())return!1;if(!(n.ev_type in d))return q(n,o);if(!d[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=d[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(F(n,t[r].filter))return!!t[r].hit()&&q(n,t[r].effectiveSampleRate);return!!e.hit()&&q(n,e.effectiveSampleRate)}},z=function(n){n.provide("sendEvent",(function(e){var t=function(n){if(n&&f(n)&&n.name&&h(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&f(n.metrics)){var t=n.metrics,r={};for(var o in t)v(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&f(n.categories)){var i=n.categories,a={};for(var o in i)a[o]=E(i[o]);e.categories=a}return e}}(e);t&&n.report({ev_type:"custom",payload:t,extra:{timestamp:Date.now()}})})),n.provide("sendLog",(function(e){var t=function(n){if(n&&f(n)&&n.content&&h(n.content)){var e={content:E(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&f(n.extra)){var t=n.extra,r={},o={};for(var i in t)v(t[i])?r[i]=t[i]:o[i]=E(t[i]);e.metrics=r,e.categories=o}return e}}(e);t&&n.report({ev_type:"custom",payload:t,extra:{timestamp:Date.now()}})}))},K=["success","fail","complete"];!function(n){n.onLaunch="onLaunch",n.onShow="onShow",n.onHide="onHide",n.onError="onError",n.onPageNotFound="onPageNotFound",n.onUnhandledRejection="onUnhandledRejection"}(M||(M={}));var U=["request","downloadFile","uploadFile"],G=["navigateTo","redirectTo","switchTab","reLaunch"],W=a(a([],i(G),!1),["navigateBack"],!1),J=a(a([],i([M.onLaunch,M.onShow,M.onHide]),!1),[M.onError,M.onPageNotFound,M.onUnhandledRejection],!1),Y=["attached","onInit"],$=["onLoad","onShow","onReady","onUnload","onHide"],Q=function(n){return"[object Object]"===Object.prototype.toString.call(n)};var X=function(){return Date.now()};function Z(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!m(n))return 0;var r=X(),o=r;try{n.apply(this,e)}finally{o=X()}return o-r}var nn,en=function(){},tn=i((nn="tt",[function(){return nn},function(n){return nn=n}]),2),rn=tn[0],on=tn[1],an=function(n,e){function t(t){return e(t),n.call(this,t)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},un=function(n,e,t){var r=n[e];if(!r||!r.__HOOKED__)return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var o=t.apply(this,n);o&&(n=o)}catch(n){j(n)}return r.apply(this,n)}}),n[e]&&(n[e].__HOOKED__=!0),function(){n[e].__HOOKED__=!1,t=en}},cn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:rn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},sn="__slardar__global__0.2.5-alpha.0",fn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},ln=function(n,e){void 0===n&&(n={}),void 0===e&&(e=cn().instance);var t=e?e[sn]||(e[sn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=r(r({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=r({},fn),e&&(e[sn]=t)}}}(r({},fn)),pn=ln.setGlobalValue,dn=ln.mergeGlobalValue,mn=ln.getGlobalValue,vn=function(n,e){Object.keys(e).forEach((function(t){e[t].addTearDown((function(){var e;return dn(n,((e={})[t]=null,e))}))}))},hn=function(n,e){e.addTearDown((function(){return pn(n,null)}))},gn=function(n){return mn("app")[n]},bn=function(n){return mn("page")[n]},yn=function(n){return mn("route")[n]},_n=function(n){return!!mn("route")[n]},wn=function(n,e){void 0===e&&(e=W),e.forEach((function(e){_n(e)&&yn(e).subscribe((function(t){return n(t,e)}))}))},Sn=function(n){return mn("http")[n]},En=function(n){return!!mn("http")[n]},kn=function(){return mn("setData")},xn=function(){return mn("performance")},Pn=function(){return!!mn("performance")},On=function(n){return mn("component")[n]},jn=function(){return mn("instance")},In=function(n){pn("instance",n)};function Cn(n){return"function"==typeof n}function Tn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}function Dn(n){return n}function Rn(n){return function(e){if(function(n){return n&&Cn(n.lift)}(e))return e.lift((function(e){try{return n(e,this)}catch(n){this.error(n)}}));throw new TypeError("Unable to lift unknown Observable type")}}function Nn(n){return 0===n.length?Dn:1===n.length?n[0]:function(e){return n.reduce((function(n,e){return e(n)}),e)}}var Vn=function(n){Cn(n)?n():null==n||n.unsubscribe()},An=function(){function n(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var n=this;if(!this.closed){this.closed=!0;var e=this,t=e._parentage,r=e._finalizers,o=e.initialTeardown;t&&(this._parentage=null,t.forEach((function(e){return e.remove(n)}))),Cn(o)&&o(),r&&(this._finalizers=null,r.forEach(Vn))}},n.prototype.remove=function(e){this._finalizers&&Tn(this._finalizers,e),e instanceof n&&e._removeParent(this)},n.prototype.add=function(e){if(e&&e!==this)if(this.closed)Vn(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}var t=this._finalizers;this._finalizers=t?(t.push(e),t):[e]}},n.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},n.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},n.prototype._removeParent=function(n){this._parentage&&Tn(this._parentage,n)},n}(),Mn=function(n){function e(e){var t,r=n.call(this)||this;return r.isStopped=!1,r.destination=Ln(e)?e:new qn(!(t=e)||Cn(t)?{next:null!=t?t:void 0}:t),r}return t(e,n),e.prototype.next=function(n){this.isStopped||this.destination.next(n)},e.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(An),qn=function(){function n(n){this.partialObserver=n}return n.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},n.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},n.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},n}();function Ln(n){return n instanceof Mn||n&&function(n){return n&&Cn(n.next)&&Cn(n.error)&&Cn(n.complete)}(n)&&function(n){return n instanceof An||n&&"closed"in n&&Cn(n.remove)&&Cn(n.add)&&Cn(n.unsubscribe)}(n)}var Bn=function(){function n(n){n&&(this._subscribe=n)}return n.prototype.subscribe=function(n){var e=Ln(n)?n:new Mn(n),t=this.operator,r=this.source;return e.add(t?t.call(e,r):this._trySubscribe(e)),e},n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.pipe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return Nn(n)(this)},n.prototype._subscribe=function(n){},n.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},n}(),Fn=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var r;return t(e,n),e.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach((function(e){return e.next(n)}))},e.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},e.prototype.error=function(n){var e=this;this.commonJudgement((function(){var t=e.observers;for(e.hasError=!0,e.thrownError=n;t.length;)t.shift().error(n)}))},Object.defineProperty(e.prototype,"observed",{get:function(){return this.observers&&this.observers.length>0},enumerable:!1,configurable:!0}),e.prototype.complete=function(){var n=this;this.commonJudgement((function(){for(var e=n.observers;e.length;)e.shift().complete()}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},e.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._checkFinalizedStatuses=function(n){var e=this,t=e.hasError,r=e.thrownError,o=e.isStopped;t?n.error(r):o&&n.complete()},e.prototype._innerSubscribe=function(n){var t=this.isStopped,r=this.observers;return t?e.EMPTY:(r.push(n),new An((function(){Tn(r,n)})))},e.EMPTY=((r=new An).closed=!0,r),e}(Bn),Hn=new Bn((function(n){return n.complete()}));function zn(n){return n<=0?function(){return Hn}:Rn((function(e,t){var r=0;e.subscribe((function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))}))}function Kn(n,e){return Rn((function(t,r){var o=0;t.subscribe((function(t){return n.call(e,t,o++)&&r.next(t)}))}))}function Un(n){return Kn((function(e,t){return n<=t}))}var Gn,Wn=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.tearDownFns=[],e}return t(e,n),e.prototype.subscribe=function(e){var t=this,r=n.prototype.subscribe.call(this,e),o=function(){t.observed||t.unsubscribe()};jn()&&jn()._subscriptions.push(r);var i=r.unsubscribe;return r.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i.apply(this,n),o()},r},e.prototype.unsubscribe=function(){n.prototype.unsubscribe.call(this),this.tearDownFns.forEach((function(n){return n()}))},e.prototype.addTearDown=function(n){this.tearDownFns.push(n)},e}(Fn),Jn=function(n){var e=n.reduce((function(n,e){return n[e]=new Wn,n}),{});return{getSubject:function(n){return e[n]},subjectMap:e}},Yn=function(n){return n.length>1?n:n.length&&n[0]||{}},$n=function(n){var e=n.filter((function(n){return e=n,!mn("app")[e];var e}));!function(n){dn("app",n),vn("app",n)}(Jn(e).subjectMap),App=an(App,(function(n){e.forEach((function(e){var t=gn(e),r=x(n,e,(function(n){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.next({that:this,param:Yn(e),time:X()}),m(n)&&n.apply(this,e)}}))();r&&t.addTearDown(r)}))}))},Qn=i((Gn={},[function(n){if(!cn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;var e=n.find((function(n){return n.platform===cn().platform}));return e&&(Gn=e.adapterCtor())},function(){return Gn}]),2),Xn=Qn[0],Zn=Qn[1],ne=function(n){return"SLARDAR"+n},ee=function(n){return n.route||n.__route__||n.url||n.path||""},te=function(n){return void 0===n&&(n=cn().instance),{instance:n,request:function(e){return n.request(e)},getStorage:function(e){return n.getStorageSync(e)},setStorage:function(e,t){return n.setStorageSync(e,t)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){n.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),n.onNetworkStatusChange((function(n){e&&e({networkType:n.networkType})}))},performanceSubscriber:c,getSystemInfo:c,buildRequestProfile:c,componentSubject:c,setDataSubject:c,pagePerfSubscriber:c}},re=function(n){var e=["attached"],t=n.filter((function(n){return~e.indexOf(n)})),r=function(n,e){t.forEach((function(t){x(n,t,(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];On(t).next({that:this,param:null,time:X()});var i=e[t];if(m(i)&&i.apply(this,r),m(n))return n.apply(this,r)}}))()}))};try{Component=an(Component,(function(n){f(n.lifetimes)?r(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},r(n.lifetimes,n))}))}catch(n){}},oe=function(n){var e={},t=null,o=function(){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0},i=function(){e.navigate_start&&(n(r({},e)),e.navigate_name="",e.navigate_start=0,t=!0)};wn((function(n,r){"invoke"===n.param.name&&(t=!1,e={navigate_start:n.time,navigate_name:r})}),G),bn("onLoad").pipe(Un(1)).subscribe((function(n){e.load_start=n.time})),bn("onShow").pipe(Un(1)).subscribe((function(n){e.dom_end=n.time})),bn("onReady").pipe(Un(1)).subscribe((function(n){e.render_end=n.time,o(),i()})),gn(M.onHide).subscribe((function(){!1===t&&(o(),i())}))},ie=function(n){var e=["downloadPackage","evaluateScript","fcp","fp","fr"];xn().subscribe((function(t){~e.indexOf(t.name)&&n(t)}))},ae=function(n){On("attached").subscribe((function(e){var t=e.that;return n.call(t)}))},ue=function(n){return"android"===n.toLowerCase()},ce=["darwin","macs","mac"],se=["windows_nt","windows","window"],fe=function(n){return ue(n)?"Android":function(n){return"ios"===n.toLowerCase()}(n)?"iOS":function(n){return~ce.indexOf(n.toLowerCase())}(n)?"Mac":function(n){return~se.indexOf(n.toLowerCase())}(n)?"windows":"unknown"},le=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,o=n.height;return e&&ue(e)&&t?r/t+" * "+o/t:r+" * "+o},pe=function(n){return function(n){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&void 0!==n[t]&&null!==n[t]&&(e[t]=n[t]);return e}({domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,secureConnectionStart:n.SSLconnectionStart,connectEnd:n.connectEnd,requestStart:n.requestStart,requestEnd:n.requestEnd,responseStart:n.responseStart,responseEnd:n.responseEnd,socketReused:n.socketReused,redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,sendBytesCount:n.sendBytesCount,throughputKbps:n.throughputKbps,receivedBytedCount:n.receivedBytedCount})},de=function(n){return{name:"unknown_error_name",message:E(n)}},me=function(){var n=wx.getAccountInfoSync().miniProgram,e=wx.getSystemInfoSync(),t=e.model,r=e.brand,o=e.pixelRatio,i=e.screenHeight,a=e.screenWidth,u=e.windowHeight,c=e.windowWidth,s=e.language,f=e.version,l=e.system,p=e.platform,d=e.SDKVersion;return{model:t,brand:r,pixelRatio:o,screenArea:le({width:a,height:i}),windowArea:le({width:c,height:u}),language:s,osName:fe(p),osVersion:l,SDKVersion:d,appId:n.appId,miniEnv:n.envVersion,miniVersion:n.version,hostName:"wx",hostVersion:f,platform:"wx"}},ve=function(n){switch(n){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return n}},he={platform:"wx",adapterCtor:function(){return r(r({},te()),{miniPlatform:"wx",buildError:function(n){return h(n)?function(n){var e=n.split("\n");return{name:i((e[2]&&e[2].split(":")||[]).map((function(n){return n.trim()})),1)[0],message:e&&e[1]&&e[1].trim(),stack:e.slice(2).join("\n")}}(n):de(n)},getSystemInfo:me,observePerformance:function(n){var e=wx.getPerformance&&wx.getPerformance();if(e){var t=e.createObserver((function(e){var t=e.getEntries().map((function(n){return r(r({},n),{name:ve(n.name)})}));n(t)}));return t.observe({entryTypes:t.supportedEntryTypes}),t}},performanceSubscriber:ie,buildRequestProfile:function(n){return function(n){var e=pe(n);return n.protocol&&(e.protocol=n.protocol),e}(n)},componentSubject:re,pagePerfSubscriber:oe,setDataSubject:ae})}},ge=function(n){return h(n)?function(n){var e=n.split("\n"),t=i((e[0]&&e[0].split(":")||[]).map((function(n){return n.trim()})),2);return{name:t[0],message:t[1],stack:n}}(n):de(n)},be=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,d=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:le({width:i,height:o}),windowArea:le({width:u,height:a}),language:c,osName:fe(l),osVersion:f,SDKVersion:p,hostName:d,hostVersion:s}},ye=function(n){void 0===n&&(n="tt");var e="",t="",o="";if(tt.getEnvInfoSync){var i=tt.getEnvInfoSync().microapp;t=i.envType,e=i.appId,o=i.mpVersion}else t=tt.env.VERSION,e="";return r({appId:e,miniEnv:t,miniVersion:o,platform:n},be())},_e=function(n){var e=bn("onReady").subscribe((function(){if(tt.performance){var e=(tt.performance.getCurrentPageEntries()||[]).map((function(n){n.name,n.entryType;var e=o(n,["name","entryType"]),t=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}}(n);return t?r(r({},e),t):n}));n(e)}}));return{disconnect:function(){return e.unsubscribe()}}},we={platform:"tt",adapterCtor:function(){return r(r({},te()),{miniPlatform:"tt",buildError:function(n){return ge(n)},getSystemInfo:ye,observePerformance:_e,performanceSubscriber:ie,buildRequestProfile:function(n){return function(n){return pe(n)}(n)},componentSubject:re,pagePerfSubscriber:oe,setDataSubject:ae})}},Se=function(){var n="",e="",t="";if(my.getAccountInfoSync){var r=my.getAccountInfoSync().miniProgram;e=r.envVersion,n=r.appId,t=r.version}else n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}});var o=my.getSystemInfoSync(),i=o.model,a=o.brand,u=o.pixelRatio,c=o.screenHeight,s=o.screenWidth,f=o.windowHeight,l=o.windowWidth,p=o.language,d=o.version,m=o.system,v=o.platform,h=o.app;return{model:i,brand:a,pixelRatio:u,screenArea:le({pixelRatio:u,width:s,height:c,systemPlatform:v}),windowArea:le({width:l,height:f}),language:p,osName:fe(v),osVersion:m,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:h,hostVersion:d,platform:"my"}},Ee={platform:"my",adapterCtor:function(){return r(r({},te()),{miniPlatform:"my",buildError:function(n){return d(n)?function(n,e){var t={message:n};if(e){t.stack=e;var r=e.split("\n"),o=i(r[0]&&r[0].split(":"),1)[0];o&&(t.name=o)}return t}(n[0],n[1]):de(n)},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:Se,componentSubject:function(n){var e=["onInit"],t=n.filter((function(n){return~e.indexOf(n)})),r=function(n){t.forEach((function(e){x(n,e,(function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(On(e).next({that:this,param:null,time:X()}),m(n))return n.apply(this,t)}}))()}))};Component=an(Component,(function(n){f(n)?r(n):null==n&&r(n={})}))},setDataSubject:function(n){On("onInit").subscribe((function(e){var t=e.that;return n.call(t)}))},pagePerfSubscriber:oe})}},ke=function(n){return n&&function(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return!0;default:return n instanceof Error}}(n)?{name:n.name,message:n.message,stack:n.stack}:de(n)},xe=function(){var n="",e="";if(swan.getEnvInfoSync){var t=swan.getEnvInfoSync();e=t.env,n=t.appKey}var r=swan.getSystemInfoSync(),o=r.model,i=r.brand,a=r.pixelRatio,u=r.screenHeight,c=r.screenWidth,s=r.windowHeight,f=r.windowWidth,l=r.language,p=r.version,d=r.system,m=r.platform,v=r.SDKVersion,h=r.host;return{model:o,brand:i,pixelRatio:a,screenArea:le({width:c,height:u}),windowArea:le({width:f,height:s}),language:l,osName:fe(m),osVersion:d,SDKVersion:v,appId:n,miniEnv:e,miniVersion:"",hostName:h,hostVersion:p,platform:"swan"}},Pe={platform:"swan",adapterCtor:function(){return r(r({},te()),{miniPlatform:"swan",buildError:function(n){return ke(n)},getSystemInfo:xe,componentSubject:re,setDataSubject:ae,pagePerfSubscriber:function(n){var e={},t={},o=!1,i=!0,a=function(e){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0,e.navigate_start&&0!==e.load_start&&(n(r({},e)),e.load_start=0,o=!0)};wn((function(n,r){"invoke"===n.param.name&&(o=!1,e={navigate_start:n.time,navigate_name:r},t={navigate_start:n.time,navigate_name:r})})),bn("onLoad").pipe(Un(1)).subscribe((function(n){n.that.componentName?t.dom_end=n.time:e.load_start=n.time})),bn("onShow").pipe(Un(1)).subscribe((function(n){n.that.componentName?(t.load_start=n.time,e.load_start=0):e.dom_end=n.time})),bn("onReady").pipe(Un(1)).subscribe((function(n){if(n.that.componentName){if(i)return void(i=!1);t.render_end=n.time,a(t)}else e.render_end=n.time,a(e),i=!1})),gn(M.onHide).subscribe((function(){o||(a(e),a(t))}))}})}},Oe=function(){return r({appId:"",miniEnv:"",miniVersion:"",platform:"lark"},be())},je={platform:"lark",adapterCtor:function(){return r(r({},te()),{miniPlatform:"lark",buildError:ge,getSystemInfo:Oe,componentSubject:re,pagePerfSubscriber:oe,setDataSubject:ae})}},Ie={platform:"mars",adapterCtor:function(){return r(r({},te()),{miniPlatform:"mars",buildError:ge,getSystemInfo:ye.bind(null,"mars"),observePerformance:_e,performanceSubscriber:ie,componentSubject:re,pagePerfSubscriber:oe,setDataSubject:ae})}},Ce=function(n){var e=n.filter((function(n){return e=n,!mn("component")[e];var e}));!function(n){dn("component",n),vn("component",n)}(Jn(e).subjectMap),Zn().componentSubject(e)},Te=function(n,e){var t=n.filter((function(n){return e=n,!mn("page")[e];var e}));!function(n){dn("page",n),vn("page",n)}(Jn(t).subjectMap);var r=function(n){t.forEach((function(e){var t=bn(e),r=x(n,e,(function(n){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(ee(this)&&t.next({that:this,param:Yn(e),time:X()}),m(n))return n.apply(this,e)}}))();r&&t.addTearDown(r)}))};!function(n){Page=an(Page,n)}(r),function(n){var e=function(e){Q(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))};try{Component=an(Component,e),Behavior=an(Behavior,e)}catch(n){}}(r)},De=function(n){var e=n.filter((function(n){return!_n(n)})),t=Jn(e).subjectMap;!function(n){dn("route",n),vn("route",n)}(t),e.forEach((function(n){var e=un(Zn().instance,n,(function(e){void 0===e&&(e={}),yn(n).next({that:this,param:{url:e.url,delta:e.delta,name:"invoke",value:{errMsg:"invoke"}},time:X()}),K.forEach((function(t){x(e,t,(function(r){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];yn(n).next({that:this,param:{url:e.url,delta:e.delta,name:t,value:Yn(o)||{}},time:X()}),m(r)&&r.apply(this,o)}}))()}))}));e&&t[n].addTearDown(e)}))},Re=function(n,e){return"uploadFile"===n?"POST":"downloadFile"===n?"GET":e||"GET"},Ne=function(n,e){void 0===e&&(e=Zn().instance);var t=n.filter((function(n){return!En(n)})),r=Jn(t).subjectMap;!function(n){dn("http",n),vn("http",n)}(r),t.forEach((function(n){var t=un(e,n,(function(e){!function(n,e){var t=e.url,r=e.method,o=e.data,i=e.header,a=e.headers,u={api:n,request:{url:t,method:Re(n,r),headers:i||a||{},body:E(o),timestamp:X()},response:{}};x(e,"complete",(function(e){return function(t){var r=u.response.timestamp||X();u.duration=r-u.request.timestamp,u.completeCallbackTime=Z(e,t);var o,i,a,c=t.errMsg||t.errorMessage||t.error;u.response={status:(o=t.status,i=t.statusCode,a=u.response.status,o>=0?o:i>=0?i:a),timestamp:r,headers:t.header||t.headers||{},body:E(t.data),errMsg:c,timing:Zn().buildRequestProfile(t.profile||{})},Sn(n).next(u)}}))(),x(e,"success",(function(n){return function(e){u.response.timestamp=X(),u.response.status=200,u.successCallbackTime=Z(n,e)}}))(),x(e,"fail",(function(n){return function(e){u.response.timestamp=X(),u.response.status=-1,u.failCallbackTime=Z(n,e)}}))()}(n,e)}));t&&r[n].addTearDown(t)}))};function Ve(){var n=ee(this),e=kn();var t=un(this,"setData",(function(){for(var t=this,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=r[0],a=X(),u=function(){var o=r[1],u=X()-a;e.next({renderTime:u,url:n,data:i,startTime:a}),o&&o.call(t)};return[i,u]}));t&&e.addTearDown(t)}var Ae=function(){if(!mn("setData")){var n,e=Jn(["setData"]).getSubject;n=e("setData"),pn("setData",n),hn("setData",n)}},Me=function(n){n.on("init",(function(){var n=Zn();if(n.observePerformance&&!Pn()){var e=(0,Jn(["performance"]).getSubject)("performance");!function(n){pn("performance",n),hn("performance",n)}(e);var t=n.observePerformance((function(n){n.forEach((function(n){e.next(n)}))}));t&&t.disconnect&&e.addTearDown((function(){return t.disconnect()}))}}))},qe=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Le=new RegExp("(bearer|session)","i"),Be=function(n){return Object.keys(n).reduce((function(e,t){var r,o;return r=t,o=n[t],r&&o&&(qe.test(r)||Le.test(o))||(e[t]=n[t]),e}),{})},Fe=function(){return function(n,e){var t=n.hookRequest,i=n.hookDownloadFile,a=n.hookUploadFile,u=n.ignoreUrls,c=n.collectBodyOnError,s=n.extraExtractor,f=function(n){if(t=u,i=n.request.url,!(a=S(t||[]))||!a.test(i)){var t,i,a,f=n.response,l=n.request,p=n.api,d=n.duration,v=n.failCallbackTime,h=n.successCallbackTime,g=n.completeCallbackTime;l.headers=Be(l.headers||{}),f.headers=Be(f.headers||{});var b=f.errMsg,y=o(f,["errMsg"]),_=r(r({},y),{is_custom_error:!1});b&&(_.err_msg=b);var w,E={api:p,request:l,duration:d,cbTime:g+(v||0)+(h||0),response:_};if(m(s)){var k=s(f.body,E);k&&(E.extra=k,E.response.is_custom_error=!0)}c&&(0===(w=f.status)||w>=400)||(delete E.request.body,delete E.response.body),e({ev_type:"http",payload:E})}};t&&Sn("request").subscribe(f),i&&Sn("downloadFile").subscribe(f),a&&Sn("uploadFile").subscribe(f)}},He=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,a([],i(r),!1));return o&&o(e,t)||[]}catch(n){return j("applyMonitor",n),[]}};function ze(n,e,t){var o;In(n);var i=null===(o=n.config())||void 0===o?void 0:o.plugins[e];return f(i)?r(r({},t),i):!!i&&t}var Ke,Ue={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Ge=function(n){n.on("init",(function(){var e=ze(n,"http",Ue);if(e){var t=e.hookRequest,r=e.hookDownloadFile,o=e.hookUploadFile,i=[];t&&i.push("request"),r&&i.push("downloadFile"),o&&i.push("uploadFile"),function(n,e){void 0===e&&(e=U),n.on("init",(function(){Ne(e)}))}(n,i),He(Fe,e,n.report.bind(n))}}))},We=function(n,e){return n&&e&&n===e},Je=function(){var n;return function(e){try{if(function(n,e){return!(!n||!e||!We(n.message,e.message)&&!We(n.stack,e.stack))}(e,n))return void(n=e)}catch(n){}return n=e,e}},Ye=function(n){return void 0===n&&(n=Zn()),function(e,t){var r=e.ignoreErrors,o=e.hookOnError,i=e.hookOnUnhandledRejection,a=e.hookRouteError,u=e.dedupe,c=S(r),f=Je(),l=function(n,e,r){var o=u?f(n):n;if(o){if(c&&c.test(o.message))return;var i={error:o};e&&(i.extra=e),r&&(i.react=r),t(i)}};o&&gn(M.onError).subscribe((function(e){var t=e.param,r=n.buildError(t);c&&c.test(r.message)||l(r)})),i&&gn(M.onUnhandledRejection).subscribe((function(n){var e=n.param||{},t=e.promise,r=E(e.reason);c&&c.test(r)||t.catch(s).then((function(n){var e={name:"UnhandledRejection",message:r};n&&n.stack&&(e.stack=n.stack),l(e)}))}));if(a&&~["tt","wx","lark"].indexOf(n.miniPlatform)){wn((function(n){return function(n){"fail"===n.name&&l({name:"RouteError",message:n.value.errMsg})}(n.param)}))}return[l]}};!function(n){n.history="history",n.manual="manual"}(Ke||(Ke={}));var $e=function(){return function(n,e){var t=n.extractPid,r=n.routeMode,o=n.setPidAndViewId,a=i(function(n,e,t){var r=e,o=null,i=0,a="launch";gn(M.onShow).pipe(Un(1)).subscribe((function(){a="show"})),wn((function(){a="history"}));var u=function(e,a){r=a,i=X(),t(a,o=a+"_"+i),n(e,a)};return[u,function(n){n&&(u(a,n),a="history")},function(e){void 0===e&&(e="hide"),o&&(t(r,o),o=null,n(e,r,X()-i))}]}((function(n,t,r){!function(n,t,r){e({ev_type:"pageview",payload:{pid:t,source:n,duration:r}})}(n,t,r)}),"",o),3),u=a[0],c=a[1],s=a[2];if(r!==Ke.manual){var f=function(n){var e,r=ee(n),o=(e=r,t?t(e):e);c(o)};bn("onShow").subscribe((function(n){var e=n.that;return f(e)})),bn("onUnload").subscribe(s.bind(null,"unload")),bn("onHide").subscribe(s.bind(null,"hide"))}return[u.bind(null,"user_set"),s]}},Qe=function(){return function(n){var e=i(function(n,e,t){void 0===n&&(n=20),void 0===e&&(e=s),void 0===t&&(t=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(u){if(e(u)){var c=r(r({},u),{timestamp:u.timestamp||Date.now()});o=n>=0&&o.length+1>n?t(a(a([],i(o),!1),[c],!1),n):a(a([],i(o),!1),[c],!1)}}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),t=e[0],o=e[1];return U.forEach((function(n){En(n)&&Sn(n).subscribe((function(n){o({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})}))})),wn((function(n,e){var t=n.param,r=n.time;"complete"===t.name&&o({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:r,data:{url:t.url||""}})})),[t,o]}},Xe=function(){return function(n,e){var t=n.isCalculateSize;kn().subscribe((function(n){var r,o={duration:n.renderTime,start_time:n.startTime};t&&(o.size=(r=n.data,TextEncoder?(new TextEncoder).encode(E(r)).length:2*E(r).length)),e({ev_type:"set_data",payload:o})}))}},Ze=function(){return function(n,e){var t={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},r=!1,o=function(){e({ev_type:"app_launch_perf",payload:t}),r=!0};gn(M.onLaunch).pipe(zn(1)).subscribe((function(n){t.activate_start=n.time})),gn(M.onShow).pipe(zn(1)).subscribe((function(n){t.init_end=n.time})),bn("onLoad").pipe(zn(1)).subscribe((function(n){t.page_load_start=n.time})),bn("onShow").pipe(zn(1)).subscribe((function(n){t.page_dom_end=n.time}));var i=Pn();bn("onReady").pipe(zn(1)).subscribe((function(n){t.page_render_end=n.time,i&&!t.trigger||o()})),i&&xn().pipe(Kn((function(n){return"appClick"===n.name})),zn(1)).subscribe((function(n){t.trigger=n.startTime,t.page_render_end&&o()})),gn(M.onHide).subscribe((function(){r||o()}))}},nt=function(){return function(n,e){Zn().pagePerfSubscriber((function(n){return e({ev_type:"page_perf",payload:n})}))}},et=function(n){return void 0===n&&(n=Zn()),function(e,t){if(Pn()&&n.performanceSubscriber){var r,o=0;bn("onLoad").subscribe((function(n){r=n.time,o++}));n.performanceSubscriber((function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:o};e.duration=n.duration||(r?n.startTime-r:0),e.is_support=e.duration>=0,t({ev_type:"performance",payload:e})}))}}},rt={routeMode:Ke.history,setPidAndViewId:function(n,e){}},ot=function(n){return n.on("init",(function(){var e=ze(n,"pageview",rt);if(e){var t=i(He($e,r(r({},e),{setPidAndViewId:function(e,t){n.set({pid:e,viewId:t,actionId:void 0})}}),n.report.bind(n)),2),o=t[0],a=t[1];n.provide("sendPageview",o),n.provide("sendPageviewWithHide",a)}})),n},it={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},at=function(n){n.on("init",(function(){var e=ze(n,"jsError",it);if(e){var t=function(n){return function(e){var t=n.getBreadcrumbs&&n.getBreadcrumbs()||[];n.report({ev_type:"js_error",payload:r(r({},e),{breadcrumbs:t})})}}(n),o=i(He(Ye,e,t),1)[0];n.provide("captureException",o)}}))},ut={maxBreadcrumbs:20,tap:!0},ct=function(n){n.on("init",(function(){var e=ze(n,"breadcrumb",ut);if(e){var t=i(He(Qe,e,(function(n){})),2),r=t[0],o=t[1];n.provide("getBreadcrumbs",r),n.provide("addBreadcrumb",o)}}))},st=function(n){n.on("init",(function(){n.provide("_subscriptions",[]),In(n),function(n){n.on("init",(function(){$n(J),Te($),Ce(Y)}))}(n),function(n){n.on("init",(function(){De(W)}))}(n)})),n.on("beforeDestroy",(function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]}))},ft={isCalculateSize:!1},lt=function(n){n.on("init",(function(){var e=ze(n,"setData",ft);e&&(!function(n){n.on("init",(function(){Ae(),bn("onLoad").subscribe((function(n){var e=n.that;Ve.call(e)})),Zn().setDataSubject(Ve)}))}(n),He(Xe,e,n.report.bind(n)))}))},pt={},dt=function(n){n.on("init",(function(){var e=ze(n,"appLaunchPerf",pt);e&&(Me(n),He(Ze,e,n.report.bind(n)))}))},mt={},vt=function(n){n.on("init",(function(){var e=ze(n,"pagePerf",mt);e&&He(nt,e,n.report.bind(n))}))},ht={},gt=function(n){n.on("init",(function(){var e=ze(n,"performance",ht);e&&(Me(n),He(et,e,n.report.bind(n)))}))},bt=function(n,e,t){void 0===t&&(t=Zn());var r,o=e.url,i=e.data,a=e.success,u=void 0===a?c:a,s=e.fail,f=void 0===s?c:s,l=e.header,p={"Content-Type":"application/json"};Q(r=l)&&0!==Object.keys(r).length&&Object.assign(p,l),t.request({method:n,url:o,data:i,header:p,headers:p,success:function(n){u(n)},fail:function(n){var e=n.errMsg||"Network request failed";f(new Error(e))}})},yt=function(n){return void 0===n&&(n=Zn()),n?{get:function(e){return bt("GET",e,n)},post:function(e){return bt("POST",e,n)}}:{get:c,post:c}};var _t=function(n){return{name:"FrameworksAdapterIntegration",setup:function(e){var t=n.Taro;t&&"my"===Zn().miniPlatform&&e.on("init",(function(){Ne(["request"],t)}))}}},wt=function(){return{name:"AppLaunchPerfIntegration",setup:function(n){dt(n)}}},St=function(){return{name:"BreadcrumbIntegration",setup:function(n){ct(n)}}},Et=function(){return{name:"CustomIntegration",setup:function(n){z(n)}}},kt=function(){return{name:"HttpIntegration",setup:function(n){Ge(n)}}},xt=function(){return{name:"JsErrorIntegration",setup:function(n){at(n)}}},Pt=function(){return{name:"PagePerfIntegration",setup:function(n){vt(n)}}},Ot=function(){return{name:"PageviewIntegration",setup:function(n){ot(n)}}},jt=function(){return{name:"PerformanceIntegration",setup:function(n){gt(n)}}},It=function(){return{name:"SetDataIntegration",setup:function(n){lt(n)}}},Ct={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:r(r({},n.extra||{}),n.overrides||{})}}},Tt={sample_rate:1,include_users:[],sample_granularity:"session",rules:{}},Dt=["/monitor_mini/collect","/settings/minipro"],Rt=function(n,e){return void 0===e&&(e="/settings/minipro"),(n&&n.indexOf("//")>=0?"":"https://")+n+e},Nt=function(n){var e=function(n){try{return Zn().getStorage(n)}catch(n){return}}(ne(String(n)));return e&&e.userId&&e.deviceId?e:{userId:N(),deviceId:N()}},Vt=function(n){var e=n.aid,t=n.userId,r=n.deviceId;!function(n,e){try{Zn().setStorage(n,e)}catch(n){}}(ne(String(e)),{userId:t,deviceId:r})};function At(n){var e,t=Nt(n.aid);return{aid:0,token:"",pid:"",viewId:(e="_",e+"_"+Date.now()),userId:t.userId,deviceId:t.deviceId,sessionId:N(),domain:"apmplus.volces.com",plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Dt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Tt,sdkName:"APM_PLUS_MINI_PROGRAM",sdkVersion:"0.2.5-alpha.0"}}function Mt(n){var e=n.plugins||{};for(var t in e)e[t]&&!f(e[t])&&(e[t]={});return r(r({},n),{plugins:e})}function qt(n){return f(n)&&"aid"in n&&"token"in n}function Lt(n){return r({},n)}var Bt=function(n){var e,t,o=n,i={},a=void 0,u=c,s=c;return{getConfig:function(){return o},setConfig:function(n){var c,s,p;return i=r(r({},i),n||{}),f(),e||(e=n,o.useLocalConfig||!o.aid?(t={},u()):a?l():(c=o.domain,s=o.aid,p=function(n){a=n,l()},yt().get({url:Rt(c)+"?biz_id="+s,success:function(n){p(n&&n.data&&n.data.data||{})},fail:function(){p({sample:{sample_rate:.001}})}}))),o},onChange:function(n){s=n},onReady:function(n){u=function(){Vt(o),n()},t&&u()}};function f(){var e=r(r(r({},n),t||{}),i);e.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=b(t,n[r++]);return t}(n.plugins,(null==t?void 0:t.plugins)||{},i.plugins||{}),e.sample=Ft(Ft(n.sample,null==t?void 0:t.sample),i.sample),o=e,s()}function l(){var e,i;t=function(n){if(!n)return{};var e=n.sample,t=n.user_id,o=n.timestamp,i=t?{userId:t}:{};if(!e)return i;var a=e.sample_rate,u=e.sample_granularity,c=void 0===u?"session":u,s=e.include_users,f=e.rules,l=void 0===f?[]:f;return r(r({},i),{sample:{include_users:s,sample_rate:a,sample_granularity:c,rules:l.reduce((function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,i=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:i},n}),{})},serverTimestamp:o})}(a),e=String(o.aid),i=ne(e),Zn().getStorage(i)&&(t.userId=n.userId),f(),u()}};function Ft(n,e){if(!n||!e)return n||e;var t=r(r({},n),e);return t.include_users=a(a([],i(n.include_users||[]),!1),i(e.include_users||[]),!1),t.rules=a(a([],i(Object.keys(n.rules||{})),!1),i(Object.keys(e.rules||{})),!1).reduce((function(t,o){var u,c;return o in t||(o in(n.rules||{})&&o in(e.rules||{})?(t[o]=r(r({},n.rules[o]),e.rules[o]),t[o].conditional_sample_rules=a(a([],i(n.rules[o].conditional_sample_rules||[]),!1),i(e.rules[o].conditional_sample_rules||[]),!1)):t[o]=(null===(u=n.rules)||void 0===u?void 0:u[o])||(null===(c=e.rules)||void 0===c?void 0:c[o])),t}),{}),t}var Ht=function(n){var e=!1,t=function(n){var e="";return function(){var t=n.getSender();e||(e=t.getEndpoint());var r=n.config(),o={did:r.deviceId,sid:r.sessionId,sname:r.sdkName,sver:r.sdkVersion,soffset:r.offset||0,model:r.model,brand:r.brand,ratio:r.pixelRatio,screen:r.screenArea,window:r.windowArea,lang:r.language,osname:r.osName,osver:r.osVersion,libver:r.SDKVersion,scene:r.scene||-1,menv:r.miniEnv,mver:r.miniVersion,hostname:r.hostName,hostver:r.hostVersion,platform:r.platform,biz_id:r.aid,x_auth_token:r.token};t.setEndpoint(e+k(o))}}(n),o=function(e){return void 0===e&&(e=Zn().getSystemInfo()),n.set(r({},e))},i=function(){o(),t()};n.on("start",(function(){i(),e=!0})),n.on("init",(function(){gn(M.onLaunch).pipe(zn(1)).subscribe((function(n){var t=n.param.scene||-1;o({scene:t}),e&&i()})),Zn().monitorNetworkType((function(e){var t=e.networkType;n.set({networkType:t})}))}))},zt=function(n){n.on("beforeBuild",(function(e){return function(n,e){var t,o={};return o.aid=e.aid,o.pid=e.pid,o.view_id=e.viewId,o.user_id=e.userId,o.network_type=e.networkType,r(r({},n),{extra:r(r({},o),null!==(t=n.extra)&&void 0!==t?t:{})})}(e,n.config())}))},Kt=function(n){n.on("report",(function(n){return function(n){var e,t,o={url:(t=Zn().getCurrentPages().pop(),t?(t?ee(t):"")+k(t.options):""),timestamp:X()};return r(r({},n),{extra:r(r({},o),null!==(e=n.extra)&&void 0!==e?e:{})})}(n)}))},Ut=function(e){if(!Xn(e))throw Error("Adapters imported incorrectly");var t=V({validateInitConfig:qt,initConfigNormalizer:Mt,userConfigNormalizer:Lt,createSender:function(e){return function(e){return n(e)}({size:20,endpoint:(t=e.domain,void 0===r&&(r="/monitor_mini/collect"),(t&&t.indexOf("//")>=0?"":"https://")+t+r),transport:yt()});var t,r},builder:Ct,createDefaultConfig:At,createConfigManager:Bt});return A(t),function(n){var e,t=!1;n.on("init",(function(){e=X(),n.on("config",(function(){var r,o=null===(r=n.config())||void 0===r?void 0:r.serverTimestamp;if(!(isNaN(o)||Number(o)<=0||t)){t=!0;var i=X();if(i-e<1e3&&o){var a=o-(i+e)/2;!isNaN(a)&&n.set({offset:a})}}}))}))}(t),zt(t),Kt(t),function(n){n.on("start",(function(){var e=n.config(),t=e.userId,r=e.sample,o=H(t,r,T,D);n.on("build",o)}))}(t),st(t),function(n,e){n.on("init",(function(){var t=[],r=function(r){r.forEach((function(r){var o=r.name;_(t,o)||(t.push(o),r.setup(n),e&&e(o,r.setup),n.destroyAgent.set(o,o,[function(){t=w(t,o),r.tearDown&&r.tearDown()}]))}))};n.provide("applyIntegrations",r);var o=n.config();o&&o.integrations&&r(o.integrations)}))}(t),function(n){n.on("init",(function(){gn(M.onHide).subscribe((function(){var e=n.getSender();e&&e.flush()}))}))}(t),Ht(t),t},Gt=function(n){var e=Ut(n);if(e)return z(e),ot(e),at(e),Ge(e),lt(e),ct(e),dt(e),vt(e),gt(e),e};export{wt as AppLaunchPerfIntegration,St as BreadcrumbIntegration,Et as CustomIntegration,_t as FrameworksAdapterIntegration,kt as HttpIntegration,xt as JsErrorIntegration,je as LarkAdapter,Ie as MarsAdapter,Ee as MyAdapter,Pt as PagePerfIntegration,Ot as PageviewIntegration,jt as PerformanceIntegration,It as SetDataIntegration,Pe as SwanAdapter,we as TtAdapter,he as WxAdapter,Ut as createBaseMiniProgramClient,Gt as createMiniProgramClient,on as setPlatform}; |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).larkClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,u=void 0===n?1e3:n,a=[],c=0;function s(){var e;a.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){a.push(n),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(n=a,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),a=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function u(n){return"[object Array]"===t.toString.call(n)}function h(n){return"function"==typeof n}function a(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):u(e[t])&&u(n[t])?o[t]=function e(n,t){n=u(n)?n:[];t=u(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):u(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!u(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function x(n,e){if(!u(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function m(n){return u(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function v(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function k(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),(""+C++).padStart(8," ")],y(n),!1))}function o(n){return Math.random()<Number(n)}function f(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){T(n)}return e}}var g=function(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(n),!1)),o=r;return h(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return h(t)&&t.apply(this,e)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=t:r=t)}}},j=0,T=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),(""+j++).padStart(8," ")],y(n),!1))},C=0;function P(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function D(){function t(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){r[n]&&r[n].forEach(function(n){t(n[1])}),r[n]=void 0}var r={};return{set:function(n,e,t){r[n]?r[n].push([e,t]):r[n]=[[e,t]]},remove:e,removeByEvType:function(e){Object.keys(r).forEach(function(n){r[n]&&r[n].forEach(function(n){n[0]===e&&t(n[1])})})},clear:function(){Object.keys(r).forEach(function(n){e(n)})}}}var I=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=v(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=v(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function R(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function M(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function N(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":a(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function A(e,n){try{return"rule"===n.type?N(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return A(e,n)}):n.children.some(function(n){return A(e,n)})}catch(n){return!1}}function F(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,u=e.sample_granularity,a=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return R(n,1)};var c,s,f,l,p,d,h,m=M(u="session"===u,o,t,e,r),v=(c=a,s=u,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:M(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!m())return!1;if(!(n.ev_type in v))return R(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(A(n,t[r].filter))return!!t[r].hit()&&R(n,t[r].effectiveSampleRate);return!!e.hit()&&R(n,e.effectiveSampleRate)}}var q,z=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=F(e,n,o,f);t.on("build",n)})},L="custom",B=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=v(i[o]);e.categories=u}return e}},V=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:v(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=v(r[t]);e.metrics=o,e.categories=i}return e}},U="Adapters imported incorrectly",H=["success","fail","complete"],G=20;(En=q=q||{}).onLaunch="onLaunch",En.onShow="onShow",En.onHide="onHide",En.onError="onError",En.onPageNotFound="onPageNotFound",En.onUnhandledRejection="onUnhandledRejection";function K(n){return"[object Object]"===Object.prototype.toString.call(n)}var J=["request","downloadFile","uploadFile"],W=["navigateTo","redirectTo","switchTab","reLaunch"],Y=_(_([],y(W),!1),["navigateBack"],!1),$=_(_([],y([q.onLaunch,q.onShow,q.onHide]),!1),[q.onError,q.onPageNotFound,q.onUnhandledRejection],!1),Q=["attached","onInit"],X=["onLoad","onShow","onReady","onUnload","onHide"],Z="__HOOKED__";var nn=function(){return Date.now()};function en(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!h(n))return 0;var r,o=nn();try{n.apply(this,e)}finally{r=nn()}return r-o}function tn(n,e,r){var o=n[e];if(!o||!o[Z])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){T(n)}return o.apply(this,n)}}),n[e]&&(n[e][Z]=!0),function(){n[e][Z]=!1,r=mn}}function rn(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return kn(t,((n={})[e]=null,n))})})}function on(n,e){e.addTearDown(function(){return xn(n,null)})}function un(n){return On("route")[n]}function an(n){return!!On("route")[n]}function cn(n){return On("http")[n]}function sn(n){return!!On("http")[n]}function fn(){return On("setData")}function ln(){return!!On("performance")}function pn(){return On("instance")}function dn(n){xn("instance",n)}var hn,mn=function(){},vn=y((hn="tt",[function(){return hn},function(n){return hn=n}]),2),bn=vn[0],gn=vn[1],yn=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},_n=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:bn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},wn="__slardar__global__0.2.4",Sn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},En=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?_n().instance:e)?e[wn]||(e[wn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},Sn),e&&(e[wn]=t)}}}(d({},Sn)),xn=En.setGlobalValue,kn=En.mergeGlobalValue,On=En.getGlobalValue,jn=function(n){return On("app")[n]},Tn=function(n){return On("page")[n]},Cn=function(t,n){(n=void 0===n?Y:n).forEach(function(e){an(e)&&un(e).subscribe(function(n){return t(n,e)})})},Pn=function(n){return On("component")[n]};function Dn(n){return"function"==typeof n}function In(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Rn(n){return n}function Mn(t){return function(n){if((e=n)&&Dn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Nn(n){Dn(n)?n():null!=n&&n.unsubscribe()}var An=function(n){return n instanceof Fn||n&&"closed"in n&&Dn(n.remove)&&Dn(n.add)&&Dn(n.unsubscribe)},Fn=(qn.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Dn(t)&&t(),e&&(this._finalizers=null,e.forEach(Nn)))},qn.prototype.remove=function(n){this._finalizers&&In(this._finalizers,n),n instanceof qn&&n._removeParent(this)},qn.prototype.add=function(n){if(n&&n!==this)if(this.closed)Nn(n);else{if(n instanceof qn){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},qn.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},qn.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},qn.prototype._removeParent=function(n){this._parentage&&In(this._parentage,n)},qn);function qn(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var zn,Ln=(n(Bn,zn=Fn),Bn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Bn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Bn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Bn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,zn.prototype.unsubscribe.call(this),this.destination=null)},Bn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Bn);function Bn(n){var e=zn.call(this)||this;return e.isStopped=!1,e.destination=Hn(n)?n:new Vn(!(n=n)||Dn(n)?{next:null!=n?n:void 0}:n),e}var Vn=(Un.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Un.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Un.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Un);function Un(n){this.partialObserver=n}function Hn(n){return n instanceof Ln||n&&((e=n)&&Dn(e.next)&&Dn(e.error)&&Dn(e.complete))&&An(n);var e}Gn.prototype.subscribe=function(n){var e=Hn(n)?n:new Ln(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Gn.prototype.lift=function(n){var e=new Gn;return e.source=this,e.operator=n,e},Gn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Rn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Gn.prototype._subscribe=function(n){},Gn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},vn=Gn;function Gn(n){n&&(this._subscribe=n)}var Kn,En=(n(Jn,Kn=vn),Jn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Jn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Jn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Jn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Jn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Jn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Jn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Jn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Jn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Jn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Jn.EMPTY:(t.push(n),new Fn(function(){In(t,n)}))},Jn.EMPTY=((En=new Fn).closed=!0,En),Jn);function Jn(){var n=null!==Kn&&Kn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var Wn=new vn(function(n){return n.complete()});function Yn(r){return r<=0?function(){return Wn}:Mn(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function $n(r,o){return Mn(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function Qn(t){return $n(function(n,e){return t<=e})}var Xn,Zn=(n(ne,Xn=En),ne.prototype.subscribe=function(n){var t=this,n=Xn.prototype.subscribe.call(this,n);pn()&&pn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},ne.prototype.unsubscribe=function(){Xn.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},ne.prototype.addTearDown=function(n){this.tearDownFns.push(n)},ne);function ne(){var n=null!==Xn&&Xn.apply(this,arguments)||this;return n.tearDownFns=[],n}function ee(n){var e=n.reduce(function(n,e){return n[e]=new Zn,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function te(n){return 1<n.length?n:n.length&&n[0]||{}}function re(n){var t=n.filter(function(n){return n=n,!!!On("app")[n]}),n=ee(t).subjectMap;kn("app",n=n),rn("app",n),App=yn(App,function(e){t.forEach(function(n){var r=jn(n),n=g(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:te(n),time:nn()}),h(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function oe(n){return n.route||n.__route__||n.url||n.path||""}function ie(n){function e(n,i){r.forEach(function(o){g(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Pn(o).next({that:this,param:null,time:nn()});var t=i[o];if(h(t)&&t.apply(this,n),h(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=yn(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function ue(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Cn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},W),Tn("onLoad").pipe(Qn(1)).subscribe(function(n){r.load_start=n.time}),Tn("onShow").pipe(Qn(1)).subscribe(function(n){r.dom_end=n.time}),Tn("onReady").pipe(Qn(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),jn(q.onHide).subscribe(function(){!1===o&&(e(),t())})}function ae(e){Pn("attached").subscribe(function(n){n=n.that;return e.call(n)})}function ce(n){return"android"===n.toLowerCase()}function se(n){return ce(n)?"Android":"ios"===n.toLowerCase()?"iOS":~xe.indexOf(n.toLowerCase())?"Mac":~ke.indexOf(n.toLowerCase())?"windows":"unknown"}function fe(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&ce(e)&&t?r/t+" * "+n/t:r+" * "+n}function le(n){return(c(n)?je:Oe)(n)}function pe(){return d({appId:"",miniEnv:"",miniVersion:"",platform:Ce},Te())}function de(n){var e=n.filter(function(n){return n=n,!!!On("component")[n]}),n=ee(e).subjectMap;kn("component",n=n),rn("component",n),we().componentSubject(e)}function he(e){function n(n){K(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=yn(Component,n),Behavior=yn(Behavior,n)}catch(n){}}function me(n,e){var t=n.filter(function(n){return n=n,!!!On("page")[n]}),n=ee(t).subjectMap;kn("page",n=n),rn("page",n),n=function(e){t.forEach(function(n){var r=Tn(n),n=g(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(oe(this)&&r.next({that:this,param:te(n),time:nn()}),h(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=yn(Page,n),he(n)}function ve(n){var e=n.filter(function(n){return!an(n)}),t=ee(e).subjectMap;kn("route",n=t),rn("route",n),e.forEach(function(i){var n=tn(we().instance,i,function(o){void 0===o&&(o={}),un(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:nn()}),H.forEach(function(r){g(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];un(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:te(n)||{}},time:nn()}),h(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function be(a,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:a,request:{url:e,method:(e=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:v(r),timestamp:nn()},response:{}};g(n,"complete",function(u){return function(n){var e=c.response.timestamp||nn();c.duration=e-c.request.timestamp,c.completeCallbackTime=en(u,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:v(n.data),errMsg:i,timing:we().buildRequestProfile(n.profile||{})},cn(a).next(c)}})(),g(n,"success",function(e){return function(n){c.response.timestamp=nn(),c.response.status=200,c.successCallbackTime=en(e,n)}})(),g(n,"fail",function(e){return function(n){c.response.timestamp=nn(),c.response.status=-1,c.failCallbackTime=en(e,n)}})()}function ge(n,t){void 0===t&&(t=we().instance);var e=n.filter(function(n){return!sn(n)}),r=ee(e).subjectMap;kn("http",n=r),rn("http",n),e.forEach(function(e){var n=tn(t,e,function(n){be(e,n)});n&&r[e].addTearDown(n)})}var ye,vn=y((ye={},[function(n){if(!_n().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===_n().platform});return n&&(ye=n.adapterCtor())},function(){return ye}]),2),_e=vn[0],we=vn[1],Se=function(n){return"SLARDAR"+n},Ee=function(n){try{return we().getStorage(n)}catch(n){return}},xe=["darwin","macs","mac"],ke=["windows_nt","windows","window"],Oe=function(n){return{name:"unknown_error_name",message:v(n)}},je=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},Te=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,u=n.windowHeight,a=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:fe({width:i,height:o}),windowArea:fe({width:a,height:u}),language:c,osName:se(l),osVersion:f,SDKVersion:p,hostName:n,hostVersion:s}},Ce="lark",En={platform:Ce,adapterCtor:function(){return d(d({},{instance:t=void 0===t?_n().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:Ce,buildError:le,getSystemInfo:pe,componentSubject:ie,pagePerfSubscriber:ue,setDataSubject:ae});var t}},Pe=function(n,e){void 0===e&&(e=J),n.on("init",function(){ge(e)})};function De(){var u=oe(this),a=fn();var n=tn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=nn();return[o,function(){var n=r[1],e=nn()-i;a.next({renderTime:e,url:u,data:o,startTime:i}),n&&n.call(t)}]});n&&a.addTearDown(n)}function Ie(){var n;On("setData")||(n=(n=ee(["setData"]).getSubject)("setData"),xn("setData",n),on("setData",n))}function Re(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(Ae.test(t)||Fe.test(r))||(n[e]=o[e]),n},{})}var Me=function(n){n.on("init",function(){Ie(),Tn("onLoad").subscribe(function(n){n=n.that;De.call(n)}),we().setDataSubject(De)})},Ne=function(n){n.on("init",function(){var e,n,t,r=we();r.observePerformance&&!ln()&&(e=(0,ee(["performance"]).getSubject)("performance"),xn("performance",n=e),on("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},Ae=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Fe=new RegExp("(bearer|session)","i"),qe=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,u,a,c;!function(n,e){n=m(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,a=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Re(e.headers||{}),c.headers=Re(c.headers||{}),u=c.errMsg,n=function(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),u&&(n.err_msg=u),a={api:t,request:e,duration:r,cbTime:i+(o||0)+(a||0),response:n},!h(p)||(n=p(c.body,a))&&(a.extra=n,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};e&&cn("request").subscribe(n),t&&cn("downloadFile").subscribe(n),r&&cn("uploadFile").subscribe(n)}},ze=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return T("applyMonitor",n),[]}};function Le(n,e,t){dn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Be(n,e){return n&&e&&n===e}function Ve(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Be(e.message,t.message)&&!Be(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var Ue,He="http",Ge={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Ke=function(f){return void 0===f&&(f=we()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,u=n.dedupe,a=m(e),c=Ve(),s=function(n,e,t){n=u?c(n):n;n&&(a&&a.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&jn(q.onError).subscribe(function(n){n=n.param,n=f.buildError(n);a&&a.test(n.message)||s(n)}),o&&jn(q.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=v(e.reason);a&&a.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Cn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(vn=Ue=Ue||{}).history="history",vn.manual="manual";function Je(t,n,r){var o=n,i=null,u=0,e="launch";function a(n,e){o=e,u=nn(),r(e,i=e+"_"+u),t(n,e)}return jn(q.onShow).pipe(Qn(1)).subscribe(function(){e="show"}),Cn(function(){e="history"}),[a,function(n){n&&(a(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,nn()-u))}]}var We=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Je(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],u=n[1],n=n[2];return t!==Ue.manual&&(Tn("onShow").subscribe(function(n){return function(n){n=oe(n),n=i(n);u(n)}(n.that)}),Tn("onUnload").subscribe(n.bind(null,"unload")),Tn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Ye=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return J.forEach(function(n){sn(n)&&cn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Cn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},$e=function(){return function(n,t){var r=n.isCalculateSize;fn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(v(n)).length:2*v(n).length)),t({ev_type:"set_data",payload:e})})}},Qe=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;jn(q.onLaunch).pipe(Yn(1)).subscribe(function(n){r.activate_start=n.time}),jn(q.onShow).pipe(Yn(1)).subscribe(function(n){r.init_end=n.time}),Tn("onLoad").pipe(Yn(1)).subscribe(function(n){r.page_load_start=n.time}),Tn("onShow").pipe(Yn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=ln();Tn("onReady").pipe(Yn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&On("performance").pipe($n(function(n){return"appClick"===n.name}),Yn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),jn(q.onHide).subscribe(function(){o||t()})}},Xe=function(){return function(n,e){we().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},Ze=function(e){return void 0===e&&(e=we()),function(n,t){var r,o;ln()&&e.performanceSubscriber&&(r=0,Tn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},nt="pageview",et={routeMode:Ue.history,setPidAndViewId:function(n,e){}},rt="jsError",ot={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},it=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},ut={maxBreadcrumbs:20,tap:!0},at="breadcrumb",ct=function(e){e.on("init",function(){e.provide("_subscriptions",[]),dn(e),e.on("init",function(){re($),me(X),de(Q)}),e.on("init",function(){ve(Y)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},st="setData",ft={isCalculateSize:!1},lt="appLaunchPerf",pt={},dt="pagePerf",ht={},mt="performance",vt={},bt=function(n,e,t){void 0===t&&(t=we());var r=e.url,o=e.data,i=e.success,u=void 0===i?l:i,a=e.fail,c=void 0===a?l:a,i=e.header,a={"Content-Type":"application/json"};K(e=i)&&0!==Object.keys(e).length&&Object.assign(a,i),t.request({method:n,url:r,data:o,header:a,headers:a,success:function(n){u(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},gt=function(e){return(e=void 0===e?we():e)?{get:function(n){return bt("GET",n,e)},post:function(n){return bt("POST",n,e)}}:{get:l,post:l}};function yt(n){return n=Se(String(n)),(n=Ee(n))&&n.userId&&n.deviceId?n:{userId:P(),deviceId:P()}}function _t(n){return n+"_"+Date.now()}function wt(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{we().setStorage(n,e)}catch(n){}}(Se(String(e)),{userId:t,deviceId:n})}var St={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},Et="/monitor_mini/collect",xt="/settings/minipro",kt="apmplus.volces.com",Ot="session",jt={sample_rate:1,include_users:[],sample_granularity:Ot,rules:{}},Tt=[Et,xt],Ct="0.2.4",Pt="APM_PLUS_MINI_PROGRAM",Dt=function(n,e){return void 0===e&&(e=Et),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function It(n){n=yt(n.aid);return{aid:0,token:"",pid:"",viewId:_t("_"),userId:n.userId,deviceId:n.deviceId,sessionId:P(),domain:kt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Tt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:jt,sdkName:Pt,sdkVersion:Ct}}function Rt(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function Mt(n){return S(n)&&"aid"in n&&"token"in n}function Nt(n){return d({},n)}var At=function(e){var r,o,i=e,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return u=d(d({},u),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):a?f():(e=i.domain,n=i.aid,t=function(n){a=n,f()},gt().get({url:function(n,e){return void 0===e&&(e=xt),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){wt(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),u);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),n.sample=Ft(Ft(e.sample,null==o?void 0:o.sample),u.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?Ot:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(a),function(n){n=Se(n);return!!we().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Ft(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function qt(n){var e={url:(e=we().getCurrentPages().pop())?(e?oe(e):"")+s(e.options):"",timestamp:nn()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function zt(n){if(!_e(n))throw Error(U);var t,n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=D(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)k("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=u(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(m,n)?k("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h=[]}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(n,e){"init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d?e():f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:v},m=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:Mt,initConfigNormalizer:Rt,userConfigNormalizer:Nt,createSender:function(n){return e({size:G,endpoint:Dt(n.domain),transport:gt()})},builder:St,createDefaultConfig:It,createConfigManager:At});return I(n),Ht(n),Bt(n),Vt(n),z(n),ct(n),(t=n).on("init",function(){var e=[],n=t.config();n&&n.integrations&&n.integrations.forEach(function(n){E(e,n.name)||(e.push(n.name),n.setup(t),n.tearDown&&t.on("beforeDestroy",n.tearDown))})}),Ut(n),Lt(n),n}var Lt=function(e){function t(n){return void 0===n&&(n=we().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,u=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),u=!0}),e.on("init",function(){jn(q.onLaunch).pipe(Yn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),u&&r()}),we().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Bt=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Vt=function(n){n.on("report",qt)},Ut=function(e){e.on("init",function(){jn(q.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},Ht=function(t){var r,o=!1;t.on("init",function(){r=nn(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=nn())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return gn("lark"),function(n){var e,t,r,i,o,u,a,c,s,n=zt(n);if(n)return(e=n).provide("sendEvent",function(n){n=B(n);n&&e.report({ev_type:L,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=V(n);n&&e.report({ev_type:L,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Le(t,nt,et);e&&(e=(n=y(ze(We,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Le(r,rt,ot);e&&(n=it(r),n=y(ze(Ke,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Le(i,He,Ge);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Pe(i,r),ze(qe,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Le(o,st,ft);n&&(Me(o),ze($e,n,o.report.bind(o)))}),(u=n).on("init",function(){var n,e=Le(u,at,ut);e&&(e=(n=y(ze(Ye,e,function(n){}),2))[0],n=n[1],u.provide("getBreadcrumbs",e),u.provide("addBreadcrumb",n))}),(a=n).on("init",function(){var n=Le(a,lt,pt);n&&(Ne(a),ze(Qe,n,a.report.bind(a)))}),(c=n).on("init",function(){var n=Le(c,dt,ht);n&&ze(Xe,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Le(s,mt,vt);n&&(Ne(s),ze(Ze,n,s.report.bind(s)))}),n}.bind(null,[En])()}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).larkClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,u=void 0===n?1e3:n,a=[],c=0;function s(){var e;a.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){a.push(n),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(n=a,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),a=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function u(n){return"[object Array]"===t.toString.call(n)}function h(n){return"function"==typeof n}function a(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):u(e[t])&&u(n[t])?o[t]=function e(n,t){n=u(n)?n:[];t=u(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):u(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!u(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function x(n,e){if(!u(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function v(n){return u(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function m(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function k(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),j(""+P++)],y(n),!1))}function o(n){return Math.random()<Number(n)}function f(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){C(n)}return e}}var g=function(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(n),!1)),o=r;return h(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return h(t)&&t.apply(this,e)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=t:r=t)}}},j="".padStart?function(n,e){return n.padStart(e=void 0===e?8:e," ")}:function(n){return n},T=0,C=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),j(""+T++)],y(n),!1))},P=0;function D(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function I(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,e,t){i[n]?i[n].push([e,t]):i[n]=[[e,t]],o&&r(t)},has:function(n){return!!i[n]},remove:e,removeByEvType:function(e){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===e&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){e(n)})}}}var R=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=m(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=m(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function M(r,o){r.on("init",function(){function n(n){n.forEach(function(n){var e=n.name;E(t,e)||(t.push(e),n.setup(r),o&&o(e,n.setup),r.destroyAgent.set(e,e,[function(){t=x(t,e),n.tearDown&&n.tearDown()}]))})}var t=[];r.provide("applyIntegrations",n);var e=r.config();e&&e.integrations&&n(e.integrations)})}function N(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function A(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function F(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":a(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function q(e,n){try{return"rule"===n.type?F(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return q(e,n)}):n.children.some(function(n){return q(e,n)})}catch(n){return!1}}function z(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,u=e.sample_granularity,a=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return N(n,1)};var c,s,f,l,p,d,h,v=A(u="session"===u,o,t,e,r),m=(c=a,s=u,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:A(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:A(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!v())return!1;if(!(n.ev_type in m))return N(n,o);if(!m[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=m[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(q(n,t[r].filter))return!!t[r].hit()&&N(n,t[r].effectiveSampleRate);return!!e.hit()&&N(n,e.effectiveSampleRate)}}var L,B=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=z(e,n,o,f);t.on("build",n)})},V="custom",U=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=m(i[o]);e.categories=u}return e}},H=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:m(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=m(r[t]);e.metrics=o,e.categories=i}return e}},G="Adapters imported incorrectly",K=["success","fail","complete"],J=20;(kn=L=L||{}).onLaunch="onLaunch",kn.onShow="onShow",kn.onHide="onHide",kn.onError="onError",kn.onPageNotFound="onPageNotFound",kn.onUnhandledRejection="onUnhandledRejection";function W(n){return"[object Object]"===Object.prototype.toString.call(n)}var Y=["request","downloadFile","uploadFile"],$=["navigateTo","redirectTo","switchTab","reLaunch"],Q=_(_([],y($),!1),["navigateBack"],!1),X=_(_([],y([L.onLaunch,L.onShow,L.onHide]),!1),[L.onError,L.onPageNotFound,L.onUnhandledRejection],!1),Z=["attached","onInit"],nn=["onLoad","onShow","onReady","onUnload","onHide"],en="__HOOKED__";var tn=function(){return Date.now()};function rn(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!h(n))return 0;var r,o=tn();try{n.apply(this,e)}finally{r=tn()}return r-o}function on(n,e,r){var o=n[e];if(!o||!o[en])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){C(n)}return o.apply(this,n)}}),n[e]&&(n[e][en]=!0),function(){n[e][en]=!1,r=bn}}function un(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return jn(t,((n={})[e]=null,n))})})}function an(n,e){e.addTearDown(function(){return On(n,null)})}function cn(n){return Tn("route")[n]}function sn(n){return!!Tn("route")[n]}function fn(n){return Tn("http")[n]}function ln(n){return!!Tn("http")[n]}function pn(){return Tn("setData")}function dn(){return!!Tn("performance")}function hn(){return Tn("instance")}function vn(n){On("instance",n)}var mn,bn=function(){},gn=y((mn="tt",[function(){return mn},function(n){return mn=n}]),2),yn=gn[0],_n=gn[1],wn=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Sn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:yn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},En="__slardar__global__0.2.5-alpha.0",xn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},kn=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?Sn().instance:e)?e[En]||(e[En]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},xn),e&&(e[En]=t)}}}(d({},xn)),On=kn.setGlobalValue,jn=kn.mergeGlobalValue,Tn=kn.getGlobalValue,Cn=function(n){return Tn("app")[n]},Pn=function(n){return Tn("page")[n]},Dn=function(t,n){(n=void 0===n?Q:n).forEach(function(e){sn(e)&&cn(e).subscribe(function(n){return t(n,e)})})},In=function(n){return Tn("component")[n]};function Rn(n){return"function"==typeof n}function Mn(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Nn(n){return n}function An(t){return function(n){if((e=n)&&Rn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Fn(n){Rn(n)?n():null!=n&&n.unsubscribe()}var qn=function(n){return n instanceof zn||n&&"closed"in n&&Rn(n.remove)&&Rn(n.add)&&Rn(n.unsubscribe)},zn=(Ln.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Rn(t)&&t(),e&&(this._finalizers=null,e.forEach(Fn)))},Ln.prototype.remove=function(n){this._finalizers&&Mn(this._finalizers,n),n instanceof Ln&&n._removeParent(this)},Ln.prototype.add=function(n){if(n&&n!==this)if(this.closed)Fn(n);else{if(n instanceof Ln){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Ln.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Ln.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Ln.prototype._removeParent=function(n){this._parentage&&Mn(this._parentage,n)},Ln);function Ln(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Bn,Vn=(n(Un,Bn=zn),Un.prototype.next=function(n){this.isStopped||this.destination.next(n)},Un.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Un.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Un.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Bn.prototype.unsubscribe.call(this),this.destination=null)},Un.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Un);function Un(n){var e=Bn.call(this)||this;return e.isStopped=!1,e.destination=Kn(n)?n:new Hn(!(n=n)||Rn(n)?{next:null!=n?n:void 0}:n),e}var Hn=(Gn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Gn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Gn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Gn);function Gn(n){this.partialObserver=n}function Kn(n){return n instanceof Vn||n&&((e=n)&&Rn(e.next)&&Rn(e.error)&&Rn(e.complete))&&qn(n);var e}Jn.prototype.subscribe=function(n){var e=Kn(n)?n:new Vn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Jn.prototype.lift=function(n){var e=new Jn;return e.source=this,e.operator=n,e},Jn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Nn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Jn.prototype._subscribe=function(n){},Jn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},gn=Jn;function Jn(n){n&&(this._subscribe=n)}var Wn,kn=(n(Yn,Wn=gn),Yn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Yn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Yn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Yn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Yn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Yn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Yn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Yn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Yn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Yn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Yn.EMPTY:(t.push(n),new zn(function(){Mn(t,n)}))},Yn.EMPTY=((kn=new zn).closed=!0,kn),Yn);function Yn(){var n=null!==Wn&&Wn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var $n=new gn(function(n){return n.complete()});function Qn(r){return r<=0?function(){return $n}:An(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function Xn(r,o){return An(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function Zn(t){return Xn(function(n,e){return t<=e})}var ne,ee=(n(te,ne=kn),te.prototype.subscribe=function(n){var t=this,n=ne.prototype.subscribe.call(this,n);hn()&&hn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},te.prototype.unsubscribe=function(){ne.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},te.prototype.addTearDown=function(n){this.tearDownFns.push(n)},te);function te(){var n=null!==ne&&ne.apply(this,arguments)||this;return n.tearDownFns=[],n}function re(n){var e=n.reduce(function(n,e){return n[e]=new ee,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function oe(n){return 1<n.length?n:n.length&&n[0]||{}}function ie(n){var t=n.filter(function(n){return n=n,!!!Tn("app")[n]}),n=re(t).subjectMap;jn("app",n=n),un("app",n),App=wn(App,function(e){t.forEach(function(n){var r=Cn(n),n=g(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:oe(n),time:tn()}),h(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function ue(n){return n.route||n.__route__||n.url||n.path||""}function ae(n){function e(n,i){r.forEach(function(o){g(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];In(o).next({that:this,param:null,time:tn()});var t=i[o];if(h(t)&&t.apply(this,n),h(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=wn(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function ce(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Dn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},$),Pn("onLoad").pipe(Zn(1)).subscribe(function(n){r.load_start=n.time}),Pn("onShow").pipe(Zn(1)).subscribe(function(n){r.dom_end=n.time}),Pn("onReady").pipe(Zn(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Cn(L.onHide).subscribe(function(){!1===o&&(e(),t())})}function se(e){In("attached").subscribe(function(n){n=n.that;return e.call(n)})}function fe(n){return"android"===n.toLowerCase()}function le(n){return fe(n)?"Android":"ios"===n.toLowerCase()?"iOS":~Oe.indexOf(n.toLowerCase())?"Mac":~je.indexOf(n.toLowerCase())?"windows":"unknown"}function pe(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&fe(e)&&t?r/t+" * "+n/t:r+" * "+n}function de(n){return(c(n)?Ce:Te)(n)}function he(){return d({appId:"",miniEnv:"",miniVersion:"",platform:De},Pe())}function ve(n){var e=n.filter(function(n){return n=n,!!!Tn("component")[n]}),n=re(e).subjectMap;jn("component",n=n),un("component",n),Ee().componentSubject(e)}function me(e){function n(n){W(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=wn(Component,n),Behavior=wn(Behavior,n)}catch(n){}}function be(n,e){var t=n.filter(function(n){return n=n,!!!Tn("page")[n]}),n=re(t).subjectMap;jn("page",n=n),un("page",n),n=function(e){t.forEach(function(n){var r=Pn(n),n=g(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(ue(this)&&r.next({that:this,param:oe(n),time:tn()}),h(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=wn(Page,n),me(n)}function ge(n){var e=n.filter(function(n){return!sn(n)}),t=re(e).subjectMap;jn("route",n=t),un("route",n),e.forEach(function(i){var n=on(Ee().instance,i,function(o){void 0===o&&(o={}),cn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:tn()}),K.forEach(function(r){g(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];cn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:oe(n)||{}},time:tn()}),h(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function ye(a,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:a,request:{url:e,method:(e=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:m(r),timestamp:tn()},response:{}};g(n,"complete",function(u){return function(n){var e=c.response.timestamp||tn();c.duration=e-c.request.timestamp,c.completeCallbackTime=rn(u,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:m(n.data),errMsg:i,timing:Ee().buildRequestProfile(n.profile||{})},fn(a).next(c)}})(),g(n,"success",function(e){return function(n){c.response.timestamp=tn(),c.response.status=200,c.successCallbackTime=rn(e,n)}})(),g(n,"fail",function(e){return function(n){c.response.timestamp=tn(),c.response.status=-1,c.failCallbackTime=rn(e,n)}})()}function _e(n,t){void 0===t&&(t=Ee().instance);var e=n.filter(function(n){return!ln(n)}),r=re(e).subjectMap;jn("http",n=r),un("http",n),e.forEach(function(e){var n=on(t,e,function(n){ye(e,n)});n&&r[e].addTearDown(n)})}var we,gn=y((we={},[function(n){if(!Sn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===Sn().platform});return n&&(we=n.adapterCtor())},function(){return we}]),2),Se=gn[0],Ee=gn[1],xe=function(n){return"SLARDAR"+n},ke=function(n){try{return Ee().getStorage(n)}catch(n){return}},Oe=["darwin","macs","mac"],je=["windows_nt","windows","window"],Te=function(n){return{name:"unknown_error_name",message:m(n)}},Ce=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},Pe=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,u=n.windowHeight,a=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:pe({width:i,height:o}),windowArea:pe({width:a,height:u}),language:c,osName:le(l),osVersion:f,SDKVersion:p,hostName:n,hostVersion:s}},De="lark",kn={platform:De,adapterCtor:function(){return d(d({},{instance:t=void 0===t?Sn().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:De,buildError:de,getSystemInfo:he,componentSubject:ae,pagePerfSubscriber:ce,setDataSubject:se});var t}},Ie=function(n,e){void 0===e&&(e=Y),n.on("init",function(){_e(e)})};function Re(){var u=ue(this),a=pn();var n=on(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=tn();return[o,function(){var n=r[1],e=tn()-i;a.next({renderTime:e,url:u,data:o,startTime:i}),n&&n.call(t)}]});n&&a.addTearDown(n)}function Me(){var n;Tn("setData")||(n=(n=re(["setData"]).getSubject)("setData"),On("setData",n),an("setData",n))}function Ne(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(qe.test(t)||ze.test(r))||(n[e]=o[e]),n},{})}var Ae=function(n){n.on("init",function(){Me(),Pn("onLoad").subscribe(function(n){n=n.that;Re.call(n)}),Ee().setDataSubject(Re)})},Fe=function(n){n.on("init",function(){var e,n,t,r=Ee();r.observePerformance&&!dn()&&(e=(0,re(["performance"]).getSubject)("performance"),On("performance",n=e),an("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},qe=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),ze=new RegExp("(bearer|session)","i"),Le=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,u,a,c;!function(n,e){n=v(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,a=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Ne(e.headers||{}),c.headers=Ne(c.headers||{}),u=c.errMsg,n=function(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),u&&(n.err_msg=u),a={api:t,request:e,duration:r,cbTime:i+(o||0)+(a||0),response:n},!h(p)||(n=p(c.body,a))&&(a.extra=n,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};e&&fn("request").subscribe(n),t&&fn("downloadFile").subscribe(n),r&&fn("uploadFile").subscribe(n)}},Be=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return C("applyMonitor",n),[]}};function Ve(n,e,t){vn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Ue(n,e){return n&&e&&n===e}function He(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Ue(e.message,t.message)&&!Ue(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var Ge,Ke="http",Je={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},We=function(f){return void 0===f&&(f=Ee()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,u=n.dedupe,a=v(e),c=He(),s=function(n,e,t){n=u?c(n):n;n&&(a&&a.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Cn(L.onError).subscribe(function(n){n=n.param,n=f.buildError(n);a&&a.test(n.message)||s(n)}),o&&Cn(L.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=m(e.reason);a&&a.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Dn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(gn=Ge=Ge||{}).history="history",gn.manual="manual";function Ye(t,n,r){var o=n,i=null,u=0,e="launch";function a(n,e){o=e,u=tn(),r(e,i=e+"_"+u),t(n,e)}return Cn(L.onShow).pipe(Zn(1)).subscribe(function(){e="show"}),Dn(function(){e="history"}),[a,function(n){n&&(a(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,tn()-u))}]}var $e=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Ye(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],u=n[1],n=n[2];return t!==Ge.manual&&(Pn("onShow").subscribe(function(n){return function(n){n=ue(n),n=i(n);u(n)}(n.that)}),Pn("onUnload").subscribe(n.bind(null,"unload")),Pn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Qe=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return Y.forEach(function(n){ln(n)&&fn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Dn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},Xe=function(){return function(n,t){var r=n.isCalculateSize;pn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(m(n)).length:2*m(n).length)),t({ev_type:"set_data",payload:e})})}},Ze=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Cn(L.onLaunch).pipe(Qn(1)).subscribe(function(n){r.activate_start=n.time}),Cn(L.onShow).pipe(Qn(1)).subscribe(function(n){r.init_end=n.time}),Pn("onLoad").pipe(Qn(1)).subscribe(function(n){r.page_load_start=n.time}),Pn("onShow").pipe(Qn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=dn();Pn("onReady").pipe(Qn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&Tn("performance").pipe(Xn(function(n){return"appClick"===n.name}),Qn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Cn(L.onHide).subscribe(function(){o||t()})}},nt=function(){return function(n,e){Ee().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},et=function(e){return void 0===e&&(e=Ee()),function(n,t){var r,o;dn()&&e.performanceSubscriber&&(r=0,Pn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},rt="pageview",ot={routeMode:Ge.history,setPidAndViewId:function(n,e){}},it="jsError",ut={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},at=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},ct={maxBreadcrumbs:20,tap:!0},st="breadcrumb",ft=function(e){e.on("init",function(){e.provide("_subscriptions",[]),vn(e),e.on("init",function(){ie(X),be(nn),ve(Z)}),e.on("init",function(){ge(Q)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},lt="setData",pt={isCalculateSize:!1},dt="appLaunchPerf",ht={},vt="pagePerf",mt={},bt="performance",gt={},yt=function(n,e,t){void 0===t&&(t=Ee());var r=e.url,o=e.data,i=e.success,u=void 0===i?l:i,a=e.fail,c=void 0===a?l:a,i=e.header,a={"Content-Type":"application/json"};W(e=i)&&0!==Object.keys(e).length&&Object.assign(a,i),t.request({method:n,url:r,data:o,header:a,headers:a,success:function(n){u(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},_t=function(e){return(e=void 0===e?Ee():e)?{get:function(n){return yt("GET",n,e)},post:function(n){return yt("POST",n,e)}}:{get:l,post:l}};function wt(n){return n=xe(String(n)),(n=ke(n))&&n.userId&&n.deviceId?n:{userId:D(),deviceId:D()}}function St(n){return n+"_"+Date.now()}function Et(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{Ee().setStorage(n,e)}catch(n){}}(xe(String(e)),{userId:t,deviceId:n})}var xt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},kt="/monitor_mini/collect",Ot="/settings/minipro",jt="apmplus.volces.com",Tt="session",Ct={sample_rate:1,include_users:[],sample_granularity:Tt,rules:{}},Pt=[kt,Ot],Dt="0.2.5-alpha.0",It="APM_PLUS_MINI_PROGRAM",Rt=function(n,e){return void 0===e&&(e=kt),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function Mt(n){n=wt(n.aid);return{aid:0,token:"",pid:"",viewId:St("_"),userId:n.userId,deviceId:n.deviceId,sessionId:D(),domain:jt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Pt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Ct,sdkName:It,sdkVersion:Dt}}function Nt(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function At(n){return S(n)&&"aid"in n&&"token"in n}function Ft(n){return d({},n)}var qt=function(e){var r,o,i=e,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return u=d(d({},u),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):a?f():(e=i.domain,n=i.aid,t=function(n){a=n,f()},_t().get({url:function(n,e){return void 0===e&&(e=Ot),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){Et(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),u);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),n.sample=zt(zt(e.sample,null==o?void 0:o.sample),u.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?Tt:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(a),function(n){n=xe(n);return!!Ee().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function zt(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Lt(n){var e={url:(e=Ee().getCurrentPages().pop())?(e?ue(e):"")+s(e.options):"",timestamp:tn()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function Bt(n){if(!Se(n))throw Error(G);return n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],v=[],m=I(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)k("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=u(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(v,n)?k("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h.length=0}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){m.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(n,e){if("init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d)try{e()}catch(n){}else f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:m},v=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:At,initConfigNormalizer:Nt,userConfigNormalizer:Ft,createSender:function(n){return e({size:J,endpoint:Rt(n.domain),transport:_t()})},builder:xt,createDefaultConfig:Mt,createConfigManager:qt}),R(n),Kt(n),Ut(n),Ht(n),B(n),ft(n),M(n),Gt(n),Vt(n),n}var Vt=function(e){function t(n){return void 0===n&&(n=Ee().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,u=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),u=!0}),e.on("init",function(){Cn(L.onLaunch).pipe(Qn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),u&&r()}),Ee().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Ut=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Ht=function(n){n.on("report",Lt)},Gt=function(e){e.on("init",function(){Cn(L.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},Kt=function(t){var r,o=!1;t.on("init",function(){r=tn(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=tn())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return _n("lark"),function(n){var e,t,r,i,o,u,a,c,s,n=Bt(n);if(n)return(e=n).provide("sendEvent",function(n){n=U(n);n&&e.report({ev_type:V,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=H(n);n&&e.report({ev_type:V,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Ve(t,rt,ot);e&&(e=(n=y(Be($e,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Ve(r,it,ut);e&&(n=at(r),n=y(Be(We,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Ve(i,Ke,Je);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Ie(i,r),Be(Le,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Ve(o,lt,pt);n&&(Ae(o),Be(Xe,n,o.report.bind(o)))}),(u=n).on("init",function(){var n,e=Ve(u,st,ct);e&&(e=(n=y(Be(Qe,e,function(n){}),2))[0],n=n[1],u.provide("getBreadcrumbs",e),u.provide("addBreadcrumb",n))}),(a=n).on("init",function(){var n=Ve(a,dt,ht);n&&(Fe(a),Be(Ze,n,a.report.bind(a)))}),(c=n).on("init",function(){var n=Ve(c,vt,mt);n&&Be(nt,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Ve(s,bt,gt);n&&(Fe(s),Be(et,n,s.report.bind(s)))}),n}.bind(null,[kn])()}); |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).marsClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,a=void 0===n?1e3:n,u=[],c=0;function s(){var e;u.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(n){i=n},setWait:function(n){a=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){u.push(n),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(n=u,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),u=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function h(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function m(n){return"function"==typeof n}function u(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):a(e[t])&&a(n[t])?o[t]=function e(n,t){n=a(n)?n:[];t=a(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):a(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!a(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function k(n,e){if(!a(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function v(n){return a(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function g(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function x(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),(""+P++).padStart(8," ")],y(n),!1))}function o(n){return Math.random()<Number(n)}function f(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){C(n)}return e}}var j=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(n),!1)),o=r;return m(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return m(t)&&t.apply(this,e)}}),i[a]=o,function(n){n||(o===i[a]?i[a]=t:r=t)}}},T=0,C=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),(""+T++).padStart(8," ")],y(n),!1))},P=0;function D(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function I(){function t(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){r[n]&&r[n].forEach(function(n){t(n[1])}),r[n]=void 0}var r={};return{set:function(n,e,t){r[n]?r[n].push([e,t]):r[n]=[[e,t]]},remove:e,removeByEvType:function(e){Object.keys(r).forEach(function(n){r[n]&&r[n].forEach(function(n){n[0]===e&&t(n[1])})})},clear:function(){Object.keys(r).forEach(function(n){e(n)})}}}var R=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=g(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=g(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function N(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function M(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function A(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":u(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function F(e,n){try{return"rule"===n.type?A(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return F(e,n)}):n.children.some(function(n){return F(e,n)})}catch(n){return!1}}function q(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return N(n,1)};var c,s,f,l,p,d,h,m=M(a="session"===a,o,t,e,r),v=(c=u,s=a,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:M(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!m())return!1;if(!(n.ev_type in v))return N(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(F(n,t[r].filter))return!!t[r].hit()&&N(n,t[r].effectiveSampleRate);return!!e.hit()&&N(n,e.effectiveSampleRate)}}var z,L=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=q(e,n,o,f);t.on("build",n)})},V="custom",B=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,a={};for(o in i)a[o]=g(i[o]);e.categories=a}return e}},U=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:g(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=g(r[t]);e.metrics=o,e.categories=i}return e}},H="Adapters imported incorrectly",G=["success","fail","complete"],K=20;(kn=z=z||{}).onLaunch="onLaunch",kn.onShow="onShow",kn.onHide="onHide",kn.onError="onError",kn.onPageNotFound="onPageNotFound",kn.onUnhandledRejection="onUnhandledRejection";function J(n){return"[object Object]"===Object.prototype.toString.call(n)}var W=["request","downloadFile","uploadFile"],Y=["navigateTo","redirectTo","switchTab","reLaunch"],$=_(_([],y(Y),!1),["navigateBack"],!1),Q=_(_([],y([z.onLaunch,z.onShow,z.onHide]),!1),[z.onError,z.onPageNotFound,z.onUnhandledRejection],!1),X=["attached","onInit"],Z=["onLoad","onShow","onReady","onUnload","onHide"],nn="__HOOKED__";var en=function(){return Date.now()};function tn(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!m(n))return 0;var r,o=en();try{n.apply(this,e)}finally{r=en()}return r-o}function rn(n,e,r){var o=n[e];if(!o||!o[nn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){C(n)}return o.apply(this,n)}}),n[e]&&(n[e][nn]=!0),function(){n[e][nn]=!1,r=vn}}function on(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return On(t,((n={})[e]=null,n))})})}function an(n,e){e.addTearDown(function(){return xn(n,null)})}function un(n){return jn("route")[n]}function cn(n){return!!jn("route")[n]}function sn(n){return jn("http")[n]}function fn(n){return!!jn("http")[n]}function ln(){return jn("setData")}function pn(){return!!jn("performance")}function dn(){return jn("instance")}function hn(n){xn("instance",n)}var mn,vn=function(){},bn=y((mn="tt",[function(){return mn},function(n){return mn=n}]),2),gn=bn[0],yn=bn[1],_n=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},wn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:gn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},Sn="__slardar__global__0.2.4",En={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},kn=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?wn().instance:e)?e[Sn]||(e[Sn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},En),e&&(e[Sn]=t)}}}(d({},En)),xn=kn.setGlobalValue,On=kn.mergeGlobalValue,jn=kn.getGlobalValue,Tn=function(n){return jn("app")[n]},Cn=function(n){return jn("page")[n]},Pn=function(t,n){(n=void 0===n?$:n).forEach(function(e){cn(e)&&un(e).subscribe(function(n){return t(n,e)})})},Dn=function(){return jn("performance")},In=function(n){return jn("component")[n]};function Rn(n){return"function"==typeof n}function Nn(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Mn(n){return n}function An(t){return function(n){if((e=n)&&Rn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Fn(n){Rn(n)?n():null!=n&&n.unsubscribe()}var qn=function(n){return n instanceof zn||n&&"closed"in n&&Rn(n.remove)&&Rn(n.add)&&Rn(n.unsubscribe)},zn=(Ln.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Rn(t)&&t(),e&&(this._finalizers=null,e.forEach(Fn)))},Ln.prototype.remove=function(n){this._finalizers&&Nn(this._finalizers,n),n instanceof Ln&&n._removeParent(this)},Ln.prototype.add=function(n){if(n&&n!==this)if(this.closed)Fn(n);else{if(n instanceof Ln){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Ln.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Ln.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Ln.prototype._removeParent=function(n){this._parentage&&Nn(this._parentage,n)},Ln);function Ln(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Vn,Bn=(n(Un,Vn=zn),Un.prototype.next=function(n){this.isStopped||this.destination.next(n)},Un.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Un.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Un.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Vn.prototype.unsubscribe.call(this),this.destination=null)},Un.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Un);function Un(n){var e=Vn.call(this)||this;return e.isStopped=!1,e.destination=Kn(n)?n:new Hn(!(n=n)||Rn(n)?{next:null!=n?n:void 0}:n),e}var Hn=(Gn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Gn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Gn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Gn);function Gn(n){this.partialObserver=n}function Kn(n){return n instanceof Bn||n&&((e=n)&&Rn(e.next)&&Rn(e.error)&&Rn(e.complete))&&qn(n);var e}Jn.prototype.subscribe=function(n){var e=Kn(n)?n:new Bn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Jn.prototype.lift=function(n){var e=new Jn;return e.source=this,e.operator=n,e},Jn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Mn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Jn.prototype._subscribe=function(n){},Jn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},bn=Jn;function Jn(n){n&&(this._subscribe=n)}var Wn,kn=(n(Yn,Wn=bn),Yn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Yn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Yn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Yn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Yn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Yn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Yn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Yn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Yn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Yn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Yn.EMPTY:(t.push(n),new zn(function(){Nn(t,n)}))},Yn.EMPTY=((kn=new zn).closed=!0,kn),Yn);function Yn(){var n=null!==Wn&&Wn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var $n=new bn(function(n){return n.complete()});function Qn(r){return r<=0?function(){return $n}:An(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function Xn(r,o){return An(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function Zn(t){return Xn(function(n,e){return t<=e})}var ne,ee=(n(te,ne=kn),te.prototype.subscribe=function(n){var t=this,n=ne.prototype.subscribe.call(this,n);dn()&&dn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},te.prototype.unsubscribe=function(){ne.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},te.prototype.addTearDown=function(n){this.tearDownFns.push(n)},te);function te(){var n=null!==ne&&ne.apply(this,arguments)||this;return n.tearDownFns=[],n}function re(n){var e=n.reduce(function(n,e){return n[e]=new ee,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function oe(n){return 1<n.length?n:n.length&&n[0]||{}}function ie(n){var t=n.filter(function(n){return n=n,!!!jn("app")[n]}),n=re(t).subjectMap;On("app",n=n),on("app",n),App=_n(App,function(e){t.forEach(function(n){var r=Tn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:oe(n),time:en()}),m(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function ae(n){return n.route||n.__route__||n.url||n.path||""}function ue(n){function e(n,i){r.forEach(function(o){j(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];In(o).next({that:this,param:null,time:en()});var t=i[o];if(m(t)&&t.apply(this,n),m(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=_n(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function ce(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Pn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},Y),Cn("onLoad").pipe(Zn(1)).subscribe(function(n){r.load_start=n.time}),Cn("onShow").pipe(Zn(1)).subscribe(function(n){r.dom_end=n.time}),Cn("onReady").pipe(Zn(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Tn(z.onHide).subscribe(function(){!1===o&&(e(),t())})}function se(e){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];Dn().subscribe(function(n){~t.indexOf(n.name)&&e(n)})}function fe(e){In("attached").subscribe(function(n){n=n.that;return e.call(n)})}function le(n){return"android"===n.toLowerCase()}function pe(n){return le(n)?"Android":"ios"===n.toLowerCase()?"iOS":~je.indexOf(n.toLowerCase())?"Mac":~Te.indexOf(n.toLowerCase())?"windows":"unknown"}function de(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&le(e)&&t?r/t+" * "+n/t:r+" * "+n}function he(n){return(c(n)?Pe:Ce)(n)}function me(e){var n=Cn("onReady").subscribe(function(){var n;tt.performance&&(n=(tt.performance.getCurrentPageEntries()||[]).map(function(n){n.name,n.entryType;var e=h(n,["name","entryType"]),t=Ie(n);return t?d(d({},e),t):n}),e(n))});return{disconnect:function(){return n.unsubscribe()}}}function ve(n){var e=n.filter(function(n){return n=n,!!!jn("component")[n]}),n=re(e).subjectMap;On("component",n=n),on("component",n),ke().componentSubject(e)}function be(e){function n(n){J(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=_n(Component,n),Behavior=_n(Behavior,n)}catch(n){}}function ge(n,e){var t=n.filter(function(n){return n=n,!!!jn("page")[n]}),n=re(t).subjectMap;On("page",n=n),on("page",n),n=function(e){t.forEach(function(n){var r=Cn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(ae(this)&&r.next({that:this,param:oe(n),time:en()}),m(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=_n(Page,n),be(n)}function ye(n){var e=n.filter(function(n){return!cn(n)}),t=re(e).subjectMap;On("route",n=t),on("route",n),e.forEach(function(i){var n=rn(ke().instance,i,function(o){void 0===o&&(o={}),un(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:en()}),G.forEach(function(r){j(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];un(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:oe(n)||{}},time:en()}),m(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function _e(u,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:u,request:{url:e,method:(e=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:g(r),timestamp:en()},response:{}};j(n,"complete",function(a){return function(n){var e=c.response.timestamp||en();c.duration=e-c.request.timestamp,c.completeCallbackTime=tn(a,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:g(n.data),errMsg:i,timing:ke().buildRequestProfile(n.profile||{})},sn(u).next(c)}})(),j(n,"success",function(e){return function(n){c.response.timestamp=en(),c.response.status=200,c.successCallbackTime=tn(e,n)}})(),j(n,"fail",function(e){return function(n){c.response.timestamp=en(),c.response.status=-1,c.failCallbackTime=tn(e,n)}})()}function we(n,t){void 0===t&&(t=ke().instance);var e=n.filter(function(n){return!fn(n)}),r=re(e).subjectMap;On("http",n=r),on("http",n),e.forEach(function(e){var n=rn(t,e,function(n){_e(e,n)});n&&r[e].addTearDown(n)})}var Se,bn=y((Se={},[function(n){if(!wn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===wn().platform});return n&&(Se=n.adapterCtor())},function(){return Se}]),2),Ee=bn[0],ke=bn[1],xe=function(n){return"SLARDAR"+n},Oe=function(n){try{return ke().getStorage(n)}catch(n){return}},je=["darwin","macs","mac"],Te=["windows_nt","windows","window"],Ce=function(n){return{name:"unknown_error_name",message:g(n)}},Pe=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},De=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:de({width:i,height:o}),windowArea:de({width:u,height:a}),language:c,osName:pe(l),osVersion:f,SDKVersion:p,hostName:n,hostVersion:s}},Ie=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},Re="mars",kn={platform:Re,adapterCtor:function(){return d(d({},{instance:t=void 0===t?wn().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:Re,buildError:he,getSystemInfo:function(n){void 0===n&&(n="tt");var e,t="",r="",o="";return tt.getEnvInfoSync?(r=(e=tt.getEnvInfoSync().microapp).envType,t=e.appId,o=e.mpVersion):(r=tt.env.VERSION,t=""),d({appId:t,miniEnv:r,miniVersion:o,platform:n},De())}.bind(null,Re),observePerformance:me,performanceSubscriber:se,componentSubject:ue,pagePerfSubscriber:ce,setDataSubject:fe});var t}},Ne=function(n,e){void 0===e&&(e=W),n.on("init",function(){we(e)})};function Me(){var a=ae(this),u=ln();var n=rn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=en();return[o,function(){var n=r[1],e=en()-i;u.next({renderTime:e,url:a,data:o,startTime:i}),n&&n.call(t)}]});n&&u.addTearDown(n)}function Ae(){var n;jn("setData")||(n=(n=re(["setData"]).getSubject)("setData"),xn("setData",n),an("setData",n))}function Fe(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(Le.test(t)||Ve.test(r))||(n[e]=o[e]),n},{})}var qe=function(n){n.on("init",function(){Ae(),Cn("onLoad").subscribe(function(n){n=n.that;Me.call(n)}),ke().setDataSubject(Me)})},ze=function(n){n.on("init",function(){var e,n,t,r=ke();r.observePerformance&&!pn()&&(e=(0,re(["performance"]).getSubject)("performance"),xn("performance",n=e),an("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},Le=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Ve=new RegExp("(bearer|session)","i"),Be=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,a,u,c;!function(n,e){n=v(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,u=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Fe(e.headers||{}),c.headers=Fe(c.headers||{}),a=c.errMsg,n=h(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),a&&(n.err_msg=a),u={api:t,request:e,duration:r,cbTime:i+(o||0)+(u||0),response:n},!m(p)||(n=p(c.body,u))&&(u.extra=n,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};e&&sn("request").subscribe(n),t&&sn("downloadFile").subscribe(n),r&&sn("uploadFile").subscribe(n)}},Ue=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return C("applyMonitor",n),[]}};function He(n,e,t){hn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Ge(n,e){return n&&e&&n===e}function Ke(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Ge(e.message,t.message)&&!Ge(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var Je,We="http",Ye={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},$e=function(f){return void 0===f&&(f=ke()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,a=n.dedupe,u=v(e),c=Ke(),s=function(n,e,t){n=a?c(n):n;n&&(u&&u.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Tn(z.onError).subscribe(function(n){n=n.param,n=f.buildError(n);u&&u.test(n.message)||s(n)}),o&&Tn(z.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=g(e.reason);u&&u.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Pn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(bn=Je=Je||{}).history="history",bn.manual="manual";function Qe(t,n,r){var o=n,i=null,a=0,e="launch";function u(n,e){o=e,a=en(),r(e,i=e+"_"+a),t(n,e)}return Tn(z.onShow).pipe(Zn(1)).subscribe(function(){e="show"}),Pn(function(){e="history"}),[u,function(n){n&&(u(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,en()-a))}]}var Xe=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Qe(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],a=n[1],n=n[2];return t!==Je.manual&&(Cn("onShow").subscribe(function(n){return function(n){n=ae(n),n=i(n);a(n)}(n.that)}),Cn("onUnload").subscribe(n.bind(null,"unload")),Cn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Ze=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return W.forEach(function(n){fn(n)&&sn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Pn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},nt=function(){return function(n,t){var r=n.isCalculateSize;ln().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(g(n)).length:2*g(n).length)),t({ev_type:"set_data",payload:e})})}},et=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Tn(z.onLaunch).pipe(Qn(1)).subscribe(function(n){r.activate_start=n.time}),Tn(z.onShow).pipe(Qn(1)).subscribe(function(n){r.init_end=n.time}),Cn("onLoad").pipe(Qn(1)).subscribe(function(n){r.page_load_start=n.time}),Cn("onShow").pipe(Qn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=pn();Cn("onReady").pipe(Qn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&Dn().pipe(Xn(function(n){return"appClick"===n.name}),Qn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Tn(z.onHide).subscribe(function(){o||t()})}},rt=function(){return function(n,e){ke().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},ot=function(e){return void 0===e&&(e=ke()),function(n,t){var r,o;pn()&&e.performanceSubscriber&&(r=0,Cn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},it="pageview",at={routeMode:Je.history,setPidAndViewId:function(n,e){}},ut="jsError",ct={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},st=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},ft={maxBreadcrumbs:20,tap:!0},lt="breadcrumb",pt=function(e){e.on("init",function(){e.provide("_subscriptions",[]),hn(e),e.on("init",function(){ie(Q),ge(Z),ve(X)}),e.on("init",function(){ye($)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},dt="setData",ht={isCalculateSize:!1},mt="appLaunchPerf",vt={},bt="pagePerf",gt={},yt="performance",_t={},wt=function(n,e,t){void 0===t&&(t=ke());var r=e.url,o=e.data,i=e.success,a=void 0===i?l:i,u=e.fail,c=void 0===u?l:u,i=e.header,u={"Content-Type":"application/json"};J(e=i)&&0!==Object.keys(e).length&&Object.assign(u,i),t.request({method:n,url:r,data:o,header:u,headers:u,success:function(n){a(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},St=function(e){return(e=void 0===e?ke():e)?{get:function(n){return wt("GET",n,e)},post:function(n){return wt("POST",n,e)}}:{get:l,post:l}};function Et(n){return n=xe(String(n)),(n=Oe(n))&&n.userId&&n.deviceId?n:{userId:D(),deviceId:D()}}function kt(n){return n+"_"+Date.now()}function xt(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{ke().setStorage(n,e)}catch(n){}}(xe(String(e)),{userId:t,deviceId:n})}var Ot={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},jt="/monitor_mini/collect",Tt="/settings/minipro",Ct="apmplus.volces.com",Pt="session",Dt={sample_rate:1,include_users:[],sample_granularity:Pt,rules:{}},It=[jt,Tt],Rt="0.2.4",Nt="APM_PLUS_MINI_PROGRAM",Mt=function(n,e){return void 0===e&&(e=jt),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function At(n){n=Et(n.aid);return{aid:0,token:"",pid:"",viewId:kt("_"),userId:n.userId,deviceId:n.deviceId,sessionId:D(),domain:Ct,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:It},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Dt,sdkName:Nt,sdkVersion:Rt}}function Ft(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function qt(n){return S(n)&&"aid"in n&&"token"in n}function zt(n){return d({},n)}var Lt=function(e){var r,o,i=e,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return a=d(d({},a),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):u?f():(e=i.domain,n=i.aid,t=function(n){u=n,f()},St().get({url:function(n,e){return void 0===e&&(e=Tt),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){xt(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),a);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),n.sample=Vt(Vt(e.sample,null==o?void 0:o.sample),a.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?Pt:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(u),function(n){n=xe(n);return!!ke().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Vt(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Bt(n){var e={url:(e=ke().getCurrentPages().pop())?(e?ae(e):"")+s(e.options):"",timestamp:en()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function Ut(n){if(!Ee(n))throw Error(H);var t,n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,a=n.createConfigManager,u=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=I(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)x("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=a(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(u(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(m,n)?x("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h=[]}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(n,e){"init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d?e():f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=k(f[n],e))},destroyAgent:v},m=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:qt,initConfigNormalizer:Ft,userConfigNormalizer:zt,createSender:function(n){return e({size:K,endpoint:Mt(n.domain),transport:St()})},builder:Ot,createDefaultConfig:At,createConfigManager:Lt});return R(n),Wt(n),Gt(n),Kt(n),L(n),pt(n),(t=n).on("init",function(){var e=[],n=t.config();n&&n.integrations&&n.integrations.forEach(function(n){E(e,n.name)||(e.push(n.name),n.setup(t),n.tearDown&&t.on("beforeDestroy",n.tearDown))})}),Jt(n),Ht(n),n}var Ht=function(e){function t(n){return void 0===n&&(n=ke().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,a=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),a=!0}),e.on("init",function(){Tn(z.onLaunch).pipe(Qn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),a&&r()}),ke().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Gt=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Kt=function(n){n.on("report",Bt)},Jt=function(e){e.on("init",function(){Tn(z.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},Wt=function(t){var r,o=!1;t.on("init",function(){r=en(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=en())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return yn("mars"),function(n){var e,t,r,i,o,a,u,c,s,n=Ut(n);if(n)return(e=n).provide("sendEvent",function(n){n=B(n);n&&e.report({ev_type:V,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=U(n);n&&e.report({ev_type:V,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=He(t,it,at);e&&(e=(n=y(Ue(Xe,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=He(r,ut,ct);e&&(n=st(r),n=y(Ue($e,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=He(i,We,Ye);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Ne(i,r),Ue(Be,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=He(o,dt,ht);n&&(qe(o),Ue(nt,n,o.report.bind(o)))}),(a=n).on("init",function(){var n,e=He(a,lt,ft);e&&(e=(n=y(Ue(Ze,e,function(n){}),2))[0],n=n[1],a.provide("getBreadcrumbs",e),a.provide("addBreadcrumb",n))}),(u=n).on("init",function(){var n=He(u,mt,vt);n&&(ze(u),Ue(et,n,u.report.bind(u)))}),(c=n).on("init",function(){var n=He(c,bt,gt);n&&Ue(rt,n,c.report.bind(c))}),(s=n).on("init",function(){var n=He(s,yt,_t);n&&(ze(s),Ue(ot,n,s.report.bind(s)))}),n}.bind(null,[kn])()}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).marsClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,a=void 0===n?1e3:n,u=[],c=0;function s(){var e;u.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(n){i=n},setWait:function(n){a=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){u.push(n),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(n=u,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),u=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function h(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function m(n){return"function"==typeof n}function u(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):a(e[t])&&a(n[t])?o[t]=function e(n,t){n=a(n)?n:[];t=a(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):a(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!a(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function k(n,e){if(!a(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function v(n){return a(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function g(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function x(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),T(""+D++)],y(n),!1))}function o(n){return Math.random()<Number(n)}function f(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){P(n)}return e}}var j=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(n),!1)),o=r;return m(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return m(t)&&t.apply(this,e)}}),i[a]=o,function(n){n||(o===i[a]?i[a]=t:r=t)}}},T="".padStart?function(n,e){return n.padStart(e=void 0===e?8:e," ")}:function(n){return n},C=0,P=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),T(""+C++)],y(n),!1))},D=0;function I(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function R(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,e,t){i[n]?i[n].push([e,t]):i[n]=[[e,t]],o&&r(t)},has:function(n){return!!i[n]},remove:e,removeByEvType:function(e){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===e&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){e(n)})}}}var N=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=g(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=g(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function M(r,o){r.on("init",function(){function n(n){n.forEach(function(n){var e=n.name;E(t,e)||(t.push(e),n.setup(r),o&&o(e,n.setup),r.destroyAgent.set(e,e,[function(){t=k(t,e),n.tearDown&&n.tearDown()}]))})}var t=[];r.provide("applyIntegrations",n);var e=r.config();e&&e.integrations&&n(e.integrations)})}function A(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function F(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function q(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":u(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function z(e,n){try{return"rule"===n.type?q(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return z(e,n)}):n.children.some(function(n){return z(e,n)})}catch(n){return!1}}function L(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return A(n,1)};var c,s,f,l,p,d,h,m=F(a="session"===a,o,t,e,r),v=(c=u,s=a,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:F(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:F(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!m())return!1;if(!(n.ev_type in v))return A(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(z(n,t[r].filter))return!!t[r].hit()&&A(n,t[r].effectiveSampleRate);return!!e.hit()&&A(n,e.effectiveSampleRate)}}var V,B=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=L(e,n,o,f);t.on("build",n)})},U="custom",H=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,a={};for(o in i)a[o]=g(i[o]);e.categories=a}return e}},G=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:g(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=g(r[t]);e.metrics=o,e.categories=i}return e}},K="Adapters imported incorrectly",J=["success","fail","complete"],W=20;(On=V=V||{}).onLaunch="onLaunch",On.onShow="onShow",On.onHide="onHide",On.onError="onError",On.onPageNotFound="onPageNotFound",On.onUnhandledRejection="onUnhandledRejection";function Y(n){return"[object Object]"===Object.prototype.toString.call(n)}var $=["request","downloadFile","uploadFile"],Q=["navigateTo","redirectTo","switchTab","reLaunch"],X=_(_([],y(Q),!1),["navigateBack"],!1),Z=_(_([],y([V.onLaunch,V.onShow,V.onHide]),!1),[V.onError,V.onPageNotFound,V.onUnhandledRejection],!1),nn=["attached","onInit"],en=["onLoad","onShow","onReady","onUnload","onHide"],tn="__HOOKED__";var rn=function(){return Date.now()};function on(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!m(n))return 0;var r,o=rn();try{n.apply(this,e)}finally{r=rn()}return r-o}function an(n,e,r){var o=n[e];if(!o||!o[tn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){P(n)}return o.apply(this,n)}}),n[e]&&(n[e][tn]=!0),function(){n[e][tn]=!1,r=gn}}function un(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return Tn(t,((n={})[e]=null,n))})})}function cn(n,e){e.addTearDown(function(){return jn(n,null)})}function sn(n){return Cn("route")[n]}function fn(n){return!!Cn("route")[n]}function ln(n){return Cn("http")[n]}function pn(n){return!!Cn("http")[n]}function dn(){return Cn("setData")}function hn(){return!!Cn("performance")}function mn(){return Cn("instance")}function vn(n){jn("instance",n)}var bn,gn=function(){},yn=y((bn="tt",[function(){return bn},function(n){return bn=n}]),2),_n=yn[0],wn=yn[1],Sn=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},En=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:_n()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},kn="__slardar__global__0.2.5-alpha.0",xn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},On=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?En().instance:e)?e[kn]||(e[kn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},xn),e&&(e[kn]=t)}}}(d({},xn)),jn=On.setGlobalValue,Tn=On.mergeGlobalValue,Cn=On.getGlobalValue,Pn=function(n){return Cn("app")[n]},Dn=function(n){return Cn("page")[n]},In=function(t,n){(n=void 0===n?X:n).forEach(function(e){fn(e)&&sn(e).subscribe(function(n){return t(n,e)})})},Rn=function(){return Cn("performance")},Nn=function(n){return Cn("component")[n]};function Mn(n){return"function"==typeof n}function An(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Fn(n){return n}function qn(t){return function(n){if((e=n)&&Mn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function zn(n){Mn(n)?n():null!=n&&n.unsubscribe()}var Ln=function(n){return n instanceof Vn||n&&"closed"in n&&Mn(n.remove)&&Mn(n.add)&&Mn(n.unsubscribe)},Vn=(Bn.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Mn(t)&&t(),e&&(this._finalizers=null,e.forEach(zn)))},Bn.prototype.remove=function(n){this._finalizers&&An(this._finalizers,n),n instanceof Bn&&n._removeParent(this)},Bn.prototype.add=function(n){if(n&&n!==this)if(this.closed)zn(n);else{if(n instanceof Bn){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Bn.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Bn.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Bn.prototype._removeParent=function(n){this._parentage&&An(this._parentage,n)},Bn);function Bn(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Un,Hn=(n(Gn,Un=Vn),Gn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Gn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Gn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Gn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Un.prototype.unsubscribe.call(this),this.destination=null)},Gn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Gn);function Gn(n){var e=Un.call(this)||this;return e.isStopped=!1,e.destination=Wn(n)?n:new Kn(!(n=n)||Mn(n)?{next:null!=n?n:void 0}:n),e}var Kn=(Jn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Jn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Jn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Jn);function Jn(n){this.partialObserver=n}function Wn(n){return n instanceof Hn||n&&((e=n)&&Mn(e.next)&&Mn(e.error)&&Mn(e.complete))&&Ln(n);var e}Yn.prototype.subscribe=function(n){var e=Wn(n)?n:new Hn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Yn.prototype.lift=function(n){var e=new Yn;return e.source=this,e.operator=n,e},Yn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Fn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Yn.prototype._subscribe=function(n){},Yn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},yn=Yn;function Yn(n){n&&(this._subscribe=n)}var $n,On=(n(Qn,$n=yn),Qn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Qn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Qn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Qn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Qn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Qn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Qn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Qn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Qn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Qn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Qn.EMPTY:(t.push(n),new Vn(function(){An(t,n)}))},Qn.EMPTY=((On=new Vn).closed=!0,On),Qn);function Qn(){var n=null!==$n&&$n.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var Xn=new yn(function(n){return n.complete()});function Zn(r){return r<=0?function(){return Xn}:qn(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function ne(r,o){return qn(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function ee(t){return ne(function(n,e){return t<=e})}var te,re=(n(oe,te=On),oe.prototype.subscribe=function(n){var t=this,n=te.prototype.subscribe.call(this,n);mn()&&mn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},oe.prototype.unsubscribe=function(){te.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},oe.prototype.addTearDown=function(n){this.tearDownFns.push(n)},oe);function oe(){var n=null!==te&&te.apply(this,arguments)||this;return n.tearDownFns=[],n}function ie(n){var e=n.reduce(function(n,e){return n[e]=new re,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function ae(n){return 1<n.length?n:n.length&&n[0]||{}}function ue(n){var t=n.filter(function(n){return n=n,!!!Cn("app")[n]}),n=ie(t).subjectMap;Tn("app",n=n),un("app",n),App=Sn(App,function(e){t.forEach(function(n){var r=Pn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:ae(n),time:rn()}),m(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function ce(n){return n.route||n.__route__||n.url||n.path||""}function se(n){function e(n,i){r.forEach(function(o){j(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Nn(o).next({that:this,param:null,time:rn()});var t=i[o];if(m(t)&&t.apply(this,n),m(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=Sn(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function fe(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;In(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},Q),Dn("onLoad").pipe(ee(1)).subscribe(function(n){r.load_start=n.time}),Dn("onShow").pipe(ee(1)).subscribe(function(n){r.dom_end=n.time}),Dn("onReady").pipe(ee(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Pn(V.onHide).subscribe(function(){!1===o&&(e(),t())})}function le(e){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];Rn().subscribe(function(n){~t.indexOf(n.name)&&e(n)})}function pe(e){Nn("attached").subscribe(function(n){n=n.that;return e.call(n)})}function de(n){return"android"===n.toLowerCase()}function he(n){return de(n)?"Android":"ios"===n.toLowerCase()?"iOS":~Ce.indexOf(n.toLowerCase())?"Mac":~Pe.indexOf(n.toLowerCase())?"windows":"unknown"}function me(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&de(e)&&t?r/t+" * "+n/t:r+" * "+n}function ve(n){return(c(n)?Ie:De)(n)}function be(e){var n=Dn("onReady").subscribe(function(){var n;tt.performance&&(n=(tt.performance.getCurrentPageEntries()||[]).map(function(n){n.name,n.entryType;var e=h(n,["name","entryType"]),t=Ne(n);return t?d(d({},e),t):n}),e(n))});return{disconnect:function(){return n.unsubscribe()}}}function ge(n){var e=n.filter(function(n){return n=n,!!!Cn("component")[n]}),n=ie(e).subjectMap;Tn("component",n=n),un("component",n),Oe().componentSubject(e)}function ye(e){function n(n){Y(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=Sn(Component,n),Behavior=Sn(Behavior,n)}catch(n){}}function _e(n,e){var t=n.filter(function(n){return n=n,!!!Cn("page")[n]}),n=ie(t).subjectMap;Tn("page",n=n),un("page",n),n=function(e){t.forEach(function(n){var r=Dn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(ce(this)&&r.next({that:this,param:ae(n),time:rn()}),m(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=Sn(Page,n),ye(n)}function we(n){var e=n.filter(function(n){return!fn(n)}),t=ie(e).subjectMap;Tn("route",n=t),un("route",n),e.forEach(function(i){var n=an(Oe().instance,i,function(o){void 0===o&&(o={}),sn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:rn()}),J.forEach(function(r){j(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];sn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:ae(n)||{}},time:rn()}),m(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function Se(u,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:u,request:{url:e,method:(e=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:g(r),timestamp:rn()},response:{}};j(n,"complete",function(a){return function(n){var e=c.response.timestamp||rn();c.duration=e-c.request.timestamp,c.completeCallbackTime=on(a,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:g(n.data),errMsg:i,timing:Oe().buildRequestProfile(n.profile||{})},ln(u).next(c)}})(),j(n,"success",function(e){return function(n){c.response.timestamp=rn(),c.response.status=200,c.successCallbackTime=on(e,n)}})(),j(n,"fail",function(e){return function(n){c.response.timestamp=rn(),c.response.status=-1,c.failCallbackTime=on(e,n)}})()}function Ee(n,t){void 0===t&&(t=Oe().instance);var e=n.filter(function(n){return!pn(n)}),r=ie(e).subjectMap;Tn("http",n=r),un("http",n),e.forEach(function(e){var n=an(t,e,function(n){Se(e,n)});n&&r[e].addTearDown(n)})}var ke,yn=y((ke={},[function(n){if(!En().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===En().platform});return n&&(ke=n.adapterCtor())},function(){return ke}]),2),xe=yn[0],Oe=yn[1],je=function(n){return"SLARDAR"+n},Te=function(n){try{return Oe().getStorage(n)}catch(n){return}},Ce=["darwin","macs","mac"],Pe=["windows_nt","windows","window"],De=function(n){return{name:"unknown_error_name",message:g(n)}},Ie=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},Re=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:me({width:i,height:o}),windowArea:me({width:u,height:a}),language:c,osName:he(l),osVersion:f,SDKVersion:p,hostName:n,hostVersion:s}},Ne=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},Me="mars",On={platform:Me,adapterCtor:function(){return d(d({},{instance:t=void 0===t?En().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:Me,buildError:ve,getSystemInfo:function(n){void 0===n&&(n="tt");var e,t="",r="",o="";return tt.getEnvInfoSync?(r=(e=tt.getEnvInfoSync().microapp).envType,t=e.appId,o=e.mpVersion):(r=tt.env.VERSION,t=""),d({appId:t,miniEnv:r,miniVersion:o,platform:n},Re())}.bind(null,Me),observePerformance:be,performanceSubscriber:le,componentSubject:se,pagePerfSubscriber:fe,setDataSubject:pe});var t}},Ae=function(n,e){void 0===e&&(e=$),n.on("init",function(){Ee(e)})};function Fe(){var a=ce(this),u=dn();var n=an(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=rn();return[o,function(){var n=r[1],e=rn()-i;u.next({renderTime:e,url:a,data:o,startTime:i}),n&&n.call(t)}]});n&&u.addTearDown(n)}function qe(){var n;Cn("setData")||(n=(n=ie(["setData"]).getSubject)("setData"),jn("setData",n),cn("setData",n))}function ze(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(Be.test(t)||Ue.test(r))||(n[e]=o[e]),n},{})}var Le=function(n){n.on("init",function(){qe(),Dn("onLoad").subscribe(function(n){n=n.that;Fe.call(n)}),Oe().setDataSubject(Fe)})},Ve=function(n){n.on("init",function(){var e,n,t,r=Oe();r.observePerformance&&!hn()&&(e=(0,ie(["performance"]).getSubject)("performance"),jn("performance",n=e),cn("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},Be=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Ue=new RegExp("(bearer|session)","i"),He=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,a,u,c;!function(n,e){n=v(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,u=n.successCallbackTime,i=n.completeCallbackTime,e.headers=ze(e.headers||{}),c.headers=ze(c.headers||{}),a=c.errMsg,n=h(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),a&&(n.err_msg=a),u={api:t,request:e,duration:r,cbTime:i+(o||0)+(u||0),response:n},!m(p)||(n=p(c.body,u))&&(u.extra=n,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};e&&ln("request").subscribe(n),t&&ln("downloadFile").subscribe(n),r&&ln("uploadFile").subscribe(n)}},Ge=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return P("applyMonitor",n),[]}};function Ke(n,e,t){vn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Je(n,e){return n&&e&&n===e}function We(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Je(e.message,t.message)&&!Je(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var Ye,$e="http",Qe={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Xe=function(f){return void 0===f&&(f=Oe()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,a=n.dedupe,u=v(e),c=We(),s=function(n,e,t){n=a?c(n):n;n&&(u&&u.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Pn(V.onError).subscribe(function(n){n=n.param,n=f.buildError(n);u&&u.test(n.message)||s(n)}),o&&Pn(V.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=g(e.reason);u&&u.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&In(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(yn=Ye=Ye||{}).history="history",yn.manual="manual";function Ze(t,n,r){var o=n,i=null,a=0,e="launch";function u(n,e){o=e,a=rn(),r(e,i=e+"_"+a),t(n,e)}return Pn(V.onShow).pipe(ee(1)).subscribe(function(){e="show"}),In(function(){e="history"}),[u,function(n){n&&(u(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,rn()-a))}]}var nt=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Ze(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],a=n[1],n=n[2];return t!==Ye.manual&&(Dn("onShow").subscribe(function(n){return function(n){n=ce(n),n=i(n);a(n)}(n.that)}),Dn("onUnload").subscribe(n.bind(null,"unload")),Dn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},et=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return $.forEach(function(n){pn(n)&&ln(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),In(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},rt=function(){return function(n,t){var r=n.isCalculateSize;dn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(g(n)).length:2*g(n).length)),t({ev_type:"set_data",payload:e})})}},ot=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Pn(V.onLaunch).pipe(Zn(1)).subscribe(function(n){r.activate_start=n.time}),Pn(V.onShow).pipe(Zn(1)).subscribe(function(n){r.init_end=n.time}),Dn("onLoad").pipe(Zn(1)).subscribe(function(n){r.page_load_start=n.time}),Dn("onShow").pipe(Zn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=hn();Dn("onReady").pipe(Zn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&Rn().pipe(ne(function(n){return"appClick"===n.name}),Zn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Pn(V.onHide).subscribe(function(){o||t()})}},it=function(){return function(n,e){Oe().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},at=function(e){return void 0===e&&(e=Oe()),function(n,t){var r,o;hn()&&e.performanceSubscriber&&(r=0,Dn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},ut="pageview",ct={routeMode:Ye.history,setPidAndViewId:function(n,e){}},st="jsError",ft={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},lt=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},pt={maxBreadcrumbs:20,tap:!0},dt="breadcrumb",ht=function(e){e.on("init",function(){e.provide("_subscriptions",[]),vn(e),e.on("init",function(){ue(Z),_e(en),ge(nn)}),e.on("init",function(){we(X)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},mt="setData",vt={isCalculateSize:!1},bt="appLaunchPerf",gt={},yt="pagePerf",_t={},wt="performance",St={},Et=function(n,e,t){void 0===t&&(t=Oe());var r=e.url,o=e.data,i=e.success,a=void 0===i?l:i,u=e.fail,c=void 0===u?l:u,i=e.header,u={"Content-Type":"application/json"};Y(e=i)&&0!==Object.keys(e).length&&Object.assign(u,i),t.request({method:n,url:r,data:o,header:u,headers:u,success:function(n){a(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},kt=function(e){return(e=void 0===e?Oe():e)?{get:function(n){return Et("GET",n,e)},post:function(n){return Et("POST",n,e)}}:{get:l,post:l}};function xt(n){return n=je(String(n)),(n=Te(n))&&n.userId&&n.deviceId?n:{userId:I(),deviceId:I()}}function Ot(n){return n+"_"+Date.now()}function jt(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{Oe().setStorage(n,e)}catch(n){}}(je(String(e)),{userId:t,deviceId:n})}var Tt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},Ct="/monitor_mini/collect",Pt="/settings/minipro",Dt="apmplus.volces.com",It="session",Rt={sample_rate:1,include_users:[],sample_granularity:It,rules:{}},Nt=[Ct,Pt],Mt="0.2.5-alpha.0",At="APM_PLUS_MINI_PROGRAM",Ft=function(n,e){return void 0===e&&(e=Ct),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function qt(n){n=xt(n.aid);return{aid:0,token:"",pid:"",viewId:Ot("_"),userId:n.userId,deviceId:n.deviceId,sessionId:I(),domain:Dt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Nt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Rt,sdkName:At,sdkVersion:Mt}}function zt(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function Lt(n){return S(n)&&"aid"in n&&"token"in n}function Vt(n){return d({},n)}var Bt=function(e){var r,o,i=e,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return a=d(d({},a),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):u?f():(e=i.domain,n=i.aid,t=function(n){u=n,f()},kt().get({url:function(n,e){return void 0===e&&(e=Pt),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){jt(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),a);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),n.sample=Ut(Ut(e.sample,null==o?void 0:o.sample),a.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?It:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(u),function(n){n=je(n);return!!Oe().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Ut(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Ht(n){var e={url:(e=Oe().getCurrentPages().pop())?(e?ce(e):"")+s(e.options):"",timestamp:rn()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function Gt(n){if(!xe(n))throw Error(K);return n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,a=n.createConfigManager,u=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=R(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)x("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=a(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(u(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(m,n)?x("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h.length=0}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){v.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(n,e){if("init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d)try{e()}catch(n){}else f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=k(f[n],e))},destroyAgent:v},m=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:Lt,initConfigNormalizer:zt,userConfigNormalizer:Vt,createSender:function(n){return e({size:W,endpoint:Ft(n.domain),transport:kt()})},builder:Tt,createDefaultConfig:qt,createConfigManager:Bt}),N(n),$t(n),Jt(n),Wt(n),B(n),ht(n),M(n),Yt(n),Kt(n),n}var Kt=function(e){function t(n){return void 0===n&&(n=Oe().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,a=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),a=!0}),e.on("init",function(){Pn(V.onLaunch).pipe(Zn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),a&&r()}),Oe().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Jt=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Wt=function(n){n.on("report",Ht)},Yt=function(e){e.on("init",function(){Pn(V.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},$t=function(t){var r,o=!1;t.on("init",function(){r=rn(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=rn())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return wn("mars"),function(n){var e,t,r,i,o,a,u,c,s,n=Gt(n);if(n)return(e=n).provide("sendEvent",function(n){n=H(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=G(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Ke(t,ut,ct);e&&(e=(n=y(Ge(nt,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Ke(r,st,ft);e&&(n=lt(r),n=y(Ge(Xe,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Ke(i,$e,Qe);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Ae(i,r),Ge(He,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Ke(o,mt,vt);n&&(Le(o),Ge(rt,n,o.report.bind(o)))}),(a=n).on("init",function(){var n,e=Ke(a,dt,pt);e&&(e=(n=y(Ge(et,e,function(n){}),2))[0],n=n[1],a.provide("getBreadcrumbs",e),a.provide("addBreadcrumb",n))}),(u=n).on("init",function(){var n=Ke(u,bt,gt);n&&(Ve(u),Ge(ot,n,u.report.bind(u)))}),(c=n).on("init",function(){var n=Ke(c,yt,_t);n&&Ge(it,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Ke(s,wt,St);n&&(Ve(s),Ge(at,n,s.report.bind(s)))}),n}.bind(null,[On])()}); |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).myClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,u=void 0===n?1e3:n,a=[],c=0;function s(){var e;a.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){a.push(n),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(n=a,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),a=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function u(n){return"[object Array]"===t.toString.call(n)}function h(n){return"function"==typeof n}function a(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):u(e[t])&&u(n[t])?o[t]=function e(n,t){n=u(n)?n:[];t=u(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):u(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!u(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function x(n,e){if(!u(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function m(n){return u(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function v(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function f(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(n),!1)),o=r;return h(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return h(t)&&t.apply(this,e)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=t:r=t)}}}function k(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),(""+C++).padStart(8," ")],y(n),!1))}function o(n){return Math.random()<Number(n)}function g(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){T(n)}return e}}var j=0,T=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),(""+j++).padStart(8," ")],y(n),!1))},C=0;function P(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function D(){function t(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){r[n]&&r[n].forEach(function(n){t(n[1])}),r[n]=void 0}var r={};return{set:function(n,e,t){r[n]?r[n].push([e,t]):r[n]=[[e,t]]},remove:e,removeByEvType:function(e){Object.keys(r).forEach(function(n){r[n]&&r[n].forEach(function(n){n[0]===e&&t(n[1])})})},clear:function(){Object.keys(r).forEach(function(n){e(n)})}}}var I=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=v(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=v(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function R(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function M(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function N(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":a(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function A(e,n){try{return"rule"===n.type?N(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return A(e,n)}):n.children.some(function(n){return A(e,n)})}catch(n){return!1}}function F(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,u=e.sample_granularity,a=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return R(n,1)};var c,s,f,l,p,d,h,m=M(u="session"===u,o,t,e,r),v=(c=a,s=u,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:M(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!m())return!1;if(!(n.ev_type in v))return R(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(A(n,t[r].filter))return!!t[r].hit()&&R(n,t[r].effectiveSampleRate);return!!e.hit()&&R(n,e.effectiveSampleRate)}}var q,z=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=F(e,n,o,g);t.on("build",n)})},L="custom",V=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=v(i[o]);e.categories=u}return e}},B=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:v(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=v(r[t]);e.metrics=o,e.categories=i}return e}},U="Adapters imported incorrectly",H=["success","fail","complete"],G=20;(xn=q=q||{}).onLaunch="onLaunch",xn.onShow="onShow",xn.onHide="onHide",xn.onError="onError",xn.onPageNotFound="onPageNotFound",xn.onUnhandledRejection="onUnhandledRejection";function K(n){return"[object Object]"===Object.prototype.toString.call(n)}var J=["request","downloadFile","uploadFile"],W=["navigateTo","redirectTo","switchTab","reLaunch"],Y=_(_([],y(W),!1),["navigateBack"],!1),$=_(_([],y([q.onLaunch,q.onShow,q.onHide]),!1),[q.onError,q.onPageNotFound,q.onUnhandledRejection],!1),Q=["attached","onInit"],X=["onLoad","onShow","onReady","onUnload","onHide"],Z="unknown_error_name",nn="__HOOKED__";function en(){return Date.now()}function tn(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!h(n))return 0;var r,o=en();try{n.apply(this,e)}finally{r=en()}return r-o}var rn,on=function(){},un=y((rn="tt",[function(){return rn},function(n){return rn=n}]),2),an=un[0];un[1];function cn(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function sn(n,e,r){var o=n[e];if(!o||!o[nn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){T(n)}return o.apply(this,n)}}),n[e]&&(n[e][nn]=!0),function(){n[e][nn]=!1,r=on}}function fn(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return On(t,((n={})[e]=null,n))})})}function ln(n,e){e.addTearDown(function(){return kn(n,null)})}function pn(n){return jn("route")[n]}function dn(n){return!!jn("route")[n]}function hn(n){return jn("http")[n]}function mn(n){return!!jn("http")[n]}function vn(){return jn("setData")}function bn(){return!!jn("performance")}function gn(n){return jn("component")[n]}function yn(){return jn("instance")}function _n(n){kn("instance",n)}var wn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:an()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},Sn="__slardar__global__0.2.4",En={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},xn=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?wn().instance:e)?e[Sn]||(e[Sn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},En),e&&(e[Sn]=t)}}}(d({},En)),kn=xn.setGlobalValue,On=xn.mergeGlobalValue,jn=xn.getGlobalValue,Tn=function(n){return jn("app")[n]},Cn=function(n){return jn("page")[n]},Pn=function(t,n){(n=void 0===n?Y:n).forEach(function(e){dn(e)&&pn(e).subscribe(function(n){return t(n,e)})})};function Dn(n){return"function"==typeof n}function In(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Rn(n){return n}function Mn(t){return function(n){if((e=n)&&Dn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Nn(n){Dn(n)?n():null!=n&&n.unsubscribe()}var An=function(n){return n instanceof Fn||n&&"closed"in n&&Dn(n.remove)&&Dn(n.add)&&Dn(n.unsubscribe)},Fn=(qn.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Dn(t)&&t(),e&&(this._finalizers=null,e.forEach(Nn)))},qn.prototype.remove=function(n){this._finalizers&&In(this._finalizers,n),n instanceof qn&&n._removeParent(this)},qn.prototype.add=function(n){if(n&&n!==this)if(this.closed)Nn(n);else{if(n instanceof qn){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},qn.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},qn.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},qn.prototype._removeParent=function(n){this._parentage&&In(this._parentage,n)},qn);function qn(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var zn,Ln=(n(Vn,zn=Fn),Vn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Vn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Vn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Vn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,zn.prototype.unsubscribe.call(this),this.destination=null)},Vn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Vn);function Vn(n){var e=zn.call(this)||this;return e.isStopped=!1,e.destination=Hn(n)?n:new Bn(!(n=n)||Dn(n)?{next:null!=n?n:void 0}:n),e}var Bn=(Un.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Un.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Un.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Un);function Un(n){this.partialObserver=n}function Hn(n){return n instanceof Ln||n&&((e=n)&&Dn(e.next)&&Dn(e.error)&&Dn(e.complete))&&An(n);var e}Gn.prototype.subscribe=function(n){var e=Hn(n)?n:new Ln(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Gn.prototype.lift=function(n){var e=new Gn;return e.source=this,e.operator=n,e},Gn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Rn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Gn.prototype._subscribe=function(n){},Gn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},un=Gn;function Gn(n){n&&(this._subscribe=n)}var Kn,xn=(n(Jn,Kn=un),Jn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Jn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Jn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Jn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Jn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Jn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Jn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Jn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Jn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Jn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Jn.EMPTY:(t.push(n),new Fn(function(){In(t,n)}))},Jn.EMPTY=((xn=new Fn).closed=!0,xn),Jn);function Jn(){var n=null!==Kn&&Kn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var Wn=new un(function(n){return n.complete()});function Yn(r){return r<=0?function(){return Wn}:Mn(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function $n(r,o){return Mn(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function Qn(t){return $n(function(n,e){return t<=e})}var Xn,Zn=(n(ne,Xn=xn),ne.prototype.subscribe=function(n){var t=this,n=Xn.prototype.subscribe.call(this,n);yn()&&yn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},ne.prototype.unsubscribe=function(){Xn.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},ne.prototype.addTearDown=function(n){this.tearDownFns.push(n)},ne);function ne(){var n=null!==Xn&&Xn.apply(this,arguments)||this;return n.tearDownFns=[],n}function ee(n){var e=n.reduce(function(n,e){return n[e]=new Zn,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function te(n){return 1<n.length?n:n.length&&n[0]||{}}function re(n){var t=n.filter(function(n){return n=n,!!!jn("app")[n]}),n=ee(t).subjectMap;On("app",n=n),fn("app",n),App=cn(App,function(e){t.forEach(function(n){var r=Tn(n),n=f(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:te(n),time:en()}),h(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function oe(n){return n.route||n.__route__||n.url||n.path||""}function ie(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Pn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},W),Cn("onLoad").pipe(Qn(1)).subscribe(function(n){r.load_start=n.time}),Cn("onShow").pipe(Qn(1)).subscribe(function(n){r.dom_end=n.time}),Cn("onReady").pipe(Qn(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Tn(q.onHide).subscribe(function(){!1===o&&(e(),t())})}function ue(n){return"android"===n.toLowerCase()}function ae(){var n="",e="",t="";my.getAccountInfoSync?(d=my.getAccountInfoSync().miniProgram,e=d.envVersion,n=d.appId,t=d.version):(n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}}));var r=(h=my.getSystemInfoSync()).model,o=h.brand,i=h.pixelRatio,u=h.screenHeight,a=h.screenWidth,c=h.windowHeight,s=h.windowWidth,f=h.language,l=h.version,p=h.system,d=h.platform,h=h.app;return{model:r,brand:o,pixelRatio:i,screenArea:Se({pixelRatio:i,width:a,height:u,systemPlatform:d}),windowArea:Se({width:s,height:c}),language:f,osName:we(d),osVersion:p,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:h,hostVersion:l,platform:"my"}}function ce(n){var e=n.filter(function(n){return n=n,!!!jn("component")[n]}),n=ee(e).subjectMap;On("component",n=n),fn("component",n),ve().componentSubject(e)}function se(e){function n(n){K(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=cn(Component,n),Behavior=cn(Behavior,n)}catch(n){}}function fe(n,e){var t=n.filter(function(n){return n=n,!!!jn("page")[n]}),n=ee(t).subjectMap;On("page",n=n),fn("page",n),n=function(e){t.forEach(function(n){var r=Cn(n),n=f(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(oe(this)&&r.next({that:this,param:te(n),time:en()}),h(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=cn(Page,n),se(n)}function le(n){var e=n.filter(function(n){return!dn(n)}),t=ee(e).subjectMap;On("route",n=t),fn("route",n),e.forEach(function(i){var n=sn(ve().instance,i,function(o){void 0===o&&(o={}),pn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:en()}),H.forEach(function(r){f(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];pn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:te(n)||{}},time:en()}),h(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function pe(a,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:a,request:{url:e,method:(e=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:v(r),timestamp:en()},response:{}};f(n,"complete",function(u){return function(n){var e=c.response.timestamp||en();c.duration=e-c.request.timestamp,c.completeCallbackTime=tn(u,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:v(n.data),errMsg:i,timing:ve().buildRequestProfile(n.profile||{})},hn(a).next(c)}})(),f(n,"success",function(e){return function(n){c.response.timestamp=en(),c.response.status=200,c.successCallbackTime=tn(e,n)}})(),f(n,"fail",function(e){return function(n){c.response.timestamp=en(),c.response.status=-1,c.failCallbackTime=tn(e,n)}})()}function de(n,t){void 0===t&&(t=ve().instance);var e=n.filter(function(n){return!mn(n)}),r=ee(e).subjectMap;On("http",n=r),fn("http",n),e.forEach(function(e){var n=sn(t,e,function(n){pe(e,n)});n&&r[e].addTearDown(n)})}var he,un=y((he={},[function(n){if(!wn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===wn().platform});return n&&(he=n.adapterCtor())},function(){return he}]),2),me=un[0],ve=un[1],be=function(n){return"SLARDAR"+n},ge=function(n){try{return ve().getStorage(n)}catch(n){return}},ye=["darwin","macs","mac"],_e=["windows_nt","windows","window"],we=function(n){return ue(n)?"Android":"ios"===n.toLowerCase()?"iOS":~ye.indexOf(n.toLowerCase())?"Mac":~_e.indexOf(n.toLowerCase())?"windows":"unknown"},Se=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&ue(e)&&t?r/t+" * "+n/t:r+" * "+n},xn={platform:"my",adapterCtor:function(){return d(d({},{instance:t=void 0===t?wn().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"my",buildError:function(n){return u(n)?function(n,e){n={message:n};return!e||(e=y((e=(n.stack=e).split("\n"))[0]&&e[0].split(":"),1)[0])&&(n.name=e),n}(n[0],n[1]):{name:Z,message:v(n)}},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:ae,componentSubject:function(n){var e=["onInit"],t=n.filter(function(n){return~e.indexOf(n)}),r=function(n){t.forEach(function(r){f(n,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(gn(r).next({that:this,param:null,time:en()}),h(t))return t.apply(this,n)}})()})};Component=cn(Component,function(n){S(n)?r(n):null==n&&r(n={})})},setDataSubject:function(e){gn("onInit").subscribe(function(n){n=n.that;return e.call(n)})},pagePerfSubscriber:ie});var t}},Ee=function(n,e){void 0===e&&(e=J),n.on("init",function(){de(e)})};function xe(){var u=oe(this),a=vn();var n=sn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=en();return[o,function(){var n=r[1],e=en()-i;a.next({renderTime:e,url:u,data:o,startTime:i}),n&&n.call(t)}]});n&&a.addTearDown(n)}function ke(){var n;jn("setData")||(n=(n=ee(["setData"]).getSubject)("setData"),kn("setData",n),ln("setData",n))}function Oe(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(Ce.test(t)||Pe.test(r))||(n[e]=o[e]),n},{})}var je=function(n){n.on("init",function(){ke(),Cn("onLoad").subscribe(function(n){n=n.that;xe.call(n)}),ve().setDataSubject(xe)})},Te=function(n){n.on("init",function(){var e,n,t,r=ve();r.observePerformance&&!bn()&&(e=(0,ee(["performance"]).getSubject)("performance"),kn("performance",n=e),ln("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},Ce=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Pe=new RegExp("(bearer|session)","i"),De=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,u,a,c;!function(n,e){n=m(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,a=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Oe(e.headers||{}),c.headers=Oe(c.headers||{}),u=c.errMsg,n=function(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),u&&(n.err_msg=u),a={api:t,request:e,duration:r,cbTime:i+(o||0)+(a||0),response:n},!h(p)||(n=p(c.body,a))&&(a.extra=n,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};e&&hn("request").subscribe(n),t&&hn("downloadFile").subscribe(n),r&&hn("uploadFile").subscribe(n)}},Ie=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return T("applyMonitor",n),[]}};function Re(n,e,t){_n(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Me(n,e){return n&&e&&n===e}function Ne(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Me(e.message,t.message)&&!Me(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var Ae,Fe="http",qe={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},ze=function(f){return void 0===f&&(f=ve()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,u=n.dedupe,a=m(e),c=Ne(),s=function(n,e,t){n=u?c(n):n;n&&(a&&a.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Tn(q.onError).subscribe(function(n){n=n.param,n=f.buildError(n);a&&a.test(n.message)||s(n)}),o&&Tn(q.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=v(e.reason);a&&a.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Pn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(un=Ae=Ae||{}).history="history",un.manual="manual";function Le(t,n,r){var o=n,i=null,u=0,e="launch";function a(n,e){o=e,u=en(),r(e,i=e+"_"+u),t(n,e)}return Tn(q.onShow).pipe(Qn(1)).subscribe(function(){e="show"}),Pn(function(){e="history"}),[a,function(n){n&&(a(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,en()-u))}]}var Ve=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Le(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],u=n[1],n=n[2];return t!==Ae.manual&&(Cn("onShow").subscribe(function(n){return function(n){n=oe(n),n=i(n);u(n)}(n.that)}),Cn("onUnload").subscribe(n.bind(null,"unload")),Cn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},Be=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return J.forEach(function(n){mn(n)&&hn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Pn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},Ue=function(){return function(n,t){var r=n.isCalculateSize;vn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(v(n)).length:2*v(n).length)),t({ev_type:"set_data",payload:e})})}},He=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Tn(q.onLaunch).pipe(Yn(1)).subscribe(function(n){r.activate_start=n.time}),Tn(q.onShow).pipe(Yn(1)).subscribe(function(n){r.init_end=n.time}),Cn("onLoad").pipe(Yn(1)).subscribe(function(n){r.page_load_start=n.time}),Cn("onShow").pipe(Yn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=bn();Cn("onReady").pipe(Yn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&jn("performance").pipe($n(function(n){return"appClick"===n.name}),Yn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Tn(q.onHide).subscribe(function(){o||t()})}},Ge=function(){return function(n,e){ve().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},Ke=function(e){return void 0===e&&(e=ve()),function(n,t){var r,o;bn()&&e.performanceSubscriber&&(r=0,Cn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},Je="pageview",We={routeMode:Ae.history,setPidAndViewId:function(n,e){}},Ye="jsError",$e={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},Qe=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},Xe={maxBreadcrumbs:20,tap:!0},Ze="breadcrumb",nt=function(e){e.on("init",function(){e.provide("_subscriptions",[]),_n(e),e.on("init",function(){re($),fe(X),ce(Q)}),e.on("init",function(){le(Y)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},et="setData",rt={isCalculateSize:!1},ot="appLaunchPerf",it={},ut="pagePerf",at={},ct="performance",st={},ft=function(n,e,t){void 0===t&&(t=ve());var r=e.url,o=e.data,i=e.success,u=void 0===i?l:i,a=e.fail,c=void 0===a?l:a,i=e.header,a={"Content-Type":"application/json"};K(e=i)&&0!==Object.keys(e).length&&Object.assign(a,i),t.request({method:n,url:r,data:o,header:a,headers:a,success:function(n){u(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},lt=function(e){return(e=void 0===e?ve():e)?{get:function(n){return ft("GET",n,e)},post:function(n){return ft("POST",n,e)}}:{get:l,post:l}};function pt(n){return n=be(String(n)),(n=ge(n))&&n.userId&&n.deviceId?n:{userId:P(),deviceId:P()}}function dt(n){return n+"_"+Date.now()}function ht(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{ve().setStorage(n,e)}catch(n){}}(be(String(e)),{userId:t,deviceId:n})}var mt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},vt="/monitor_mini/collect",bt="/settings/minipro",gt="apmplus.volces.com",yt="session",_t={sample_rate:1,include_users:[],sample_granularity:yt,rules:{}},wt=[vt,bt],St="0.2.4",Et="APM_PLUS_MINI_PROGRAM",xt=function(n,e){return void 0===e&&(e=vt),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function kt(n){n=pt(n.aid);return{aid:0,token:"",pid:"",viewId:dt("_"),userId:n.userId,deviceId:n.deviceId,sessionId:P(),domain:gt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:wt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:_t,sdkName:Et,sdkVersion:St}}function Ot(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function jt(n){return S(n)&&"aid"in n&&"token"in n}function Tt(n){return d({},n)}var Ct=function(e){var r,o,i=e,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return u=d(d({},u),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):a?f():(e=i.domain,n=i.aid,t=function(n){a=n,f()},lt().get({url:function(n,e){return void 0===e&&(e=bt),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){ht(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),u);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),n.sample=Pt(Pt(e.sample,null==o?void 0:o.sample),u.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?yt:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(a),function(n){n=be(n);return!!ve().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Pt(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Dt(n){var e={url:(e=ve().getCurrentPages().pop())?(e?oe(e):"")+s(e.options):"",timestamp:en()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function It(n){if(!me(n))throw Error(U);var t,n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=D(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)k("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=u(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(m,n)?k("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h=[]}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(n,e){"init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d?e():f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:v},m=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:jt,initConfigNormalizer:Ot,userConfigNormalizer:Tt,createSender:function(n){return e({size:G,endpoint:xt(n.domain),transport:lt()})},builder:mt,createDefaultConfig:kt,createConfigManager:Ct});return I(n),Ft(n),Mt(n),Nt(n),z(n),nt(n),(t=n).on("init",function(){var e=[],n=t.config();n&&n.integrations&&n.integrations.forEach(function(n){E(e,n.name)||(e.push(n.name),n.setup(t),n.tearDown&&t.on("beforeDestroy",n.tearDown))})}),At(n),Rt(n),n}var Rt=function(e){function t(n){return void 0===n&&(n=ve().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,u=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),u=!0}),e.on("init",function(){Tn(q.onLaunch).pipe(Yn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),u&&r()}),ve().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Mt=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Nt=function(n){n.on("report",Dt)},At=function(e){e.on("init",function(){Tn(q.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},Ft=function(t){var r,o=!1;t.on("init",function(){r=en(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=en())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return function(n){var e,t,r,i,o,u,a,c,s,n=It(n);if(n)return(e=n).provide("sendEvent",function(n){n=V(n);n&&e.report({ev_type:L,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=B(n);n&&e.report({ev_type:L,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Re(t,Je,We);e&&(e=(n=y(Ie(Ve,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Re(r,Ye,$e);e&&(n=Qe(r),n=y(Ie(ze,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Re(i,Fe,qe);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Ee(i,r),Ie(De,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Re(o,et,rt);n&&(je(o),Ie(Ue,n,o.report.bind(o)))}),(u=n).on("init",function(){var n,e=Re(u,Ze,Xe);e&&(e=(n=y(Ie(Be,e,function(n){}),2))[0],n=n[1],u.provide("getBreadcrumbs",e),u.provide("addBreadcrumb",n))}),(a=n).on("init",function(){var n=Re(a,ot,it);n&&(Te(a),Ie(He,n,a.report.bind(a)))}),(c=n).on("init",function(){var n=Re(c,ut,at);n&&Ie(Ge,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Re(s,ct,st);n&&(Te(s),Ie(Ke,n,s.report.bind(s)))}),n}.bind(null,[xn])()}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).myClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,u=void 0===n?1e3:n,a=[],c=0;function s(){var e;a.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(n){i=n},setWait:function(n){u=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){a.push(n),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(n=a,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),a=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function u(n){return"[object Array]"===t.toString.call(n)}function h(n){return"function"==typeof n}function a(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):u(e[t])&&u(n[t])?o[t]=function e(n,t){n=u(n)?n:[];t=u(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):u(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!u(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function x(n,e){if(!u(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function m(n){return u(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function v(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function f(i,u,a,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(n),!1)),o=r;return h(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return h(t)&&t.apply(this,e)}}),i[u]=o,function(n){n||(o===i[u]?i[u]=t:r=t)}}}function k(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),j(""+P++)],y(n),!1))}function o(n){return Math.random()<Number(n)}function g(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){C(n)}return e}}var j="".padStart?function(n,e){return n.padStart(e=void 0===e?8:e," ")}:function(n){return n},T=0,C=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),j(""+T++)],y(n),!1))},P=0;function I(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function D(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,e,t){i[n]?i[n].push([e,t]):i[n]=[[e,t]],o&&r(t)},has:function(n){return!!i[n]},remove:e,removeByEvType:function(e){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===e&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){e(n)})}}}var R=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=v(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=v(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function M(r,o){r.on("init",function(){function n(n){n.forEach(function(n){var e=n.name;E(t,e)||(t.push(e),n.setup(r),o&&o(e,n.setup),r.destroyAgent.set(e,e,[function(){t=x(t,e),n.tearDown&&n.tearDown()}]))})}var t=[];r.provide("applyIntegrations",n);var e=r.config();e&&e.integrations&&n(e.integrations)})}function N(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function A(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function F(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":a(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function q(e,n){try{return"rule"===n.type?F(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return q(e,n)}):n.children.some(function(n){return q(e,n)})}catch(n){return!1}}function z(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,u=e.sample_granularity,a=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return N(n,1)};var c,s,f,l,p,d,h,m=A(u="session"===u,o,t,e,r),v=(c=a,s=u,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:A(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:A(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!m())return!1;if(!(n.ev_type in v))return N(n,o);if(!v[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=v[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(q(n,t[r].filter))return!!t[r].hit()&&N(n,t[r].effectiveSampleRate);return!!e.hit()&&N(n,e.effectiveSampleRate)}}var L,V=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=z(e,n,o,g);t.on("build",n)})},B="custom",U=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,u={};for(o in i)u[o]=v(i[o]);e.categories=u}return e}},H=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:v(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=v(r[t]);e.metrics=o,e.categories=i}return e}},G="Adapters imported incorrectly",K=["success","fail","complete"],J=20;(On=L=L||{}).onLaunch="onLaunch",On.onShow="onShow",On.onHide="onHide",On.onError="onError",On.onPageNotFound="onPageNotFound",On.onUnhandledRejection="onUnhandledRejection";function W(n){return"[object Object]"===Object.prototype.toString.call(n)}var Y=["request","downloadFile","uploadFile"],$=["navigateTo","redirectTo","switchTab","reLaunch"],Q=_(_([],y($),!1),["navigateBack"],!1),X=_(_([],y([L.onLaunch,L.onShow,L.onHide]),!1),[L.onError,L.onPageNotFound,L.onUnhandledRejection],!1),Z=["attached","onInit"],nn=["onLoad","onShow","onReady","onUnload","onHide"],en="unknown_error_name",tn="__HOOKED__";function rn(){return Date.now()}function on(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!h(n))return 0;var r,o=rn();try{n.apply(this,e)}finally{r=rn()}return r-o}var un,an=function(){},cn=y((un="tt",[function(){return un},function(n){return un=n}]),2),sn=cn[0];cn[1];function fn(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function ln(n,e,r){var o=n[e];if(!o||!o[tn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){C(n)}return o.apply(this,n)}}),n[e]&&(n[e][tn]=!0),function(){n[e][tn]=!1,r=an}}function pn(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return Tn(t,((n={})[e]=null,n))})})}function dn(n,e){e.addTearDown(function(){return jn(n,null)})}function hn(n){return Cn("route")[n]}function mn(n){return!!Cn("route")[n]}function vn(n){return Cn("http")[n]}function bn(n){return!!Cn("http")[n]}function gn(){return Cn("setData")}function yn(){return!!Cn("performance")}function _n(n){return Cn("component")[n]}function wn(){return Cn("instance")}function Sn(n){jn("instance",n)}var En=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:sn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},xn="__slardar__global__0.2.5-alpha.0",kn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},On=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?En().instance:e)?e[xn]||(e[xn]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},kn),e&&(e[xn]=t)}}}(d({},kn)),jn=On.setGlobalValue,Tn=On.mergeGlobalValue,Cn=On.getGlobalValue,Pn=function(n){return Cn("app")[n]},In=function(n){return Cn("page")[n]},Dn=function(t,n){(n=void 0===n?Q:n).forEach(function(e){mn(e)&&hn(e).subscribe(function(n){return t(n,e)})})};function Rn(n){return"function"==typeof n}function Mn(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function Nn(n){return n}function An(t){return function(n){if((e=n)&&Rn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Fn(n){Rn(n)?n():null!=n&&n.unsubscribe()}var qn=function(n){return n instanceof zn||n&&"closed"in n&&Rn(n.remove)&&Rn(n.add)&&Rn(n.unsubscribe)},zn=(Ln.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Rn(t)&&t(),e&&(this._finalizers=null,e.forEach(Fn)))},Ln.prototype.remove=function(n){this._finalizers&&Mn(this._finalizers,n),n instanceof Ln&&n._removeParent(this)},Ln.prototype.add=function(n){if(n&&n!==this)if(this.closed)Fn(n);else{if(n instanceof Ln){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},Ln.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},Ln.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},Ln.prototype._removeParent=function(n){this._parentage&&Mn(this._parentage,n)},Ln);function Ln(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Vn,Bn=(n(Un,Vn=zn),Un.prototype.next=function(n){this.isStopped||this.destination.next(n)},Un.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Un.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Un.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Vn.prototype.unsubscribe.call(this),this.destination=null)},Un.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Un);function Un(n){var e=Vn.call(this)||this;return e.isStopped=!1,e.destination=Kn(n)?n:new Hn(!(n=n)||Rn(n)?{next:null!=n?n:void 0}:n),e}var Hn=(Gn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Gn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Gn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Gn);function Gn(n){this.partialObserver=n}function Kn(n){return n instanceof Bn||n&&((e=n)&&Rn(e.next)&&Rn(e.error)&&Rn(e.complete))&&qn(n);var e}Jn.prototype.subscribe=function(n){var e=Kn(n)?n:new Bn(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Jn.prototype.lift=function(n){var e=new Jn;return e.source=this,e.operator=n,e},Jn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?Nn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Jn.prototype._subscribe=function(n){},Jn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},cn=Jn;function Jn(n){n&&(this._subscribe=n)}var Wn,On=(n(Yn,Wn=cn),Yn.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},Yn.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},Yn.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty(Yn.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Yn.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},Yn.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Yn.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Yn.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},Yn.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},Yn.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?Yn.EMPTY:(t.push(n),new zn(function(){Mn(t,n)}))},Yn.EMPTY=((On=new zn).closed=!0,On),Yn);function Yn(){var n=null!==Wn&&Wn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var $n=new cn(function(n){return n.complete()});function Qn(r){return r<=0?function(){return $n}:An(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function Xn(r,o){return An(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function Zn(t){return Xn(function(n,e){return t<=e})}var ne,ee=(n(te,ne=On),te.prototype.subscribe=function(n){var t=this,n=ne.prototype.subscribe.call(this,n);wn()&&wn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},te.prototype.unsubscribe=function(){ne.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},te.prototype.addTearDown=function(n){this.tearDownFns.push(n)},te);function te(){var n=null!==ne&&ne.apply(this,arguments)||this;return n.tearDownFns=[],n}function re(n){var e=n.reduce(function(n,e){return n[e]=new ee,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function oe(n){return 1<n.length?n:n.length&&n[0]||{}}function ie(n){var t=n.filter(function(n){return n=n,!!!Cn("app")[n]}),n=re(t).subjectMap;Tn("app",n=n),pn("app",n),App=fn(App,function(e){t.forEach(function(n){var r=Pn(n),n=f(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:oe(n),time:rn()}),h(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function ue(n){return n.route||n.__route__||n.url||n.path||""}function ae(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Dn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},$),In("onLoad").pipe(Zn(1)).subscribe(function(n){r.load_start=n.time}),In("onShow").pipe(Zn(1)).subscribe(function(n){r.dom_end=n.time}),In("onReady").pipe(Zn(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Pn(L.onHide).subscribe(function(){!1===o&&(e(),t())})}function ce(n){return"android"===n.toLowerCase()}function se(){var n="",e="",t="";my.getAccountInfoSync?(d=my.getAccountInfoSync().miniProgram,e=d.envVersion,n=d.appId,t=d.version):(n=my.getAppIdSync().appId,my.getRunScene({success:function(n){e=n.envVersion}}));var r=(h=my.getSystemInfoSync()).model,o=h.brand,i=h.pixelRatio,u=h.screenHeight,a=h.screenWidth,c=h.windowHeight,s=h.windowWidth,f=h.language,l=h.version,p=h.system,d=h.platform,h=h.app;return{model:r,brand:o,pixelRatio:i,screenArea:xe({pixelRatio:i,width:a,height:u,systemPlatform:d}),windowArea:xe({width:s,height:c}),language:f,osName:Ee(d),osVersion:p,SDKVersion:my.SDKVersion,appId:n,miniEnv:e,miniVersion:t,hostName:h,hostVersion:l,platform:"my"}}function fe(n){var e=n.filter(function(n){return n=n,!!!Cn("component")[n]}),n=re(e).subjectMap;Tn("component",n=n),pn("component",n),ge().componentSubject(e)}function le(e){function n(n){W(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=fn(Component,n),Behavior=fn(Behavior,n)}catch(n){}}function pe(n,e){var t=n.filter(function(n){return n=n,!!!Cn("page")[n]}),n=re(t).subjectMap;Tn("page",n=n),pn("page",n),n=function(e){t.forEach(function(n){var r=In(n),n=f(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(ue(this)&&r.next({that:this,param:oe(n),time:rn()}),h(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=fn(Page,n),le(n)}function de(n){var e=n.filter(function(n){return!mn(n)}),t=re(e).subjectMap;Tn("route",n=t),pn("route",n),e.forEach(function(i){var n=ln(ge().instance,i,function(o){void 0===o&&(o={}),hn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:rn()}),K.forEach(function(r){f(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];hn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:oe(n)||{}},time:rn()}),h(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function he(a,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:a,request:{url:e,method:(e=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:v(r),timestamp:rn()},response:{}};f(n,"complete",function(u){return function(n){var e=c.response.timestamp||rn();c.duration=e-c.request.timestamp,c.completeCallbackTime=on(u,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:v(n.data),errMsg:i,timing:ge().buildRequestProfile(n.profile||{})},vn(a).next(c)}})(),f(n,"success",function(e){return function(n){c.response.timestamp=rn(),c.response.status=200,c.successCallbackTime=on(e,n)}})(),f(n,"fail",function(e){return function(n){c.response.timestamp=rn(),c.response.status=-1,c.failCallbackTime=on(e,n)}})()}function me(n,t){void 0===t&&(t=ge().instance);var e=n.filter(function(n){return!bn(n)}),r=re(e).subjectMap;Tn("http",n=r),pn("http",n),e.forEach(function(e){var n=ln(t,e,function(n){he(e,n)});n&&r[e].addTearDown(n)})}var ve,cn=y((ve={},[function(n){if(!En().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===En().platform});return n&&(ve=n.adapterCtor())},function(){return ve}]),2),be=cn[0],ge=cn[1],ye=function(n){return"SLARDAR"+n},_e=function(n){try{return ge().getStorage(n)}catch(n){return}},we=["darwin","macs","mac"],Se=["windows_nt","windows","window"],Ee=function(n){return ce(n)?"Android":"ios"===n.toLowerCase()?"iOS":~we.indexOf(n.toLowerCase())?"Mac":~Se.indexOf(n.toLowerCase())?"windows":"unknown"},xe=function(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&ce(e)&&t?r/t+" * "+n/t:r+" * "+n},On={platform:"my",adapterCtor:function(){return d(d({},{instance:t=void 0===t?En().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"my",buildError:function(n){return u(n)?function(n,e){n={message:n};return!e||(e=y((e=(n.stack=e).split("\n"))[0]&&e[0].split(":"),1)[0])&&(n.name=e),n}(n[0],n[1]):{name:en,message:v(n)}},setStorage:function(n,e){return my.setStorageSync({key:n,data:e})},getStorage:function(n){return my.getStorageSync({key:n}).data},getSystemInfo:se,componentSubject:function(n){var e=["onInit"],t=n.filter(function(n){return~e.indexOf(n)}),r=function(n){t.forEach(function(r){f(n,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(_n(r).next({that:this,param:null,time:rn()}),h(t))return t.apply(this,n)}})()})};Component=fn(Component,function(n){S(n)?r(n):null==n&&r(n={})})},setDataSubject:function(e){_n("onInit").subscribe(function(n){n=n.that;return e.call(n)})},pagePerfSubscriber:ae});var t}},ke=function(n,e){void 0===e&&(e=Y),n.on("init",function(){me(e)})};function Oe(){var u=ue(this),a=gn();var n=ln(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=rn();return[o,function(){var n=r[1],e=rn()-i;a.next({renderTime:e,url:u,data:o,startTime:i}),n&&n.call(t)}]});n&&a.addTearDown(n)}function je(){var n;Cn("setData")||(n=(n=re(["setData"]).getSubject)("setData"),jn("setData",n),dn("setData",n))}function Te(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(Ie.test(t)||De.test(r))||(n[e]=o[e]),n},{})}var Ce=function(n){n.on("init",function(){je(),In("onLoad").subscribe(function(n){n=n.that;Oe.call(n)}),ge().setDataSubject(Oe)})},Pe=function(n){n.on("init",function(){var e,n,t,r=ge();r.observePerformance&&!yn()&&(e=(0,re(["performance"]).getSubject)("performance"),jn("performance",n=e),dn("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},Ie=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),De=new RegExp("(bearer|session)","i"),Re=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,u,a,c;!function(n,e){n=m(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,a=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Te(e.headers||{}),c.headers=Te(c.headers||{}),u=c.errMsg,n=function(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),u&&(n.err_msg=u),a={api:t,request:e,duration:r,cbTime:i+(o||0)+(a||0),response:n},!h(p)||(n=p(c.body,a))&&(a.extra=n,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};e&&vn("request").subscribe(n),t&&vn("downloadFile").subscribe(n),r&&vn("uploadFile").subscribe(n)}},Me=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return C("applyMonitor",n),[]}};function Ne(n,e,t){Sn(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Ae(n,e){return n&&e&&n===e}function Fe(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Ae(e.message,t.message)&&!Ae(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var qe,ze="http",Le={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Ve=function(f){return void 0===f&&(f=ge()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,u=n.dedupe,a=m(e),c=Fe(),s=function(n,e,t){n=u?c(n):n;n&&(a&&a.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Pn(L.onError).subscribe(function(n){n=n.param,n=f.buildError(n);a&&a.test(n.message)||s(n)}),o&&Pn(L.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=v(e.reason);a&&a.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Dn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(cn=qe=qe||{}).history="history",cn.manual="manual";function Be(t,n,r){var o=n,i=null,u=0,e="launch";function a(n,e){o=e,u=rn(),r(e,i=e+"_"+u),t(n,e)}return Pn(L.onShow).pipe(Zn(1)).subscribe(function(){e="show"}),Dn(function(){e="history"}),[a,function(n){n&&(a(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,rn()-u))}]}var Ue=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Be(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],u=n[1],n=n[2];return t!==qe.manual&&(In("onShow").subscribe(function(n){return function(n){n=ue(n),n=i(n);u(n)}(n.that)}),In("onUnload").subscribe(n.bind(null,"unload")),In("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},He=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return Y.forEach(function(n){bn(n)&&vn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Dn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},Ge=function(){return function(n,t){var r=n.isCalculateSize;gn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(v(n)).length:2*v(n).length)),t({ev_type:"set_data",payload:e})})}},Ke=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Pn(L.onLaunch).pipe(Qn(1)).subscribe(function(n){r.activate_start=n.time}),Pn(L.onShow).pipe(Qn(1)).subscribe(function(n){r.init_end=n.time}),In("onLoad").pipe(Qn(1)).subscribe(function(n){r.page_load_start=n.time}),In("onShow").pipe(Qn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=yn();In("onReady").pipe(Qn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&Cn("performance").pipe(Xn(function(n){return"appClick"===n.name}),Qn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Pn(L.onHide).subscribe(function(){o||t()})}},Je=function(){return function(n,e){ge().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},We=function(e){return void 0===e&&(e=ge()),function(n,t){var r,o;yn()&&e.performanceSubscriber&&(r=0,In("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},Ye="pageview",$e={routeMode:qe.history,setPidAndViewId:function(n,e){}},Qe="jsError",Xe={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},Ze=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},nt={maxBreadcrumbs:20,tap:!0},et="breadcrumb",rt=function(e){e.on("init",function(){e.provide("_subscriptions",[]),Sn(e),e.on("init",function(){ie(X),pe(nn),fe(Z)}),e.on("init",function(){de(Q)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},ot="setData",it={isCalculateSize:!1},ut="appLaunchPerf",at={},ct="pagePerf",st={},ft="performance",lt={},pt=function(n,e,t){void 0===t&&(t=ge());var r=e.url,o=e.data,i=e.success,u=void 0===i?l:i,a=e.fail,c=void 0===a?l:a,i=e.header,a={"Content-Type":"application/json"};W(e=i)&&0!==Object.keys(e).length&&Object.assign(a,i),t.request({method:n,url:r,data:o,header:a,headers:a,success:function(n){u(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},dt=function(e){return(e=void 0===e?ge():e)?{get:function(n){return pt("GET",n,e)},post:function(n){return pt("POST",n,e)}}:{get:l,post:l}};function ht(n){return n=ye(String(n)),(n=_e(n))&&n.userId&&n.deviceId?n:{userId:I(),deviceId:I()}}function mt(n){return n+"_"+Date.now()}function vt(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{ge().setStorage(n,e)}catch(n){}}(ye(String(e)),{userId:t,deviceId:n})}var bt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},gt="/monitor_mini/collect",yt="/settings/minipro",_t="apmplus.volces.com",wt="session",St={sample_rate:1,include_users:[],sample_granularity:wt,rules:{}},Et=[gt,yt],xt="0.2.5-alpha.0",kt="APM_PLUS_MINI_PROGRAM",Ot=function(n,e){return void 0===e&&(e=gt),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function jt(n){n=ht(n.aid);return{aid:0,token:"",pid:"",viewId:mt("_"),userId:n.userId,deviceId:n.deviceId,sessionId:I(),domain:_t,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Et},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:St,sdkName:kt,sdkVersion:xt}}function Tt(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function Ct(n){return S(n)&&"aid"in n&&"token"in n}function Pt(n){return d({},n)}var It=function(e){var r,o,i=e,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return u=d(d({},u),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):a?f():(e=i.domain,n=i.aid,t=function(n){a=n,f()},dt().get({url:function(n,e){return void 0===e&&(e=yt),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){vt(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),u);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),n.sample=Dt(Dt(e.sample,null==o?void 0:o.sample),u.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?wt:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(a),function(n){n=ye(n);return!!ge().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Dt(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Rt(n){var e={url:(e=ge().getCurrentPages().pop())?(e?ue(e):"")+s(e.options):"",timestamp:rn()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function Mt(n){if(!be(n))throw Error(G);return n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=D(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)k("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=u(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(m,n)?k("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h.length=0}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){v.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(n,e){if("init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d)try{e()}catch(n){}else f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=x(f[n],e))},destroyAgent:v},m=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:Ct,initConfigNormalizer:Tt,userConfigNormalizer:Pt,createSender:function(n){return e({size:J,endpoint:Ot(n.domain),transport:dt()})},builder:bt,createDefaultConfig:jt,createConfigManager:It}),R(n),zt(n),At(n),Ft(n),V(n),rt(n),M(n),qt(n),Nt(n),n}var Nt=function(e){function t(n){return void 0===n&&(n=ge().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,u=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),u=!0}),e.on("init",function(){Pn(L.onLaunch).pipe(Qn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),u&&r()}),ge().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},At=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Ft=function(n){n.on("report",Rt)},qt=function(e){e.on("init",function(){Pn(L.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},zt=function(t){var r,o=!1;t.on("init",function(){r=rn(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=rn())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return function(n){var e,t,r,i,o,u,a,c,s,n=Mt(n);if(n)return(e=n).provide("sendEvent",function(n){n=U(n);n&&e.report({ev_type:B,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=H(n);n&&e.report({ev_type:B,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Ne(t,Ye,$e);e&&(e=(n=y(Me(Ue,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Ne(r,Qe,Xe);e&&(n=Ze(r),n=y(Me(Ve,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Ne(i,ze,Le);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),ke(i,r),Me(Re,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Ne(o,ot,it);n&&(Ce(o),Me(Ge,n,o.report.bind(o)))}),(u=n).on("init",function(){var n,e=Ne(u,et,nt);e&&(e=(n=y(Me(He,e,function(n){}),2))[0],n=n[1],u.provide("getBreadcrumbs",e),u.provide("addBreadcrumb",n))}),(a=n).on("init",function(){var n=Ne(a,ut,at);n&&(Pe(a),Me(Ke,n,a.report.bind(a)))}),(c=n).on("init",function(){var n=Ne(c,ct,st);n&&Me(Je,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Ne(s,ft,lt);n&&(Pe(s),Me(We,n,s.report.bind(s)))}),n}.bind(null,[On])()}); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).swanClient=n()}(this,function(){"use strict";function n(e){var t,r=e.transport,o=e.endpoint,n=e.size,i=void 0===n?10:n,e=e.wait,a=void 0===e?1e3:e,u=[],c=0;function s(){var n;u.length&&(n=this.getBatchData(),r.post({url:o,data:n,fail:function(e){t&&t(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(e=u,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),u=[]},fail:function(e){t=e}}}var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(e){return e}function S(e){return"object"==typeof e&&null!==e}var t=Object.prototype;function i(e){if(S(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(e);e=Object.getPrototypeOf(e);return e===t||null===e}}function a(e){return"[object Array]"===t.toString.call(e)}function h(e){return"function"==typeof e}function u(e){return"number"==typeof e}function c(e){return"string"==typeof e}function p(e,n){var t,r,o=d({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(S(n[t])&&i(n[t])?o[t]=p(S(e[t])?e[t]:{},n[t]):a(n[t])&&a(e[t])?o[t]=function n(e,t){e=a(e)?e:[];t=a(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:S(e)&&i(e)?p({},e):a(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function E(e,n){if(!a(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function x(e,n){if(!a(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function m(e){return a(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];c(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function v(e){try{return c(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function s(t){return S(t)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""}function O(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,_(["[SDK]",Date.now(),(""+C++).padStart(8," ")],y(e),!1))}function o(e){return Math.random()<Number(e)}function f(e,n){return e<Number(n)}function k(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){T(e)}return n}}var g=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(e),!1)),o=r;return h(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return h(t)&&t.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=t:r=t)}}},j=0,T=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,_(["[SDK]",Date.now(),(""+j++).padStart(8," ")],y(e),!1))},C=0;function D(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}function P(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){r[e]&&r[e].forEach(function(e){t(e[1])}),r[e]=void 0}var r={};return{set:function(e,n,t){r[e]?r[e].push([n,t]):r[e]=[[n,t]]},remove:n,removeByEvType:function(n){Object.keys(r).forEach(function(e){r[e]&&r[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){Object.keys(r).forEach(function(e){n(e)})}}}var I=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=v(n),o},merge:function(n){return t=d(d({},t),n),Object.keys(n).forEach(function(e){r[e]=v(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return d({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})};function R(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function M(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function N(e,n,t,r){if(void 0===(e=function(e,n,t){for(var r,n=y(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=y(i))[0],i=r.slice(1);if(e)return t(e,o)}(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":u(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return E(n,e);case"neq":return!E(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function A(n,e){try{return"rule"===e.type?N(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return A(n,e)}):e.children.some(function(e){return A(n,e)})}catch(e){return!1}}function F(e,n,t,r){if(!n)return b;var o=n.sample_rate,i=n.include_users,a=n.sample_granularity,u=n.rules,n=void 0===(n=n.r)?Math.random():n;if(E(i,e))return function(e){return R(e,1)};var c,s,f,l,p,d,h,m=M(a="session"===a,o,t,n,r),v=(c=u,s=a,f=o,l=t,p=n,d=r,h={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(h[e]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},n&&(h[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:M(s,n,l,p,d),effectiveSampleRate:n*f,filter:e}}))):h[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(e){if(!m())return!1;if(!(e.ev_type in v))return R(e,o);if(!v[e.ev_type].enable)return!1;if(e.common&&e.common.sample_rate)return e;var n=v[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(A(e,t[r].filter))return!!t[r].hit()&&R(e,t[r].effectiveSampleRate);return!!n.hit()&&R(e,n.effectiveSampleRate)}}var q,z=function(t){t.on("start",function(){var e=t.config(),n=e.userId,e=e.sample,e=F(n,e,o,f);t.on("build",e)})},L="custom",B=function(e){if(e&&S(e)&&e.name&&c(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&S(e.metrics)){var t=e.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&S(e.categories)){var o,i=e.categories,a={};for(o in i)a[o]=v(i[o]);n.categories=a}return n}},V=function(e){if(e&&S(e)&&e.content&&c(e.content)){var n={content:v(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&S(e.extra)){var t,r=e.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=v(r[t]);n.metrics=o,n.categories=i}return n}},U="Adapters imported incorrectly",H=["success","fail","complete"],G=20;(we=q=q||{}).onLaunch="onLaunch",we.onShow="onShow",we.onHide="onHide",we.onError="onError",we.onPageNotFound="onPageNotFound",we.onUnhandledRejection="onUnhandledRejection";function K(e){return"[object Object]"===Object.prototype.toString.call(e)}var J=["request","downloadFile","uploadFile"],W=_(_([],y(["navigateTo","redirectTo","switchTab","reLaunch"]),!1),["navigateBack"],!1),Y=_(_([],y([q.onLaunch,q.onShow,q.onHide]),!1),[q.onError,q.onPageNotFound,q.onUnhandledRejection],!1),$=["attached","onInit"],Q=["onLoad","onShow","onReady","onUnload","onHide"],X="__HOOKED__";var Z=function(){return Date.now()};function ee(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!h(e))return 0;var r,o=Z();try{e.apply(this,n)}finally{r=Z()}return r-o}var ne,te=function(){},re=y((ne="tt",[function(){return ne},function(e){return ne=e}]),2),oe=re[0];re[1];function ie(e,n,r){var o=e[n];if(!o||!o[X])return Object.defineProperty(e,n,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=r.apply(this,e);t&&(e=t)}catch(e){T(e)}return o.apply(this,e)}}),e[n]&&(e[n][X]=!0),function(){e[n][X]=!1,r=te}}function ae(t,e){Object.keys(e).forEach(function(n){e[n].addTearDown(function(){var e;return Ee(t,((e={})[n]=null,e))})})}function ue(e,n){n.addTearDown(function(){return Se(e,null)})}function ce(e){return xe("app")[e]}function se(e){return xe("page")[e]}function fe(t,e){(e=void 0===e?W:e).forEach(function(n){ke(n)&&Oe(n).subscribe(function(e){return t(e,n)})})}function le(e){return xe("http")[e]}function pe(e){return!!xe("http")[e]}function de(){return xe("setData")}function he(){return!!xe("performance")}function me(){return xe("instance")}function ve(e){Se("instance",e)}var be=function(n,t){function e(e){return t(e),n.call(this,e)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},ge=function(){var e={instance:null};return e.instance||("undefined"!=typeof tt?e={instance:tt,platform:oe()}:"undefined"!=typeof my?e={instance:my,platform:"my"}:"undefined"!=typeof swan?e={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(e={instance:wx,platform:"wx"})),e},ye="__slardar__global__0.2.4",_e={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},we=function(e,n){void 0===e&&(e={});var t=(n=void 0===n?ge().instance:n)?n[ye]||(n[ye]=e):e;return{setGlobalValue:function(e,n){t[e]=n},mergeGlobalValue:function(e,n){t[e]=d(d({},t[e]),n)},getGlobalValue:function(e){return t[e]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},_e),n&&(n[ye]=t)}}}(d({},_e)),Se=we.setGlobalValue,Ee=we.mergeGlobalValue,xe=we.getGlobalValue,Oe=function(e){return xe("route")[e]},ke=function(e){return!!xe("route")[e]},je=function(e){return xe("component")[e]};function Te(e){return"function"==typeof e}function Ce(e,n){!e||0<=(n=e.indexOf(n))&&e.splice(n,1)}function De(e){return e}function Pe(t){return function(e){if((n=e)&&Te(n.lift))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});var n;throw new TypeError("Unable to lift unknown Observable type")}}function Ie(e){Te(e)?e():null!=e&&e.unsubscribe()}var Re=function(e){return e instanceof Me||e&&"closed"in e&&Te(e.remove)&&Te(e.add)&&Te(e.unsubscribe)},Me=(Ne.prototype.unsubscribe=function(){var e,n,t,r=this;this.closed||(this.closed=!0,e=this._parentage,n=this._finalizers,t=this.initialTeardown,e&&(this._parentage=null,e.forEach(function(e){return e.remove(r)})),Te(t)&&t(),n&&(this._finalizers=null,n.forEach(Ie)))},Ne.prototype.remove=function(e){this._finalizers&&Ce(this._finalizers,e),e instanceof Ne&&e._removeParent(this)},Ne.prototype.add=function(e){if(e&&e!==this)if(this.closed)Ie(e);else{if(e instanceof Ne){if(e.closed||e._hasParent(this))return;e._addParent(this)}var n=this._finalizers;this._finalizers=n?(n.push(e),n):[e]}},Ne.prototype._addParent=function(e){var n=this._parentage;this._parentage=n?(n.push(e),n):[e]},Ne.prototype._hasParent=function(e){return this._parentage&&~this._parentage.indexOf(e)},Ne.prototype._removeParent=function(e){this._parentage&&Ce(this._parentage,e)},Ne);function Ne(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var Ae,Fe=(e(qe,Ae=Me),qe.prototype.next=function(e){this.isStopped||this.destination.next(e)},qe.prototype.error=function(e){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(e)}finally{this.unsubscribe()}}},qe.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},qe.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Ae.prototype.unsubscribe.call(this),this.destination=null)},qe.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},qe);function qe(e){var n=Ae.call(this)||this;return n.isStopped=!1,n.destination=Be(e)?e:new ze(!(e=e)||Te(e)?{next:null!=e?e:void 0}:e),n}var ze=(Le.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(e){console.error("ConsumerObserver.next error",e)}},Le.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(e){console.error("ConsumerObserver.error error",e)}},Le.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){console.error("ConsumerObserver.complete error",e)}},Le);function Le(e){this.partialObserver=e}function Be(e){return e instanceof Fe||e&&((n=e)&&Te(n.next)&&Te(n.error)&&Te(n.complete))&&Re(e);var n}Ve.prototype.subscribe=function(e){var n=Be(e)?e:new Fe(e),t=this.operator,e=this.source;return n.add(t?t.call(n,e):this._trySubscribe(n)),n},Ve.prototype.lift=function(e){var n=new Ve;return n.source=this,n.operator=e,n},Ve.prototype.pipe=function(){for(var n,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?De:1===n.length?n[0]:function(e){return n.reduce(function(e,n){return n(e)},e)})(this)},Ve.prototype._subscribe=function(e){},Ve.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},re=Ve;function Ve(e){e&&(this._subscribe=e)}var Ue,we=(e(He,Ue=re),He.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(e){return e.next(n)})},He.prototype.commonJudgement=function(e){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,e())},He.prototype.error=function(n){var t=this;this.commonJudgement(function(){var e=t.observers;for(t.hasError=!0,t.thrownError=n;e.length;)e.shift().error(n)})},Object.defineProperty(He.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),He.prototype.complete=function(){var n=this;this.commonJudgement(function(){for(var e=n.observers;e.length;)e.shift().complete()})},He.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},He.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},He.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},He.prototype._checkFinalizedStatuses=function(e){var n=this.hasError,t=this.thrownError,r=this.isStopped;n?e.error(t):r&&e.complete()},He.prototype._innerSubscribe=function(e){var n=this.isStopped,t=this.observers;return n?He.EMPTY:(t.push(e),new Me(function(){Ce(t,e)}))},He.EMPTY=((we=new Me).closed=!0,we),He);function He(){var e=null!==Ue&&Ue.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var Ge=new re(function(e){return e.complete()});function Ke(r){return r<=0?function(){return Ge}:Pe(function(e,n){var t=0;e.subscribe(function(e){++t<=r&&(n.next(e),r<=t&&n.complete())})})}function Je(r,o){return Pe(function(e,n){var t=0;e.subscribe(function(e){return r.call(o,e,t++)&&n.next(e)})})}function We(t){return Je(function(e,n){return t<=n})}var Ye,$e=(e(Qe,Ye=we),Qe.prototype.subscribe=function(e){var t=this,e=Ye.prototype.subscribe.call(this,e);me()&&me()._subscriptions.push(e);var r=e.unsubscribe;return e.unsubscribe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(this,e),t.observed||t.unsubscribe()},e},Qe.prototype.unsubscribe=function(){Ye.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(e){return e()})},Qe.prototype.addTearDown=function(e){this.tearDownFns.push(e)},Qe);function Qe(){var e=null!==Ye&&Ye.apply(this,arguments)||this;return e.tearDownFns=[],e}function Xe(e){var n=e.reduce(function(e,n){return e[n]=new $e,e},{});return{getSubject:function(e){return n[e]},subjectMap:n}}function Ze(e){return 1<e.length?e:e.length&&e[0]||{}}function en(e){var t=e.filter(function(e){return e=e,!!!xe("app")[e]}),e=Xe(t).subjectMap;Ee("app",e=e),ae("app",e),App=be(App,function(n){t.forEach(function(e){var r=ce(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.next({that:this,param:Ze(e),time:Z()}),h(t)&&t.apply(this,e)}})();e&&r.addTearDown(e)})})}function nn(e){return e.route||e.__route__||e.url||e.path||""}function tn(e){function n(e,i){r.forEach(function(o){g(e,o,function(r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];je(o).next({that:this,param:null,time:Z()});var t=i[o];if(h(t)&&t.apply(this,e),h(r))return r.apply(this,e)}})()})}var t=["attached"],r=e.filter(function(e){return~t.indexOf(e)});try{Component=be(Component,function(e){S(e.lifetimes)?n(e.lifetimes,e):void 0!==e.lifetimes&&null!==e.lifetimes||(e.lifetimes={},n(e.lifetimes,e))})}catch(e){}}function rn(n){je("attached").subscribe(function(e){e=e.that;return n.call(e)})}function on(e){return"android"===e.toLowerCase()}function an(e){return e&&function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?{name:e.name,message:e.message,stack:e.stack}:En(e)}function un(){var e="",n="";swan.getEnvInfoSync&&(n=(d=swan.getEnvInfoSync()).env,e=d.appKey);var t=(h=swan.getSystemInfoSync()).model,r=h.brand,o=h.pixelRatio,i=h.screenHeight,a=h.screenWidth,u=h.windowHeight,c=h.windowWidth,s=h.language,f=h.version,l=h.system,p=h.platform,d=h.SDKVersion,h=h.host;return{model:t,brand:r,pixelRatio:o,screenArea:Sn({width:a,height:i}),windowArea:Sn({width:c,height:u}),language:s,osName:wn(p),osVersion:l,SDKVersion:d,appId:e,miniEnv:n,miniVersion:"",hostName:h,hostVersion:f,platform:"swan"}}function cn(e){var n=e.filter(function(e){return e=e,!!!xe("component")[e]}),e=Xe(n).subjectMap;Ee("component",e=e),ae("component",e),vn().componentSubject(n)}function sn(n){function e(e){K(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))}try{Component=be(Component,e),Behavior=be(Behavior,e)}catch(e){}}function fn(e,n){var t=e.filter(function(e){return e=e,!!!xe("page")[e]}),e=Xe(t).subjectMap;Ee("page",e=e),ae("page",e),e=function(n){t.forEach(function(e){var r=se(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(nn(this)&&r.next({that:this,param:Ze(e),time:Z()}),h(t))return t.apply(this,e)}})();e&&r.addTearDown(e)})},Page=be(Page,e),sn(e)}function ln(e){var n=e.filter(function(e){return!ke(e)}),t=Xe(n).subjectMap;Ee("route",e=t),ae("route",e),n.forEach(function(i){var e=ie(vn().instance,i,function(o){void 0===o&&(o={}),Oe(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:Z()}),H.forEach(function(r){g(o,r,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Oe(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:Ze(e)||{}},time:Z()}),h(t)&&t.apply(this,e)}})()})});e&&t[i].addTearDown(e)})}function pn(u,e){var n=e.url,t=e.method,r=e.data,o=e.header,i=e.headers,c={api:u,request:{url:n,method:(n=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&n||"GET"),headers:o||i||{},body:v(r),timestamp:Z()},response:{}};g(e,"complete",function(a){return function(e){var n=c.response.timestamp||Z();c.duration=n-c.request.timestamp,c.completeCallbackTime=ee(a,e);var t,r,o,i=e.errMsg||e.errorMessage||e.error;c.response={status:(t=e.status,r=e.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:n,headers:e.header||e.headers||{},body:v(e.data),errMsg:i,timing:vn().buildRequestProfile(e.profile||{})},le(u).next(c)}})(),g(e,"success",function(n){return function(e){c.response.timestamp=Z(),c.response.status=200,c.successCallbackTime=ee(n,e)}})(),g(e,"fail",function(n){return function(e){c.response.timestamp=Z(),c.response.status=-1,c.failCallbackTime=ee(n,e)}})()}function dn(e,t){void 0===t&&(t=vn().instance);var n=e.filter(function(e){return!pe(e)}),r=Xe(n).subjectMap;Ee("http",e=r),ae("http",e),n.forEach(function(n){var e=ie(t,n,function(e){pn(n,e)});e&&r[n].addTearDown(e)})}var hn,re=y((hn={},[function(e){if(!ge().platform)throw Error("Not support current Mini Program");if(!Array.isArray(e)||!e.length)return null;e=e.find(function(e){return e.platform===ge().platform});return e&&(hn=e.adapterCtor())},function(){return hn}]),2),mn=re[0],vn=re[1],bn=function(e){return"SLARDAR"+e},gn=function(e){try{return vn().getStorage(e)}catch(e){return}},yn=["darwin","macs","mac"],_n=["windows_nt","windows","window"],wn=function(e){return on(e)?"Android":"ios"===e.toLowerCase()?"iOS":~yn.indexOf(e.toLowerCase())?"Mac":~_n.indexOf(e.toLowerCase())?"windows":"unknown"},Sn=function(e){var n=e.systemPlatform,t=e.pixelRatio,r=e.width,e=e.height;return n&&on(n)&&t?r/t+" * "+e/t:r+" * "+e},En=function(e){return{name:"unknown_error_name",message:v(e)}},we={platform:"swan",adapterCtor:function(){return d(d({},{instance:t=void 0===t?ge().instance:t,request:function(e){return t.request(e)},getStorage:function(e){return t.getStorageSync(e)},setStorage:function(e,n){return t.setStorageSync(e,n)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(e){return e},monitorNetworkType:function(n){t.getNetworkType({success:function(e){n&&n({networkType:e.networkType})}}),t.onNetworkStatusChange(function(e){n&&n({networkType:e.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"swan",buildError:an,getSystemInfo:un,componentSubject:tn,setDataSubject:rn,pagePerfSubscriber:function(n){function t(e){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0,e.navigate_start&&0!==e.load_start&&(n(d({},e)),e.load_start=0,i=!0)}var r={},o={},i=!1,a=!0;fe(function(e,n){"invoke"===e.param.name&&(i=!1,r={navigate_start:e.time,navigate_name:n},o={navigate_start:e.time,navigate_name:n})}),se("onLoad").pipe(We(1)).subscribe(function(e){e.that.componentName?o.dom_end=e.time:r.load_start=e.time}),se("onShow").pipe(We(1)).subscribe(function(e){e.that.componentName?(o.load_start=e.time,r.load_start=0):r.dom_end=e.time}),se("onReady").pipe(We(1)).subscribe(function(e){e.that.componentName?a?a=!1:(o.render_end=e.time,t(o)):(r.render_end=e.time,t(r),a=!1)}),ce(q.onHide).subscribe(function(){i||(t(r),t(o))})}});var t}},xn=function(e,n){void 0===n&&(n=J),e.on("init",function(){dn(n)})};function On(){var a=nn(this),u=de();var e=ie(this,"setData",function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=r[0],i=Z();return[o,function(){var e=r[1],n=Z()-i;u.next({renderTime:n,url:a,data:o,startTime:i}),e&&e.call(t)}]});e&&u.addTearDown(e)}function kn(){var e;xe("setData")||(e=(e=Xe(["setData"]).getSubject)("setData"),Se("setData",e),ue("setData",e))}function jn(o){return Object.keys(o).reduce(function(e,n){var t,r;return r=o[t=n],t&&r&&(Dn.test(t)||Pn.test(r))||(e[n]=o[n]),e},{})}var Tn=function(e){e.on("init",function(){kn(),se("onLoad").subscribe(function(e){e=e.that;On.call(e)}),vn().setDataSubject(On)})},Cn=function(e){e.on("init",function(){var n,e,t,r=vn();r.observePerformance&&!he()&&(n=(0,Xe(["performance"]).getSubject)("performance"),Se("performance",e=n),ue("performance",e),(t=r.observePerformance(function(e){e.forEach(function(e){n.next(e)})}))&&t.disconnect&&n.addTearDown(function(){return t.disconnect()}))})},Dn=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Pn=new RegExp("(bearer|session)","i"),In=function(){return function(e,s){var n=e.hookRequest,t=e.hookDownloadFile,r=e.hookUploadFile,f=e.ignoreUrls,l=e.collectBodyOnError,p=e.extraExtractor,e=function(e){var n,t,r,o,i,a,u,c;!function(e,n){e=m(e||[]);return!!e&&e.test(n)}(f,e.request.url)&&(c=e.response,n=e.request,t=e.api,r=e.duration,o=e.failCallbackTime,u=e.successCallbackTime,i=e.completeCallbackTime,n.headers=jn(n.headers||{}),c.headers=jn(c.headers||{}),a=c.errMsg,e=function(e,n){var t={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}(c,["errMsg"]),e=d(d({},e),{is_custom_error:!1}),a&&(e.err_msg=a),u={api:t,request:n,duration:r,cbTime:i+(o||0)+(u||0),response:e},!h(p)||(e=p(c.body,u))&&(u.extra=e,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};n&&le("request").subscribe(e),t&&le("downloadFile").subscribe(e),r&&le("uploadFile").subscribe(e)}},Rn=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,_([],y(r),!1));return o&&o(n,t)||[]}catch(e){return T("applyMonitor",e),[]}};function Mn(e,n,t){ve(e);n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return S(n)?d(d({},t),n):!!n&&t}function Nn(e,n){return e&&n&&e===n}function An(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Nn(n.message,t.message)&&!Nn(n.stack,t.stack)))return void(r=e)}catch(e){}var n,t;return r=e}}var Fn,qn="http",zn={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Ln=function(f){return void 0===f&&(f=vn()),function(e,r){var n=e.ignoreErrors,t=e.hookOnError,o=e.hookOnUnhandledRejection,i=e.hookRouteError,a=e.dedupe,u=m(n),c=An(),s=function(e,n,t){e=a?c(e):e;e&&(u&&u.test(e.message)||(e={error:e},n&&(e.extra=n),t&&(e.react=t),r(e)))};t&&ce(q.onError).subscribe(function(e){e=e.param,e=f.buildError(e);u&&u.test(e.message)||s(e)}),o&&ce(q.onUnhandledRejection).subscribe(function(e){var n=e.param||{},e=n.promise,t=v(n.reason);u&&u.test(t)||e.catch(b).then(function(e){var n={name:"UnhandledRejection",message:t};e&&e.stack&&(n.stack=e.stack),s(n)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&fe(function(e){e=e.param;"fail"===(e=e).name&&s({name:"RouteError",message:e.value.errMsg})}),[s]}};(re=Fn=Fn||{}).history="history",re.manual="manual";function Bn(t,e,r){var o=e,i=null,a=0,n="launch";function u(e,n){o=n,a=Z(),r(n,i=n+"_"+a),t(e,n)}return ce(q.onShow).pipe(We(1)).subscribe(function(){n="show"}),fe(function(){n="history"}),[u,function(e){e&&(u(n,e),n="history")},function(e){void 0===e&&(e="hide"),i&&(r(o,i),i=null,t(e,o,Z()-a))}]}var Vn=function(){return function(e,r){var n=e.extractPid,t=e.routeMode,o=e.setPidAndViewId,i=function(e){return n?n(e):e},e=y(Bn(function(e,n,t){r({ev_type:"pageview",payload:{pid:n,source:e,duration:t}})},"",o),3),o=e[0],a=e[1],e=e[2];return t!==Fn.manual&&(se("onShow").subscribe(function(e){return function(e){e=nn(e),e=i(e);a(e)}(e.that)}),se("onUnload").subscribe(e.bind(null,"unload")),se("onHide").subscribe(e.bind(null,"hide"))),[o.bind(null,"user_set"),e]}},Un=function(){return function(e){var n=y(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=b),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=d(d({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(_(_([],y(o),!1),[e],!1),n):_(_([],y(o),!1),[e],!1))}]}(e.maxBreadcrumbs,e.onAddBreadcrumb,e.onMaxBreadcrumbs),2),e=n[0],r=n[1];return J.forEach(function(e){pe(e)&&le(e).subscribe(function(e){r({type:"http",category:e.api,message:"",data:{method:e.request.method,url:e.request.url,status_code:String(e.response.status)},timestamp:e.request.timestamp})})}),fe(function(e,n){var t=e.param,e=e.time;"complete"===t.name&&r({type:"route",category:n,message:t.value.errMsg||t.value.errorMessage||"",timestamp:e,data:{url:t.url||""}})}),[e,r]}},Hn=function(){return function(e,t){var r=e.isCalculateSize;de().subscribe(function(e){var n={duration:e.renderTime,start_time:e.startTime};r&&(n.size=(e=e.data,TextEncoder?(new TextEncoder).encode(v(e)).length:2*v(e).length)),t({ev_type:"set_data",payload:n})})}},Gn=function(){return function(e,n){function t(){n({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;ce(q.onLaunch).pipe(Ke(1)).subscribe(function(e){r.activate_start=e.time}),ce(q.onShow).pipe(Ke(1)).subscribe(function(e){r.init_end=e.time}),se("onLoad").pipe(Ke(1)).subscribe(function(e){r.page_load_start=e.time}),se("onShow").pipe(Ke(1)).subscribe(function(e){r.page_dom_end=e.time});var i=he();se("onReady").pipe(Ke(1)).subscribe(function(e){r.page_render_end=e.time,i&&!r.trigger||t()}),i&&xe("performance").pipe(Je(function(e){return"appClick"===e.name}),Ke(1)).subscribe(function(e){r.trigger=e.startTime,r.page_render_end&&t()}),ce(q.onHide).subscribe(function(){o||t()})}},Kn=function(){return function(e,n){vn().pagePerfSubscriber(function(e){return n({ev_type:"page_perf",payload:e})})}},Jn=function(n){return void 0===n&&(n=vn()),function(e,t){var r,o;he()&&n.performanceSubscriber&&(r=0,se("onLoad").subscribe(function(e){o=e.time,r++}),n.performanceSubscriber(function(e){var n={is_custom:!1,name:e.name,value:e.startTime,type:"perf",count:r};n.duration=e.duration||(o?e.startTime-o:0),n.is_support=0<=n.duration,t({ev_type:"performance",payload:n})}))}},Wn="pageview",Yn={routeMode:Fn.history,setPidAndViewId:function(e,n){}},$n="jsError",Qn={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},Xn=function(t){return function(e){var n=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},e),{breadcrumbs:n})})}},Zn={maxBreadcrumbs:20,tap:!0},et="breadcrumb",nt=function(n){n.on("init",function(){n.provide("_subscriptions",[]),ve(n),n.on("init",function(){en(Y),fn(Q),cn($)}),n.on("init",function(){ln(W)})}),n.on("beforeDestroy",function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]})},rt="setData",ot={isCalculateSize:!1},it="appLaunchPerf",at={},ut="pagePerf",ct={},st="performance",ft={},lt=function(e,n,t){void 0===t&&(t=vn());var r=n.url,o=n.data,i=n.success,a=void 0===i?l:i,u=n.fail,c=void 0===u?l:u,i=n.header,u={"Content-Type":"application/json"};K(n=i)&&0!==Object.keys(n).length&&Object.assign(u,i),t.request({method:e,url:r,data:o,header:u,headers:u,success:function(e){a(e)},fail:function(e){e=e.errMsg||"Network request failed";c(new Error(e))}})},pt=function(n){return(n=void 0===n?vn():n)?{get:function(e){return lt("GET",e,n)},post:function(e){return lt("POST",e,n)}}:{get:l,post:l}};function dt(e){return e=bn(String(e)),(e=gn(e))&&e.userId&&e.deviceId?e:{userId:D(),deviceId:D()}}function ht(e){return e+"_"+Date.now()}function mt(e){var n=e.aid,t=e.userId,e=e.deviceId;!function(e,n){try{vn().setStorage(e,n)}catch(e){}}(bn(String(n)),{userId:t,deviceId:e})}var vt={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:d(d({},e.extra||{}),e.overrides||{})}}},bt="/monitor_mini/collect",gt="/settings/minipro",yt="apmplus.volces.com",_t="session",wt={sample_rate:1,include_users:[],sample_granularity:_t,rules:{}},St=[bt,gt],Et="0.2.4",xt="APM_PLUS_MINI_PROGRAM",Ot=function(e,n){return void 0===n&&(n=bt),(e&&0<=e.indexOf("//")?"":"https://")+e+n};function kt(e){e=dt(e.aid);return{aid:0,token:"",pid:"",viewId:ht("_"),userId:e.userId,deviceId:e.deviceId,sessionId:D(),domain:yt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:St},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:wt,sdkName:xt,sdkVersion:Et}}function jt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!S(t[n])&&(t[n]={});return d(d({},e),{plugins:t})}function Tt(e){return S(e)&&"aid"in e&&"token"in e}function Ct(e){return d({},e)}var Dt=function(n){var r,o,i=n,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(e){var n,t;return a=d(d({},a),e||{}),s(),r||(r=e,i.useLocalConfig||!i.aid?(o={},c()):u?f():(n=i.domain,e=i.aid,t=function(e){u=e,f()},pt().get({url:function(e,n){return void 0===n&&(n=gt),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(n)+"?biz_id="+e,success:function(e){t(e&&e.data&&e.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(e){t=e},onReady:function(e){c=function(){mt(i),e()},o&&c()}};function s(){var e=d(d(d({},n),o||{}),a);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=p(t,e[r++]);return t}(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=Pt(Pt(n.sample,null==o?void 0:o.sample),a.sample),i=e,t()}function f(){o=function(e){if(!e)return{};var n=e.sample,t=e.user_id,r=e.timestamp,o=t?{userId:t}:{};if(!n)return o;var i=n.sample_rate,e=n.sample_granularity,t=void 0===e?_t:e,e=n.include_users,n=n.rules,n=void 0===n?[]:n;return d(d({},o),{sample:{include_users:e,sample_rate:i,sample_granularity:t,rules:n.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r})}(u),function(e){e=bn(e);return!!vn().getStorage(e)}(String(i.aid))&&(o.userId=n.userId),s(),c()}};function Pt(r,o){if(!r||!o)return r||o;var e=d(d({},r),o);return e.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),e.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=d(d({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=_(_([],y(r.rules[n].conditional_sample_rules||[]),!1),y(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}function It(e){var n={url:(n=vn().getCurrentPages().pop())?(n?nn(n):"")+s(n.options):"",timestamp:Z()};return d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})})}function Rt(e){if(!mn(e))throw Error(U);var t,e=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};w.forEach(function(e){return f[e]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=P(),b={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(l)O("already inited");else{if(!(e&&S(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=a(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(u(e))),null==r?void 0:r.getConfig()},provide:function(e,n){E(m,e)?O("cannot provide "+e+", reserved"):(b[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(e){return n.build(e)}),h=[]}))},report:function(e){e&&(!(e=k(f.beforeReport)(e))||(e=k(f.report)(e))&&(p?this.build(e):h.push(e)))},build:function(e){!p||(e=k(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=k(f.build)(e))&&this.send(e))},send:function(e){!p||(e=k(f.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&p||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=x(f[e],n))},destroyAgent:v},m=Object.keys(b);return b;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[e].forEach(function(e){try{e.apply(void 0,_([],y(t),!1))}catch(e){}}),n&&(f[e].length=0)}}({validateInitConfig:Tt,initConfigNormalizer:jt,userConfigNormalizer:Ct,createSender:function(e){return n({size:G,endpoint:Ot(e.domain),transport:pt()})},builder:vt,createDefaultConfig:kt,createConfigManager:Dt});return I(e),qt(e),Nt(e),At(e),z(e),nt(e),(t=e).on("init",function(){var n=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){E(n,e.name)||(n.push(e.name),e.setup(t),e.tearDown&&t.on("beforeDestroy",e.tearDown))})}),Ft(e),Mt(e),e}var Mt=function(n){function t(e){return void 0===e&&(e=vn().getSystemInfo()),n.set(d({},e))}function r(){t(),e()}var o,i,a=!1,e=(i="",function(){var e=o.getSender();i=i||e.getEndpoint();var n=o.config(),n={did:n.deviceId,sid:n.sessionId,sname:n.sdkName,sver:n.sdkVersion,soffset:n.offset||0,model:n.model,brand:n.brand,ratio:n.pixelRatio,screen:n.screenArea,window:n.windowArea,lang:n.language,osname:n.osName,osver:n.osVersion,libver:n.SDKVersion,scene:n.scene||-1,menv:n.miniEnv,mver:n.miniVersion,hostname:n.hostName,hostver:n.hostVersion,platform:n.platform,biz_id:n.aid,x_auth_token:n.token};e.setEndpoint(i+s(n))});(o=n).on("start",function(){r(),a=!0}),n.on("init",function(){ce(q.onLaunch).pipe(Ke(1)).subscribe(function(e){e=e.param.scene||-1;t({scene:e}),a&&r()}),vn().monitorNetworkType(function(e){e=e.networkType;n.set({networkType:e})})})},Nt=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,e.network_type=t.networkType,d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})});var n,t})},At=function(e){e.on("report",It)},Ft=function(n){n.on("init",function(){ce(q.onHide).subscribe(function(){var e=n.getSender();e&&e.flush()})})},qt=function(t){var r,o=!1;t.on("init",function(){r=Z(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=Z())-r<1e3&&n&&(e=n-(e+r)/2,isNaN(e)||t.set({offset:e})))})})};return function(e){var n,t,r,i,o,a,u,c,s,e=Rt(e);if(e)return(n=e).provide("sendEvent",function(e){e=B(e);e&&n.report({ev_type:L,payload:e,extra:{timestamp:Date.now()}})}),n.provide("sendLog",function(e){e=V(e);e&&n.report({ev_type:L,payload:e,extra:{timestamp:Date.now()}})}),(t=e).on("init",function(){var e,n=Mn(t,Wn,Yn);n&&(n=(e=y(Rn(Vn,d(d({},n),{setPidAndViewId:function(e,n){t.set({pid:e,viewId:n,actionId:void 0})}}),t.report.bind(t)),2))[0],e=e[1],t.provide("sendPageview",n),t.provide("sendPageviewWithHide",e))}),(r=e).on("init",function(){var e,n=Mn(r,$n,Qn);n&&(e=Xn(r),e=y(Rn(Ln,n,e),1)[0],r.provide("captureException",e))}),(i=e).on("init",function(){var e,n,t,r,o=Mn(i,qn,zn);o&&(e=o.hookRequest,n=o.hookDownloadFile,t=o.hookUploadFile,r=[],e&&r.push("request"),n&&r.push("downloadFile"),t&&r.push("uploadFile"),xn(i,r),Rn(In,o,i.report.bind(i)))}),(o=e).on("init",function(){var e=Mn(o,rt,ot);e&&(Tn(o),Rn(Hn,e,o.report.bind(o)))}),(a=e).on("init",function(){var e,n=Mn(a,et,Zn);n&&(n=(e=y(Rn(Un,n,function(e){}),2))[0],e=e[1],a.provide("getBreadcrumbs",n),a.provide("addBreadcrumb",e))}),(u=e).on("init",function(){var e=Mn(u,it,at);e&&(Cn(u),Rn(Gn,e,u.report.bind(u)))}),(c=e).on("init",function(){var e=Mn(c,ut,ct);e&&Rn(Kn,e,c.report.bind(c))}),(s=e).on("init",function(){var e=Mn(s,st,ft);e&&(Cn(s),Rn(Jn,e,s.report.bind(s)))}),e}.bind(null,[we])()}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).swanClient=n()}(this,function(){"use strict";function n(e){var t,r=e.transport,o=e.endpoint,n=e.size,i=void 0===n?10:n,e=e.wait,a=void 0===e?1e3:e,u=[],c=0;function s(){var n;u.length&&(n=this.getBatchData(),r.post({url:o,data:n,fail:function(e){t&&t(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(e=u,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),u=[]},fail:function(e){t=e}}}var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(e){return e}function S(e){return"object"==typeof e&&null!==e}var t=Object.prototype;function i(e){if(S(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(e);e=Object.getPrototypeOf(e);return e===t||null===e}}function a(e){return"[object Array]"===t.toString.call(e)}function h(e){return"function"==typeof e}function u(e){return"number"==typeof e}function c(e){return"string"==typeof e}function p(e,n){var t,r,o=d({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(S(n[t])&&i(n[t])?o[t]=p(S(e[t])?e[t]:{},n[t]):a(n[t])&&a(e[t])?o[t]=function n(e,t){e=a(e)?e:[];t=a(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:S(e)&&i(e)?p({},e):a(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function E(e,n){if(!a(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function x(e,n){if(!a(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function m(e){return a(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];c(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function v(e){try{return c(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function s(t){return S(t)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""}function O(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,_(["[SDK]",Date.now(),j(""+P++)],y(e),!1))}function o(e){return Math.random()<Number(e)}function f(e,n){return e<Number(n)}function k(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){C(e)}return n}}var g=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(e),!1)),o=r;return h(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return h(t)&&t.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=t:r=t)}}},j="".padStart?function(e,n){return e.padStart(n=void 0===n?8:n," ")}:function(e){return e},T=0,C=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,_(["[SDK]",Date.now(),j(""+T++)],y(e),!1))},P=0;function D(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}function I(){function r(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){i[e]&&i[e].forEach(function(e){r(e[1])}),i[e]=void 0}var o=!1,i={};return{set:function(e,n,t){i[e]?i[e].push([n,t]):i[e]=[[n,t]],o&&r(t)},has:function(e){return!!i[e]},remove:n,removeByEvType:function(n){Object.keys(i).forEach(function(e){i[e]&&i[e].forEach(function(e){e[0]===n&&r(e[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(e){n(e)})}}}var R=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=v(n),o},merge:function(n){return t=d(d({},t),n),Object.keys(n).forEach(function(e){r[e]=v(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return d({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})};function M(r,o){r.on("init",function(){function e(e){e.forEach(function(e){var n=e.name;E(t,n)||(t.push(n),e.setup(r),o&&o(n,e.setup),r.destroyAgent.set(n,n,[function(){t=x(t,n),e.tearDown&&e.tearDown()}]))})}var t=[];r.provide("applyIntegrations",e);var n=r.config();n&&n.integrations&&e(n.integrations)})}function N(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function A(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function F(e,n,t,r){if(void 0===(e=function(e,n,t){for(var r,n=y(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=y(i))[0],i=r.slice(1);if(e)return t(e,o)}(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":u(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return E(n,e);case"neq":return!E(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function q(n,e){try{return"rule"===e.type?F(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return q(n,e)}):e.children.some(function(e){return q(n,e)})}catch(e){return!1}}function z(e,n,t,r){if(!n)return b;var o=n.sample_rate,i=n.include_users,a=n.sample_granularity,u=n.rules,n=void 0===(n=n.r)?Math.random():n;if(E(i,e))return function(e){return N(e,1)};var c,s,f,l,p,d,h,m=A(a="session"===a,o,t,n,r),v=(c=u,s=a,f=o,l=t,p=n,d=r,h={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(h[e]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:A(s,r,l,p,d)},n&&(h[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:A(s,n,l,p,d),effectiveSampleRate:n*f,filter:e}}))):h[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(e){if(!m())return!1;if(!(e.ev_type in v))return N(e,o);if(!v[e.ev_type].enable)return!1;if(e.common&&e.common.sample_rate)return e;var n=v[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(q(e,t[r].filter))return!!t[r].hit()&&N(e,t[r].effectiveSampleRate);return!!n.hit()&&N(e,n.effectiveSampleRate)}}var L,B=function(t){t.on("start",function(){var e=t.config(),n=e.userId,e=e.sample,e=z(n,e,o,f);t.on("build",e)})},V="custom",U=function(e){if(e&&S(e)&&e.name&&c(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&S(e.metrics)){var t=e.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&S(e.categories)){var o,i=e.categories,a={};for(o in i)a[o]=v(i[o]);n.categories=a}return n}},H=function(e){if(e&&S(e)&&e.content&&c(e.content)){var n={content:v(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&S(e.extra)){var t,r=e.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=v(r[t]);n.metrics=o,n.categories=i}return n}},G="Adapters imported incorrectly",K=["success","fail","complete"],J=20;(Ee=L=L||{}).onLaunch="onLaunch",Ee.onShow="onShow",Ee.onHide="onHide",Ee.onError="onError",Ee.onPageNotFound="onPageNotFound",Ee.onUnhandledRejection="onUnhandledRejection";function W(e){return"[object Object]"===Object.prototype.toString.call(e)}var Y=["request","downloadFile","uploadFile"],$=_(_([],y(["navigateTo","redirectTo","switchTab","reLaunch"]),!1),["navigateBack"],!1),Q=_(_([],y([L.onLaunch,L.onShow,L.onHide]),!1),[L.onError,L.onPageNotFound,L.onUnhandledRejection],!1),X=["attached","onInit"],Z=["onLoad","onShow","onReady","onUnload","onHide"],ee="__HOOKED__";var ne=function(){return Date.now()};function te(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!h(e))return 0;var r,o=ne();try{e.apply(this,n)}finally{r=ne()}return r-o}var re,oe=function(){},ie=y((re="tt",[function(){return re},function(e){return re=e}]),2),ae=ie[0];ie[1];function ue(e,n,r){var o=e[n];if(!o||!o[ee])return Object.defineProperty(e,n,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=r.apply(this,e);t&&(e=t)}catch(e){C(e)}return o.apply(this,e)}}),e[n]&&(e[n][ee]=!0),function(){e[n][ee]=!1,r=oe}}function ce(t,e){Object.keys(e).forEach(function(n){e[n].addTearDown(function(){var e;return Oe(t,((e={})[n]=null,e))})})}function se(e,n){n.addTearDown(function(){return xe(e,null)})}function fe(e){return ke("app")[e]}function le(e){return ke("page")[e]}function pe(t,e){(e=void 0===e?$:e).forEach(function(n){Te(n)&&je(n).subscribe(function(e){return t(e,n)})})}function de(e){return ke("http")[e]}function he(e){return!!ke("http")[e]}function me(){return ke("setData")}function ve(){return!!ke("performance")}function be(){return ke("instance")}function ge(e){xe("instance",e)}var ye=function(n,t){function e(e){return t(e),n.call(this,e)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},_e=function(){var e={instance:null};return e.instance||("undefined"!=typeof tt?e={instance:tt,platform:ae()}:"undefined"!=typeof my?e={instance:my,platform:"my"}:"undefined"!=typeof swan?e={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(e={instance:wx,platform:"wx"})),e},we="__slardar__global__0.2.5-alpha.0",Se={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},Ee=function(e,n){void 0===e&&(e={});var t=(n=void 0===n?_e().instance:n)?n[we]||(n[we]=e):e;return{setGlobalValue:function(e,n){t[e]=n},mergeGlobalValue:function(e,n){t[e]=d(d({},t[e]),n)},getGlobalValue:function(e){return t[e]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},Se),n&&(n[we]=t)}}}(d({},Se)),xe=Ee.setGlobalValue,Oe=Ee.mergeGlobalValue,ke=Ee.getGlobalValue,je=function(e){return ke("route")[e]},Te=function(e){return!!ke("route")[e]},Ce=function(e){return ke("component")[e]};function Pe(e){return"function"==typeof e}function De(e,n){!e||0<=(n=e.indexOf(n))&&e.splice(n,1)}function Ie(e){return e}function Re(t){return function(e){if((n=e)&&Pe(n.lift))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});var n;throw new TypeError("Unable to lift unknown Observable type")}}function Me(e){Pe(e)?e():null!=e&&e.unsubscribe()}var Ne=function(e){return e instanceof Ae||e&&"closed"in e&&Pe(e.remove)&&Pe(e.add)&&Pe(e.unsubscribe)},Ae=(Fe.prototype.unsubscribe=function(){var e,n,t,r=this;this.closed||(this.closed=!0,e=this._parentage,n=this._finalizers,t=this.initialTeardown,e&&(this._parentage=null,e.forEach(function(e){return e.remove(r)})),Pe(t)&&t(),n&&(this._finalizers=null,n.forEach(Me)))},Fe.prototype.remove=function(e){this._finalizers&&De(this._finalizers,e),e instanceof Fe&&e._removeParent(this)},Fe.prototype.add=function(e){if(e&&e!==this)if(this.closed)Me(e);else{if(e instanceof Fe){if(e.closed||e._hasParent(this))return;e._addParent(this)}var n=this._finalizers;this._finalizers=n?(n.push(e),n):[e]}},Fe.prototype._addParent=function(e){var n=this._parentage;this._parentage=n?(n.push(e),n):[e]},Fe.prototype._hasParent=function(e){return this._parentage&&~this._parentage.indexOf(e)},Fe.prototype._removeParent=function(e){this._parentage&&De(this._parentage,e)},Fe);function Fe(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var qe,ze=(e(Le,qe=Ae),Le.prototype.next=function(e){this.isStopped||this.destination.next(e)},Le.prototype.error=function(e){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(e)}finally{this.unsubscribe()}}},Le.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Le.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,qe.prototype.unsubscribe.call(this),this.destination=null)},Le.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Le);function Le(e){var n=qe.call(this)||this;return n.isStopped=!1,n.destination=Ue(e)?e:new Be(!(e=e)||Pe(e)?{next:null!=e?e:void 0}:e),n}var Be=(Ve.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(e){console.error("ConsumerObserver.next error",e)}},Ve.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(e){console.error("ConsumerObserver.error error",e)}},Ve.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){console.error("ConsumerObserver.complete error",e)}},Ve);function Ve(e){this.partialObserver=e}function Ue(e){return e instanceof ze||e&&((n=e)&&Pe(n.next)&&Pe(n.error)&&Pe(n.complete))&&Ne(e);var n}He.prototype.subscribe=function(e){var n=Ue(e)?e:new ze(e),t=this.operator,e=this.source;return n.add(t?t.call(n,e):this._trySubscribe(n)),n},He.prototype.lift=function(e){var n=new He;return n.source=this,n.operator=e,n},He.prototype.pipe=function(){for(var n,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?Ie:1===n.length?n[0]:function(e){return n.reduce(function(e,n){return n(e)},e)})(this)},He.prototype._subscribe=function(e){},He.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},ie=He;function He(e){e&&(this._subscribe=e)}var Ge,Ee=(e(Ke,Ge=ie),Ke.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(e){return e.next(n)})},Ke.prototype.commonJudgement=function(e){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,e())},Ke.prototype.error=function(n){var t=this;this.commonJudgement(function(){var e=t.observers;for(t.hasError=!0,t.thrownError=n;e.length;)e.shift().error(n)})},Object.defineProperty(Ke.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Ke.prototype.complete=function(){var n=this;this.commonJudgement(function(){for(var e=n.observers;e.length;)e.shift().complete()})},Ke.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Ke.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Ke.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Ke.prototype._checkFinalizedStatuses=function(e){var n=this.hasError,t=this.thrownError,r=this.isStopped;n?e.error(t):r&&e.complete()},Ke.prototype._innerSubscribe=function(e){var n=this.isStopped,t=this.observers;return n?Ke.EMPTY:(t.push(e),new Ae(function(){De(t,e)}))},Ke.EMPTY=((Ee=new Ae).closed=!0,Ee),Ke);function Ke(){var e=null!==Ge&&Ge.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var Je=new ie(function(e){return e.complete()});function We(r){return r<=0?function(){return Je}:Re(function(e,n){var t=0;e.subscribe(function(e){++t<=r&&(n.next(e),r<=t&&n.complete())})})}function Ye(r,o){return Re(function(e,n){var t=0;e.subscribe(function(e){return r.call(o,e,t++)&&n.next(e)})})}function $e(t){return Ye(function(e,n){return t<=n})}var Qe,Xe=(e(Ze,Qe=Ee),Ze.prototype.subscribe=function(e){var t=this,e=Qe.prototype.subscribe.call(this,e);be()&&be()._subscriptions.push(e);var r=e.unsubscribe;return e.unsubscribe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(this,e),t.observed||t.unsubscribe()},e},Ze.prototype.unsubscribe=function(){Qe.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(e){return e()})},Ze.prototype.addTearDown=function(e){this.tearDownFns.push(e)},Ze);function Ze(){var e=null!==Qe&&Qe.apply(this,arguments)||this;return e.tearDownFns=[],e}function en(e){var n=e.reduce(function(e,n){return e[n]=new Xe,e},{});return{getSubject:function(e){return n[e]},subjectMap:n}}function nn(e){return 1<e.length?e:e.length&&e[0]||{}}function tn(e){var t=e.filter(function(e){return e=e,!!!ke("app")[e]}),e=en(t).subjectMap;Oe("app",e=e),ce("app",e),App=ye(App,function(n){t.forEach(function(e){var r=fe(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.next({that:this,param:nn(e),time:ne()}),h(t)&&t.apply(this,e)}})();e&&r.addTearDown(e)})})}function rn(e){return e.route||e.__route__||e.url||e.path||""}function on(e){function n(e,i){r.forEach(function(o){g(e,o,function(r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Ce(o).next({that:this,param:null,time:ne()});var t=i[o];if(h(t)&&t.apply(this,e),h(r))return r.apply(this,e)}})()})}var t=["attached"],r=e.filter(function(e){return~t.indexOf(e)});try{Component=ye(Component,function(e){S(e.lifetimes)?n(e.lifetimes,e):void 0!==e.lifetimes&&null!==e.lifetimes||(e.lifetimes={},n(e.lifetimes,e))})}catch(e){}}function an(n){Ce("attached").subscribe(function(e){e=e.that;return n.call(e)})}function un(e){return"android"===e.toLowerCase()}function cn(e){return e&&function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMError]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?{name:e.name,message:e.message,stack:e.stack}:On(e)}function sn(){var e="",n="";swan.getEnvInfoSync&&(n=(d=swan.getEnvInfoSync()).env,e=d.appKey);var t=(h=swan.getSystemInfoSync()).model,r=h.brand,o=h.pixelRatio,i=h.screenHeight,a=h.screenWidth,u=h.windowHeight,c=h.windowWidth,s=h.language,f=h.version,l=h.system,p=h.platform,d=h.SDKVersion,h=h.host;return{model:t,brand:r,pixelRatio:o,screenArea:xn({width:a,height:i}),windowArea:xn({width:c,height:u}),language:s,osName:En(p),osVersion:l,SDKVersion:d,appId:e,miniEnv:n,miniVersion:"",hostName:h,hostVersion:f,platform:"swan"}}function fn(e){var n=e.filter(function(e){return e=e,!!!ke("component")[e]}),e=en(n).subjectMap;Oe("component",e=e),ce("component",e),gn().componentSubject(n)}function ln(n){function e(e){W(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))}try{Component=ye(Component,e),Behavior=ye(Behavior,e)}catch(e){}}function pn(e,n){var t=e.filter(function(e){return e=e,!!!ke("page")[e]}),e=en(t).subjectMap;Oe("page",e=e),ce("page",e),e=function(n){t.forEach(function(e){var r=le(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(rn(this)&&r.next({that:this,param:nn(e),time:ne()}),h(t))return t.apply(this,e)}})();e&&r.addTearDown(e)})},Page=ye(Page,e),ln(e)}function dn(e){var n=e.filter(function(e){return!Te(e)}),t=en(n).subjectMap;Oe("route",e=t),ce("route",e),n.forEach(function(i){var e=ue(gn().instance,i,function(o){void 0===o&&(o={}),je(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:ne()}),K.forEach(function(r){g(o,r,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];je(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:nn(e)||{}},time:ne()}),h(t)&&t.apply(this,e)}})()})});e&&t[i].addTearDown(e)})}function hn(u,e){var n=e.url,t=e.method,r=e.data,o=e.header,i=e.headers,c={api:u,request:{url:n,method:(n=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&n||"GET"),headers:o||i||{},body:v(r),timestamp:ne()},response:{}};g(e,"complete",function(a){return function(e){var n=c.response.timestamp||ne();c.duration=n-c.request.timestamp,c.completeCallbackTime=te(a,e);var t,r,o,i=e.errMsg||e.errorMessage||e.error;c.response={status:(t=e.status,r=e.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:n,headers:e.header||e.headers||{},body:v(e.data),errMsg:i,timing:gn().buildRequestProfile(e.profile||{})},de(u).next(c)}})(),g(e,"success",function(n){return function(e){c.response.timestamp=ne(),c.response.status=200,c.successCallbackTime=te(n,e)}})(),g(e,"fail",function(n){return function(e){c.response.timestamp=ne(),c.response.status=-1,c.failCallbackTime=te(n,e)}})()}function mn(e,t){void 0===t&&(t=gn().instance);var n=e.filter(function(e){return!he(e)}),r=en(n).subjectMap;Oe("http",e=r),ce("http",e),n.forEach(function(n){var e=ue(t,n,function(e){hn(n,e)});e&&r[n].addTearDown(e)})}var vn,ie=y((vn={},[function(e){if(!_e().platform)throw Error("Not support current Mini Program");if(!Array.isArray(e)||!e.length)return null;e=e.find(function(e){return e.platform===_e().platform});return e&&(vn=e.adapterCtor())},function(){return vn}]),2),bn=ie[0],gn=ie[1],yn=function(e){return"SLARDAR"+e},_n=function(e){try{return gn().getStorage(e)}catch(e){return}},wn=["darwin","macs","mac"],Sn=["windows_nt","windows","window"],En=function(e){return un(e)?"Android":"ios"===e.toLowerCase()?"iOS":~wn.indexOf(e.toLowerCase())?"Mac":~Sn.indexOf(e.toLowerCase())?"windows":"unknown"},xn=function(e){var n=e.systemPlatform,t=e.pixelRatio,r=e.width,e=e.height;return n&&un(n)&&t?r/t+" * "+e/t:r+" * "+e},On=function(e){return{name:"unknown_error_name",message:v(e)}},Ee={platform:"swan",adapterCtor:function(){return d(d({},{instance:t=void 0===t?_e().instance:t,request:function(e){return t.request(e)},getStorage:function(e){return t.getStorageSync(e)},setStorage:function(e,n){return t.setStorageSync(e,n)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(e){return e},monitorNetworkType:function(n){t.getNetworkType({success:function(e){n&&n({networkType:e.networkType})}}),t.onNetworkStatusChange(function(e){n&&n({networkType:e.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"swan",buildError:cn,getSystemInfo:sn,componentSubject:on,setDataSubject:an,pagePerfSubscriber:function(n){function t(e){e.navigate_name=e.navigate_name||"native",e.load_start=e.load_start||0,e.dom_end=e.dom_end||0,e.render_end=e.render_end||0,e.navigate_start&&0!==e.load_start&&(n(d({},e)),e.load_start=0,i=!0)}var r={},o={},i=!1,a=!0;pe(function(e,n){"invoke"===e.param.name&&(i=!1,r={navigate_start:e.time,navigate_name:n},o={navigate_start:e.time,navigate_name:n})}),le("onLoad").pipe($e(1)).subscribe(function(e){e.that.componentName?o.dom_end=e.time:r.load_start=e.time}),le("onShow").pipe($e(1)).subscribe(function(e){e.that.componentName?(o.load_start=e.time,r.load_start=0):r.dom_end=e.time}),le("onReady").pipe($e(1)).subscribe(function(e){e.that.componentName?a?a=!1:(o.render_end=e.time,t(o)):(r.render_end=e.time,t(r),a=!1)}),fe(L.onHide).subscribe(function(){i||(t(r),t(o))})}});var t}},kn=function(e,n){void 0===n&&(n=Y),e.on("init",function(){mn(n)})};function jn(){var a=rn(this),u=me();var e=ue(this,"setData",function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=r[0],i=ne();return[o,function(){var e=r[1],n=ne()-i;u.next({renderTime:n,url:a,data:o,startTime:i}),e&&e.call(t)}]});e&&u.addTearDown(e)}function Tn(){var e;ke("setData")||(e=(e=en(["setData"]).getSubject)("setData"),xe("setData",e),se("setData",e))}function Cn(o){return Object.keys(o).reduce(function(e,n){var t,r;return r=o[t=n],t&&r&&(In.test(t)||Rn.test(r))||(e[n]=o[n]),e},{})}var Pn=function(e){e.on("init",function(){Tn(),le("onLoad").subscribe(function(e){e=e.that;jn.call(e)}),gn().setDataSubject(jn)})},Dn=function(e){e.on("init",function(){var n,e,t,r=gn();r.observePerformance&&!ve()&&(n=(0,en(["performance"]).getSubject)("performance"),xe("performance",e=n),se("performance",e),(t=r.observePerformance(function(e){e.forEach(function(e){n.next(e)})}))&&t.disconnect&&n.addTearDown(function(){return t.disconnect()}))})},In=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Rn=new RegExp("(bearer|session)","i"),Mn=function(){return function(e,s){var n=e.hookRequest,t=e.hookDownloadFile,r=e.hookUploadFile,f=e.ignoreUrls,l=e.collectBodyOnError,p=e.extraExtractor,e=function(e){var n,t,r,o,i,a,u,c;!function(e,n){e=m(e||[]);return!!e&&e.test(n)}(f,e.request.url)&&(c=e.response,n=e.request,t=e.api,r=e.duration,o=e.failCallbackTime,u=e.successCallbackTime,i=e.completeCallbackTime,n.headers=Cn(n.headers||{}),c.headers=Cn(c.headers||{}),a=c.errMsg,e=function(e,n){var t={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}(c,["errMsg"]),e=d(d({},e),{is_custom_error:!1}),a&&(e.err_msg=a),u={api:t,request:n,duration:r,cbTime:i+(o||0)+(u||0),response:e},!h(p)||(e=p(c.body,u))&&(u.extra=e,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};n&&de("request").subscribe(e),t&&de("downloadFile").subscribe(e),r&&de("uploadFile").subscribe(e)}},Nn=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,_([],y(r),!1));return o&&o(n,t)||[]}catch(e){return C("applyMonitor",e),[]}};function An(e,n,t){ge(e);n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return S(n)?d(d({},t),n):!!n&&t}function Fn(e,n){return e&&n&&e===n}function qn(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Fn(n.message,t.message)&&!Fn(n.stack,t.stack)))return void(r=e)}catch(e){}var n,t;return r=e}}var zn,Ln="http",Bn={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Vn=function(f){return void 0===f&&(f=gn()),function(e,r){var n=e.ignoreErrors,t=e.hookOnError,o=e.hookOnUnhandledRejection,i=e.hookRouteError,a=e.dedupe,u=m(n),c=qn(),s=function(e,n,t){e=a?c(e):e;e&&(u&&u.test(e.message)||(e={error:e},n&&(e.extra=n),t&&(e.react=t),r(e)))};t&&fe(L.onError).subscribe(function(e){e=e.param,e=f.buildError(e);u&&u.test(e.message)||s(e)}),o&&fe(L.onUnhandledRejection).subscribe(function(e){var n=e.param||{},e=n.promise,t=v(n.reason);u&&u.test(t)||e.catch(b).then(function(e){var n={name:"UnhandledRejection",message:t};e&&e.stack&&(n.stack=e.stack),s(n)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&pe(function(e){e=e.param;"fail"===(e=e).name&&s({name:"RouteError",message:e.value.errMsg})}),[s]}};(ie=zn=zn||{}).history="history",ie.manual="manual";function Un(t,e,r){var o=e,i=null,a=0,n="launch";function u(e,n){o=n,a=ne(),r(n,i=n+"_"+a),t(e,n)}return fe(L.onShow).pipe($e(1)).subscribe(function(){n="show"}),pe(function(){n="history"}),[u,function(e){e&&(u(n,e),n="history")},function(e){void 0===e&&(e="hide"),i&&(r(o,i),i=null,t(e,o,ne()-a))}]}var Hn=function(){return function(e,r){var n=e.extractPid,t=e.routeMode,o=e.setPidAndViewId,i=function(e){return n?n(e):e},e=y(Un(function(e,n,t){r({ev_type:"pageview",payload:{pid:n,source:e,duration:t}})},"",o),3),o=e[0],a=e[1],e=e[2];return t!==zn.manual&&(le("onShow").subscribe(function(e){return function(e){e=rn(e),e=i(e);a(e)}(e.that)}),le("onUnload").subscribe(e.bind(null,"unload")),le("onHide").subscribe(e.bind(null,"hide"))),[o.bind(null,"user_set"),e]}},Gn=function(){return function(e){var n=y(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=b),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=d(d({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(_(_([],y(o),!1),[e],!1),n):_(_([],y(o),!1),[e],!1))}]}(e.maxBreadcrumbs,e.onAddBreadcrumb,e.onMaxBreadcrumbs),2),e=n[0],r=n[1];return Y.forEach(function(e){he(e)&&de(e).subscribe(function(e){r({type:"http",category:e.api,message:"",data:{method:e.request.method,url:e.request.url,status_code:String(e.response.status)},timestamp:e.request.timestamp})})}),pe(function(e,n){var t=e.param,e=e.time;"complete"===t.name&&r({type:"route",category:n,message:t.value.errMsg||t.value.errorMessage||"",timestamp:e,data:{url:t.url||""}})}),[e,r]}},Kn=function(){return function(e,t){var r=e.isCalculateSize;me().subscribe(function(e){var n={duration:e.renderTime,start_time:e.startTime};r&&(n.size=(e=e.data,TextEncoder?(new TextEncoder).encode(v(e)).length:2*v(e).length)),t({ev_type:"set_data",payload:n})})}},Jn=function(){return function(e,n){function t(){n({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;fe(L.onLaunch).pipe(We(1)).subscribe(function(e){r.activate_start=e.time}),fe(L.onShow).pipe(We(1)).subscribe(function(e){r.init_end=e.time}),le("onLoad").pipe(We(1)).subscribe(function(e){r.page_load_start=e.time}),le("onShow").pipe(We(1)).subscribe(function(e){r.page_dom_end=e.time});var i=ve();le("onReady").pipe(We(1)).subscribe(function(e){r.page_render_end=e.time,i&&!r.trigger||t()}),i&&ke("performance").pipe(Ye(function(e){return"appClick"===e.name}),We(1)).subscribe(function(e){r.trigger=e.startTime,r.page_render_end&&t()}),fe(L.onHide).subscribe(function(){o||t()})}},Wn=function(){return function(e,n){gn().pagePerfSubscriber(function(e){return n({ev_type:"page_perf",payload:e})})}},Yn=function(n){return void 0===n&&(n=gn()),function(e,t){var r,o;ve()&&n.performanceSubscriber&&(r=0,le("onLoad").subscribe(function(e){o=e.time,r++}),n.performanceSubscriber(function(e){var n={is_custom:!1,name:e.name,value:e.startTime,type:"perf",count:r};n.duration=e.duration||(o?e.startTime-o:0),n.is_support=0<=n.duration,t({ev_type:"performance",payload:n})}))}},$n="pageview",Qn={routeMode:zn.history,setPidAndViewId:function(e,n){}},Xn="jsError",Zn={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},et=function(t){return function(e){var n=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},e),{breadcrumbs:n})})}},nt={maxBreadcrumbs:20,tap:!0},rt="breadcrumb",ot=function(n){n.on("init",function(){n.provide("_subscriptions",[]),ge(n),n.on("init",function(){tn(Q),pn(Z),fn(X)}),n.on("init",function(){dn($)})}),n.on("beforeDestroy",function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]})},it="setData",at={isCalculateSize:!1},ut="appLaunchPerf",ct={},st="pagePerf",ft={},lt="performance",pt={},dt=function(e,n,t){void 0===t&&(t=gn());var r=n.url,o=n.data,i=n.success,a=void 0===i?l:i,u=n.fail,c=void 0===u?l:u,i=n.header,u={"Content-Type":"application/json"};W(n=i)&&0!==Object.keys(n).length&&Object.assign(u,i),t.request({method:e,url:r,data:o,header:u,headers:u,success:function(e){a(e)},fail:function(e){e=e.errMsg||"Network request failed";c(new Error(e))}})},ht=function(n){return(n=void 0===n?gn():n)?{get:function(e){return dt("GET",e,n)},post:function(e){return dt("POST",e,n)}}:{get:l,post:l}};function mt(e){return e=yn(String(e)),(e=_n(e))&&e.userId&&e.deviceId?e:{userId:D(),deviceId:D()}}function vt(e){return e+"_"+Date.now()}function bt(e){var n=e.aid,t=e.userId,e=e.deviceId;!function(e,n){try{gn().setStorage(e,n)}catch(e){}}(yn(String(n)),{userId:t,deviceId:e})}var gt={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:d(d({},e.extra||{}),e.overrides||{})}}},yt="/monitor_mini/collect",_t="/settings/minipro",wt="apmplus.volces.com",St="session",Et={sample_rate:1,include_users:[],sample_granularity:St,rules:{}},xt=[yt,_t],Ot="0.2.5-alpha.0",kt="APM_PLUS_MINI_PROGRAM",jt=function(e,n){return void 0===n&&(n=yt),(e&&0<=e.indexOf("//")?"":"https://")+e+n};function Tt(e){e=mt(e.aid);return{aid:0,token:"",pid:"",viewId:vt("_"),userId:e.userId,deviceId:e.deviceId,sessionId:D(),domain:wt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:xt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Et,sdkName:kt,sdkVersion:Ot}}function Ct(e){var n,t=e.plugins||{};for(n in t)t[n]&&!S(t[n])&&(t[n]={});return d(d({},e),{plugins:t})}function Pt(e){return S(e)&&"aid"in e&&"token"in e}function Dt(e){return d({},e)}var It=function(n){var r,o,i=n,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(e){var n,t;return a=d(d({},a),e||{}),s(),r||(r=e,i.useLocalConfig||!i.aid?(o={},c()):u?f():(n=i.domain,e=i.aid,t=function(e){u=e,f()},ht().get({url:function(e,n){return void 0===n&&(n=_t),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(n)+"?biz_id="+e,success:function(e){t(e&&e.data&&e.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(e){t=e},onReady:function(e){c=function(){bt(i),e()},o&&c()}};function s(){var e=d(d(d({},n),o||{}),a);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=p(t,e[r++]);return t}(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=Rt(Rt(n.sample,null==o?void 0:o.sample),a.sample),i=e,t()}function f(){o=function(e){if(!e)return{};var n=e.sample,t=e.user_id,r=e.timestamp,o=t?{userId:t}:{};if(!n)return o;var i=n.sample_rate,e=n.sample_granularity,t=void 0===e?St:e,e=n.include_users,n=n.rules,n=void 0===n?[]:n;return d(d({},o),{sample:{include_users:e,sample_rate:i,sample_granularity:t,rules:n.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r})}(u),function(e){e=yn(e);return!!gn().getStorage(e)}(String(i.aid))&&(o.userId=n.userId),s(),c()}};function Rt(r,o){if(!r||!o)return r||o;var e=d(d({},r),o);return e.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),e.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=d(d({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=_(_([],y(r.rules[n].conditional_sample_rules||[]),!1),y(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}function Mt(e){var n={url:(n=gn().getCurrentPages().pop())?(n?rn(n):"")+s(n.options):"",timestamp:ne()};return d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})})}function Nt(e){if(!bn(e))throw Error(G);return e=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};w.forEach(function(e){return f[e]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=I(),b={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(l)O("already inited");else{if(!(e&&S(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=a(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(u(e))),null==r?void 0:r.getConfig()},provide:function(e,n){E(m,e)?O("cannot provide "+e+", reserved"):(b[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(e){return n.build(e)}),h.length=0}))},report:function(e){e&&(!(e=k(f.beforeReport)(e))||(e=k(f.report)(e))&&(p?this.build(e):h.push(e)))},build:function(e){!p||(e=k(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=k(f.build)(e))&&this.send(e))},send:function(e){!p||(e=k(f.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){v.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(e,n){if("init"===e&&l||"start"===e&&p||"beforeDestroy"===e&&d)try{n()}catch(e){}else f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=x(f[e],n))},destroyAgent:v},m=Object.keys(b);return b;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[e].forEach(function(e){try{e.apply(void 0,_([],y(t),!1))}catch(e){}}),n&&(f[e].length=0)}}({validateInitConfig:Pt,initConfigNormalizer:Ct,userConfigNormalizer:Dt,createSender:function(e){return n({size:J,endpoint:jt(e.domain),transport:ht()})},builder:gt,createDefaultConfig:Tt,createConfigManager:It}),R(e),Lt(e),Ft(e),qt(e),B(e),ot(e),M(e),zt(e),At(e),e}var At=function(n){function t(e){return void 0===e&&(e=gn().getSystemInfo()),n.set(d({},e))}function r(){t(),e()}var o,i,a=!1,e=(i="",function(){var e=o.getSender();i=i||e.getEndpoint();var n=o.config(),n={did:n.deviceId,sid:n.sessionId,sname:n.sdkName,sver:n.sdkVersion,soffset:n.offset||0,model:n.model,brand:n.brand,ratio:n.pixelRatio,screen:n.screenArea,window:n.windowArea,lang:n.language,osname:n.osName,osver:n.osVersion,libver:n.SDKVersion,scene:n.scene||-1,menv:n.miniEnv,mver:n.miniVersion,hostname:n.hostName,hostver:n.hostVersion,platform:n.platform,biz_id:n.aid,x_auth_token:n.token};e.setEndpoint(i+s(n))});(o=n).on("start",function(){r(),a=!0}),n.on("init",function(){fe(L.onLaunch).pipe(We(1)).subscribe(function(e){e=e.param.scene||-1;t({scene:e}),a&&r()}),gn().monitorNetworkType(function(e){e=e.networkType;n.set({networkType:e})})})},Ft=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,e.network_type=t.networkType,d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})});var n,t})},qt=function(e){e.on("report",Mt)},zt=function(n){n.on("init",function(){fe(L.onHide).subscribe(function(){var e=n.getSender();e&&e.flush()})})},Lt=function(t){var r,o=!1;t.on("init",function(){r=ne(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=ne())-r<1e3&&n&&(e=n-(e+r)/2,isNaN(e)||t.set({offset:e})))})})};return function(e){var n,t,r,i,o,a,u,c,s,e=Nt(e);if(e)return(n=e).provide("sendEvent",function(e){e=U(e);e&&n.report({ev_type:V,payload:e,extra:{timestamp:Date.now()}})}),n.provide("sendLog",function(e){e=H(e);e&&n.report({ev_type:V,payload:e,extra:{timestamp:Date.now()}})}),(t=e).on("init",function(){var e,n=An(t,$n,Qn);n&&(n=(e=y(Nn(Hn,d(d({},n),{setPidAndViewId:function(e,n){t.set({pid:e,viewId:n,actionId:void 0})}}),t.report.bind(t)),2))[0],e=e[1],t.provide("sendPageview",n),t.provide("sendPageviewWithHide",e))}),(r=e).on("init",function(){var e,n=An(r,Xn,Zn);n&&(e=et(r),e=y(Nn(Vn,n,e),1)[0],r.provide("captureException",e))}),(i=e).on("init",function(){var e,n,t,r,o=An(i,Ln,Bn);o&&(e=o.hookRequest,n=o.hookDownloadFile,t=o.hookUploadFile,r=[],e&&r.push("request"),n&&r.push("downloadFile"),t&&r.push("uploadFile"),kn(i,r),Nn(Mn,o,i.report.bind(i)))}),(o=e).on("init",function(){var e=An(o,it,at);e&&(Pn(o),Nn(Kn,e,o.report.bind(o)))}),(a=e).on("init",function(){var e,n=An(a,rt,nt);n&&(n=(e=y(Nn(Gn,n,function(e){}),2))[0],e=e[1],a.provide("getBreadcrumbs",n),a.provide("addBreadcrumb",e))}),(u=e).on("init",function(){var e=An(u,ut,ct);e&&(Dn(u),Nn(Jn,e,u.report.bind(u)))}),(c=e).on("init",function(){var e=An(c,st,ft);e&&Nn(Wn,e,c.report.bind(c))}),(s=e).on("init",function(){var e=An(s,lt,pt);e&&(Dn(s),Nn(Yn,e,s.report.bind(s)))}),e}.bind(null,[Ee])()}); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).ttClient=n()}(this,function(){"use strict";function n(e){var t,r=e.transport,o=e.endpoint,n=e.size,i=void 0===n?10:n,e=e.wait,a=void 0===e?1e3:e,u=[],c=0;function s(){var n;u.length&&(n=this.getBatchData(),r.post({url:o,data:n,fail:function(e){t&&t(e,n)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(e){i=e},setWait:function(e){a=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){u.push(e),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(e=u,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),u=[]},fail:function(e){t=e}}}var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function h(e,n){var t={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(e){return e}function S(e){return"object"==typeof e&&null!==e}var t=Object.prototype;function i(e){if(S(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(e);e=Object.getPrototypeOf(e);return e===t||null===e}}function a(e){return"[object Array]"===t.toString.call(e)}function m(e){return"function"==typeof e}function u(e){return"number"==typeof e}function c(e){return"string"==typeof e}function p(e,n){var t,r,o=d({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(S(n[t])&&i(n[t])?o[t]=p(S(e[t])?e[t]:{},n[t]):a(n[t])&&a(e[t])?o[t]=function n(e,t){e=a(e)?e:[];t=a(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:S(e)&&i(e)?p({},e):a(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function E(e,n){if(!a(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function k(e,n){if(!a(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function v(e){return a(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];c(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function g(e){try{return c(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function s(t){return S(t)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""}function x(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,_(["[SDK]",Date.now(),(""+P++).padStart(8," ")],y(e),!1))}function o(e){return Math.random()<Number(e)}function f(e,n){return e<Number(n)}function O(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){C(e)}return n}}var j=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(e),!1)),o=r;return m(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return m(t)&&t.apply(this,n)}}),i[a]=o,function(e){e||(o===i[a]?i[a]=t:r=t)}}},T=0,C=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,_(["[SDK]",Date.now(),(""+T++).padStart(8," ")],y(e),!1))},P=0;function D(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}function I(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){r[e]&&r[e].forEach(function(e){t(e[1])}),r[e]=void 0}var r={};return{set:function(e,n,t){r[e]?r[e].push([n,t]):r[e]=[[n,t]]},remove:n,removeByEvType:function(n){Object.keys(r).forEach(function(e){r[e]&&r[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){Object.keys(r).forEach(function(e){n(e)})}}}var R=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=g(n),o},merge:function(n){return t=d(d({},t),n),Object.keys(n).forEach(function(e){r[e]=g(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return d({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})};function N(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function M(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function q(e,n,t,r){if(void 0===(e=function(e,n,t){for(var r,n=y(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=y(i))[0],i=r.slice(1);if(e)return t(e,o)}(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":u(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return E(n,e);case"neq":return!E(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function L(n,e){try{return"rule"===e.type?q(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return L(n,e)}):e.children.some(function(e){return L(n,e)})}catch(e){return!1}}function A(e,n,t,r){if(!n)return b;var o=n.sample_rate,i=n.include_users,a=n.sample_granularity,u=n.rules,n=void 0===(n=n.r)?Math.random():n;if(E(i,e))return function(e){return N(e,1)};var c,s,f,l,p,d,h,m=M(a="session"===a,o,t,n,r),v=(c=u,s=a,f=o,l=t,p=n,d=r,h={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(h[e]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},n&&(h[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:M(s,n,l,p,d),effectiveSampleRate:n*f,filter:e}}))):h[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(e){if(!m())return!1;if(!(e.ev_type in v))return N(e,o);if(!v[e.ev_type].enable)return!1;if(e.common&&e.common.sample_rate)return e;var n=v[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(L(e,t[r].filter))return!!t[r].hit()&&N(e,t[r].effectiveSampleRate);return!!n.hit()&&N(e,n.effectiveSampleRate)}}var B,F=function(t){t.on("start",function(){var e=t.config(),n=e.userId,e=e.sample,e=A(n,e,o,f);t.on("build",e)})},z="custom",V=function(e){if(e&&S(e)&&e.name&&c(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&S(e.metrics)){var t=e.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&S(e.categories)){var o,i=e.categories,a={};for(o in i)a[o]=g(i[o]);n.categories=a}return n}},U=function(e){if(e&&S(e)&&e.content&&c(e.content)){var n={content:g(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&S(e.extra)){var t,r=e.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=g(r[t]);n.metrics=o,n.categories=i}return n}},H="Adapters imported incorrectly",G=["success","fail","complete"],K=20;(Se=B=B||{}).onLaunch="onLaunch",Se.onShow="onShow",Se.onHide="onHide",Se.onError="onError",Se.onPageNotFound="onPageNotFound",Se.onUnhandledRejection="onUnhandledRejection";function J(e){return"[object Object]"===Object.prototype.toString.call(e)}var W=["request","downloadFile","uploadFile"],Y=["navigateTo","redirectTo","switchTab","reLaunch"],$=_(_([],y(Y),!1),["navigateBack"],!1),Q=_(_([],y([B.onLaunch,B.onShow,B.onHide]),!1),[B.onError,B.onPageNotFound,B.onUnhandledRejection],!1),X=["attached","onInit"],Z=["onLoad","onShow","onReady","onUnload","onHide"],ee="__HOOKED__";var ne=function(){return Date.now()};function te(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!m(e))return 0;var r,o=ne();try{e.apply(this,n)}finally{r=ne()}return r-o}var re,oe=function(){},ie=y((re="tt",[function(){return re},function(e){return re=e}]),2),ae=ie[0];ie[1];function ue(e,n,r){var o=e[n];if(!o||!o[ee])return Object.defineProperty(e,n,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=r.apply(this,e);t&&(e=t)}catch(e){C(e)}return o.apply(this,e)}}),e[n]&&(e[n][ee]=!0),function(){e[n][ee]=!1,r=oe}}function ce(t,e){Object.keys(e).forEach(function(n){e[n].addTearDown(function(){var e;return ke(t,((e={})[n]=null,e))})})}function se(e,n){n.addTearDown(function(){return Ee(e,null)})}function fe(e){return xe("route")[e]}function le(e){return!!xe("route")[e]}function pe(e){return xe("http")[e]}function de(e){return!!xe("http")[e]}function he(){return xe("setData")}function me(){return!!xe("performance")}function ve(){return xe("instance")}function be(e){Ee("instance",e)}var ge=function(n,t){function e(e){return t(e),n.call(this,e)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},ye=function(){var e={instance:null};return e.instance||("undefined"!=typeof tt?e={instance:tt,platform:ae()}:"undefined"!=typeof my?e={instance:my,platform:"my"}:"undefined"!=typeof swan?e={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(e={instance:wx,platform:"wx"})),e},_e="__slardar__global__0.2.4",we={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},Se=function(e,n){void 0===e&&(e={});var t=(n=void 0===n?ye().instance:n)?n[_e]||(n[_e]=e):e;return{setGlobalValue:function(e,n){t[e]=n},mergeGlobalValue:function(e,n){t[e]=d(d({},t[e]),n)},getGlobalValue:function(e){return t[e]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},we),n&&(n[_e]=t)}}}(d({},we)),Ee=Se.setGlobalValue,ke=Se.mergeGlobalValue,xe=Se.getGlobalValue,Oe=function(e){return xe("app")[e]},je=function(e){return xe("page")[e]},Te=function(t,e){(e=void 0===e?$:e).forEach(function(n){le(n)&&fe(n).subscribe(function(e){return t(e,n)})})},Ce=function(){return xe("performance")},Pe=function(e){return xe("component")[e]};function De(e){return"function"==typeof e}function Ie(e,n){!e||0<=(n=e.indexOf(n))&&e.splice(n,1)}function Re(e){return e}function Ne(t){return function(e){if((n=e)&&De(n.lift))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});var n;throw new TypeError("Unable to lift unknown Observable type")}}function Me(e){De(e)?e():null!=e&&e.unsubscribe()}var qe=function(e){return e instanceof Le||e&&"closed"in e&&De(e.remove)&&De(e.add)&&De(e.unsubscribe)},Le=(Ae.prototype.unsubscribe=function(){var e,n,t,r=this;this.closed||(this.closed=!0,e=this._parentage,n=this._finalizers,t=this.initialTeardown,e&&(this._parentage=null,e.forEach(function(e){return e.remove(r)})),De(t)&&t(),n&&(this._finalizers=null,n.forEach(Me)))},Ae.prototype.remove=function(e){this._finalizers&&Ie(this._finalizers,e),e instanceof Ae&&e._removeParent(this)},Ae.prototype.add=function(e){if(e&&e!==this)if(this.closed)Me(e);else{if(e instanceof Ae){if(e.closed||e._hasParent(this))return;e._addParent(this)}var n=this._finalizers;this._finalizers=n?(n.push(e),n):[e]}},Ae.prototype._addParent=function(e){var n=this._parentage;this._parentage=n?(n.push(e),n):[e]},Ae.prototype._hasParent=function(e){return this._parentage&&~this._parentage.indexOf(e)},Ae.prototype._removeParent=function(e){this._parentage&&Ie(this._parentage,e)},Ae);function Ae(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var Be,Fe=(e(ze,Be=Le),ze.prototype.next=function(e){this.isStopped||this.destination.next(e)},ze.prototype.error=function(e){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(e)}finally{this.unsubscribe()}}},ze.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},ze.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Be.prototype.unsubscribe.call(this),this.destination=null)},ze.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},ze);function ze(e){var n=Be.call(this)||this;return n.isStopped=!1,n.destination=He(e)?e:new Ve(!(e=e)||De(e)?{next:null!=e?e:void 0}:e),n}var Ve=(Ue.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(e){console.error("ConsumerObserver.next error",e)}},Ue.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(e){console.error("ConsumerObserver.error error",e)}},Ue.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){console.error("ConsumerObserver.complete error",e)}},Ue);function Ue(e){this.partialObserver=e}function He(e){return e instanceof Fe||e&&((n=e)&&De(n.next)&&De(n.error)&&De(n.complete))&&qe(e);var n}Ge.prototype.subscribe=function(e){var n=He(e)?e:new Fe(e),t=this.operator,e=this.source;return n.add(t?t.call(n,e):this._trySubscribe(n)),n},Ge.prototype.lift=function(e){var n=new Ge;return n.source=this,n.operator=e,n},Ge.prototype.pipe=function(){for(var n,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?Re:1===n.length?n[0]:function(e){return n.reduce(function(e,n){return n(e)},e)})(this)},Ge.prototype._subscribe=function(e){},Ge.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},ie=Ge;function Ge(e){e&&(this._subscribe=e)}var Ke,Se=(e(Je,Ke=ie),Je.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(e){return e.next(n)})},Je.prototype.commonJudgement=function(e){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,e())},Je.prototype.error=function(n){var t=this;this.commonJudgement(function(){var e=t.observers;for(t.hasError=!0,t.thrownError=n;e.length;)e.shift().error(n)})},Object.defineProperty(Je.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Je.prototype.complete=function(){var n=this;this.commonJudgement(function(){for(var e=n.observers;e.length;)e.shift().complete()})},Je.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Je.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Je.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Je.prototype._checkFinalizedStatuses=function(e){var n=this.hasError,t=this.thrownError,r=this.isStopped;n?e.error(t):r&&e.complete()},Je.prototype._innerSubscribe=function(e){var n=this.isStopped,t=this.observers;return n?Je.EMPTY:(t.push(e),new Le(function(){Ie(t,e)}))},Je.EMPTY=((Se=new Le).closed=!0,Se),Je);function Je(){var e=null!==Ke&&Ke.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var We=new ie(function(e){return e.complete()});function Ye(r){return r<=0?function(){return We}:Ne(function(e,n){var t=0;e.subscribe(function(e){++t<=r&&(n.next(e),r<=t&&n.complete())})})}function $e(r,o){return Ne(function(e,n){var t=0;e.subscribe(function(e){return r.call(o,e,t++)&&n.next(e)})})}function Qe(t){return $e(function(e,n){return t<=n})}var Xe,Ze=(e(en,Xe=Se),en.prototype.subscribe=function(e){var t=this,e=Xe.prototype.subscribe.call(this,e);ve()&&ve()._subscriptions.push(e);var r=e.unsubscribe;return e.unsubscribe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(this,e),t.observed||t.unsubscribe()},e},en.prototype.unsubscribe=function(){Xe.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(e){return e()})},en.prototype.addTearDown=function(e){this.tearDownFns.push(e)},en);function en(){var e=null!==Xe&&Xe.apply(this,arguments)||this;return e.tearDownFns=[],e}function nn(e){var n=e.reduce(function(e,n){return e[n]=new Ze,e},{});return{getSubject:function(e){return n[e]},subjectMap:n}}function tn(e){return 1<e.length?e:e.length&&e[0]||{}}function rn(e){var t=e.filter(function(e){return e=e,!!!xe("app")[e]}),e=nn(t).subjectMap;ke("app",e=e),ce("app",e),App=ge(App,function(n){t.forEach(function(e){var r=Oe(e),e=j(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.next({that:this,param:tn(e),time:ne()}),m(t)&&t.apply(this,e)}})();e&&r.addTearDown(e)})})}function on(e){return e.route||e.__route__||e.url||e.path||""}function an(e){function n(e,i){r.forEach(function(o){j(e,o,function(r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Pe(o).next({that:this,param:null,time:ne()});var t=i[o];if(m(t)&&t.apply(this,e),m(r))return r.apply(this,e)}})()})}var t=["attached"],r=e.filter(function(e){return~t.indexOf(e)});try{Component=ge(Component,function(e){S(e.lifetimes)?n(e.lifetimes,e):void 0!==e.lifetimes&&null!==e.lifetimes||(e.lifetimes={},n(e.lifetimes,e))})}catch(e){}}function un(e){function n(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(e(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Te(function(e,n){"invoke"===e.param.name&&(o=!1,r={navigate_start:e.time,navigate_name:n})},Y),je("onLoad").pipe(Qe(1)).subscribe(function(e){r.load_start=e.time}),je("onShow").pipe(Qe(1)).subscribe(function(e){r.dom_end=e.time}),je("onReady").pipe(Qe(1)).subscribe(function(e){r.render_end=e.time,n(),t()}),Oe(B.onHide).subscribe(function(){!1===o&&(n(),t())})}function cn(n){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];Ce().subscribe(function(e){~t.indexOf(e.name)&&n(e)})}function sn(n){Pe("attached").subscribe(function(e){e=e.that;return n.call(e)})}function fn(e){return"android"===e.toLowerCase()}function ln(e){return fn(e)?"Android":"ios"===e.toLowerCase()?"iOS":~On.indexOf(e.toLowerCase())?"Mac":~jn.indexOf(e.toLowerCase())?"windows":"unknown"}function pn(e){var n=e.systemPlatform,t=e.pixelRatio,r=e.width,e=e.height;return n&&fn(n)&&t?r/t+" * "+e/t:r+" * "+e}function dn(e){void 0===e&&(e="tt");var n,t="",r="",o="";return tt.getEnvInfoSync?(r=(n=tt.getEnvInfoSync().microapp).envType,t=n.appId,o=n.mpVersion):(r=tt.env.VERSION,t=""),d({appId:t,miniEnv:r,miniVersion:o,platform:e},Dn())}function hn(n){var e=je("onReady").subscribe(function(){var e;tt.performance&&(e=(tt.performance.getCurrentPageEntries()||[]).map(function(e){e.name,e.entryType;var n=h(e,["name","entryType"]),t=In(e);return t?d(d({},n),t):e}),n(e))});return{disconnect:function(){return e.unsubscribe()}}}function mn(e){var n=e.filter(function(e){return e=e,!!!xe("component")[e]}),e=nn(n).subjectMap;ke("component",e=e),ce("component",e),En().componentSubject(n)}function vn(n){function e(e){J(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))}try{Component=ge(Component,e),Behavior=ge(Behavior,e)}catch(e){}}function bn(e,n){var t=e.filter(function(e){return e=e,!!!xe("page")[e]}),e=nn(t).subjectMap;ke("page",e=e),ce("page",e),e=function(n){t.forEach(function(e){var r=je(e),e=j(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(on(this)&&r.next({that:this,param:tn(e),time:ne()}),m(t))return t.apply(this,e)}})();e&&r.addTearDown(e)})},Page=ge(Page,e),vn(e)}function gn(e){var n=e.filter(function(e){return!le(e)}),t=nn(n).subjectMap;ke("route",e=t),ce("route",e),n.forEach(function(i){var e=ue(En().instance,i,function(o){void 0===o&&(o={}),fe(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:ne()}),G.forEach(function(r){j(o,r,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];fe(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:tn(e)||{}},time:ne()}),m(t)&&t.apply(this,e)}})()})});e&&t[i].addTearDown(e)})}function yn(u,e){var n=e.url,t=e.method,r=e.data,o=e.header,i=e.headers,c={api:u,request:{url:n,method:(n=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&n||"GET"),headers:o||i||{},body:g(r),timestamp:ne()},response:{}};j(e,"complete",function(a){return function(e){var n=c.response.timestamp||ne();c.duration=n-c.request.timestamp,c.completeCallbackTime=te(a,e);var t,r,o,i=e.errMsg||e.errorMessage||e.error;c.response={status:(t=e.status,r=e.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:n,headers:e.header||e.headers||{},body:g(e.data),errMsg:i,timing:En().buildRequestProfile(e.profile||{})},pe(u).next(c)}})(),j(e,"success",function(n){return function(e){c.response.timestamp=ne(),c.response.status=200,c.successCallbackTime=te(n,e)}})(),j(e,"fail",function(n){return function(e){c.response.timestamp=ne(),c.response.status=-1,c.failCallbackTime=te(n,e)}})()}function _n(e,t){void 0===t&&(t=En().instance);var n=e.filter(function(e){return!de(e)}),r=nn(n).subjectMap;ke("http",e=r),ce("http",e),n.forEach(function(n){var e=ue(t,n,function(e){yn(n,e)});e&&r[n].addTearDown(e)})}var wn,ie=y((wn={},[function(e){if(!ye().platform)throw Error("Not support current Mini Program");if(!Array.isArray(e)||!e.length)return null;e=e.find(function(e){return e.platform===ye().platform});return e&&(wn=e.adapterCtor())},function(){return wn}]),2),Sn=ie[0],En=ie[1],kn=function(e){return"SLARDAR"+e},xn=function(e){try{return En().getStorage(e)}catch(e){return}},On=["darwin","macs","mac"],jn=["windows_nt","windows","window"],Tn=function(e){return function(e){var n,t={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t}({domainLookupStart:e.domainLookupStart,domainLookupEnd:e.domainLookupEnd,connectStart:e.connectStart,secureConnectionStart:e.SSLconnectionStart,connectEnd:e.connectEnd,requestStart:e.requestStart,requestEnd:e.requestEnd,responseStart:e.responseStart,responseEnd:e.responseEnd,socketReused:e.socketReused,redirectStart:e.redirectStart,redirectEnd:e.redirectEnd,fetchStart:e.fetchStart,sendBytesCount:e.sendBytesCount,throughputKbps:e.throughputKbps,receivedBytedCount:e.receivedBytedCount})},Cn=function(e){return{name:"unknown_error_name",message:g(e)}},Pn=function(e){var n=e.split("\n"),n=y((n[0]&&n[0].split(":")||[]).map(function(e){return e.trim()}),2);return{name:n[0],message:n[1],stack:e}},Dn=function(){var e=tt.getSystemInfoSync(),n=e.model,t=e.brand,r=e.pixelRatio,o=e.screenHeight,i=e.screenWidth,a=e.windowHeight,u=e.windowWidth,c=e.language,s=e.version,f=e.system,l=e.platform,p=e.SDKVersion,e=e.appName;return{model:n,brand:t,pixelRatio:r,screenArea:pn({width:i,height:o}),windowArea:pn({width:u,height:a}),language:c,osName:ln(l),osVersion:f,SDKVersion:p,hostName:e,hostVersion:s}},In=function(e){if("navigation"===e.entryType)return{name:"route",entryType:"navigation",path:e.name};switch(e.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},Se={platform:"tt",adapterCtor:function(){return d(d({},{instance:t=void 0===t?ye().instance:t,request:function(e){return t.request(e)},getStorage:function(e){return t.getStorageSync(e)},setStorage:function(e,n){return t.setStorageSync(e,n)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(e){return e},monitorNetworkType:function(n){t.getNetworkType({success:function(e){n&&n({networkType:e.networkType})}}),t.onNetworkStatusChange(function(e){n&&n({networkType:e.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"tt",buildError:function(e){return(c(e=e)?Pn:Cn)(e)},getSystemInfo:dn,observePerformance:hn,performanceSubscriber:cn,buildRequestProfile:function(e){return Tn(e)},componentSubject:an,pagePerfSubscriber:un,setDataSubject:sn});var t}},Rn=function(e,n){void 0===n&&(n=W),e.on("init",function(){_n(n)})};function Nn(){var a=on(this),u=he();var e=ue(this,"setData",function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=r[0],i=ne();return[o,function(){var e=r[1],n=ne()-i;u.next({renderTime:n,url:a,data:o,startTime:i}),e&&e.call(t)}]});e&&u.addTearDown(e)}function Mn(){var e;xe("setData")||(e=(e=nn(["setData"]).getSubject)("setData"),Ee("setData",e),se("setData",e))}function qn(o){return Object.keys(o).reduce(function(e,n){var t,r;return r=o[t=n],t&&r&&(Bn.test(t)||Fn.test(r))||(e[n]=o[n]),e},{})}var Ln=function(e){e.on("init",function(){Mn(),je("onLoad").subscribe(function(e){e=e.that;Nn.call(e)}),En().setDataSubject(Nn)})},An=function(e){e.on("init",function(){var n,e,t,r=En();r.observePerformance&&!me()&&(n=(0,nn(["performance"]).getSubject)("performance"),Ee("performance",e=n),se("performance",e),(t=r.observePerformance(function(e){e.forEach(function(e){n.next(e)})}))&&t.disconnect&&n.addTearDown(function(){return t.disconnect()}))})},Bn=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Fn=new RegExp("(bearer|session)","i"),zn=function(){return function(e,s){var n=e.hookRequest,t=e.hookDownloadFile,r=e.hookUploadFile,f=e.ignoreUrls,l=e.collectBodyOnError,p=e.extraExtractor,e=function(e){var n,t,r,o,i,a,u,c;!function(e,n){e=v(e||[]);return!!e&&e.test(n)}(f,e.request.url)&&(c=e.response,n=e.request,t=e.api,r=e.duration,o=e.failCallbackTime,u=e.successCallbackTime,i=e.completeCallbackTime,n.headers=qn(n.headers||{}),c.headers=qn(c.headers||{}),a=c.errMsg,e=h(c,["errMsg"]),e=d(d({},e),{is_custom_error:!1}),a&&(e.err_msg=a),u={api:t,request:n,duration:r,cbTime:i+(o||0)+(u||0),response:e},!m(p)||(e=p(c.body,u))&&(u.extra=e,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};n&&pe("request").subscribe(e),t&&pe("downloadFile").subscribe(e),r&&pe("uploadFile").subscribe(e)}},Vn=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,_([],y(r),!1));return o&&o(n,t)||[]}catch(e){return C("applyMonitor",e),[]}};function Un(e,n,t){be(e);n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return S(n)?d(d({},t),n):!!n&&t}function Hn(e,n){return e&&n&&e===n}function Gn(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Hn(n.message,t.message)&&!Hn(n.stack,t.stack)))return void(r=e)}catch(e){}var n,t;return r=e}}var Kn,Jn="http",Wn={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Yn=function(f){return void 0===f&&(f=En()),function(e,r){var n=e.ignoreErrors,t=e.hookOnError,o=e.hookOnUnhandledRejection,i=e.hookRouteError,a=e.dedupe,u=v(n),c=Gn(),s=function(e,n,t){e=a?c(e):e;e&&(u&&u.test(e.message)||(e={error:e},n&&(e.extra=n),t&&(e.react=t),r(e)))};t&&Oe(B.onError).subscribe(function(e){e=e.param,e=f.buildError(e);u&&u.test(e.message)||s(e)}),o&&Oe(B.onUnhandledRejection).subscribe(function(e){var n=e.param||{},e=n.promise,t=g(n.reason);u&&u.test(t)||e.catch(b).then(function(e){var n={name:"UnhandledRejection",message:t};e&&e.stack&&(n.stack=e.stack),s(n)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Te(function(e){e=e.param;"fail"===(e=e).name&&s({name:"RouteError",message:e.value.errMsg})}),[s]}};(ie=Kn=Kn||{}).history="history",ie.manual="manual";function $n(t,e,r){var o=e,i=null,a=0,n="launch";function u(e,n){o=n,a=ne(),r(n,i=n+"_"+a),t(e,n)}return Oe(B.onShow).pipe(Qe(1)).subscribe(function(){n="show"}),Te(function(){n="history"}),[u,function(e){e&&(u(n,e),n="history")},function(e){void 0===e&&(e="hide"),i&&(r(o,i),i=null,t(e,o,ne()-a))}]}var Qn=function(){return function(e,r){var n=e.extractPid,t=e.routeMode,o=e.setPidAndViewId,i=function(e){return n?n(e):e},e=y($n(function(e,n,t){r({ev_type:"pageview",payload:{pid:n,source:e,duration:t}})},"",o),3),o=e[0],a=e[1],e=e[2];return t!==Kn.manual&&(je("onShow").subscribe(function(e){return function(e){e=on(e),e=i(e);a(e)}(e.that)}),je("onUnload").subscribe(e.bind(null,"unload")),je("onHide").subscribe(e.bind(null,"hide"))),[o.bind(null,"user_set"),e]}},Xn=function(){return function(e){var n=y(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=b),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=d(d({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(_(_([],y(o),!1),[e],!1),n):_(_([],y(o),!1),[e],!1))}]}(e.maxBreadcrumbs,e.onAddBreadcrumb,e.onMaxBreadcrumbs),2),e=n[0],r=n[1];return W.forEach(function(e){de(e)&&pe(e).subscribe(function(e){r({type:"http",category:e.api,message:"",data:{method:e.request.method,url:e.request.url,status_code:String(e.response.status)},timestamp:e.request.timestamp})})}),Te(function(e,n){var t=e.param,e=e.time;"complete"===t.name&&r({type:"route",category:n,message:t.value.errMsg||t.value.errorMessage||"",timestamp:e,data:{url:t.url||""}})}),[e,r]}},Zn=function(){return function(e,t){var r=e.isCalculateSize;he().subscribe(function(e){var n={duration:e.renderTime,start_time:e.startTime};r&&(n.size=(e=e.data,TextEncoder?(new TextEncoder).encode(g(e)).length:2*g(e).length)),t({ev_type:"set_data",payload:n})})}},et=function(){return function(e,n){function t(){n({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Oe(B.onLaunch).pipe(Ye(1)).subscribe(function(e){r.activate_start=e.time}),Oe(B.onShow).pipe(Ye(1)).subscribe(function(e){r.init_end=e.time}),je("onLoad").pipe(Ye(1)).subscribe(function(e){r.page_load_start=e.time}),je("onShow").pipe(Ye(1)).subscribe(function(e){r.page_dom_end=e.time});var i=me();je("onReady").pipe(Ye(1)).subscribe(function(e){r.page_render_end=e.time,i&&!r.trigger||t()}),i&&Ce().pipe($e(function(e){return"appClick"===e.name}),Ye(1)).subscribe(function(e){r.trigger=e.startTime,r.page_render_end&&t()}),Oe(B.onHide).subscribe(function(){o||t()})}},nt=function(){return function(e,n){En().pagePerfSubscriber(function(e){return n({ev_type:"page_perf",payload:e})})}},rt=function(n){return void 0===n&&(n=En()),function(e,t){var r,o;me()&&n.performanceSubscriber&&(r=0,je("onLoad").subscribe(function(e){o=e.time,r++}),n.performanceSubscriber(function(e){var n={is_custom:!1,name:e.name,value:e.startTime,type:"perf",count:r};n.duration=e.duration||(o?e.startTime-o:0),n.is_support=0<=n.duration,t({ev_type:"performance",payload:n})}))}},ot="pageview",it={routeMode:Kn.history,setPidAndViewId:function(e,n){}},at="jsError",ut={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},ct=function(t){return function(e){var n=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},e),{breadcrumbs:n})})}},st={maxBreadcrumbs:20,tap:!0},ft="breadcrumb",lt=function(n){n.on("init",function(){n.provide("_subscriptions",[]),be(n),n.on("init",function(){rn(Q),bn(Z),mn(X)}),n.on("init",function(){gn($)})}),n.on("beforeDestroy",function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]})},pt="setData",dt={isCalculateSize:!1},ht="appLaunchPerf",mt={},vt="pagePerf",bt={},gt="performance",yt={},_t=function(e,n,t){void 0===t&&(t=En());var r=n.url,o=n.data,i=n.success,a=void 0===i?l:i,u=n.fail,c=void 0===u?l:u,i=n.header,u={"Content-Type":"application/json"};J(n=i)&&0!==Object.keys(n).length&&Object.assign(u,i),t.request({method:e,url:r,data:o,header:u,headers:u,success:function(e){a(e)},fail:function(e){e=e.errMsg||"Network request failed";c(new Error(e))}})},wt=function(n){return(n=void 0===n?En():n)?{get:function(e){return _t("GET",e,n)},post:function(e){return _t("POST",e,n)}}:{get:l,post:l}};function St(e){return e=kn(String(e)),(e=xn(e))&&e.userId&&e.deviceId?e:{userId:D(),deviceId:D()}}function Et(e){return e+"_"+Date.now()}function kt(e){var n=e.aid,t=e.userId,e=e.deviceId;!function(e,n){try{En().setStorage(e,n)}catch(e){}}(kn(String(n)),{userId:t,deviceId:e})}var xt={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:d(d({},e.extra||{}),e.overrides||{})}}},Ot="/monitor_mini/collect",jt="/settings/minipro",Tt="apmplus.volces.com",Ct="session",Pt={sample_rate:1,include_users:[],sample_granularity:Ct,rules:{}},Dt=[Ot,jt],It="0.2.4",Rt="APM_PLUS_MINI_PROGRAM",Nt=function(e,n){return void 0===n&&(n=Ot),(e&&0<=e.indexOf("//")?"":"https://")+e+n};function Mt(e){e=St(e.aid);return{aid:0,token:"",pid:"",viewId:Et("_"),userId:e.userId,deviceId:e.deviceId,sessionId:D(),domain:Tt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Dt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:Pt,sdkName:Rt,sdkVersion:It}}function qt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!S(t[n])&&(t[n]={});return d(d({},e),{plugins:t})}function Lt(e){return S(e)&&"aid"in e&&"token"in e}function At(e){return d({},e)}var Bt=function(n){var r,o,i=n,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(e){var n,t;return a=d(d({},a),e||{}),s(),r||(r=e,i.useLocalConfig||!i.aid?(o={},c()):u?f():(n=i.domain,e=i.aid,t=function(e){u=e,f()},wt().get({url:function(e,n){return void 0===n&&(n=jt),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(n)+"?biz_id="+e,success:function(e){t(e&&e.data&&e.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(e){t=e},onReady:function(e){c=function(){kt(i),e()},o&&c()}};function s(){var e=d(d(d({},n),o||{}),a);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=p(t,e[r++]);return t}(n.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),e.sample=Ft(Ft(n.sample,null==o?void 0:o.sample),a.sample),i=e,t()}function f(){o=function(e){if(!e)return{};var n=e.sample,t=e.user_id,r=e.timestamp,o=t?{userId:t}:{};if(!n)return o;var i=n.sample_rate,e=n.sample_granularity,t=void 0===e?Ct:e,e=n.include_users,n=n.rules,n=void 0===n?[]:n;return d(d({},o),{sample:{include_users:e,sample_rate:i,sample_granularity:t,rules:n.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r})}(u),function(e){e=kn(e);return!!En().getStorage(e)}(String(i.aid))&&(o.userId=n.userId),s(),c()}};function Ft(r,o){if(!r||!o)return r||o;var e=d(d({},r),o);return e.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),e.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=d(d({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=_(_([],y(r.rules[n].conditional_sample_rules||[]),!1),y(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}function zt(e){var n={url:(n=En().getCurrentPages().pop())?(n?on(n):"")+s(n.options):"",timestamp:ne()};return d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})})}function Vt(e){if(!Sn(e))throw Error(H);var t,e=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,a=e.createConfigManager,u=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};w.forEach(function(e){return f[e]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=I(),b={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(l)x("already inited");else{if(!(e&&S(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=a(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(u(e))),null==r?void 0:r.getConfig()},provide:function(e,n){E(m,e)?x("cannot provide "+e+", reserved"):(b[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(e){return n.build(e)}),h=[]}))},report:function(e){e&&(!(e=O(f.beforeReport)(e))||(e=O(f.report)(e))&&(p?this.build(e):h.push(e)))},build:function(e){!p||(e=O(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=O(f.build)(e))&&this.send(e))},send:function(e){!p||(e=O(f.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&p||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=k(f[e],n))},destroyAgent:v},m=Object.keys(b);return b;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[e].forEach(function(e){try{e.apply(void 0,_([],y(t),!1))}catch(e){}}),n&&(f[e].length=0)}}({validateInitConfig:Lt,initConfigNormalizer:qt,userConfigNormalizer:At,createSender:function(e){return n({size:K,endpoint:Nt(e.domain),transport:wt()})},builder:xt,createDefaultConfig:Mt,createConfigManager:Bt});return R(e),Jt(e),Ht(e),Gt(e),F(e),lt(e),(t=e).on("init",function(){var n=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){E(n,e.name)||(n.push(e.name),e.setup(t),e.tearDown&&t.on("beforeDestroy",e.tearDown))})}),Kt(e),Ut(e),e}var Ut=function(n){function t(e){return void 0===e&&(e=En().getSystemInfo()),n.set(d({},e))}function r(){t(),e()}var o,i,a=!1,e=(i="",function(){var e=o.getSender();i=i||e.getEndpoint();var n=o.config(),n={did:n.deviceId,sid:n.sessionId,sname:n.sdkName,sver:n.sdkVersion,soffset:n.offset||0,model:n.model,brand:n.brand,ratio:n.pixelRatio,screen:n.screenArea,window:n.windowArea,lang:n.language,osname:n.osName,osver:n.osVersion,libver:n.SDKVersion,scene:n.scene||-1,menv:n.miniEnv,mver:n.miniVersion,hostname:n.hostName,hostver:n.hostVersion,platform:n.platform,biz_id:n.aid,x_auth_token:n.token};e.setEndpoint(i+s(n))});(o=n).on("start",function(){r(),a=!0}),n.on("init",function(){Oe(B.onLaunch).pipe(Ye(1)).subscribe(function(e){e=e.param.scene||-1;t({scene:e}),a&&r()}),En().monitorNetworkType(function(e){e=e.networkType;n.set({networkType:e})})})},Ht=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,e.network_type=t.networkType,d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})});var n,t})},Gt=function(e){e.on("report",zt)},Kt=function(n){n.on("init",function(){Oe(B.onHide).subscribe(function(){var e=n.getSender();e&&e.flush()})})},Jt=function(t){var r,o=!1;t.on("init",function(){r=ne(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=ne())-r<1e3&&n&&(e=n-(e+r)/2,isNaN(e)||t.set({offset:e})))})})};return function(e){var n,t,r,i,o,a,u,c,s,e=Vt(e);if(e)return(n=e).provide("sendEvent",function(e){e=V(e);e&&n.report({ev_type:z,payload:e,extra:{timestamp:Date.now()}})}),n.provide("sendLog",function(e){e=U(e);e&&n.report({ev_type:z,payload:e,extra:{timestamp:Date.now()}})}),(t=e).on("init",function(){var e,n=Un(t,ot,it);n&&(n=(e=y(Vn(Qn,d(d({},n),{setPidAndViewId:function(e,n){t.set({pid:e,viewId:n,actionId:void 0})}}),t.report.bind(t)),2))[0],e=e[1],t.provide("sendPageview",n),t.provide("sendPageviewWithHide",e))}),(r=e).on("init",function(){var e,n=Un(r,at,ut);n&&(e=ct(r),e=y(Vn(Yn,n,e),1)[0],r.provide("captureException",e))}),(i=e).on("init",function(){var e,n,t,r,o=Un(i,Jn,Wn);o&&(e=o.hookRequest,n=o.hookDownloadFile,t=o.hookUploadFile,r=[],e&&r.push("request"),n&&r.push("downloadFile"),t&&r.push("uploadFile"),Rn(i,r),Vn(zn,o,i.report.bind(i)))}),(o=e).on("init",function(){var e=Un(o,pt,dt);e&&(Ln(o),Vn(Zn,e,o.report.bind(o)))}),(a=e).on("init",function(){var e,n=Un(a,ft,st);n&&(n=(e=y(Vn(Xn,n,function(e){}),2))[0],e=e[1],a.provide("getBreadcrumbs",n),a.provide("addBreadcrumb",e))}),(u=e).on("init",function(){var e=Un(u,ht,mt);e&&(An(u),Vn(et,e,u.report.bind(u)))}),(c=e).on("init",function(){var e=Un(c,vt,bt);e&&Vn(nt,e,c.report.bind(c))}),(s=e).on("init",function(){var e=Un(s,gt,yt);e&&(An(s),Vn(rt,e,s.report.bind(s)))}),e}.bind(null,[Se])()}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).ttClient=e()}(this,function(){"use strict";function e(n){var t,r=n.transport,o=n.endpoint,e=n.size,i=void 0===e?10:e,n=n.wait,a=void 0===n?1e3:n,u=[],c=0;function s(){var e;u.length&&(e=this.getBatchData(),r.post({url:o,data:e,fail:function(n){t&&t(n,e)}}),u=[])}return{getSize:function(){return i},getWait:function(){return a},setSize:function(n){i=n},setWait:function(n){a=n},getEndpoint:function(){return o},setEndpoint:function(n){o=n},send:function(n){u.push(n),u.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return u.length?(n=u,JSON.stringify({ev_type:"batch",list:n})):"";var n},clear:function(){clearTimeout(c),u=[]},fail:function(n){t=n}}}var r=function(n,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])})(n,e)};function n(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}r(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var d=function(){return(d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function h(n,e){var t={};for(o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]]);return t}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function _(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(n){return n}function S(n){return"object"==typeof n&&null!==n}var t=Object.prototype;function i(n){if(S(n)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(n);n=Object.getPrototypeOf(n);return n===t||null===n}}function a(n){return"[object Array]"===t.toString.call(n)}function v(n){return"function"==typeof n}function u(n){return"number"==typeof n}function c(n){return"string"==typeof n}function p(n,e){var t,r,o=d({},n);for(t in e)r=t,Object.prototype.hasOwnProperty.call(e,r)&&void 0!==e[t]&&(S(e[t])&&i(e[t])?o[t]=p(S(n[t])?n[t]:{},e[t]):a(e[t])&&a(n[t])?o[t]=function e(n,t){n=a(n)?n:[];t=a(t)?t:[];return Array.prototype.concat.call(n,t).map(function(n){return n instanceof RegExp?n:S(n)&&i(n)?p({},n):a(n)?e([],n):n})}(n[t],e[t]):o[t]=e[t]);return o}function E(n,e){if(!a(n))return!1;if(0===n.length)return!1;for(var t=0;t<n.length;){if(n[t]===e)return!0;t++}return!1}function k(n,e){if(!a(n))return n;var t=n.indexOf(e);if(0<=t){e=n.slice();return e.splice(t,1),e}return n}function m(n){return a(n)&&n.length?function(n){for(var e=[],t=n.length,r=0;r<t;r++){var o=n[r];c(o)?e.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&e.push(o.source)}return new RegExp(e.join("|"),"i")}(n):null}function g(n){try{return c(n)?n:JSON.stringify(n)}catch(n){return"[FAILED_TO_STRINGIFY]:"+String(n)}}function s(t){return S(t)?Object.keys(t).reduce(function(n,e){return n+="&"+e+"="+t[e]},"").replace("&","?"):""}function x(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.warn.apply(console,_(["[SDK]",Date.now(),T(""+D++)],y(n),!1))}function o(n){return Math.random()<Number(n)}function f(n,e){return n<Number(e)}function O(r){return function(n){for(var e=n,t=0;t<r.length&&e;t++)try{e=r[t](e)}catch(n){P(n)}return e}}var j=function(i,a,u,c){return void 0===c&&(c=!0),function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(!i)return l;var t=i[a],r=u.apply(void 0,_([t],y(n),!1)),o=r;return v(o)&&c&&(o=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return r.apply(this,e)}catch(n){return v(t)&&t.apply(this,e)}}),i[a]=o,function(n){n||(o===i[a]?i[a]=t:r=t)}}},T="".padStart?function(n,e){return n.padStart(e=void 0===e?8:e," ")}:function(n){return n},C=0,P=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,_(["[SDK]",Date.now(),T(""+C++)],y(n),!1))},D=0;function I(){var n=function(){for(var n=new Array(16),e=0,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var e=[],t=0;t<256;++t)e[t]=(t+256).toString(16).substr(1);var r=0,o=e;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function R(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function e(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,e,t){i[n]?i[n].push([e,t]):i[n]=[[e,t]],o&&r(t)},has:function(n){return!!i[n]},remove:e,removeByEvType:function(e){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===e&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){e(n)})}}}var N=function(n){var t,r,o,e=(t={},r={},o={set:function(n,e){return t[n]=e,r[n]=g(e),o},merge:function(e){return t=d(d({},t),e),Object.keys(e).forEach(function(n){r[n]=g(e[n])}),o},delete:function(n){return delete t[n],delete r[n],o},clear:function(){return t={},r={},o},get:function(n){return r[n]},toString:function(){return d({},r)}});n.provide("context",e),n.on("report",function(n){return n.extra||(n.extra={}),n.extra.context=e.toString(),n})};function M(r,o){r.on("init",function(){function n(n){n.forEach(function(n){var e=n.name;E(t,e)||(t.push(e),n.setup(r),o&&o(e,n.setup),r.destroyAgent.set(e,e,[function(){t=k(t,e),n.tearDown&&n.tearDown()}]))})}var t=[];r.provide("applyIntegrations",n);var e=r.config();e&&e.integrations&&n(e.integrations)})}function q(n,e){var t=n.common||{};return t.sample_rate=e,n.common=t,n}function A(n,e,t,r,o){return n?(i=o(r,e),function(){return i}):function(){return t(e)};var i}function L(n,e,t,r){if(void 0===(n=function(n,e,t){for(var r,e=y(e.split(".")),o=e[0],i=e.slice(1);n&&0<i.length;)n=n[o],o=(r=y(i))[0],i=r.slice(1);if(n)return t(n,o)}(n,e,function(n,e){return n[e]})))return!1;var o,e="boolean"==typeof n?"bool":u(n)?"number":"string";return function(n,e,t){switch(t){case"eq":return E(e,n);case"neq":return!E(e,n);case"gt":return n>e[0];case"gte":return n>=e[0];case"lt":return n<e[0];case"lte":return n<=e[0];case"regex":return Boolean(n.match(new RegExp(e.join("|"))));case"not_regex":return!n.match(new RegExp(e.join("|")));default:return!1}}(n,(o=e,r.map(function(n){switch(o){case"number":return Number(n);case"boolean":return"1"===n;default:return String(n)}})),t)}function B(e,n){try{return"rule"===n.type?L(e,n.field,n.op,n.values):"and"===n.type?n.children.every(function(n){return B(e,n)}):n.children.some(function(n){return B(e,n)})}catch(n){return!1}}function F(n,e,t,r){if(!e)return b;var o=e.sample_rate,i=e.include_users,a=e.sample_granularity,u=e.rules,e=void 0===(e=e.r)?Math.random():e;if(E(i,n))return function(n){return q(n,1)};var c,s,f,l,p,d,h,v=A(a="session"===a,o,t,e,r),m=(c=u,s=a,f=o,l=t,p=e,d=r,h={},Object.keys(c).forEach(function(n){var e=c[n],t=e.enable,r=e.sample_rate,e=e.conditional_sample_rules;t?(h[n]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:A(s,r,l,p,d)},e&&(h[n].conditional_hit_rules=e.map(function(n){var e=n.sample_rate,n=n.filter;return{sample_rate:e,hit:A(s,e,l,p,d),effectiveSampleRate:e*f,filter:n}}))):h[n]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(n){if(!v())return!1;if(!(n.ev_type in m))return q(n,o);if(!m[n.ev_type].enable)return!1;if(n.common&&n.common.sample_rate)return n;var e=m[n.ev_type],t=e.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(B(n,t[r].filter))return!!t[r].hit()&&q(n,t[r].effectiveSampleRate);return!!e.hit()&&q(n,e.effectiveSampleRate)}}var z,V=function(t){t.on("start",function(){var n=t.config(),e=n.userId,n=n.sample,n=F(e,n,o,f);t.on("build",n)})},U="custom",H=function(n){if(n&&S(n)&&n.name&&c(n.name)){var e={name:n.name,type:"event"};if("metrics"in n&&S(n.metrics)){var t=n.metrics,r={};for(o in t)u(t[o])&&(r[o]=t[o]);e.metrics=r}if("categories"in n&&S(n.categories)){var o,i=n.categories,a={};for(o in i)a[o]=g(i[o]);e.categories=a}return e}},G=function(n){if(n&&S(n)&&n.content&&c(n.content)){var e={content:g(n.content),type:"log",level:"info"};if("level"in n&&(e.level=n.level),"extra"in n&&S(n.extra)){var t,r=n.extra,o={},i={};for(t in r)u(r[t])?o[t]=r[t]:i[t]=g(r[t]);e.metrics=o,e.categories=i}return e}},K="Adapters imported incorrectly",J=["success","fail","complete"],W=20;(xn=z=z||{}).onLaunch="onLaunch",xn.onShow="onShow",xn.onHide="onHide",xn.onError="onError",xn.onPageNotFound="onPageNotFound",xn.onUnhandledRejection="onUnhandledRejection";function Y(n){return"[object Object]"===Object.prototype.toString.call(n)}var $=["request","downloadFile","uploadFile"],Q=["navigateTo","redirectTo","switchTab","reLaunch"],X=_(_([],y(Q),!1),["navigateBack"],!1),Z=_(_([],y([z.onLaunch,z.onShow,z.onHide]),!1),[z.onError,z.onPageNotFound,z.onUnhandledRejection],!1),nn=["attached","onInit"],en=["onLoad","onShow","onReady","onUnload","onHide"],tn="__HOOKED__";var rn=function(){return Date.now()};function on(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!v(n))return 0;var r,o=rn();try{n.apply(this,e)}finally{r=rn()}return r-o}var an,un=function(){},cn=y((an="tt",[function(){return an},function(n){return an=n}]),2),sn=cn[0];cn[1];function fn(n,e,r){var o=n[e];if(!o||!o[tn])return Object.defineProperty(n,e,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{var t=r.apply(this,n);t&&(n=t)}catch(n){P(n)}return o.apply(this,n)}}),n[e]&&(n[e][tn]=!0),function(){n[e][tn]=!1,r=un}}function ln(t,n){Object.keys(n).forEach(function(e){n[e].addTearDown(function(){var n;return jn(t,((n={})[e]=null,n))})})}function pn(n,e){e.addTearDown(function(){return On(n,null)})}function dn(n){return Tn("route")[n]}function hn(n){return!!Tn("route")[n]}function vn(n){return Tn("http")[n]}function mn(n){return!!Tn("http")[n]}function bn(){return Tn("setData")}function gn(){return!!Tn("performance")}function yn(){return Tn("instance")}function _n(n){On("instance",n)}var wn=function(e,t){function n(n){return t(n),e.call(this,n)}for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Sn=function(){var n={instance:null};return n.instance||("undefined"!=typeof tt?n={instance:tt,platform:sn()}:"undefined"!=typeof my?n={instance:my,platform:"my"}:"undefined"!=typeof swan?n={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(n={instance:wx,platform:"wx"})),n},En="__slardar__global__0.2.5-alpha.0",kn={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},xn=function(n,e){void 0===n&&(n={});var t=(e=void 0===e?Sn().instance:e)?e[En]||(e[En]=n):n;return{setGlobalValue:function(n,e){t[n]=e},mergeGlobalValue:function(n,e){t[n]=d(d({},t[n]),e)},getGlobalValue:function(n){return t[n]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},kn),e&&(e[En]=t)}}}(d({},kn)),On=xn.setGlobalValue,jn=xn.mergeGlobalValue,Tn=xn.getGlobalValue,Cn=function(n){return Tn("app")[n]},Pn=function(n){return Tn("page")[n]},Dn=function(t,n){(n=void 0===n?X:n).forEach(function(e){hn(e)&&dn(e).subscribe(function(n){return t(n,e)})})},In=function(){return Tn("performance")},Rn=function(n){return Tn("component")[n]};function Nn(n){return"function"==typeof n}function Mn(n,e){!n||0<=(e=n.indexOf(e))&&n.splice(e,1)}function qn(n){return n}function An(t){return function(n){if((e=n)&&Nn(e.lift))return n.lift(function(n){try{return t(n,this)}catch(n){this.error(n)}});var e;throw new TypeError("Unable to lift unknown Observable type")}}function Ln(n){Nn(n)?n():null!=n&&n.unsubscribe()}var Bn=function(n){return n instanceof Fn||n&&"closed"in n&&Nn(n.remove)&&Nn(n.add)&&Nn(n.unsubscribe)},Fn=(zn.prototype.unsubscribe=function(){var n,e,t,r=this;this.closed||(this.closed=!0,n=this._parentage,e=this._finalizers,t=this.initialTeardown,n&&(this._parentage=null,n.forEach(function(n){return n.remove(r)})),Nn(t)&&t(),e&&(this._finalizers=null,e.forEach(Ln)))},zn.prototype.remove=function(n){this._finalizers&&Mn(this._finalizers,n),n instanceof zn&&n._removeParent(this)},zn.prototype.add=function(n){if(n&&n!==this)if(this.closed)Ln(n);else{if(n instanceof zn){if(n.closed||n._hasParent(this))return;n._addParent(this)}var e=this._finalizers;this._finalizers=e?(e.push(n),e):[n]}},zn.prototype._addParent=function(n){var e=this._parentage;this._parentage=e?(e.push(n),e):[n]},zn.prototype._hasParent=function(n){return this._parentage&&~this._parentage.indexOf(n)},zn.prototype._removeParent=function(n){this._parentage&&Mn(this._parentage,n)},zn);function zn(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}var Vn,Un=(n(Hn,Vn=Fn),Hn.prototype.next=function(n){this.isStopped||this.destination.next(n)},Hn.prototype.error=function(n){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(n)}finally{this.unsubscribe()}}},Hn.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Hn.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Vn.prototype.unsubscribe.call(this),this.destination=null)},Hn.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Hn);function Hn(n){var e=Vn.call(this)||this;return e.isStopped=!1,e.destination=Jn(n)?n:new Gn(!(n=n)||Nn(n)?{next:null!=n?n:void 0}:n),e}var Gn=(Kn.prototype.next=function(n){var e=this.partialObserver;if(e.next)try{e.next(n)}catch(n){console.error("ConsumerObserver.next error",n)}},Kn.prototype.error=function(n){var e=this.partialObserver;if(e.error)try{e.error(n)}catch(n){console.error("ConsumerObserver.error error",n)}},Kn.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(n){console.error("ConsumerObserver.complete error",n)}},Kn);function Kn(n){this.partialObserver=n}function Jn(n){return n instanceof Un||n&&((e=n)&&Nn(e.next)&&Nn(e.error)&&Nn(e.complete))&&Bn(n);var e}Wn.prototype.subscribe=function(n){var e=Jn(n)?n:new Un(n),t=this.operator,n=this.source;return e.add(t?t.call(e,n):this._trySubscribe(e)),e},Wn.prototype.lift=function(n){var e=new Wn;return e.source=this,e.operator=n,e},Wn.prototype.pipe=function(){for(var e,n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0===(e=n).length?qn:1===e.length?e[0]:function(n){return e.reduce(function(n,e){return e(n)},n)})(this)},Wn.prototype._subscribe=function(n){},Wn.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},cn=Wn;function Wn(n){n&&(this._subscribe=n)}var Yn,xn=(n($n,Yn=cn),$n.prototype.next=function(e){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(n){return n.next(e)})},$n.prototype.commonJudgement=function(n){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,n())},$n.prototype.error=function(e){var t=this;this.commonJudgement(function(){var n=t.observers;for(t.hasError=!0,t.thrownError=e;n.length;)n.shift().error(e)})},Object.defineProperty($n.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),$n.prototype.complete=function(){var e=this;this.commonJudgement(function(){for(var n=e.observers;n.length;)n.shift().complete()})},$n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},$n.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},$n.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},$n.prototype._checkFinalizedStatuses=function(n){var e=this.hasError,t=this.thrownError,r=this.isStopped;e?n.error(t):r&&n.complete()},$n.prototype._innerSubscribe=function(n){var e=this.isStopped,t=this.observers;return e?$n.EMPTY:(t.push(n),new Fn(function(){Mn(t,n)}))},$n.EMPTY=((xn=new Fn).closed=!0,xn),$n);function $n(){var n=null!==Yn&&Yn.apply(this,arguments)||this;return n.closed=!1,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}var Qn=new cn(function(n){return n.complete()});function Xn(r){return r<=0?function(){return Qn}:An(function(n,e){var t=0;n.subscribe(function(n){++t<=r&&(e.next(n),r<=t&&e.complete())})})}function Zn(r,o){return An(function(n,e){var t=0;n.subscribe(function(n){return r.call(o,n,t++)&&e.next(n)})})}function ne(t){return Zn(function(n,e){return t<=e})}var ee,te=(n(re,ee=xn),re.prototype.subscribe=function(n){var t=this,n=ee.prototype.subscribe.call(this,n);yn()&&yn()._subscriptions.push(n);var r=n.unsubscribe;return n.unsubscribe=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.apply(this,n),t.observed||t.unsubscribe()},n},re.prototype.unsubscribe=function(){ee.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(n){return n()})},re.prototype.addTearDown=function(n){this.tearDownFns.push(n)},re);function re(){var n=null!==ee&&ee.apply(this,arguments)||this;return n.tearDownFns=[],n}function oe(n){var e=n.reduce(function(n,e){return n[e]=new te,n},{});return{getSubject:function(n){return e[n]},subjectMap:e}}function ie(n){return 1<n.length?n:n.length&&n[0]||{}}function ae(n){var t=n.filter(function(n){return n=n,!!!Tn("app")[n]}),n=oe(t).subjectMap;jn("app",n=n),ln("app",n),App=wn(App,function(e){t.forEach(function(n){var r=Cn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];r.next({that:this,param:ie(n),time:rn()}),v(t)&&t.apply(this,n)}})();n&&r.addTearDown(n)})})}function ue(n){return n.route||n.__route__||n.url||n.path||""}function ce(n){function e(n,i){r.forEach(function(o){j(n,o,function(r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];Rn(o).next({that:this,param:null,time:rn()});var t=i[o];if(v(t)&&t.apply(this,n),v(r))return r.apply(this,n)}})()})}var t=["attached"],r=n.filter(function(n){return~t.indexOf(n)});try{Component=wn(Component,function(n){S(n.lifetimes)?e(n.lifetimes,n):void 0!==n.lifetimes&&null!==n.lifetimes||(n.lifetimes={},e(n.lifetimes,n))})}catch(n){}}function se(n){function e(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(n(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Dn(function(n,e){"invoke"===n.param.name&&(o=!1,r={navigate_start:n.time,navigate_name:e})},Q),Pn("onLoad").pipe(ne(1)).subscribe(function(n){r.load_start=n.time}),Pn("onShow").pipe(ne(1)).subscribe(function(n){r.dom_end=n.time}),Pn("onReady").pipe(ne(1)).subscribe(function(n){r.render_end=n.time,e(),t()}),Cn(z.onHide).subscribe(function(){!1===o&&(e(),t())})}function fe(e){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];In().subscribe(function(n){~t.indexOf(n.name)&&e(n)})}function le(e){Rn("attached").subscribe(function(n){n=n.that;return e.call(n)})}function pe(n){return"android"===n.toLowerCase()}function de(n){return pe(n)?"Android":"ios"===n.toLowerCase()?"iOS":~Te.indexOf(n.toLowerCase())?"Mac":~Ce.indexOf(n.toLowerCase())?"windows":"unknown"}function he(n){var e=n.systemPlatform,t=n.pixelRatio,r=n.width,n=n.height;return e&&pe(e)&&t?r/t+" * "+n/t:r+" * "+n}function ve(n){void 0===n&&(n="tt");var e,t="",r="",o="";return tt.getEnvInfoSync?(r=(e=tt.getEnvInfoSync().microapp).envType,t=e.appId,o=e.mpVersion):(r=tt.env.VERSION,t=""),d({appId:t,miniEnv:r,miniVersion:o,platform:n},Re())}function me(e){var n=Pn("onReady").subscribe(function(){var n;tt.performance&&(n=(tt.performance.getCurrentPageEntries()||[]).map(function(n){n.name,n.entryType;var e=h(n,["name","entryType"]),t=Ne(n);return t?d(d({},e),t):n}),e(n))});return{disconnect:function(){return n.unsubscribe()}}}function be(n){var e=n.filter(function(n){return n=n,!!!Tn("component")[n]}),n=oe(e).subjectMap;jn("component",n=n),ln("component",n),xe().componentSubject(e)}function ge(e){function n(n){Y(n.methods)?e(n.methods):void 0!==n.methods&&null!==n.methods||(n.methods={},e(n.methods))}try{Component=wn(Component,n),Behavior=wn(Behavior,n)}catch(n){}}function ye(n,e){var t=n.filter(function(n){return n=n,!!!Tn("page")[n]}),n=oe(t).subjectMap;jn("page",n=n),ln("page",n),n=function(e){t.forEach(function(n){var r=Pn(n),n=j(e,n,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(ue(this)&&r.next({that:this,param:ie(n),time:rn()}),v(t))return t.apply(this,n)}})();n&&r.addTearDown(n)})},Page=wn(Page,n),ge(n)}function _e(n){var e=n.filter(function(n){return!hn(n)}),t=oe(e).subjectMap;jn("route",n=t),ln("route",n),e.forEach(function(i){var n=fn(xe().instance,i,function(o){void 0===o&&(o={}),dn(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:rn()}),J.forEach(function(r){j(o,r,function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];dn(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:ie(n)||{}},time:rn()}),v(t)&&t.apply(this,n)}})()})});n&&t[i].addTearDown(n)})}function we(u,n){var e=n.url,t=n.method,r=n.data,o=n.header,i=n.headers,c={api:u,request:{url:e,method:(e=t,"uploadFile"===(t=u)?"POST":"downloadFile"!==t&&e||"GET"),headers:o||i||{},body:g(r),timestamp:rn()},response:{}};j(n,"complete",function(a){return function(n){var e=c.response.timestamp||rn();c.duration=e-c.request.timestamp,c.completeCallbackTime=on(a,n);var t,r,o,i=n.errMsg||n.errorMessage||n.error;c.response={status:(t=n.status,r=n.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:e,headers:n.header||n.headers||{},body:g(n.data),errMsg:i,timing:xe().buildRequestProfile(n.profile||{})},vn(u).next(c)}})(),j(n,"success",function(e){return function(n){c.response.timestamp=rn(),c.response.status=200,c.successCallbackTime=on(e,n)}})(),j(n,"fail",function(e){return function(n){c.response.timestamp=rn(),c.response.status=-1,c.failCallbackTime=on(e,n)}})()}function Se(n,t){void 0===t&&(t=xe().instance);var e=n.filter(function(n){return!mn(n)}),r=oe(e).subjectMap;jn("http",n=r),ln("http",n),e.forEach(function(e){var n=fn(t,e,function(n){we(e,n)});n&&r[e].addTearDown(n)})}var Ee,cn=y((Ee={},[function(n){if(!Sn().platform)throw Error("Not support current Mini Program");if(!Array.isArray(n)||!n.length)return null;n=n.find(function(n){return n.platform===Sn().platform});return n&&(Ee=n.adapterCtor())},function(){return Ee}]),2),ke=cn[0],xe=cn[1],Oe=function(n){return"SLARDAR"+n},je=function(n){try{return xe().getStorage(n)}catch(n){return}},Te=["darwin","macs","mac"],Ce=["windows_nt","windows","window"],Pe=function(n){return function(n){var e,t={};for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&void 0!==n[e]&&null!==n[e]&&(t[e]=n[e]);return t}({domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,secureConnectionStart:n.SSLconnectionStart,connectEnd:n.connectEnd,requestStart:n.requestStart,requestEnd:n.requestEnd,responseStart:n.responseStart,responseEnd:n.responseEnd,socketReused:n.socketReused,redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,sendBytesCount:n.sendBytesCount,throughputKbps:n.throughputKbps,receivedBytedCount:n.receivedBytedCount})},De=function(n){return{name:"unknown_error_name",message:g(n)}},Ie=function(n){var e=n.split("\n"),e=y((e[0]&&e[0].split(":")||[]).map(function(n){return n.trim()}),2);return{name:e[0],message:e[1],stack:n}},Re=function(){var n=tt.getSystemInfoSync(),e=n.model,t=n.brand,r=n.pixelRatio,o=n.screenHeight,i=n.screenWidth,a=n.windowHeight,u=n.windowWidth,c=n.language,s=n.version,f=n.system,l=n.platform,p=n.SDKVersion,n=n.appName;return{model:e,brand:t,pixelRatio:r,screenArea:he({width:i,height:o}),windowArea:he({width:u,height:a}),language:c,osName:de(l),osVersion:f,SDKVersion:p,hostName:n,hostVersion:s}},Ne=function(n){if("navigation"===n.entryType)return{name:"route",entryType:"navigation",path:n.name};switch(n.name){case"app-click":return{name:"appClick",entryType:"navigation"};case"miniprogram-package\t":return{name:"downloadPackage",entryType:"loadPackage"};case"first-paint":return{name:"fp",entryType:"render"};default:return null}},xn={platform:"tt",adapterCtor:function(){return d(d({},{instance:t=void 0===t?Sn().instance:t,request:function(n){return t.request(n)},getStorage:function(n){return t.getStorageSync(n)},setStorage:function(n,e){return t.setStorageSync(n,e)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(n){return n},monitorNetworkType:function(e){t.getNetworkType({success:function(n){e&&e({networkType:n.networkType})}}),t.onNetworkStatusChange(function(n){e&&e({networkType:n.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"tt",buildError:function(n){return(c(n=n)?Ie:De)(n)},getSystemInfo:ve,observePerformance:me,performanceSubscriber:fe,buildRequestProfile:function(n){return Pe(n)},componentSubject:ce,pagePerfSubscriber:se,setDataSubject:le});var t}},Me=function(n,e){void 0===e&&(e=$),n.on("init",function(){Se(e)})};function qe(){var a=ue(this),u=bn();var n=fn(this,"setData",function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=r[0],i=rn();return[o,function(){var n=r[1],e=rn()-i;u.next({renderTime:e,url:a,data:o,startTime:i}),n&&n.call(t)}]});n&&u.addTearDown(n)}function Ae(){var n;Tn("setData")||(n=(n=oe(["setData"]).getSubject)("setData"),On("setData",n),pn("setData",n))}function Le(o){return Object.keys(o).reduce(function(n,e){var t,r;return r=o[t=e],t&&r&&(ze.test(t)||Ve.test(r))||(n[e]=o[e]),n},{})}var Be=function(n){n.on("init",function(){Ae(),Pn("onLoad").subscribe(function(n){n=n.that;qe.call(n)}),xe().setDataSubject(qe)})},Fe=function(n){n.on("init",function(){var e,n,t,r=xe();r.observePerformance&&!gn()&&(e=(0,oe(["performance"]).getSubject)("performance"),On("performance",n=e),pn("performance",n),(t=r.observePerformance(function(n){n.forEach(function(n){e.next(n)})}))&&t.disconnect&&e.addTearDown(function(){return t.disconnect()}))})},ze=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Ve=new RegExp("(bearer|session)","i"),Ue=function(){return function(n,s){var e=n.hookRequest,t=n.hookDownloadFile,r=n.hookUploadFile,f=n.ignoreUrls,l=n.collectBodyOnError,p=n.extraExtractor,n=function(n){var e,t,r,o,i,a,u,c;!function(n,e){n=m(n||[]);return!!n&&n.test(e)}(f,n.request.url)&&(c=n.response,e=n.request,t=n.api,r=n.duration,o=n.failCallbackTime,u=n.successCallbackTime,i=n.completeCallbackTime,e.headers=Le(e.headers||{}),c.headers=Le(c.headers||{}),a=c.errMsg,n=h(c,["errMsg"]),n=d(d({},n),{is_custom_error:!1}),a&&(n.err_msg=a),u={api:t,request:e,duration:r,cbTime:i+(o||0)+(u||0),response:n},!v(p)||(n=p(c.body,u))&&(u.extra=n,u.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete u.request.body,delete u.response.body),s({ev_type:"http",payload:u}))};e&&vn("request").subscribe(n),t&&vn("downloadFile").subscribe(n),r&&vn("uploadFile").subscribe(n)}},He=function(n,e,t,r){void 0===e&&(e={}),void 0===r&&(r=[]);try{var o=n.apply(void 0,_([],y(r),!1));return o&&o(e,t)||[]}catch(n){return P("applyMonitor",n),[]}};function Ge(n,e,t){_n(n);e=null===(n=n.config())||void 0===n?void 0:n.plugins[e];return S(e)?d(d({},t),e):!!e&&t}function Ke(n,e){return n&&e&&n===e}function Je(){var r;return function(n){try{if(t=r,!(!(e=n)||!t)&&!(!Ke(e.message,t.message)&&!Ke(e.stack,t.stack)))return void(r=n)}catch(n){}var e,t;return r=n}}var We,Ye="http",$e={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Qe=function(f){return void 0===f&&(f=xe()),function(n,r){var e=n.ignoreErrors,t=n.hookOnError,o=n.hookOnUnhandledRejection,i=n.hookRouteError,a=n.dedupe,u=m(e),c=Je(),s=function(n,e,t){n=a?c(n):n;n&&(u&&u.test(n.message)||(n={error:n},e&&(n.extra=e),t&&(n.react=t),r(n)))};t&&Cn(z.onError).subscribe(function(n){n=n.param,n=f.buildError(n);u&&u.test(n.message)||s(n)}),o&&Cn(z.onUnhandledRejection).subscribe(function(n){var e=n.param||{},n=e.promise,t=g(e.reason);u&&u.test(t)||n.catch(b).then(function(n){var e={name:"UnhandledRejection",message:t};n&&n.stack&&(e.stack=n.stack),s(e)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Dn(function(n){n=n.param;"fail"===(n=n).name&&s({name:"RouteError",message:n.value.errMsg})}),[s]}};(cn=We=We||{}).history="history",cn.manual="manual";function Xe(t,n,r){var o=n,i=null,a=0,e="launch";function u(n,e){o=e,a=rn(),r(e,i=e+"_"+a),t(n,e)}return Cn(z.onShow).pipe(ne(1)).subscribe(function(){e="show"}),Dn(function(){e="history"}),[u,function(n){n&&(u(e,n),e="history")},function(n){void 0===n&&(n="hide"),i&&(r(o,i),i=null,t(n,o,rn()-a))}]}var Ze=function(){return function(n,r){var e=n.extractPid,t=n.routeMode,o=n.setPidAndViewId,i=function(n){return e?e(n):n},n=y(Xe(function(n,e,t){r({ev_type:"pageview",payload:{pid:e,source:n,duration:t}})},"",o),3),o=n[0],a=n[1],n=n[2];return t!==We.manual&&(Pn("onShow").subscribe(function(n){return function(n){n=ue(n),n=i(n);a(n)}(n.that)}),Pn("onUnload").subscribe(n.bind(null,"unload")),Pn("onHide").subscribe(n.bind(null,"hide"))),[o.bind(null,"user_set"),n]}},nt=function(){return function(n){var e=y(function(e,t,r){void 0===e&&(e=20),void 0===t&&(t=b),void 0===r&&(r=function(n,e){return n.slice(-e)});var o=[];return[function(){return o},function(n){t(n)&&(n=d(d({},n),{timestamp:n.timestamp||Date.now()}),o=0<=e&&o.length+1>e?r(_(_([],y(o),!1),[n],!1),e):_(_([],y(o),!1),[n],!1))}]}(n.maxBreadcrumbs,n.onAddBreadcrumb,n.onMaxBreadcrumbs),2),n=e[0],r=e[1];return $.forEach(function(n){mn(n)&&vn(n).subscribe(function(n){r({type:"http",category:n.api,message:"",data:{method:n.request.method,url:n.request.url,status_code:String(n.response.status)},timestamp:n.request.timestamp})})}),Dn(function(n,e){var t=n.param,n=n.time;"complete"===t.name&&r({type:"route",category:e,message:t.value.errMsg||t.value.errorMessage||"",timestamp:n,data:{url:t.url||""}})}),[n,r]}},et=function(){return function(n,t){var r=n.isCalculateSize;bn().subscribe(function(n){var e={duration:n.renderTime,start_time:n.startTime};r&&(e.size=(n=n.data,TextEncoder?(new TextEncoder).encode(g(n)).length:2*g(n).length)),t({ev_type:"set_data",payload:e})})}},rt=function(){return function(n,e){function t(){e({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Cn(z.onLaunch).pipe(Xn(1)).subscribe(function(n){r.activate_start=n.time}),Cn(z.onShow).pipe(Xn(1)).subscribe(function(n){r.init_end=n.time}),Pn("onLoad").pipe(Xn(1)).subscribe(function(n){r.page_load_start=n.time}),Pn("onShow").pipe(Xn(1)).subscribe(function(n){r.page_dom_end=n.time});var i=gn();Pn("onReady").pipe(Xn(1)).subscribe(function(n){r.page_render_end=n.time,i&&!r.trigger||t()}),i&&In().pipe(Zn(function(n){return"appClick"===n.name}),Xn(1)).subscribe(function(n){r.trigger=n.startTime,r.page_render_end&&t()}),Cn(z.onHide).subscribe(function(){o||t()})}},ot=function(){return function(n,e){xe().pagePerfSubscriber(function(n){return e({ev_type:"page_perf",payload:n})})}},it=function(e){return void 0===e&&(e=xe()),function(n,t){var r,o;gn()&&e.performanceSubscriber&&(r=0,Pn("onLoad").subscribe(function(n){o=n.time,r++}),e.performanceSubscriber(function(n){var e={is_custom:!1,name:n.name,value:n.startTime,type:"perf",count:r};e.duration=n.duration||(o?n.startTime-o:0),e.is_support=0<=e.duration,t({ev_type:"performance",payload:e})}))}},at="pageview",ut={routeMode:We.history,setPidAndViewId:function(n,e){}},ct="jsError",st={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},ft=function(t){return function(n){var e=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},n),{breadcrumbs:e})})}},lt={maxBreadcrumbs:20,tap:!0},pt="breadcrumb",dt=function(e){e.on("init",function(){e.provide("_subscriptions",[]),_n(e),e.on("init",function(){ae(Z),ye(en),be(nn)}),e.on("init",function(){_e(X)})}),e.on("beforeDestroy",function(){if(e._subscriptions)for(;e._subscriptions.length;)e._subscriptions.shift().unsubscribe();for(var n in e)delete e[n]})},ht="setData",vt={isCalculateSize:!1},mt="appLaunchPerf",bt={},gt="pagePerf",yt={},_t="performance",wt={},St=function(n,e,t){void 0===t&&(t=xe());var r=e.url,o=e.data,i=e.success,a=void 0===i?l:i,u=e.fail,c=void 0===u?l:u,i=e.header,u={"Content-Type":"application/json"};Y(e=i)&&0!==Object.keys(e).length&&Object.assign(u,i),t.request({method:n,url:r,data:o,header:u,headers:u,success:function(n){a(n)},fail:function(n){n=n.errMsg||"Network request failed";c(new Error(n))}})},Et=function(e){return(e=void 0===e?xe():e)?{get:function(n){return St("GET",n,e)},post:function(n){return St("POST",n,e)}}:{get:l,post:l}};function kt(n){return n=Oe(String(n)),(n=je(n))&&n.userId&&n.deviceId?n:{userId:I(),deviceId:I()}}function xt(n){return n+"_"+Date.now()}function Ot(n){var e=n.aid,t=n.userId,n=n.deviceId;!function(n,e){try{xe().setStorage(n,e)}catch(n){}}(Oe(String(e)),{userId:t,deviceId:n})}var jt={build:function(n){return{ev_type:n.ev_type,payload:n.payload,common:d(d({},n.extra||{}),n.overrides||{})}}},Tt="/monitor_mini/collect",Ct="/settings/minipro",Pt="apmplus.volces.com",Dt="session",It={sample_rate:1,include_users:[],sample_granularity:Dt,rules:{}},Rt=[Tt,Ct],Nt="0.2.5-alpha.0",Mt="APM_PLUS_MINI_PROGRAM",qt=function(n,e){return void 0===e&&(e=Tt),(n&&0<=n.indexOf("//")?"":"https://")+n+e};function At(n){n=kt(n.aid);return{aid:0,token:"",pid:"",viewId:xt("_"),userId:n.userId,deviceId:n.deviceId,sessionId:I(),domain:Pt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Rt},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:It,sdkName:Mt,sdkVersion:Nt}}function Lt(n){var e,t=n.plugins||{};for(e in t)t[e]&&!S(t[e])&&(t[e]={});return d(d({},n),{plugins:t})}function Bt(n){return S(n)&&"aid"in n&&"token"in n}function Ft(n){return d({},n)}var zt=function(e){var r,o,i=e,a={},u=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(n){var e,t;return a=d(d({},a),n||{}),s(),r||(r=n,i.useLocalConfig||!i.aid?(o={},c()):u?f():(e=i.domain,n=i.aid,t=function(n){u=n,f()},Et().get({url:function(n,e){return void 0===e&&(e=Ct),(n&&0<=n.indexOf("//")?"":"https://")+n+e}(e)+"?biz_id="+n,success:function(n){t(n&&n.data&&n.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(n){t=n},onReady:function(n){c=function(){Ot(i),n()},o&&c()}};function s(){var n=d(d(d({},e),o||{}),a);n.plugins=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t={},r=0;r<n.length;)t=p(t,n[r++]);return t}(e.plugins,(null==o?void 0:o.plugins)||{},a.plugins||{}),n.sample=Vt(Vt(e.sample,null==o?void 0:o.sample),a.sample),i=n,t()}function f(){o=function(n){if(!n)return{};var e=n.sample,t=n.user_id,r=n.timestamp,o=t?{userId:t}:{};if(!e)return o;var i=e.sample_rate,n=e.sample_granularity,t=void 0===n?Dt:n,n=e.include_users,e=e.rules,e=void 0===e?[]:e;return d(d({},o),{sample:{include_users:n,sample_rate:i,sample_granularity:t,rules:e.reduce(function(n,e){var t=e.name,r=e.enable,o=e.sample_rate,e=e.conditional_sample_rules;return n[t]={enable:r,sample_rate:o,conditional_sample_rules:e},n},{})},serverTimestamp:r})}(u),function(n){n=Oe(n);return!!xe().getStorage(n)}(String(i.aid))&&(o.userId=e.userId),s(),c()}};function Vt(r,o){if(!r||!o)return r||o;var n=d(d({},r),o);return n.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),n.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(n,e){var t;return e in n||(e in(r.rules||{})&&e in(o.rules||{})?(n[e]=d(d({},r.rules[e]),o.rules[e]),n[e].conditional_sample_rules=_(_([],y(r.rules[e].conditional_sample_rules||[]),!1),y(o.rules[e].conditional_sample_rules||[]),!1)):n[e]=(null===(t=r.rules)||void 0===t?void 0:t[e])||(null===(t=o.rules)||void 0===t?void 0:t[e])),n},{}),n}function Ut(n){var e={url:(e=xe().getCurrentPages().pop())?(e?ue(e):"")+s(e.options):"",timestamp:rn()};return d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})})}function Ht(n){if(!ke(n))throw Error(K);return n=function(n){var t,r,e=n.builder,o=n.createSender,i=n.createDefaultConfig,a=n.createConfigManager,u=n.userConfigNormalizer,c=n.initConfigNormalizer,s=n.validateInitConfig,f={};w.forEach(function(n){return f[n]=[]});var l=!1,p=!1,d=!1,h=[],v=[],m=R(),b={getBuilder:function(){return e},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(n){if(l)x("already inited");else{if(!(n&&S(n)&&s(n)))throw new Error("invalid InitConfig, init failed");var e=i(n);if(!e)throw new Error("defaultConfig missing");n=c(n);if((r=a(e)).setConfig(n),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(n){l&&n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&S(n)&&(g("beforeConfig",!1,n),null!=r&&r.setConfig(u(n))),null==r?void 0:r.getConfig()},provide:function(n,e){E(v,n)?x("cannot provide "+n+", reserved"):(b[n]=e,g("provide",!1,n))},start:function(){var e=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(n){return e.build(n)}),h.length=0}))},report:function(n){n&&(!(n=O(f.beforeReport)(n))||(n=O(f.report)(n))&&(p?this.build(n):h.push(n)))},build:function(n){!p||(n=O(f.beforeBuild)(n))&&(!(n=e.build(n))||(n=O(f.build)(n))&&this.send(n))},send:function(n){!p||(n=O(f.beforeSend)(n))&&(t.send(n),g("send",!1,n))},destroy:function(){m.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(n,e){if("init"===n&&l||"start"===n&&p||"beforeDestroy"===n&&d)try{e()}catch(n){}else f[n]&&f[n].push(e)},off:function(n,e){f[n]&&(f[n]=k(f[n],e))},destroyAgent:m},v=Object.keys(b);return b;function g(n,e){void 0===e&&(e=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[n].forEach(function(n){try{n.apply(void 0,_([],y(t),!1))}catch(n){}}),e&&(f[n].length=0)}}({validateInitConfig:Bt,initConfigNormalizer:Lt,userConfigNormalizer:Ft,createSender:function(n){return e({size:W,endpoint:qt(n.domain),transport:Et()})},builder:jt,createDefaultConfig:At,createConfigManager:zt}),N(n),Yt(n),Kt(n),Jt(n),V(n),dt(n),M(n),Wt(n),Gt(n),n}var Gt=function(e){function t(n){return void 0===n&&(n=xe().getSystemInfo()),e.set(d({},n))}function r(){t(),n()}var o,i,a=!1,n=(i="",function(){var n=o.getSender();i=i||n.getEndpoint();var e=o.config(),e={did:e.deviceId,sid:e.sessionId,sname:e.sdkName,sver:e.sdkVersion,soffset:e.offset||0,model:e.model,brand:e.brand,ratio:e.pixelRatio,screen:e.screenArea,window:e.windowArea,lang:e.language,osname:e.osName,osver:e.osVersion,libver:e.SDKVersion,scene:e.scene||-1,menv:e.miniEnv,mver:e.miniVersion,hostname:e.hostName,hostver:e.hostVersion,platform:e.platform,biz_id:e.aid,x_auth_token:e.token};n.setEndpoint(i+s(e))});(o=e).on("start",function(){r(),a=!0}),e.on("init",function(){Cn(z.onLaunch).pipe(Xn(1)).subscribe(function(n){n=n.param.scene||-1;t({scene:n}),a&&r()}),xe().monitorNetworkType(function(n){n=n.networkType;e.set({networkType:n})})})},Kt=function(r){r.on("beforeBuild",function(n){return e=n,t=r.config(),(n={}).aid=t.aid,n.pid=t.pid,n.view_id=t.viewId,n.user_id=t.userId,n.network_type=t.networkType,d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})});var e,t})},Jt=function(n){n.on("report",Ut)},Wt=function(e){e.on("init",function(){Cn(z.onHide).subscribe(function(){var n=e.getSender();n&&n.flush()})})},Yt=function(t){var r,o=!1;t.on("init",function(){r=rn(),t.on("config",function(){var n,e=null===(n=t.config())||void 0===n?void 0:n.serverTimestamp;isNaN(e)||Number(e)<=0||o||(o=!0,(n=rn())-r<1e3&&e&&(n=e-(n+r)/2,isNaN(n)||t.set({offset:n})))})})};return function(n){var e,t,r,i,o,a,u,c,s,n=Ht(n);if(n)return(e=n).provide("sendEvent",function(n){n=H(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})}),e.provide("sendLog",function(n){n=G(n);n&&e.report({ev_type:U,payload:n,extra:{timestamp:Date.now()}})}),(t=n).on("init",function(){var n,e=Ge(t,at,ut);e&&(e=(n=y(He(Ze,d(d({},e),{setPidAndViewId:function(n,e){t.set({pid:n,viewId:e,actionId:void 0})}}),t.report.bind(t)),2))[0],n=n[1],t.provide("sendPageview",e),t.provide("sendPageviewWithHide",n))}),(r=n).on("init",function(){var n,e=Ge(r,ct,st);e&&(n=ft(r),n=y(He(Qe,e,n),1)[0],r.provide("captureException",n))}),(i=n).on("init",function(){var n,e,t,r,o=Ge(i,Ye,$e);o&&(n=o.hookRequest,e=o.hookDownloadFile,t=o.hookUploadFile,r=[],n&&r.push("request"),e&&r.push("downloadFile"),t&&r.push("uploadFile"),Me(i,r),He(Ue,o,i.report.bind(i)))}),(o=n).on("init",function(){var n=Ge(o,ht,vt);n&&(Be(o),He(et,n,o.report.bind(o)))}),(a=n).on("init",function(){var n,e=Ge(a,pt,lt);e&&(e=(n=y(He(nt,e,function(n){}),2))[0],n=n[1],a.provide("getBreadcrumbs",e),a.provide("addBreadcrumb",n))}),(u=n).on("init",function(){var n=Ge(u,mt,bt);n&&(Fe(u),He(rt,n,u.report.bind(u)))}),(c=n).on("init",function(){var n=Ge(c,gt,yt);n&&He(ot,n,c.report.bind(c))}),(s=n).on("init",function(){var n=Ge(s,_t,wt);n&&(Fe(s),He(it,n,s.report.bind(s)))}),n}.bind(null,[xn])()}); |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).wxClient=n()}(this,function(){"use strict";function n(e){var t,r=e.transport,o=e.endpoint,n=e.size,i=void 0===n?10:n,e=e.wait,u=void 0===e?1e3:e,a=[],c=0;function s(){var n;a.length&&(n=this.getBatchData(),r.post({url:o,data:n,fail:function(e){t&&t(e,n)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(e){i=e},setWait:function(e){u=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){a.push(e),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(e=a,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),a=[]},fail:function(e){t=e}}}var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(e){return e}function S(e){return"object"==typeof e&&null!==e}var t=Object.prototype;function i(e){if(S(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(e);e=Object.getPrototypeOf(e);return e===t||null===e}}function u(e){return"[object Array]"===t.toString.call(e)}function h(e){return"function"==typeof e}function a(e){return"number"==typeof e}function c(e){return"string"==typeof e}function p(e,n){var t,r,o=d({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(S(n[t])&&i(n[t])?o[t]=p(S(e[t])?e[t]:{},n[t]):u(n[t])&&u(e[t])?o[t]=function n(e,t){e=u(e)?e:[];t=u(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:S(e)&&i(e)?p({},e):u(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function E(e,n){if(!u(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function x(e,n){if(!u(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function m(e){return u(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];c(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function v(e){try{return c(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function s(t){return S(t)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""}function k(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,_(["[SDK]",Date.now(),(""+P++).padStart(8," ")],y(e),!1))}function o(e){return Math.random()<Number(e)}function f(e,n){return e<Number(n)}function O(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){C(e)}return n}}var g=function(i,u,a,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(e),!1)),o=r;return h(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return h(t)&&t.apply(this,n)}}),i[u]=o,function(e){e||(o===i[u]?i[u]=t:r=t)}}},j=0,C=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,_(["[SDK]",Date.now(),(""+j++).padStart(8," ")],y(e),!1))},P=0;function T(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}function D(){function t(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){r[e]&&r[e].forEach(function(e){t(e[1])}),r[e]=void 0}var r={};return{set:function(e,n,t){r[e]?r[e].push([n,t]):r[e]=[[n,t]]},remove:n,removeByEvType:function(n){Object.keys(r).forEach(function(e){r[e]&&r[e].forEach(function(e){e[0]===n&&t(e[1])})})},clear:function(){Object.keys(r).forEach(function(e){n(e)})}}}var I=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=v(n),o},merge:function(n){return t=d(d({},t),n),Object.keys(n).forEach(function(e){r[e]=v(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return d({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})};function R(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function M(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function N(e,n,t,r){if(void 0===(e=function(e,n,t){for(var r,n=y(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=y(i))[0],i=r.slice(1);if(e)return t(e,o)}(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":a(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return E(n,e);case"neq":return!E(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function q(n,e){try{return"rule"===e.type?N(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return q(n,e)}):e.children.some(function(e){return q(n,e)})}catch(e){return!1}}function L(e,n,t,r){if(!n)return b;var o=n.sample_rate,i=n.include_users,u=n.sample_granularity,a=n.rules,n=void 0===(n=n.r)?Math.random():n;if(E(i,e))return function(e){return R(e,1)};var c,s,f,l,p,d,h,m=M(u="session"===u,o,t,n,r),v=(c=a,s=u,f=o,l=t,p=n,d=r,h={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(h[e]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:M(s,r,l,p,d)},n&&(h[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:M(s,n,l,p,d),effectiveSampleRate:n*f,filter:e}}))):h[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(e){if(!m())return!1;if(!(e.ev_type in v))return R(e,o);if(!v[e.ev_type].enable)return!1;if(e.common&&e.common.sample_rate)return e;var n=v[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(q(e,t[r].filter))return!!t[r].hit()&&R(e,t[r].effectiveSampleRate);return!!n.hit()&&R(e,n.effectiveSampleRate)}}var A,B=function(t){t.on("start",function(){var e=t.config(),n=e.userId,e=e.sample,e=L(n,e,o,f);t.on("build",e)})},F="custom",z=function(e){if(e&&S(e)&&e.name&&c(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&S(e.metrics)){var t=e.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&S(e.categories)){var o,i=e.categories,u={};for(o in i)u[o]=v(i[o]);n.categories=u}return n}},V=function(e){if(e&&S(e)&&e.content&&c(e.content)){var n={content:v(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&S(e.extra)){var t,r=e.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=v(r[t]);n.metrics=o,n.categories=i}return n}},U="Adapters imported incorrectly",H=["success","fail","complete"],G=20;(Se=A=A||{}).onLaunch="onLaunch",Se.onShow="onShow",Se.onHide="onHide",Se.onError="onError",Se.onPageNotFound="onPageNotFound",Se.onUnhandledRejection="onUnhandledRejection";function K(e){return"[object Object]"===Object.prototype.toString.call(e)}var J=["request","downloadFile","uploadFile"],W=["navigateTo","redirectTo","switchTab","reLaunch"],Y=_(_([],y(W),!1),["navigateBack"],!1),$=_(_([],y([A.onLaunch,A.onShow,A.onHide]),!1),[A.onError,A.onPageNotFound,A.onUnhandledRejection],!1),Q=["attached","onInit"],X=["onLoad","onShow","onReady","onUnload","onHide"],Z="unknown_error_name",ee="__HOOKED__";var ne=function(){return Date.now()};function te(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!h(e))return 0;var r,o=ne();try{e.apply(this,n)}finally{r=ne()}return r-o}var re,oe=function(){},ie=y((re="tt",[function(){return re},function(e){return re=e}]),2),ue=ie[0];ie[1];function ae(e,n,r){var o=e[n];if(!o||!o[ee])return Object.defineProperty(e,n,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=r.apply(this,e);t&&(e=t)}catch(e){C(e)}return o.apply(this,e)}}),e[n]&&(e[n][ee]=!0),function(){e[n][ee]=!1,r=oe}}function ce(t,e){Object.keys(e).forEach(function(n){e[n].addTearDown(function(){var e;return xe(t,((e={})[n]=null,e))})})}function se(e,n){n.addTearDown(function(){return Ee(e,null)})}function fe(e){return ke("route")[e]}function le(e){return!!ke("route")[e]}function pe(e){return ke("http")[e]}function de(e){return!!ke("http")[e]}function he(){return ke("setData")}function me(){return!!ke("performance")}function ve(){return ke("instance")}function be(e){Ee("instance",e)}var ge=function(n,t){function e(e){return t(e),n.call(this,e)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},ye=function(){var e={instance:null};return e.instance||("undefined"!=typeof tt?e={instance:tt,platform:ue()}:"undefined"!=typeof my?e={instance:my,platform:"my"}:"undefined"!=typeof swan?e={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(e={instance:wx,platform:"wx"})),e},_e="__slardar__global__0.2.4",we={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},Se=function(e,n){void 0===e&&(e={});var t=(n=void 0===n?ye().instance:n)?n[_e]||(n[_e]=e):e;return{setGlobalValue:function(e,n){t[e]=n},mergeGlobalValue:function(e,n){t[e]=d(d({},t[e]),n)},getGlobalValue:function(e){return t[e]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},we),n&&(n[_e]=t)}}}(d({},we)),Ee=Se.setGlobalValue,xe=Se.mergeGlobalValue,ke=Se.getGlobalValue,Oe=function(e){return ke("app")[e]},je=function(e){return ke("page")[e]},Ce=function(t,e){(e=void 0===e?Y:e).forEach(function(n){le(n)&&fe(n).subscribe(function(e){return t(e,n)})})},Pe=function(){return ke("performance")},Te=function(e){return ke("component")[e]};function De(e){return"function"==typeof e}function Ie(e,n){!e||0<=(n=e.indexOf(n))&&e.splice(n,1)}function Re(e){return e}function Me(t){return function(e){if((n=e)&&De(n.lift))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});var n;throw new TypeError("Unable to lift unknown Observable type")}}function Ne(e){De(e)?e():null!=e&&e.unsubscribe()}var qe=function(e){return e instanceof Le||e&&"closed"in e&&De(e.remove)&&De(e.add)&&De(e.unsubscribe)},Le=(Ae.prototype.unsubscribe=function(){var e,n,t,r=this;this.closed||(this.closed=!0,e=this._parentage,n=this._finalizers,t=this.initialTeardown,e&&(this._parentage=null,e.forEach(function(e){return e.remove(r)})),De(t)&&t(),n&&(this._finalizers=null,n.forEach(Ne)))},Ae.prototype.remove=function(e){this._finalizers&&Ie(this._finalizers,e),e instanceof Ae&&e._removeParent(this)},Ae.prototype.add=function(e){if(e&&e!==this)if(this.closed)Ne(e);else{if(e instanceof Ae){if(e.closed||e._hasParent(this))return;e._addParent(this)}var n=this._finalizers;this._finalizers=n?(n.push(e),n):[e]}},Ae.prototype._addParent=function(e){var n=this._parentage;this._parentage=n?(n.push(e),n):[e]},Ae.prototype._hasParent=function(e){return this._parentage&&~this._parentage.indexOf(e)},Ae.prototype._removeParent=function(e){this._parentage&&Ie(this._parentage,e)},Ae);function Ae(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var Be,Fe=(e(ze,Be=Le),ze.prototype.next=function(e){this.isStopped||this.destination.next(e)},ze.prototype.error=function(e){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(e)}finally{this.unsubscribe()}}},ze.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},ze.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Be.prototype.unsubscribe.call(this),this.destination=null)},ze.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},ze);function ze(e){var n=Be.call(this)||this;return n.isStopped=!1,n.destination=He(e)?e:new Ve(!(e=e)||De(e)?{next:null!=e?e:void 0}:e),n}var Ve=(Ue.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(e){console.error("ConsumerObserver.next error",e)}},Ue.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(e){console.error("ConsumerObserver.error error",e)}},Ue.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){console.error("ConsumerObserver.complete error",e)}},Ue);function Ue(e){this.partialObserver=e}function He(e){return e instanceof Fe||e&&((n=e)&&De(n.next)&&De(n.error)&&De(n.complete))&&qe(e);var n}Ge.prototype.subscribe=function(e){var n=He(e)?e:new Fe(e),t=this.operator,e=this.source;return n.add(t?t.call(n,e):this._trySubscribe(n)),n},Ge.prototype.lift=function(e){var n=new Ge;return n.source=this,n.operator=e,n},Ge.prototype.pipe=function(){for(var n,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?Re:1===n.length?n[0]:function(e){return n.reduce(function(e,n){return n(e)},e)})(this)},Ge.prototype._subscribe=function(e){},Ge.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},ie=Ge;function Ge(e){e&&(this._subscribe=e)}var Ke,Se=(e(Je,Ke=ie),Je.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(e){return e.next(n)})},Je.prototype.commonJudgement=function(e){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,e())},Je.prototype.error=function(n){var t=this;this.commonJudgement(function(){var e=t.observers;for(t.hasError=!0,t.thrownError=n;e.length;)e.shift().error(n)})},Object.defineProperty(Je.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Je.prototype.complete=function(){var n=this;this.commonJudgement(function(){for(var e=n.observers;e.length;)e.shift().complete()})},Je.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Je.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Je.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Je.prototype._checkFinalizedStatuses=function(e){var n=this.hasError,t=this.thrownError,r=this.isStopped;n?e.error(t):r&&e.complete()},Je.prototype._innerSubscribe=function(e){var n=this.isStopped,t=this.observers;return n?Je.EMPTY:(t.push(e),new Le(function(){Ie(t,e)}))},Je.EMPTY=((Se=new Le).closed=!0,Se),Je);function Je(){var e=null!==Ke&&Ke.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var We=new ie(function(e){return e.complete()});function Ye(r){return r<=0?function(){return We}:Me(function(e,n){var t=0;e.subscribe(function(e){++t<=r&&(n.next(e),r<=t&&n.complete())})})}function $e(r,o){return Me(function(e,n){var t=0;e.subscribe(function(e){return r.call(o,e,t++)&&n.next(e)})})}function Qe(t){return $e(function(e,n){return t<=n})}var Xe,Ze=(e(en,Xe=Se),en.prototype.subscribe=function(e){var t=this,e=Xe.prototype.subscribe.call(this,e);ve()&&ve()._subscriptions.push(e);var r=e.unsubscribe;return e.unsubscribe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(this,e),t.observed||t.unsubscribe()},e},en.prototype.unsubscribe=function(){Xe.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(e){return e()})},en.prototype.addTearDown=function(e){this.tearDownFns.push(e)},en);function en(){var e=null!==Xe&&Xe.apply(this,arguments)||this;return e.tearDownFns=[],e}function nn(e){var n=e.reduce(function(e,n){return e[n]=new Ze,e},{});return{getSubject:function(e){return n[e]},subjectMap:n}}function tn(e){return 1<e.length?e:e.length&&e[0]||{}}function rn(e){var t=e.filter(function(e){return e=e,!!!ke("app")[e]}),e=nn(t).subjectMap;xe("app",e=e),ce("app",e),App=ge(App,function(n){t.forEach(function(e){var r=Oe(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.next({that:this,param:tn(e),time:ne()}),h(t)&&t.apply(this,e)}})();e&&r.addTearDown(e)})})}function on(e){return e.route||e.__route__||e.url||e.path||""}function un(e){function n(e,i){r.forEach(function(o){g(e,o,function(r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Te(o).next({that:this,param:null,time:ne()});var t=i[o];if(h(t)&&t.apply(this,e),h(r))return r.apply(this,e)}})()})}var t=["attached"],r=e.filter(function(e){return~t.indexOf(e)});try{Component=ge(Component,function(e){S(e.lifetimes)?n(e.lifetimes,e):void 0!==e.lifetimes&&null!==e.lifetimes||(e.lifetimes={},n(e.lifetimes,e))})}catch(e){}}function an(e){function n(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(e(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Ce(function(e,n){"invoke"===e.param.name&&(o=!1,r={navigate_start:e.time,navigate_name:n})},W),je("onLoad").pipe(Qe(1)).subscribe(function(e){r.load_start=e.time}),je("onShow").pipe(Qe(1)).subscribe(function(e){r.dom_end=e.time}),je("onReady").pipe(Qe(1)).subscribe(function(e){r.render_end=e.time,n(),t()}),Oe(A.onHide).subscribe(function(){!1===o&&(n(),t())})}function cn(n){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];Pe().subscribe(function(e){~t.indexOf(e.name)&&n(e)})}function sn(n){Te("attached").subscribe(function(e){e=e.that;return n.call(e)})}function fn(e){return"android"===e.toLowerCase()}function ln(){var e=wx.getAccountInfoSync().miniProgram,n=(p=wx.getSystemInfoSync()).model,t=p.brand,r=p.pixelRatio,o=p.screenHeight,i=p.screenWidth,u=p.windowHeight,a=p.windowWidth,c=p.language,s=p.version,f=p.system,l=p.platform,p=p.SDKVersion;return{model:n,brand:t,pixelRatio:r,screenArea:On({width:i,height:o}),windowArea:On({width:a,height:u}),language:c,osName:kn(l),osVersion:f,SDKVersion:p,appId:e.appId,miniEnv:e.envVersion,miniVersion:e.version,hostName:"wx",hostVersion:s,platform:"wx"}}function pn(e){var n=e.filter(function(e){return e=e,!!!ke("component")[e]}),e=nn(n).subjectMap;xe("component",e=e),ce("component",e),_n().componentSubject(n)}function dn(n){function e(e){K(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))}try{Component=ge(Component,e),Behavior=ge(Behavior,e)}catch(e){}}function hn(e,n){var t=e.filter(function(e){return e=e,!!!ke("page")[e]}),e=nn(t).subjectMap;xe("page",e=e),ce("page",e),e=function(n){t.forEach(function(e){var r=je(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(on(this)&&r.next({that:this,param:tn(e),time:ne()}),h(t))return t.apply(this,e)}})();e&&r.addTearDown(e)})},Page=ge(Page,e),dn(e)}function mn(e){var n=e.filter(function(e){return!le(e)}),t=nn(n).subjectMap;xe("route",e=t),ce("route",e),n.forEach(function(i){var e=ae(_n().instance,i,function(o){void 0===o&&(o={}),fe(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:ne()}),H.forEach(function(r){g(o,r,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];fe(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:tn(e)||{}},time:ne()}),h(t)&&t.apply(this,e)}})()})});e&&t[i].addTearDown(e)})}function vn(a,e){var n=e.url,t=e.method,r=e.data,o=e.header,i=e.headers,c={api:a,request:{url:n,method:(n=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&n||"GET"),headers:o||i||{},body:v(r),timestamp:ne()},response:{}};g(e,"complete",function(u){return function(e){var n=c.response.timestamp||ne();c.duration=n-c.request.timestamp,c.completeCallbackTime=te(u,e);var t,r,o,i=e.errMsg||e.errorMessage||e.error;c.response={status:(t=e.status,r=e.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:n,headers:e.header||e.headers||{},body:v(e.data),errMsg:i,timing:_n().buildRequestProfile(e.profile||{})},pe(a).next(c)}})(),g(e,"success",function(n){return function(e){c.response.timestamp=ne(),c.response.status=200,c.successCallbackTime=te(n,e)}})(),g(e,"fail",function(n){return function(e){c.response.timestamp=ne(),c.response.status=-1,c.failCallbackTime=te(n,e)}})()}function bn(e,t){void 0===t&&(t=_n().instance);var n=e.filter(function(e){return!de(e)}),r=nn(n).subjectMap;xe("http",e=r),ce("http",e),n.forEach(function(n){var e=ae(t,n,function(e){vn(n,e)});e&&r[n].addTearDown(e)})}var gn,ie=y((gn={},[function(e){if(!ye().platform)throw Error("Not support current Mini Program");if(!Array.isArray(e)||!e.length)return null;e=e.find(function(e){return e.platform===ye().platform});return e&&(gn=e.adapterCtor())},function(){return gn}]),2),yn=ie[0],_n=ie[1],wn=function(e){return"SLARDAR"+e},Sn=function(e){try{return _n().getStorage(e)}catch(e){return}},En=["darwin","macs","mac"],xn=["windows_nt","windows","window"],kn=function(e){return fn(e)?"Android":"ios"===e.toLowerCase()?"iOS":~En.indexOf(e.toLowerCase())?"Mac":~xn.indexOf(e.toLowerCase())?"windows":"unknown"},On=function(e){var n=e.systemPlatform,t=e.pixelRatio,r=e.width,e=e.height;return n&&fn(n)&&t?r/t+" * "+e/t:r+" * "+e},jn=function(e){return function(e){var n,t={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t}({domainLookupStart:e.domainLookupStart,domainLookupEnd:e.domainLookupEnd,connectStart:e.connectStart,secureConnectionStart:e.SSLconnectionStart,connectEnd:e.connectEnd,requestStart:e.requestStart,requestEnd:e.requestEnd,responseStart:e.responseStart,responseEnd:e.responseEnd,socketReused:e.socketReused,redirectStart:e.redirectStart,redirectEnd:e.redirectEnd,fetchStart:e.fetchStart,sendBytesCount:e.sendBytesCount,throughputKbps:e.throughputKbps,receivedBytedCount:e.receivedBytedCount})},Se={platform:"wx",adapterCtor:function(){return d(d({},{instance:t=void 0===t?ye().instance:t,request:function(e){return t.request(e)},getStorage:function(e){return t.getStorageSync(e)},setStorage:function(e,n){return t.setStorageSync(e,n)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(e){return e},monitorNetworkType:function(n){t.getNetworkType({success:function(e){n&&n({networkType:e.networkType})}}),t.onNetworkStatusChange(function(e){n&&n({networkType:e.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"wx",buildError:function(e){return c(e)?function(e){e=e.split("\n");return{name:y((e[2]&&e[2].split(":")||[]).map(function(e){return e.trim()}),1)[0],message:e&&e[1]&&e[1].trim(),stack:e.slice(2).join("\n")}}(e):{name:Z,message:v(e)}},getSystemInfo:ln,observePerformance:function(n){var e=wx.getPerformance&&wx.getPerformance();if(e){e=e.createObserver(function(e){e=e.getEntries().map(function(e){return d(d({},e),{name:function(e){switch(e){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return e}}(e.name)})});n(e)});return e.observe({entryTypes:e.supportedEntryTypes}),e}},performanceSubscriber:cn,buildRequestProfile:function(e){return e=jn(n=e),n.protocol&&(e.protocol=n.protocol),e;var n},componentSubject:un,pagePerfSubscriber:an,setDataSubject:sn});var t}},Cn=function(e,n){void 0===n&&(n=J),e.on("init",function(){bn(n)})};function Pn(){var u=on(this),a=he();var e=ae(this,"setData",function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=r[0],i=ne();return[o,function(){var e=r[1],n=ne()-i;a.next({renderTime:n,url:u,data:o,startTime:i}),e&&e.call(t)}]});e&&a.addTearDown(e)}function Tn(){var e;ke("setData")||(e=(e=nn(["setData"]).getSubject)("setData"),Ee("setData",e),se("setData",e))}function Dn(o){return Object.keys(o).reduce(function(e,n){var t,r;return r=o[t=n],t&&r&&(Mn.test(t)||Nn.test(r))||(e[n]=o[n]),e},{})}var In=function(e){e.on("init",function(){Tn(),je("onLoad").subscribe(function(e){e=e.that;Pn.call(e)}),_n().setDataSubject(Pn)})},Rn=function(e){e.on("init",function(){var n,e,t,r=_n();r.observePerformance&&!me()&&(n=(0,nn(["performance"]).getSubject)("performance"),Ee("performance",e=n),se("performance",e),(t=r.observePerformance(function(e){e.forEach(function(e){n.next(e)})}))&&t.disconnect&&n.addTearDown(function(){return t.disconnect()}))})},Mn=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),Nn=new RegExp("(bearer|session)","i"),qn=function(){return function(e,s){var n=e.hookRequest,t=e.hookDownloadFile,r=e.hookUploadFile,f=e.ignoreUrls,l=e.collectBodyOnError,p=e.extraExtractor,e=function(e){var n,t,r,o,i,u,a,c;!function(e,n){e=m(e||[]);return!!e&&e.test(n)}(f,e.request.url)&&(c=e.response,n=e.request,t=e.api,r=e.duration,o=e.failCallbackTime,a=e.successCallbackTime,i=e.completeCallbackTime,n.headers=Dn(n.headers||{}),c.headers=Dn(c.headers||{}),u=c.errMsg,e=function(e,n){var t={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}(c,["errMsg"]),e=d(d({},e),{is_custom_error:!1}),u&&(e.err_msg=u),a={api:t,request:n,duration:r,cbTime:i+(o||0)+(a||0),response:e},!h(p)||(e=p(c.body,a))&&(a.extra=e,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};n&&pe("request").subscribe(e),t&&pe("downloadFile").subscribe(e),r&&pe("uploadFile").subscribe(e)}},Ln=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,_([],y(r),!1));return o&&o(n,t)||[]}catch(e){return C("applyMonitor",e),[]}};function An(e,n,t){be(e);n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return S(n)?d(d({},t),n):!!n&&t}function Bn(e,n){return e&&n&&e===n}function Fn(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!Bn(n.message,t.message)&&!Bn(n.stack,t.stack)))return void(r=e)}catch(e){}var n,t;return r=e}}var zn,Vn="http",Un={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Hn=function(f){return void 0===f&&(f=_n()),function(e,r){var n=e.ignoreErrors,t=e.hookOnError,o=e.hookOnUnhandledRejection,i=e.hookRouteError,u=e.dedupe,a=m(n),c=Fn(),s=function(e,n,t){e=u?c(e):e;e&&(a&&a.test(e.message)||(e={error:e},n&&(e.extra=n),t&&(e.react=t),r(e)))};t&&Oe(A.onError).subscribe(function(e){e=e.param,e=f.buildError(e);a&&a.test(e.message)||s(e)}),o&&Oe(A.onUnhandledRejection).subscribe(function(e){var n=e.param||{},e=n.promise,t=v(n.reason);a&&a.test(t)||e.catch(b).then(function(e){var n={name:"UnhandledRejection",message:t};e&&e.stack&&(n.stack=e.stack),s(n)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Ce(function(e){e=e.param;"fail"===(e=e).name&&s({name:"RouteError",message:e.value.errMsg})}),[s]}};(ie=zn=zn||{}).history="history",ie.manual="manual";function Gn(t,e,r){var o=e,i=null,u=0,n="launch";function a(e,n){o=n,u=ne(),r(n,i=n+"_"+u),t(e,n)}return Oe(A.onShow).pipe(Qe(1)).subscribe(function(){n="show"}),Ce(function(){n="history"}),[a,function(e){e&&(a(n,e),n="history")},function(e){void 0===e&&(e="hide"),i&&(r(o,i),i=null,t(e,o,ne()-u))}]}var Kn=function(){return function(e,r){var n=e.extractPid,t=e.routeMode,o=e.setPidAndViewId,i=function(e){return n?n(e):e},e=y(Gn(function(e,n,t){r({ev_type:"pageview",payload:{pid:n,source:e,duration:t}})},"",o),3),o=e[0],u=e[1],e=e[2];return t!==zn.manual&&(je("onShow").subscribe(function(e){return function(e){e=on(e),e=i(e);u(e)}(e.that)}),je("onUnload").subscribe(e.bind(null,"unload")),je("onHide").subscribe(e.bind(null,"hide"))),[o.bind(null,"user_set"),e]}},Jn=function(){return function(e){var n=y(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=b),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=d(d({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(_(_([],y(o),!1),[e],!1),n):_(_([],y(o),!1),[e],!1))}]}(e.maxBreadcrumbs,e.onAddBreadcrumb,e.onMaxBreadcrumbs),2),e=n[0],r=n[1];return J.forEach(function(e){de(e)&&pe(e).subscribe(function(e){r({type:"http",category:e.api,message:"",data:{method:e.request.method,url:e.request.url,status_code:String(e.response.status)},timestamp:e.request.timestamp})})}),Ce(function(e,n){var t=e.param,e=e.time;"complete"===t.name&&r({type:"route",category:n,message:t.value.errMsg||t.value.errorMessage||"",timestamp:e,data:{url:t.url||""}})}),[e,r]}},Wn=function(){return function(e,t){var r=e.isCalculateSize;he().subscribe(function(e){var n={duration:e.renderTime,start_time:e.startTime};r&&(n.size=(e=e.data,TextEncoder?(new TextEncoder).encode(v(e)).length:2*v(e).length)),t({ev_type:"set_data",payload:n})})}},Yn=function(){return function(e,n){function t(){n({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Oe(A.onLaunch).pipe(Ye(1)).subscribe(function(e){r.activate_start=e.time}),Oe(A.onShow).pipe(Ye(1)).subscribe(function(e){r.init_end=e.time}),je("onLoad").pipe(Ye(1)).subscribe(function(e){r.page_load_start=e.time}),je("onShow").pipe(Ye(1)).subscribe(function(e){r.page_dom_end=e.time});var i=me();je("onReady").pipe(Ye(1)).subscribe(function(e){r.page_render_end=e.time,i&&!r.trigger||t()}),i&&Pe().pipe($e(function(e){return"appClick"===e.name}),Ye(1)).subscribe(function(e){r.trigger=e.startTime,r.page_render_end&&t()}),Oe(A.onHide).subscribe(function(){o||t()})}},$n=function(){return function(e,n){_n().pagePerfSubscriber(function(e){return n({ev_type:"page_perf",payload:e})})}},Qn=function(n){return void 0===n&&(n=_n()),function(e,t){var r,o;me()&&n.performanceSubscriber&&(r=0,je("onLoad").subscribe(function(e){o=e.time,r++}),n.performanceSubscriber(function(e){var n={is_custom:!1,name:e.name,value:e.startTime,type:"perf",count:r};n.duration=e.duration||(o?e.startTime-o:0),n.is_support=0<=n.duration,t({ev_type:"performance",payload:n})}))}},Xn="pageview",Zn={routeMode:zn.history,setPidAndViewId:function(e,n){}},et="jsError",nt={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},rt=function(t){return function(e){var n=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},e),{breadcrumbs:n})})}},ot={maxBreadcrumbs:20,tap:!0},it="breadcrumb",ut=function(n){n.on("init",function(){n.provide("_subscriptions",[]),be(n),n.on("init",function(){rn($),hn(X),pn(Q)}),n.on("init",function(){mn(Y)})}),n.on("beforeDestroy",function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]})},at="setData",ct={isCalculateSize:!1},st="appLaunchPerf",ft={},lt="pagePerf",pt={},dt="performance",ht={},mt=function(e,n,t){void 0===t&&(t=_n());var r=n.url,o=n.data,i=n.success,u=void 0===i?l:i,a=n.fail,c=void 0===a?l:a,i=n.header,a={"Content-Type":"application/json"};K(n=i)&&0!==Object.keys(n).length&&Object.assign(a,i),t.request({method:e,url:r,data:o,header:a,headers:a,success:function(e){u(e)},fail:function(e){e=e.errMsg||"Network request failed";c(new Error(e))}})},vt=function(n){return(n=void 0===n?_n():n)?{get:function(e){return mt("GET",e,n)},post:function(e){return mt("POST",e,n)}}:{get:l,post:l}};function bt(e){return e=wn(String(e)),(e=Sn(e))&&e.userId&&e.deviceId?e:{userId:T(),deviceId:T()}}function gt(e){return e+"_"+Date.now()}function yt(e){var n=e.aid,t=e.userId,e=e.deviceId;!function(e,n){try{_n().setStorage(e,n)}catch(e){}}(wn(String(n)),{userId:t,deviceId:e})}var _t={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:d(d({},e.extra||{}),e.overrides||{})}}},wt="/monitor_mini/collect",St="/settings/minipro",Et="apmplus.volces.com",xt="session",kt={sample_rate:1,include_users:[],sample_granularity:xt,rules:{}},Ot=[wt,St],jt="0.2.4",Ct="APM_PLUS_MINI_PROGRAM",Pt=function(e,n){return void 0===n&&(n=wt),(e&&0<=e.indexOf("//")?"":"https://")+e+n};function Tt(e){e=bt(e.aid);return{aid:0,token:"",pid:"",viewId:gt("_"),userId:e.userId,deviceId:e.deviceId,sessionId:T(),domain:Et,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Ot},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:kt,sdkName:Ct,sdkVersion:jt}}function Dt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!S(t[n])&&(t[n]={});return d(d({},e),{plugins:t})}function It(e){return S(e)&&"aid"in e&&"token"in e}function Rt(e){return d({},e)}var Mt=function(n){var r,o,i=n,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(e){var n,t;return u=d(d({},u),e||{}),s(),r||(r=e,i.useLocalConfig||!i.aid?(o={},c()):a?f():(n=i.domain,e=i.aid,t=function(e){a=e,f()},vt().get({url:function(e,n){return void 0===n&&(n=St),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(n)+"?biz_id="+e,success:function(e){t(e&&e.data&&e.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(e){t=e},onReady:function(e){c=function(){yt(i),e()},o&&c()}};function s(){var e=d(d(d({},n),o||{}),u);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=p(t,e[r++]);return t}(n.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),e.sample=Nt(Nt(n.sample,null==o?void 0:o.sample),u.sample),i=e,t()}function f(){o=function(e){if(!e)return{};var n=e.sample,t=e.user_id,r=e.timestamp,o=t?{userId:t}:{};if(!n)return o;var i=n.sample_rate,e=n.sample_granularity,t=void 0===e?xt:e,e=n.include_users,n=n.rules,n=void 0===n?[]:n;return d(d({},o),{sample:{include_users:e,sample_rate:i,sample_granularity:t,rules:n.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r})}(a),function(e){e=wn(e);return!!_n().getStorage(e)}(String(i.aid))&&(o.userId=n.userId),s(),c()}};function Nt(r,o){if(!r||!o)return r||o;var e=d(d({},r),o);return e.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),e.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=d(d({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=_(_([],y(r.rules[n].conditional_sample_rules||[]),!1),y(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}function qt(e){var n={url:(n=_n().getCurrentPages().pop())?(n?on(n):"")+s(n.options):"",timestamp:ne()};return d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})})}function Lt(e){if(!yn(e))throw Error(U);var t,e=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,u=e.createConfigManager,a=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};w.forEach(function(e){return f[e]=[]});var l=!1,p=!1,d=!1,h=[],m=[],v=D(),b={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(l)k("already inited");else{if(!(e&&S(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=u(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(a(e))),null==r?void 0:r.getConfig()},provide:function(e,n){E(m,e)?k("cannot provide "+e+", reserved"):(b[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(e){return n.build(e)}),h=[]}))},report:function(e){e&&(!(e=O(f.beforeReport)(e))||(e=O(f.report)(e))&&(p?this.build(e):h.push(e)))},build:function(e){!p||(e=O(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=O(f.build)(e))&&this.send(e))},send:function(e){!p||(e=O(f.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){v.clear(),g("beforeDestroy",d=!0)},on:function(e,n){"init"===e&&l||"start"===e&&p||"beforeDestroy"===e&&d?n():f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=x(f[e],n))},destroyAgent:v},m=Object.keys(b);return b;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[e].forEach(function(e){try{e.apply(void 0,_([],y(t),!1))}catch(e){}}),n&&(f[e].length=0)}}({validateInitConfig:It,initConfigNormalizer:Dt,userConfigNormalizer:Rt,createSender:function(e){return n({size:G,endpoint:Pt(e.domain),transport:vt()})},builder:_t,createDefaultConfig:Tt,createConfigManager:Mt});return I(e),Vt(e),Bt(e),Ft(e),B(e),ut(e),(t=e).on("init",function(){var n=[],e=t.config();e&&e.integrations&&e.integrations.forEach(function(e){E(n,e.name)||(n.push(e.name),e.setup(t),e.tearDown&&t.on("beforeDestroy",e.tearDown))})}),zt(e),At(e),e}var At=function(n){function t(e){return void 0===e&&(e=_n().getSystemInfo()),n.set(d({},e))}function r(){t(),e()}var o,i,u=!1,e=(i="",function(){var e=o.getSender();i=i||e.getEndpoint();var n=o.config(),n={did:n.deviceId,sid:n.sessionId,sname:n.sdkName,sver:n.sdkVersion,soffset:n.offset||0,model:n.model,brand:n.brand,ratio:n.pixelRatio,screen:n.screenArea,window:n.windowArea,lang:n.language,osname:n.osName,osver:n.osVersion,libver:n.SDKVersion,scene:n.scene||-1,menv:n.miniEnv,mver:n.miniVersion,hostname:n.hostName,hostver:n.hostVersion,platform:n.platform,biz_id:n.aid,x_auth_token:n.token};e.setEndpoint(i+s(n))});(o=n).on("start",function(){r(),u=!0}),n.on("init",function(){Oe(A.onLaunch).pipe(Ye(1)).subscribe(function(e){e=e.param.scene||-1;t({scene:e}),u&&r()}),_n().monitorNetworkType(function(e){e=e.networkType;n.set({networkType:e})})})},Bt=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,e.network_type=t.networkType,d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})});var n,t})},Ft=function(e){e.on("report",qt)},zt=function(n){n.on("init",function(){Oe(A.onHide).subscribe(function(){var e=n.getSender();e&&e.flush()})})},Vt=function(t){var r,o=!1;t.on("init",function(){r=ne(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=ne())-r<1e3&&n&&(e=n-(e+r)/2,isNaN(e)||t.set({offset:e})))})})},ie=function(e){var n,t,r,i,o,u,a,c,s,e=Lt(e);if(e)return(n=e).provide("sendEvent",function(e){e=z(e);e&&n.report({ev_type:F,payload:e,extra:{timestamp:Date.now()}})}),n.provide("sendLog",function(e){e=V(e);e&&n.report({ev_type:F,payload:e,extra:{timestamp:Date.now()}})}),(t=e).on("init",function(){var e,n=An(t,Xn,Zn);n&&(n=(e=y(Ln(Kn,d(d({},n),{setPidAndViewId:function(e,n){t.set({pid:e,viewId:n,actionId:void 0})}}),t.report.bind(t)),2))[0],e=e[1],t.provide("sendPageview",n),t.provide("sendPageviewWithHide",e))}),(r=e).on("init",function(){var e,n=An(r,et,nt);n&&(e=rt(r),e=y(Ln(Hn,n,e),1)[0],r.provide("captureException",e))}),(i=e).on("init",function(){var e,n,t,r,o=An(i,Vn,Un);o&&(e=o.hookRequest,n=o.hookDownloadFile,t=o.hookUploadFile,r=[],e&&r.push("request"),n&&r.push("downloadFile"),t&&r.push("uploadFile"),Cn(i,r),Ln(qn,o,i.report.bind(i)))}),(o=e).on("init",function(){var e=An(o,at,ct);e&&(In(o),Ln(Wn,e,o.report.bind(o)))}),(u=e).on("init",function(){var e,n=An(u,it,ot);n&&(n=(e=y(Ln(Jn,n,function(e){}),2))[0],e=e[1],u.provide("getBreadcrumbs",n),u.provide("addBreadcrumb",e))}),(a=e).on("init",function(){var e=An(a,st,ft);e&&(Rn(a),Ln(Yn,e,a.report.bind(a)))}),(c=e).on("init",function(){var e=An(c,lt,pt);e&&Ln($n,e,c.report.bind(c))}),(s=e).on("init",function(){var e=An(s,dt,ht);e&&(Rn(s),Ln(Qn,e,s.report.bind(s)))}),e}.bind(null,[Se]),Se=ie();return Se.createClient=ie,Se}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).wxClient=n()}(this,function(){"use strict";function n(e){var t,r=e.transport,o=e.endpoint,n=e.size,i=void 0===n?10:n,e=e.wait,u=void 0===e?1e3:e,a=[],c=0;function s(){var n;a.length&&(n=this.getBatchData(),r.post({url:o,data:n,fail:function(e){t&&t(e,n)}}),a=[])}return{getSize:function(){return i},getWait:function(){return u},setSize:function(e){i=e},setWait:function(e){u=e},getEndpoint:function(){return o},setEndpoint:function(e){o=e},send:function(e){a.push(e),a.length>=i&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),u)},flush:function(){clearTimeout(c),s.call(this)},getBatchData:function(){return a.length?(e=a,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),a=[]},fail:function(e){t=e}}}var r=function(e,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var d=function(){return(d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function y(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,i=t.call(e),u=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function _(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||((r=r||Array.prototype.slice.call(n,0,o))[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var w=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"],l=function(){return{}};function b(e){return e}function S(e){return"object"==typeof e&&null!==e}var t=Object.prototype;function i(e){if(S(e)){if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===t.toString.call(e);e=Object.getPrototypeOf(e);return e===t||null===e}}function u(e){return"[object Array]"===t.toString.call(e)}function h(e){return"function"==typeof e}function a(e){return"number"==typeof e}function c(e){return"string"==typeof e}function p(e,n){var t,r,o=d({},e);for(t in n)r=t,Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[t]&&(S(n[t])&&i(n[t])?o[t]=p(S(e[t])?e[t]:{},n[t]):u(n[t])&&u(e[t])?o[t]=function n(e,t){e=u(e)?e:[];t=u(t)?t:[];return Array.prototype.concat.call(e,t).map(function(e){return e instanceof RegExp?e:S(e)&&i(e)?p({},e):u(e)?n([],e):e})}(e[t],n[t]):o[t]=n[t]);return o}function E(e,n){if(!u(e))return!1;if(0===e.length)return!1;for(var t=0;t<e.length;){if(e[t]===n)return!0;t++}return!1}function x(e,n){if(!u(e))return e;var t=e.indexOf(n);if(0<=t){n=e.slice();return n.splice(t,1),n}return e}function v(e){return u(e)&&e.length?function(e){for(var n=[],t=e.length,r=0;r<t;r++){var o=e[r];c(o)?n.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&n.push(o.source)}return new RegExp(n.join("|"),"i")}(e):null}function m(e){try{return c(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:"+String(e)}}function s(t){return S(t)?Object.keys(t).reduce(function(e,n){return e+="&"+n+"="+t[n]},"").replace("&","?"):""}function k(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.warn.apply(console,_(["[SDK]",Date.now(),j(""+T++)],y(e),!1))}function o(e){return Math.random()<Number(e)}function f(e,n){return e<Number(n)}function O(r){return function(e){for(var n=e,t=0;t<r.length&&n;t++)try{n=r[t](n)}catch(e){P(e)}return n}}var g=function(i,u,a,c){return void 0===c&&(c=!0),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!i)return l;var t=i[u],r=a.apply(void 0,_([t],y(e),!1)),o=r;return h(o)&&c&&(o=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];try{return r.apply(this,n)}catch(e){return h(t)&&t.apply(this,n)}}),i[u]=o,function(e){e||(o===i[u]?i[u]=t:r=t)}}},j="".padStart?function(e,n){return e.padStart(n=void 0===n?8:n," ")}:function(e){return e},C=0,P=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];console.error.apply(console,_(["[SDK]",Date.now(),j(""+C++)],y(e),!1))},T=0;function D(){var e=function(){for(var e=new Array(16),n=0,t=0;t<16;t++)0==(3&t)&&(n=4294967296*Math.random()),e[t]=n>>>((3&t)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var n=[],t=0;t<256;++t)n[t]=(t+256).toString(16).substr(1);var r=0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[+r]],o[e[15]]].join("")}(e)}function I(){function r(e){e.length&&e.forEach(function(e){try{e()}catch(e){}}),e.length=0}function n(e){i[e]&&i[e].forEach(function(e){r(e[1])}),i[e]=void 0}var o=!1,i={};return{set:function(e,n,t){i[e]?i[e].push([n,t]):i[e]=[[n,t]],o&&r(t)},has:function(e){return!!i[e]},remove:n,removeByEvType:function(n){Object.keys(i).forEach(function(e){i[e]&&i[e].forEach(function(e){e[0]===n&&r(e[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(e){n(e)})}}}var R=function(e){var t,r,o,n=(t={},r={},o={set:function(e,n){return t[e]=n,r[e]=m(n),o},merge:function(n){return t=d(d({},t),n),Object.keys(n).forEach(function(e){r[e]=m(n[e])}),o},delete:function(e){return delete t[e],delete r[e],o},clear:function(){return t={},r={},o},get:function(e){return r[e]},toString:function(){return d({},r)}});e.provide("context",n),e.on("report",function(e){return e.extra||(e.extra={}),e.extra.context=n.toString(),e})};function M(r,o){r.on("init",function(){function e(e){e.forEach(function(e){var n=e.name;E(t,n)||(t.push(n),e.setup(r),o&&o(n,e.setup),r.destroyAgent.set(n,n,[function(){t=x(t,n),e.tearDown&&e.tearDown()}]))})}var t=[];r.provide("applyIntegrations",e);var n=r.config();n&&n.integrations&&e(n.integrations)})}function N(e,n){var t=e.common||{};return t.sample_rate=n,e.common=t,e}function q(e,n,t,r,o){return e?(i=o(r,n),function(){return i}):function(){return t(n)};var i}function A(e,n,t,r){if(void 0===(e=function(e,n,t){for(var r,n=y(n.split(".")),o=n[0],i=n.slice(1);e&&0<i.length;)e=e[o],o=(r=y(i))[0],i=r.slice(1);if(e)return t(e,o)}(e,n,function(e,n){return e[n]})))return!1;var o,n="boolean"==typeof e?"bool":a(e)?"number":"string";return function(e,n,t){switch(t){case"eq":return E(n,e);case"neq":return!E(n,e);case"gt":return e>n[0];case"gte":return e>=n[0];case"lt":return e<n[0];case"lte":return e<=n[0];case"regex":return Boolean(e.match(new RegExp(n.join("|"))));case"not_regex":return!e.match(new RegExp(n.join("|")));default:return!1}}(e,(o=n,r.map(function(e){switch(o){case"number":return Number(e);case"boolean":return"1"===e;default:return String(e)}})),t)}function L(n,e){try{return"rule"===e.type?A(n,e.field,e.op,e.values):"and"===e.type?e.children.every(function(e){return L(n,e)}):e.children.some(function(e){return L(n,e)})}catch(e){return!1}}function B(e,n,t,r){if(!n)return b;var o=n.sample_rate,i=n.include_users,u=n.sample_granularity,a=n.rules,n=void 0===(n=n.r)?Math.random():n;if(E(i,e))return function(e){return N(e,1)};var c,s,f,l,p,d,h,v=q(u="session"===u,o,t,n,r),m=(c=a,s=u,f=o,l=t,p=n,d=r,h={},Object.keys(c).forEach(function(e){var n=c[e],t=n.enable,r=n.sample_rate,n=n.conditional_sample_rules;t?(h[e]={enable:t,sample_rate:r,effectiveSampleRate:r*f,hit:q(s,r,l,p,d)},n&&(h[e].conditional_hit_rules=n.map(function(e){var n=e.sample_rate,e=e.filter;return{sample_rate:n,hit:q(s,n,l,p,d),effectiveSampleRate:n*f,filter:e}}))):h[e]={enable:t,hit:function(){return!1},sample_rate:0,effectiveSampleRate:0}}),h);return function(e){if(!v())return!1;if(!(e.ev_type in m))return N(e,o);if(!m[e.ev_type].enable)return!1;if(e.common&&e.common.sample_rate)return e;var n=m[e.ev_type],t=n.conditional_hit_rules;if(t)for(var r=0;r<t.length;r++)if(L(e,t[r].filter))return!!t[r].hit()&&N(e,t[r].effectiveSampleRate);return!!n.hit()&&N(e,n.effectiveSampleRate)}}var F,z=function(t){t.on("start",function(){var e=t.config(),n=e.userId,e=e.sample,e=B(n,e,o,f);t.on("build",e)})},V="custom",U=function(e){if(e&&S(e)&&e.name&&c(e.name)){var n={name:e.name,type:"event"};if("metrics"in e&&S(e.metrics)){var t=e.metrics,r={};for(o in t)a(t[o])&&(r[o]=t[o]);n.metrics=r}if("categories"in e&&S(e.categories)){var o,i=e.categories,u={};for(o in i)u[o]=m(i[o]);n.categories=u}return n}},H=function(e){if(e&&S(e)&&e.content&&c(e.content)){var n={content:m(e.content),type:"log",level:"info"};if("level"in e&&(n.level=e.level),"extra"in e&&S(e.extra)){var t,r=e.extra,o={},i={};for(t in r)a(r[t])?o[t]=r[t]:i[t]=m(r[t]);n.metrics=o,n.categories=i}return n}},G="Adapters imported incorrectly",K=["success","fail","complete"],J=20;(xe=F=F||{}).onLaunch="onLaunch",xe.onShow="onShow",xe.onHide="onHide",xe.onError="onError",xe.onPageNotFound="onPageNotFound",xe.onUnhandledRejection="onUnhandledRejection";function W(e){return"[object Object]"===Object.prototype.toString.call(e)}var Y=["request","downloadFile","uploadFile"],$=["navigateTo","redirectTo","switchTab","reLaunch"],Q=_(_([],y($),!1),["navigateBack"],!1),X=_(_([],y([F.onLaunch,F.onShow,F.onHide]),!1),[F.onError,F.onPageNotFound,F.onUnhandledRejection],!1),Z=["attached","onInit"],ee=["onLoad","onShow","onReady","onUnload","onHide"],ne="unknown_error_name",te="__HOOKED__";var re=function(){return Date.now()};function oe(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!h(e))return 0;var r,o=re();try{e.apply(this,n)}finally{r=re()}return r-o}var ie,ue=function(){},ae=y((ie="tt",[function(){return ie},function(e){return ie=e}]),2),ce=ae[0];ae[1];function se(e,n,r){var o=e[n];if(!o||!o[te])return Object.defineProperty(e,n,{writable:!0,enumerable:!0,configurable:!0,value:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{var t=r.apply(this,e);t&&(e=t)}catch(e){P(e)}return o.apply(this,e)}}),e[n]&&(e[n][te]=!0),function(){e[n][te]=!1,r=ue}}function fe(t,e){Object.keys(e).forEach(function(n){e[n].addTearDown(function(){var e;return Oe(t,((e={})[n]=null,e))})})}function le(e,n){n.addTearDown(function(){return ke(e,null)})}function pe(e){return je("route")[e]}function de(e){return!!je("route")[e]}function he(e){return je("http")[e]}function ve(e){return!!je("http")[e]}function me(){return je("setData")}function be(){return!!je("performance")}function ge(){return je("instance")}function ye(e){ke("instance",e)}var _e=function(n,t){function e(e){return t(e),n.call(this,e)}for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},we=function(){var e={instance:null};return e.instance||("undefined"!=typeof tt?e={instance:tt,platform:ce()}:"undefined"!=typeof my?e={instance:my,platform:"my"}:"undefined"!=typeof swan?e={instance:swan,platform:"swan"}:"undefined"!=typeof wx&&(e={instance:wx,platform:"wx"})),e},Se="__slardar__global__0.2.5-alpha.0",Ee={app:{},page:{},route:{},http:{},component:{},setData:null,performance:null,instance:null},xe=function(e,n){void 0===e&&(e={});var t=(n=void 0===n?we().instance:n)?n[Se]||(n[Se]=e):e;return{setGlobalValue:function(e,n){t[e]=n},mergeGlobalValue:function(e,n){t[e]=d(d({},t[e]),n)},getGlobalValue:function(e){return t[e]},getGlobalEntirely:function(){return t},destroy:function(){t=d({},Ee),n&&(n[Se]=t)}}}(d({},Ee)),ke=xe.setGlobalValue,Oe=xe.mergeGlobalValue,je=xe.getGlobalValue,Ce=function(e){return je("app")[e]},Pe=function(e){return je("page")[e]},Te=function(t,e){(e=void 0===e?Q:e).forEach(function(n){de(n)&&pe(n).subscribe(function(e){return t(e,n)})})},De=function(){return je("performance")},Ie=function(e){return je("component")[e]};function Re(e){return"function"==typeof e}function Me(e,n){!e||0<=(n=e.indexOf(n))&&e.splice(n,1)}function Ne(e){return e}function qe(t){return function(e){if((n=e)&&Re(n.lift))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});var n;throw new TypeError("Unable to lift unknown Observable type")}}function Ae(e){Re(e)?e():null!=e&&e.unsubscribe()}var Le=function(e){return e instanceof Be||e&&"closed"in e&&Re(e.remove)&&Re(e.add)&&Re(e.unsubscribe)},Be=(Fe.prototype.unsubscribe=function(){var e,n,t,r=this;this.closed||(this.closed=!0,e=this._parentage,n=this._finalizers,t=this.initialTeardown,e&&(this._parentage=null,e.forEach(function(e){return e.remove(r)})),Re(t)&&t(),n&&(this._finalizers=null,n.forEach(Ae)))},Fe.prototype.remove=function(e){this._finalizers&&Me(this._finalizers,e),e instanceof Fe&&e._removeParent(this)},Fe.prototype.add=function(e){if(e&&e!==this)if(this.closed)Ae(e);else{if(e instanceof Fe){if(e.closed||e._hasParent(this))return;e._addParent(this)}var n=this._finalizers;this._finalizers=n?(n.push(e),n):[e]}},Fe.prototype._addParent=function(e){var n=this._parentage;this._parentage=n?(n.push(e),n):[e]},Fe.prototype._hasParent=function(e){return this._parentage&&~this._parentage.indexOf(e)},Fe.prototype._removeParent=function(e){this._parentage&&Me(this._parentage,e)},Fe);function Fe(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var ze,Ve=(e(Ue,ze=Be),Ue.prototype.next=function(e){this.isStopped||this.destination.next(e)},Ue.prototype.error=function(e){if(!this.isStopped){this.isStopped=!0;try{this.destination.error(e)}finally{this.unsubscribe()}}},Ue.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Ue.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,ze.prototype.unsubscribe.call(this),this.destination=null)},Ue.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},Ue);function Ue(e){var n=ze.call(this)||this;return n.isStopped=!1,n.destination=Ke(e)?e:new He(!(e=e)||Re(e)?{next:null!=e?e:void 0}:e),n}var He=(Ge.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(e){console.error("ConsumerObserver.next error",e)}},Ge.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(e){console.error("ConsumerObserver.error error",e)}},Ge.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){console.error("ConsumerObserver.complete error",e)}},Ge);function Ge(e){this.partialObserver=e}function Ke(e){return e instanceof Ve||e&&((n=e)&&Re(n.next)&&Re(n.error)&&Re(n.complete))&&Le(e);var n}Je.prototype.subscribe=function(e){var n=Ke(e)?e:new Ve(e),t=this.operator,e=this.source;return n.add(t?t.call(n,e):this._trySubscribe(n)),n},Je.prototype.lift=function(e){var n=new Je;return n.source=this,n.operator=e,n},Je.prototype.pipe=function(){for(var n,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===(n=e).length?Ne:1===n.length?n[0]:function(e){return n.reduce(function(e,n){return n(e)},e)})(this)},Je.prototype._subscribe=function(e){},Je.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(e){n.error(e)}},ae=Je;function Je(e){e&&(this._subscribe=e)}var We,xe=(e(Ye,We=ae),Ye.prototype.next=function(n){this._throwIfClosed(),this.isStopped||this.observers.forEach(function(e){return e.next(n)})},Ye.prototype.commonJudgement=function(e){this._throwIfClosed(),this.isStopped||(this.isStopped=!0,e())},Ye.prototype.error=function(n){var t=this;this.commonJudgement(function(){var e=t.observers;for(t.hasError=!0,t.thrownError=n;e.length;)e.shift().error(n)})},Object.defineProperty(Ye.prototype,"observed",{get:function(){return this.observers&&0<this.observers.length},enumerable:!1,configurable:!0}),Ye.prototype.complete=function(){var n=this;this.commonJudgement(function(){for(var e=n.observers;e.length;)e.shift().complete()})},Ye.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Ye.prototype._throwIfClosed=function(){this.closed&&console.error("current subject is closed")},Ye.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Ye.prototype._checkFinalizedStatuses=function(e){var n=this.hasError,t=this.thrownError,r=this.isStopped;n?e.error(t):r&&e.complete()},Ye.prototype._innerSubscribe=function(e){var n=this.isStopped,t=this.observers;return n?Ye.EMPTY:(t.push(e),new Be(function(){Me(t,e)}))},Ye.EMPTY=((xe=new Be).closed=!0,xe),Ye);function Ye(){var e=null!==We&&We.apply(this,arguments)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}var $e=new ae(function(e){return e.complete()});function Qe(r){return r<=0?function(){return $e}:qe(function(e,n){var t=0;e.subscribe(function(e){++t<=r&&(n.next(e),r<=t&&n.complete())})})}function Xe(r,o){return qe(function(e,n){var t=0;e.subscribe(function(e){return r.call(o,e,t++)&&n.next(e)})})}function Ze(t){return Xe(function(e,n){return t<=n})}var en,nn=(e(tn,en=xe),tn.prototype.subscribe=function(e){var t=this,e=en.prototype.subscribe.call(this,e);ge()&&ge()._subscriptions.push(e);var r=e.unsubscribe;return e.unsubscribe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.apply(this,e),t.observed||t.unsubscribe()},e},tn.prototype.unsubscribe=function(){en.prototype.unsubscribe.call(this),this.tearDownFns.forEach(function(e){return e()})},tn.prototype.addTearDown=function(e){this.tearDownFns.push(e)},tn);function tn(){var e=null!==en&&en.apply(this,arguments)||this;return e.tearDownFns=[],e}function rn(e){var n=e.reduce(function(e,n){return e[n]=new nn,e},{});return{getSubject:function(e){return n[e]},subjectMap:n}}function on(e){return 1<e.length?e:e.length&&e[0]||{}}function un(e){var t=e.filter(function(e){return e=e,!!!je("app")[e]}),e=rn(t).subjectMap;Oe("app",e=e),fe("app",e),App=_e(App,function(n){t.forEach(function(e){var r=Ce(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r.next({that:this,param:on(e),time:re()}),h(t)&&t.apply(this,e)}})();e&&r.addTearDown(e)})})}function an(e){return e.route||e.__route__||e.url||e.path||""}function cn(e){function n(e,i){r.forEach(function(o){g(e,o,function(r){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Ie(o).next({that:this,param:null,time:re()});var t=i[o];if(h(t)&&t.apply(this,e),h(r))return r.apply(this,e)}})()})}var t=["attached"],r=e.filter(function(e){return~t.indexOf(e)});try{Component=_e(Component,function(e){S(e.lifetimes)?n(e.lifetimes,e):void 0!==e.lifetimes&&null!==e.lifetimes||(e.lifetimes={},n(e.lifetimes,e))})}catch(e){}}function sn(e){function n(){r.navigate_name=r.navigate_name||"native",r.load_start=r.load_start||0,r.dom_end=r.dom_end||0,r.render_end=r.render_end||0}function t(){r.navigate_start&&(e(d({},r)),r.navigate_name="",r.navigate_start=0,o=!0)}var r={},o=null;Te(function(e,n){"invoke"===e.param.name&&(o=!1,r={navigate_start:e.time,navigate_name:n})},$),Pe("onLoad").pipe(Ze(1)).subscribe(function(e){r.load_start=e.time}),Pe("onShow").pipe(Ze(1)).subscribe(function(e){r.dom_end=e.time}),Pe("onReady").pipe(Ze(1)).subscribe(function(e){r.render_end=e.time,n(),t()}),Ce(F.onHide).subscribe(function(){!1===o&&(n(),t())})}function fn(n){var t=["downloadPackage","evaluateScript","fcp","fp","fr"];De().subscribe(function(e){~t.indexOf(e.name)&&n(e)})}function ln(n){Ie("attached").subscribe(function(e){e=e.that;return n.call(e)})}function pn(e){return"android"===e.toLowerCase()}function dn(){var e=wx.getAccountInfoSync().miniProgram,n=(p=wx.getSystemInfoSync()).model,t=p.brand,r=p.pixelRatio,o=p.screenHeight,i=p.screenWidth,u=p.windowHeight,a=p.windowWidth,c=p.language,s=p.version,f=p.system,l=p.platform,p=p.SDKVersion;return{model:n,brand:t,pixelRatio:r,screenArea:Cn({width:i,height:o}),windowArea:Cn({width:a,height:u}),language:c,osName:jn(l),osVersion:f,SDKVersion:p,appId:e.appId,miniEnv:e.envVersion,miniVersion:e.version,hostName:"wx",hostVersion:s,platform:"wx"}}function hn(e){var n=e.filter(function(e){return e=e,!!!je("component")[e]}),e=rn(n).subjectMap;Oe("component",e=e),fe("component",e),Sn().componentSubject(n)}function vn(n){function e(e){W(e.methods)?n(e.methods):void 0!==e.methods&&null!==e.methods||(e.methods={},n(e.methods))}try{Component=_e(Component,e),Behavior=_e(Behavior,e)}catch(e){}}function mn(e,n){var t=e.filter(function(e){return e=e,!!!je("page")[e]}),e=rn(t).subjectMap;Oe("page",e=e),fe("page",e),e=function(n){t.forEach(function(e){var r=Pe(e),e=g(n,e,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(an(this)&&r.next({that:this,param:on(e),time:re()}),h(t))return t.apply(this,e)}})();e&&r.addTearDown(e)})},Page=_e(Page,e),vn(e)}function bn(e){var n=e.filter(function(e){return!de(e)}),t=rn(n).subjectMap;Oe("route",e=t),fe("route",e),n.forEach(function(i){var e=se(Sn().instance,i,function(o){void 0===o&&(o={}),pe(i).next({that:this,param:{url:o.url,delta:o.delta,name:"invoke",value:{errMsg:"invoke"}},time:re()}),K.forEach(function(r){g(o,r,function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];pe(i).next({that:this,param:{url:o.url,delta:o.delta,name:r,value:on(e)||{}},time:re()}),h(t)&&t.apply(this,e)}})()})});e&&t[i].addTearDown(e)})}function gn(a,e){var n=e.url,t=e.method,r=e.data,o=e.header,i=e.headers,c={api:a,request:{url:n,method:(n=t,"uploadFile"===(t=a)?"POST":"downloadFile"!==t&&n||"GET"),headers:o||i||{},body:m(r),timestamp:re()},response:{}};g(e,"complete",function(u){return function(e){var n=c.response.timestamp||re();c.duration=n-c.request.timestamp,c.completeCallbackTime=oe(u,e);var t,r,o,i=e.errMsg||e.errorMessage||e.error;c.response={status:(t=e.status,r=e.statusCode,o=c.response.status,0<=t?t:0<=r?r:o),timestamp:n,headers:e.header||e.headers||{},body:m(e.data),errMsg:i,timing:Sn().buildRequestProfile(e.profile||{})},he(a).next(c)}})(),g(e,"success",function(n){return function(e){c.response.timestamp=re(),c.response.status=200,c.successCallbackTime=oe(n,e)}})(),g(e,"fail",function(n){return function(e){c.response.timestamp=re(),c.response.status=-1,c.failCallbackTime=oe(n,e)}})()}function yn(e,t){void 0===t&&(t=Sn().instance);var n=e.filter(function(e){return!ve(e)}),r=rn(n).subjectMap;Oe("http",e=r),fe("http",e),n.forEach(function(n){var e=se(t,n,function(e){gn(n,e)});e&&r[n].addTearDown(e)})}var _n,ae=y((_n={},[function(e){if(!we().platform)throw Error("Not support current Mini Program");if(!Array.isArray(e)||!e.length)return null;e=e.find(function(e){return e.platform===we().platform});return e&&(_n=e.adapterCtor())},function(){return _n}]),2),wn=ae[0],Sn=ae[1],En=function(e){return"SLARDAR"+e},xn=function(e){try{return Sn().getStorage(e)}catch(e){return}},kn=["darwin","macs","mac"],On=["windows_nt","windows","window"],jn=function(e){return pn(e)?"Android":"ios"===e.toLowerCase()?"iOS":~kn.indexOf(e.toLowerCase())?"Mac":~On.indexOf(e.toLowerCase())?"windows":"unknown"},Cn=function(e){var n=e.systemPlatform,t=e.pixelRatio,r=e.width,e=e.height;return n&&pn(n)&&t?r/t+" * "+e/t:r+" * "+e},Pn=function(e){return function(e){var n,t={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t}({domainLookupStart:e.domainLookupStart,domainLookupEnd:e.domainLookupEnd,connectStart:e.connectStart,secureConnectionStart:e.SSLconnectionStart,connectEnd:e.connectEnd,requestStart:e.requestStart,requestEnd:e.requestEnd,responseStart:e.responseStart,responseEnd:e.responseEnd,socketReused:e.socketReused,redirectStart:e.redirectStart,redirectEnd:e.redirectEnd,fetchStart:e.fetchStart,sendBytesCount:e.sendBytesCount,throughputKbps:e.throughputKbps,receivedBytedCount:e.receivedBytedCount})},xe={platform:"wx",adapterCtor:function(){return d(d({},{instance:t=void 0===t?we().instance:t,request:function(e){return t.request(e)},getStorage:function(e){return t.getStorageSync(e)},setStorage:function(e,n){return t.setStorageSync(e,n)},getCurrentPages:function(){return getCurrentPages()},buildHttpPayload:function(e){return e},monitorNetworkType:function(n){t.getNetworkType({success:function(e){n&&n({networkType:e.networkType})}}),t.onNetworkStatusChange(function(e){n&&n({networkType:e.networkType})})},performanceSubscriber:l,getSystemInfo:l,buildRequestProfile:l,componentSubject:l,setDataSubject:l,pagePerfSubscriber:l}),{miniPlatform:"wx",buildError:function(e){return c(e)?function(e){e=e.split("\n");return{name:y((e[2]&&e[2].split(":")||[]).map(function(e){return e.trim()}),1)[0],message:e&&e[1]&&e[1].trim(),stack:e.slice(2).join("\n")}}(e):{name:ne,message:m(e)}},getSystemInfo:dn,observePerformance:function(n){var e=wx.getPerformance&&wx.getPerformance();if(e){e=e.createObserver(function(e){e=e.getEntries().map(function(e){return d(d({},e),{name:function(e){switch(e){case"appLaunch":return"appClick";case"firstRender":return"fr";case"firstPaint":return"fp";case"firstContentfulPaint":return"fcp";case"largestContentfulPaint":return"lcp";default:return e}}(e.name)})});n(e)});return e.observe({entryTypes:e.supportedEntryTypes}),e}},performanceSubscriber:fn,buildRequestProfile:function(e){return e=Pn(n=e),n.protocol&&(e.protocol=n.protocol),e;var n},componentSubject:cn,pagePerfSubscriber:sn,setDataSubject:ln});var t}},Tn=function(e,n){void 0===n&&(n=Y),e.on("init",function(){yn(n)})};function Dn(){var u=an(this),a=me();var e=se(this,"setData",function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var o=r[0],i=re();return[o,function(){var e=r[1],n=re()-i;a.next({renderTime:n,url:u,data:o,startTime:i}),e&&e.call(t)}]});e&&a.addTearDown(e)}function In(){var e;je("setData")||(e=(e=rn(["setData"]).getSubject)("setData"),ke("setData",e),le("setData",e))}function Rn(o){return Object.keys(o).reduce(function(e,n){var t,r;return r=o[t=n],t&&r&&(qn.test(t)||An.test(r))||(e[n]=o[n]),e},{})}var Mn=function(e){e.on("init",function(){In(),Pe("onLoad").subscribe(function(e){e=e.that;Dn.call(e)}),Sn().setDataSubject(Dn)})},Nn=function(e){e.on("init",function(){var n,e,t,r=Sn();r.observePerformance&&!be()&&(n=(0,rn(["performance"]).getSubject)("performance"),ke("performance",e=n),le("performance",e),(t=r.observePerformance(function(e){e.forEach(function(e){n.next(e)})}))&&t.disconnect&&n.addTearDown(function(){return t.disconnect()}))})},qn=new RegExp("(cookie|auth|jwt|token|key|ticket|secret|credential|session|password)","i"),An=new RegExp("(bearer|session)","i"),Ln=function(){return function(e,s){var n=e.hookRequest,t=e.hookDownloadFile,r=e.hookUploadFile,f=e.ignoreUrls,l=e.collectBodyOnError,p=e.extraExtractor,e=function(e){var n,t,r,o,i,u,a,c;!function(e,n){e=v(e||[]);return!!e&&e.test(n)}(f,e.request.url)&&(c=e.response,n=e.request,t=e.api,r=e.duration,o=e.failCallbackTime,a=e.successCallbackTime,i=e.completeCallbackTime,n.headers=Rn(n.headers||{}),c.headers=Rn(c.headers||{}),u=c.errMsg,e=function(e,n){var t={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(t[o[r]]=e[o[r]]);return t}(c,["errMsg"]),e=d(d({},e),{is_custom_error:!1}),u&&(e.err_msg=u),a={api:t,request:n,duration:r,cbTime:i+(o||0)+(a||0),response:e},!h(p)||(e=p(c.body,a))&&(a.extra=e,a.response.is_custom_error=!0),l&&(0===(c=c.status)||400<=c)||(delete a.request.body,delete a.response.body),s({ev_type:"http",payload:a}))};n&&he("request").subscribe(e),t&&he("downloadFile").subscribe(e),r&&he("uploadFile").subscribe(e)}},Bn=function(e,n,t,r){void 0===n&&(n={}),void 0===r&&(r=[]);try{var o=e.apply(void 0,_([],y(r),!1));return o&&o(n,t)||[]}catch(e){return P("applyMonitor",e),[]}};function Fn(e,n,t){ye(e);n=null===(e=e.config())||void 0===e?void 0:e.plugins[n];return S(n)?d(d({},t),n):!!n&&t}function zn(e,n){return e&&n&&e===n}function Vn(){var r;return function(e){try{if(t=r,!(!(n=e)||!t)&&!(!zn(n.message,t.message)&&!zn(n.stack,t.stack)))return void(r=e)}catch(e){}var n,t;return r=e}}var Un,Hn="http",Gn={hookRequest:!0,hookDownloadFile:!0,hookUploadFile:!0,ignoreUrls:[],collectBodyOnError:!1},Kn=function(f){return void 0===f&&(f=Sn()),function(e,r){var n=e.ignoreErrors,t=e.hookOnError,o=e.hookOnUnhandledRejection,i=e.hookRouteError,u=e.dedupe,a=v(n),c=Vn(),s=function(e,n,t){e=u?c(e):e;e&&(a&&a.test(e.message)||(e={error:e},n&&(e.extra=n),t&&(e.react=t),r(e)))};t&&Ce(F.onError).subscribe(function(e){e=e.param,e=f.buildError(e);a&&a.test(e.message)||s(e)}),o&&Ce(F.onUnhandledRejection).subscribe(function(e){var n=e.param||{},e=n.promise,t=m(n.reason);a&&a.test(t)||e.catch(b).then(function(e){var n={name:"UnhandledRejection",message:t};e&&e.stack&&(n.stack=e.stack),s(n)})});return i&&~["tt","wx","lark"].indexOf(f.miniPlatform)&&Te(function(e){e=e.param;"fail"===(e=e).name&&s({name:"RouteError",message:e.value.errMsg})}),[s]}};(ae=Un=Un||{}).history="history",ae.manual="manual";function Jn(t,e,r){var o=e,i=null,u=0,n="launch";function a(e,n){o=n,u=re(),r(n,i=n+"_"+u),t(e,n)}return Ce(F.onShow).pipe(Ze(1)).subscribe(function(){n="show"}),Te(function(){n="history"}),[a,function(e){e&&(a(n,e),n="history")},function(e){void 0===e&&(e="hide"),i&&(r(o,i),i=null,t(e,o,re()-u))}]}var Wn=function(){return function(e,r){var n=e.extractPid,t=e.routeMode,o=e.setPidAndViewId,i=function(e){return n?n(e):e},e=y(Jn(function(e,n,t){r({ev_type:"pageview",payload:{pid:n,source:e,duration:t}})},"",o),3),o=e[0],u=e[1],e=e[2];return t!==Un.manual&&(Pe("onShow").subscribe(function(e){return function(e){e=an(e),e=i(e);u(e)}(e.that)}),Pe("onUnload").subscribe(e.bind(null,"unload")),Pe("onHide").subscribe(e.bind(null,"hide"))),[o.bind(null,"user_set"),e]}},Yn=function(){return function(e){var n=y(function(n,t,r){void 0===n&&(n=20),void 0===t&&(t=b),void 0===r&&(r=function(e,n){return e.slice(-n)});var o=[];return[function(){return o},function(e){t(e)&&(e=d(d({},e),{timestamp:e.timestamp||Date.now()}),o=0<=n&&o.length+1>n?r(_(_([],y(o),!1),[e],!1),n):_(_([],y(o),!1),[e],!1))}]}(e.maxBreadcrumbs,e.onAddBreadcrumb,e.onMaxBreadcrumbs),2),e=n[0],r=n[1];return Y.forEach(function(e){ve(e)&&he(e).subscribe(function(e){r({type:"http",category:e.api,message:"",data:{method:e.request.method,url:e.request.url,status_code:String(e.response.status)},timestamp:e.request.timestamp})})}),Te(function(e,n){var t=e.param,e=e.time;"complete"===t.name&&r({type:"route",category:n,message:t.value.errMsg||t.value.errorMessage||"",timestamp:e,data:{url:t.url||""}})}),[e,r]}},$n=function(){return function(e,t){var r=e.isCalculateSize;me().subscribe(function(e){var n={duration:e.renderTime,start_time:e.startTime};r&&(n.size=(e=e.data,TextEncoder?(new TextEncoder).encode(m(e)).length:2*m(e).length)),t({ev_type:"set_data",payload:n})})}},Qn=function(){return function(e,n){function t(){n({ev_type:"app_launch_perf",payload:r}),o=!0}var r={activate_start:0,init_end:0,page_load_start:0,page_dom_end:0,page_render_end:0},o=!1;Ce(F.onLaunch).pipe(Qe(1)).subscribe(function(e){r.activate_start=e.time}),Ce(F.onShow).pipe(Qe(1)).subscribe(function(e){r.init_end=e.time}),Pe("onLoad").pipe(Qe(1)).subscribe(function(e){r.page_load_start=e.time}),Pe("onShow").pipe(Qe(1)).subscribe(function(e){r.page_dom_end=e.time});var i=be();Pe("onReady").pipe(Qe(1)).subscribe(function(e){r.page_render_end=e.time,i&&!r.trigger||t()}),i&&De().pipe(Xe(function(e){return"appClick"===e.name}),Qe(1)).subscribe(function(e){r.trigger=e.startTime,r.page_render_end&&t()}),Ce(F.onHide).subscribe(function(){o||t()})}},Xn=function(){return function(e,n){Sn().pagePerfSubscriber(function(e){return n({ev_type:"page_perf",payload:e})})}},Zn=function(n){return void 0===n&&(n=Sn()),function(e,t){var r,o;be()&&n.performanceSubscriber&&(r=0,Pe("onLoad").subscribe(function(e){o=e.time,r++}),n.performanceSubscriber(function(e){var n={is_custom:!1,name:e.name,value:e.startTime,type:"perf",count:r};n.duration=e.duration||(o?e.startTime-o:0),n.is_support=0<=n.duration,t({ev_type:"performance",payload:n})}))}},et="pageview",nt={routeMode:Un.history,setPidAndViewId:function(e,n){}},rt="jsError",ot={ignoreErrors:[],hookOnError:!0,hookOnUnhandledRejection:!0,hookRouteError:!0,dedupe:!0},it=function(t){return function(e){var n=t.getBreadcrumbs&&t.getBreadcrumbs()||[];t.report({ev_type:"js_error",payload:d(d({},e),{breadcrumbs:n})})}},ut={maxBreadcrumbs:20,tap:!0},at="breadcrumb",ct=function(n){n.on("init",function(){n.provide("_subscriptions",[]),ye(n),n.on("init",function(){un(X),mn(ee),hn(Z)}),n.on("init",function(){bn(Q)})}),n.on("beforeDestroy",function(){if(n._subscriptions)for(;n._subscriptions.length;)n._subscriptions.shift().unsubscribe();for(var e in n)delete n[e]})},st="setData",ft={isCalculateSize:!1},lt="appLaunchPerf",pt={},dt="pagePerf",ht={},vt="performance",mt={},bt=function(e,n,t){void 0===t&&(t=Sn());var r=n.url,o=n.data,i=n.success,u=void 0===i?l:i,a=n.fail,c=void 0===a?l:a,i=n.header,a={"Content-Type":"application/json"};W(n=i)&&0!==Object.keys(n).length&&Object.assign(a,i),t.request({method:e,url:r,data:o,header:a,headers:a,success:function(e){u(e)},fail:function(e){e=e.errMsg||"Network request failed";c(new Error(e))}})},gt=function(n){return(n=void 0===n?Sn():n)?{get:function(e){return bt("GET",e,n)},post:function(e){return bt("POST",e,n)}}:{get:l,post:l}};function yt(e){return e=En(String(e)),(e=xn(e))&&e.userId&&e.deviceId?e:{userId:D(),deviceId:D()}}function _t(e){return e+"_"+Date.now()}function wt(e){var n=e.aid,t=e.userId,e=e.deviceId;!function(e,n){try{Sn().setStorage(e,n)}catch(e){}}(En(String(n)),{userId:t,deviceId:e})}var St={build:function(e){return{ev_type:e.ev_type,payload:e.payload,common:d(d({},e.extra||{}),e.overrides||{})}}},Et="/monitor_mini/collect",xt="/settings/minipro",kt="apmplus.volces.com",Ot="session",jt={sample_rate:1,include_users:[],sample_granularity:Ot,rules:{}},Ct=[Et,xt],Pt="0.2.5-alpha.0",Tt="APM_PLUS_MINI_PROGRAM",Dt=function(e,n){return void 0===n&&(n=Et),(e&&0<=e.indexOf("//")?"":"https://")+e+n};function It(e){e=yt(e.aid);return{aid:0,token:"",pid:"",viewId:_t("_"),userId:e.userId,deviceId:e.deviceId,sessionId:D(),domain:kt,plugins:{breadcrumb:{},pageview:{},jsError:{},http:{ignoreUrls:Ct},setData:{},appLaunchPerf:{},pagePerf:{},performance:{}},sample:jt,sdkName:Tt,sdkVersion:Pt}}function Rt(e){var n,t=e.plugins||{};for(n in t)t[n]&&!S(t[n])&&(t[n]={});return d(d({},e),{plugins:t})}function Mt(e){return S(e)&&"aid"in e&&"token"in e}function Nt(e){return d({},e)}var qt=function(n){var r,o,i=n,u={},a=void 0,c=l,t=l;return{getConfig:function(){return i},setConfig:function(e){var n,t;return u=d(d({},u),e||{}),s(),r||(r=e,i.useLocalConfig||!i.aid?(o={},c()):a?f():(n=i.domain,e=i.aid,t=function(e){a=e,f()},gt().get({url:function(e,n){return void 0===n&&(n=xt),(e&&0<=e.indexOf("//")?"":"https://")+e+n}(n)+"?biz_id="+e,success:function(e){t(e&&e.data&&e.data.data||{})},fail:function(){t({sample:{sample_rate:.001}})}}))),i},onChange:function(e){t=e},onReady:function(e){c=function(){wt(i),e()},o&&c()}};function s(){var e=d(d(d({},n),o||{}),u);e.plugins=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var t={},r=0;r<e.length;)t=p(t,e[r++]);return t}(n.plugins,(null==o?void 0:o.plugins)||{},u.plugins||{}),e.sample=At(At(n.sample,null==o?void 0:o.sample),u.sample),i=e,t()}function f(){o=function(e){if(!e)return{};var n=e.sample,t=e.user_id,r=e.timestamp,o=t?{userId:t}:{};if(!n)return o;var i=n.sample_rate,e=n.sample_granularity,t=void 0===e?Ot:e,e=n.include_users,n=n.rules,n=void 0===n?[]:n;return d(d({},o),{sample:{include_users:e,sample_rate:i,sample_granularity:t,rules:n.reduce(function(e,n){var t=n.name,r=n.enable,o=n.sample_rate,n=n.conditional_sample_rules;return e[t]={enable:r,sample_rate:o,conditional_sample_rules:n},e},{})},serverTimestamp:r})}(a),function(e){e=En(e);return!!Sn().getStorage(e)}(String(i.aid))&&(o.userId=n.userId),s(),c()}};function At(r,o){if(!r||!o)return r||o;var e=d(d({},r),o);return e.include_users=_(_([],y(r.include_users||[]),!1),y(o.include_users||[]),!1),e.rules=_(_([],y(Object.keys(r.rules||{})),!1),y(Object.keys(o.rules||{})),!1).reduce(function(e,n){var t;return n in e||(n in(r.rules||{})&&n in(o.rules||{})?(e[n]=d(d({},r.rules[n]),o.rules[n]),e[n].conditional_sample_rules=_(_([],y(r.rules[n].conditional_sample_rules||[]),!1),y(o.rules[n].conditional_sample_rules||[]),!1)):e[n]=(null===(t=r.rules)||void 0===t?void 0:t[n])||(null===(t=o.rules)||void 0===t?void 0:t[n])),e},{}),e}function Lt(e){var n={url:(n=Sn().getCurrentPages().pop())?(n?an(n):"")+s(n.options):"",timestamp:re()};return d(d({},e),{extra:d(d({},n),null!==(e=e.extra)&&void 0!==e?e:{})})}function Bt(e){if(!wn(e))throw Error(G);return e=function(e){var t,r,n=e.builder,o=e.createSender,i=e.createDefaultConfig,u=e.createConfigManager,a=e.userConfigNormalizer,c=e.initConfigNormalizer,s=e.validateInitConfig,f={};w.forEach(function(e){return f[e]=[]});var l=!1,p=!1,d=!1,h=[],v=[],m=I(),b={getBuilder:function(){return n},getSender:function(){return t},getPreStartQueue:function(){return h},init:function(e){if(l)k("already inited");else{if(!(e&&S(e)&&s(e)))throw new Error("invalid InitConfig, init failed");var n=i(e);if(!n)throw new Error("defaultConfig missing");e=c(e);if((r=u(n)).setConfig(e),r.onChange(function(){g("config")}),!(t=o(r.getConfig())))throw new Error("sender missing");g("init",l=!0)}},set:function(e){l&&e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(e))},config:function(e){if(l)return e&&S(e)&&(g("beforeConfig",!1,e),null!=r&&r.setConfig(a(e))),null==r?void 0:r.getConfig()},provide:function(e,n){E(v,e)?k("cannot provide "+e+", reserved"):(b[e]=n,g("provide",!1,e))},start:function(){var n=this;l&&(p||null!=r&&r.onReady(function(){g("start",p=!0),h.forEach(function(e){return n.build(e)}),h.length=0}))},report:function(e){e&&(!(e=O(f.beforeReport)(e))||(e=O(f.report)(e))&&(p?this.build(e):h.push(e)))},build:function(e){!p||(e=O(f.beforeBuild)(e))&&(!(e=n.build(e))||(e=O(f.build)(e))&&this.send(e))},send:function(e){!p||(e=O(f.beforeSend)(e))&&(t.send(e),g("send",!1,e))},destroy:function(){m.clear(),d=!0,g("beforeDestroy",!(h.length=0))},on:function(e,n){if("init"===e&&l||"start"===e&&p||"beforeDestroy"===e&&d)try{n()}catch(e){}else f[e]&&f[e].push(n)},off:function(e,n){f[e]&&(f[e]=x(f[e],n))},destroyAgent:m},v=Object.keys(b);return b;function g(e,n){void 0===n&&(n=!1);for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];f[e].forEach(function(e){try{e.apply(void 0,_([],y(t),!1))}catch(e){}}),n&&(f[e].length=0)}}({validateInitConfig:Mt,initConfigNormalizer:Rt,userConfigNormalizer:Nt,createSender:function(e){return n({size:J,endpoint:Dt(e.domain),transport:gt()})},builder:St,createDefaultConfig:It,createConfigManager:qt}),R(e),Ht(e),zt(e),Vt(e),z(e),ct(e),M(e),Ut(e),Ft(e),e}var Ft=function(n){function t(e){return void 0===e&&(e=Sn().getSystemInfo()),n.set(d({},e))}function r(){t(),e()}var o,i,u=!1,e=(i="",function(){var e=o.getSender();i=i||e.getEndpoint();var n=o.config(),n={did:n.deviceId,sid:n.sessionId,sname:n.sdkName,sver:n.sdkVersion,soffset:n.offset||0,model:n.model,brand:n.brand,ratio:n.pixelRatio,screen:n.screenArea,window:n.windowArea,lang:n.language,osname:n.osName,osver:n.osVersion,libver:n.SDKVersion,scene:n.scene||-1,menv:n.miniEnv,mver:n.miniVersion,hostname:n.hostName,hostver:n.hostVersion,platform:n.platform,biz_id:n.aid,x_auth_token:n.token};e.setEndpoint(i+s(n))});(o=n).on("start",function(){r(),u=!0}),n.on("init",function(){Ce(F.onLaunch).pipe(Qe(1)).subscribe(function(e){e=e.param.scene||-1;t({scene:e}),u&&r()}),Sn().monitorNetworkType(function(e){e=e.networkType;n.set({networkType:e})})})},zt=function(r){r.on("beforeBuild",function(e){return n=e,t=r.config(),(e={}).aid=t.aid,e.pid=t.pid,e.view_id=t.viewId,e.user_id=t.userId,e.network_type=t.networkType,d(d({},n),{extra:d(d({},e),null!==(n=n.extra)&&void 0!==n?n:{})});var n,t})},Vt=function(e){e.on("report",Lt)},Ut=function(n){n.on("init",function(){Ce(F.onHide).subscribe(function(){var e=n.getSender();e&&e.flush()})})},Ht=function(t){var r,o=!1;t.on("init",function(){r=re(),t.on("config",function(){var e,n=null===(e=t.config())||void 0===e?void 0:e.serverTimestamp;isNaN(n)||Number(n)<=0||o||(o=!0,(e=re())-r<1e3&&n&&(e=n-(e+r)/2,isNaN(e)||t.set({offset:e})))})})},ae=function(e){var n,t,r,i,o,u,a,c,s,e=Bt(e);if(e)return(n=e).provide("sendEvent",function(e){e=U(e);e&&n.report({ev_type:V,payload:e,extra:{timestamp:Date.now()}})}),n.provide("sendLog",function(e){e=H(e);e&&n.report({ev_type:V,payload:e,extra:{timestamp:Date.now()}})}),(t=e).on("init",function(){var e,n=Fn(t,et,nt);n&&(n=(e=y(Bn(Wn,d(d({},n),{setPidAndViewId:function(e,n){t.set({pid:e,viewId:n,actionId:void 0})}}),t.report.bind(t)),2))[0],e=e[1],t.provide("sendPageview",n),t.provide("sendPageviewWithHide",e))}),(r=e).on("init",function(){var e,n=Fn(r,rt,ot);n&&(e=it(r),e=y(Bn(Kn,n,e),1)[0],r.provide("captureException",e))}),(i=e).on("init",function(){var e,n,t,r,o=Fn(i,Hn,Gn);o&&(e=o.hookRequest,n=o.hookDownloadFile,t=o.hookUploadFile,r=[],e&&r.push("request"),n&&r.push("downloadFile"),t&&r.push("uploadFile"),Tn(i,r),Bn(Ln,o,i.report.bind(i)))}),(o=e).on("init",function(){var e=Fn(o,st,ft);e&&(Mn(o),Bn($n,e,o.report.bind(o)))}),(u=e).on("init",function(){var e,n=Fn(u,at,ut);n&&(n=(e=y(Bn(Yn,n,function(e){}),2))[0],e=e[1],u.provide("getBreadcrumbs",n),u.provide("addBreadcrumb",e))}),(a=e).on("init",function(){var e=Fn(a,lt,pt);e&&(Nn(a),Bn(Qn,e,a.report.bind(a)))}),(c=e).on("init",function(){var e=Fn(c,dt,ht);e&&Bn(Xn,e,c.report.bind(c))}),(s=e).on("init",function(){var e=Fn(s,vt,mt);e&&(Nn(s),Bn(Zn,e,s.report.bind(s)))}),e}.bind(null,[xe]),xe=ae();return xe.createClient=ae,xe}); |
{ | ||
"name": "@apmplus/mini-program", | ||
"version": "0.2.4", | ||
"version": "0.2.5-alpha.0", | ||
"description": "apmplus for mini program", | ||
@@ -16,5 +16,5 @@ "main": "cn/index.cjs.js", | ||
"@slardar/mini-program-types": "0.0.0", | ||
"@slardar/rollup": "0.0.3-alpha.0", | ||
"@slardar/sdk-mini-program": "0.0.18", | ||
"@slardar/sdk-template": "1.2.0" | ||
"@slardar/rollup": "0.0.3", | ||
"@slardar/sdk-mini-program": "0.0.24-alpha.0", | ||
"@slardar/sdk-template": "1.5.1-alpha.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "ava": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
687052
3683