@microsoft/applicationinsights-react-native 2.4.2-nightly.2111-10 → 2.4.2-nightly.2111-12
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.
- package/browser/applicationinsights-react-native.js +35 -2
- package/browser/applicationinsights-react-native.js.map +1 -1
- package/browser/applicationinsights-react-native.min.js +2 -2
- package/browser/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.d.ts +1 -1
- package/dist/applicationinsights-react-native.js +35 -2
- package/dist/applicationinsights-react-native.js.map +1 -1
- package/dist/applicationinsights-react-native.min.js +2 -2
- package/dist/applicationinsights-react-native.min.js.map +1 -1
- package/dist/applicationinsights-react-native.rollup.d.ts +1 -1
- package/dist-esm/Interfaces/INativeDevice.js +1 -1
- package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
- package/dist-esm/Interfaces/index.js +1 -1
- package/dist-esm/ReactNativePlugin.js +1 -1
- package/dist-esm/index.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2111-
|
|
2
|
+
* Application Insights JavaScript SDK - React Native Plugin, 2.4.2-nightly.2111-12
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
var e=this,n=function(e,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var c=t(n),r="function",f="object",g="undefined",i="prototype",o="hasOwnProperty",l=Object,u=l[i],a=l.create,s=l.defineProperty,v=u[o];function d(){return typeof globalThis!==g&&globalThis?globalThis:typeof self!==g&&self?self:typeof window!==g&&window?window:typeof global!==g&&global?global:null}function p(e){throw new TypeError(e)}(d()||{}).Symbol,(d()||{}).Reflect;var y,h=function(e,n){return(h=l.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[o](t)&&(e[t]=n[t])})(e,n)},C="constructor",x="prototype",m="function",I="_dynInstFuncs",b="_isDynProxy",w="_dynClass",T="_dynInstChk",_=T,N="_dfOpts",P="_unknown_",L="__proto__",E="useBaseInst",A="setInstFuncs",D=Object,M=D.getPrototypeOf,R=0;function O(e,n){return e&&D[x].hasOwnProperty.call(e,n)}function j(e){return e&&(e===D[x]||e===Array[x])}function K(e){return j(e)||e===Function[x]}function S(e){if(e){if(M)return M(e);if(e=e[L]||e[x]||(e[C]?e[C][x]:null))return e}return null}function U(e,n){var t=[],r=D.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&O(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function k(e,n,t){return n!==C&&typeof e[n]===m&&(t||O(e,n))}function z(e){throw new TypeError("DynamicProto: "+e)}function H(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function q(e,n){return O(e,x)?e.name||n||P:((e||{})[C]||{}).name||n||P}function F(e,r,n,t){O(e,x)||z("theClass is an invalid class definition.");var i=e[x];!function(e){if(M)for(var n=[],t=S(r);t&&!K(t)&&!H(n,t);){if(t===e)return 1;n.push(t),t=S(t)}}(i)&&z("["+q(e)+"] is not in class hierarchy of ["+q(r)+"]");var o=null;O(i,w)?o=i[w]:(o="_dynCls$"+q(e,"_")+"$"+R,R++,i[w]=o);var l=F[N],u=!!l[E];u&&t&&t[E]!==undefined&&(u=!!t[E]);var a,s,c,f,g,v,e=(s={},U(a=r,function(e){!s[e]&&k(a,e,!1)&&(s[e]=a[e])}),s);n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[b]&&o&&!1!==(r=e[I]||{})[_]&&(i=(r[n[w]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};U(t,function(e){i[e]=r(n,t,e)});for(var l=S(e),u=[];l&&!K(l)&&!H(u,l);)U(l,function(e){!i[e]&&k(l,e,!M)&&(i[e]=r(n,l,e))}),u.push(l),l=S(l);return i}(i,r,e,u)),l=!!M&&!!l[A],c=i,o=o,f=r,g=e,t=!1!==(l=l&&t?!!t[A]:l),j(c)||(l=f[I]=f[I]||{},v=l[o]=l[o]||{},!1!==l[_]&&(l[_]=!!t),U(f,function(e){var t,r,i;k(f,e,!1)&&f[e]!==g[e]&&(v[e]=f[e],delete f[e],O(c,e)&&(!c[e]||c[e][b])||(c[e]=(t=c,r=e,(i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&O(t,w)){var o=e[I]||{};if((i=(o[t[w]]||{})[n])||z("Missing ["+n+"] "+m),!i[T]&&!1!==o[_]){for(var l=!O(e,n),u=S(e),a=[];l&&u&&!K(u)&&!H(a,u);){var s=u[n];if(s){l=s===r;break}a.push(u),u=S(u)}try{l&&(e[n]=i),i[T]=1}catch(c){o[_]=!1}}}return i}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?S(t)[e]:n)!==m&&z("["+e+"] is not a "+m),n)).apply(this,arguments)})[b]=1,i)))}))}F[N]={setInstFuncs:!0,useBaseInst:!0},(n=y=y||{})[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var G=73,J=s;function W(e){return u.toString.call(e)}function V(e){return e===undefined||typeof e===g}function B(e){return null===e||V(e)}function $(e){return typeof e===r}function Q(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function X(){var e=Date;return e.now?e.now():(new e).getTime()}var Y="window",Z="JSON";function ee(e){var n=d();return n&&n[e]?n[e]:e===Y&&typeof window===f&&window?window:null}function ne(){return typeof JSON===f&&JSON||null!==ee(Z)}function te(){return ne()?JSON||ee(Z):null}function re(e){var n=Object[i].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":ne()&&(t=te().stringify(e)),n+t}function ie(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function oe(e,n){var t,r=typeof console!==g?console:ee("console");r&&(t="log",$(r[t=r[e]?e:t])&&r[t](n))}var le=(ue.dataType="MessageData",ue);function ue(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",ne()&&(e=te().stringify(r)),e=(n?" message:"+ie(n):"")+(r?" props:"+ie(e):""),this.message+=e}var ae=function _e(t){this.identifier="DiagnosticLogger",this.queue=[];var i=0,l={};F(_e,this,function(o){function e(e,n){return B(e=t[e])?n:e}B(t)&&(t={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(n=new le(n,t,i=void 0!==i&&i,r),o.enableDebugExceptions())throw n;t=e===y.CRITICAL?"errorToConsole":"warnToConsole",V(n.message)||(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!l[i]&&e<=r&&(o[t](n.message),l[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){oe("warn",e)},o.errorToConsole=function(e){oe("error",e)},o.resetInternalMessageCount=function(){i=0,l={}},o.logInternalMessage=function(e,n){var t,r;i>=o.maxInternalMessageLimit()||(t=!0,r="AITR_"+n.messageId,l[r]?t=!1:l[r]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),i++),i===o.maxInternalMessageLimit()&&(n=new le(23,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),o.warnToConsole(e))))}})},se=(ce.ParentContextKey="parent",ce.ChildrenContextKey="childEvts",ce);function ce(e,i,n){var r,o=this,l=!1;o.start=X(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},$(i)&&(l=function(e){if(J)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&$(i)&&(r=i(),i=null),r}};return J(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===ce.ParentContextKey||e===ce.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===ce.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===ce.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(ce.ChildrenContextKey);if("[object Array]"===W(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&$(i)&&(o.payload=i())}}var fe="CoreUtils.doPerf";function ge(e,n,t,r,i){if(e){var o=e;if(o=$(o.getPerfMgr)?o.getPerfMgr():o){var l,u=void 0,e=o.getCtx(fe);try{if(u=o.create(n(),r,i))return e&&u.setCtx&&(u.setCtx(se.ParentContextKey,e),e.getCtx&&e.setCtx&&((l=e.getCtx(se.ChildrenContextKey))||(l=[],e.setCtx(se.ChildrenContextKey,l)),l.push(u))),o.setCtx(fe,u),t(u)}catch(a){u&&u.setCtx&&u.setCtx("exception",a)}finally{u&&o.fire(u),o.setCtx(fe,e)}}}return t()}var ve=function(i,n){var o=this,l=null,u=$(i.processTelemetry),a=$(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ge(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&u){o._hasRun=!0;try{r.setNext(l),a&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(y.CRITICAL,G,"Plugin ["+i.identifier+"] failed during processTelemetry - "+re(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function de(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&$(o.processTelemetry)&&(o=new ve(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var pe,ye=function Ne(e,i,t,n){var r,o,l,u,a=this,s=null;null!==n&&(e&&$(e.getPlugin)?s=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),de(r,n)}(e,a,n||e.getPlugin()):n?(r=a,l=e,u=!1,(o=n)&&e&&(l=[],Q(e,function(e){!u&&e!==o||(u=!0,l.push(e))})),o&&!u&&(l=l||[]).push(o),s=de(l,r)):V(n)&&(s=de(e,a))),a.core=function(){return t},a.diagLog=function(){return(t||{}).logger||new ae(i)},a.getCfg=function(){return i},a.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},a.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=a.getExtCfg(e,null))&&!B(e[n])?r=e[n]:i&&!B(i[n])&&(r=i[n]),B(r)?t:r},a.hasNext=function(){return null!=s},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processNext=function(e){var n=s;n&&(s=n.getNext(),n.processTelemetry(e,a))},a.createNew=function(e,n){return new Ne((e=void 0===e?null:e)||s,i,t,n)}},he="getPlugin",n=(Ce.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},Ce);function Ce(){var u=this,a=!1,s=null,c=null;u.core=null,u.diagLog=function(e){return u._getTelCtx(e).diagLog()},u.isInitialized=function(){return a},u.setInitialized=function(e){a=e},u.setNextPlugin=function(e){c=e},u.processNext=function(e,n){n?n.processNext(e):c&&$(c.processTelemetry)&&c.processTelemetry(e,null)},u._getTelCtx=function(e){var n=e=void 0===e?null:e;return n||(e=s||new ye(null,{},u.core),n=c&&c[he]?e.createNew(null,c[he]):e.createNew(null,c)),n},u._baseTelInit=function(e,n,t,r){var i,o;e&&(i="extensionConfig",l=o=[],!e||(l=e[i])!==o&&B(l)&&(e[i]=l=o)),!r&&n&&(r=n.getProcessTelContext().getNext());var l=c;c&&c[he]&&(l=c[he]()),u.core=n,s=new ye(r,e,n,l),a=!0}}(s=pe=pe||{})[s.Verbose=0]="Verbose",s[s.Information=1]="Information",s[s.Warning=2]="Warning",s[s.Error=3]="Error",s[s.Critical=4]="Critical";var xe=(me.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),n=(t&&e.extensionConfig&&e.extensionConfig[t]&&!B(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],B(n)?r:n},me);function me(){}var Ie,be,n=(be=Te,typeof(s=Ie=n)!==r&&null!==s&&p("Class extends value "+s+" is not a constructor or null"),h(be,s),be[i]=null===s?function(e){if(a)return a(e);if(null==e)return{};var n=typeof e;function t(){}return n!==f&&n!==r&&p("Object prototype may only be an Object:"+e),t[i]=e,new t}(s):(we[i]=s[i],new we),Te);function we(){this.constructor=be}function Te(e){var n=Ie.call(this)||this;n.identifier="AppInsightsReactNativePlugin",n.priority=140;var l,r,u={},a=e||s();function s(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return F(Te,n,function(i,o){i.initialize=function(e,n,t){var r;i.isInitialized()||(o.initialize(e,n,t),r=e||{},function(e,n){if("object"===f)for(var t in e)i=t,(r=e)&&v.call(r,i)&&n(t,e[t]);var r,i}(s(),function(e,n){a[e]=xe.getConfig(r,e,i.identifier,V(a[e])?n:a[e])}),a.disableDeviceCollection||i._collectDeviceInfo(),t&&Q(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(l=e)}),a.disableExceptionCollection||i._setExceptionHandler())},i.processTelemetry=function(e,n){var t=e;u&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof u.id&&(t.ext.device.localId=u.id),"string"==typeof u.model&&(t.ext.device.model=u.model),"string"==typeof u.deviceClass&&(t.ext.device.deviceClass=u.deviceClass)),i.processNext(e,n)},i.setDeviceId=function(e){u.id=e},i.setDeviceModel=function(e){u.model=e},i.setDeviceType=function(e){u.deviceClass=e},i._collectDeviceInfo=function(){try{u.deviceClass=c["default"].getDeviceType(),u.id=c["default"].getUniqueId(),u.model=c["default"].getModel()}catch(n){i.diagLog().warnToConsole("Failed to get DeviceInfo: "+("[object Error]"===W(e=n)?e.name:"")+" - "+re(n))}var e},i._setExceptionHandler=function(){var e=typeof global!==g&&global?global:d();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:pe.Error};l?l.trackException(t):i.diagLog().throwInternal(y.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},i._config=a,i._getDbgPlgTargets=function(){return[u]}}),n}e.ReactNativePlugin=n,Object.defineProperty(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
|
|
5
|
+
var e=this,n=function(e,n){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{"default":e}}var c=t(n),r="function",f="object",g="undefined",i="prototype",o="hasOwnProperty",l=Object,a=l[i],u=l.create,s=l.defineProperty,v=a[o];function d(){return typeof globalThis!==g&&globalThis?globalThis:typeof self!==g&&self?self:typeof window!==g&&window?window:typeof global!==g&&global?global:null}function p(e){throw new TypeError(e)}(d()||{}).Symbol,(d()||{}).Reflect;var y,C=function(e,n){return(C=l.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[o](t)&&(e[t]=n[t])})(e,n)},h="constructor",x="prototype",m="function",I="_dynInstFuncs",b="_isDynProxy",w="_dynClass",T="_dynInstChk",_=T,L="_dfOpts",N="_unknown_",P="__proto__",E="useBaseInst",A="setInstFuncs",D=Object,R=D.getPrototypeOf,M=0;function O(e,n){return e&&D[x].hasOwnProperty.call(e,n)}function j(e){return e&&(e===D[x]||e===Array[x])}function K(e){return j(e)||e===Function[x]}function S(e){if(e){if(R)return R(e);if(e=e[P]||e[x]||(e[h]?e[h][x]:null))return e}return null}function U(e,n){var t=[],r=D.getOwnPropertyNames;if(r)t=r(e);else for(var i in e)"string"==typeof i&&O(e,i)&&t.push(i);if(t&&0<t.length)for(var o=0;o<t.length;o++)n(t[o])}function k(e,n,t){return n!==h&&typeof e[n]===m&&(t||O(e,n))}function z(e){throw new TypeError("DynamicProto: "+e)}function H(e,n){for(var t=e.length-1;0<=t;t--)if(e[t]===n)return 1}function q(e,n){return O(e,x)?e.name||n||N:((e||{})[h]||{}).name||n||N}function F(e,r,n,t){O(e,x)||z("theClass is an invalid class definition.");var i=e[x];!function(e){if(R)for(var n=[],t=S(r);t&&!K(t)&&!H(n,t);){if(t===e)return 1;n.push(t),t=S(t)}}(i)&&z("["+q(e)+"] is not in class hierarchy of ["+q(r)+"]");var o=null;O(i,w)?o=i[w]:(o="_dynCls$"+q(e,"_")+"$"+M,M++,i[w]=o);var l=F[L],a=!!l[E];a&&t&&t[E]!==undefined&&(a=!!t[E]);var u,s,c,f,g,v,e=(s={},U(u=r,function(e){!s[e]&&k(u,e,!1)&&(s[e]=u[e])}),s);n(r,function(e,n,t,o){function r(e,n,t){var r,i=n[t];return i[b]&&o&&!1!==(r=e[I]||{})[_]&&(i=(r[n[w]]||{})[t]||i),function(){return i.apply(e,arguments)}}var i={};U(t,function(e){i[e]=r(n,t,e)});for(var l=S(e),a=[];l&&!K(l)&&!H(a,l);)U(l,function(e){!i[e]&&k(l,e,!R)&&(i[e]=r(n,l,e))}),a.push(l),l=S(l);return i}(i,r,e,a)),l=!!R&&!!l[A],c=i,o=o,f=r,g=e,t=!1!==(l=l&&t?!!t[A]:l),j(c)||(l=f[I]=f[I]||{},v=l[o]=l[o]||{},!1!==l[_]&&(l[_]=!!t),U(f,function(e){var t,r,i;k(f,e,!1)&&f[e]!==g[e]&&(v[e]=f[e],delete f[e],O(c,e)&&(!c[e]||c[e][b])||(c[e]=(t=c,r=e,(i=function(){var e,n;return(function(e,n,t,r){var i=null;if(e&&O(t,w)){var o=e[I]||{};if((i=(o[t[w]]||{})[n])||z("Missing ["+n+"] "+m),!i[T]&&!1!==o[_]){for(var l=!O(e,n),a=S(e),u=[];l&&a&&!K(a)&&!H(u,a);){var s=a[n];if(s){l=s===r;break}u.push(a),a=S(a)}try{l&&(e[n]=i),i[T]=1}catch(c){o[_]=!1}}}return i}(this,r,t,i)||(typeof(n=(n=t[e=r])===i?S(t)[e]:n)!==m&&z("["+e+"] is not a "+m),n)).apply(this,arguments)})[b]=1,i)))}))}F[L]={setInstFuncs:!0,useBaseInst:!0},(n=y=y||{})[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var G=73,W=s;function J(e){return a.toString.call(e)}function V(e){return e===undefined||typeof e===g}function B(e){return null===e||V(e)}function $(e){return typeof e===r}function Q(e,n,t){var r=e.length;try{for(var i=0;i<r&&!(i in e&&-1===n.call(t||e,e[i],i,e));i++);}catch(o){}}function X(){var e=Date;return e.now?e.now():(new e).getTime()}var Y="window",Z="JSON";function ee(e){var n=d();return n&&n[e]?n[e]:e===Y&&typeof window===f&&window?window:null}function ne(){return typeof JSON===f&&JSON||null!==ee(Z)}function te(){return ne()?JSON||ee(Z):null}function re(e){var n=Object[i].toString.call(e),t="";return"[object Error]"===n?t="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":ne()&&(t=te().stringify(e)),n+t}var ie=null;function oe(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function le(e,n){var t,r=typeof console!==g?console:ee("console");r&&(t="log",$(r[t=r[e]?e:t])&&r[t](n))}var ae=(ue.dataType="MessageData",ue);function ue(e,n,t,r){void 0===t&&(t=!1),this.messageId=e,this.message=(t?"AI: ":"AI (Internal): ")+e,e="",ne()&&(e=te().stringify(r)),e=(n?" message:"+oe(n):"")+(r?" props:"+oe(e):""),this.message+=e}var se=function Le(i){this.identifier="DiagnosticLogger",this.queue=[];var a=0,u={};F(Le,this,function(o){function e(e,n){return B(e=i[e])?n:e}function l(e,n){var t,r=(t=i,(r=(r=ie)||!0===t.disableDbgExt?r:ie||(t=ee("Microsoft"),ie=t?t.ApplicationInsights:ie))?r.ChromeDbgExt:null);r&&r.diagLog&&r.diagLog(e,n)}B(i)&&(i={}),o.consoleLoggingLevel=function(){return e("loggingLevelConsole",0)},o.telemetryLoggingLevel=function(){return e("loggingLevelTelemetry",1)},o.maxInternalMessageLimit=function(){return e("maxMessageLimit",25)},o.enableDebugExceptions=function(){return e("enableDebugExceptions",!1)},o.throwInternal=function(e,n,t,r,i){if(n=new ae(n,t,i=void 0!==i&&i,r),o.enableDebugExceptions())throw n;t=e===y.CRITICAL?"errorToConsole":"warnToConsole",V(n.message)?l("throw"+(e===y.CRITICAL?"Critical":"Warning"),n):(r=o.consoleLoggingLevel(),i?(i=+n.messageId,!u[i]&&e<=r&&(o[t](n.message),u[i]=!0)):e<=r&&o[t](n.message),o.logInternalMessage(e,n))},o.warnToConsole=function(e){le("warn",e),l("warning",e)},o.errorToConsole=function(e){le("error",e),l("error",e)},o.resetInternalMessageCount=function(){a=0,u={}},o.logInternalMessage=function(e,n){var t,r;a>=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+n.messageId,u[t]?r=!1:u[t]=!0,r&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),a++,l(e===y.CRITICAL?"error":"warn",n)),a===o.maxInternalMessageLimit()&&(n=new ae(23,r="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(n),e===y.CRITICAL?o.errorToConsole(r):o.warnToConsole(r))))}})},ce=(fe.ParentContextKey="parent",fe.ChildrenContextKey="childEvts",fe);function fe(e,i,n){var r,o=this,l=!1;o.start=X(),o.name=e,o.isAsync=n,o.isChildEvt=function(){return!1},$(i)&&(l=function(e){if(W)try{var n={enumerable:!0,configurable:!0,get:function(){return!r&&$(i)&&(r=i(),i=null),r}};return W(e,"payload",n),!0}catch(t){}return!1}(o)),o.getCtx=function(e){return e?(e===fe.ParentContextKey||e===fe.ChildrenContextKey?o:o.ctx||{})[e]:null},o.setCtx=function(e,n){e&&(e===fe.ParentContextKey?(o[e]||(o.isChildEvt=function(){return!0}),o[e]=n):e===fe.ChildrenContextKey?o[e]=n:(o.ctx=o.ctx||{})[e]=n)},o.complete=function(){var e=0,n=o.getCtx(fe.ChildrenContextKey);if("[object Array]"===J(n))for(var t=0;t<n.length;t++){var r=n[t];r&&(e+=r.time)}o.time=X()-o.start,o.exTime=o.time-e,o.complete=function(){},!l&&$(i)&&(o.payload=i())}}var ge="CoreUtils.doPerf";function ve(e,n,t,r,i){if(e){var o=e;if(o=$(o.getPerfMgr)?o.getPerfMgr():o){var l,a=void 0,e=o.getCtx(ge);try{if(a=o.create(n(),r,i))return e&&a.setCtx&&(a.setCtx(ce.ParentContextKey,e),e.getCtx&&e.setCtx&&((l=e.getCtx(ce.ChildrenContextKey))||(l=[],e.setCtx(ce.ChildrenContextKey,l)),l.push(a))),o.setCtx(ge,a),t(a)}catch(u){a&&a.setCtx&&a.setCtx("exception",u)}finally{a&&o.fire(a),o.setCtx(ge,e)}}}return t()}var de=function(i,n){var o=this,l=null,a=$(i.processTelemetry),u=$(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return l},o.setNext=function(e){l=e},o.processTelemetry=function(t,r){r=r||n;var e=i?i.identifier:"TelemetryPluginChain";ve(r?r.core():null,function(){return e+":processTelemetry"},function(){if(i&&a){o._hasRun=!0;try{r.setNext(l),u&&i.setNextPlugin(l),l&&(l._hasRun=!1),i.processTelemetry(t,r)}catch(n){var e=l&&l._hasRun;l&&e||r.diagLog().throwInternal(y.CRITICAL,G,"Plugin ["+i.identifier+"] failed during processTelemetry - "+re(n)),l&&!e&&l.processTelemetry(t,r)}}else l&&(o._hasRun=!0,l.processTelemetry(t,r))},function(){return{item:t}},!t.sync)}};function pe(e,n){var t=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var o=e[i];o&&$(o.processTelemetry)&&(o=new de(o,n),t.push(o),r&&r.setNext(o),r=o)}return 0<t.length?t[0]:null}var ye,Ce=function Ne(e,i,t,n){var r,o,l,a,u=this,s=null;null!==n&&(e&&$(e.getPlugin)?s=function(e,n,t){var r=[],i=!t;if(e)for(;e;){var o=e.getPlugin();!i&&o!==t||(i=!0,r.push(o)),e=e.getNext()}return i||r.push(t),pe(r,n)}(e,u,n||e.getPlugin()):n?(r=u,l=e,a=!1,(o=n)&&e&&(l=[],Q(e,function(e){!a&&e!==o||(a=!0,l.push(e))})),o&&!a&&(l=l||[]).push(o),s=pe(l,r)):V(n)&&(s=pe(e,u))),u.core=function(){return t},u.diagLog=function(){return(t||{}).logger||new se(i)},u.getCfg=function(){return i},u.getExtCfg=function(e,n){var t,r;return void 0===n&&(n={}),!i||(r=i.extensionConfig)&&e&&(t=r[e]),t||n},u.getConfig=function(e,n,t){var r;return void 0===t&&(t=!1),(e=u.getExtCfg(e,null))&&!B(e[n])?r=e[n]:i&&!B(i[n])&&(r=i[n]),B(r)?t:r},u.hasNext=function(){return null!=s},u.getNext=function(){return s},u.setNext=function(e){s=e},u.processNext=function(e){var n=s;n&&(s=n.getNext(),n.processTelemetry(e,u))},u.createNew=function(e,n){return new Ne((e=void 0===e?null:e)||s,i,t,n)}},he="getPlugin",n=(xe.prototype.initialize=function(e,n,t,r){this._baseTelInit(e,n,t,r)},xe);function xe(){var a=this,u=!1,s=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return u},a.setInitialized=function(e){u=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,n){n?n.processNext(e):c&&$(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){var n=e=void 0===e?null:e;return n||(e=s||new Ce(null,{},a.core),n=c&&c[he]?e.createNew(null,c[he]):e.createNew(null,c)),n},a._baseTelInit=function(e,n,t,r){var i,o;e&&(i="extensionConfig",l=o=[],!e||(l=e[i])!==o&&B(l)&&(e[i]=l=o)),!r&&n&&(r=n.getProcessTelContext().getNext());var l=c;c&&c[he]&&(l=c[he]()),a.core=n,s=new Ce(r,e,n,l),u=!0}}(s=ye=ye||{})[s.Verbose=0]="Verbose",s[s.Information=1]="Information",s[s.Warning=2]="Warning",s[s.Error=3]="Error",s[s.Critical=4]="Critical";var me=(Ie.getConfig=function(e,n,t,r){return void 0===r&&(r=!1),n=(t&&e.extensionConfig&&e.extensionConfig[t]&&!B(e.extensionConfig[t][n])?e.extensionConfig[t]:e)[n],B(n)?r:n},Ie);function Ie(){}var be,we,n=(we=_e,typeof(s=be=n)!==r&&null!==s&&p("Class extends value "+s+" is not a constructor or null"),C(we,s),we[i]=null===s?function(e){if(u)return u(e);if(null==e)return{};var n=typeof e;function t(){}return n!==f&&n!==r&&p("Object prototype may only be an Object:"+e),t[i]=e,new t}(s):(Te[i]=s[i],new Te),_e);function Te(){this.constructor=we}function _e(e){var n=be.call(this)||this;n.identifier="AppInsightsReactNativePlugin",n.priority=140;var l,r,a={},u=e||s();function s(){return{disableDeviceCollection:!1,disableExceptionCollection:!1}}return F(_e,n,function(i,o){i.initialize=function(e,n,t){var r;i.isInitialized()||(o.initialize(e,n,t),r=e||{},function(e,n){if("object"===f)for(var t in e)i=t,(r=e)&&v.call(r,i)&&n(t,e[t]);var r,i}(s(),function(e,n){u[e]=me.getConfig(r,e,i.identifier,V(u[e])?n:u[e])}),u.disableDeviceCollection||i._collectDeviceInfo(),t&&Q(t,function(e){"ApplicationInsightsAnalytics"===e.identifier&&(l=e)}),u.disableExceptionCollection||i._setExceptionHandler())},i.processTelemetry=function(e,n){var t=e;a&&(t.ext=t.ext||{},t.ext.device=t.ext.device||{},"string"==typeof a.id&&(t.ext.device.localId=a.id),"string"==typeof a.model&&(t.ext.device.model=a.model),"string"==typeof a.deviceClass&&(t.ext.device.deviceClass=a.deviceClass)),i.processNext(e,n)},i.setDeviceId=function(e){a.id=e},i.setDeviceModel=function(e){a.model=e},i.setDeviceType=function(e){a.deviceClass=e},i._collectDeviceInfo=function(){try{a.deviceClass=c["default"].getDeviceType(),a.id=c["default"].getUniqueId(),a.model=c["default"].getModel()}catch(n){i.diagLog().warnToConsole("Failed to get DeviceInfo: "+("[object Error]"===J(e=n)?e.name:"")+" - "+re(n))}var e},i._setExceptionHandler=function(){var e=typeof global!==g&&global?global:d();e&&e.ErrorUtils&&(r="function"==typeof e.ErrorUtils.getGlobalHandler&&e.ErrorUtils.getGlobalHandler()||e.ErrorUtils._globalHandler,e.ErrorUtils.setGlobalHandler((function(e,n){var t={exception:e,severityLevel:ye.Error};l?l.trackException(t):i.diagLog().throwInternal(y.CRITICAL,64,"Analytics plugin is not available, ReactNative plugin telemetry will not be sent: "),r&&r.call(global,e,n)}).bind(n)))},i._config=u,i._getDbgPlgTargets=function(){return[a]}}),n}e.ReactNativePlugin=n,Object.defineProperty(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react-native-device-info")):"function"==typeof define&&define.amd?define(["exports","react-native-device-info"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}),e.DeviceInfo);
|
|
6
6
|
//# sourceMappingURL=applicationinsights-react-native.min.js.map
|