@conecli/cone-render 0.8.15-alpha.23 → 0.8.15-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  urlCookie
2
+ import Taro from '@tarojs/taro'
3
3
  urlCookie
4
4
  public config: object | null
5
5
  this.config = {}
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
2
2
  public config: object | null
3
3
  this.config = {}
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  console.log('=================>', 'updateBusinessDomainAndApi')
2
+ import Taro from '@tarojs/taro'
3
3
  public config: object | null
4
4
  this.config = {}
5
5
  console.log('=================>', 'updateBusinessDomainAndApi')
@@ -1 +1 @@
1
- import React from 'react'
1
+ import React from 'react'
@@ -1 +1 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react'
2
1
  const [componentShowState, setComponentShowState] = useState(false)
3
2
  const componentLazyRef = useRef<HTMLElement | null>(null)
4
3
  const componentShowStateRef = useRef(false)
5
4
  useEffect(() => {
6
5
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
7
6
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
8
7
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
9
8
  !componentShowStateRef.current && dealPageScrollInfo(res)
10
9
  })
11
10
 
12
11
 
13
12
  <View
14
13
  ref={componentLazyRef}
15
14
  className={classNames(
16
15
  imageStyle['d-app-lazy-image'],
17
16
  {
18
17
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
19
18
  },
20
19
  {
21
20
  [imageStyle['d-hide-image-error']]: imageErrState,
22
21
  },
23
22
  {
24
23
  [imageStyle['d-load-completed']]: loadSuccess,
25
24
  },
26
25
  {
27
26
  'd-imag-rendering-crisp-edges':
28
27
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
29
28
  imagRenderingSet,
30
29
  },
31
30
  'J_html5ImageBg',
32
31
  className,
33
32
  )}
34
33
  style={{
35
34
  ...style,
36
35
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
37
36
  >
38
37
  {(componentShowState || lazyLoad === false) && <img
39
38
  src={getQualityImage(
40
39
  imgSrc,
41
40
  taroJdBaseInfo.info.pageInfo.isVipShop
42
41
  ? NetWorkTypeQuality['perfect']
43
42
  : NetWorkTypeQuality[getNetWorkType],
44
43
  )}
45
44
  onLoad={imageLoad.bind(this, imgSrc)}
46
45
  onError={imageError}
47
46
  />}
48
47
  </View>
49
48
  ) : (
50
49
  <Image
51
50
  style={{
52
51
  ...style,
53
52
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
54
53
  }}
55
54
  className={classNames(
56
55
  imageStyle['d-lazy-image'],
57
56
  {
58
57
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
59
58
  },
60
59
  {
61
60
  [imageStyle['d-hide-image-error']]: imageErrState,
62
61
  },
63
62
  {
64
63
  [imageStyle['d-load-completed']]: loadSuccess,
65
64
  },
66
65
  {
67
66
  'd-imag-rendering-crisp-edges': imagRenderingSet,
68
67
  },
69
68
  className,
70
69
  )}
71
70
  src={getQualityImage(
72
71
  imgSrc,
73
72
  NetWorkTypeQuality[getNetWorkType],
74
73
  )}
75
74
  lazyLoad={lazyLoad}
76
75
  onError={imageError}
77
76
  onLoad={imageLoad.bind(this, imgSrc)}
78
77
  {...otherOption}
79
78
  />
80
79
  )
80
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
81
81
  const [componentShowState, setComponentShowState] = useState(false)
82
82
  const componentLazyRef = useRef<HTMLElement | null>(null)
83
83
  const componentShowStateRef = useRef(false)
84
84
  useEffect(() => {
85
85
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
86
86
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
87
87
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
88
88
  !componentShowStateRef.current && dealPageScrollInfo(res)
89
89
  })
90
90
 
91
91
 
92
92
  <View
93
93
  ref={componentLazyRef}
94
94
  className={classNames(
95
95
  imageStyle['d-app-lazy-image'],
96
96
  {
97
97
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
98
98
  },
99
99
  {
100
100
  [imageStyle['d-hide-image-error']]: imageErrState,
101
101
  },
102
102
  {
103
103
  [imageStyle['d-load-completed']]: loadSuccess,
104
104
  },
105
105
  {
106
106
  'd-imag-rendering-crisp-edges':
107
107
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
108
108
  imagRenderingSet,
109
109
  },
110
110
  'J_html5ImageBg',
111
111
  className,
112
112
  )}
113
113
  style={{
114
114
  ...style,
115
115
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
116
116
  >
117
117
  {(componentShowState || lazyLoad === false) && <img
118
118
  src={getQualityImage(
119
119
  imgSrc,
120
120
  taroJdBaseInfo.info.pageInfo.isVipShop
121
121
  ? NetWorkTypeQuality['perfect']
122
122
  : NetWorkTypeQuality[getNetWorkType],
123
123
  )}
124
124
  onLoad={imageLoad.bind(this, imgSrc)}
125
125
  onError={imageError}
126
126
  />}
127
127
  </View>
128
128
  ) : (
129
129
  <Image
130
130
  style={{
131
131
  ...style,
132
132
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
133
133
  }}
134
134
  className={classNames(
135
135
  imageStyle['d-lazy-image'],
136
136
  {
137
137
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
138
138
  },
139
139
  {
140
140
  [imageStyle['d-hide-image-error']]: imageErrState,
141
141
  },
142
142
  {
143
143
  [imageStyle['d-load-completed']]: loadSuccess,
144
144
  },
145
145
  {
146
146
  'd-imag-rendering-crisp-edges': imagRenderingSet,
147
147
  },
148
148
  className,
149
149
  )}
150
150
  src={getQualityImage(
151
151
  imgSrc,
152
152
  NetWorkTypeQuality[getNetWorkType],
153
153
  )}
154
154
  lazyLoad={lazyLoad}
155
155
  onError={imageError}
156
156
  onLoad={imageLoad.bind(this, imgSrc)}
157
157
  {...otherOption}
158
158
  />
159
159
  )
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
@@ -0,0 +1 @@
1
+ import JdDraProfileAndException from "./jm-js-agent-jd-profile";
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  nativePageShowToast, ToastAndroidType,
3
2
  ToastIosType
4
3
  getAppChannelType, isAndroidDevice, isH5AndJdShopView,
5
4
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
6
5
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie
7
6
  addHttps, clearTaroStorageKey, countStringify, dateFormat, dealAddress, dealShopContentData as originDealShopContentData, debounce, filterUrlQueryData, formatTabActiveMenuType, getQualityImage, getTaroStorageKeyValue,
8
7
  getWxAppCookieStr, isH5, isJdMin, isWxMin,
9
8
  isWxMinAndWxapp, lodashThrottle, objectToUrlEncode, parseQueryUrlString, removeTaroStorageKey, setLowSmallPicUrl,
10
9
  setTaroStorage, showFailToast,
11
10
  showNormalToast, showSuccessToast, sliceArrToChunkList, throttle
12
11
  <span class="d-shop-loading-icon"></span>
13
12
  <p class="d-shop-text">${text}</p>
14
13
  </div>`
15
14
  return originDealShopContentData(pageData, DraJSAgentReport)
16
15
  isJdApp,
17
16
  isWxApp,
18
17
  isIosDevice,
19
18
  isAndroidDevice,
20
19
  isJdAndIosDevice,
21
20
  isJdAndAndroidDevice,
22
21
  isWxMin,
23
22
  isWxMinAndWxapp,
24
23
  isJdMin,
25
24
  isH5,
26
25
  isH5AndJdShopView,
27
26
  isH5AndJdShopViewNativeScroll,
28
27
  isH5AndJingGouMini,
29
28
  isWxMiniH5View,
30
29
  urlCookie,
31
30
  sliceArrToChunkList,
32
31
  dealAddress,
33
32
  objectToUrlEncode,
34
33
  parseQueryUrlString,
35
34
  setLowSmallPicUrl,
36
35
  setTaroStorage,
37
36
  getTaroStorageKeyValue,
38
37
  removeTaroStorageKey,
39
38
  clearTaroStorageKey,
40
39
  getQualityImage,
41
40
  countStringify,
42
41
  getWxAppCookieStr,
43
42
  getSystemInfos,
44
43
  pxTransformFromData,
45
44
  dateFormat,
46
45
  throttle,
47
46
  lodashThrottle,
48
47
  debounce,
49
48
  addHttps,
50
49
  commonShowSuccessToast as showSuccessToast,
51
50
  commonShowFailToast as showFailToast,
52
51
  commonShowNormalToast as showNormalToast,
53
52
  showShopLoading,
54
53
  hideShopLoading,
55
54
  getAppChannelType,
56
55
  formatTabActiveMenuType,
57
56
  filterUrlQueryData,
57
+ import Taro from '@tarojs/taro'
58
58
  nativePageShowToast, ToastAndroidType,
59
59
  ToastIosType
60
60
  getAppChannelType, isAndroidDevice, isH5AndJdShopView,
61
61
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
62
62
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie
63
63
  addHttps, clearTaroStorageKey, countStringify, dateFormat, dealAddress, dealShopContentData as originDealShopContentData, debounce, filterUrlQueryData, formatTabActiveMenuType, getQualityImage, getTaroStorageKeyValue,
64
64
  getWxAppCookieStr, isH5, isJdMin, isWxMin,
65
65
  isWxMinAndWxapp, lodashThrottle, objectToUrlEncode, parseQueryUrlString, removeTaroStorageKey, setLowSmallPicUrl,
66
66
  setTaroStorage, showFailToast,
67
67
  showNormalToast, showSuccessToast, sliceArrToChunkList, throttle
68
68
  <span class="d-shop-loading-icon"></span>
69
69
  <p class="d-shop-text">${text}</p>
70
70
  </div>`
71
71
  return originDealShopContentData(pageData, DraJSAgentReport)
72
72
  isJdApp,
73
73
  isWxApp,
74
74
  isIosDevice,
75
75
  isAndroidDevice,
76
76
  isJdAndIosDevice,
77
77
  isJdAndAndroidDevice,
78
78
  isWxMin,
79
79
  isWxMinAndWxapp,
80
80
  isJdMin,
81
81
  isH5,
82
82
  isH5AndJdShopView,
83
83
  isH5AndJdShopViewNativeScroll,
84
84
  isH5AndJingGouMini,
85
85
  isWxMiniH5View,
86
86
  urlCookie,
87
87
  sliceArrToChunkList,
88
88
  dealAddress,
89
89
  objectToUrlEncode,
90
90
  parseQueryUrlString,
91
91
  setLowSmallPicUrl,
92
92
  setTaroStorage,
93
93
  getTaroStorageKeyValue,
94
94
  removeTaroStorageKey,
95
95
  clearTaroStorageKey,
96
96
  getQualityImage,
97
97
  countStringify,
98
98
  getWxAppCookieStr,
99
99
  getSystemInfos,
100
100
  pxTransformFromData,
101
101
  dateFormat,
102
102
  throttle,
103
103
  lodashThrottle,
104
104
  debounce,
105
105
  addHttps,
106
106
  commonShowSuccessToast as showSuccessToast,
107
107
  commonShowFailToast as showFailToast,
108
108
  commonShowNormalToast as showNormalToast,
109
109
  showShopLoading,
110
110
  hideShopLoading,
111
111
  getAppChannelType,
112
112
  formatTabActiveMenuType,
113
113
  filterUrlQueryData,
@@ -0,0 +1 @@
1
+ !function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports.JdDraProfileAndException=e():t.JdDraProfileAndException=e()}(self,(function(){return function(){var t={223:function(t){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"===typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}var s=Object.prototype.toString;function c(){var t,n,r,i,o,a,s=arguments.length<=0?void 0:arguments[0],l=1,p=arguments.length,d=!1;for("boolean"===typeof s?(d=s,s=(arguments.length<=1?void 0:arguments[1])||{},l=2):("object"!==e(s)&&"function"!==typeof s||null==s)&&(s={});l<p;++l)if(null!=(t=l<0||arguments.length<=l?void 0:arguments[l]))for(n in t)r=s[n],s!==(i=t[n])&&(d&&i&&(f(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&f(r)?r:{},s[n]=c(d,a,i)):"undefined"!==typeof i&&(s[n]=i));return s}function u(t){return"[object Array]"===s.call(t)}function f(t){if(!t||"[object Object]"!==s.call(t))return!1;var e,n=Object.prototype.hasOwnProperty,r=n.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!i)return!1;for(e in t);return"undefined"===typeof e||n.call(t,e)}function l(t,n,r){if(r>=3)return encodeURIComponent(n)+"=[RECURSIVE]";r=r+1||1;var i=[];for(var o in t)if(t.hasOwnProperty(o)&&null!=o&&null!=t[o]){var a=n?"".concat(n,"[").concat(o,"]"):o,s=t[o],c="object"===e(s)?l(s,a,r):encodeURIComponent(a)+"="+encodeURIComponent(s);i.push(c)}return i.sort().join("&")}function p(t){var e,n,r=[],i=a(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;n=o,"[object String]"===s.call(n)?r.push(o.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):o&&o.source&&r.push(o.source)}}catch(c){i.e(c)}finally{i.f()}return r.length?new RegExp(r.join("|"),"i"):null}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.replace(/(^\s*)|(\s*$)/g,"")}var h=new function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(e){var n,r,i,o,a,s,c,u="",f=0;for(e=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e+=String.fromCharCode(r):r>127&&r<2048?(e+=String.fromCharCode(r>>6|192),e+=String.fromCharCode(63&r|128)):(e+=String.fromCharCode(r>>12|224),e+=String.fromCharCode(r>>6&63|128),e+=String.fromCharCode(63&r|128))}return e}(e);f<e.length;)o=(n=e.charCodeAt(f++))>>2,a=(3&n)<<4|(r=e.charCodeAt(f++))>>4,s=(15&r)<<2|(i=e.charCodeAt(f++))>>6,c=63&i,isNaN(r)?s=c=64:isNaN(i)&&(c=64),u=u+t.charAt(o)+t.charAt(a)+t.charAt(s)+t.charAt(c);return u},this.decode=function(e){var n,r,i,o,a,s,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)n=t.indexOf(e.charAt(u++))<<2|(o=t.indexOf(e.charAt(u++)))>>4,r=(15&o)<<4|(a=t.indexOf(e.charAt(u++)))>>2,i=(3&a)<<6|(s=t.indexOf(e.charAt(u++))),c+=String.fromCharCode(n),64!=a&&(c+=String.fromCharCode(r)),64!=s&&(c+=String.fromCharCode(i));return c=function(t){var e,n,r,i="",o=0;e=n=0;for(;o<t.length;)(e=t.charCodeAt(o))<128?(i+=String.fromCharCode(e),o++):e>191&&e<224?(n=t.charCodeAt(o+1),i+=String.fromCharCode((31&e)<<6|63&n),o+=2):(n=t.charCodeAt(o+1),r=t.charCodeAt(o+2),i+=String.fromCharCode((15&e)<<12|(63&n)<<6|63&r),o+=3);return i}(c),c}};function g(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.unshift("<JS Agent>:"),console.warn.apply(console,e)}function m(t,e){g("\u53d1\u9001\u670d\u52a1\u8bf7\u6c42\uff1a",t+="?"+l(e));var n=new Image;return n.src=t,n}function v(t){var e,n=[],r=/^\s*at((?:\s\S+)+) \(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(.+)@\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,o=a(t.stack.split("\n"));try{for(o.s();!(e=o.n()).done;){var s=e.value,c=r.exec(s)||i.exec(s);if(c){var u={url:c[2],func:d(c[1]),line:Number(c[3]),column:Number(c[4])};n.push(u)}}}catch(t){o.e(t)}finally{o.f()}return n}var y=function(){function t(){n(this,t),this.init(),this.limit=5,this.actionInfo={userTraceDom:[],userTraceEvent:[],userTraceTs:[]}}return i(t,[{key:"pushLimit",value:function(t,e){t.push(e),t.length>this.limit&&t.shift()}},{key:"addItem",value:function(t,e){this.pushLimit(this.actionInfo.userTraceDom,encodeURIComponent(t)),this.pushLimit(this.actionInfo.userTraceEvent,e),this.pushLimit(this.actionInfo.userTraceTs,(new Date).getTime())}},{key:"init",value:function(){var t=this;window.addEventListener("click",(function(e){t.addItem(function(t){if(t instanceof Element)try{for(var n=[];t&&t.nodeType===Node.ELEMENT_NODE;){var r=t.nodeName.toLowerCase();if(t.id){r+="#"+t.id,n.unshift(r);break}for(var i=t,o=1;i=i.previousElementSibling;)i.nodeName.toLowerCase()==r&&o++;if(1!=o&&(r+=":nth-of-type("+o+")"),n.unshift(r),!(t=t.parentNode))break}return n.join(">").replace(/div/g,"d").replace(/span/g,"s").replace(/header/g,"h").replace(/footer/g,"f").replace(/nth-of-type/g,"nth")}catch(e){return""}}(e.target),"click")}),!1)}},{key:"getActionInfo",value:function(){return this.actionInfo}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t),this.instance}}]),t}(),w=navigator.userAgent.toLowerCase(),b=w.split(";"),T=-1!=w.indexOf("jdapp"),S="jdlog"===b[1]?"android"===b[2]:"android"===b[1],E="jdlog"===b[1]?"iphone"===b[2]:"iphone"===b[1],A=-1!=w.indexOf("ipad");var _={id:null,endpoint:"//h5speed.m.jd.com/v3/exception",rate:1,ignoreErrors:[],ignoreUrls:[],stackLimit:10,flag:10,autoReport:!0},k={net:1,busniess:2,business:2,others:3,code:4,resource:5,unhandlerejection:6,fetcherror:7,ajaxerror:8,ajaxtimeout:9},C=1,j=2,I=function(){function t(){var e=this;n(this,t),this.VERSION="3.0.3-alpha.0",this._config=null,this._installed=!1,this._ignoreOnError=!1,this._lastException=null,this._needReport=!1,this._plugins={},this._ignoreErrors=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/(\w*\s*)missing \) after argument list(\w*\s*)/,/(\w*\s*)\'offsetWidth\'(\s*)of(\s*)null(\s*\w*)/],this._ignoreUrls=[/.jd-jssdk.min.js$/],this._interceptors=[],this._action=y.getInstance(),this._autoReport=!0,function(){var t=window&&window.navigator?navigator.userAgent:"",e=/^jdapp/i.test(t),n=/ip(hone|od)|ipad/i.test(t),r=/android/i.test(t)&&!n;return new Promise((function(t){if(e){var i="getNetWorkType";window[i]||(window[i]=function(e){t({status:"0",msg:"success",data:e})});try{n&&window.webkit?window.webkit.messageHandlers.JDAppUnite.postMessage({method:"getNetWorkType",params:i}):r&&window.JDAppUnite&&window.JDAppUnite.getNetWorkType(i)}catch(s){t({msg:"fail",data:"error"})}}else{if(window&&window.navigator){var o=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{},a=o.type||o.effectiveType||"unknown";t({msg:"success",data:a})}t({msg:"fail",data:"error"})}}))}().then((function(t){"success"===t.msg&&(e.network=t.data)})).catch((function(t){}))}return i(t,[{key:"init",value:function(t){if(this._config=c({},_,t),this._needReport=Math.random()<this._config.rate,this._config.flag){if(this._installed)return;this._autoReport=!!this._config.autoReport,this._ignoreErrors=this._ignoreErrors.concat(this._config.ignoreErrors),this._ignoreErrors=p(this._ignoreErrors),this._ignoreUrls=this._ignoreUrls.concat(this._config.ignoreUrls),this._ignoreUrls=p(this._ignoreUrls),this._wrapBuiltIns(),this._installPlugins(),this._installed=!0}else g("config.flag \u6ca1\u6709\u914d\u7f6e\uff0c\u5fc5\u987b\u914d\u7f6eflag.");return this}},{key:"addPlugin",value:function(t){if("function"===typeof t&&t.name&&!this._plugins[t.name]){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this._plugins[t.name]={args:n,fn:t,installed:!1},this._installed&&this._installPlugins()}return this}},{key:"addInterceptor",value:function(t){"function"===typeof t&&(this._interceptors||(this._interceptors=[]),this._interceptors.push(t))}},{key:"removeInterceptor",value:function(t){if("function"===typeof t&&this._interceptors){var e=this._interceptors.indexOf(t);e>-1&&this._interceptors.splice(e,1)}}},{key:"_installPlugins",value:function(){for(var t in this._plugins){var e=this._plugins[t];e.installed||(e.fn.apply(this,[this].concat(e.args)),e.installed=!0)}}},{key:"reportException",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this,o={type:t.name,stack:v(t).slice(0,i._config.stackLimit)};if(o.stack.length){var a=o.stack[0];o.row=a.line,o.col=a.column,o.file=a.url}var s={errType:k.code,errCode:750,errMsg:t.message,exceptionInfo:o};e&&(s.extraData=e),s.errLevel="number"===typeof n?n:4,s.reType=r?C:j,this._ignoreErrors&&this._ignoreErrors.test(t.message)||this._ignoreUrls&&this._ignoreUrls.test(t.file)||this._send(s)}},{key:"report",value:function(t,n,r,i,o){var a;if(1===arguments.length&&"object"===e(arguments[0])){var s=arguments[0];a={errType:s.errType,errCode:s.errCode,errMsg:s.errMsg,errLevel:4,reType:C}}else a={errType:t,errCode:n,errMsg:r,reType:j},i&&(a.extraData=i),a.errLevel="number"===typeof o?o:4;this._send(a)}},{key:"reportByJSbridge",value:function(t,e,n,r){var i={errType:t,errCode:e,errMsg:n};r&&(i.extraData=r),T?this._sendByJSbridge(i):this._send(i)}},{key:"wrap",value:function(t){if(t){if(t._wrapped)return t._wrapped;var e=this;if("function"!==typeof t&&"function"===typeof t.handleEvent){var n=t.handleEvent;return t.handleEvent=function(){try{for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];n.apply(t,i)}catch(a){throw e.reportException(a,null,4,!0),e._ignoreNextOnError(),a}},t._wrapped=t,t}var r=function(){try{for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}catch(o){throw e.reportException(o,null,4,!0),e._ignoreNextOnError(),o}};return"function"!==typeof t?t:(t._wrapped=r,r)}}},{key:"_wrapBuiltIns",value:function(){if(this._autoReport){for(var t=this,e=0,n=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];e<n.length;e++){i(n[e])}r(window,"setTimeout",a),r(window,"setInterval",a),window.requestAnimationFrame&&r(window,"requestAnimationFrame",o),window.$&&window.$.fn&&window.$.fn.ready&&r($.fn,"ready",o),r(window,"onerror",(function(e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._ignoreOnError||t._ignoreErrors&&t._ignoreErrors.test(r[0])||t._ignoreUrls&&t._ignoreUrls.test(r[1])||t.reportException(r[4]||new Error("window.onerror"),null,4,!0),e&&e.apply(this,r)}})),window.addEventListener("error",(function(e){var n=e.target;if("SCRIPT"===n.tagName||"LINK"===n.tagName){var r=n.src||n.href;t.report({errType:k.resource,errCode:0,errMsg:"".concat(r," \u6ca1\u6709\u52a0\u8f7d\u6210\u529f.")})}}),!0)}function r(t,e,n){var r=t[e];t[e]=n(r)}function i(e){var n=window[e]&&window[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(r(n,"addEventListener",(function(e){return function(n,r,i,o){return e.call(this,n,t.wrap(r),i,o)}})),r(n,"removeEventListener",(function(t){return function(e,n,r){return t.call(this,e,n&&n._wrapped||n,r)}})))}function o(e){return function(n){return e.call(this,t.wrap(n))}}function a(e){return function(n,r){return e.call(this,t.wrap(n),r)}}}},{key:"_send",value:function(t){if(this._interceptors&&this._interceptors.length>0){var e,n=a(this._interceptors);try{for(n.s();!(e=n.n()).done;){if(!(t=(0,e.value)(t)))return}}catch(p){n.e(p)}finally{n.f()}}var r=JSON.stringify(t);if(r!==this._lastException&&(this._lastException=r,this._needReport)){var i=this._action.getActionInfo(),o=i.userTraceDom,s=i.userTraceEvent,u=i.userTraceTs,f=document.getElementsByTagName("title")[0]&&document.getElementsByTagName("title")[0].innerText||"",l={flag:this._config.flag,rts:Date.now(),libVer:this.VERSION,url:window.location.href.split("?")[0]||"",title:f,userTraceDom:o,userTraceEvent:s,userTraceTs:u,network:this.network||"unknown"};c(l,t),g(l),m(this._config.endpoint,{data:h.encode(JSON.stringify(l))})}}},{key:"_sendByJSbridge",value:function(t){if(this._interceptors&&this._interceptors.length>0){var e,n=a(this._interceptors);try{for(n.s();!(e=n.n()).done;){if(!(t=(0,e.value)(t)))return}}catch(y){n.e(y)}finally{n.f()}}var r=t,i=r.errType,o=r.errCode,s=r.errMsg,c=r.extraData,u=void 0===c?{}:c,f=this._action.getActionInfo(),l=f.userTraceDom,p=f.userTraceEvent,d=f.userTraceTs,h=document.getElementsByTagName("title")[0]&&document.getElementsByTagName("title")[0].innerText||"",m={errCode:o,flag:this._config.flag,rts:Date.now(),libVer:this.VERSION,title:h,userTraceDom:l,userTraceEvent:p,userTraceTs:d,network:this.network||"unknown"},v={businessType:"exceptionReport",params:{functionInfo:"".concat(i),errMsg:s,exceptionInfo:JSON.stringify(m),url:window.location.href.split("?")[0]||"",extra:JSON.stringify(u)}};g(v);try{!function(t){if(E||A)try{window.webkit&&window.webkit.messageHandlers.JDAppUnite.postMessage({method:"notifyMessageToNative",params:t})}catch(e){console.log("jsbridge \u4e0a\u62a5\u5f02\u5e38",e)}else if(S)try{window.JDAppUnite&&window.JDAppUnite.notifyMessageToNative(t)}catch(e){console.log("jsbridge \u4e0a\u62a5\u5f02\u5e38",e)}}(JSON.stringify(v))}catch(w){console.warn("report by bridge error...",w)}}},{key:"_ignoreNextOnError",value:function(){var t=this;this._ignoreOnError=!0,setTimeout((function(){return t._ignoreOnError=!1}))}}]),t}(),O=window.JSAgent,x=new I;x.noConflict=function(){return window.JSAgent=O,x},x.EXCEPTION_TYPE=k,t.exports=x},955:function(t,e,n){var r;!function(){var i="undefined"!=typeof window&&window===this?this:"undefined"!=typeof n.g&&null!=n.g?n.g:this,o="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};function a(){a=function(){},i.Symbol||(i.Symbol=c)}var s=0;function c(t){return"jscomp_symbol_"+(t||"")+s++}function u(){a();var t=i.Symbol.iterator;t||(t=i.Symbol.iterator=i.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&o(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return f(this)}}),u=function(){}}function f(t){var e=0;return function(t){return u(),t={next:t},t[i.Symbol.iterator]=function(){return this},t}((function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}))}function l(t){u();var e=t[Symbol.iterator];return e?e.call(t):f(t)}function p(t){if(!(t instanceof Array)){t=l(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}var d=0;var h="img script iframe link audio video source".split(" ");function g(t,e){for(var n=(t=l(t)).next();!n.done;n=t.next())if(n=n.value,e.includes(n.nodeName.toLowerCase())||g(n.children,e))return!0;return!1}function m(t,e){if(2<t.length)return performance.now();for(var n=[],r=(e=l(e)).next();!r.done;r=e.next())r=r.value,n.push({timestamp:r.start,type:"requestStart"}),n.push({timestamp:r.end,type:"requestEnd"});for(r=(e=l(t)).next();!r.done;r=e.next())n.push({timestamp:r.value,type:"requestStart"});for(n.sort((function(t,e){return t.timestamp-e.timestamp})),t=t.length,e=n.length-1;0<=e;e--)switch((r=n[e]).type){case"requestStart":t--;break;case"requestEnd":if(2<++t)return r.timestamp;break;default:throw Error("Internal Error: This should never happen")}return 0}function v(t){t=t||{},this.w=!!t.useMutationObserver,this.u=t.minValue||null,t=window.__tti&&window.__tti.e;var e=window.__tti&&window.__tti.o;this.a=t?t.map((function(t){return{start:t.startTime,end:t.startTime+t.duration}})):[],e&&e.disconnect(),this.b=[],this.f=new Map,this.j=null,this.v=-1/0,this.i=!1,this.h=this.c=this.s=null,function(t,e){var n=XMLHttpRequest.prototype.send,r=d++;XMLHttpRequest.prototype.send=function(i){for(var o=[],a=0;a<arguments.length;++a)o[a-0]=arguments[a];var s=this;return t(r),this.addEventListener("readystatechange",(function(){4===s.readyState&&e(r)})),n.apply(this,o)}}(this.m.bind(this),this.l.bind(this)),function(t,e){var n=fetch;fetch=function(r){for(var i=[],o=0;o<arguments.length;++o)i[o-0]=arguments[o];return new Promise((function(r,o){var a=d++;t(a),n.apply(null,[].concat(p(i))).then((function(t){e(a),r(t)}),(function(t){e(t),o(t)}))}))}}(this.m.bind(this),this.l.bind(this)),function(t){t.c=new PerformanceObserver((function(e){for(var n=(e=l(e.getEntries())).next();!n.done;n=e.next())if("resource"===(n=n.value).entryType&&(t.b.push({start:n.fetchStart,end:n.responseEnd}),w(t,m(t.g,t.b)+5e3)),"longtask"===n.entryType){var r=n.startTime+n.duration;t.a.push({start:n.startTime,end:r}),w(t,r+5e3)}})),t.c.observe({entryTypes:["longtask","resource"]})}(this),this.w&&(this.h=function(t){var e=new MutationObserver((function(e){for(var n=(e=l(e)).next();!n.done;n=e.next())("childList"==(n=n.value).type&&g(n.addedNodes,h)||"attributes"==n.type&&h.includes(n.target.tagName.toLowerCase()))&&t(n)}));return e.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),e}(this.B.bind(this)))}function y(t){t.i=!0;var e=0<t.a.length?t.a[t.a.length-1].end:0,n=m(t.g,t.b);w(t,Math.max(n+5e3,e))}function w(t,e){!t.i||t.v>e||(clearTimeout(t.j),t.j=setTimeout((function(){var e=performance.timing.navigationStart,n=m(t.g,t.b);e=(window.a&&window.a.A?1e3*window.a.A().C-e:0)||performance.timing.domContentLoadedEventEnd-e;if(t.u)var r=t.u;else performance.timing.domContentLoadedEventEnd?r=(r=performance.timing).domContentLoadedEventEnd-r.navigationStart:r=null;var i=performance.now();null===r&&w(t,Math.max(n+5e3,i+1e3));var o=t.a;5e3>i-n?n=null:n=5e3>i-(n=o.length?o[o.length-1].end:e)?null:Math.max(n,r),n&&(t.s(n),clearTimeout(t.j),t.i=!1,t.c&&t.c.disconnect(),t.h&&t.h.disconnect()),w(t,performance.now()+1e3)}),e-performance.now()),t.v=e)}v.prototype.getFirstConsistentlyInteractive=function(){var t=this;return new Promise((function(e){t.s=e,"complete"==document.readyState?y(t):window.addEventListener("load",(function(){y(t)}))}))},v.prototype.m=function(t){this.f.set(t,performance.now())},v.prototype.l=function(t){this.f.delete(t)},v.prototype.B=function(){w(this,performance.now()+5e3)},i.Object.defineProperties(v.prototype,{g:{configurable:!0,enumerable:!0,get:function(){return[].concat(p(this.f.values()))}}});var b={getFirstConsistentlyInteractive:function(t){return t=t||{},"PerformanceLongTaskTiming"in window?new v(t).getFirstConsistentlyInteractive():Promise.resolve(null)}};t.exports?t.exports=b:void 0===(r=function(){return b}.apply(e,[]))||(t.exports=r)}()}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return function(){"use strict";n.r(r),n.d(r,{default:function(){return G}});var t,e,i=n(223),o=n.n(i),a=n(955),s=n.n(a);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(){try{if(!(t="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))){for(var n=0;n<16;n++)e[n]=Math.floor(255*Math.random());return e}return t(e)}catch(i){for(var r=0;r<16;r++)e[r]=Math.floor(255*Math.random());return e}}e="function"===typeof Uint8Array?new Uint8Array(16):[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(var p=[],d=0;d<256;++d)p.push((d+256).toString(16).substr(1));var h=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function g(t){return"string"===typeof t&&h.test(t)}function m(t,e,n){var r=(t=t||{}).random||(t.rng||l)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase();if(!g(n))throw TypeError("Stringified UUID is invalid");return n}(r)}function v(t){if(t instanceof Element)try{for(var e=[];t&&t.nodeType===Node.ELEMENT_NODE;){var n=t.nodeName.toLowerCase();if(t.id){n+="#"+t.id,e.unshift(n);break}for(var r=t,i=1;r=r.previousElementSibling;)r.nodeName.toLowerCase()==n&&i++;if(1!=i&&(n+=":nth-of-type("+i+")"),e.unshift(n),!(t=t.parentNode))break}return e.join(">").replace(/div/g,"d").replace(/span/g,"s").replace(/header/g,"h").replace(/footer/g,"f").replace(/nth-of-type/g,"nth")}catch(o){return""}}var y=function(t){var e=t;return"number"==typeof t&&(e=Number(t.toFixed(2))),e},w=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,"reportData",{fcp:null,fp:null,lcp:[],fid:null,cls:null,tbt:null,clsInfo:[],tti:null,longTask:[],fps:[]})}var e,n,r;return e=t,n=[{key:"setFPS",value:function(t){this.reportData.fps.push(t)}},{key:"setFP",value:function(t){this.reportData.fp=t}},{key:"setFCP",value:function(t){this.reportData.fcp=t}},{key:"setLCP",value:function(t){this.reportData.lcp=t}},{key:"setFID",value:function(t){this.reportData.fid=t}},{key:"setCLS",value:function(t){this.reportData.cls=t,this.reportData.clsInfo=[]}},{key:"setCLSInfo",value:function(t){var e;null===(e=this.reportData.clsInfo)||void 0===e||e.push(t)}},{key:"setTTI",value:function(t){this.reportData.tti=t}},{key:"setLongTask",value:function(t){this.reportData.longTask.push(t)}},{key:"setTBT",value:function(){var t=this.reportData,e=t.longTask,n=t.fcp,r=t.tti;if(e.length>0){var i=0;e.forEach((function(t){n&&t.startTime>=n&&(null==r||t.startTime<=r)&&(i+=t.duration-50)})),this.reportData.tbt=y(i)}}},{key:"buildServerInfoParam",value:function(t){var e=[];for(var n in t){var r;e.push(n+"="+encodeURIComponent(null!==(r=t[n])&&void 0!==r?r:""))}return e.join("&")}},{key:"buildPerformanceParam",value:function(){var t=[],e=this.reportData,n=e.fp,r=e.fcp,i=e.lcp,o=e.fid,a=e.cls,s=e.clsInfo,c=e.tti,u=e.longTask,f=e.tbt,l=e.fps;t.push("fp=".concat(null!==n&&void 0!==n?n:"")),t.push("fcp=".concat(null!==r&&void 0!==r?r:"")),t.push("lcp=".concat(encodeURIComponent(JSON.stringify(i)))),t.push("fid=".concat(null!==o&&void 0!==o?o:"")),t.push("cls=".concat(null!==a&&void 0!==a?a:"")),t.push("clsInfo=".concat(encodeURIComponent(JSON.stringify(s)))),t.push("tti=".concat(null!==c&&void 0!==c?c:"")),t.push("fps=".concat(encodeURIComponent(JSON.stringify(l))));for(var p=[],d=0;d<u.length&&(p.push(u[d].duration),9!=d);d++);return t.push("longTask=".concat(encodeURIComponent(JSON.stringify(p)))),t.push("tbt=".concat(null!==f&&void 0!==f?f:"")),t.join("&")}},{key:"report",value:function(t){if(t&&void 0!=t.options.flag){this.setTBT();var e,n=this.buildServerInfoParam(t.getServerInfo()),r=this.buildPerformanceParam();try{var i=new Image,o="//h5speed.m.jd.com",a=t.options.serverDomain.match(/.*\.com/);e=a,"[object Array]"===Object.prototype.toString.call(e)&&a.length>0&&(o=a[0]),i.src="".concat(o,"/v2/speed/event?").concat(n,"&").concat(r)}catch(s){}}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new t),this.instance}}],n&&u(e.prototype,n),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();f(w,"instance",void 0);var b,T=[],S=6e3,E=function(t){"function"==typeof t&&T.push(t)},A=function(t,e){try{if(-1!=PerformanceObserver.supportedEntryTypes.indexOf(t)){if("first-input"===t&&!("PerformanceEventTiming"in self))return;var n=new PerformanceObserver((function(t){for(var n=t.getEntries(),r=0;r<n.length;r++)e(n[r])}));return n.observe({type:t,buffered:!0}),E((function(){n.disconnect()})),n}}catch(r){}},_=0,k=[],C=0,j=[],I=0,O=function(){var t=w.getInstance();A("layout-shift",(function(e){if(!e.hadRecentInput){var n=j[0],r=j[j.length-1];C&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(C+=e.value,j.push(e)):(C=e.value,j=[e]),C>_&&(_=C,k=j,t.setCLS(function(t){var e=t;return"number"==typeof t&&(e=Number(t.toFixed(4))),e}(_)),k.forEach((function(e){if(++I<=10)if(t.setCLSInfo(Number(e.value.toFixed(4))),e.sources){for(var n=[],r=0;r<e.sources.length;r++)n.push(v(e.sources[r].node));t.setCLSInfo(n.join("|"))}else t.setCLSInfo("null")})))}}))},x=!1,P=function(){!function(){var t=performance.now(),e=0,n=performance.now(),r=function r(){var i=performance.now(),o=i-n;n=i;var a=Math.round(1e3/o);e++,i>1e3+t&&((a=Math.round(1e3*e/(i-t)))<=20&&R.setFPS(a),e=0,t=i),0==x&&window.requestAnimationFrame(r)};r(),E((function(){x=!0}))}()},R=w.getInstance();var N=!1;function L(t){var e,n;null!==t&&void 0!==t&&null!==(e=t.options)&&void 0!==e&&e.flag&&("number"==typeof(n=t.performanceReportTime)&&n>=3e3&&(S=n,clearTimeout(b),b=setTimeout((function(){T&&T.length>0&&T.forEach((function(t){t()}))}),S)),N||(N=!0,function(t){if("function"!==typeof PerformanceObserver)return void console.log("not support PerformanceObserver");try{A("paint",(function(t){"first-contentful-paint"==t.name?w.getInstance().setFCP(y(t.startTime)):"first-paint"==t.name&&w.getInstance().setFP(y(t.startTime))})),function(){var t=w.getInstance();A("largest-contentful-paint",(function(e){var n=e.startTime;t.setLCP([y(n)+"",v(null===e||void 0===e?void 0:e.element)])}))}(),function(){var t=w.getInstance();A("first-input",(function(e){var n=e.processingStart-e.startTime;t.setFID(y(n))}))}(),s().getFirstConsistentlyInteractive().then((function(t){t&&w.getInstance().setTTI(y(t))})),function(){var t=w.getInstance();A("longtask",(function(e){t.setLongTask({startTime:e.startTime,duration:y(e.duration)})}))}(),O(),P();var e=w.getInstance();E((function(){e.report(t)}))}catch(n){}}(t)))}var D=[/index\.bundle\..{20,32}\.css/gi,/app\..{20,32}\.css/gi,/index\.bundle\..{20}\.js/gi,/app\..{20}\.js/gi,"unify.min.js"],M=[-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function U(t){M[t]=1}function F(t,e){for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t[n]=e[n])}function J(t,e){var n=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(t)[9];if(n&&""!==n)for(var r=n.split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e)return decodeURIComponent(o[1])}return!1}function q(t,e){return""===e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function B(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)&&void 0!==t[n])try{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]))}catch(r){}return e}function V(t){var e=this;if(!(this instanceof V))return new V(t);this._installed=!1,this._plugins=[],this.sid=m(),this.selected=!1,this.timing={},this.isReported=!1,this.performanceReportTime=8e3,this.options={serverUrl:"//h5speed.m.jd.com",serverDomain:"//h5speed.m.jd.com",flag:null,profilingRate:1,autoReport:!1,autoAddStaticReport:!1,autoAddApiReport:!1,autoAddImageReport:!1,plugins:[]},this.init(t),this.pitsData=[],this.staticFiles=[],this.staticFilesSpecialType=[],this.customKeyValueData={},this.CONST_CREATE_TIME_MS=1550731072251,this.CONST_REASONABLE_TIME_LIMIT=6e4,this.performance=window.performance,this.isPerformanceApiAvailable="undefined"!==typeof this.performance,this.isTimingApiAvailable=this.isPerformanceApiAvailable&&"undefined"!==typeof this.performance.timing,this.isGetEntriesApiAvailable=this.isPerformanceApiAvailable&&"function"===typeof this.performance.getEntries,function(){var t=window&&window.navigator?navigator.userAgent:"",e=/^jdapp/i.test(t),n=/ip(hone|od)|ipad/i.test(t),r=/android/i.test(t)&&!n;return new Promise((function(t){if(e){var i="getNetWorkType";window[i]||(window[i]=function(e){t({status:"0",msg:"success",data:e})});try{n&&window.webkit?window.webkit.messageHandlers.JDAppUnite.postMessage({method:"getNetWorkType",params:i}):r&&window.JDAppUnite.getNetWorkType(i)}catch(s){t({msg:"fail",data:"error"})}}else{if(window&&window.navigator){var o=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{},a=o.type||o.effectiveType||"unknown";t({msg:"success",data:a})}t({msg:"fail",data:"error"})}}))}().then((function(t){"success"===t.msg&&(e.network=t.data)})).catch((function(t){}))}var W={init:function(t){if("number"===typeof t.flag&&!this._installed)return"object"===c(t)&&F(this.options,t),t.performanceReportTime&&(this.performanceReportTime=t.performanceReportTime),t.plugins&&(this._plugins=t.plugins),this.options.autoAddStaticReport&&(this.staticFiles=D),this.options.serverUrl=this.options.serverDomain+(12==this.options.flag?"/v2/speed/ware":"/v2/speed/activity"),this.selected=Math.random()<this.options.profilingRate,!0===this.options.autoReport&&this.enableAutoReport(),L(this),this._installed=!0,this._loadPlugins(),this},_loadPlugins:function(){var t=this;if(this._installed&&Array.isArray(this._plugins))try{this._plugins.map((function(e){return e.handler(t)}))}catch(e){console.error("@jmfe/jd-profiler \u6267\u884c\u63d2\u4ef6\u5931\u8d25",e)}},getTimingData:function(){var t,e={},n=this;e.hasPerformanceApi=n.isPerformanceApiAvailable?1:0,e.hasTimingApi=n.isTimingApiAvailable?1:0,e.hasGetEntriesApi=n.isGetEntriesApiAvailable?1:0,t=function(){var t=0;return window.chrome&&"function"===typeof window.chrome.loadTimes?t=1e3*window.chrome.loadTimes().firstPaintTime:n.isTimingApiAvailable&&"number"===typeof n.performance.timing.msFirstPaint&&(t=n.performance.timing.msFirstPaint),Math.round(t)}(),e.hasFirstPaintApi=t>0?1:0;try{if(n.isTimingApiAvailable){n.performance.timing.firstPaint=t;var r=n.performance.timing;e.domainLookup=r.domainLookupEnd-r.domainLookupStart,e.redirection=r.fetchStart-r.navigationStart,e.serverConnection=r.requestStart-r.connectStart,e.request2ResponseStart=r.responseStart-r.requestStart,e.responseStart2responseEnd=r.responseEnd-r.responseStart,e.request2ResponseEnd=r.responseEnd-r.requestStart,e.domInteractive=r.domInteractive-r.navigationStart,e.domContentLoaded=r.domContentLoadedEventStart-r.navigationStart,e.firstPaint=r.firstPaint-r.navigationStart,e.pageLoad=r.loadEventStart-r.navigationStart,e.backEnd=r.responseEnd-r.navigationStart,e.frontEnd=r.loadEventStart-r.responseEnd,e.loadEvent=r.loadEventEnd-r.loadEventStart}}catch(i){}return e},traversalResources:function(t){try{var e=t.indexOf("img")>=0,n=t.indexOf("api")>=0,r=null,i={},o={};if(!this.isGetEntriesApiAvailable)return i;r=this.performance.getEntries();for(var a=0;a<r.length;a++){var s,c,u,f=r[a],l=f.name,p=f.initiatorType;if(e&&"img"==p&&l.indexOf("h5speed.m.jd.com/v1/exception")<0){var d=l.split("!")[0].split("/"),h=d[d.length-1];c=parseInt(f.duration),i[h]=c}!n||"script"!=p&&"xmlhttprequest"!=p||(s=J(l,"functionId"))&&(u=J(l,"nickName"),c=parseInt(f.duration),u?i["api-"+u]=c:o[s]?(o[s]+=1,i["api-"+s+o[s]]=c):(o[s]=1,i["api-"+s]=c))}return i}catch(g){}},report:function(){try{if(this.selected&&!this.isReported&&null!==this.options.flag){var t=new Image,e=[];this.options.autoAddApiReport&&e.push("api"),this.options.autoAddImageReport&&e.push("img");var n=e.length>0,r=this.buildUrl(this.getServerInfo(),this.getTimingData(),n?this.traversalResources(e):{});r&&(t.src=r),this.isReported=!0}}catch(i){}},getServerInfo:function(){var t=location.href.split("?")[0],e=document.getElementsByTagName("title")[0]&&document.getElementsByTagName("title")[0].innerText||"";return{flag:this.options.flag,sid:this.sid,libVer:"4.1.0-alpha.0",url:t,rts:(new Date).getTime(),title:e,network:this.network}},moduleReport:function(t,e){try{var n,r,i=[],o=new Image,a={},s="";if("string"===typeof e&&(a.moduleId=e),"[object Object]"===Object.prototype.toString.call(t)&&(t=[t]),"[object Array]"===Object.prototype.toString.call(t)&&(t.forEach((function(t){if(t.number&&t.key&&t.time){if(t.number>35)throw new Error("\u53ea\u63d0\u4f9b1-35\u5751\u4f4d\u4e0a\u62a5");var e={};U(t.number),e["k"+t.number]=t.key,e["v"+t.number]=t.time,t.desc&&(e["s"+t.number]=t.desc||""),i.push(e)}})),i.length>0)){i.forEach((function(t){F(a,t)})),r=this.getServerInfo(),F(a,r),n=B(a),"[object Array]"===Object.prototype.toString.call(n)&&n.length>0&&(s=n.join("&"));var c=q("//h5speed.m.jd.com/v2/speed/event",s);c&&(o.src=c)}}catch(u){throw u}},addPits:function(t){try{var e=this;"[object Object]"===Object.prototype.toString.call(t)&&(t=[t]),"[object Array]"===Object.prototype.toString.call(t)&&t.forEach((function(t){if(t.number&&t.key&&t.time){if(r=t.number,0!==M[r])throw new Error("JdProfiler.addPits\u4f7f\u7528\u7684\u56fa\u5b9a\u5751\u4f4d\u5df2\u7ecf\u88ab\u5360\u7528\uff0c\u8bf7\u66f4\u6362");var n={};U(t.number),n["k"+t.number]=t.key,n["v"+t.number]=t.time,t.desc&&(n["s"+t.number]=t.desc||""),e.pitsData.push(n)}var r}))}catch(n){throw n}},add:function(t){this.addKeyValues(t)},detectStaticFile:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&void 0!==t[n]&&e.push(t[n]);this.staticFiles=this.staticFiles.concat(e)},addStaticFile:function(t){try{"[object Array]"===Object.prototype.toString.call(t)&&(this.staticFiles=this.staticFiles.concat(t))}catch(e){}},addStaticFileByLimitedType:function(t){try{"[object Object]"===Object.prototype.toString.call(t)?this.staticFilesSpecialType=this.staticFilesSpecialType.concat([t]):"[object Array]"===Object.prototype.toString.call(t)&&(this.staticFilesSpecialType=this.staticFilesSpecialType.concat(t))}catch(e){}},addKeyValues:function(t){try{"[object Object]"===Object.prototype.toString.call(t)&&F(this.customKeyValueData,t)}catch(e){}},buildUrl:function(t,e,n){var r={},i={},o=[],a=[],s=[],c={},u="",f=this;F(r,t),(o=B(r)).length>0&&(u=o.join("&"));var l=0;for(var p in e)e.hasOwnProperty(p)&&void 0!==e[p]&&(l++,s.push("p"+l+"="+e[p]));return s.length>0&&(u=u+"&"+s.join("&")),f.isGetEntriesApiAvailable&&f.staticFiles.length>0&&(c=function(t){var e,n,r={},i=null;return f.isGetEntriesApiAvailable?(i=f.performance.getEntries(),t.forEach((function(t){try{if(e=t){var o=function(t,e){var n=[];if(t&&e.length>0)for(var r=0,i=e.length;r<i;r++){var o=e[r];if(t.test){var a=o.name.match(t);a&&a.length>0&&n.push({name:a,time:o.duration})}else-1!==o.name.indexOf(t)&&n.push({name:t,time:o.duration})}return n}(e,i);o.forEach((function(t){t&&(n=parseInt(t.time))>=0&&(r[encodeURIComponent(t.name)]=n)}))}}catch(a){}})),r):r}(f.staticFiles),F(c,n),F(c,f.customKeyValueData),"[object Object]"===Object.prototype.toString.call(c)&&Object.getOwnPropertyNames(c).length>0&&(u=u+"&resources="+JSON.stringify(c))),f.isGetEntriesApiAvailable&&f.staticFilesSpecialType.length>0&&function(t){var e=null;f.isGetEntriesApiAvailable&&(e=f.performance.getEntries()),t.forEach((function(t){try{t&&function(t,e){var n=t.name,r=t.type,i=t.number,o=t.key;if(!(n&&r&&i&&o&&e.length>0))throw new Error("\u6307\u5b9a\u9759\u6001\u8d44\u6e90\u4e0a\u62a5\u7c7b\u578b\u53c2\u6570\u5f02\u5e38\uff0c\u8bf7\u68c0\u67e5\u5165\u53c2");for(var a=0,s=e.length;a<s;a++){var c=e[a];if(n.test){c.name.match(n),f.addPits({number:i,key:o,time:parseInt(c[r]),desc:t.desc});break}if(-1!==c.name.indexOf(n)){f.addPits({number:i,key:o,time:parseInt(c[r]),desc:t.desc});break}}}(t,e)}catch(n){}}))}(f.staticFilesSpecialType),f.isTimingApiAvailable&&f.pitsData.length>0&&(f.pitsData.forEach((function(t){F(i,t)})),a=B(i),"[object Array]"===Object.prototype.toString.call(a)&&a.length>0&&(u=u+"&"+a.join("&"))),q(this.options.serverUrl,u)},enableAutoReport:function(){var t=this;window.addEventListener("pageshow",(function(){window.setTimeout((function(){t.report()}),3e3)}),!1)}};V.prototype=W;var $=V({serverUrl:"//h5speed.m.jd.com",flag:null,profilingRate:1,autoReport:!1,autoAddStaticReport:!1,autoAddApiReport:!1,autoAddImageReport:!1});!0===$.options.autoReport&&$.enableAutoReport();var G={JSAgent:o(),jdProfiler:$}}(),r}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-alpha.23",
3
+ "version": "0.8.15-alpha.25",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"
@@ -1 +0,0 @@
1
- import DraException from "../utils/jm-js-agent";
@@ -1 +0,0 @@
1
- !function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.DraException=t():e.DraException=t()}(self,(function(){return function(){var e={223:function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"===typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}var s=Object.prototype.toString;function c(){var e,r,n,o,i,a,s=arguments.length<=0?void 0:arguments[0],l=1,p=arguments.length,h=!1;for("boolean"===typeof s?(h=s,s=(arguments.length<=1?void 0:arguments[1])||{},l=2):("object"!==t(s)&&"function"!==typeof s||null==s)&&(s={});l<p;++l)if(null!=(e=l<0||arguments.length<=l?void 0:arguments[l]))for(r in e)n=s[r],s!==(o=e[r])&&(h&&o&&(f(o)||(i=u(o)))?(i?(i=!1,a=n&&u(n)?n:[]):a=n&&f(n)?n:{},s[r]=c(h,a,o)):"undefined"!==typeof o&&(s[r]=o));return s}function u(e){return"[object Array]"===s.call(e)}function f(e){if(!e||"[object Object]"!==s.call(e))return!1;var t,r=Object.prototype.hasOwnProperty,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return"undefined"===typeof t||r.call(e,t)}function l(e,r,n){if(n>=3)return encodeURIComponent(r)+"=[RECURSIVE]";n=n+1||1;var o=[];for(var i in e)if(e.hasOwnProperty(i)&&null!=i&&null!=e[i]){var a=r?"".concat(r,"[").concat(i,"]"):i,s=e[i],c="object"===t(s)?l(s,a,n):encodeURIComponent(a)+"="+encodeURIComponent(s);o.push(c)}return o.sort().join("&")}function p(e){var t,r,n=[],o=a(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;r=i,"[object String]"===s.call(r)?n.push(i.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):i&&i.source&&n.push(i.source)}}catch(c){o.e(c)}finally{o.f()}return n.length?new RegExp(n.join("|"),"i"):null}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/(^\s*)|(\s*$)/g,"")}var d=new function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(t){var r,n,o,i,a,s,c,u="",f=0;for(t=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(t);f<t.length;)i=(r=t.charCodeAt(f++))>>2,a=(3&r)<<4|(n=t.charCodeAt(f++))>>4,s=(15&n)<<2|(o=t.charCodeAt(f++))>>6,c=63&o,isNaN(n)?s=c=64:isNaN(o)&&(c=64),u=u+e.charAt(i)+e.charAt(a)+e.charAt(s)+e.charAt(c);return u},this.decode=function(t){var r,n,o,i,a,s,c="",u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<t.length;)r=e.indexOf(t.charAt(u++))<<2|(i=e.indexOf(t.charAt(u++)))>>4,n=(15&i)<<4|(a=e.indexOf(t.charAt(u++)))>>2,o=(3&a)<<6|(s=e.indexOf(t.charAt(u++))),c+=String.fromCharCode(r),64!=a&&(c+=String.fromCharCode(n)),64!=s&&(c+=String.fromCharCode(o));return c=function(e){var t,r,n,o="",i=0;t=r=0;for(;i<e.length;)(t=e.charCodeAt(i))<128?(o+=String.fromCharCode(t),i++):t>191&&t<224?(r=e.charCodeAt(i+1),o+=String.fromCharCode((31&t)<<6|63&r),i+=2):(r=e.charCodeAt(i+1),n=e.charCodeAt(i+2),o+=String.fromCharCode((15&t)<<12|(63&r)<<6|63&n),i+=3);return o}(c),c}};function g(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t.unshift("<JS Agent>:"),console.warn.apply(console,t)}function y(e,t){g("\u53d1\u9001\u670d\u52a1\u8bf7\u6c42\uff1a",e+="?"+l(t));var r=new Image;return r.src=e,r}function v(e){var t,r=[],n=/^\s*at((?:\s\S+)+) \(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,o=/^\s*(.+)@\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=a(e.stack.split("\n"));try{for(i.s();!(t=i.n()).done;){var s=t.value,c=n.exec(s)||o.exec(s);if(c){var u={url:c[2],func:h(c[1]),line:Number(c[3]),column:Number(c[4])};r.push(u)}}}catch(e){i.e(e)}finally{i.f()}return r}var w=function(){function e(){r(this,e),this.init(),this.limit=5,this.actionInfo={userTraceDom:[],userTraceEvent:[],userTraceTs:[]}}return o(e,[{key:"pushLimit",value:function(e,t){e.push(t),e.length>this.limit&&e.shift()}},{key:"addItem",value:function(e,t){this.pushLimit(this.actionInfo.userTraceDom,encodeURIComponent(e)),this.pushLimit(this.actionInfo.userTraceEvent,t),this.pushLimit(this.actionInfo.userTraceTs,(new Date).getTime())}},{key:"init",value:function(){var e=this;window.addEventListener("click",(function(t){e.addItem(function(e){if(e instanceof Element)try{for(var r=[];e&&e.nodeType===Node.ELEMENT_NODE;){var n=e.nodeName.toLowerCase();if(e.id){n+="#"+e.id,r.unshift(n);break}for(var o=e,i=1;o=o.previousElementSibling;)o.nodeName.toLowerCase()==n&&i++;if(1!=i&&(n+=":nth-of-type("+i+")"),r.unshift(n),!(e=e.parentNode))break}return r.join(">").replace(/div/g,"d").replace(/span/g,"s").replace(/header/g,"h").replace(/footer/g,"f").replace(/nth-of-type/g,"nth")}catch(t){return""}}(t.target),"click")}),!1)}},{key:"getActionInfo",value:function(){return this.actionInfo}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}]),e}(),m=navigator.userAgent.toLowerCase(),_=m.split(";"),b=-1!=m.indexOf("jdapp"),T="jdlog"===_[1]?"android"===_[2]:"android"===_[1],E="jdlog"===_[1]?"iphone"===_[2]:"iphone"===_[1],C=-1!=m.indexOf("ipad");var k={id:null,endpoint:"//h5speed.m.jd.com/v3/exception",rate:1,ignoreErrors:[],ignoreUrls:[],stackLimit:10,flag:10,autoReport:!0},S={net:1,busniess:2,business:2,others:3,code:4,resource:5,unhandlerejection:6,fetcherror:7,ajaxerror:8,ajaxtimeout:9},x=1,A=2,O=function(){function e(){var t=this;r(this,e),this.VERSION="3.0.3-alpha.0",this._config=null,this._installed=!1,this._ignoreOnError=!1,this._lastException=null,this._needReport=!1,this._plugins={},this._ignoreErrors=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/(\w*\s*)missing \) after argument list(\w*\s*)/,/(\w*\s*)\'offsetWidth\'(\s*)of(\s*)null(\s*\w*)/],this._ignoreUrls=[/.jd-jssdk.min.js$/],this._interceptors=[],this._action=w.getInstance(),this._autoReport=!0,function(){var e=window&&window.navigator?navigator.userAgent:"",t=/^jdapp/i.test(e),r=/ip(hone|od)|ipad/i.test(e),n=/android/i.test(e)&&!r;return new Promise((function(e){if(t){var o="getNetWorkType";window[o]||(window[o]=function(t){e({status:"0",msg:"success",data:t})});try{r&&window.webkit?window.webkit.messageHandlers.JDAppUnite.postMessage({method:"getNetWorkType",params:o}):n&&window.JDAppUnite&&window.JDAppUnite.getNetWorkType(o)}catch(s){e({msg:"fail",data:"error"})}}else{if(window&&window.navigator){var i=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{},a=i.type||i.effectiveType||"unknown";e({msg:"success",data:a})}e({msg:"fail",data:"error"})}}))}().then((function(e){"success"===e.msg&&(t.network=e.data)})).catch((function(e){}))}return o(e,[{key:"init",value:function(e){if(this._config=c({},k,e),this._needReport=Math.random()<this._config.rate,this._config.flag){if(this._installed)return;this._autoReport=!!this._config.autoReport,this._ignoreErrors=this._ignoreErrors.concat(this._config.ignoreErrors),this._ignoreErrors=p(this._ignoreErrors),this._ignoreUrls=this._ignoreUrls.concat(this._config.ignoreUrls),this._ignoreUrls=p(this._ignoreUrls),this._wrapBuiltIns(),this._installPlugins(),this._installed=!0}else g("config.flag \u6ca1\u6709\u914d\u7f6e\uff0c\u5fc5\u987b\u914d\u7f6eflag.");return this}},{key:"addPlugin",value:function(e){if("function"===typeof e&&e.name&&!this._plugins[e.name]){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this._plugins[e.name]={args:r,fn:e,installed:!1},this._installed&&this._installPlugins()}return this}},{key:"addInterceptor",value:function(e){"function"===typeof e&&(this._interceptors||(this._interceptors=[]),this._interceptors.push(e))}},{key:"removeInterceptor",value:function(e){if("function"===typeof e&&this._interceptors){var t=this._interceptors.indexOf(e);t>-1&&this._interceptors.splice(t,1)}}},{key:"_installPlugins",value:function(){for(var e in this._plugins){var t=this._plugins[e];t.installed||(t.fn.apply(this,[this].concat(t.args)),t.installed=!0)}}},{key:"reportException",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this,i={type:e.name,stack:v(e).slice(0,o._config.stackLimit)};if(i.stack.length){var a=i.stack[0];i.row=a.line,i.col=a.column,i.file=a.url}var s={errType:S.code,errCode:750,errMsg:e.message,exceptionInfo:i};t&&(s.extraData=t),s.errLevel="number"===typeof r?r:4,s.reType=n?x:A,this._ignoreErrors&&this._ignoreErrors.test(e.message)||this._ignoreUrls&&this._ignoreUrls.test(e.file)||this._send(s)}},{key:"report",value:function(e,r,n,o,i){var a;if(1===arguments.length&&"object"===t(arguments[0])){var s=arguments[0];a={errType:s.errType,errCode:s.errCode,errMsg:s.errMsg,errLevel:4,reType:x}}else a={errType:e,errCode:r,errMsg:n,reType:A},o&&(a.extraData=o),a.errLevel="number"===typeof i?i:4;this._send(a)}},{key:"reportByJSbridge",value:function(e,t,r,n){var o={errType:e,errCode:t,errMsg:r};n&&(o.extraData=n),b?this._sendByJSbridge(o):this._send(o)}},{key:"wrap",value:function(e){if(e){if(e._wrapped)return e._wrapped;var t=this;if("function"!==typeof e&&"function"===typeof e.handleEvent){var r=e.handleEvent;return e.handleEvent=function(){try{for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r.apply(e,o)}catch(a){throw t.reportException(a,null,4,!0),t._ignoreNextOnError(),a}},e._wrapped=e,e}var n=function(){try{for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}catch(i){throw t.reportException(i,null,4,!0),t._ignoreNextOnError(),i}};return"function"!==typeof e?e:(e._wrapped=n,n)}}},{key:"_wrapBuiltIns",value:function(){if(this._autoReport){for(var e=this,t=0,r=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];t<r.length;t++){o(r[t])}n(window,"setTimeout",a),n(window,"setInterval",a),window.requestAnimationFrame&&n(window,"requestAnimationFrame",i),window.$&&window.$.fn&&window.$.fn.ready&&n($.fn,"ready",i),n(window,"onerror",(function(t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e._ignoreOnError||e._ignoreErrors&&e._ignoreErrors.test(n[0])||e._ignoreUrls&&e._ignoreUrls.test(n[1])||e.reportException(n[4]||new Error("window.onerror"),null,4,!0),t&&t.apply(this,n)}})),window.addEventListener("error",(function(t){var r=t.target;if("SCRIPT"===r.tagName||"LINK"===r.tagName){var n=r.src||r.href;e.report({errType:S.resource,errCode:0,errMsg:"".concat(n," \u6ca1\u6709\u52a0\u8f7d\u6210\u529f.")})}}),!0)}function n(e,t,r){var n=e[t];e[t]=r(n)}function o(t){var r=window[t]&&window[t].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(n(r,"addEventListener",(function(t){return function(r,n,o,i){return t.call(this,r,e.wrap(n),o,i)}})),n(r,"removeEventListener",(function(e){return function(t,r,n){return e.call(this,t,r&&r._wrapped||r,n)}})))}function i(t){return function(r){return t.call(this,e.wrap(r))}}function a(t){return function(r,n){return t.call(this,e.wrap(r),n)}}}},{key:"_send",value:function(e){if(this._interceptors&&this._interceptors.length>0){var t,r=a(this._interceptors);try{for(r.s();!(t=r.n()).done;){if(!(e=(0,t.value)(e)))return}}catch(p){r.e(p)}finally{r.f()}}var n=JSON.stringify(e);if(n!==this._lastException&&(this._lastException=n,this._needReport)){var o=this._action.getActionInfo(),i=o.userTraceDom,s=o.userTraceEvent,u=o.userTraceTs,f=document.getElementsByTagName("title")[0]&&document.getElementsByTagName("title")[0].innerText||"",l={flag:this._config.flag,rts:Date.now(),libVer:this.VERSION,url:window.location.href.split("?")[0]||"",title:f,userTraceDom:i,userTraceEvent:s,userTraceTs:u,network:this.network||"unknown"};c(l,e),g(l),y(this._config.endpoint,{data:d.encode(JSON.stringify(l))})}}},{key:"_sendByJSbridge",value:function(e){if(this._interceptors&&this._interceptors.length>0){var t,r=a(this._interceptors);try{for(r.s();!(t=r.n()).done;){if(!(e=(0,t.value)(e)))return}}catch(w){r.e(w)}finally{r.f()}}var n=e,o=n.errType,i=n.errCode,s=n.errMsg,c=n.extraData,u=void 0===c?{}:c,f=this._action.getActionInfo(),l=f.userTraceDom,p=f.userTraceEvent,h=f.userTraceTs,d=document.getElementsByTagName("title")[0]&&document.getElementsByTagName("title")[0].innerText||"",y={errCode:i,flag:this._config.flag,rts:Date.now(),libVer:this.VERSION,title:d,userTraceDom:l,userTraceEvent:p,userTraceTs:h,network:this.network||"unknown"},v={businessType:"exceptionReport",params:{functionInfo:"".concat(o),errMsg:s,exceptionInfo:JSON.stringify(y),url:window.location.href.split("?")[0]||"",extra:JSON.stringify(u)}};g(v);try{!function(e){if(E||C)try{window.webkit&&window.webkit.messageHandlers.JDAppUnite.postMessage({method:"notifyMessageToNative",params:e})}catch(t){console.log("jsbridge \u4e0a\u62a5\u5f02\u5e38",t)}else if(T)try{window.JDAppUnite&&window.JDAppUnite.notifyMessageToNative(e)}catch(t){console.log("jsbridge \u4e0a\u62a5\u5f02\u5e38",t)}}(JSON.stringify(v))}catch(m){console.warn("report by bridge error...",m)}}},{key:"_ignoreNextOnError",value:function(){var e=this;this._ignoreOnError=!0,setTimeout((function(){return e._ignoreOnError=!1}))}}]),e}(),I=window.JSAgent,N=new O;N.noConflict=function(){return window.JSAgent=I,N},N.EXCEPTION_TYPE=S,e.exports=N}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n);var e=r(223),t=r.n(e);n.default={JSAgent:t()}}(),n}()}));