@microsoft/applicationinsights-react-native 2.4.5 → 2.4.6

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