@microsoft/applicationinsights-clickanalytics-js 2.7.2-nightly.2112-03 → 2.7.2
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/{ai.clck.2.7.2-nightly.2112-03.cjs.js → ai.clck.2.7.2.cjs.js} +3 -3
- package/browser/ai.clck.2.7.2.cjs.js.map +1 -0
- package/browser/ai.clck.2.7.2.cjs.min.js +6 -0
- package/browser/ai.clck.2.7.2.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.7.2-nightly.2112-03.gbl.js → ai.clck.2.7.2.gbl.js} +3 -3
- package/browser/ai.clck.2.7.2.gbl.js.map +1 -0
- package/browser/ai.clck.2.7.2.gbl.min.js +6 -0
- package/browser/ai.clck.2.7.2.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.7.2.integrity.json +66 -0
- package/browser/{ai.clck.2.7.2-nightly.2112-03.js → ai.clck.2.7.2.js} +3 -3
- package/browser/ai.clck.2.7.2.js.map +1 -0
- package/browser/ai.clck.2.7.2.min.js +6 -0
- package/browser/ai.clck.2.7.2.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +2 -2
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +2 -2
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +2 -2
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.api.json +1 -1
- package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/dist/applicationinsights-clickanalytics-js.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +2 -2
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +1 -1
- package/dist-esm/events/PageAction.js +1 -1
- package/dist-esm/events/WebEvent.js +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +1 -1
- package/dist-esm/handlers/DomContentHandler.js +1 -1
- package/package.json +56 -59
- package/src/ClickAnalyticsPlugin.ts +1 -1
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.cjs.js.map +0 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.cjs.min.js +0 -6
- package/browser/ai.clck.2.7.2-nightly.2112-03.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.gbl.js.map +0 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.gbl.min.js +0 -6
- package/browser/ai.clck.2.7.2-nightly.2112-03.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.integrity.json +0 -66
- package/browser/ai.clck.2.7.2-nightly.2112-03.js.map +0 -1
- package/browser/ai.clck.2.7.2-nightly.2112-03.min.js +0 -6
- package/browser/ai.clck.2.7.2-nightly.2112-03.min.js.map +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Click Analytics, 2.7.2-nightly.2112-03
|
|
3
|
-
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
var t=this,e=function(t){"use strict";var a="function",i="object",r="undefined",o="prototype",s="hasOwnProperty",n=Object,c=n[o],e=n.assign,l=n.create,u=n.defineProperty,f=c[s];function g(){return typeof globalThis!==r&&globalThis?globalThis:typeof self!==r&&self?self:typeof window!==r&&window?window:typeof global!==r&&global?global:null}function p(t){throw new TypeError(t)}(g()||{}).Symbol,(g()||{}).Reflect;var d=e||function(t){for(var e,n=1,a=arguments.length;n<a;n++)for(var i in e=arguments[n])c[s].call(e,i)&&(t[i]=e[i]);return t},h=function(t,e){return(h=n.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e[s](n)&&(t[n]=e[n])})(t,e)};function v(t,e){function n(){this.constructor=t}typeof e!==a&&null!==e&&p("Class extends value "+e+" is not a constructor or null"),h(t,e),t[o]=null===e?function(t){if(l)return l(t);if(null==t)return{};var e=typeof t;function n(){}return e!==i&&e!==a&&p("Object prototype may only be an Object:"+t),n[o]=t,new n}(e):(n[o]=e[o],new n)}var m,T="constructor",C="prototype",y="function",_="_dynInstFuncs",I="_isDynProxy",b="_dynClass",x="_dynInstChk",A=x,P="_dfOpts",N="_unknown_",D="__proto__",E="useBaseInst",k="setInstFuncs",w=Object,S=w.getPrototypeOf,M=0;function L(t,e){return t&&w[C].hasOwnProperty.call(t,e)}function O(t){return t&&(t===w[C]||t===Array[C])}function F(t){return O(t)||t===Function[C]}function B(t){if(t){if(S)return S(t);if(t=t[D]||t[C]||(t[T]?t[T][C]:null))return t}return null}function R(t,e){var n=[],a=w.getOwnPropertyNames;if(a)n=a(t);else for(var i in t)"string"==typeof i&&L(t,i)&&n.push(i);if(n&&0<n.length)for(var r=0;r<n.length;r++)e(n[r])}function U(t,e,n){return e!==T&&typeof t[e]===y&&(n||L(t,e))}function V(t){throw new TypeError("DynamicProto: "+t)}function j(t,e){for(var n=t.length-1;0<=n;n--)if(t[n]===e)return 1}function H(t,e){return L(t,C)?t.name||e||N:((t||{})[T]||{}).name||e||N}function K(t,a,e,n){L(t,C)||V("theClass is an invalid class definition.");var i=t[C];!function(t){if(S)for(var e=[],n=B(a);n&&!F(n)&&!j(e,n);){if(n===t)return 1;e.push(n),n=B(n)}}(i)&&V("["+H(t)+"] is not in class hierarchy of ["+H(a)+"]");var r=null;L(i,b)?r=i[b]:(r="_dynCls$"+H(t,"_")+"$"+M,M++,i[b]=r);var o=K[P],s=!!o[E];s&&n&&n[E]!==undefined&&(s=!!n[E]);var c,l,u,f,g,p,t=(l={},R(c=a,function(t){!l[t]&&U(c,t,!1)&&(l[t]=c[t])}),l);e(a,function(t,e,n,r){function a(t,e,n){var a,i=e[n];return i[I]&&r&&!1!==(a=t[_]||{})[A]&&(i=(a[e[b]]||{})[n]||i),function(){return i.apply(t,arguments)}}var i={};R(n,function(t){i[t]=a(e,n,t)});for(var o=B(t),s=[];o&&!F(o)&&!j(s,o);)R(o,function(t){!i[t]&&U(o,t,!S)&&(i[t]=a(e,o,t))}),s.push(o),o=B(o);return i}(i,a,t,s)),o=!!S&&!!o[k],u=i,r=r,f=a,g=t,n=!1!==(o=o&&n?!!n[k]:o),O(u)||(o=f[_]=f[_]||{},p=o[r]=o[r]||{},!1!==o[A]&&(o[A]=!!n),R(f,function(t){var n,a,i;U(f,t,!1)&&f[t]!==g[t]&&(p[t]=f[t],delete f[t],L(u,t)&&(!u[t]||u[t][I])||(u[t]=(n=u,a=t,(i=function(){var t,e;return(function(t,e,n,a){var i=null;if(t&&L(n,b)){var r=t[_]||{};if((i=(r[n[b]]||{})[e])||V("Missing ["+e+"] "+y),!i[x]&&!1!==r[A]){for(var o=!L(t,e),s=B(t),c=[];o&&s&&!F(s)&&!j(c,s);){var l=s[e];if(l){o=l===a;break}c.push(s),s=B(s)}try{o&&(t[e]=i),i[x]=1}catch(u){r[A]=!1}}}return i}(this,a,n,i)||(typeof(e=(e=n[t=a])===i?B(n)[t]:e)!==y&&V("["+t+"] is not a "+y),e)).apply(this,arguments)})[I]=1,i)))}))}K[P]={setInstFuncs:!0,useBaseInst:!0},(e=m=m||{})[e.CRITICAL=1]="CRITICAL",e[e.WARNING=2]="WARNING";var q={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105},z="attachEvent",W="addEventListener",G=u;function J(t){return c.toString.call(t)}function X(t){return t===undefined||typeof t===r}function Y(t){return null===t||X(t)}function $(t){return typeof t===a}function Q(t,e,n,a){void 0===a&&(a=!1);var i=!1;if(!Y(t))try{Y(t[W])?Y(t[z])||(t[z]("on"+e,n),i=!0):(t[W](e,n,a),i=!0)}catch(r){}return i}function Z(t,e,n){var a=t.length;try{for(var i=0;i<a&&!(i in t&&-1===e.call(n||t,t[i],i,t));i++);}catch(r){}}function tt(){var t=Date;return t.now?t.now():(new t).getTime()}var et="window",nt="JSON";function at(t){var e=g();return e&&e[t]?e[t]:t===et&&it()?window:null}function it(){return!(typeof window!==i||!window)}function rt(){return it()?window:at(et)}function ot(){return typeof document===i&&document?document:at("document")}function st(){return typeof location===i&&location?location:at("location")}function ct(){return typeof JSON===i&&JSON||null!==at(nt)}function lt(){return ct()?JSON||at(nt):null}function ut(t){var e=Object[o].toString.call(t),n="";return"[object Error]"===e?n="{ stack: '"+t.stack+"', message: '"+t.message+"', name: '"+t.name+"'":ct()&&(n=lt().stringify(t)),e+n}var ft=null;function gt(t){return t?'"'+t.replace(/\"/g,"")+'"':""}function pt(t,e){var n,a=typeof console!==r?console:at("console");a&&(n="log",$(a[n=a[t]?t:n])&&a[n](e))}var dt=(ht.dataType="MessageData",ht);function ht(t,e,n,a){void 0===n&&(n=!1),this.messageId=t,this.message=(n?"AI: ":"AI (Internal): ")+t,t="",ct()&&(t=lt().stringify(a)),t=(e?" message:"+gt(e):"")+(a?" props:"+gt(t):""),this.message+=t}var vt=function Gt(i){this.identifier="DiagnosticLogger",this.queue=[];var s=0,c={};K(Gt,this,function(r){function t(t,e){return Y(t=i[t])?e:t}function o(t,e){var n,a=(n=i,(a=(a=ft)||!0===n.disableDbgExt?a:ft||(n=at("Microsoft"),ft=n?n.ApplicationInsights:ft))?a.ChromeDbgExt:null);a&&a.diagLog&&a.diagLog(t,e)}Y(i)&&(i={}),r.consoleLoggingLevel=function(){return t("loggingLevelConsole",0)},r.telemetryLoggingLevel=function(){return t("loggingLevelTelemetry",1)},r.maxInternalMessageLimit=function(){return t("maxMessageLimit",25)},r.enableDebugExceptions=function(){return t("enableDebugExceptions",!1)},r.throwInternal=function(t,e,n,a,i){if(e=new dt(e,n,i=void 0!==i&&i,a),r.enableDebugExceptions())throw e;n=t===m.CRITICAL?"errorToConsole":"warnToConsole",X(e.message)?o("throw"+(t===m.CRITICAL?"Critical":"Warning"),e):(a=r.consoleLoggingLevel(),i?(i=+e.messageId,!c[i]&&t<=a&&(r[n](e.message),c[i]=!0)):t<=a&&r[n](e.message),r.logInternalMessage(t,e))},r.warnToConsole=function(t){pt("warn",t),o("warning",t)},r.errorToConsole=function(t){pt("error",t),o("error",t)},r.resetInternalMessageCount=function(){s=0,c={}},r.logInternalMessage=function(t,e){var n,a;s>=r.maxInternalMessageLimit()||(a=!0,n="AITR_"+e.messageId,c[n]?a=!1:c[n]=!0,a&&(t<=r.telemetryLoggingLevel()&&(r.queue.push(e),s++,o(t===m.CRITICAL?"error":"warn",e)),s===r.maxInternalMessageLimit()&&(e=new dt(q.MessageLimitPerPVExceeded,a="Internal events throttle limit per PageView reached for this app.",!1),r.queue.push(e),t===m.CRITICAL?r.errorToConsole(a):r.warnToConsole(a))))}})},mt=(Tt.ParentContextKey="parent",Tt.ChildrenContextKey="childEvts",Tt);function Tt(t,i,e){var a,r=this,o=!1;r.start=tt(),r.name=t,r.isAsync=e,r.isChildEvt=function(){return!1},$(i)&&(o=function(t){if(G)try{var e={enumerable:!0,configurable:!0,get:function(){return!a&&$(i)&&(a=i(),i=null),a}};return G(t,"payload",e),!0}catch(n){}return!1}(r)),r.getCtx=function(t){return t?(t===Tt.ParentContextKey||t===Tt.ChildrenContextKey?r:r.ctx||{})[t]:null},r.setCtx=function(t,e){t&&(t===Tt.ParentContextKey?(r[t]||(r.isChildEvt=function(){return!0}),r[t]=e):t===Tt.ChildrenContextKey?r[t]=e:(r.ctx=r.ctx||{})[t]=e)},r.complete=function(){var t=0,e=r.getCtx(Tt.ChildrenContextKey);if("[object Array]"===J(e))for(var n=0;n<e.length;n++){var a=e[n];a&&(t+=a.time)}r.time=tt()-r.start,r.exTime=r.time-t,r.complete=function(){},!o&&$(i)&&(r.payload=i())}}var Ct="CoreUtils.doPerf";function yt(t,e,n,a,i){if(t){var r=t;if(r=$(r.getPerfMgr)?r.getPerfMgr():r){var o,s=void 0,t=r.getCtx(Ct);try{if(s=r.create(e(),a,i))return t&&s.setCtx&&(s.setCtx(mt.ParentContextKey,t),t.getCtx&&t.setCtx&&((o=t.getCtx(mt.ChildrenContextKey))||(o=[],t.setCtx(mt.ChildrenContextKey,o)),o.push(s))),r.setCtx(Ct,s),n(s)}catch(c){s&&s.setCtx&&s.setCtx("exception",c)}finally{s&&r.fire(s),r.setCtx(Ct,t)}}}return n()}var _t=function(i,e){var r=this,o=null,s=$(i.processTelemetry),c=$(i.setNextPlugin);r._hasRun=!1,r.getPlugin=function(){return i},r.getNext=function(){return o},r.setNext=function(t){o=t},r.processTelemetry=function(n,a){a=a||e;var t=i?i.identifier:"TelemetryPluginChain";yt(a?a.core():null,function(){return t+":processTelemetry"},function(){if(i&&s){r._hasRun=!0;try{a.setNext(o),c&&i.setNextPlugin(o),o&&(o._hasRun=!1),i.processTelemetry(n,a)}catch(e){var t=o&&o._hasRun;o&&t||a.diagLog().throwInternal(m.CRITICAL,q.PluginException,"Plugin ["+i.identifier+"] failed during processTelemetry - "+ut(e)),o&&!t&&o.processTelemetry(n,a)}}else o&&(r._hasRun=!0,o.processTelemetry(n,a))},function(){return{item:n}},!n.sync)}};function It(t,e){var n=[];if(t&&0<t.length)for(var a=null,i=0;i<t.length;i++){var r=t[i];r&&$(r.processTelemetry)&&(r=new _t(r,e),n.push(r),a&&a.setNext(r),a=r)}return 0<n.length?n[0]:null}var bt=function Jt(t,i,n,e){var a,r,o,s,c=this,l=null;null!==e&&(t&&$(t.getPlugin)?l=function(t,e,n){var a=[],i=!n;if(t)for(;t;){var r=t.getPlugin();!i&&r!==n||(i=!0,a.push(r)),t=t.getNext()}return i||a.push(n),It(a,e)}(t,c,e||t.getPlugin()):e?(a=c,o=t,s=!1,(r=e)&&t&&(o=[],Z(t,function(t){!s&&t!==r||(s=!0,o.push(t))})),r&&!s&&(o=o||[]).push(r),l=It(o,a)):X(e)&&(l=It(t,c))),c.core=function(){return n},c.diagLog=function(){return(n||{}).logger||new vt(i)},c.getCfg=function(){return i},c.getExtCfg=function(t,e){var n,a;return void 0===e&&(e={}),!i||(a=i.extensionConfig)&&t&&(n=a[t]),n||e},c.getConfig=function(t,e,n){var a;return void 0===n&&(n=!1),(t=c.getExtCfg(t,null))&&!Y(t[e])?a=t[e]:i&&!Y(i[e])&&(a=i[e]),Y(a)?n:a},c.hasNext=function(){return null!=l},c.getNext=function(){return l},c.setNext=function(t){l=t},c.processNext=function(t){var e=l;e&&(l=e.getNext(),e.processTelemetry(t,c))},c.createNew=function(t,e){return new Jt((t=void 0===t?null:t)||l,i,n,e)}},xt="getPlugin",u=(At.prototype.initialize=function(t,e,n,a){this._baseTelInit(t,e,n,a)},At);function At(){var s=this,c=!1,l=null,u=null;s.core=null,s.diagLog=function(t){return s._getTelCtx(t).diagLog()},s.isInitialized=function(){return c},s.setInitialized=function(t){c=t},s.setNextPlugin=function(t){u=t},s.processNext=function(t,e){e?e.processNext(t):u&&$(u.processTelemetry)&&u.processTelemetry(t,null)},s._getTelCtx=function(t){var e=t=void 0===t?null:t;return e||(t=l||new bt(null,{},s.core),e=u&&u[xt]?t.createNew(null,u[xt]):t.createNew(null,u)),e},s._baseTelInit=function(t,e,n,a){var i,r;t&&(i="extensionConfig",o=r=[],!t||(o=t[i])!==r&&Y(o)&&(t[i]=o=r)),!a&&e&&(a=e.getProcessTelContext().getNext());var o=u;u&&u[xt]&&(o=u[xt]()),s.core=e,l=new bt(a,t,e,o),c=!0}}var Pt="not_specified",Nt=d(d({},q),{CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103});function Dt(t){for(var e in t)Et(t[e])&&("{}"!==JSON.stringify(t[e])||"callback"===e)||delete t[e]}function Et(t){return!(Y(t)||""===t)}function kt(t,e){return Et(t.getAttribute(e))}function wt(t,e,n){var a=t;if(a){for(;!e(a,n);)if(!(a=a.parentNode)||!a.getAttribute)return null;return a}}function St(t){return"A"===t.nodeName}function Mt(){var i={},r=!1,t=0,e=arguments.length,o=Object.prototype,n=arguments;for("[object Boolean]"===o.toString.call(n[0])&&(r=n[0],t++);t<e;t++)!function(t){for(var e in t)a=e,(n=t)&&f.call(n,a)&&(r&&"[object Object]"===o.toString.call(t[e])?i[e]=Mt(!0,i[e],t[e]):i[e]=t[e]);var n,a}(n[t]);return i}function Lt(t){var e,n,a={autoCapture:!0,callback:{pageActionPageTags:null},pageTags:{},coreData:{referrerUri:document.referrer,requestUri:"",pageName:"",pageType:""},dataTags:{useDefaultContentNameOrId:!1,aiBlobAttributeTag:"ai-blob",customDataPrefix:"data-",captureAllMetaDataContent:!1,dntDataTag:"ai-dnt"},behaviorValidator:function(t){return t||""},defaultRightClickBhvr:"",dropInvalidEvents:!1},i=[];for(e in a)"object"==typeof a[e]&&i.push(e);if(t)return function(t,e){for(var n in Dt(t),e)e.hasOwnProperty(n)&&("object"==typeof t[n=e[n]]?Dt(t[n]):delete t[n])}(t,i),Et(t.dataTags)&&(t.dataTags.customDataPrefix=Et((n=t).dataTags.customDataPrefix)&&!n.dataTags.customDataPrefix.indexOf("data-")?t.dataTags.customDataPrefix:"data-"),Mt(!0,a,t)}var Ot={BUTTON:!0,CHECKBOX:!0,RADIO:!0,RESET:!0,SUBMIT:!0};function Ft(t,e,n,a,i,r){this._clickAnalyticsPlugin=t,this._config=e,this._contentHandler=n,this._pageTagsCallback=a,this._metaTags=i,this._traceLogger=r,this._pageTags={}}Ft.prototype.setBasicProperties=function(t,e){var n;Et(t.name)||(t.pageName=(n=this._config,e&&e.pageName?e.pageName:n.callback&&$(n.callback.pageName)?n.callback.pageName():n.coreData&&n.coreData.pageName?n.coreData.pageName:(n=ot())&&n.title||"")),!Et(t.uri)&&it&&(t.uri=(n=this._config,t=st(),n.coreData&&n.coreData.requestUri&&""!==n.coreData.requestUri?n.coreData.requestUri:t?t.protocol+"//"+(t.hostname||t.host)+(Et(t.port)?":"+t.port:"")+t.pathname:null))},Ft.prototype.setCommonProperties=function(t,e){this.setBasicProperties(t,e),this._setPageTags(t,e),this._pageTypeMetaTag=this._getMetaData(this._metaTags,this._config.coreData,"pageType"),this._behaviorMetaTag=this._getMetaData(this._metaTags,this._config.coreData,"behavior"),Et(e.pageType)&&(t.pageType=e.pageType),Et(this._pageTypeMetaTag)&&!Et(t.pageType)&&(t.pageType=this._pageTypeMetaTag)},Ft.prototype._setPageTags=function(t,e){if(this._pageTagsCallback&&(this._pageTags=Mt(!0,this._pageTags,this._pageTagsCallback())),Et(e.pageTags)&&(this._pageTags=Mt(!0,this._pageTags,e.pageTags)),this._metaTags)for(var n in this._pageTags.metaTags={},this._metaTags)"behavior"!=n&&"market"!=n&&"pageType"!=n&&(this._pageTags.metaTags[n]=this._metaTags[n]);t.properties=t.properties||{},t.properties.pageTags=this._pageTags},Ft.prototype._getBehavior=function(t){var e;return t&&Et(t.behavior)?e=t.behavior:Et(this._behaviorMetaTag)&&(e=this._behaviorMetaTag),this._getValidBehavior(e)},Ft.prototype._getValidBehavior=function(t){return this._config.behaviorValidator(t)},Ft.prototype._getMetaData=function(t,e,n){return e&&e[n]?e[n]:t?t[n]:""};var Bt,Rt=(v(Ut,Bt=d=Ft),Ut.prototype.trackPageAction=function(t,e){var a=this,i={name:"Microsoft.ApplicationInsights.{0}.Event",baseType:"EventData",ext:{web:{}},data:{},baseData:{}};this._populateEventDataIfPresent(i.baseData,"name",t.name),this._populateEventDataIfPresent(i.data,"baseTypeSource","ClickEvent"),this._populateEventDataIfPresent(i.data,"uri",t.uri),this._populateEventDataIfPresent(i.data,"pageType",t.pageType),this._populateEventDataIfPresent(i.data,"properties",t.properties),this._populateEventDataIfPresent(i.data,"actionType",t.actionType),this._populateEventDataIfPresent(i.data,"behavior",t.behavior),this._populateEventDataIfPresent(i.data,"clickCoordinates",t.clickCoordinates),this._populateEventDataIfPresent(i.data,"content",t.content),this._populateEventDataIfPresent(i.data,"targetUri",t.targetUri),this._populateEventDataIfPresent(i.data,"timeToAction",t.timeToAction),this._populateEventDataIfPresent(i.data,"refUri",t.refUri),this._populateEventDataIfPresent(i.data,"pageName",t.pageName),this._populateEventDataIfPresent(i.data,"parentId",t.parentId),e&&function(t){if(t)for(var e in t)f.call(t,e)&&(n=e,e=t[e],i.data[n]||a._populateEventDataIfPresent(i.data,n,e));var n}(e),this._clickAnalyticsPlugin.core.track(i)},Ut.prototype.capturePageAction=function(t,e,n,a){e=Et(e)?e:{};var i={name:""},r=Et(n)?n:{};this.setCommonProperties(i,e),i.behavior=this._getBehavior(e);var o,n={};a&&(i.behavior=this._config.defaultRightClickBhvr),t&&(i.targetUri=function(t){var e="";switch(t.tagName){case"A":case"AREA":e=t.href||"";break;case"IMG":e=function(t){if(t&&1===(t=wt(t,St)).length){if((t=t[0]).href)return t.href;if(t.src)return t.src}return""}(t);break;case"INPUT":var n=t.type;n&&Ot[n.toUpperCase()]&&(n=st()||{},e=t.form?t.form.action||n.pathname||"":n.pathname||"")}return e}(t),(n=this._contentHandler.getElementContent(t)).bhvr&&!Et(e.behavior)&&(a="bhvr",(t=n)&&t[a]&&(o=t[a],delete t[a]),i.behavior=this._getValidBehavior(o)),Et(n.id)||Et(n.contentName)||this._traceLogger.throwInternal(m.WARNING,Nt.InvalidContentBlob,"Missing attributes id or contentName in click event. Click event information will still be collected!")),i.name=n.id||n.contentName||Pt,i.parentId=n.parentid||n.parentName||Pt,Et(e.actionType)&&(i.actionType=e.actionType),Et(e.clickCoordinateX)&&Et(e.clickCoordinateY)&&(i.clickCoordinates=e.clickCoordinateX+"X"+e.clickCoordinateY),this._sanitizePageActionEventContent(n),i.content="["+JSON.stringify(Mt(n,e&&e.contentTags?e.contentTags:{}))+"]",i.timeToAction=this._getTimeToClick(),i.refUri=Et(e.refUri)?e.refUri:this._config.coreData.referrerUri,this._isUndefinedEvent(i)||this.trackPageAction(i,r)},Ut.prototype._getTimeToClick=function(){var t=at("performance");return t&&t.timing&&(t=t.timing.navigationStart)&&0!==t?(new Date).getTime()-t:-1},Ut.prototype._populateEventDataIfPresent=function(t,e,n){Et(n)&&(t[e]=n)},Ut.prototype._sanitizePageActionEventContent=function(t){t&&(delete t.id,delete t.parentid,delete t.parentname,this._config&&this._config.dataTags&&Et(this._config.dataTags.parentDataTag)&&delete t[this._config.dataTags.parentDataTag])},Ut.prototype._isUndefinedEvent=function(t){return!(!this._config.dropInvalidEvents||t.name!==Pt||t.parentId!==Pt||"[{}]"!==t.content)},Ut);function Ut(){return null!==Bt&&Bt.apply(this,arguments)||this}var Vt={BUTTON:!0,CHECKBOX:!0,RADIO:!0,RESET:!0,SUBMIT:!0},jt=(Ht.prototype.click=function(){var e=this,t=rt(),n=ot();t?(Q(t,~navigator.appVersion.indexOf("MSIE")?"click":"mousedown",function(t){e._processClick(t)}),Q(t,"keyup",function(t){e._processClick(t)})):n&&(Q(n,"click",function(t){e._processClick(t)}),Q(n,"keyup",function(t){e._processClick(t)}))},Ht.prototype.capturePageAction=function(t,e,n,a){Et(wt(t,kt,this._config.dataTags.customDataPrefix+this._config.dataTags.dntDataTag))||this._pageAction.capturePageAction(t,e,n,a)},Ht.prototype._processClick=function(t){var e={A:!0,BUTTON:!0,AREA:!0,INPUT:!0},n=rt();if(t=Y(t)&&n?n.event:t){var a=t.srcElement||t.target,i={clickCoordinateX:t.pageX,clickCoordinateY:t.pageY},r=function(t){try{if("which"in t)return 3===t.which;if("button"in t)return 2===t.button}catch(e){}}(t);if(r)i.actionType="CR";else if(function(t){try{if("which"in t)return 1===t.which;if("button"in t)return 1===t.button}catch(e){}}(t))i.actionType="CL";else if(function(t){try{if("keyCode"in t)return 13===t.keyCode}catch(e){}}(t))i.actionType="KE";else if(function(t){try{if("keyCode"in t)return 32===t.keyCode}catch(e){}}(t))i.actionType="KS";else{if(!function(t){try{if("which"in t)return 2===t.which;if("button"in t)return 4===t.button}catch(e){}}(t))return;i.actionType="CM"}for(;a&&a.tagName;){var o=(a=a.control&&e[a.control.tagName.toUpperCase()]?a.control:a).tagName.toUpperCase();if(e[o]){"INPUT"==o&&!Vt[a.type.toUpperCase()]||this.capturePageAction(a,i,{},r);break}a=a.parentElement||a.parentNode}}},Ht);function Ht(t,e,n,a){this._analyticsPlugin=t,this._config=e,this._pageAction=n,this._traceLogger=a}var Kt=(qt.prototype.getMetadata=function(){return Et(this._config.dataTags.metaDataPrefix)?this._getMetaDataFromDOM(this._config.dataTags.captureAllMetaDataContent,this._config.dataTags.metaDataPrefix,!1):this._getMetaDataFromDOM(this._config.dataTags.captureAllMetaDataContent,"",!1)},qt.prototype.getElementContent=function(t){if(!t)return{};var e,n,a={},i=this._config.dataTags.customDataPrefix,r=i+this._config.dataTags.aiBlobAttributeTag;if(Et(this._config.dataTags.parentDataTag)&&(n=i+this._config.dataTags.parentDataTag),this._isTracked(t,i,r))a=Mt(a,this._populateElementContentwithDataTag(t,i,n,r));else if(e=t.getAttribute(r))try{a=JSON.parse(e)}catch(o){this._traceLogger.throwInternal(m.CRITICAL,Nt.CannotParseAiBlobValue,"Can not parse "+e)}else a=Mt(a,this._populateElementContent(t,i,n,r));return Dt(a),n?Mt(a,this._getParentDetails(t,a,i,r)):a},qt.prototype._captureElementContentWithDataTag=function(t,e,n){for(var a,i=0;i<t.attributes.length;i++)(a=t.attributes[i]).name.indexOf(n)||(e[a.name.replace(n,"")]=a.value)},qt.prototype._walkUpDomChainCaptureData=function(t,e,n,a,i){for(var r=t,o=!1,s=!1;!Y(r)&&!Y(r.attributes);){for(var c=r.attributes,l=0;l<c.length;l++){var u,f=c[l];f.name.indexOf(n)||(f.name.indexOf(a)||(o=!0),f.name.indexOf(i)&&(u=f.name.replace(n,""),s&&"id"===u||Et(e[u])||(e[u]=f.value)))}if(o)break;s=!0,r=r.parentNode}},qt.prototype._populateElementContent=function(t,e,n,a){var i={};if(!t)return i;var r=this._getHtmlIdAndContentName(t),i={id:r.id||"",contentName:r.contentName||""};return Et(n)&&this._walkUpDomChainCaptureData(t,i,e,n,a),i.id||i.contentName||this._traceLogger.throwInternal(m.WARNING,Nt.InvalidContentBlob,"Invalid content blob. Missing required attributes (id, contentName. Content information will still be collected!"),i},qt.prototype._populateElementContentwithDataTag=function(t,e,n,a){var i={};if(!t)return i;var r=this._getHtmlIdAndContentName(t);return Et(n)?this._walkUpDomChainCaptureData(t,i,e,n,a):this._captureElementContentWithDataTag(t,i,e),this._config.dataTags.useDefaultContentNameOrId&&(Et(i.id)||(i.id=r.id||""),i.contentName=r.contentName||""),i.id||i.contentName||this._traceLogger.throwInternal(m.WARNING,Nt.InvalidContentBlob,"Invalid content blob. Missing required attributes (id, contentName. Content information will still be collected!"),i},qt.prototype._getMetaDataFromDOM=function(t,e,n){for(var a={},i=document.querySelectorAll("meta"),r=0;r<i.length;r++){var o=i[r];o.name&&(!t&&o.name.indexOf(e)||(a[n?o.name.replace(e,""):o.name]=o.content))}return a},qt.prototype._getDefaultContentName=function(t,e){if(!1===e||!t.tagName)return"";var n,a=ot()||{};switch(t.tagName){case"A":n=a.all?t.innerText||t.innerHTML:t.text||t.innerHTML;break;case"IMG":case"AREA":n=t.alt;break;default:n=t.value||t.name||t.alt||t.innerText||t.id}return n.substring(0,200)},qt.prototype._isTracked=function(t,e,n){for(var a=t.attributes,i=!1,r=0;r<a.length;r++){var o=a[r].name;if(o===n)return!1;o.indexOf(e)||(i=!0)}return i},qt.prototype._getHtmlIdAndContentName=function(t){var e,n,a={};return t&&this._config.dataTags.useDefaultContentNameOrId&&(e=this._config.callback.contentName?this._config.callback.contentName(t,this._config.dataTags.useDefaultContentNameOrId):"",n=this._getDefaultContentName(t,this._config.dataTags.useDefaultContentNameOrId),a={id:t.id,contentName:e||n||t.getAttribute("alt")}),a},qt.prototype._getParentDetails=function(t,e,n,a){var i=e.parentid,e=e.parentname;return i||e||!t?{}:this._populateParentInfo(t,n,a)},qt.prototype._populateParentInfo=function(t,e,n){var a,i={},r=wt(t.parentElement,this._isTracked,e);if(r)if(n=r.getAttribute(n)||t[n]){try{var o=JSON.parse(n)}catch(s){this._traceLogger.throwInternal(m.CRITICAL,Nt.CannotParseAiBlobValue,"Can not parse "+n)}o&&(a=o.id)}else a=r.getAttribute(e+"id");return a?i.parentid=a:(t=this._getHtmlIdAndContentName(t.parentElement),i.parentid=t.id,i.parentname=t.contentName),i},qt);function qt(t,e){this._config=t,this._traceLogger=e}var zt,u=(v(Wt,zt=u),Wt.prototype.initialize=function(t,e,n,a){if(Y(e))throw Error("Error initializing");t.extensionConfig=t.extensionConfig||[],t.extensionConfig[this.identifier]=t.extensionConfig[this.identifier]||{},this._config=Lt(t.extensionConfig[this.identifier]),zt.prototype.initialize.call(this,t,e,n,a),this._contentHandler=this._contentHandler||new Kt(this._config,this.diagLog());var i,a=this._contentHandler.getMetadata();this.pageAction=new Rt(this,this._config,this._contentHandler,this._config.callback.pageActionPageTags,a,this.diagLog()),this._autoCaptureHandler=this._autoCaptureHandler||new jt(this,this._config,this.pageAction,this.diagLog()),this._config.autoCapture&&this._autoCaptureHandler.click(),Z(n,function(t){"AppInsightsPropertiesPlugin"===t.identifier&&(i=t)}),i&&i.context&&i.context.internal&&i.context.internal.sdkVersion&&(i.context.internal.sdkVersion+="_ClickPlugin"+Wt.Version)},Wt.prototype.processTelemetry=function(t,e){this.processNext(t,e)},Wt.prototype.trackPageAction=function(t,e){try{this.pageAction.trackPageAction(t,e)}catch(n){this.diagLog().throwInternal(m.CRITICAL,Nt.TrackPageActionEventFailed,"trackPageAction failed, page action event will not be collected: "+("[object Error]"===J(e=n)?e.name:""),{exception:ut(n)})}},Wt.Version="2.7.2-nightly.2112-03",Wt);function Wt(){var t=null!==zt&&zt.apply(this,arguments)||this;return t.identifier="ClickAnalyticsPlugin",t.priority=181,t}t.BehaviorEnumValidator=function(e){return function(t){return e[t]||""}},t.BehaviorMapValidator=function(e){return function(t){return e[t]||""}},t.BehaviorValueValidator=function(t){return function(e){var n;return Z(t,function(t){if(t===e)return n=t,-1}),n||""}},t.ClickAnalyticsPlugin=u,function(t,e,n){var a=Object.defineProperty;if(a)try{return a(t,e,n)}catch(i){}typeof n.value!==undefined&&(t[e]=n.value)}(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{}));
|
|
6
|
-
//# sourceMappingURL=ai.clck.2.7.2-nightly.2112-03.min.js.map
|