@microsoft/applicationinsights-properties-js 3.0.0-beta.2303-11 → 3.0.0-beta.2304-07

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.
Files changed (95) hide show
  1. package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.js +3990 -0
  2. package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.js.map +1 -0
  3. package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.min.js +6 -0
  4. package/browser/es5/ai.props.3.0.0-beta.2304-07.cjs.min.js.map +1 -0
  5. package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.js +3994 -0
  6. package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.js.map +1 -0
  7. package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.min.js +6 -0
  8. package/browser/es5/ai.props.3.0.0-beta.2304-07.gbl.min.js.map +1 -0
  9. package/browser/es5/ai.props.3.0.0-beta.2304-07.integrity.json +66 -0
  10. package/browser/es5/ai.props.3.0.0-beta.2304-07.js +3996 -0
  11. package/browser/es5/ai.props.3.0.0-beta.2304-07.js.map +1 -0
  12. package/browser/es5/ai.props.3.0.0-beta.2304-07.min.js +6 -0
  13. package/browser/es5/ai.props.3.0.0-beta.2304-07.min.js.map +1 -0
  14. package/browser/es5/ai.props.3.cjs.js +3990 -0
  15. package/browser/es5/ai.props.3.cjs.js.map +1 -0
  16. package/browser/es5/ai.props.3.cjs.min.js +6 -0
  17. package/browser/es5/ai.props.3.cjs.min.js.map +1 -0
  18. package/browser/es5/ai.props.3.gbl.js +3994 -0
  19. package/browser/es5/ai.props.3.gbl.js.map +1 -0
  20. package/browser/es5/ai.props.3.gbl.min.js +6 -0
  21. package/browser/es5/ai.props.3.gbl.min.js.map +1 -0
  22. package/{dist/applicationinsights-properties-js.js → browser/es5/ai.props.3.js} +858 -828
  23. package/browser/es5/ai.props.3.js.map +1 -0
  24. package/browser/es5/ai.props.3.min.js +6 -0
  25. package/browser/es5/ai.props.3.min.js.map +1 -0
  26. package/{browser → dist/es5}/applicationinsights-properties-js.js +857 -827
  27. package/dist/es5/applicationinsights-properties-js.js.map +1 -0
  28. package/dist/es5/applicationinsights-properties-js.min.js +6 -0
  29. package/dist/es5/applicationinsights-properties-js.min.js.map +1 -0
  30. package/{dist-esm → dist-es5}/Context/Application.js +1 -1
  31. package/{dist-esm → dist-es5}/Context/Device.js +1 -1
  32. package/{dist-esm → dist-es5}/Context/Internal.js +1 -1
  33. package/{dist-esm → dist-es5}/Context/Location.js +1 -1
  34. package/{dist-esm → dist-es5}/Context/Session.js +1 -1
  35. package/{dist-esm → dist-es5}/Context/TelemetryTrace.js +1 -1
  36. package/{dist-esm → dist-es5}/Context/User.js +1 -1
  37. package/{dist-esm → dist-es5}/Interfaces/IPropTelemetryContext.js +1 -1
  38. package/{dist-esm → dist-es5}/Interfaces/IPropertiesConfig.js +1 -1
  39. package/{dist-esm → dist-es5}/PropertiesPlugin.js +1 -1
  40. package/{dist-esm → dist-es5}/TelemetryContext.js +1 -1
  41. package/{dist-esm → dist-es5}/__DynamicConstants.js +1 -1
  42. package/{dist-esm → dist-es5}/applicationinsights-properties-js.js +1 -1
  43. package/package.json +17 -16
  44. package/tsconfig.json +4 -3
  45. package/types/applicationinsights-properties-js.d.ts +161 -6
  46. package/{dist/applicationinsights-properties-js.d.ts → types/applicationinsights-properties-js.namespaced.d.ts} +1 -1
  47. package/browser/applicationinsights-properties-js.integrity.json +0 -26
  48. package/browser/applicationinsights-properties-js.js.map +0 -1
  49. package/browser/applicationinsights-properties-js.min.js +0 -6
  50. package/browser/applicationinsights-properties-js.min.js.map +0 -1
  51. package/dist/applicationinsights-properties-js.api.json +0 -3120
  52. package/dist/applicationinsights-properties-js.api.md +0 -173
  53. package/dist/applicationinsights-properties-js.js.map +0 -1
  54. package/dist/applicationinsights-properties-js.min.js +0 -6
  55. package/dist/applicationinsights-properties-js.min.js.map +0 -1
  56. package/dist/applicationinsights-properties-js.rollup.d.ts +0 -162
  57. package/src/Context/Application.ts +0 -16
  58. package/src/Context/Device.ts +0 -49
  59. package/src/Context/Internal.ts +0 -49
  60. package/src/Context/Location.ts +0 -12
  61. package/src/Context/Session.ts +0 -257
  62. package/src/Context/TelemetryTrace.ts +0 -26
  63. package/src/Context/User.ts +0 -233
  64. package/src/Interfaces/IPropTelemetryContext.ts +0 -21
  65. package/src/Interfaces/IPropertiesConfig.ts +0 -19
  66. package/src/PropertiesPlugin.ts +0 -183
  67. package/src/TelemetryContext.ts +0 -233
  68. package/src/__DynamicConstants.ts +0 -41
  69. package/src/applicationinsights-properties-js.ts +0 -10
  70. package/types/Context/Application.d.ts +0 -11
  71. package/types/Context/Device.d.ts +0 -31
  72. package/types/Context/Internal.d.ts +0 -30
  73. package/types/Context/Location.d.ts +0 -7
  74. package/types/Context/Session.d.ts +0 -42
  75. package/types/Context/TelemetryTrace.d.ts +0 -10
  76. package/types/Context/User.d.ts +0 -59
  77. package/types/Interfaces/IPropTelemetryContext.d.ts +0 -16
  78. package/types/Interfaces/IPropertiesConfig.d.ts +0 -16
  79. package/types/PropertiesPlugin.d.ts +0 -19
  80. package/types/TelemetryContext.d.ts +0 -34
  81. package/types/__DynamicConstants.d.ts +0 -29
  82. package/types/tsdoc-metadata.json +0 -11
  83. /package/{dist-esm → dist-es5}/Context/Application.js.map +0 -0
  84. /package/{dist-esm → dist-es5}/Context/Device.js.map +0 -0
  85. /package/{dist-esm → dist-es5}/Context/Internal.js.map +0 -0
  86. /package/{dist-esm → dist-es5}/Context/Location.js.map +0 -0
  87. /package/{dist-esm → dist-es5}/Context/Session.js.map +0 -0
  88. /package/{dist-esm → dist-es5}/Context/TelemetryTrace.js.map +0 -0
  89. /package/{dist-esm → dist-es5}/Context/User.js.map +0 -0
  90. /package/{dist-esm → dist-es5}/Interfaces/IPropTelemetryContext.js.map +0 -0
  91. /package/{dist-esm → dist-es5}/Interfaces/IPropertiesConfig.js.map +0 -0
  92. /package/{dist-esm → dist-es5}/PropertiesPlugin.js.map +0 -0
  93. /package/{dist-esm → dist-es5}/TelemetryContext.js.map +0 -0
  94. /package/{dist-esm → dist-es5}/__DynamicConstants.js.map +0 -0
  95. /package/{dist-esm → dist-es5}/applicationinsights-properties-js.js.map +0 -0
@@ -1,958 +1,982 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2303-11
2
+ * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2304-07
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
6
6
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
7
7
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
8
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {})));
8
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights3 = global.Microsoft.ApplicationInsights3 || {})));
9
9
  })(this, (function (exports) { 'use strict';
10
10
 
11
11
  var strShimFunction = "function";
12
12
  var strShimObject = "object";
13
13
  var strShimUndefined = "undefined";
14
14
  var strShimPrototype = "prototype";
15
- var strShimHasOwnProperty = "hasOwnProperty";
16
15
  var ObjClass$1 = Object;
17
- var ObjCreate = ObjClass$1["create"];
18
16
 
19
- var _cachedGlobal$1 = null;
20
- function getGlobal$1(useCached) {
21
- if (useCached === void 0) { useCached = true; }
22
- var result = useCached === false ? null : _cachedGlobal$1;
23
- if (!result) {
24
- if (typeof globalThis !== strShimUndefined) {
25
- result = globalThis;
26
- }
27
- if (!result && typeof self !== strShimUndefined) {
28
- result = self;
29
- }
30
- if (!result && typeof window !== strShimUndefined) {
31
- result = window;
32
- }
33
- if (!result && typeof global !== strShimUndefined) {
34
- result = global;
35
- }
36
- _cachedGlobal$1 = result;
17
+ var UNDEF_VALUE = undefined;
18
+ var EMPTY = "";
19
+ var FUNCTION = "function";
20
+ var NUMBER = "number";
21
+ var OBJECT = "object";
22
+ var PROTOTYPE = "prototype";
23
+ var STRING = "string";
24
+ var UNDEFINED = "undefined";
25
+ var CONSTRUCTOR = "constructor";
26
+ var SYMBOL = "Symbol";
27
+ var POLYFILL_TAG = "_polyfill";
28
+ var INDEX_OF = "indexOf";
29
+ var LENGTH = "length";
30
+ var DONE = "done";
31
+ var VALUE = "value";
32
+ var NAME = "name";
33
+ var SLICE = "slice";
34
+ var ObjClass = Object;
35
+ var ObjProto = ObjClass[PROTOTYPE];
36
+ var StrCls = String;
37
+ var StrProto = StrCls[PROTOTYPE];
38
+ var MathCls = Math;
39
+ var ArrCls = Array;
40
+ var ArrProto = ArrCls[PROTOTYPE];
41
+
42
+ function _safeGet(cb, defValue) {
43
+ var result = defValue;
44
+ try {
45
+ result = cb();
46
+ }
47
+ catch (e) {
37
48
  }
38
49
  return result;
39
50
  }
40
- function throwTypeError$1(message) {
41
- throw new TypeError(message);
51
+
52
+ function _createIs(theType) {
53
+ return function (value) {
54
+ return typeof value === theType;
55
+ };
42
56
  }
43
- function objCreateFn(obj) {
44
- var func = ObjCreate;
45
- if (func) {
46
- return func(obj);
47
- }
48
- if (obj == null) {
49
- return {};
50
- }
51
- var type = typeof obj;
52
- if (type !== strShimObject && type !== strShimFunction) {
53
- throwTypeError$1("Object prototype may only be an Object:" + obj);
57
+ function _createObjIs(theName) {
58
+ var theType = "[object " + theName + "]";
59
+ return function (value) {
60
+ return !!(value && objToString(value) === theType);
61
+ };
62
+ }
63
+ function objToString(value) {
64
+ return ObjProto.toString.call(value);
65
+ }
66
+ function isUndefined(value) {
67
+ return typeof value === UNDEFINED || value === UNDEFINED;
68
+ }
69
+ function isNullOrUndefined(value) {
70
+ return value === null || isUndefined(value);
71
+ }
72
+ function isStrictNullOrUndefined(value) {
73
+ return value === null || !isDefined(value);
74
+ }
75
+ function isDefined(arg) {
76
+ return !!arg || arg !== UNDEF_VALUE;
77
+ }
78
+ var isString = _createIs(STRING);
79
+ var isFunction = _createIs(FUNCTION);
80
+ function isObject(value) {
81
+ if (!value && isNullOrUndefined(value)) {
82
+ return false;
54
83
  }
55
- function tmpFunc() { }
56
- tmpFunc[strShimPrototype] = obj;
57
- return new tmpFunc();
84
+ return !!value && typeof value === OBJECT;
85
+ }
86
+ var isArray = ArrCls.isArray;
87
+ var isNumber = _createIs(NUMBER);
88
+ var isError = _createObjIs("Error");
89
+ function isTruthy(value) {
90
+ return !(!value || _safeGet(function () { return !(value && (0 + value)); }, !value));
58
91
  }
59
92
 
60
- (getGlobal$1() || {})["Symbol"];
61
- (getGlobal$1() || {})["Reflect"];
62
- var extendStaticsFn = function (d, b) {
63
- extendStaticsFn = ObjClass$1["setPrototypeOf"] ||
64
- ({ __proto__: [] } instanceof Array && function (d, b) {
65
- d.__proto__ = b;
66
- }) ||
67
- function (d, b) {
68
- for (var p in b) {
69
- if (b[strShimHasOwnProperty](p)) {
70
- d[p] = b[p];
93
+ var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;
94
+
95
+ function objHasOwnProperty(obj, prop) {
96
+ return obj && ObjProto.hasOwnProperty.call(obj, prop);
97
+ }
98
+
99
+ var objHasOwn = ObjClass["hasOwn"] || polyObjHasOwn;
100
+ function polyObjHasOwn(obj, prop) {
101
+ return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
102
+ }
103
+
104
+ function objForEachKey(theObject, callbackfn, thisArg) {
105
+ if (theObject && isObject(theObject)) {
106
+ for (var prop in theObject) {
107
+ if (objHasOwn(theObject, prop)) {
108
+ if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {
109
+ break;
71
110
  }
72
111
  }
73
- };
74
- return extendStaticsFn(d, b);
75
- };
76
- function __extendsFn(d, b) {
77
- if (typeof b !== strShimFunction && b !== null) {
78
- throwTypeError$1("Class extends value " + String(b) + " is not a constructor or null");
112
+ }
79
113
  }
80
- extendStaticsFn(d, b);
81
- function __() {
82
- this.constructor = d;
114
+ }
115
+
116
+ function _createKeyValueMap(values, keyType, valueType, completeFn) {
117
+ var theMap = {};
118
+ objForEachKey(values, function (key, value) {
119
+ theMap[key] = keyType ? value : key;
120
+ theMap[value] = valueType ? value : key;
121
+ });
122
+ return completeFn(theMap);
123
+ }
124
+
125
+ function throwTypeError(message) {
126
+ throw new TypeError(message);
127
+ }
128
+
129
+ var _objFreeze = ObjClass["freeze"];
130
+ var _doNothing = function (value) { return value; };
131
+ function objKeys(value) {
132
+ if (!isObject(value) || value === null) {
133
+ throwTypeError("objKeys called on non-object");
134
+ }
135
+ return ObjClass.keys(value);
136
+ }
137
+ function objDeepFreeze(value) {
138
+ if (_objFreeze) {
139
+ objForEachKey(value, function (key, value) {
140
+ if (isArray(value) || isObject(value)) {
141
+ _objFreeze(value);
142
+ }
143
+ });
83
144
  }
84
- d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
145
+ return objFreeze(value);
85
146
  }
147
+ var objFreeze = _objFreeze || _doNothing;
148
+ var objGetPrototypeOf = ObjClass["getPrototypeOf"] || _doNothing;
86
149
 
87
- /*!
88
- * Microsoft Dynamic Proto Utility, 1.1.8
89
- * Copyright (c) Microsoft and contributors. All rights reserved.
90
- */
91
- var _a$3;
92
- var UNDEFINED$1 = "undefined";
93
- var Constructor = 'constructor';
94
- var Prototype = 'prototype';
95
- var strFunction = 'function';
96
- var DynInstFuncTable = '_dynInstFuncs';
97
- var DynProxyTag = '_isDynProxy';
98
- var DynClassName = '_dynClass';
99
- var DynClassNamePrefix = '_dynCls$';
100
- var DynInstChkTag = '_dynInstChk';
101
- var DynAllowInstChkTag = DynInstChkTag;
102
- var DynProtoDefaultOptions = '_dfOpts';
103
- var UnknownValue = '_unknown_';
104
- var str__Proto = "__proto__";
105
- var DynProtoBaseProto = "_dyn" + str__Proto;
106
- var DynProtoGlobalSettings = "__dynProto$Gbl";
107
- var DynProtoCurrent = "_dynInstProto";
108
- var strUseBaseInst = 'useBaseInst';
109
- var strSetInstFuncs = 'setInstFuncs';
110
- var Obj = Object;
111
- var _objGetPrototypeOf = Obj["getPrototypeOf"];
112
- var _objGetOwnProps = Obj["getOwnPropertyNames"];
113
- function _getGlobal() {
150
+ function createEnum(values) {
151
+ return _createKeyValueMap(values, 1 , 0 , objDeepFreeze);
152
+ }
153
+ function createEnumKeyMap(values) {
154
+ return _createKeyValueMap(values, 0 , 0 , objDeepFreeze);
155
+ }
156
+
157
+ var _wellKnownSymbolMap = createEnumKeyMap({
158
+ asyncIterator: 0 ,
159
+ hasInstance: 1 ,
160
+ isConcatSpreadable: 2 ,
161
+ iterator: 3 ,
162
+ match: 4 ,
163
+ matchAll: 5 ,
164
+ replace: 6 ,
165
+ search: 7 ,
166
+ species: 8 ,
167
+ split: 9 ,
168
+ toPrimitive: 10 ,
169
+ toStringTag: 11 ,
170
+ unscopables: 12
171
+ });
172
+
173
+ var asString = StrCls;
174
+
175
+ var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg";
176
+ var _globalCfg;
177
+ function _getGlobalValue() {
114
178
  var result;
115
- if (typeof globalThis !== UNDEFINED$1) {
179
+ if (typeof globalThis !== UNDEFINED) {
116
180
  result = globalThis;
117
181
  }
118
- if (!result && typeof self !== UNDEFINED$1) {
182
+ if (!result && typeof self !== UNDEFINED) {
119
183
  result = self;
120
184
  }
121
- if (!result && typeof window !== UNDEFINED$1) {
185
+ if (!result && typeof window !== UNDEFINED) {
122
186
  result = window;
123
187
  }
124
- if (!result && typeof global !== UNDEFINED$1) {
188
+ if (!result && typeof global !== UNDEFINED) {
125
189
  result = global;
126
190
  }
127
- return result || {};
128
- }
129
- var _gbl = _getGlobal();
130
- var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {
131
- o: (_a$3 = {},
132
- _a$3[strSetInstFuncs] = true,
133
- _a$3[strUseBaseInst] = true,
134
- _a$3),
135
- n: 1000
136
- });
137
- function _hasOwnProperty(obj, prop) {
138
- return obj && Obj[Prototype].hasOwnProperty.call(obj, prop);
139
- }
140
- function _isObjectOrArrayPrototype(target) {
141
- return target && (target === Obj[Prototype] || target === Array[Prototype]);
142
- }
143
- function _isObjectArrayOrFunctionPrototype(target) {
144
- return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
191
+ return result;
145
192
  }
146
- function _getObjProto(target) {
147
- var newProto;
148
- if (target) {
149
- if (_objGetPrototypeOf) {
150
- return _objGetPrototypeOf(target);
151
- }
152
- var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
153
- newProto = target[DynProtoBaseProto] || curProto;
154
- if (!_hasOwnProperty(target, DynProtoBaseProto)) {
155
- delete target[DynProtoCurrent];
156
- newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];
157
- target[DynProtoCurrent] = curProto;
158
- }
193
+ function _getGlobalConfig() {
194
+ if (!_globalCfg) {
195
+ var gbl = _getGlobalValue() || {};
196
+ _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {};
159
197
  }
160
- return newProto;
198
+ return _globalCfg;
161
199
  }
162
- function _forEachProp(target, func) {
163
- var props = [];
164
- if (_objGetOwnProps) {
165
- props = _objGetOwnProps(target);
200
+
201
+ function dumpObj(object, format) {
202
+ var propertyValueDump = EMPTY;
203
+ if (isError(object)) {
204
+ propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
166
205
  }
167
206
  else {
168
- for (var name_1 in target) {
169
- if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) {
170
- props.push(name_1);
171
- }
207
+ try {
208
+ propertyValueDump = JSON.stringify(object, null, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);
172
209
  }
173
- }
174
- if (props && props.length > 0) {
175
- for (var lp = 0; lp < props.length; lp++) {
176
- func(props[lp]);
210
+ catch (e) {
211
+ propertyValueDump = " - " + dumpObj(e, format);
177
212
  }
178
213
  }
214
+ return objToString(object) + ": " + propertyValueDump;
179
215
  }
180
- function _isDynamicCandidate(target, funcName, skipOwn) {
181
- return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName)));
182
- }
183
- function _throwTypeError(message) {
184
- throw new TypeError("DynamicProto: " + message);
216
+
217
+ function _unwrapFunction(funcName, target, polyFunc) {
218
+ return function (thisArg) {
219
+ var theFunc = (thisArg && thisArg[funcName]) || (target && target[funcName]);
220
+ if (theFunc || polyFunc) {
221
+ var theArgs = arguments;
222
+ return (theFunc || polyFunc).apply(thisArg, theFunc ? ArrProto[SLICE].call(theArgs, 1) : theArgs);
223
+ }
224
+ throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg));
225
+ };
185
226
  }
186
- function _getInstanceFuncs(thisTarget) {
187
- var instFuncs = {};
188
- _forEachProp(thisTarget, function (name) {
189
- if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
190
- instFuncs[name] = thisTarget[name];
191
- }
192
- });
193
- return instFuncs;
194
- }
195
- function _hasVisited(values, value) {
196
- for (var lp = values.length - 1; lp >= 0; lp--) {
197
- if (values[lp] === value) {
198
- return true;
199
- }
227
+
228
+ var mathMax = MathCls.max;
229
+
230
+ var strSlice = _unwrapFunction(SLICE, StrProto);
231
+
232
+ var strSubstring = _unwrapFunction("substring", StrProto);
233
+ var strSubstr = _unwrapFunction("substr", StrProto, polyStrSubstr);
234
+ function polyStrSubstr(value, start, length) {
235
+ if (isNullOrUndefined(value)) {
236
+ throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
200
237
  }
201
- return false;
202
- }
203
- function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
204
- function _instFuncProxy(target, funcHost, funcName) {
205
- var theFunc = funcHost[funcName];
206
- if (theFunc[DynProxyTag] && useBaseInst) {
207
- var instFuncTable = target[DynInstFuncTable] || {};
208
- if (instFuncTable[DynAllowInstChkTag] !== false) {
209
- theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
210
- }
211
- }
212
- return function () {
213
- return theFunc.apply(target, arguments);
214
- };
238
+ if (length < 0) {
239
+ return EMPTY;
215
240
  }
216
- var baseFuncs = {};
217
- _forEachProp(instFuncs, function (name) {
218
- baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
219
- });
220
- var baseProto = _getObjProto(classProto);
221
- var visited = [];
222
- while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
223
- _forEachProp(baseProto, function (name) {
224
- if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
225
- baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
226
- }
227
- });
228
- visited.push(baseProto);
229
- baseProto = _getObjProto(baseProto);
241
+ start = start || 0;
242
+ if (start < 0) {
243
+ start = mathMax(start + value[LENGTH], 0);
230
244
  }
231
- return baseFuncs;
232
- }
233
- function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
234
- var instFunc = null;
235
- if (target && _hasOwnProperty(proto, DynClassName)) {
236
- var instFuncTable = target[DynInstFuncTable] || {};
237
- instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
238
- if (!instFunc) {
239
- _throwTypeError("Missing [" + funcName + "] " + strFunction);
240
- }
241
- if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
242
- var canAddInst = !_hasOwnProperty(target, funcName);
243
- var objProto = _getObjProto(target);
244
- var visited = [];
245
- while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
246
- var protoFunc = objProto[funcName];
247
- if (protoFunc) {
248
- canAddInst = (protoFunc === currentDynProtoProxy);
249
- break;
250
- }
251
- visited.push(objProto);
252
- objProto = _getObjProto(objProto);
253
- }
254
- try {
255
- if (canAddInst) {
256
- target[funcName] = instFunc;
257
- }
258
- instFunc[DynInstChkTag] = 1;
259
- }
260
- catch (e) {
261
- instFuncTable[DynAllowInstChkTag] = false;
262
- }
263
- }
245
+ if (isUndefined(length)) {
246
+ return strSlice(value, start);
264
247
  }
265
- return instFunc;
248
+ return strSlice(value, start, start + length);
266
249
  }
267
- function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
268
- var protoFunc = proto[funcName];
269
- if (protoFunc === currentDynProtoProxy) {
270
- protoFunc = _getObjProto(proto)[funcName];
250
+ function strLeft(value, count) {
251
+ return strSubstring(value, 0, count);
252
+ }
253
+
254
+ var _polySymbols;
255
+ function _globalSymbolRegistry() {
256
+ if (!_polySymbols) {
257
+ var gblCfg = _getGlobalConfig();
258
+ _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} };
271
259
  }
272
- if (typeof protoFunc !== strFunction) {
273
- _throwTypeError("[" + funcName + "] is not a " + strFunction);
260
+ return _polySymbols;
261
+ }
262
+ var _wellKnownSymbolCache = {};
263
+ function polyNewSymbol(description) {
264
+ var theSymbol = {
265
+ description: asString(description),
266
+ toString: function () { return SYMBOL + "(" + description + ")"; }
267
+ };
268
+ theSymbol[POLYFILL_TAG] = true;
269
+ return theSymbol;
270
+ }
271
+ function polySymbolFor(key) {
272
+ var registry = _globalSymbolRegistry();
273
+ if (!objHasOwn(registry, key)) {
274
+ var newSymbol = polyNewSymbol(key);
275
+ registry.k[key] = newSymbol;
276
+ registry.s[newSymbol] = asString(key);
274
277
  }
275
- return protoFunc;
278
+ return registry.k[key];
276
279
  }
277
- function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
278
- function _createDynamicPrototype(proto, funcName) {
279
- var dynProtoProxy = function () {
280
- var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
281
- return instFunc.apply(this, arguments);
282
- };
283
- dynProtoProxy[DynProxyTag] = 1;
284
- return dynProtoProxy;
280
+ function polyGetKnownSymbol(name) {
281
+ var result;
282
+ var knownName = _wellKnownSymbolMap[name];
283
+ if (knownName) {
284
+ result = _wellKnownSymbolCache[knownName] = _wellKnownSymbolCache[knownName] || polyNewSymbol(SYMBOL + "." + knownName);
285
285
  }
286
- if (!_isObjectOrArrayPrototype(proto)) {
287
- var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
288
- var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
289
- if (instFuncTable[DynAllowInstChkTag] !== false) {
290
- instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
286
+ return result;
287
+ }
288
+
289
+ var propMap = {
290
+ e: "enumerable",
291
+ c: "configurable",
292
+ v: VALUE,
293
+ w: "writable",
294
+ g: "get",
295
+ s: "set"
296
+ };
297
+ function _createProp(value) {
298
+ var prop = {};
299
+ prop[propMap["c"]] = true;
300
+ prop[propMap["e"]] = true;
301
+ if (value.l) {
302
+ prop.get = function () { return value.l.v; };
303
+ var desc = objGetOwnPropertyDescriptor(value.l, "v");
304
+ if (desc && desc.set) {
305
+ prop.set = function (newValue) {
306
+ value.l.v = newValue;
307
+ };
291
308
  }
292
- _forEachProp(target, function (name) {
293
- if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
294
- instFuncs_1[name] = target[name];
295
- delete target[name];
296
- if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
297
- proto[name] = _createDynamicPrototype(proto, name);
298
- }
299
- }
300
- });
301
309
  }
310
+ objForEachKey(value, function (key, value) {
311
+ prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
312
+ });
313
+ return prop;
302
314
  }
303
- function _checkPrototype(classProto, thisTarget) {
304
- if (_objGetPrototypeOf) {
305
- var visited = [];
306
- var thisProto = _getObjProto(thisTarget);
307
- while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
308
- if (thisProto === classProto) {
309
- return true;
315
+ var objDefineProp = ObjClass["defineProperty"];
316
+ function objDefine(target, key, propDesc) {
317
+ return objDefineProp(target, key, _createProp(propDesc));
318
+ }
319
+
320
+ var _globalLazyTestHooks;
321
+ var _fetchLazyTestHooks = function () {
322
+ _globalLazyTestHooks = _getGlobalConfig();
323
+ _fetchLazyTestHooks = null;
324
+ };
325
+ function getLazy(cb) {
326
+ var lazyValue = {};
327
+ _fetchLazyTestHooks && _fetchLazyTestHooks();
328
+ lazyValue.b = _globalLazyTestHooks.lzy;
329
+ objDefineProp(lazyValue, "v", {
330
+ configurable: true,
331
+ get: function () {
332
+ var result = cb();
333
+ if (!_globalLazyTestHooks.lzy) {
334
+ objDefineProp(lazyValue, "v", {
335
+ value: result
336
+ });
337
+ if (lazyValue.b) {
338
+ delete lazyValue.b;
339
+ }
310
340
  }
311
- visited.push(thisProto);
312
- thisProto = _getObjProto(thisProto);
341
+ if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {
342
+ lazyValue.b = _globalLazyTestHooks.lzy;
343
+ }
344
+ return result;
313
345
  }
314
- return false;
315
- }
316
- return true;
317
- }
318
- function _getObjName(target, unknownValue) {
319
- if (_hasOwnProperty(target, Prototype)) {
320
- return target.name || unknownValue || UnknownValue;
321
- }
322
- return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
346
+ });
347
+ return lazyValue;
323
348
  }
324
- function dynamicProto(theClass, target, delegateFunc, options) {
325
- if (!_hasOwnProperty(theClass, Prototype)) {
326
- _throwTypeError("theClass is an invalid class definition.");
327
- }
328
- var classProto = theClass[Prototype];
329
- if (!_checkPrototype(classProto, target)) {
330
- _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]");
331
- }
332
- var className = null;
333
- if (_hasOwnProperty(classProto, DynClassName)) {
334
- className = classProto[DynClassName];
335
- }
336
- else {
337
- className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n;
338
- _gblInst.n++;
339
- classProto[DynClassName] = className;
340
- }
341
- var perfOptions = dynamicProto[DynProtoDefaultOptions];
342
- var useBaseInst = !!perfOptions[strUseBaseInst];
343
- if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
344
- useBaseInst = !!options[strUseBaseInst];
345
- }
346
- var instFuncs = _getInstanceFuncs(target);
347
- var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
348
- delegateFunc(target, baseFuncs);
349
- var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
350
- if (setInstanceFunc && options) {
351
- setInstanceFunc = !!options[strSetInstFuncs];
352
- }
353
- _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
349
+
350
+ function _lazySafeGet(cb, defValue) {
351
+ return getLazy(function () { return _safeGet(cb, defValue); });
354
352
  }
355
- dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
356
353
 
357
- /*!
358
- * NevWare21 - ts-utils, 0.8.1
359
- * https://github.com/nevware21/ts-utils
360
- * Copyright (c) NevWare21 and contributors. All rights reserved.
361
- * Licensed under the MIT license.
362
- */
363
- var UNDEF_VALUE = undefined;
364
- var EMPTY = "";
365
- var FUNCTION = "function";
366
- var NUMBER = "number";
367
- var OBJECT = "object";
368
- var PROTOTYPE = "prototype";
369
- var STRING = "string";
370
- var UNDEFINED = "undefined";
371
- var CONSTRUCTOR = "constructor";
372
- var HAS_OWN_PROPERTY = "hasOwnProperty";
373
- var SYMBOL = "Symbol";
374
- var POLYFILL_TAG = "_polyfill";
375
- var INDEX_OF = "indexOf";
376
- var LENGTH = "length";
377
- var DONE = "done";
378
- var VALUE = "value";
379
- var NAME = "name";
380
- var ObjClass = Object;
381
- var ObjProto = ObjClass[PROTOTYPE];
382
- var StrCls = String;
383
- var MathCls = Math;
384
- var ArrCls = Array;
385
- var ArrProto = ArrCls[PROTOTYPE];
386
- function _safeGet(cb, defValue) {
387
- var result = defValue;
388
- try {
389
- result = cb();
354
+ var WINDOW = "window";
355
+ var _cachedGlobal;
356
+ var _cachedWindow;
357
+ var _cachedDocument;
358
+ var _cachedNavigator;
359
+ function _lazySafeGetInst(name) {
360
+ return _lazySafeGet(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
361
+ }
362
+ function getGlobal(useCached) {
363
+ (!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = _lazySafeGet(_getGlobalValue, null));
364
+ return _cachedGlobal.v;
365
+ }
366
+ function getInst(name, useCached) {
367
+ var gbl = getGlobal(useCached);
368
+ if (gbl && gbl[name]) {
369
+ return gbl[name];
390
370
  }
391
- catch (e) {
371
+ if (name === WINDOW && _cachedWindow) {
372
+ return _cachedWindow.v;
392
373
  }
393
- return result;
374
+ return null;
394
375
  }
395
- function _createIs(theType) {
396
- return function (value) {
397
- return typeof value === theType;
398
- };
376
+ function getDocument() {
377
+ (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = _lazySafeGetInst("document"));
378
+ return _cachedDocument.v;
399
379
  }
400
- function _createObjIs(theName) {
401
- var theType = "[object " + theName + "]";
402
- return function (value) {
403
- return !!(value && objToString(value) === theType);
404
- };
380
+ function hasWindow() {
381
+ return !!getWindow();
405
382
  }
406
- function objToString(value) {
407
- return ObjProto.toString.call(value);
383
+ function getWindow() {
384
+ (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGetInst(WINDOW));
385
+ return _cachedWindow.v;
408
386
  }
409
- function isUndefined(value) {
410
- return typeof value === UNDEFINED || value === UNDEFINED;
387
+ function getNavigator() {
388
+ (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = _lazySafeGetInst("navigator"));
389
+ return _cachedNavigator.v;
411
390
  }
412
- function isNullOrUndefined(value) {
413
- return value === null || isUndefined(value);
391
+
392
+ var _symbol;
393
+ var _symbolFor;
394
+ var _symbolKeyFor;
395
+ function _getSymbolValue(name) {
396
+ return _lazySafeGet(function () {
397
+ return (_symbol.v ? _symbol[name] : UNDEF_VALUE);
398
+ }, UNDEF_VALUE);
414
399
  }
415
- function isDefined(arg) {
416
- return !!arg || arg !== UNDEF_VALUE;
400
+ function getSymbol() {
401
+ var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b);
402
+ resetCache && (_symbol = _lazySafeGetInst(SYMBOL));
403
+ (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for"));
404
+ (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor"));
405
+ return _symbol.v;
417
406
  }
418
- var isString = _createIs(STRING);
419
- var isFunction = _createIs(FUNCTION);
420
- function isObject(value) {
421
- if (!value && isNullOrUndefined(value)) {
422
- return false;
423
- }
424
- return !!value && typeof value === OBJECT;
407
+ function getKnownSymbol(name, noPoly) {
408
+ var knownName = _wellKnownSymbolMap[name];
409
+ (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
410
+ return _symbol.v ? _symbol.v[knownName || name] : (!noPoly ? polyGetKnownSymbol(name) : UNDEF_VALUE);
425
411
  }
426
- var isArray = ArrCls.isArray;
427
- var isNumber = _createIs(NUMBER);
428
- var isError = _createObjIs("Error");
429
- function isTruthy(value) {
430
- return !(!value || _safeGet(function () { return !(value && (0 + value)); }, !value));
412
+ function newSymbol(description, noPoly) {
413
+ (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
414
+ return _symbol.v ? _symbol.v(description) : (!noPoly ? polyNewSymbol(description) : null);
431
415
  }
432
- var objGetOwnPropertyDescriptor = ObjClass.getOwnPropertyDescriptor;
433
- function objHasOwnProperty(obj, prop) {
434
- return obj && ObjProto[HAS_OWN_PROPERTY].call(obj, prop);
416
+ function symbolFor(key) {
417
+ (!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
418
+ return (_symbolFor.v || polySymbolFor)(key);
435
419
  }
436
- var objHasOwn = ObjClass["hasOwn"] || polyObjHasOwn;
437
- function polyObjHasOwn(obj, prop) {
438
- return objHasOwnProperty(obj, prop) || !!objGetOwnPropertyDescriptor(obj, prop);
420
+
421
+ function isIterator(value) {
422
+ return !!value && isFunction(value.next);
439
423
  }
440
- function objForEachKey(theObject, callbackfn, thisArg) {
441
- if (theObject && isObject(theObject)) {
442
- for (var prop in theObject) {
443
- if (objHasOwn(theObject, prop)) {
444
- if (callbackfn.call(thisArg || theObject, prop, theObject[prop]) === -1) {
445
- break;
424
+ function isIterable(value) {
425
+ return !isStrictNullOrUndefined(value) && isFunction(value[getKnownSymbol(3 )]);
426
+ }
427
+
428
+ function iterForOf(iter, callbackfn, thisArg) {
429
+ if (iter) {
430
+ if (!isIterator(iter)) {
431
+ var itSymbol = getKnownSymbol(3 );
432
+ iter = iter[itSymbol] ? iter[itSymbol]() : null;
433
+ }
434
+ if (isIterator(iter)) {
435
+ try {
436
+ var count = 0;
437
+ var value = iter.next();
438
+ while (!value[DONE]) {
439
+ if (callbackfn.call(thisArg || iter, value[VALUE], count, iter) === -1) {
440
+ break;
441
+ }
442
+ count++;
443
+ value = iter.next();
446
444
  }
445
+ iter.return && iter.return(value);
447
446
  }
448
- }
449
- }
450
- }
451
- function _createKeyValueMap(values, keyType, valueType, completeFn) {
452
- var theMap = {};
453
- objForEachKey(values, function (key, value) {
454
- theMap[key] = keyType ? value : key;
455
- theMap[value] = valueType ? value : key;
456
- });
457
- return completeFn(theMap);
458
- }
459
- function throwTypeError(message) {
460
- throw new TypeError(message);
461
- }
462
- var _objFreeze = ObjClass["freeze"];
463
- var _doNothing = function (value) { return value; };
464
- function objKeys(value) {
465
- if (!isObject(value) || value === null) {
466
- throwTypeError("objKeys called on non-object");
467
- }
468
- return ObjClass.keys(value);
469
- }
470
- function objDeepFreeze(value) {
471
- if (_objFreeze) {
472
- objForEachKey(value, function (key, value) {
473
- if (isArray(value) || isObject(value)) {
474
- _objFreeze(value);
447
+ catch (e) {
448
+ iter.throw && iter.throw(e);
475
449
  }
476
- });
450
+ }
477
451
  }
478
- return objFreeze(value);
479
452
  }
480
- var objFreeze = _objFreeze || _doNothing;
481
- var objGetPrototypeOf = ObjClass["getPrototypeOf"] || _doNothing;
482
- function createEnum(values) {
483
- return _createKeyValueMap(values, 1 , 0 , objDeepFreeze);
484
- }
485
- function createEnumKeyMap(values) {
486
- return _createKeyValueMap(values, 0 , 0 , objDeepFreeze);
487
- }
488
- createEnumKeyMap({
489
- asyncIterator: 0 ,
490
- hasInstance: 1 ,
491
- isConcatSpreadable: 2 ,
492
- iterator: 3 ,
493
- match: 4 ,
494
- matchAll: 5 ,
495
- replace: 6 ,
496
- search: 7 ,
497
- species: 8 ,
498
- split: 9 ,
499
- toPrimitive: 10 ,
500
- toStringTag: 11 ,
501
- unscopables: 12
502
- });
503
- var asString = StrCls;
504
- var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg";
505
- var _globalCfg;
506
- function _getGlobalValue() {
507
- var result;
508
- if (typeof globalThis !== UNDEFINED) {
509
- result = globalThis;
510
- }
511
- if (!result && typeof self !== UNDEFINED) {
512
- result = self;
513
- }
514
- if (!result && typeof window !== UNDEFINED) {
515
- result = window;
453
+
454
+ function arrAppend(target, elms) {
455
+ if (!isUndefined(elms) && target) {
456
+ if (isArray(elms)) {
457
+ target.push.apply(target, elms);
458
+ }
459
+ else if (isIterator(elms) || isIterable(elms)) {
460
+ iterForOf(elms, function (elm) {
461
+ target.push(elm);
462
+ });
463
+ }
464
+ else {
465
+ target.push(elms);
466
+ }
516
467
  }
517
- if (!result && typeof global !== UNDEFINED) {
518
- result = global;
468
+ return target;
469
+ }
470
+
471
+ function arrForEach(theArray, callbackfn, thisArg) {
472
+ if (theArray) {
473
+ var len = theArray[LENGTH] >>> 0;
474
+ for (var idx = 0; idx < len; idx++) {
475
+ if (idx in theArray) {
476
+ if (callbackfn.call(thisArg || theArray, theArray[idx], idx, theArray) === -1) {
477
+ break;
478
+ }
479
+ }
480
+ }
519
481
  }
520
- return result;
521
482
  }
522
- function _getGlobalConfig() {
523
- if (!_globalCfg) {
524
- var gbl = _getGlobalValue() || {};
525
- _globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {};
483
+
484
+ var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);
485
+
486
+ var arrSlice = _unwrapFunction(SLICE, ArrProto);
487
+
488
+ function objSetPrototypeOf(obj, proto) {
489
+ var fn = ObjClass["setPrototypeOf"] ||
490
+ ({ __proto__: [] } instanceof Array && function (d, b) {
491
+ d.__proto__ = b;
492
+ }) ||
493
+ function (d, b) {
494
+ objForEachKey(b, function (key, value) { return d[key] = value; });
495
+ };
496
+ return fn(obj, proto);
497
+ }
498
+
499
+ function _createCustomError(name, d, baseClass) {
500
+ objSetPrototypeOf(d, baseClass);
501
+ function __() {
502
+ this.constructor = d;
503
+ this[NAME] = name;
526
504
  }
527
- return _globalCfg;
505
+ __[PROTOTYPE] = baseClass[PROTOTYPE];
506
+ d[PROTOTYPE] = new __();
507
+ return d;
528
508
  }
529
- function dumpObj(object, format) {
530
- var propertyValueDump = "";
531
- if (isError(object)) {
532
- propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
509
+ var _safeSetName = function (baseClass, name) {
510
+ try {
511
+ baseClass[PROTOTYPE][NAME] = name;
533
512
  }
534
- else {
513
+ catch (e) {
514
+ }
515
+ };
516
+ function createCustomError(name, constructCb) {
517
+ var baseClass = Error;
518
+ var orgName = baseClass[PROTOTYPE][NAME];
519
+ var customError = _createCustomError(name, function () {
520
+ var _this = this;
535
521
  try {
536
- propertyValueDump = JSON.stringify(object, null, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);
522
+ _safeSetName(baseClass, name);
523
+ _this = baseClass.apply(_this, arguments) || _this;
524
+ _this[NAME] = name;
525
+ constructCb && constructCb(_this, arguments);
537
526
  }
538
- catch (e) {
539
- propertyValueDump = " - " + dumpObj(e, format);
527
+ finally {
528
+ _safeSetName(baseClass, orgName);
540
529
  }
541
- }
542
- return objToString(object) + ": " + propertyValueDump;
530
+ return _this;
531
+ }, baseClass);
532
+ return customError;
543
533
  }
544
- function _extractArgs(args, startAt) {
545
- var theArgs = [];
546
- for (var lp = startAt; lp < args[LENGTH]; lp++) {
547
- theArgs[lp - startAt] = args[lp];
548
- }
549
- return theArgs;
534
+
535
+ function utcNow() {
536
+ return (Date.now || polyUtcNow)();
550
537
  }
551
- function _unwrapFunction(funcName, target, polyFunc) {
552
- return function (thisArg) {
553
- if ((thisArg || thisArg === EMPTY)) {
554
- var theFunc = thisArg[funcName] || (target && target[funcName]);
555
- if (theFunc) {
556
- return theFunc.apply(thisArg, _extractArgs(arguments, 1));
557
- }
558
- if (polyFunc) {
559
- return polyFunc.apply(thisArg, arguments);
560
- }
538
+ function polyUtcNow() {
539
+ return new Date().getTime();
540
+ }
541
+
542
+ function _createTrimFn(exp) {
543
+ return function _doTrim(value) {
544
+ if (isNullOrUndefined(value)) {
545
+ throwTypeError("strTrim called [" + dumpObj(value) + "]");
561
546
  }
562
- throwTypeError("'" + asString(funcName) + "' not defined for " + dumpObj(thisArg));
547
+ if (value && value.replace) {
548
+ value = value.replace(exp, EMPTY);
549
+ }
550
+ return value;
563
551
  };
564
552
  }
565
- var mathMax = MathCls.max;
566
- var strSlice = _unwrapFunction("slice");
567
- var SUB_STR = "substr";
568
- var strSubstring = _unwrapFunction("substring");
569
- var strSubstr = _unwrapFunction(SUB_STR, UNDEF_VALUE, polyStrSubstr);
570
- function polyStrSubstr(value, start, length) {
571
- if (isNullOrUndefined(value)) {
572
- throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
573
- }
574
- if (length < 0) {
575
- return EMPTY;
553
+ var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
554
+
555
+ var strTrim = _unwrapFunction("trim", StrProto, polyStrTrim);
556
+
557
+ var _fnToString;
558
+ var _objCtrFnString;
559
+ var _gblWindow;
560
+ function isPlainObject(value) {
561
+ if (!value || typeof value !== OBJECT) {
562
+ return false;
576
563
  }
577
- start = start || 0;
578
- if (start < 0) {
579
- start = mathMax(start + value[LENGTH], 0);
564
+ if (!_gblWindow) {
565
+ _gblWindow = hasWindow() ? getWindow() : true;
580
566
  }
581
- if (isUndefined(length)) {
582
- return strSlice(value, start);
567
+ var result = false;
568
+ if (value !== _gblWindow) {
569
+ if (!_objCtrFnString) {
570
+ _fnToString = Function[PROTOTYPE].toString;
571
+ _objCtrFnString = _fnToString.call(ObjClass);
572
+ }
573
+ try {
574
+ var proto = objGetPrototypeOf(value);
575
+ result = !proto;
576
+ if (!result) {
577
+ if (objHasOwnProperty(proto, CONSTRUCTOR)) {
578
+ proto = proto[CONSTRUCTOR];
579
+ }
580
+ result = proto && typeof proto === FUNCTION && _fnToString.call(proto) === _objCtrFnString;
581
+ }
582
+ }
583
+ catch (ex) {
584
+ }
583
585
  }
584
- return strSlice(value, start, start + length);
585
- }
586
- function strLeft(value, count) {
587
- return strSubstring(value, 0, count);
586
+ return result;
588
587
  }
589
- var _polySymbols;
590
- function _globalSymbolRegistry() {
591
- if (!_polySymbols) {
592
- var gblCfg = _getGlobalConfig();
593
- _polySymbols = gblCfg.gblSym = gblCfg.gblSym || { k: {}, s: {} };
588
+
589
+ var _objCreate = ObjClass["create"];
590
+ var objCreate = _objCreate || polyObjCreate;
591
+ function polyObjCreate(obj) {
592
+ if (!obj) {
593
+ return {};
594
594
  }
595
- return _polySymbols;
596
- }
597
- function polyNewSymbol(description) {
598
- var theSymbol = {
599
- description: asString(description),
600
- toString: function () { return SYMBOL + "(" + description + ")"; }
601
- };
602
- theSymbol[POLYFILL_TAG] = true;
603
- return theSymbol;
595
+ var type = typeof obj;
596
+ if (type !== OBJECT && type !== FUNCTION) {
597
+ throw new TypeError("Prototype must be an Object or function: " + dumpObj(obj));
598
+ }
599
+ function tempFunc() { }
600
+ tempFunc[PROTOTYPE] = obj;
601
+ return new tempFunc();
604
602
  }
605
- function polySymbolFor(key) {
606
- var registry = _globalSymbolRegistry();
607
- if (!objHasOwn(registry, key)) {
608
- var newSymbol = polyNewSymbol(key);
609
- registry.k[key] = newSymbol;
610
- registry.s[newSymbol] = asString(key);
603
+
604
+ var strEndsWith = _unwrapFunction("endsWith", StrProto, polyStrEndsWith);
605
+ function polyStrEndsWith(value, searchString, length) {
606
+ if (!isString(value)) {
607
+ throwTypeError("'" + dumpObj(value) + "' is not a string");
611
608
  }
612
- return registry.k[key];
609
+ var searchValue = isString(searchString) ? searchString : asString(searchString);
610
+ var chkLen = searchValue[LENGTH];
611
+ var len = value[LENGTH];
612
+ var end = !isUndefined(length) && length < len ? length : len;
613
+ return strSubstring(value, end - chkLen, end) === searchValue;
613
614
  }
614
- var propMap = {
615
- e: "enumerable",
616
- c: "configurable",
617
- v: VALUE,
618
- w: "writable",
619
- g: "get",
620
- s: "set"
621
- };
622
- function _createProp(value) {
623
- var prop = {};
624
- prop[propMap["c"]] = true;
625
- prop[propMap["e"]] = true;
626
- objForEachKey(value, function (key, value) {
627
- prop[propMap[key]] = isUndefined(value) ? prop[propMap[key]] : value;
615
+
616
+ var strIndexOf = _unwrapFunction(INDEX_OF, StrProto);
617
+
618
+ var REF = "ref";
619
+ var UNREF = "un" + REF;
620
+ var HAS_REF = "hasRef";
621
+ var ENABLED = "enabled";
622
+ function _createTimerHandler(startTimer, refreshFn, cancelFn) {
623
+ var _a;
624
+ var ref = true;
625
+ var timerId = startTimer ? refreshFn(null) : null;
626
+ var theTimerHandler;
627
+ var _unref = function () {
628
+ ref = false;
629
+ timerId && timerId[UNREF] && timerId[UNREF]();
630
+ return theTimerHandler;
631
+ };
632
+ var _ref = function () {
633
+ ref = true;
634
+ timerId && timerId[REF] && timerId[REF]();
635
+ return theTimerHandler;
636
+ };
637
+ var _hasRef = function () {
638
+ if (timerId && timerId[HAS_REF]) {
639
+ return timerId[HAS_REF]();
640
+ }
641
+ return ref;
642
+ };
643
+ var _refresh = function () {
644
+ timerId = refreshFn(timerId);
645
+ if (!ref) {
646
+ _unref();
647
+ }
648
+ return theTimerHandler;
649
+ };
650
+ var _cancel = function () {
651
+ timerId && cancelFn(timerId);
652
+ timerId = null;
653
+ };
654
+ var _setEnabled = function (value) {
655
+ !value && timerId && _cancel();
656
+ value && !timerId && _refresh();
657
+ };
658
+ theTimerHandler = (_a = {
659
+ cancel: _cancel,
660
+ refresh: _refresh
661
+ },
662
+ _a[HAS_REF] = _hasRef,
663
+ _a[REF] = _ref,
664
+ _a[UNREF] = _unref,
665
+ _a[ENABLED] = false,
666
+ _a);
667
+ objDefineProp(theTimerHandler, ENABLED, {
668
+ get: function () { return !!timerId; },
669
+ set: _setEnabled
628
670
  });
629
- return prop;
630
- }
631
- var objDefineProp = ObjClass["defineProperty"];
632
- function objDefine(target, key, propDesc) {
633
- return objDefineProp(target, key, _createProp(propDesc));
671
+ return {
672
+ h: theTimerHandler,
673
+ dn: function () {
674
+ timerId = null;
675
+ }
676
+ };
634
677
  }
635
- var _globalLazyTestHooks;
636
- var _fetchLazyTestHooks = function () {
637
- _globalLazyTestHooks = _getGlobalConfig();
638
- _fetchLazyTestHooks = null;
639
- };
640
- function getLazy(cb) {
641
- var lazyValue = {};
642
- _fetchLazyTestHooks && _fetchLazyTestHooks();
643
- lazyValue.b = _globalLazyTestHooks.lzy;
644
- objDefine(lazyValue, "v", {
645
- g: function () {
646
- var result = cb();
647
- if (!_globalLazyTestHooks.lzy) {
648
- objDefine(lazyValue, "v", { v: result });
649
- if (lazyValue.b) {
650
- delete lazyValue.b;
651
- }
652
- }
653
- if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) {
654
- lazyValue.b = _globalLazyTestHooks.lzy;
678
+
679
+ function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
680
+ var isArr = isArray(overrideFn);
681
+ var len = isArr ? overrideFn.length : 0;
682
+ var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
683
+ var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
684
+ var timerFn = theArgs[0];
685
+ theArgs[0] = function () {
686
+ handler.dn();
687
+ timerFn.apply(self, arguments);
688
+ };
689
+ var handler = _createTimerHandler(startTimer, function (timerId) {
690
+ if (timerId) {
691
+ if (timerId.refresh) {
692
+ timerId.refresh();
693
+ return timerId;
655
694
  }
656
- return result;
695
+ clearFn.call(self, timerId);
657
696
  }
697
+ return setFn.apply(self, theArgs);
698
+ }, function (timerId) {
699
+ clearFn.call(self, timerId);
658
700
  });
659
- return lazyValue;
660
- }
661
- function _lazySafeGet(cb, defValue) {
662
- return getLazy(function () { return _safeGet(cb, defValue); });
663
- }
664
- var DOCUMENT = "document";
665
- var NAVIGATOR = "navigator";
666
- var WINDOW = "window";
667
- var _cachedGlobal;
668
- var _cachedWindow;
669
- var _cachedDocument;
670
- var _cachedNavigator;
671
- function _lazySafeGetInst(name) {
672
- return _lazySafeGet(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
701
+ return handler.h;
673
702
  }
674
- function getGlobal(useCached) {
675
- (!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = _lazySafeGet(_getGlobalValue, null));
676
- return _cachedGlobal.v;
703
+ function scheduleTimeout(callback, timeout) {
704
+ return _createTimeoutWith(this, true, UNDEF_VALUE, arrSlice(arguments));
677
705
  }
678
- function getInst(name, useCached) {
679
- var gbl = getGlobal(useCached);
680
- if (gbl && gbl[name]) {
681
- return gbl[name];
706
+
707
+ (getGlobal() || {})["Symbol"];
708
+ (getGlobal() || {})["Reflect"];
709
+ var strHasOwnProperty = "hasOwnProperty";
710
+ var extendStaticsFn = function (d, b) {
711
+ extendStaticsFn = ObjClass$1["setPrototypeOf"] ||
712
+ ({ __proto__: [] } instanceof Array && function (d, b) {
713
+ d.__proto__ = b;
714
+ }) ||
715
+ function (d, b) {
716
+ for (var p in b) {
717
+ if (b[strHasOwnProperty](p)) {
718
+ d[p] = b[p];
719
+ }
720
+ }
721
+ };
722
+ return extendStaticsFn(d, b);
723
+ };
724
+ function __extendsFn(d, b) {
725
+ if (typeof b !== strShimFunction && b !== null) {
726
+ throwTypeError("Class extends value " + String(b) + " is not a constructor or null");
682
727
  }
683
- if (name === WINDOW && _cachedWindow) {
684
- return _cachedWindow.v;
728
+ extendStaticsFn(d, b);
729
+ function __() {
730
+ this.constructor = d;
685
731
  }
686
- return null;
687
- }
688
- function getDocument() {
689
- (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = _lazySafeGetInst(DOCUMENT));
690
- return _cachedDocument.v;
691
- }
692
- function hasWindow() {
693
- return !!getWindow();
732
+ d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new __());
694
733
  }
695
- function getWindow() {
696
- (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGetInst(WINDOW));
697
- return _cachedWindow.v;
734
+
735
+ var _a$3;
736
+ var Constructor = 'constructor';
737
+ var Prototype = 'prototype';
738
+ var strFunction = 'function';
739
+ var DynInstFuncTable = '_dynInstFuncs';
740
+ var DynProxyTag = '_isDynProxy';
741
+ var DynClassName = '_dynClass';
742
+ var DynClassNamePrefix = '_dynCls$';
743
+ var DynInstChkTag = '_dynInstChk';
744
+ var DynAllowInstChkTag = DynInstChkTag;
745
+ var DynProtoDefaultOptions = '_dfOpts';
746
+ var UnknownValue = '_unknown_';
747
+ var str__Proto = "__proto__";
748
+ var DynProtoBaseProto = "_dyn" + str__Proto;
749
+ var DynProtoGlobalSettings = "__dynProto$Gbl";
750
+ var DynProtoCurrent = "_dynInstProto";
751
+ var strUseBaseInst = 'useBaseInst';
752
+ var strSetInstFuncs = 'setInstFuncs';
753
+ var Obj = Object;
754
+ var _objGetPrototypeOf = Obj["getPrototypeOf"];
755
+ var _objGetOwnProps = Obj["getOwnPropertyNames"];
756
+ var _gbl = getGlobal();
757
+ var _gblInst = _gbl[DynProtoGlobalSettings] || (_gbl[DynProtoGlobalSettings] = {
758
+ o: (_a$3 = {},
759
+ _a$3[strSetInstFuncs] = true,
760
+ _a$3[strUseBaseInst] = true,
761
+ _a$3),
762
+ n: 1000
763
+ });
764
+ function _isObjectOrArrayPrototype(target) {
765
+ return target && (target === Obj[Prototype] || target === Array[Prototype]);
698
766
  }
699
- function getNavigator() {
700
- (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = _lazySafeGetInst(NAVIGATOR));
701
- return _cachedNavigator.v;
767
+ function _isObjectArrayOrFunctionPrototype(target) {
768
+ return _isObjectOrArrayPrototype(target) || target === Function[Prototype];
702
769
  }
703
- var _symbol;
704
- var _symbolFor;
705
- var _symbolKeyFor;
706
- function _getSymbolValue(name) {
707
- return _lazySafeGet(function () {
708
- return (_symbol.v ? _symbol[name] : UNDEF_VALUE);
709
- }, UNDEF_VALUE);
770
+ function _getObjProto(target) {
771
+ var newProto;
772
+ if (target) {
773
+ if (_objGetPrototypeOf) {
774
+ return _objGetPrototypeOf(target);
775
+ }
776
+ var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null);
777
+ newProto = target[DynProtoBaseProto] || curProto;
778
+ if (!objHasOwnProperty(target, DynProtoBaseProto)) {
779
+ delete target[DynProtoCurrent];
780
+ newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto];
781
+ target[DynProtoCurrent] = curProto;
782
+ }
783
+ }
784
+ return newProto;
710
785
  }
711
- function getSymbol() {
712
- var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b);
713
- resetCache && (_symbol = _lazySafeGetInst(SYMBOL));
714
- (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for"));
715
- (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor"));
716
- return _symbol.v;
786
+ function _forEachProp(target, func) {
787
+ var props = [];
788
+ if (_objGetOwnProps) {
789
+ props = _objGetOwnProps(target);
790
+ }
791
+ else {
792
+ for (var name_1 in target) {
793
+ if (typeof name_1 === "string" && objHasOwnProperty(target, name_1)) {
794
+ props.push(name_1);
795
+ }
796
+ }
797
+ }
798
+ if (props && props.length > 0) {
799
+ for (var lp = 0; lp < props.length; lp++) {
800
+ func(props[lp]);
801
+ }
802
+ }
717
803
  }
718
- function newSymbol(description, noPoly) {
719
- (!_symbol || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
720
- return _symbol.v ? _symbol.v(description) : (!noPoly ? polyNewSymbol(description) : null);
804
+ function _isDynamicCandidate(target, funcName, skipOwn) {
805
+ return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || objHasOwnProperty(target, funcName)));
721
806
  }
722
- function symbolFor(key) {
723
- (!_symbolFor || (_globalLazyTestHooks.lzy && !_symbol.b)) && getSymbol();
724
- return (_symbolFor.v || polySymbolFor)(key);
807
+ function _throwTypeError(message) {
808
+ throwTypeError("DynamicProto: " + message);
725
809
  }
726
- function isIterator(value) {
727
- return !!value && isFunction(value.next);
810
+ function _getInstanceFuncs(thisTarget) {
811
+ var instFuncs = {};
812
+ _forEachProp(thisTarget, function (name) {
813
+ if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) {
814
+ instFuncs[name] = thisTarget[name];
815
+ }
816
+ });
817
+ return instFuncs;
728
818
  }
729
- function arrAppend(target, elms) {
730
- if (!isUndefined(elms) && target) {
731
- if (isArray(elms)) {
732
- target.push.apply(target, elms);
819
+ function _hasVisited(values, value) {
820
+ for (var lp = values.length - 1; lp >= 0; lp--) {
821
+ if (values[lp] === value) {
822
+ return true;
733
823
  }
734
- else if (isIterator(elms)) {
735
- var value = elms.next();
736
- while (!value[DONE]) {
737
- target.push(value[VALUE]);
738
- value = elms.next();
824
+ }
825
+ return false;
826
+ }
827
+ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) {
828
+ function _instFuncProxy(target, funcHost, funcName) {
829
+ var theFunc = funcHost[funcName];
830
+ if (theFunc[DynProxyTag] && useBaseInst) {
831
+ var instFuncTable = target[DynInstFuncTable] || {};
832
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
833
+ theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc;
739
834
  }
740
835
  }
741
- else {
742
- target.push(elms);
743
- }
836
+ return function () {
837
+ return theFunc.apply(target, arguments);
838
+ };
744
839
  }
745
- return target;
840
+ var baseFuncs = {};
841
+ _forEachProp(instFuncs, function (name) {
842
+ baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name);
843
+ });
844
+ var baseProto = _getObjProto(classProto);
845
+ var visited = [];
846
+ while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) {
847
+ _forEachProp(baseProto, function (name) {
848
+ if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) {
849
+ baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name);
850
+ }
851
+ });
852
+ visited.push(baseProto);
853
+ baseProto = _getObjProto(baseProto);
854
+ }
855
+ return baseFuncs;
746
856
  }
747
- function arrForEach(theArray, callbackfn, thisArg) {
748
- if (theArray) {
749
- var len = theArray[LENGTH] >>> 0;
750
- for (var idx = 0; idx < len; idx++) {
751
- if (idx in theArray) {
752
- if (callbackfn.call(thisArg || theArray, theArray[idx], idx, theArray) === -1) {
857
+ function _getInstFunc(target, funcName, proto, currentDynProtoProxy) {
858
+ var instFunc = null;
859
+ if (target && objHasOwnProperty(proto, DynClassName)) {
860
+ var instFuncTable = target[DynInstFuncTable] || {};
861
+ instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName];
862
+ if (!instFunc) {
863
+ _throwTypeError("Missing [" + funcName + "] " + strFunction);
864
+ }
865
+ if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) {
866
+ var canAddInst = !objHasOwnProperty(target, funcName);
867
+ var objProto = _getObjProto(target);
868
+ var visited = [];
869
+ while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) {
870
+ var protoFunc = objProto[funcName];
871
+ if (protoFunc) {
872
+ canAddInst = (protoFunc === currentDynProtoProxy);
753
873
  break;
754
874
  }
875
+ visited.push(objProto);
876
+ objProto = _getObjProto(objProto);
877
+ }
878
+ try {
879
+ if (canAddInst) {
880
+ target[funcName] = instFunc;
881
+ }
882
+ instFunc[DynInstChkTag] = 1;
883
+ }
884
+ catch (e) {
885
+ instFuncTable[DynAllowInstChkTag] = false;
755
886
  }
756
887
  }
757
888
  }
889
+ return instFunc;
758
890
  }
759
- var arrIndexOf = _unwrapFunction(INDEX_OF, ArrProto);
760
- function objSetPrototypeOf(obj, proto) {
761
- var fn = ObjClass["setPrototypeOf"] ||
762
- ({ __proto__: [] } instanceof Array && function (d, b) {
763
- d.__proto__ = b;
764
- }) ||
765
- function (d, b) {
766
- objForEachKey(b, function (key, value) { return d[key] = value; });
767
- };
768
- return fn(obj, proto);
769
- }
770
- function _createCustomError(name, d, baseClass) {
771
- objSetPrototypeOf(d, baseClass);
772
- function __() {
773
- this.constructor = d;
774
- this[NAME] = name;
775
- }
776
- __[PROTOTYPE] = baseClass[PROTOTYPE];
777
- d[PROTOTYPE] = new __();
778
- return d;
779
- }
780
- var _safeSetName = function (baseClass, name) {
781
- try {
782
- baseClass[PROTOTYPE][NAME] = name;
891
+ function _getProtoFunc(funcName, proto, currentDynProtoProxy) {
892
+ var protoFunc = proto[funcName];
893
+ if (protoFunc === currentDynProtoProxy) {
894
+ protoFunc = _getObjProto(proto)[funcName];
783
895
  }
784
- catch (e) {
896
+ if (typeof protoFunc !== strFunction) {
897
+ _throwTypeError("[" + funcName + "] is not a " + strFunction);
785
898
  }
786
- };
787
- function createCustomError(name, constructCb) {
788
- var baseClass = Error;
789
- var orgName = baseClass[PROTOTYPE][NAME];
790
- var customError = _createCustomError(name, function () {
791
- var _this = this;
792
- try {
793
- _safeSetName(baseClass, name);
794
- _this = baseClass.apply(_this, arguments) || _this;
795
- _this[NAME] = name;
796
- constructCb && constructCb(_this, arguments);
797
- }
798
- finally {
799
- _safeSetName(baseClass, orgName);
800
- }
801
- return _this;
802
- }, baseClass);
803
- return customError;
804
- }
805
- function utcNow() {
806
- return (Date.now || polyUtcNow)();
807
- }
808
- function polyUtcNow() {
809
- return new Date().getTime();
899
+ return protoFunc;
810
900
  }
811
- var _fnToString;
812
- var _objCtrFnString;
813
- var _gblWindow;
814
- function isPlainObject(value) {
815
- if (!value || typeof value !== OBJECT) {
816
- return false;
817
- }
818
- if (!_gblWindow) {
819
- _gblWindow = hasWindow() ? getWindow() : true;
901
+ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) {
902
+ function _createDynamicPrototype(proto, funcName) {
903
+ var dynProtoProxy = function () {
904
+ var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy);
905
+ return instFunc.apply(this, arguments);
906
+ };
907
+ dynProtoProxy[DynProxyTag] = 1;
908
+ return dynProtoProxy;
820
909
  }
821
- var result = false;
822
- if (value !== _gblWindow) {
823
- if (!_objCtrFnString) {
824
- _fnToString = Function[PROTOTYPE].toString;
825
- _objCtrFnString = _fnToString.call(ObjClass);
910
+ if (!_isObjectOrArrayPrototype(proto)) {
911
+ var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {};
912
+ var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {});
913
+ if (instFuncTable[DynAllowInstChkTag] !== false) {
914
+ instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc;
826
915
  }
827
- try {
828
- var proto = objGetPrototypeOf(value);
829
- result = !proto;
830
- if (!result) {
831
- if (objHasOwnProperty(proto, CONSTRUCTOR)) {
832
- proto = proto[CONSTRUCTOR];
916
+ _forEachProp(target, function (name) {
917
+ if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) {
918
+ instFuncs_1[name] = target[name];
919
+ delete target[name];
920
+ if (!objHasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) {
921
+ proto[name] = _createDynamicPrototype(proto, name);
833
922
  }
834
- result = proto && typeof proto === FUNCTION && _fnToString.call(proto) === _objCtrFnString;
835
923
  }
836
- }
837
- catch (ex) {
838
- }
839
- }
840
- return result;
841
- }
842
- var ENDS_WITH = "endsWith";
843
- var strEndsWith = _unwrapFunction(ENDS_WITH, UNDEF_VALUE, polyStrEndsWith);
844
- function polyStrEndsWith(value, searchString, length) {
845
- if (!isString(value)) {
846
- throwTypeError("'" + dumpObj(value) + "' is not a string");
924
+ });
847
925
  }
848
- var searchValue = isString(searchString) ? searchString : asString(searchString);
849
- var chkLen = searchValue[LENGTH];
850
- var len = value[LENGTH];
851
- var end = !isUndefined(length) && length < len ? length : len;
852
- return strSubstring(value, end - chkLen, end) === searchValue;
853
- }
854
- var strIndexOf = _unwrapFunction(INDEX_OF);
855
- function _createTrimFn(exp) {
856
- return function _doTrim(value) {
857
- if (isNullOrUndefined(value)) {
858
- throwTypeError("strTrim called [" + dumpObj(value) + "]");
859
- }
860
- if (value && value.replace) {
861
- value = value.replace(exp, "");
862
- }
863
- return value;
864
- };
865
- }
866
- var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
867
- var TRIM = "trim";
868
- var strTrim = _unwrapFunction(TRIM, UNDEF_VALUE, polyStrTrim);
869
- var REF = "ref";
870
- var UNREF = "un" + REF;
871
- var HAS_REF = "hasRef";
872
- var ENABLED = "enabled";
873
- function _createTimerHandler(startTimer, refreshFn, cancelFn) {
874
- var _a;
875
- var ref = true;
876
- var timerId = startTimer ? refreshFn(null) : null;
877
- var theTimerHandler;
878
- var _unref = function () {
879
- ref = false;
880
- timerId && timerId[UNREF] && timerId[UNREF]();
881
- return theTimerHandler;
882
- };
883
- var _ref = function () {
884
- ref = true;
885
- timerId && timerId[REF] && timerId[REF]();
886
- return theTimerHandler;
887
- };
888
- var _hasRef = function () {
889
- if (timerId && timerId[HAS_REF]) {
890
- return timerId[HAS_REF]();
891
- }
892
- return ref;
893
- };
894
- var _refresh = function () {
895
- timerId = refreshFn(timerId);
896
- if (!ref) {
897
- _unref();
898
- }
899
- return theTimerHandler;
900
- };
901
- var _cancel = function () {
902
- timerId && cancelFn(timerId);
903
- timerId = null;
904
- };
905
- var _setEnabled = function (value) {
906
- !value && timerId && _cancel();
907
- value && !timerId && _refresh();
908
- };
909
- theTimerHandler = (_a = {
910
- cancel: _cancel,
911
- refresh: _refresh
912
- },
913
- _a[HAS_REF] = _hasRef,
914
- _a[REF] = _ref,
915
- _a[UNREF] = _unref,
916
- _a[ENABLED] = false,
917
- _a);
918
- objDefineProp(theTimerHandler, ENABLED, {
919
- get: function () { return !!timerId; },
920
- set: _setEnabled
921
- });
922
- return {
923
- h: theTimerHandler,
924
- dn: function () {
925
- timerId = null;
926
- }
927
- };
928
926
  }
929
- function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
930
- var isArr = isArray(overrideFn);
931
- var len = isArr ? overrideFn.length : 0;
932
- var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
933
- var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
934
- var timerFn = theArgs[0];
935
- theArgs[0] = function () {
936
- handler.dn();
937
- timerFn.apply(self, arguments);
938
- };
939
- var handler = _createTimerHandler(startTimer, function (timerId) {
940
- if (timerId) {
941
- if (timerId.refresh) {
942
- timerId.refresh();
943
- return timerId;
927
+ function _checkPrototype(classProto, thisTarget) {
928
+ if (_objGetPrototypeOf) {
929
+ var visited = [];
930
+ var thisProto = _getObjProto(thisTarget);
931
+ while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) {
932
+ if (thisProto === classProto) {
933
+ return true;
944
934
  }
945
- clearFn.call(self, timerId);
935
+ visited.push(thisProto);
936
+ thisProto = _getObjProto(thisProto);
946
937
  }
947
- return setFn.apply(self, theArgs);
948
- }, function (timerId) {
949
- clearFn.call(self, timerId);
950
- });
951
- return handler.h;
938
+ return false;
939
+ }
940
+ return true;
952
941
  }
953
- function scheduleTimeout(callback, timeout) {
954
- return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
942
+ function _getObjName(target, unknownValue) {
943
+ if (objHasOwnProperty(target, Prototype)) {
944
+ return target.name || unknownValue || UnknownValue;
945
+ }
946
+ return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue;
955
947
  }
948
+ function dynamicProto(theClass, target, delegateFunc, options) {
949
+ if (!objHasOwnProperty(theClass, Prototype)) {
950
+ _throwTypeError("theClass is an invalid class definition.");
951
+ }
952
+ var classProto = theClass[Prototype];
953
+ if (!_checkPrototype(classProto, target)) {
954
+ _throwTypeError("[" + _getObjName(theClass) + "] not in hierarchy of [" + _getObjName(target) + "]");
955
+ }
956
+ var className = null;
957
+ if (objHasOwnProperty(classProto, DynClassName)) {
958
+ className = classProto[DynClassName];
959
+ }
960
+ else {
961
+ className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _gblInst.n;
962
+ _gblInst.n++;
963
+ classProto[DynClassName] = className;
964
+ }
965
+ var perfOptions = dynamicProto[DynProtoDefaultOptions];
966
+ var useBaseInst = !!perfOptions[strUseBaseInst];
967
+ if (useBaseInst && options && options[strUseBaseInst] !== undefined) {
968
+ useBaseInst = !!options[strUseBaseInst];
969
+ }
970
+ var instFuncs = _getInstanceFuncs(target);
971
+ var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst);
972
+ delegateFunc(target, baseFuncs);
973
+ var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs];
974
+ if (setInstanceFunc && options) {
975
+ setInstanceFunc = !!options[strSetInstFuncs];
976
+ }
977
+ _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false);
978
+ }
979
+ dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
956
980
 
957
981
  var createEnumStyle = createEnum;
958
982
 
@@ -1010,7 +1034,7 @@
1010
1034
  arrForEach(sourceErrors, function (srcError, idx) {
1011
1035
  theMessage += "\n".concat(idx, " > ").concat(dumpObj(srcError));
1012
1036
  });
1013
- throw new aggregationErrorType(message, sourceErrors || []);
1037
+ throw new aggregationErrorType(theMessage, sourceErrors || []);
1014
1038
  }
1015
1039
 
1016
1040
  var UNDEFINED_VALUE = undefined;
@@ -1181,15 +1205,17 @@
1181
1205
 
1182
1206
  var UInt32Mask = 0x100000000;
1183
1207
  var MaxUInt32 = 0xffffffff;
1208
+ var SEED1 = 123456789;
1209
+ var SEED2 = 987654321;
1184
1210
  var _mwcSeeded = false;
1185
- var _mwcW = 123456789;
1186
- var _mwcZ = 987654321;
1211
+ var _mwcW = SEED1;
1212
+ var _mwcZ = SEED2;
1187
1213
  function _mwcSeed(seedValue) {
1188
1214
  if (seedValue < 0) {
1189
1215
  seedValue >>>= 0;
1190
1216
  }
1191
- _mwcW = (123456789 + seedValue) & MaxUInt32;
1192
- _mwcZ = (987654321 - seedValue) & MaxUInt32;
1217
+ _mwcW = (SEED1 + seedValue) & MaxUInt32;
1218
+ _mwcZ = (SEED2 - seedValue) & MaxUInt32;
1193
1219
  _mwcSeeded = true;
1194
1220
  }
1195
1221
  function _autoSeedMwc() {
@@ -1247,7 +1273,7 @@
1247
1273
  return result;
1248
1274
  }
1249
1275
 
1250
- var version = "3.0.0-beta.2303-11";
1276
+ var version = "3.0.0-beta.2304-07";
1251
1277
  var instanceName = "." + newId(6);
1252
1278
  var _dataUid = 0;
1253
1279
  function _canAcceptData(target) {
@@ -2048,7 +2074,7 @@
2048
2074
  var _supportsCookies = null;
2049
2075
  var _allowUaSameSite = null;
2050
2076
  var _parsedCookieValue = null;
2051
- var _doc = getDocument();
2077
+ var _doc;
2052
2078
  var _cookieCache = {};
2053
2079
  var _globalCookieConfig = {};
2054
2080
  var rootDefaultConfig = (_a$2 = {
@@ -2064,6 +2090,9 @@
2064
2090
  },
2065
2091
  _a$2[strDisableCookiesUsage] = UNDEFINED_VALUE,
2066
2092
  _a$2);
2093
+ function _getDoc() {
2094
+ !_doc && (_doc = getLazy(function () { return getDocument(); }));
2095
+ }
2067
2096
  function _gblCookieMgr(config, logger) {
2068
2097
  var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
2069
2098
  if (!inst) {
@@ -2236,8 +2265,9 @@
2236
2265
  function areCookiesSupported(logger) {
2237
2266
  if (_supportsCookies === null) {
2238
2267
  _supportsCookies = false;
2268
+ !_doc && _getDoc();
2239
2269
  try {
2240
- var doc = _doc || {};
2270
+ var doc = _doc.v || {};
2241
2271
  _supportsCookies = doc[strCookie] !== undefined;
2242
2272
  }
2243
2273
  catch (e) {
@@ -2280,8 +2310,9 @@
2280
2310
  }
2281
2311
  function _getCookieValue(name) {
2282
2312
  var cookieValue = STR_EMPTY;
2283
- if (_doc) {
2284
- var theCookie = _doc[strCookie] || STR_EMPTY;
2313
+ !_doc && _getDoc();
2314
+ if (_doc.v) {
2315
+ var theCookie = _doc.v[strCookie] || STR_EMPTY;
2285
2316
  if (_parsedCookieValue !== theCookie) {
2286
2317
  _cookieCache = _extractParts(theCookie);
2287
2318
  _parsedCookieValue = theCookie;
@@ -2291,8 +2322,9 @@
2291
2322
  return cookieValue;
2292
2323
  }
2293
2324
  function _setCookieValue(name, cookieValue) {
2294
- if (_doc) {
2295
- _doc[strCookie] = name + "=" + cookieValue;
2325
+ !_doc && _getDoc();
2326
+ if (_doc.v) {
2327
+ _doc.v[strCookie] = name + "=" + cookieValue;
2296
2328
  }
2297
2329
  }
2298
2330
  function uaDisallowsSameSiteNone(userAgent) {
@@ -3121,7 +3153,7 @@
3121
3153
  }
3122
3154
  function dsPadNumber(num) {
3123
3155
  var s = "00" + num;
3124
- return s.substr(s[_DYN_LENGTH$1 ] - 3);
3156
+ return strSubstr(s, s[_DYN_LENGTH$1 ] - 3);
3125
3157
  }
3126
3158
 
3127
3159
  function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {
@@ -3181,7 +3213,7 @@
3181
3213
  }
3182
3214
  function _getVerifiedStorageObject(storageType) {
3183
3215
  try {
3184
- if (isNullOrUndefined(getGlobal$1())) {
3216
+ if (isNullOrUndefined(getGlobal())) {
3185
3217
  return null;
3186
3218
  }
3187
3219
  var uid = (new Date)[_DYN_TO_STRING ]();
@@ -3960,7 +3992,5 @@
3960
3992
  exports.TelemetryContext = TelemetryContext;
3961
3993
  exports.TelemetryTrace = TelemetryTrace;
3962
3994
 
3963
- Object.defineProperty(exports, '__esModule', { value: true });
3964
-
3965
3995
  }));
3966
- //# sourceMappingURL=applicationinsights-properties-js.js.map
3996
+ //# sourceMappingURL=ai.props.3.js.map