@microsoft/applicationinsights-react-js 3.4.2 → 3.4.3

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 Plugin, 3.4.2
2
+ * Application Insights JavaScript SDK - React Plugin, 3.4.3
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
- var t=this,n=function(t,a){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function p(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){var n;"default"!==t&&Object.defineProperty(r,t,(n=Object.getOwnPropertyDescriptor(e,t)).get?n:{enumerable:!0,get:function(){return e[t]}})}),r["default"]=e,r}var R=p(a),z=s(a),V="function",d="object",i="undefined",r="prototype",K="hasOwnProperty",e=Object,W=e[r],n=e.assign,B=e.create,J=e.defineProperty,$=W[K],q=null;function G(t){t=!1===(t=void 0===t||t)?null:q;return t||((t=(t=(t=typeof globalThis!==i?globalThis:t)||typeof self===i?t:self)||typeof window===i?t:window)||typeof global===i||(t=global),q=t),t}function F(t){throw new TypeError(t)}(G()||{}).Symbol,(G()||{}).Reflect;var H=n||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])W[K].call(n,i)&&(t[i]=n[i]);return t},X=function(t,n){return(X=e.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[K](e)&&(t[e]=n[e])})(t,n)};function Q(t,n){function e(){this.constructor=t}typeof n!==V&&null!==n&&F("Class extends value "+n+" is not a constructor or null"),X(t,n),t[r]=null===n?function(t){if(B)return B(t);if(null==t)return{};var n=typeof t;function e(){}return n!==d&&n!==V&&F("Object prototype may only be an Object:"+t),e[r]=t,new e}(n):(e[r]=n[r],new e)}var n="undefined",Y="constructor",v="prototype",Z="function",tt="_dynInstFuncs",nt="_isDynProxy",m="_dynClass",et="_dynInstChk",rt=et,it="_dfOpts",ot="_unknown_",ut="__proto__",at="_dyn"+ut,ct="__dynProto$Gbl",lt="_dynInstProto",ft="useBaseInst",st="setInstFuncs",pt=Object,dt=pt.getPrototypeOf,vt=pt.getOwnPropertyNames,n=(u=(u=(u=(u=typeof globalThis!=n?globalThis:u)||typeof self==n?u:self)||typeof window==n?u:window)||typeof global==n?u:global)||{},mt=n[ct]||(n[ct]={o:((u={})[st]=!0,u[ft]=!0,u),n:1e3});function g(t,n){return t&&pt[v].hasOwnProperty.call(t,n)}function gt(t){return t&&(t===pt[v]||t===Array[v])}function ht(t){return gt(t)||t===Function[v]}function h(t){if(t){if(dt)return dt(t);var n=t[ut]||t[v]||(t[Y]?t[Y][v]:null),e=t[at]||n;g(t,at)||(delete t[lt],e=t[at]=t[lt]||t[at],t[lt]=n)}return e}function yt(t,n){var e=[];if(vt)e=vt(t);else for(var r in t)"string"==typeof r&&g(t,r)&&e.push(r);if(e&&0<e.length)for(var i=0;i<e.length;i++)n(e[i])}function _t(t,n,e){return n!==Y&&typeof t[n]===Z&&(e||g(t,n))}function Tt(t){throw new TypeError("DynamicProto: "+t)}function Ct(t,n){for(var e=t.length-1;0<=e;e--)if(t[e]===n)return 1}function wt(t,n){return g(t,v)?t.name||n||ot:((t||{})[Y]||{}).name||n||ot}function xt(t,r,n,e){g(t,v)||Tt("theClass is an invalid class definition.");var i,o,u,a,c,l,f=t[v],s=(function(t){if(!dt)return 1;for(var n=[],e=h(r);e&&!ht(e)&&!Ct(n,e);){if(e===t)return 1;n.push(e),e=h(e)}}(f)||Tt("["+wt(t)+"] not in hierarchy of ["+wt(r)+"]"),null),t=(g(f,m)?s=f[m]:(s="_dynCls$"+wt(t,"_")+"$"+mt.n,mt.n++,f[m]=s),xt[it]),p=!!t[ft],d=(p&&e&&e[ft]!==undefined&&(p=!!e[ft]),o={},yt(i=r,function(t){!o[t]&&_t(i,t,!1)&&(o[t]=i[t])}),o),p=(n(r,function(t,n,e,o){function r(t,n,e){var r,i=n[e];return i[nt]&&o&&!1!==(r=t[tt]||{})[rt]&&(i=(r[n[m]]||{})[e]||i),function(){return i.apply(t,arguments)}}for(var i={},u=(yt(e,function(t){i[t]=r(n,e,t)}),h(t)),a=[];u&&!ht(u)&&!Ct(a,u);)yt(u,function(t){!i[t]&&_t(u,t,!dt)&&(i[t]=r(n,u,t))}),a.push(u),u=h(u);return i}(f,r,d,p)),!!dt&&!!t[st]);u=f,n=s,a=r,c=d,t=!1!==(p=p&&e?!!e[st]:p),gt(u)||(f=a[tt]=a[tt]||{},l=f[n]=f[n]||{},!1!==f[rt]&&(f[rt]=!!t),yt(a,function(t){var e,r,i;_t(a,t,!1)&&a[t]!==c[t]&&(l[t]=a[t],delete a[t],g(u,t)&&(!u[t]||u[t][nt])||(u[t]=(e=u,r=t,(i=function(){var t,n;return(function(t,n,e,r){var i=null;if(t&&g(e,m)){var o=t[tt]||{};if((i=(o[e[m]]||{})[n])||Tt("Missing ["+n+"] "+Z),!i[et]&&!1!==o[rt]){for(var u=!g(t,n),a=h(t),c=[];u&&a&&!ht(a)&&!Ct(c,a);){var l=a[n];if(l){u=l===r;break}c.push(a),a=h(a)}try{u&&(t[n]=i),i[et]=1}catch(f){o[rt]=!1}}}return i}(this,r,e,i)||(typeof(n=(n=e[t=r])===i?h(e)[t]:n)!==Z&&Tt("["+t+"] is not a "+Z),n)).apply(this,arguments)})[nt]=1,i)))}))}xt[it]=mt.o;var bt="name",At="identifier",y="push",kt="isInitialized",It="config",Et="logger",_="length",Pt="time",T="processNext",Mt="getPlugin",C="teardown",St="messageId",Ot="message",Nt="isAsync",Dt="_doTeardown",Ut="update",w="getNext",x="diagLog",jt="setNextPlugin",Lt="createNew",Rt="cookieCfg",zt="indexOf",Vt="substring",Kt="userAgent",Wt="split",Bt="setEnabled",Jt="nodeType",$t="apply",o="replace",qt="enableDebugExceptions",Gt="toLowerCase",b="call",Ft="isChildEvt",Ht="getCtx",l="setCtx",Xt="complete",A="",k="core",Qt="disabled",Yt="extensionConfig",Zt="processTelemetry",tn="priority",nn="errorToConsole",en="warnToConsole",rn="getPerfMgr",on="endsWith",un="trim",ct="toString",an="constructor",cn=J,ln=e.freeze,n=String[r],fn=n[un],sn=n[on],u=Array.isArray,pn=W[ct],dn=$[ct],vn=dn[b](e),mn=/-([a-z])/g,gn=/([^\w\d_$])/g,hn=/^(\d+[\w\d_$])/,yn=Object.getPrototypeOf;function I(t){return t===undefined||typeof t===i}function E(t){return null===t||I(t)}function _n(t){return!E(t)}function Tn(t){return!(!t||typeof t!==d)}function P(t){return!(!t||typeof t!==V)}function Cn(t){var n=t;return t&&xn(t)?(n=(n=t[o](mn,function(t,n){return n.toUpperCase()}))[o](gn,"_"))[o](hn,function(t,n){return"_"+n}):n}function wn(t,n){if(t)for(var e in t)$[b](t,e)&&n[b](t,e,t[e])}function M(t,n){return!(!t||!n)&&-1!==t[zt](n)}var S=u||function(t){return!(!t||"[object Array]"!==pn[b](t))};function xn(t){return"string"==typeof t}function bn(t){return t&&"object"==typeof t&&(!(t=(yn||function(t){if(t){if(yn)return yn(t);t=t.__proto__||t[r]||t[an];if(t)return t}return null})(t))||typeof(t=t[an]&&$[b](t,an)?t[an]:t)===V&&dn[b](t)===vn)}function O(t,n,e){var r=t[_];try{for(var i=0;i<r&&!(i in t&&-1===n[b](e||t,t[i],i,t));i++);}catch(o){}}function N(t){return t&&(fn&&t[un]?t[un]():t[o]?t[o](/^\s+|(?=\s)\s+$/g,A):t)}function An(t,n,e,r){if(cn)try{var i={enumerable:!0,configurable:!0};return e&&(i.get=e),r&&(i.set=r),cn(t,n,i),!0}catch(o){}return!1}var kn=ln||function(t){return t};function D(){var t=Date;return t.now?t.now():(new t).getTime()}function U(t,n,e,r,i){var o=e;!t||(o=t[n])===e||i&&!i(o)||r&&!r(e)||(t[n]=o=e)}function In(t,n){return E(t)?n:t}function En(t){return!!t}function Pn(t,n,e,r,i){var o,u,a;t&&n&&e&&(!1===i&&!I(t[n])||(t[n]=(o=r,a=u=null,P(i=e)?u=i:a=i,function(){var t=arguments;if(a=u?u():a)return a[o][$t](a,t)})))}var Mn="window",Sn="navigator",On="location",Nn="console",Dn="JSON",Un="msie",jn="trident/",Ln=null,Rn=null;function j(t){var n=G();return n&&n[t]?n[t]:t===Mn&&typeof window===d&&window?window:null}function zn(){return typeof navigator===d&&navigator?navigator:j(Sn)}function Vn(){return typeof JSON===d&&JSON||null!==j(Dn)}function Kn(){return Vn()?JSON||j(Dn):null}function Wn(){var t=zn();return!t||t[Kt]===Rn&&null!==Ln||(t=((Rn=t[Kt])||A)[Gt](),Ln=M(t,Un)||M(t,jn)),Ln}function Bn(t){var n=Object[r].toString[b](t),e=A;return"[object Error]"===n?e="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t[bt]+"'":Vn()&&(e=Kn().stringify(t)),n+e}var Jn=null;function $n(t){return t?'"'+t[o](/\"/g,A)+'"':A}function qn(t,n){var e,r=typeof console!==i?console:j(Nn);r&&(e="log",P(r[e=r[t]?t:e])&&r[e](n))}Fn.dataType="MessageData";var Gn=Fn;function Fn(t,n,e,r){void 0===e&&(e=!1),this[St]=t,this[Ot]=(e?"AI: ":"AI (Internal): ")+t;e=A,Vn()&&(e=Kn().stringify(r)),t=(n?" message:"+$n(n):A)+(r?" props:"+$n(e):A);this[Ot]+=t}Xn.__ieDyn=1;var Hn=Xn;function Xn(i){this.identifier="DiagnosticLogger",this.queue=[];var c,l,f,s,p=0,d={};xt(Xn,this,function(o){var t;function u(t,n){var e,r;f<=p||(r=!0,e="AITR_"+n[St],d[e]?r=!1:d[e]=!0,r&&(t<=l&&(o.queue[y](n),p++,a(1===t?"error":"warn",n)),p===f&&(r=new Gn(23,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue[y](r),1===t?o[nn](e):o[en](e))))}function a(t,n){var e,r=(e=(e=Jn)||!0===(i||{}).disableDbgExt?e:Jn||(r=j("Microsoft"),Jn=r?r.ApplicationInsights:Jn))?e.ChromeDbgExt:null;r&&r[x]&&r[x](t,n)}c=In((t=i||{}).loggingLevelConsole,0),l=In(t.loggingLevelTelemetry,1),f=In(t.maxMessageLimit,25),s=In(t.enableDebug,In(t[qt],!1)),o.consoleLoggingLevel=function(){return c},o.telemetryLoggingLevel=function(){return l},o.maxInternalMessageLimit=function(){return f},o[qt]=function(){return s},o.throwInternal=function(t,n,e,r,i){n=new Gn(n,e,i=void 0!==i&&i,r);if(s)throw Bn(n);e=1===t?nn:en;I(n[Ot])?a("throw"+(1===t?"Critical":"Warning"),n):(i?(r=+n[St],!d[r]&&t<=c&&(o[e](n[Ot]),d[r]=!0)):t<=c&&o[e](n[Ot]),u(t,n))},o[en]=function(t){qn("warn",t),a("warning",t)},o[nn]=function(t){qn("error",t),a("error",t)},o.resetInternalMessageCount=function(){p=0,d={}},o.logInternalMessage=u})}function Qn(t,n,e,r,i,o){void 0===o&&(o=!1),(t||new Hn).throwInternal(n,e,r,i,o)}var Yn="ParentContextKey",Zn="ChildrenContextKey",te=(c.ParentContextKey="parent",c.ChildrenContextKey="childEvts",c);function c(t,i,n){var e,o=this,u=!1;o.start=D(),o[bt]=t,o[Nt]=n,o[Ft]=function(){return!1},P(i)&&(u=An(o,"payload",function(){return!e&&P(i)&&(e=i(),i=null),e})),o[Ht]=function(t){return t?(t===c[Yn]||t===c[Zn]?o:o.ctx||{})[t]:null},o[l]=function(t,n){t&&(t===c[Yn]?(o[t]||(o[Ft]=function(){return!0}),o[t]=n):t===c[Zn]?o[t]=n:(o.ctx=o.ctx||{})[t]=n)},o[Xt]=function(){var t=0,n=o[Ht](c[Zn]);if(S(n))for(var e=0;e<n[_];e++){var r=n[e];r&&(t+=r[Pt])}o[Pt]=D()-o.start,o.exTime=o[Pt]-t,o[Xt]=function(){},!u&&P(i)&&(o.payload=i())}}var ne="CoreUtils.doPerf";function ee(t,n,e,r,i){if(t)if(t=t[rn]?t[rn]():t){var o,u=void 0,a=t[Ht](ne);try{if(u=t.create(n(),r,i))return a&&u[l]&&(u[l](te[Yn],a),a[Ht]&&a[l]&&((o=a[Ht](te[Zn]))||(o=[],a[l](te[Zn],o)),o[y](u))),t[l](ne,u),e(u)}catch(c){u&&u[l]&&u[l]("exception",c)}finally{u&&t.fire(u),t[l](ne,a)}}e()}var re=4294967296,f=4294967295,ie=!1,oe=123456789,ue=987654321;function ae(t){var n,e=0,r=j("crypto")||j("msCrypto");if(0===(e=r&&r.getRandomValues?r.getRandomValues(new Uint32Array(1))[0]&f:e)&&Wn()){if(!ie)try{var i=2147483647&D();(n=(Math.random()*re^i)+i)<0&&(n>>>=0),oe=123456789+n&f,ue=987654321-n&f,ie=!0}catch(o){}r=((ue=36969*(65535&ue)+(ue>>16)&f)<<16)+(65535&(oe=18e3*(65535&oe)+(oe>>16)&f))>>>0&f|0,e=(r>>>=0)&f}return 0===e&&(e=Math.floor(re*Math.random()|0)),t||(e>>>=0),e}var ce=J,n="."+function(t){void 0===t&&(t=22);for(var n=ae()>>>0,e=0,r=A;r[_]<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n]||"",n>>>=6,5==++e&&(n=(ae()<<2&4294967295|3&n)>>>0,e=0);return r}(6);function le(t){return 1===t[Jt]||9===t[Jt]||!+t[Jt]}var fe="toGMTString",se="toUTCString",pe="cookie",de="expires",ve="enabled",me="isCookieUseDisabled",ge="disableCookiesUsage",he="_ckMgr",ye=null,_e=null,Te=null,Ce=typeof document===d&&document?document:j("document"),we={},xe={};function be(t){return!t||t.isEnabled()}function Ae(t,n){return n&&t&&S(t.ignoreCookies)&&-1!==t.ignoreCookies[zt](n)}function ke(t,i){U(e=(t=t||xe)[Rt]=t[Rt]||{},"domain",t.cookieDomain,_n,E),U(e,"path",t.cookiePath||"/",null,E),E(e[ve])&&(n=void 0,I(t[me])||(n=!t[me]),I(t[ge])||(n=!t[ge]),e[ve]=n);var n,e,l=e,f=l.path||"/",s=l.domain,r=!1!==l[ve],p=((t={isEnabled:function(){var t=r&&Ie(i),n=xe[he];return t&&n&&p!==n?be(n):t}})[Bt]=function(t){r=!1!==t},t.set=function(t,n,e,r,i){var o,u,a,c=!1;return!be(p)||(u=l,(a=t)&&u&&S(u.blockedCookies)&&-1!==u.blockedCookies[zt](a)||Ae(u,a))||(u={},-1!==(o=(a=N(n||A))[zt](";"))&&(a=N(n[Vt](0,o)),u=Ee(n[Vt](o+1))),U(u,"domain",r||s,En,I),E(e)||(o=Wn(),I(u[de])&&0<(n=D()+1e3*e)&&((r=new Date).setTime(n),U(u,de,Pe(r,o?fe:se)||Pe(r,o?fe:se)||A,En)),o||U(u,"max-age",A+e,null,I)),(n=typeof location===d&&location?location:j(On))&&"https:"===n.protocol&&(U(u,"secure",null,null,I),(_e=null===_e?!(xn(r=(zn()||{})[Kt])&&(M(r,"CPU iPhone OS 12")||M(r,"iPad; CPU OS 12")||M(r,"Macintosh; Intel Mac OS X 10_14")&&M(r,"Version/")&&M(r,"Safari")||M(r,"Macintosh; Intel Mac OS X 10_14")&&function(t,n){var e=!1;if(!t||(e=t===n))return e;if(sn)return t[on](n);var r=t,i=n,e=!1,t=i[_],n=r?r[_]:0;if(t&&n&&t<=n&&!(e=r===i)){for(var o=n-1,u=t-1;0<=u;u--){if(r[o]!=i[u])return;o--}e=!0}return e}(r,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||M(r,"Chrome/5")||M(r,"Chrome/6")||M(r,"UnrealEngine")&&!M(r,"Chrome")||M(r,"UCBrowser/12")||M(r,"UCBrowser/11"))):_e)&&U(u,"SameSite","None",null,I)),U(u,"path",i||f,null,I),(l.setCookie||Se)(t,Me(a,u)),c=!0),c},t.get=function(t){var n=A;return be(p)&&!Ae(l,t)?(l.getCookie||function(t){var n,e=A;return Ce&&(n=Ce[pe]||A,Te!==n&&(we=Ee(n),Te=n),e=N(we[t]||A)),e})(t):n},t.del=function(t,n){return!!be(p)&&p.purge(t,n)},t.purge=function(t,n){var e,r=!1;return Ie(i)&&((e={}).path=n||"/",e[de]="Thu, 01 Jan 1970 00:00:01 GMT",n=e,Wn()||(n["max-age"]="0"),(l.delCookie||Se)(t,Me(A,n)),r=!0),r},t);return p[he]=p}function Ie(t){if(null===ye){ye=!1;try{ye=(Ce||{})[pe]!==undefined}catch(n){Qn(t,2,68,"Cannot access document.cookie - "+((t=n)&&"[object Error]"===pn[b](t)?t[bt]:A),{exception:Bn(n)})}}return ye}function Ee(t){var e={};return t&&t[_]&&O(N(t)[Wt](";"),function(t){var n;(t=N(t||A))&&(-1===(n=t[zt]("="))?e[t]=null:e[N(t[Vt](0,n))]=N(t[Vt](n+1)))}),e}function Pe(t,n){return P(t[n])?t[n]():null}function Me(t,n){var e=t||A;return wn(n,function(t,n){e+="; "+t+(E(n)?A:"="+n)}),e}function Se(t,n){Ce&&(Ce[pe]=t+"="+n)}var Oe,Ne,De=Ne={id:Cn("_aiData-plugin.2.8.120"+((Oe=void 0!==Oe&&Oe)?".2.8.12":A)+n),accept:le,get:function(t,n,e,r){var i=t[Ne.id];return i?i[Cn(n)]:(r&&((i=function(t,n){var e=n[t.id];if(!e){e={};try{le(n)&&!function(t,n,e){if(ce)try{return ce(t,n,{value:e,enumerable:!1,configurable:!0}),1}catch(r){}}(n,t.id,e)&&(n[t.id]=e)}catch(r){}}return e}(Ne,t))[Cn(n)]=e),e)},kill:function(t,n){if(t&&t[n])try{delete t[n]}catch(e){}}};function Ue(t){return De.get(t,"state",{},!0)}var je="TelemetryPluginChain",Le="_hasRun",Re="_getTelCtx",ze=0;function Ve(t,u,e,n){var r=null,i=[],o=(null!==n&&(r=n?function(t,n,e){for(;t;){if(t[Mt]()===e)return t;t=t[w]()}return We([e],n[It]||{},n)}(t,e,n):t),{_next:function(){var t,n=r;return r=n?n[w]():null,n||(t=i)&&0<t[_]&&(O(t,function(t){try{t.func[b](t.self,t.args)}catch(n){Qn(e[Et],2,73,"Unexpected Exception during onComplete - "+Bn(n))}}),i=[]),n},ctx:{core:function(){return e},diagLog:function(){return(e||{})[Et]||new Hn(u)},getCfg:function(){return u},getExtCfg:a,getConfig:function(t,n,e){void 0===e&&(e=!1);var r,t=a(t,null);return t&&!E(t[n])?r=t[n]:u&&!E(u[n])&&(r=u[n]),E(r)?e:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(t){r=t},iterate:function(t){for(;n=o._next();){var n=n[Mt]();n&&t(n)}},onComplete:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];t&&i[y]({func:t,self:I(n)?o.ctx:n,args:e})}}});function a(t,n,e){var r,i,o;return void 0===n&&(n={}),void 0===e&&(e=0),(r=u&&(i=u[Yt])&&t?i[t]:r)?Tn(n)&&0!==e&&(o=function p(){var t=arguments,n=t[0]||{},e=t[_],r=!1,i=1;for(0<e&&"boolean"==typeof n&&(r=n,n=t[i]||{},i++),Tn(n)||(n={});i<e;i++){var o,u,a,c,l=t[i],f=S(l),s=Tn(l);for(o in l)(f&&o in l||s&&$[b](l,o))&&(u=l[o],a=void 0,r&&u&&((a=S(u))||bn(u))&&(c=n[o],a?S(c)||(c=[]):bn(c)||(c={}),u=p(r,c,u)),u!==undefined&&(n[o]=u))}return n}(!0,n,r),u&&2===e&&wn(n,function(t){var n;E(o[t])&&!E(n=u[t])&&(o[t]=n)}),r=o):r=n,r}return o}function Ke(t,e,r,n){var i=Ve(t,e,r,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n[Zt](t,o),!n},o[Lt]=function(t,n){return Ke((t=S(t=void 0===t?null:t)?We(t,e,r,n):t)||o[w](),e,r,n)},o}function We(t,n,e,r){var i,o=null,u=!r;return S(t)&&0<t[_]&&(i=null,O(t,function(t){(u=!u&&r===t||u)&&t&&P(t[Zt])&&(t=Be(t,n,e),o=o||t,i&&i._setNext(t),i=t)})),r&&!o?We([r],n,e):o}function Be(c,r,i){var l=null,o=P(c[Zt]),u=P(c[jt]),f=c?c[At]+"-"+c[tn]+"-"+ze++:"Unknown-0-"+ze++,a={getPlugin:function(){return c},getNext:function(){return l},processTelemetry:function(e,t){var n;s(t=t||(n=(n=c&&P(c[Re])?c[Re]():n)||Ke(a,r,i)),function(t){if(!c||!o)return!1;var n=Ue(c);return!n[C]&&!n[Qt]&&(u&&c[jt](l),c[Zt](e,t),!0)},"processTelemetry",function(){return{item:e}},!e.sync)||t[T](e)},unload:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Ue(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||(t[k]=null,t[C]=!0,t[kt]=!1,c[C]&&!0===c[C](r,i)&&(e=!0))),e},"unload",function(){},i[Nt])||r[T](i)},update:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Ue(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||c[Ut]&&!0===c[Ut](r,i)&&(e=!0)),e},"update",function(){},!1)||r[T](i)},_id:f,_setNext:function(t){l=t}};function s(e,r,i,t,n){var o=!1,u=c?c[At]:je,a=(a=e[Le])||(e[Le]={});return e.setNext(l),c&&ee(e[k](),function(){return u+":"+i},function(){a[f]=!0;try{var t=l?l._id:A;t&&(a[t]=!1),o=r(e)}catch(n){t=!l||a[l._id];t&&(o=!0),l&&t||Qn(e[x](),1,73,"Plugin ["+u+"] failed during "+i+" - "+Bn(n)+", run flags: "+Bn(a))}},t,n),o}return kn(a)}function Je(){var n=[];return{add:function(t){t&&n[y](t)},run:function(e,r){O(n,function(t){try{t(e,r)}catch(n){Qn(e[x](),2,73,"Unexpected error calling unload handler - "+Bn(n))}}),n=[]}}}var $e,L="getPlugin";function qe(){var i,o,f,s,p,u=this;function n(t){var n,t=t=void 0===t?null:t;return t||(n=o||Ke(null,{},u[k]),t=f&&f[L]?n[Lt](null,f[L]):n[Lt](null,f)),t}function c(t,n,e){t&&U(t,Yt,[],null,E),!e&&n&&(e=n.getProcessTelContext()[w]());var r=f;f&&f[L]&&(r=f[L]()),u[k]=n,o=Ke(e,t,n,r)}function d(){i=!1,u[k]=null,f=o=null,p=[],s=Je()}d(),xt(qe,u,function(l){l.initialize=function(t,n,e,r){c(t,n,r),i=!0},l[C]=function(t,n){var e,r,i,o,u=l[k];if(u&&(!t||u===t[k]()))return r=!1,i=t||function c(t,e,n){var r=e[It]||{},i=Ve(t,r,e,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n.unload(o,t),!n},o[Lt]=function(t,n){return c((t=S(t=void 0===t?null:t)?We(t,r,e,n):t)||o[w](),e,n)},o}(null,u,f&&f[L]?f[L]():f),o=n||((t={reason:0})[Nt]=!1,t),l[Dt]&&!0===l[Dt](i,o,a)?e=!0:a(),e;function a(){var t;r||(r=!0,s.run(i,n),t=p,p=[],O(t,function(t){t.rm()}),!0===e&&i[T](o),d())}},l[Ut]=function(t,n){var e,r,i,o=l[k];if(o&&(!t||o===t[k]()))return r=!1,i=t||function a(t,e,n){var r=e[It]||{},i=Ve(t,r,e,n).ctx;return i[T]=function(n){return i.iterate(function(t){P(t[Ut])&&t[Ut](i,n)})},i[Lt]=function(t,n){return a((t=S(t=void 0===t?null:t)?We(t,r,e,n):t)||i[w](),e,n)},i}(null,o,f&&f[L]?f[L]():f),l._doUpdate&&!0===l._doUpdate(i,n||{reason:0},u)?e=!0:u(),e;function u(){r||(r=!0,c(i.getCfg(),i.core(),i[w]()))}},l._addHook=function(t){t&&(S(t)?p=p.concat(t):p[y](t))},Pn(l,"_addUnloadCb",function(){return s},"add")}),u[x]=function(t){return n(t)[x]()},u[kt]=function(){return i},u.setInitialized=function(t){i=t},u[jt]=function(t){f=t},u[T]=function(t,n){n?n[T](t):f&&P(f[Zt])&&f[Zt](t,null)},u._getTelCtx=n}function Ge(){var a,c,l,f,s=$e.call(this)||this;return s.priority=185,s.identifier="ReactPlugin",xt(Ge,s,function(i,t){var n,e,r;function o(){f=l=c=a=null}function u(){return a||Qn(i.diagLog(),1,64,"Analytics plugin is not available, React plugin telemetry will not be sent: "),a}o(),i.initialize=function(t,n,e,r){$e.prototype.initialize.call(s,t,n,e,r),c=t.extensionConfig&&t.extensionConfig[i.identifier]?t.extensionConfig[i.identifier]:{history:null},O(e,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(a=t)}),c.history&&(n=c.history,l=n.listen(function(t){var n="location"in t?t.location:t;f=setTimeout(function(){f=null;var t={uri:n.pathname};i.trackPageView(t)},500)}),r={uri:c.history.location.pathname},i.trackPageView(r))},i.getCookieMgr=function(){return(n=(e=i.core)?e.getCookieMgr():n)||(e=(e||{})[Et],(r=ke[he]||xe[he])||(r=ke[he]=ke(t,e),xe[he]=r),n=r),n;var t,n,e,r},i.getAppInsights=u,i.processTelemetry=function(t,n){i.processNext(t,n)},i._doTeardown=function(t,n,e){P(l)&&l(),f&&clearTimeout(f),o()},e=u,r=["trackMetric","trackPageView","trackEvent","trackException","trackTrace"],(n=i)&&e&&Tn(n)&&S(r)&&O(r,function(t){xn(t)&&Pn(n,t,e,t,void 0)}),An(i,"_extensionConfig",function(){return c})}),s}qe.__ieDyn=1,Q(Ge,$e=qe),Ge.__ieDyn=1;var Fe,ct=Ge,He=(Q(Xe,Fe=R.Component),Xe.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=D(),this._firstActiveTimestamp=0,this._totalIdleTime=0,this._lastActiveTimestamp=0,this._idleStartTimestamp=0,this._idleCount=0,this._intervalId=setInterval(function(){0<t._lastActiveTimestamp&&0===t._idleStartTimestamp&&D()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=D(),t._idleCount++)},100)},Xe.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,n;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),n={"Component Name":this._componentName},this._reactPlugin.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},n))},Xe.prototype.getEngagementTimeSeconds=function(){return(D()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},Xe);function Xe(t,n,e){var r=Fe.call(this,t)||this;return r._mountTimestamp=0,r._firstActiveTimestamp=0,r._idleStartTimestamp=0,r._lastActiveTimestamp=0,r._totalIdleTime=0,r._idleCount=0,r._idleTimeout=5e3,r.trackActivity=function(t){var n;0===r._firstActiveTimestamp?(r._firstActiveTimestamp=D(),r._lastActiveTimestamp=r._firstActiveTimestamp):r._lastActiveTimestamp=D(),0<r._idleStartTimestamp&&(n=r._lastActiveTimestamp-r._idleStartTimestamp,r._totalIdleTime+=n,r._idleStartTimestamp=0)},r._reactPlugin=n,r._componentName=e,r}Qe={},wn({Verbose:0,Information:1,Warning:2,Error:3,Critical:4},function(t,n){Qe[t]=n,Qe[n]=t}),u=Qe,ln&&wn(u,function(t,n){(S(n)||Tn(n))&&ln(n)});var Qe,Ye,Ze=kn(u);function tr(){var t=null!==Ye&&Ye.apply(this,arguments)||this;return t.state={hasError:!1},t}Q(tr,Ye=z["default"].Component),tr.prototype.componentDidCatch=function(t,n){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:Ze.Error,properties:n})},tr.prototype.render=function(){var t;return this.state.hasError?(t=this.props.onError,z["default"].createElement(t)):this.props.children};var J=tr,nr=a.createContext(undefined);t.AITrackedComponentBase=He,t.AppInsightsContext=nr,t.AppInsightsErrorBoundary=J,t.ReactPlugin=ct,t.useAppInsightsContext=function(){return a.useContext(nr)},t.useTrackEvent=function(t,n,e,r){void 0===r&&(r=!0);var e=a.useState(e),i=e[0],e=e[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:n},i)},[t,i,n]),e},t.useTrackMetric=function(r,i,o){var u=a.useRef({hookTimestamp:D(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=u.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&D()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=D(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t,n=u.current;if(0===n.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==n.firstActiveTimestamp&&(n=n,n={average:(D()-n.firstActiveTimestamp-n.totalIdleTime-n.idleCount*n.idleTimeout)/1e3,name:"React Component Engaged Time (seconds)",sampleCount:1},t=H({"Component Name":i},o),r.trackMetric(n,t))}},[]),function(){var t,n=u.current;0===n.firstActiveTimestamp?(n.firstActiveTimestamp=D(),n.lastActiveTimestamp=n.firstActiveTimestamp):n.lastActiveTimestamp=D(),0<n.idleStartTimestamp&&(t=n.lastActiveTimestamp-n.idleStartTimestamp,n.totalIdleTime+=t,n.idleStartTimestamp=0)}},t.withAITracking=function(n,t,e,r){return e!==undefined&&null!==e&&"string"==typeof e||(e=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),r!==undefined&&null!==r&&"string"==typeof r||(r=""),Q(i,o=He),i.prototype.render=function(){return R.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:r},R.createElement(t,H({},this.props)))},i;function i(t){return o.call(this,t,n,e)||this}var o},Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);
5
+ var t=this,n=function(t,a){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{"default":t}}function p(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){var n;"default"!==t&&Object.defineProperty(r,t,(n=Object.getOwnPropertyDescriptor(e,t)).get?n:{enumerable:!0,get:function(){return e[t]}})}),r["default"]=e,r}var R=p(a),z=s(a),V="function",d="object",i="undefined",r="prototype",K="hasOwnProperty",e=Object,W=e[r],n=e.assign,B=e.create,J=e.defineProperty,$=W[K],q=null;function G(t){t=!1===(t=void 0===t||t)?null:q;return t||((t=(t=(t=typeof globalThis!==i?globalThis:t)||typeof self===i?t:self)||typeof window===i?t:window)||typeof global===i||(t=global),q=t),t}function F(t){throw new TypeError(t)}(G()||{}).Symbol,(G()||{}).Reflect;var H=n||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var i in n=arguments[e])W[K].call(n,i)&&(t[i]=n[i]);return t},X=function(t,n){return(X=e.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[K](e)&&(t[e]=n[e])})(t,n)};function Q(t,n){function e(){this.constructor=t}typeof n!==V&&null!==n&&F("Class extends value "+n+" is not a constructor or null"),X(t,n),t[r]=null===n?function(t){if(B)return B(t);if(null==t)return{};var n=typeof t;function e(){}return n!==d&&n!==V&&F("Object prototype may only be an Object:"+t),e[r]=t,new e}(n):(e[r]=n[r],new e)}var n="undefined",Y="constructor",v="prototype",Z="function",tt="_dynInstFuncs",nt="_isDynProxy",m="_dynClass",et="_dynInstChk",rt=et,it="_dfOpts",ot="_unknown_",ut="__proto__",at="_dyn"+ut,ct="__dynProto$Gbl",lt="_dynInstProto",ft="useBaseInst",st="setInstFuncs",pt=Object,dt=pt.getPrototypeOf,vt=pt.getOwnPropertyNames,n=(u=(u=(u=(u=typeof globalThis!=n?globalThis:u)||typeof self==n?u:self)||typeof window==n?u:window)||typeof global==n?u:global)||{},mt=n[ct]||(n[ct]={o:((u={})[st]=!0,u[ft]=!0,u),n:1e3});function g(t,n){return t&&pt[v].hasOwnProperty.call(t,n)}function gt(t){return t&&(t===pt[v]||t===Array[v])}function ht(t){return gt(t)||t===Function[v]}function h(t){if(t){if(dt)return dt(t);var n=t[ut]||t[v]||(t[Y]?t[Y][v]:null),e=t[at]||n;g(t,at)||(delete t[lt],e=t[at]=t[lt]||t[at],t[lt]=n)}return e}function yt(t,n){var e=[];if(vt)e=vt(t);else for(var r in t)"string"==typeof r&&g(t,r)&&e.push(r);if(e&&0<e.length)for(var i=0;i<e.length;i++)n(e[i])}function _t(t,n,e){return n!==Y&&typeof t[n]===Z&&(e||g(t,n))}function Tt(t){throw new TypeError("DynamicProto: "+t)}function Ct(t,n){for(var e=t.length-1;0<=e;e--)if(t[e]===n)return 1}function wt(t,n){return g(t,v)?t.name||n||ot:((t||{})[Y]||{}).name||n||ot}function xt(t,r,n,e){g(t,v)||Tt("theClass is an invalid class definition.");var i,o,u,a,c,l,f=t[v],s=(function(t){if(!dt)return 1;for(var n=[],e=h(r);e&&!ht(e)&&!Ct(n,e);){if(e===t)return 1;n.push(e),e=h(e)}}(f)||Tt("["+wt(t)+"] not in hierarchy of ["+wt(r)+"]"),null),t=(g(f,m)?s=f[m]:(s="_dynCls$"+wt(t,"_")+"$"+mt.n,mt.n++,f[m]=s),xt[it]),p=!!t[ft],d=(p&&e&&e[ft]!==undefined&&(p=!!e[ft]),o={},yt(i=r,function(t){!o[t]&&_t(i,t,!1)&&(o[t]=i[t])}),o),p=(n(r,function(t,n,e,o){function r(t,n,e){var r,i=n[e];return i[nt]&&o&&!1!==(r=t[tt]||{})[rt]&&(i=(r[n[m]]||{})[e]||i),function(){return i.apply(t,arguments)}}for(var i={},u=(yt(e,function(t){i[t]=r(n,e,t)}),h(t)),a=[];u&&!ht(u)&&!Ct(a,u);)yt(u,function(t){!i[t]&&_t(u,t,!dt)&&(i[t]=r(n,u,t))}),a.push(u),u=h(u);return i}(f,r,d,p)),!!dt&&!!t[st]);u=f,n=s,a=r,c=d,t=!1!==(p=p&&e?!!e[st]:p),gt(u)||(f=a[tt]=a[tt]||{},l=f[n]=f[n]||{},!1!==f[rt]&&(f[rt]=!!t),yt(a,function(t){var e,r,i;_t(a,t,!1)&&a[t]!==c[t]&&(l[t]=a[t],delete a[t],g(u,t)&&(!u[t]||u[t][nt])||(u[t]=(e=u,r=t,(i=function(){var t,n;return(function(t,n,e,r){var i=null;if(t&&g(e,m)){var o=t[tt]||{};if((i=(o[e[m]]||{})[n])||Tt("Missing ["+n+"] "+Z),!i[et]&&!1!==o[rt]){for(var u=!g(t,n),a=h(t),c=[];u&&a&&!ht(a)&&!Ct(c,a);){var l=a[n];if(l){u=l===r;break}c.push(a),a=h(a)}try{u&&(t[n]=i),i[et]=1}catch(f){o[rt]=!1}}}return i}(this,r,e,i)||(typeof(n=(n=e[t=r])===i?h(e)[t]:n)!==Z&&Tt("["+t+"] is not a "+Z),n)).apply(this,arguments)})[nt]=1,i)))}))}xt[it]=mt.o;var bt="name",At="identifier",y="push",kt="isInitialized",It="config",Et="logger",_="length",Pt="time",T="processNext",Mt="getPlugin",C="teardown",St="messageId",Ot="message",Nt="isAsync",Dt="_doTeardown",Ut="update",w="getNext",x="diagLog",jt="setNextPlugin",Lt="createNew",Rt="cookieCfg",zt="indexOf",Vt="substring",Kt="userAgent",Wt="split",Bt="setEnabled",Jt="nodeType",$t="apply",o="replace",qt="enableDebugExceptions",Gt="toLowerCase",b="call",Ft="isChildEvt",Ht="getCtx",l="setCtx",Xt="complete",A="",k="core",Qt="disabled",Yt="extensionConfig",Zt="processTelemetry",tn="priority",nn="errorToConsole",en="warnToConsole",rn="getPerfMgr",on="endsWith",un="trim",ct="toString",an="constructor",cn=J,ln=e.freeze,n=String[r],fn=n[un],sn=n[on],u=Array.isArray,pn=W[ct],dn=$[ct],vn=dn[b](e),mn=/-([a-z])/g,gn=/([^\w\d_$])/g,hn=/^(\d+[\w\d_$])/,yn=Object.getPrototypeOf;function I(t){return t===undefined||typeof t===i}function E(t){return null===t||I(t)}function _n(t){return!E(t)}function Tn(t){return!(!t||typeof t!==d)}function P(t){return!(!t||typeof t!==V)}function Cn(t){var n=t;return t&&xn(t)?(n=(n=t[o](mn,function(t,n){return n.toUpperCase()}))[o](gn,"_"))[o](hn,function(t,n){return"_"+n}):n}function wn(t,n){if(t)for(var e in t)$[b](t,e)&&n[b](t,e,t[e])}function M(t,n){return!(!t||!n)&&-1!==t[zt](n)}var S=u||function(t){return!(!t||"[object Array]"!==pn[b](t))};function xn(t){return"string"==typeof t}function bn(t){return t&&"object"==typeof t&&(!(t=(yn||function(t){if(t){if(yn)return yn(t);t=t.__proto__||t[r]||t[an];if(t)return t}return null})(t))||typeof(t=t[an]&&$[b](t,an)?t[an]:t)===V&&dn[b](t)===vn)}function O(t,n,e){var r=t[_];try{for(var i=0;i<r&&!(i in t&&-1===n[b](e||t,t[i],i,t));i++);}catch(o){}}function N(t){return t&&(fn&&t[un]?t[un]():t[o]?t[o](/^\s+|(?=\s)\s+$/g,A):t)}function An(t,n,e,r){if(cn)try{var i={enumerable:!0,configurable:!0};return e&&(i.get=e),r&&(i.set=r),cn(t,n,i),!0}catch(o){}return!1}var kn=ln||function(t){return t};function D(){var t=Date;return t.now?t.now():(new t).getTime()}function U(t,n,e,r,i){var o=e;!t||(o=t[n])===e||i&&!i(o)||r&&!r(e)||(t[n]=o=e)}function In(t,n){return E(t)?n:t}function En(t){return!!t}function Pn(t,n,e,r,i){var o,u,a;t&&n&&e&&(!1===i&&!I(t[n])||(t[n]=(o=r,a=u=null,P(i=e)?u=i:a=i,function(){var t=arguments;if(a=u?u():a)return a[o][$t](a,t)})))}var Mn="window",Sn="navigator",On="location",Nn="console",Dn="JSON",Un="msie",jn="trident/",Ln=null,Rn=null;function j(t){var n=G();return n&&n[t]?n[t]:t===Mn&&typeof window===d&&window?window:null}function zn(){return typeof navigator===d&&navigator?navigator:j(Sn)}function Vn(){return typeof JSON===d&&JSON||null!==j(Dn)}function Kn(){return Vn()?JSON||j(Dn):null}function Wn(){var t=zn();return!t||t[Kt]===Rn&&null!==Ln||(t=((Rn=t[Kt])||A)[Gt](),Ln=M(t,Un)||M(t,jn)),Ln}function Bn(t){var n=Object[r].toString[b](t),e=A;return"[object Error]"===n?e="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t[bt]+"'":Vn()&&(e=Kn().stringify(t)),n+e}var Jn=null;function $n(t){return t?'"'+t[o](/\"/g,A)+'"':A}function qn(t,n){var e,r=typeof console!==i?console:j(Nn);r&&(e="log",P(r[e=r[t]?t:e])&&r[e](n))}Fn.dataType="MessageData";var Gn=Fn;function Fn(t,n,e,r){void 0===e&&(e=!1),this[St]=t,this[Ot]=(e?"AI: ":"AI (Internal): ")+t;e=A,Vn()&&(e=Kn().stringify(r)),t=(n?" message:"+$n(n):A)+(r?" props:"+$n(e):A);this[Ot]+=t}Xn.__ieDyn=1;var Hn=Xn;function Xn(i){this.identifier="DiagnosticLogger",this.queue=[];var c,l,f,s,p=0,d={};xt(Xn,this,function(o){var t;function u(t,n){var e,r;f<=p||(r=!0,e="AITR_"+n[St],d[e]?r=!1:d[e]=!0,r&&(t<=l&&(o.queue[y](n),p++,a(1===t?"error":"warn",n)),p===f&&(r=new Gn(23,e="Internal events throttle limit per PageView reached for this app.",!1),o.queue[y](r),1===t?o[nn](e):o[en](e))))}function a(t,n){var e,r=(e=(e=Jn)||!0===(i||{}).disableDbgExt?e:Jn||(r=j("Microsoft"),Jn=r?r.ApplicationInsights:Jn))?e.ChromeDbgExt:null;r&&r[x]&&r[x](t,n)}c=In((t=i||{}).loggingLevelConsole,0),l=In(t.loggingLevelTelemetry,1),f=In(t.maxMessageLimit,25),s=In(t.enableDebug,In(t[qt],!1)),o.consoleLoggingLevel=function(){return c},o.telemetryLoggingLevel=function(){return l},o.maxInternalMessageLimit=function(){return f},o[qt]=function(){return s},o.throwInternal=function(t,n,e,r,i){n=new Gn(n,e,i=void 0!==i&&i,r);if(s)throw Bn(n);e=1===t?nn:en;I(n[Ot])?a("throw"+(1===t?"Critical":"Warning"),n):(i?(r=+n[St],!d[r]&&t<=c&&(o[e](n[Ot]),d[r]=!0)):t<=c&&o[e](n[Ot]),u(t,n))},o[en]=function(t){qn("warn",t),a("warning",t)},o[nn]=function(t){qn("error",t),a("error",t)},o.resetInternalMessageCount=function(){p=0,d={}},o.logInternalMessage=u})}function Qn(t,n,e,r,i,o){void 0===o&&(o=!1),(t||new Hn).throwInternal(n,e,r,i,o)}var Yn="ParentContextKey",Zn="ChildrenContextKey",te=(c.ParentContextKey="parent",c.ChildrenContextKey="childEvts",c);function c(t,i,n){var e,o=this,u=!1;o.start=D(),o[bt]=t,o[Nt]=n,o[Ft]=function(){return!1},P(i)&&(u=An(o,"payload",function(){return!e&&P(i)&&(e=i(),i=null),e})),o[Ht]=function(t){return t?(t===c[Yn]||t===c[Zn]?o:o.ctx||{})[t]:null},o[l]=function(t,n){t&&(t===c[Yn]?(o[t]||(o[Ft]=function(){return!0}),o[t]=n):t===c[Zn]?o[t]=n:(o.ctx=o.ctx||{})[t]=n)},o[Xt]=function(){var t=0,n=o[Ht](c[Zn]);if(S(n))for(var e=0;e<n[_];e++){var r=n[e];r&&(t+=r[Pt])}o[Pt]=D()-o.start,o.exTime=o[Pt]-t,o[Xt]=function(){},!u&&P(i)&&(o.payload=i())}}var ne="CoreUtils.doPerf";function ee(t,n,e,r,i){if(t)if(t=t[rn]?t[rn]():t){var o,u=void 0,a=t[Ht](ne);try{if(u=t.create(n(),r,i))return a&&u[l]&&(u[l](te[Yn],a),a[Ht]&&a[l]&&((o=a[Ht](te[Zn]))||(o=[],a[l](te[Zn],o)),o[y](u))),t[l](ne,u),e(u)}catch(c){u&&u[l]&&u[l]("exception",c)}finally{u&&t.fire(u),t[l](ne,a)}}e()}var re=4294967296,f=4294967295,ie=!1,oe=123456789,ue=987654321;function ae(t){var n,e=0,r=j("crypto")||j("msCrypto");if(0===(e=r&&r.getRandomValues?r.getRandomValues(new Uint32Array(1))[0]&f:e)&&Wn()){if(!ie)try{var i=2147483647&D();(n=(Math.random()*re^i)+i)<0&&(n>>>=0),oe=123456789+n&f,ue=987654321-n&f,ie=!0}catch(o){}r=((ue=36969*(65535&ue)+(ue>>16)&f)<<16)+(65535&(oe=18e3*(65535&oe)+(oe>>16)&f))>>>0&f|0,e=(r>>>=0)&f}return 0===e&&(e=Math.floor(re*Math.random()|0)),t||(e>>>=0),e}var ce=J,n="."+function(t){void 0===t&&(t=22);for(var n=ae()>>>0,e=0,r=A;r[_]<t;)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[0|63&n]||"",n>>>=6,5==++e&&(n=(ae()<<2&4294967295|3&n)>>>0,e=0);return r}(6);function le(t){return 1===t[Jt]||9===t[Jt]||!+t[Jt]}var fe="toGMTString",se="toUTCString",pe="cookie",de="expires",ve="enabled",me="isCookieUseDisabled",ge="disableCookiesUsage",he="_ckMgr",ye=null,_e=null,Te=null,Ce=typeof document===d&&document?document:j("document"),we={},xe={};function be(t){return!t||t.isEnabled()}function Ae(t,n){return n&&t&&S(t.ignoreCookies)&&-1!==t.ignoreCookies[zt](n)}function ke(t,i){U(e=(t=t||xe)[Rt]=t[Rt]||{},"domain",t.cookieDomain,_n,E),U(e,"path",t.cookiePath||"/",null,E),E(e[ve])&&(n=void 0,I(t[me])||(n=!t[me]),I(t[ge])||(n=!t[ge]),e[ve]=n);var n,e,l=e,f=l.path||"/",s=l.domain,r=!1!==l[ve],p=((t={isEnabled:function(){var t=r&&Ie(i),n=xe[he];return t&&n&&p!==n?be(n):t}})[Bt]=function(t){r=!1!==t},t.set=function(t,n,e,r,i){var o,u,a,c=!1;return!be(p)||(u=l,(a=t)&&u&&S(u.blockedCookies)&&-1!==u.blockedCookies[zt](a)||Ae(u,a))||(u={},-1!==(o=(a=N(n||A))[zt](";"))&&(a=N(n[Vt](0,o)),u=Ee(n[Vt](o+1))),U(u,"domain",r||s,En,I),E(e)||(o=Wn(),I(u[de])&&0<(n=D()+1e3*e)&&((r=new Date).setTime(n),U(u,de,Pe(r,o?fe:se)||Pe(r,o?fe:se)||A,En)),o||U(u,"max-age",A+e,null,I)),(n=typeof location===d&&location?location:j(On))&&"https:"===n.protocol&&(U(u,"secure",null,null,I),(_e=null===_e?!(xn(r=(zn()||{})[Kt])&&(M(r,"CPU iPhone OS 12")||M(r,"iPad; CPU OS 12")||M(r,"Macintosh; Intel Mac OS X 10_14")&&M(r,"Version/")&&M(r,"Safari")||M(r,"Macintosh; Intel Mac OS X 10_14")&&function(t,n){var e=!1;if(!t||(e=t===n))return e;if(sn)return t[on](n);var r=t,i=n,e=!1,t=i[_],n=r?r[_]:0;if(t&&n&&t<=n&&!(e=r===i)){for(var o=n-1,u=t-1;0<=u;u--){if(r[o]!=i[u])return;o--}e=!0}return e}(r,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||M(r,"Chrome/5")||M(r,"Chrome/6")||M(r,"UnrealEngine")&&!M(r,"Chrome")||M(r,"UCBrowser/12")||M(r,"UCBrowser/11"))):_e)&&U(u,"SameSite","None",null,I)),U(u,"path",i||f,null,I),(l.setCookie||Se)(t,Me(a,u)),c=!0),c},t.get=function(t){var n=A;return be(p)&&!Ae(l,t)?(l.getCookie||function(t){var n,e=A;return Ce&&(n=Ce[pe]||A,Te!==n&&(we=Ee(n),Te=n),e=N(we[t]||A)),e})(t):n},t.del=function(t,n){return!!be(p)&&p.purge(t,n)},t.purge=function(t,n){var e,r=!1;return Ie(i)&&((e={}).path=n||"/",e[de]="Thu, 01 Jan 1970 00:00:01 GMT",n=e,Wn()||(n["max-age"]="0"),(l.delCookie||Se)(t,Me(A,n)),r=!0),r},t);return p[he]=p}function Ie(t){if(null===ye){ye=!1;try{ye=(Ce||{})[pe]!==undefined}catch(n){Qn(t,2,68,"Cannot access document.cookie - "+((t=n)&&"[object Error]"===pn[b](t)?t[bt]:A),{exception:Bn(n)})}}return ye}function Ee(t){var e={};return t&&t[_]&&O(N(t)[Wt](";"),function(t){var n;(t=N(t||A))&&(-1===(n=t[zt]("="))?e[t]=null:e[N(t[Vt](0,n))]=N(t[Vt](n+1)))}),e}function Pe(t,n){return P(t[n])?t[n]():null}function Me(t,n){var e=t||A;return wn(n,function(t,n){e+="; "+t+(E(n)?A:"="+n)}),e}function Se(t,n){Ce&&(Ce[pe]=t+"="+n)}var Oe,Ne,De=Ne={id:Cn("_aiData-plugin.2.8.140"+((Oe=void 0!==Oe&&Oe)?".2.8.14":A)+n),accept:le,get:function(t,n,e,r){var i=t[Ne.id];return i?i[Cn(n)]:(r&&((i=function(t,n){var e=n[t.id];if(!e){e={};try{le(n)&&!function(t,n,e){if(ce)try{return ce(t,n,{value:e,enumerable:!1,configurable:!0}),1}catch(r){}}(n,t.id,e)&&(n[t.id]=e)}catch(r){}}return e}(Ne,t))[Cn(n)]=e),e)},kill:function(t,n){if(t&&t[n])try{delete t[n]}catch(e){}}};function Ue(t){return De.get(t,"state",{},!0)}var je="TelemetryPluginChain",Le="_hasRun",Re="_getTelCtx",ze=0;function Ve(t,u,e,n){var r=null,i=[],o=(null!==n&&(r=n?function(t,n,e){for(;t;){if(t[Mt]()===e)return t;t=t[w]()}return We([e],n[It]||{},n)}(t,e,n):t),{_next:function(){var t,n=r;return r=n?n[w]():null,n||(t=i)&&0<t[_]&&(O(t,function(t){try{t.func[b](t.self,t.args)}catch(n){Qn(e[Et],2,73,"Unexpected Exception during onComplete - "+Bn(n))}}),i=[]),n},ctx:{core:function(){return e},diagLog:function(){return(e||{})[Et]||new Hn(u)},getCfg:function(){return u},getExtCfg:a,getConfig:function(t,n,e){void 0===e&&(e=!1);var r,t=a(t,null);return t&&!E(t[n])?r=t[n]:u&&!E(u[n])&&(r=u[n]),E(r)?e:r},hasNext:function(){return!!r},getNext:function(){return r},setNext:function(t){r=t},iterate:function(t){for(;n=o._next();){var n=n[Mt]();n&&t(n)}},onComplete:function(t,n){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];t&&i[y]({func:t,self:I(n)?o.ctx:n,args:e})}}});function a(t,n,e){var r,i,o;return void 0===n&&(n={}),void 0===e&&(e=0),(r=u&&(i=u[Yt])&&t?i[t]:r)?Tn(n)&&0!==e&&(o=function p(){var t=arguments,n=t[0]||{},e=t[_],r=!1,i=1;for(0<e&&"boolean"==typeof n&&(r=n,n=t[i]||{},i++),Tn(n)||(n={});i<e;i++){var o,u,a,c,l=t[i],f=S(l),s=Tn(l);for(o in l)(f&&o in l||s&&$[b](l,o))&&(u=l[o],a=void 0,r&&u&&((a=S(u))||bn(u))&&(c=n[o],a?S(c)||(c=[]):bn(c)||(c={}),u=p(r,c,u)),u!==undefined&&(n[o]=u))}return n}(!0,n,r),u&&2===e&&wn(n,function(t){var n;E(o[t])&&!E(n=u[t])&&(o[t]=n)}),r=o):r=n,r}return o}function Ke(t,e,r,n){var i=Ve(t,e,r,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n[Zt](t,o),!n},o[Lt]=function(t,n){return Ke((t=S(t=void 0===t?null:t)?We(t,e,r,n):t)||o[w](),e,r,n)},o}function We(t,n,e,r){var i,o=null,u=!r;return S(t)&&0<t[_]&&(i=null,O(t,function(t){(u=!u&&r===t||u)&&t&&P(t[Zt])&&(t=Be(t,n,e),o=o||t,i&&i._setNext(t),i=t)})),r&&!o?We([r],n,e):o}function Be(c,r,i){var l=null,o=P(c[Zt]),u=P(c[jt]),f=c?c[At]+"-"+c[tn]+"-"+ze++:"Unknown-0-"+ze++,a={getPlugin:function(){return c},getNext:function(){return l},processTelemetry:function(e,t){var n;s(t=t||(n=(n=c&&P(c[Re])?c[Re]():n)||Ke(a,r,i)),function(t){if(!c||!o)return!1;var n=Ue(c);return!n[C]&&!n[Qt]&&(u&&c[jt](l),c[Zt](e,t),!0)},"processTelemetry",function(){return{item:e}},!e.sync)||t[T](e)},unload:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Ue(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||(t[k]=null,t[C]=!0,t[kt]=!1,c[C]&&!0===c[C](r,i)&&(e=!0))),e},"unload",function(){},i[Nt])||r[T](i)},update:function(r,i){s(r,function(){var t,n,e=!1;return c&&(t=Ue(c),n=c[k]||t[k],!c||n&&n!==r.core()||t[C]||c[Ut]&&!0===c[Ut](r,i)&&(e=!0)),e},"update",function(){},!1)||r[T](i)},_id:f,_setNext:function(t){l=t}};function s(e,r,i,t,n){var o=!1,u=c?c[At]:je,a=(a=e[Le])||(e[Le]={});return e.setNext(l),c&&ee(e[k](),function(){return u+":"+i},function(){a[f]=!0;try{var t=l?l._id:A;t&&(a[t]=!1),o=r(e)}catch(n){t=!l||a[l._id];t&&(o=!0),l&&t||Qn(e[x](),1,73,"Plugin ["+u+"] failed during "+i+" - "+Bn(n)+", run flags: "+Bn(a))}},t,n),o}return kn(a)}function Je(){var n=[];return{add:function(t){t&&n[y](t)},run:function(e,r){O(n,function(t){try{t(e,r)}catch(n){Qn(e[x](),2,73,"Unexpected error calling unload handler - "+Bn(n))}}),n=[]}}}var $e,L="getPlugin";function qe(){var i,o,f,s,p,u=this;function n(t){var n,t=t=void 0===t?null:t;return t||(n=o||Ke(null,{},u[k]),t=f&&f[L]?n[Lt](null,f[L]):n[Lt](null,f)),t}function c(t,n,e){t&&U(t,Yt,[],null,E),!e&&n&&(e=n.getProcessTelContext()[w]());var r=f;f&&f[L]&&(r=f[L]()),u[k]=n,o=Ke(e,t,n,r)}function d(){i=!1,u[k]=null,f=o=null,p=[],s=Je()}d(),xt(qe,u,function(l){l.initialize=function(t,n,e,r){c(t,n,r),i=!0},l[C]=function(t,n){var e,r,i,o,u=l[k];if(u&&(!t||u===t[k]()))return r=!1,i=t||function c(t,e,n){var r=e[It]||{},i=Ve(t,r,e,n),o=i.ctx;return o[T]=function(t){var n=i._next();return n&&n.unload(o,t),!n},o[Lt]=function(t,n){return c((t=S(t=void 0===t?null:t)?We(t,r,e,n):t)||o[w](),e,n)},o}(null,u,f&&f[L]?f[L]():f),o=n||((t={reason:0})[Nt]=!1,t),l[Dt]&&!0===l[Dt](i,o,a)?e=!0:a(),e;function a(){var t;r||(r=!0,s.run(i,n),t=p,p=[],O(t,function(t){t.rm()}),!0===e&&i[T](o),d())}},l[Ut]=function(t,n){var e,r,i,o=l[k];if(o&&(!t||o===t[k]()))return r=!1,i=t||function a(t,e,n){var r=e[It]||{},i=Ve(t,r,e,n).ctx;return i[T]=function(n){return i.iterate(function(t){P(t[Ut])&&t[Ut](i,n)})},i[Lt]=function(t,n){return a((t=S(t=void 0===t?null:t)?We(t,r,e,n):t)||i[w](),e,n)},i}(null,o,f&&f[L]?f[L]():f),l._doUpdate&&!0===l._doUpdate(i,n||{reason:0},u)?e=!0:u(),e;function u(){r||(r=!0,c(i.getCfg(),i.core(),i[w]()))}},l._addHook=function(t){t&&(S(t)?p=p.concat(t):p[y](t))},Pn(l,"_addUnloadCb",function(){return s},"add")}),u[x]=function(t){return n(t)[x]()},u[kt]=function(){return i},u.setInitialized=function(t){i=t},u[jt]=function(t){f=t},u[T]=function(t,n){n?n[T](t):f&&P(f[Zt])&&f[Zt](t,null)},u._getTelCtx=n}function Ge(){var a,c,l,f,s=$e.call(this)||this;return s.priority=185,s.identifier="ReactPlugin",xt(Ge,s,function(i,t){var n,e,r;function o(){f=l=c=a=null}function u(){return a||Qn(i.diagLog(),1,64,"Analytics plugin is not available, React plugin telemetry will not be sent: "),a}o(),i.initialize=function(t,n,e,r){$e.prototype.initialize.call(s,t,n,e,r),c=t.extensionConfig&&t.extensionConfig[i.identifier]?t.extensionConfig[i.identifier]:{history:null},O(e,function(t){"ApplicationInsightsAnalytics"===t.identifier&&(a=t)}),c.history&&(n=c.history,l=n.listen(function(t){var n="location"in t?t.location:t;f=setTimeout(function(){f=null;var t={uri:n.pathname};i.trackPageView(t)},500)}),r={uri:c.history.location.pathname},i.trackPageView(r))},i.getCookieMgr=function(){return(n=(e=i.core)?e.getCookieMgr():n)||(e=(e||{})[Et],(r=ke[he]||xe[he])||(r=ke[he]=ke(t,e),xe[he]=r),n=r),n;var t,n,e,r},i.getAppInsights=u,i.processTelemetry=function(t,n){i.processNext(t,n)},i._doTeardown=function(t,n,e){P(l)&&l(),f&&clearTimeout(f),o()},e=u,r=["trackMetric","trackPageView","trackEvent","trackException","trackTrace"],(n=i)&&e&&Tn(n)&&S(r)&&O(r,function(t){xn(t)&&Pn(n,t,e,t,void 0)}),An(i,"_extensionConfig",function(){return c})}),s}qe.__ieDyn=1,Q(Ge,$e=qe),Ge.__ieDyn=1;var Fe,ct=Ge,He=(Q(Xe,Fe=R.Component),Xe.prototype.componentDidMount=function(){var t=this;this._mountTimestamp=D(),this._firstActiveTimestamp=0,this._totalIdleTime=0,this._lastActiveTimestamp=0,this._idleStartTimestamp=0,this._idleCount=0,this._intervalId=setInterval(function(){0<t._lastActiveTimestamp&&0===t._idleStartTimestamp&&D()-t._lastActiveTimestamp>=t._idleTimeout&&(t._idleStartTimestamp=D(),t._idleCount++)},100)},Xe.prototype.componentWillUnmount=function(){if(0===this._mountTimestamp)throw Error("withAITracking:componentWillUnmount: mountTimestamp is not initialized.");var t,n;this._intervalId&&clearInterval(this._intervalId),0!==this._firstActiveTimestamp&&(t=this.getEngagementTimeSeconds(),n={"Component Name":this._componentName},this._reactPlugin.trackMetric({average:t,name:"React Component Engaged Time (seconds)",sampleCount:1},n))},Xe.prototype.getEngagementTimeSeconds=function(){return(D()-this._firstActiveTimestamp-this._totalIdleTime-this._idleCount*this._idleTimeout)/1e3},Xe);function Xe(t,n,e){var r=Fe.call(this,t)||this;return r._mountTimestamp=0,r._firstActiveTimestamp=0,r._idleStartTimestamp=0,r._lastActiveTimestamp=0,r._totalIdleTime=0,r._idleCount=0,r._idleTimeout=5e3,r.trackActivity=function(t){var n;0===r._firstActiveTimestamp?(r._firstActiveTimestamp=D(),r._lastActiveTimestamp=r._firstActiveTimestamp):r._lastActiveTimestamp=D(),0<r._idleStartTimestamp&&(n=r._lastActiveTimestamp-r._idleStartTimestamp,r._totalIdleTime+=n,r._idleStartTimestamp=0)},r._reactPlugin=n,r._componentName=e,r}Qe={},wn({Verbose:0,Information:1,Warning:2,Error:3,Critical:4},function(t,n){Qe[t]=n,Qe[n]=t}),u=Qe,ln&&wn(u,function(t,n){(S(n)||Tn(n))&&ln(n)});var Qe,Ye,Ze=kn(u);function tr(){var t=null!==Ye&&Ye.apply(this,arguments)||this;return t.state={hasError:!1},t}Q(tr,Ye=z["default"].Component),tr.prototype.componentDidCatch=function(t,n){this.setState({hasError:!0}),this.props.appInsights.trackException({error:t,exception:t,severityLevel:Ze.Error,properties:n})},tr.prototype.render=function(){var t;return this.state.hasError?(t=this.props.onError,z["default"].createElement(t)):this.props.children};var J=tr,nr=a.createContext(undefined);t.AITrackedComponentBase=He,t.AppInsightsContext=nr,t.AppInsightsErrorBoundary=J,t.ReactPlugin=ct,t.useAppInsightsContext=function(){return a.useContext(nr)},t.useTrackEvent=function(t,n,e,r){void 0===r&&(r=!0);var e=a.useState(e),i=e[0],e=e[1],o=a.useRef(r);return a.useEffect(function(){o.current?o.current=!1:t.trackEvent({name:n},i)},[t,i,n]),e},t.useTrackMetric=function(r,i,o){var u=a.useRef({hookTimestamp:D(),firstActiveTimestamp:0,totalIdleTime:0,lastActiveTimestamp:0,idleStartTimestamp:0,idleCount:0,idleTimeout:5e3}),t=a.useRef();return t.current=function(){var t=u.current;0<t.lastActiveTimestamp&&0===t.idleStartTimestamp&&D()-t.lastActiveTimestamp>=t.idleTimeout&&(t.idleStartTimestamp=D(),t.idleCount++)},a.useEffect(function(){var e=setInterval(t.current,100);return function(){clearInterval(e);var t,n=u.current;if(0===n.hookTimestamp)throw Error("useAppInsights:unload hook: hookTimestamp is not initialized.");0!==n.firstActiveTimestamp&&(n=n,n={average:(D()-n.firstActiveTimestamp-n.totalIdleTime-n.idleCount*n.idleTimeout)/1e3,name:"React Component Engaged Time (seconds)",sampleCount:1},t=H({"Component Name":i},o),r.trackMetric(n,t))}},[]),function(){var t,n=u.current;0===n.firstActiveTimestamp?(n.firstActiveTimestamp=D(),n.lastActiveTimestamp=n.firstActiveTimestamp):n.lastActiveTimestamp=D(),0<n.idleStartTimestamp&&(t=n.lastActiveTimestamp-n.idleStartTimestamp,n.totalIdleTime+=t,n.idleStartTimestamp=0)}},t.withAITracking=function(n,t,e,r){return e!==undefined&&null!==e&&"string"==typeof e||(e=t.prototype&&t.prototype.constructor&&t.prototype.constructor.name||"Unknown"),r!==undefined&&null!==r&&"string"==typeof r||(r=""),Q(i,o=He),i.prototype.render=function(){return R.createElement("div",{onKeyDown:this.trackActivity,onMouseMove:this.trackActivity,onScroll:this.trackActivity,onMouseDown:this.trackActivity,onTouchStart:this.trackActivity,onTouchMove:this.trackActivity,className:r},R.createElement(t,H({},this.props)))},i;function i(t){return o.call(this,t,n,e)||this}var o},Object.defineProperty(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}),t.React);
6
6
  //# sourceMappingURL=applicationinsights-react-js.min.js.map