@adobe/alloy 2.20.0-beta.2 → 2.20.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (701) hide show
  1. package/libEs5/baseCode/index.js +61 -0
  2. package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +53 -0
  3. package/libEs5/components/ActivityCollector/configValidators.js +22 -0
  4. package/libEs5/components/ActivityCollector/createGetLinkDetails.js +68 -0
  5. package/libEs5/components/ActivityCollector/createLinkClick.js +38 -0
  6. package/libEs5/components/ActivityCollector/getLinkName.js +139 -0
  7. package/libEs5/components/ActivityCollector/getLinkRegion.js +61 -0
  8. package/libEs5/components/ActivityCollector/index.js +78 -0
  9. package/libEs5/components/ActivityCollector/utils.js +104 -0
  10. package/libEs5/components/Audiences/index.js +49 -0
  11. package/libEs5/components/Audiences/injectProcessDestinations.js +67 -0
  12. package/libEs5/components/Audiences/injectProcessResponse.js +38 -0
  13. package/libEs5/components/Context/createComponent.js +39 -0
  14. package/libEs5/components/Context/implementationDetails.js +27 -0
  15. package/libEs5/components/Context/index.js +59 -0
  16. package/libEs5/components/Context/injectDevice.js +66 -0
  17. package/libEs5/components/Context/injectEnvironment.js +40 -0
  18. package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +58 -0
  19. package/libEs5/components/Context/injectPlaceContext.js +32 -0
  20. package/libEs5/components/Context/injectTimestamp.js +23 -0
  21. package/libEs5/components/Context/injectWeb.js +30 -0
  22. package/libEs5/components/DataCollector/index.js +110 -0
  23. package/libEs5/components/DataCollector/validateApplyResponse.js +35 -0
  24. package/libEs5/components/DataCollector/validateUserEventOptions.js +50 -0
  25. package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +31 -0
  26. package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
  27. package/libEs5/components/DecisioningEngine/constants.js +28 -0
  28. package/libEs5/components/DecisioningEngine/createApplyResponse.js +35 -0
  29. package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +30 -0
  30. package/libEs5/components/DecisioningEngine/createContextProvider.js +95 -0
  31. package/libEs5/components/DecisioningEngine/createDecisionHistory.js +27 -0
  32. package/libEs5/components/DecisioningEngine/createDecisionProvider.js +50 -0
  33. package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +82 -0
  34. package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +48 -0
  35. package/libEs5/components/DecisioningEngine/createEventRegistry.js +130 -0
  36. package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +48 -0
  37. package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +89 -0
  38. package/libEs5/components/DecisioningEngine/index.js +119 -0
  39. package/libEs5/components/DecisioningEngine/utils.js +82 -0
  40. package/libEs5/components/EventMerge/createComponent.js +24 -0
  41. package/libEs5/components/EventMerge/createEventMergeId.js +20 -0
  42. package/libEs5/components/EventMerge/index.js +24 -0
  43. package/libEs5/components/Identity/addEcidQueryToPayload.js +22 -0
  44. package/libEs5/components/Identity/addEcidToPayload.js +20 -0
  45. package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +25 -0
  46. package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +45 -0
  47. package/libEs5/components/Identity/configValidators.js +21 -0
  48. package/libEs5/components/Identity/constants/authState.js +18 -0
  49. package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +15 -0
  50. package/libEs5/components/Identity/createComponent.js +97 -0
  51. package/libEs5/components/Identity/createLegacyIdentity.js +72 -0
  52. package/libEs5/components/Identity/getEcidFromResponse.js +23 -0
  53. package/libEs5/components/Identity/getIdentity/createGetIdentity.js +35 -0
  54. package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +29 -0
  55. package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +29 -0
  56. package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +27 -0
  57. package/libEs5/components/Identity/index.js +129 -0
  58. package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +31 -0
  59. package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +68 -0
  60. package/libEs5/components/Identity/injectAwaitIdentityCookie.js +52 -0
  61. package/libEs5/components/Identity/injectEnsureSingleIdentity.js +100 -0
  62. package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +20 -0
  63. package/libEs5/components/Identity/injectProcessIdSyncs.js +41 -0
  64. package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +33 -0
  65. package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +34 -0
  66. package/libEs5/components/Identity/visitorService/getVisitor.js +19 -0
  67. package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +49 -0
  68. package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +144 -0
  69. package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +49 -0
  70. package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +245 -0
  71. package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
  72. package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +181 -0
  73. package/libEs5/components/LegacyMediaAnalytics/index.js +71 -0
  74. package/libEs5/components/LibraryInfo/index.js +68 -0
  75. package/libEs5/components/MachineLearning/index.js +26 -0
  76. package/libEs5/components/MachineLearning/processResponse.js +19 -0
  77. package/libEs5/components/Personalization/constants/loggerMessage.js +16 -0
  78. package/libEs5/components/Personalization/constants/scopeType.js +18 -0
  79. package/libEs5/components/Personalization/constants/surface.js +19 -0
  80. package/libEs5/components/Personalization/createActionsProvider.js +71 -0
  81. package/libEs5/components/Personalization/createApplyPropositions.js +115 -0
  82. package/libEs5/components/Personalization/createClickStorage.js +64 -0
  83. package/libEs5/components/Personalization/createCollect.js +53 -0
  84. package/libEs5/components/Personalization/createComponent.js +145 -0
  85. package/libEs5/components/Personalization/createFetchDataHandler.js +92 -0
  86. package/libEs5/components/Personalization/createGetPageLocation.js +20 -0
  87. package/libEs5/components/Personalization/createHandleConsentFlicker.js +29 -0
  88. package/libEs5/components/Personalization/createNotificationHandler.js +38 -0
  89. package/libEs5/components/Personalization/createOnClickHandler.js +51 -0
  90. package/libEs5/components/Personalization/createOnDecisionHandler.js +43 -0
  91. package/libEs5/components/Personalization/createPersonalizationDetails.js +104 -0
  92. package/libEs5/components/Personalization/createPreprocessors.js +23 -0
  93. package/libEs5/components/Personalization/createSetTargetMigration.js +28 -0
  94. package/libEs5/components/Personalization/createViewCacheManager.js +90 -0
  95. package/libEs5/components/Personalization/createViewChangeHandler.js +45 -0
  96. package/libEs5/components/Personalization/dom-actions/action.js +120 -0
  97. package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +41 -0
  98. package/libEs5/components/Personalization/dom-actions/appendHtml.js +32 -0
  99. package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +108 -0
  100. package/libEs5/components/Personalization/dom-actions/createPreprocess.js +25 -0
  101. package/libEs5/components/Personalization/dom-actions/createRedirect.js +27 -0
  102. package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +21 -0
  103. package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +17 -0
  104. package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
  105. package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +22 -0
  106. package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +24 -0
  107. package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +17 -0
  108. package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +17 -0
  109. package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +35 -0
  110. package/libEs5/components/Personalization/dom-actions/dom/getParent.js +17 -0
  111. package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +24 -0
  112. package/libEs5/components/Personalization/dom-actions/dom/index.js +100 -0
  113. package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +25 -0
  114. package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +24 -0
  115. package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
  116. package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +17 -0
  117. package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +104 -0
  118. package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +17 -0
  119. package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +23 -0
  120. package/libEs5/components/Personalization/dom-actions/images.js +36 -0
  121. package/libEs5/components/Personalization/dom-actions/index.js +9 -0
  122. package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +35 -0
  123. package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +31 -0
  124. package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +31 -0
  125. package/libEs5/components/Personalization/dom-actions/prependHtml.js +45 -0
  126. package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +32 -0
  127. package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +36 -0
  128. package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +54 -0
  129. package/libEs5/components/Personalization/dom-actions/replaceHtml.js +20 -0
  130. package/libEs5/components/Personalization/dom-actions/scripts.js +90 -0
  131. package/libEs5/components/Personalization/dom-actions/setAttributes.js +20 -0
  132. package/libEs5/components/Personalization/dom-actions/setHtml.js +27 -0
  133. package/libEs5/components/Personalization/dom-actions/setStyles.js +25 -0
  134. package/libEs5/components/Personalization/dom-actions/setText.js +17 -0
  135. package/libEs5/components/Personalization/dom-actions/swapImage.js +31 -0
  136. package/libEs5/components/Personalization/event.js +49 -0
  137. package/libEs5/components/Personalization/flicker/index.js +86 -0
  138. package/libEs5/components/Personalization/handlers/createProcessDomAction.js +71 -0
  139. package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +43 -0
  140. package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +78 -0
  141. package/libEs5/components/Personalization/handlers/createProcessPropositions.js +194 -0
  142. package/libEs5/components/Personalization/handlers/createProcessRedirect.js +44 -0
  143. package/libEs5/components/Personalization/handlers/injectCreateProposition.js +118 -0
  144. package/libEs5/components/Personalization/handlers/processDefaultContent.js +20 -0
  145. package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +286 -0
  146. package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +22 -0
  147. package/libEs5/components/Personalization/in-app-message-actions/utils.js +51 -0
  148. package/libEs5/components/Personalization/index.js +162 -0
  149. package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +24 -0
  150. package/libEs5/components/Personalization/utils/createAsyncArray.js +38 -0
  151. package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +18 -0
  152. package/libEs5/components/Personalization/utils/surfaceUtils.js +101 -0
  153. package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +34 -0
  154. package/libEs5/components/Privacy/computeConsentHash.js +33 -0
  155. package/libEs5/components/Privacy/createComponent.js +88 -0
  156. package/libEs5/components/Privacy/createConsentHashStore.js +59 -0
  157. package/libEs5/components/Privacy/createConsentRequest.js +29 -0
  158. package/libEs5/components/Privacy/createConsentRequestPayload.js +33 -0
  159. package/libEs5/components/Privacy/createStoredConsent.js +31 -0
  160. package/libEs5/components/Privacy/index.js +63 -0
  161. package/libEs5/components/Privacy/injectSendSetConsentRequest.js +47 -0
  162. package/libEs5/components/Privacy/parseConsentCookie.js +37 -0
  163. package/libEs5/components/Privacy/validateSetConsentOptions.js +21 -0
  164. package/libEs5/components/StreamingMedia/configValidators.js +24 -0
  165. package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
  166. package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
  167. package/libEs5/components/StreamingMedia/createMediaEventManager.js +112 -0
  168. package/libEs5/components/StreamingMedia/createMediaRequest.js +29 -0
  169. package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
  170. package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +58 -0
  171. package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +72 -0
  172. package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +90 -0
  173. package/libEs5/components/StreamingMedia/createTrackMediaSession.js +52 -0
  174. package/libEs5/components/StreamingMedia/index.js +69 -0
  175. package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +40 -0
  176. package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +35 -0
  177. package/libEs5/constants/apiVersion.js +15 -0
  178. package/libEs5/constants/browser.js +22 -0
  179. package/libEs5/constants/consentPurpose.js +16 -0
  180. package/libEs5/constants/consentStatus.js +18 -0
  181. package/libEs5/constants/contentType.js +16 -0
  182. package/libEs5/constants/cookieNameKey.js +18 -0
  183. package/libEs5/constants/cookieNamePrefix.js +16 -0
  184. package/libEs5/constants/coreCommands.js +17 -0
  185. package/libEs5/constants/debugQueryParam.js +15 -0
  186. package/libEs5/constants/decisionProvider.js +15 -0
  187. package/libEs5/constants/domain.js +17 -0
  188. package/libEs5/constants/ecidNamespace.js +15 -0
  189. package/libEs5/constants/edgeBasePath.js +15 -0
  190. package/libEs5/constants/elementAttribute.js +16 -0
  191. package/libEs5/constants/eventType.js +20 -0
  192. package/libEs5/constants/handle.js +15 -0
  193. package/libEs5/constants/highEntropyUserAgentClientHints.js +15 -0
  194. package/libEs5/constants/httpHeaderNames.js +17 -0
  195. package/libEs5/constants/httpStatusCode.js +20 -0
  196. package/libEs5/constants/identityMapAuthenticatedState.js +17 -0
  197. package/libEs5/constants/legacyCookies.js +18 -0
  198. package/libEs5/constants/libraryName.js +15 -0
  199. package/libEs5/constants/libraryVersion.js +17 -0
  200. package/libEs5/constants/namespace.js +15 -0
  201. package/libEs5/constants/pageWideScope.js +15 -0
  202. package/libEs5/constants/propositionEventType.js +32 -0
  203. package/libEs5/constants/queryStringIdentityParam.js +15 -0
  204. package/libEs5/constants/schema.js +25 -0
  205. package/libEs5/constants/shadowSeparator.js +15 -0
  206. package/libEs5/constants/tagName.js +22 -0
  207. package/libEs5/core/buildAndValidateConfig.js +115 -0
  208. package/libEs5/core/componentCreators.js +39 -0
  209. package/libEs5/core/config/createConfig.js +20 -0
  210. package/libEs5/core/config/createCoreConfigs.js +31 -0
  211. package/libEs5/core/consent/createConsent.js +61 -0
  212. package/libEs5/core/consent/createConsentStateMachine.js +137 -0
  213. package/libEs5/core/createComponentRegistry.js +86 -0
  214. package/libEs5/core/createCookieTransfer.js +80 -0
  215. package/libEs5/core/createEvent.js +170 -0
  216. package/libEs5/core/createEventManager.js +144 -0
  217. package/libEs5/core/createInstanceFunction.js +27 -0
  218. package/libEs5/core/createLifecycle.js +74 -0
  219. package/libEs5/core/createLogController.js +70 -0
  220. package/libEs5/core/createLogger.js +103 -0
  221. package/libEs5/core/edgeNetwork/handleRequestFailure.js +27 -0
  222. package/libEs5/core/edgeNetwork/injectApplyResponse.js +66 -0
  223. package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +42 -0
  224. package/libEs5/core/edgeNetwork/injectGetLocationHint.js +35 -0
  225. package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
  226. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +99 -0
  227. package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +28 -0
  228. package/libEs5/core/index.js +238 -0
  229. package/libEs5/core/initializeComponents.js +41 -0
  230. package/libEs5/core/injectCreateResponse.js +77 -0
  231. package/libEs5/core/injectExecuteCommand.js +104 -0
  232. package/libEs5/core/injectHandleError.js +36 -0
  233. package/libEs5/core/injectShouldTransferCookie.js +28 -0
  234. package/libEs5/core/network/getRequestRetryDelay.js +73 -0
  235. package/libEs5/core/network/injectSendNetworkRequest.js +102 -0
  236. package/libEs5/core/network/isRequestRetryable.js +27 -0
  237. package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +39 -0
  238. package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +44 -0
  239. package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +50 -0
  240. package/libEs5/core/validateCommandOptions.js +34 -0
  241. package/libEs5/index.js +59 -0
  242. package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +24 -0
  243. package/libEs5/utils/assign.js +16 -0
  244. package/libEs5/utils/assignConcatArrayValues.js +48 -0
  245. package/libEs5/utils/assignIf.js +21 -0
  246. package/libEs5/utils/clone.js +22 -0
  247. package/libEs5/utils/cookieJar.js +21 -0
  248. package/libEs5/utils/crc32.js +36 -0
  249. package/libEs5/utils/createCallbackAggregator.js +38 -0
  250. package/libEs5/utils/createLoggingCookieJar.js +33 -0
  251. package/libEs5/utils/createMerger.js +33 -0
  252. package/libEs5/utils/createSubscription.js +90 -0
  253. package/libEs5/utils/createTaskQueue.js +50 -0
  254. package/libEs5/utils/deduplicateArray.js +31 -0
  255. package/libEs5/utils/deepAssign.js +48 -0
  256. package/libEs5/utils/defer.js +26 -0
  257. package/libEs5/utils/dom/appendNode.js +17 -0
  258. package/libEs5/utils/dom/awaitSelector.js +105 -0
  259. package/libEs5/utils/dom/createNode.js +47 -0
  260. package/libEs5/utils/dom/index.js +58 -0
  261. package/libEs5/utils/dom/isShadowSelector.js +18 -0
  262. package/libEs5/utils/dom/matchesSelector.js +28 -0
  263. package/libEs5/utils/dom/querySelectorAll.js +32 -0
  264. package/libEs5/utils/dom/removeNode.js +21 -0
  265. package/libEs5/utils/dom/selectNodes.js +30 -0
  266. package/libEs5/utils/dom/selectNodesWithShadow.js +66 -0
  267. package/libEs5/utils/endsWith.js +23 -0
  268. package/libEs5/utils/filterObject.js +55 -0
  269. package/libEs5/utils/find.js +30 -0
  270. package/libEs5/utils/fireImage.js +38 -0
  271. package/libEs5/utils/flatMap.js +17 -0
  272. package/libEs5/utils/flattenArray.js +36 -0
  273. package/libEs5/utils/flattenObject.js +42 -0
  274. package/libEs5/utils/getApexDomain.js +45 -0
  275. package/libEs5/utils/getBrowser.js +35 -0
  276. package/libEs5/utils/getLastArrayItems.js +23 -0
  277. package/libEs5/utils/getNamespacedCookieName.js +19 -0
  278. package/libEs5/utils/groupBy.js +31 -0
  279. package/libEs5/utils/includes.js +23 -0
  280. package/libEs5/utils/index.js +408 -0
  281. package/libEs5/utils/injectDoesIdentityCookieExist.js +27 -0
  282. package/libEs5/utils/injectFireReferrerHideableImage.js +75 -0
  283. package/libEs5/utils/injectStorage.js +74 -0
  284. package/libEs5/utils/intersection.js +26 -0
  285. package/libEs5/utils/isBlankString.js +23 -0
  286. package/libEs5/utils/isBoolean.js +22 -0
  287. package/libEs5/utils/isEmptyObject.js +23 -0
  288. package/libEs5/utils/isFunction.js +22 -0
  289. package/libEs5/utils/isInteger.js +24 -0
  290. package/libEs5/utils/isNamespacedCookieName.js +26 -0
  291. package/libEs5/utils/isNil.js +22 -0
  292. package/libEs5/utils/isNonEmptyArray.js +22 -0
  293. package/libEs5/utils/isNonEmptyString.js +23 -0
  294. package/libEs5/utils/isNumber.js +23 -0
  295. package/libEs5/utils/isObject.js +23 -0
  296. package/libEs5/utils/isString.js +22 -0
  297. package/libEs5/utils/isUnique.js +30 -0
  298. package/libEs5/utils/isValidRegExp.js +26 -0
  299. package/libEs5/utils/memoize.js +36 -0
  300. package/libEs5/utils/noop.js +18 -0
  301. package/libEs5/utils/padStart.js +27 -0
  302. package/libEs5/utils/parseUrl.js +72 -0
  303. package/libEs5/utils/prepareConfigOverridesForEdge.js +52 -0
  304. package/libEs5/utils/querystring.js +16 -0
  305. package/libEs5/utils/request/createAddIdentity.js +22 -0
  306. package/libEs5/utils/request/createDataCollectionRequest.js +68 -0
  307. package/libEs5/utils/request/createDataCollectionRequestPayload.js +35 -0
  308. package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +44 -0
  309. package/libEs5/utils/request/createHasIdentity.js +19 -0
  310. package/libEs5/utils/request/createRequest.js +62 -0
  311. package/libEs5/utils/request/createRequestParams.js +44 -0
  312. package/libEs5/utils/request/createRequestPayload.js +36 -0
  313. package/libEs5/utils/request/index.js +58 -0
  314. package/libEs5/utils/sanitizeOrgIdForCookieName.js +17 -0
  315. package/libEs5/utils/stackError.js +34 -0
  316. package/libEs5/utils/startsWith.js +23 -0
  317. package/libEs5/utils/stringToBoolean.js +18 -0
  318. package/libEs5/utils/toArray.js +23 -0
  319. package/libEs5/utils/toError.js +23 -0
  320. package/libEs5/utils/toISOStringLocal.js +39 -0
  321. package/libEs5/utils/toInteger.js +31 -0
  322. package/libEs5/utils/updateErrorMessage.js +24 -0
  323. package/libEs5/utils/uuid.js +16 -0
  324. package/libEs5/utils/validateConfigOverride.js +16 -0
  325. package/libEs5/utils/validateIdentityMap.js +25 -0
  326. package/libEs5/utils/validation/booleanValidator.js +20 -0
  327. package/libEs5/utils/validation/callbackValidator.js +20 -0
  328. package/libEs5/utils/validation/createAnyOfValidator.js +32 -0
  329. package/libEs5/utils/validation/createArrayOfValidator.js +34 -0
  330. package/libEs5/utils/validation/createDefaultValidator.js +22 -0
  331. package/libEs5/utils/validation/createDeprecatedValidator.js +44 -0
  332. package/libEs5/utils/validation/createLiteralValidator.js +21 -0
  333. package/libEs5/utils/validation/createMapOfValuesValidator.js +40 -0
  334. package/libEs5/utils/validation/createMaximumValidator.js +21 -0
  335. package/libEs5/utils/validation/createMinimumValidator.js +21 -0
  336. package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +29 -0
  337. package/libEs5/utils/validation/createNonEmptyValidator.js +27 -0
  338. package/libEs5/utils/validation/createObjectOfValidator.js +48 -0
  339. package/libEs5/utils/validation/createUniqueItemsValidator.js +21 -0
  340. package/libEs5/utils/validation/createUniqueValidator.js +23 -0
  341. package/libEs5/utils/validation/domainValidator.js +21 -0
  342. package/libEs5/utils/validation/index.js +239 -0
  343. package/libEs5/utils/validation/integerValidator.js +20 -0
  344. package/libEs5/utils/validation/matchesRegexpValidator.js +21 -0
  345. package/libEs5/utils/validation/numberValidator.js +20 -0
  346. package/libEs5/utils/validation/regexpValidator.js +20 -0
  347. package/libEs5/utils/validation/requiredValidator.js +20 -0
  348. package/libEs5/utils/validation/stringValidator.js +20 -0
  349. package/libEs5/utils/validation/utils.js +137 -0
  350. package/libEs5/utils/values.js +25 -0
  351. package/libEs6/baseCode/index.js +61 -0
  352. package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +52 -0
  353. package/libEs6/components/ActivityCollector/configValidators.js +19 -0
  354. package/libEs6/components/ActivityCollector/createGetLinkDetails.js +70 -0
  355. package/libEs6/components/ActivityCollector/createLinkClick.js +37 -0
  356. package/libEs6/components/ActivityCollector/getLinkName.js +136 -0
  357. package/libEs6/components/ActivityCollector/getLinkRegion.js +58 -0
  358. package/libEs6/components/ActivityCollector/index.js +80 -0
  359. package/libEs6/components/ActivityCollector/utils.js +104 -0
  360. package/libEs6/components/Audiences/index.js +47 -0
  361. package/libEs6/components/Audiences/injectProcessDestinations.js +60 -0
  362. package/libEs6/components/Audiences/injectProcessResponse.js +38 -0
  363. package/libEs6/components/Context/createComponent.js +34 -0
  364. package/libEs6/components/Context/implementationDetails.js +24 -0
  365. package/libEs6/components/Context/index.js +52 -0
  366. package/libEs6/components/Context/injectDevice.js +70 -0
  367. package/libEs6/components/Context/injectEnvironment.js +42 -0
  368. package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +45 -0
  369. package/libEs6/components/Context/injectPlaceContext.js +29 -0
  370. package/libEs6/components/Context/injectTimestamp.js +21 -0
  371. package/libEs6/components/Context/injectWeb.js +28 -0
  372. package/libEs6/components/DataCollector/index.js +106 -0
  373. package/libEs6/components/DataCollector/validateApplyResponse.js +33 -0
  374. package/libEs6/components/DataCollector/validateUserEventOptions.js +49 -0
  375. package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +30 -0
  376. package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
  377. package/libEs6/components/DecisioningEngine/constants.js +25 -0
  378. package/libEs6/components/DecisioningEngine/createApplyResponse.js +31 -0
  379. package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +29 -0
  380. package/libEs6/components/DecisioningEngine/createContextProvider.js +95 -0
  381. package/libEs6/components/DecisioningEngine/createDecisionHistory.js +25 -0
  382. package/libEs6/components/DecisioningEngine/createDecisionProvider.js +41 -0
  383. package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +79 -0
  384. package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +45 -0
  385. package/libEs6/components/DecisioningEngine/createEventRegistry.js +120 -0
  386. package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +45 -0
  387. package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +79 -0
  388. package/libEs6/components/DecisioningEngine/index.js +124 -0
  389. package/libEs6/components/DecisioningEngine/utils.js +83 -0
  390. package/libEs6/components/EventMerge/createComponent.js +23 -0
  391. package/libEs6/components/EventMerge/createEventMergeId.js +18 -0
  392. package/libEs6/components/EventMerge/index.js +21 -0
  393. package/libEs6/components/Identity/addEcidQueryToPayload.js +20 -0
  394. package/libEs6/components/Identity/addEcidToPayload.js +18 -0
  395. package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +23 -0
  396. package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +31 -0
  397. package/libEs6/components/Identity/configValidators.js +18 -0
  398. package/libEs6/components/Identity/constants/authState.js +15 -0
  399. package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +13 -0
  400. package/libEs6/components/Identity/createComponent.js +97 -0
  401. package/libEs6/components/Identity/createLegacyIdentity.js +69 -0
  402. package/libEs6/components/Identity/getEcidFromResponse.js +19 -0
  403. package/libEs6/components/Identity/getIdentity/createGetIdentity.js +34 -0
  404. package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +28 -0
  405. package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +27 -0
  406. package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +25 -0
  407. package/libEs6/components/Identity/index.js +125 -0
  408. package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +30 -0
  409. package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +59 -0
  410. package/libEs6/components/Identity/injectAwaitIdentityCookie.js +52 -0
  411. package/libEs6/components/Identity/injectEnsureSingleIdentity.js +98 -0
  412. package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +19 -0
  413. package/libEs6/components/Identity/injectProcessIdSyncs.js +34 -0
  414. package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +32 -0
  415. package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +33 -0
  416. package/libEs6/components/Identity/visitorService/getVisitor.js +17 -0
  417. package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +48 -0
  418. package/libEs6/components/LegacyMediaAnalytics/constants/constants.js +141 -0
  419. package/libEs6/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +46 -0
  420. package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +239 -0
  421. package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
  422. package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +180 -0
  423. package/libEs6/components/LegacyMediaAnalytics/index.js +67 -0
  424. package/libEs6/components/LibraryInfo/index.js +59 -0
  425. package/libEs6/components/MachineLearning/index.js +23 -0
  426. package/libEs6/components/MachineLearning/processResponse.js +18 -0
  427. package/libEs6/components/Personalization/constants/loggerMessage.js +13 -0
  428. package/libEs6/components/Personalization/constants/scopeType.js +15 -0
  429. package/libEs6/components/Personalization/constants/surface.js +16 -0
  430. package/libEs6/components/Personalization/createActionsProvider.js +70 -0
  431. package/libEs6/components/Personalization/createApplyPropositions.js +103 -0
  432. package/libEs6/components/Personalization/createClickStorage.js +58 -0
  433. package/libEs6/components/Personalization/createCollect.js +48 -0
  434. package/libEs6/components/Personalization/createComponent.js +133 -0
  435. package/libEs6/components/Personalization/createFetchDataHandler.js +84 -0
  436. package/libEs6/components/Personalization/createGetPageLocation.js +17 -0
  437. package/libEs6/components/Personalization/createHandleConsentFlicker.js +26 -0
  438. package/libEs6/components/Personalization/createNotificationHandler.js +33 -0
  439. package/libEs6/components/Personalization/createOnClickHandler.js +52 -0
  440. package/libEs6/components/Personalization/createOnDecisionHandler.js +42 -0
  441. package/libEs6/components/Personalization/createPersonalizationDetails.js +94 -0
  442. package/libEs6/components/Personalization/createPreprocessors.js +19 -0
  443. package/libEs6/components/Personalization/createSetTargetMigration.js +27 -0
  444. package/libEs6/components/Personalization/createViewCacheManager.js +81 -0
  445. package/libEs6/components/Personalization/createViewChangeHandler.js +47 -0
  446. package/libEs6/components/Personalization/dom-actions/action.js +49 -0
  447. package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +36 -0
  448. package/libEs6/components/Personalization/dom-actions/appendHtml.js +30 -0
  449. package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +91 -0
  450. package/libEs6/components/Personalization/dom-actions/createPreprocess.js +18 -0
  451. package/libEs6/components/Personalization/dom-actions/createRedirect.js +22 -0
  452. package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +19 -0
  453. package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
  454. package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
  455. package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +22 -0
  456. package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +21 -0
  457. package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
  458. package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
  459. package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +33 -0
  460. package/libEs6/components/Personalization/dom-actions/dom/getParent.js +15 -0
  461. package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +19 -0
  462. package/libEs6/components/Personalization/dom-actions/dom/index.js +26 -0
  463. package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +23 -0
  464. package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +22 -0
  465. package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +35 -0
  466. package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
  467. package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +102 -0
  468. package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
  469. package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +21 -0
  470. package/libEs6/components/Personalization/dom-actions/images.js +31 -0
  471. package/libEs6/components/Personalization/dom-actions/index.js +13 -0
  472. package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +33 -0
  473. package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +29 -0
  474. package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +29 -0
  475. package/libEs6/components/Personalization/dom-actions/prependHtml.js +45 -0
  476. package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +31 -0
  477. package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +34 -0
  478. package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +51 -0
  479. package/libEs6/components/Personalization/dom-actions/replaceHtml.js +18 -0
  480. package/libEs6/components/Personalization/dom-actions/scripts.js +85 -0
  481. package/libEs6/components/Personalization/dom-actions/setAttributes.js +18 -0
  482. package/libEs6/components/Personalization/dom-actions/setHtml.js +24 -0
  483. package/libEs6/components/Personalization/dom-actions/setStyles.js +22 -0
  484. package/libEs6/components/Personalization/dom-actions/setText.js +15 -0
  485. package/libEs6/components/Personalization/dom-actions/swapImage.js +29 -0
  486. package/libEs6/components/Personalization/event.js +45 -0
  487. package/libEs6/components/Personalization/flicker/index.js +82 -0
  488. package/libEs6/components/Personalization/handlers/createProcessDomAction.js +61 -0
  489. package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +40 -0
  490. package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +77 -0
  491. package/libEs6/components/Personalization/handlers/createProcessPropositions.js +175 -0
  492. package/libEs6/components/Personalization/handlers/createProcessRedirect.js +41 -0
  493. package/libEs6/components/Personalization/handlers/injectCreateProposition.js +110 -0
  494. package/libEs6/components/Personalization/handlers/processDefaultContent.js +17 -0
  495. package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +293 -0
  496. package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +17 -0
  497. package/libEs6/components/Personalization/in-app-message-actions/utils.js +49 -0
  498. package/libEs6/components/Personalization/index.js +167 -0
  499. package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +21 -0
  500. package/libEs6/components/Personalization/utils/createAsyncArray.js +35 -0
  501. package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
  502. package/libEs6/components/Personalization/utils/surfaceUtils.js +76 -0
  503. package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +31 -0
  504. package/libEs6/components/Privacy/computeConsentHash.js +30 -0
  505. package/libEs6/components/Privacy/createComponent.js +85 -0
  506. package/libEs6/components/Privacy/createConsentHashStore.js +57 -0
  507. package/libEs6/components/Privacy/createConsentRequest.js +28 -0
  508. package/libEs6/components/Privacy/createConsentRequestPayload.js +31 -0
  509. package/libEs6/components/Privacy/createStoredConsent.js +30 -0
  510. package/libEs6/components/Privacy/index.js +63 -0
  511. package/libEs6/components/Privacy/injectSendSetConsentRequest.js +45 -0
  512. package/libEs6/components/Privacy/parseConsentCookie.js +26 -0
  513. package/libEs6/components/Privacy/validateSetConsentOptions.js +18 -0
  514. package/libEs6/components/StreamingMedia/configValidators.js +22 -0
  515. package/libEs6/components/StreamingMedia/constants/eventTypes.js +31 -0
  516. package/libEs6/components/StreamingMedia/constants/playbackState.js +16 -0
  517. package/libEs6/components/StreamingMedia/createMediaEventManager.js +122 -0
  518. package/libEs6/components/StreamingMedia/createMediaRequest.js +28 -0
  519. package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
  520. package/libEs6/components/StreamingMedia/createMediaSessionCacheManager.js +59 -0
  521. package/libEs6/components/StreamingMedia/createStreamingMediaComponent.js +69 -0
  522. package/libEs6/components/StreamingMedia/createTrackMediaEvent.js +88 -0
  523. package/libEs6/components/StreamingMedia/createTrackMediaSession.js +51 -0
  524. package/libEs6/components/StreamingMedia/index.js +64 -0
  525. package/libEs6/components/StreamingMedia/validateMediaEventOptions.js +33 -0
  526. package/libEs6/components/StreamingMedia/validateMediaSessionOptions.js +34 -0
  527. package/libEs6/constants/apiVersion.js +12 -0
  528. package/libEs6/constants/browser.js +19 -0
  529. package/libEs6/constants/consentPurpose.js +13 -0
  530. package/libEs6/constants/consentStatus.js +15 -0
  531. package/libEs6/constants/contentType.js +13 -0
  532. package/libEs6/constants/cookieNameKey.js +15 -0
  533. package/libEs6/constants/cookieNamePrefix.js +14 -0
  534. package/libEs6/constants/coreCommands.js +14 -0
  535. package/libEs6/constants/debugQueryParam.js +13 -0
  536. package/libEs6/constants/decisionProvider.js +12 -0
  537. package/libEs6/constants/domain.js +14 -0
  538. package/libEs6/constants/ecidNamespace.js +13 -0
  539. package/libEs6/constants/edgeBasePath.js +12 -0
  540. package/libEs6/constants/elementAttribute.js +13 -0
  541. package/libEs6/constants/eventType.js +17 -0
  542. package/libEs6/constants/handle.js +12 -0
  543. package/libEs6/constants/highEntropyUserAgentClientHints.js +13 -0
  544. package/libEs6/constants/httpHeaderNames.js +14 -0
  545. package/libEs6/constants/httpStatusCode.js +17 -0
  546. package/libEs6/constants/identityMapAuthenticatedState.js +14 -0
  547. package/libEs6/constants/legacyCookies.js +15 -0
  548. package/libEs6/constants/libraryName.js +13 -0
  549. package/libEs6/constants/libraryVersion.js +16 -0
  550. package/libEs6/constants/namespace.js +13 -0
  551. package/libEs6/constants/pageWideScope.js +13 -0
  552. package/libEs6/constants/propositionEventType.js +33 -0
  553. package/libEs6/constants/queryStringIdentityParam.js +13 -0
  554. package/libEs6/constants/schema.js +22 -0
  555. package/libEs6/constants/shadowSeparator.js +13 -0
  556. package/libEs6/constants/tagName.js +19 -0
  557. package/libEs6/core/buildAndValidateConfig.js +94 -0
  558. package/libEs6/core/componentCreators.js +47 -0
  559. package/libEs6/core/config/createConfig.js +17 -0
  560. package/libEs6/core/config/createCoreConfigs.js +27 -0
  561. package/libEs6/core/consent/createConsent.js +60 -0
  562. package/libEs6/core/consent/createConsentStateMachine.js +125 -0
  563. package/libEs6/core/createComponentRegistry.js +83 -0
  564. package/libEs6/core/createCookieTransfer.js +78 -0
  565. package/libEs6/core/createEvent.js +161 -0
  566. package/libEs6/core/createEventManager.js +135 -0
  567. package/libEs6/core/createInstanceFunction.js +25 -0
  568. package/libEs6/core/createLifecycle.js +65 -0
  569. package/libEs6/core/createLogController.js +68 -0
  570. package/libEs6/core/createLogger.js +99 -0
  571. package/libEs6/core/edgeNetwork/handleRequestFailure.js +24 -0
  572. package/libEs6/core/edgeNetwork/injectApplyResponse.js +58 -0
  573. package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +39 -0
  574. package/libEs6/core/edgeNetwork/injectGetLocationHint.js +32 -0
  575. package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
  576. package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +100 -0
  577. package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +21 -0
  578. package/libEs6/core/index.js +236 -0
  579. package/libEs6/core/initializeComponents.js +40 -0
  580. package/libEs6/core/injectCreateResponse.js +70 -0
  581. package/libEs6/core/injectExecuteCommand.js +100 -0
  582. package/libEs6/core/injectHandleError.js +33 -0
  583. package/libEs6/core/injectShouldTransferCookie.js +25 -0
  584. package/libEs6/core/network/getRequestRetryDelay.js +72 -0
  585. package/libEs6/core/network/injectSendNetworkRequest.js +96 -0
  586. package/libEs6/core/network/isRequestRetryable.js +25 -0
  587. package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +38 -0
  588. package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +41 -0
  589. package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +49 -0
  590. package/libEs6/core/validateCommandOptions.js +33 -0
  591. package/libEs6/index.js +55 -0
  592. package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +20 -0
  593. package/libEs6/utils/assign.js +14 -0
  594. package/libEs6/utils/assignConcatArrayValues.js +36 -0
  595. package/libEs6/utils/assignIf.js +19 -0
  596. package/libEs6/utils/clone.js +18 -0
  597. package/libEs6/utils/cookieJar.js +19 -0
  598. package/libEs6/utils/crc32.js +33 -0
  599. package/libEs6/utils/createCallbackAggregator.js +31 -0
  600. package/libEs6/utils/createLoggingCookieJar.js +28 -0
  601. package/libEs6/utils/createMerger.js +30 -0
  602. package/libEs6/utils/createSubscription.js +70 -0
  603. package/libEs6/utils/createTaskQueue.js +48 -0
  604. package/libEs6/utils/deduplicateArray.js +23 -0
  605. package/libEs6/utils/deepAssign.js +40 -0
  606. package/libEs6/utils/defer.js +24 -0
  607. package/libEs6/utils/dom/appendNode.js +15 -0
  608. package/libEs6/utils/dom/awaitSelector.js +98 -0
  609. package/libEs6/utils/dom/createNode.js +38 -0
  610. package/libEs6/utils/dom/index.js +20 -0
  611. package/libEs6/utils/dom/isShadowSelector.js +14 -0
  612. package/libEs6/utils/dom/matchesSelector.js +26 -0
  613. package/libEs6/utils/dom/querySelectorAll.js +29 -0
  614. package/libEs6/utils/dom/removeNode.js +19 -0
  615. package/libEs6/utils/dom/selectNodes.js +28 -0
  616. package/libEs6/utils/dom/selectNodesWithShadow.js +63 -0
  617. package/libEs6/utils/endsWith.js +19 -0
  618. package/libEs6/utils/filterObject.js +55 -0
  619. package/libEs6/utils/find.js +28 -0
  620. package/libEs6/utils/fireImage.js +37 -0
  621. package/libEs6/utils/flatMap.js +14 -0
  622. package/libEs6/utils/flattenArray.js +26 -0
  623. package/libEs6/utils/flattenObject.js +28 -0
  624. package/libEs6/utils/getApexDomain.js +42 -0
  625. package/libEs6/utils/getBrowser.js +65 -0
  626. package/libEs6/utils/getLastArrayItems.js +19 -0
  627. package/libEs6/utils/getNamespacedCookieName.js +15 -0
  628. package/libEs6/utils/groupBy.js +29 -0
  629. package/libEs6/utils/includes.js +21 -0
  630. package/libEs6/utils/index.js +71 -0
  631. package/libEs6/utils/injectDoesIdentityCookieExist.js +24 -0
  632. package/libEs6/utils/injectFireReferrerHideableImage.js +65 -0
  633. package/libEs6/utils/injectStorage.js +69 -0
  634. package/libEs6/utils/intersection.js +21 -0
  635. package/libEs6/utils/isBlankString.js +20 -0
  636. package/libEs6/utils/isBoolean.js +18 -0
  637. package/libEs6/utils/isEmptyObject.js +20 -0
  638. package/libEs6/utils/isFunction.js +18 -0
  639. package/libEs6/utils/isInteger.js +23 -0
  640. package/libEs6/utils/isNamespacedCookieName.js +23 -0
  641. package/libEs6/utils/isNil.js +18 -0
  642. package/libEs6/utils/isNonEmptyArray.js +18 -0
  643. package/libEs6/utils/isNonEmptyString.js +20 -0
  644. package/libEs6/utils/isNumber.js +19 -0
  645. package/libEs6/utils/isObject.js +20 -0
  646. package/libEs6/utils/isString.js +18 -0
  647. package/libEs6/utils/isUnique.js +27 -0
  648. package/libEs6/utils/isValidRegExp.js +24 -0
  649. package/libEs6/utils/memoize.js +34 -0
  650. package/libEs6/utils/noop.js +16 -0
  651. package/libEs6/utils/padStart.js +25 -0
  652. package/libEs6/utils/parseUrl.js +62 -0
  653. package/libEs6/utils/prepareConfigOverridesForEdge.js +50 -0
  654. package/libEs6/utils/querystring.js +14 -0
  655. package/libEs6/utils/request/createAddIdentity.js +19 -0
  656. package/libEs6/utils/request/createDataCollectionRequest.js +69 -0
  657. package/libEs6/utils/request/createDataCollectionRequestPayload.js +30 -0
  658. package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +42 -0
  659. package/libEs6/utils/request/createHasIdentity.js +15 -0
  660. package/libEs6/utils/request/createRequest.js +63 -0
  661. package/libEs6/utils/request/createRequestParams.js +40 -0
  662. package/libEs6/utils/request/createRequestPayload.js +35 -0
  663. package/libEs6/utils/request/index.js +20 -0
  664. package/libEs6/utils/sanitizeOrgIdForCookieName.js +13 -0
  665. package/libEs6/utils/stackError.js +34 -0
  666. package/libEs6/utils/startsWith.js +19 -0
  667. package/libEs6/utils/stringToBoolean.js +15 -0
  668. package/libEs6/utils/toArray.js +21 -0
  669. package/libEs6/utils/toError.js +21 -0
  670. package/libEs6/utils/toISOStringLocal.js +37 -0
  671. package/libEs6/utils/toInteger.js +30 -0
  672. package/libEs6/utils/updateErrorMessage.js +23 -0
  673. package/libEs6/utils/uuid.js +14 -0
  674. package/libEs6/utils/validateConfigOverride.js +14 -0
  675. package/libEs6/utils/validateIdentityMap.js +23 -0
  676. package/libEs6/utils/validation/booleanValidator.js +18 -0
  677. package/libEs6/utils/validation/callbackValidator.js +17 -0
  678. package/libEs6/utils/validation/createAnyOfValidator.js +26 -0
  679. package/libEs6/utils/validation/createArrayOfValidator.js +28 -0
  680. package/libEs6/utils/validation/createDefaultValidator.js +18 -0
  681. package/libEs6/utils/validation/createDeprecatedValidator.js +37 -0
  682. package/libEs6/utils/validation/createLiteralValidator.js +16 -0
  683. package/libEs6/utils/validation/createMapOfValuesValidator.js +35 -0
  684. package/libEs6/utils/validation/createMaximumValidator.js +16 -0
  685. package/libEs6/utils/validation/createMinimumValidator.js +16 -0
  686. package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +25 -0
  687. package/libEs6/utils/validation/createNonEmptyValidator.js +23 -0
  688. package/libEs6/utils/validation/createObjectOfValidator.js +43 -0
  689. package/libEs6/utils/validation/createUniqueItemsValidator.js +18 -0
  690. package/libEs6/utils/validation/createUniqueValidator.js +21 -0
  691. package/libEs6/utils/validation/domainValidator.js +17 -0
  692. package/libEs6/utils/validation/index.js +232 -0
  693. package/libEs6/utils/validation/integerValidator.js +18 -0
  694. package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
  695. package/libEs6/utils/validation/numberValidator.js +18 -0
  696. package/libEs6/utils/validation/regexpValidator.js +18 -0
  697. package/libEs6/utils/validation/requiredValidator.js +18 -0
  698. package/libEs6/utils/validation/stringValidator.js +17 -0
  699. package/libEs6/utils/validation/utils.js +127 -0
  700. package/libEs6/utils/values.js +21 -0
  701. package/package.json +1 -1
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ /*
5
+ Copyright 2019 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software distributed under
11
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ OF ANY KIND, either express or implied. See the License for the specific language
13
+ governing permissions and limitations under the License.
14
+ */
15
+ /* eslint no-param-reassign: 0 */
16
+ /* eslint no-underscore-dangle: 0 */
17
+ /* eslint prefer-rest-params: 0 */
18
+ /* eslint no-var: 0 */
19
+ /* eslint-disable func-names */
20
+ /**
21
+ * This is the code, once minified, that an Alloy consumer copies and pastes
22
+ * into their website's HTML. It sets up any global functions the consumer will
23
+ * use to interact with Alloy. It also provides a queuing mechanism whereby
24
+ * any function calls made by the consumer before the Alloy library file
25
+ * loads will be enqueued and later processed by Alloy once the Alloy library
26
+ * file has loaded. Because each call may be asynchronously processed, a promise
27
+ * will always be returned to the consumer any time the consumer attempts to
28
+ * execute a command.
29
+ *
30
+ * Along with this base code, a script tag (not shown here) will also be added
31
+ * to the consumer website's HTML that will load the Alloy library file.
32
+ *
33
+ * Take particular care to write well-minifiable code, as consumers are
34
+ * particularly sensitive to base code size.
35
+ */
36
+ var _default = exports.default = function _default(window, instanceNames) {
37
+ instanceNames.forEach(function (instanceName) {
38
+ if (!window[instanceName]) {
39
+ // __alloyNS stores a name of each "instance", or in other words, each
40
+ // global function created that the consumer will use. This array is
41
+ // what the Alloy library will consult once it is loaded to determine
42
+ // which global functions have been set up so that is can connect them to
43
+ // the library's command processing pipeline.
44
+ (window.__alloyNS = window.__alloyNS || []).push(instanceName);
45
+ window[instanceName] = function () {
46
+ var userProvidedArgs = arguments;
47
+ // Always return a promise, because the command may be executed
48
+ // asynchronously, especially if the Alloy library has not yet loaded.
49
+ return new Promise(function (resolve, reject) {
50
+ // Push required call information into the queue. Once the Alloy
51
+ // library is loaded, it will process this queue and resolve/reject
52
+ // the promise we just returned to the consumer. If the Alloy
53
+ // library has already loaded, then it will have already overridden
54
+ // q.push and will therefore process the call immediately.
55
+ window[instanceName].q.push([resolve, reject, userProvidedArgs]);
56
+ });
57
+ };
58
+ window[instanceName].q = [];
59
+ }
60
+ });
61
+ };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _index = require("../../utils/index.js");
5
+ /*
6
+ Copyright 2022 Adobe. All rights reserved.
7
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License. You may obtain a copy
9
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software distributed under
12
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ OF ANY KIND, either express or implied. See the License for the specific language
14
+ governing permissions and limitations under the License.
15
+ */
16
+
17
+ var createClickHandler = function createClickHandler(_ref) {
18
+ var eventManager = _ref.eventManager,
19
+ lifecycle = _ref.lifecycle,
20
+ handleError = _ref.handleError;
21
+ return function (clickEvent) {
22
+ // TODO: Consider safeguarding from the same object being clicked multiple times in rapid succession?
23
+ var clickedElement = clickEvent.target;
24
+ var event = eventManager.createEvent();
25
+ // this is to make sure a exit link personalization metric use send beacon
26
+ event.documentMayUnload();
27
+ return lifecycle.onClick({
28
+ event: event,
29
+ clickedElement: clickedElement
30
+ }).then(function () {
31
+ if (event.isEmpty()) {
32
+ return Promise.resolve();
33
+ }
34
+ return eventManager.sendEvent(event);
35
+ })
36
+ // eventManager.sendEvent() will return a promise resolved to an
37
+ // object and we want to avoid returning any value to the customer
38
+ .then(_index.noop).catch(function (error) {
39
+ handleError(error, "click collection");
40
+ });
41
+ };
42
+ };
43
+ var _default = exports.default = function _default(_ref2) {
44
+ var eventManager = _ref2.eventManager,
45
+ lifecycle = _ref2.lifecycle,
46
+ handleError = _ref2.handleError;
47
+ var clickHandler = createClickHandler({
48
+ eventManager: eventManager,
49
+ lifecycle: lifecycle,
50
+ handleError: handleError
51
+ });
52
+ document.addEventListener("click", clickHandler, true);
53
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ exports.downloadLinkQualifier = exports.default = void 0;
4
+ var _index = require("../../utils/validation/index.js");
5
+ /*
6
+ Copyright 2019 Adobe. All rights reserved.
7
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License. You may obtain a copy
9
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software distributed under
12
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ OF ANY KIND, either express or implied. See the License for the specific language
14
+ governing permissions and limitations under the License.
15
+ */
16
+
17
+ var downloadLinkQualifier = exports.downloadLinkQualifier = (0, _index.string)().regexp().default("\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$");
18
+ var _default = exports.default = (0, _index.objectOf)({
19
+ clickCollectionEnabled: (0, _index.boolean)().default(true),
20
+ onBeforeLinkClickSend: (0, _index.callback)(),
21
+ downloadLinkQualifier: downloadLinkQualifier
22
+ });
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ /*
5
+ Copyright 2022 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software distributed under
11
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ OF ANY KIND, either express or implied. See the License for the specific language
13
+ governing permissions and limitations under the License.
14
+ */
15
+ var _default = exports.default = function _default(_ref) {
16
+ var window = _ref.window,
17
+ getLinkName = _ref.getLinkName,
18
+ getLinkRegion = _ref.getLinkRegion,
19
+ getAbsoluteUrlFromAnchorElement = _ref.getAbsoluteUrlFromAnchorElement,
20
+ findSupportedAnchorElement = _ref.findSupportedAnchorElement,
21
+ determineLinkType = _ref.determineLinkType;
22
+ return function (_ref2) {
23
+ var targetElement = _ref2.targetElement,
24
+ config = _ref2.config,
25
+ logger = _ref2.logger;
26
+ var anchorElement = findSupportedAnchorElement(targetElement);
27
+ if (!anchorElement) {
28
+ logger.info("This link click event is not triggered because the HTML element is not an anchor.");
29
+ return undefined;
30
+ }
31
+ var linkUrl = getAbsoluteUrlFromAnchorElement(window, anchorElement);
32
+ if (!linkUrl) {
33
+ logger.info("This link click event is not triggered because the HTML element doesn't have an URL.");
34
+ return undefined;
35
+ }
36
+ var linkType = determineLinkType(window, config, linkUrl, anchorElement);
37
+ var linkRegion = getLinkRegion(anchorElement);
38
+ var linkName = getLinkName(anchorElement);
39
+ var onBeforeLinkClickSend = config.onBeforeLinkClickSend;
40
+ var options = {
41
+ xdm: {
42
+ eventType: "web.webinteraction.linkClicks",
43
+ web: {
44
+ webInteraction: {
45
+ name: linkName,
46
+ region: linkRegion,
47
+ type: linkType,
48
+ URL: linkUrl,
49
+ linkClicks: {
50
+ value: 1
51
+ }
52
+ }
53
+ }
54
+ },
55
+ data: {},
56
+ clickedElement: targetElement
57
+ };
58
+ if (!onBeforeLinkClickSend) {
59
+ return options;
60
+ }
61
+ var shouldEventBeTracked = onBeforeLinkClickSend(options);
62
+ if (shouldEventBeTracked !== false) {
63
+ return options;
64
+ }
65
+ logger.info("This link click event is not triggered because it was canceled in onBeforeLinkClickSend.");
66
+ return undefined;
67
+ };
68
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ /*
5
+ Copyright 2022 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software distributed under
11
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ OF ANY KIND, either express or implied. See the License for the specific language
13
+ governing permissions and limitations under the License.
14
+ */
15
+ var _default = exports.default = function _default(_ref) {
16
+ var getLinkDetails = _ref.getLinkDetails,
17
+ config = _ref.config,
18
+ logger = _ref.logger;
19
+ var clickCollectionEnabled = config.clickCollectionEnabled;
20
+ if (!clickCollectionEnabled) {
21
+ return function () {
22
+ return undefined;
23
+ };
24
+ }
25
+ return function (_ref2) {
26
+ var targetElement = _ref2.targetElement,
27
+ event = _ref2.event;
28
+ var linkDetails = getLinkDetails({
29
+ targetElement: targetElement,
30
+ config: config,
31
+ logger: logger
32
+ });
33
+ if (linkDetails) {
34
+ event.mergeXdm(linkDetails.xdm);
35
+ event.setUserData(linkDetails.data);
36
+ }
37
+ };
38
+ };
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _utils = require("./utils.js");
5
+ /*
6
+ Copyright 2022 Adobe. All rights reserved.
7
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License. You may obtain a copy
9
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software distributed under
12
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ OF ANY KIND, either express or implied. See the License for the specific language
14
+ governing permissions and limitations under the License.
15
+ */
16
+
17
+ var unsupportedNodeNames = /^(SCRIPT|STYLE|LINK|CANVAS|NOSCRIPT|#COMMENT)$/i;
18
+
19
+ /**
20
+ * Determines if a node qualifies as a supported link text node.
21
+ * @param {*} node Node to determine support for.
22
+ * @returns {boolean}
23
+ */
24
+ var isSupportedTextNode = function isSupportedTextNode(node) {
25
+ if (node && node.nodeName) {
26
+ if (node.nodeName.match(unsupportedNodeNames)) {
27
+ return false;
28
+ }
29
+ }
30
+ return true;
31
+ };
32
+
33
+ /**
34
+ * Orders and returns specified node and its child nodes in arrays of supported
35
+ * and unsupported nodes.
36
+ * @param {*} node The node to extract supported and unsupported nodes from.
37
+ * @returns {{supportedNodes: Array, includesUnsupportedNodes: boolean}} Node support object.
38
+ */
39
+ var extractSupportedNodes = function extractSupportedNodes(node) {
40
+ var supportedNodes = [];
41
+ var includesUnsupportedNodes = false;
42
+ if (isSupportedTextNode(node)) {
43
+ supportedNodes.push(node);
44
+ if (node.childNodes) {
45
+ var childNodes = Array.prototype.slice.call(node.childNodes);
46
+ childNodes.forEach(function (childNode) {
47
+ var nodes = extractSupportedNodes(childNode);
48
+ supportedNodes = supportedNodes.concat(nodes.supportedNodes);
49
+ includesUnsupportedNodes = includesUnsupportedNodes || nodes.includesUnsupportedNodes;
50
+ });
51
+ }
52
+ } else {
53
+ includesUnsupportedNodes = true;
54
+ }
55
+ return {
56
+ supportedNodes: supportedNodes,
57
+ includesUnsupportedNodes: includesUnsupportedNodes
58
+ };
59
+ };
60
+
61
+ /**
62
+ * Returns the value of a node attribute.
63
+ * @param {*} node The node holding the attribute.
64
+ * @param {string} attributeName The name of the attribute.
65
+ * @param {string} nodeName Optional node name constraint.
66
+ * @returns {string} Attribute value or undefined.
67
+ */
68
+ var getNodeAttributeValue = function getNodeAttributeValue(node, attributeName, nodeName) {
69
+ var attributeValue;
70
+ if (!nodeName || nodeName === node.nodeName.toUpperCase()) {
71
+ attributeValue = node.getAttribute(attributeName);
72
+ }
73
+ return attributeValue;
74
+ };
75
+
76
+ /**
77
+ * Extracts the children supported nodes attributes map
78
+ * @param {*} nodes The nodes array holding the children nodes.
79
+ * The returned map contains the supported not empty children attributes values.
80
+ * */
81
+ var getChildrenAttributes = function getChildrenAttributes(nodes) {
82
+ var attributes = {
83
+ texts: []
84
+ };
85
+ nodes.supportedNodes.forEach(function (supportedNode) {
86
+ if (supportedNode.getAttribute) {
87
+ if (!attributes.alt) {
88
+ attributes.alt = (0, _utils.truncateWhiteSpace)(supportedNode.getAttribute("alt"));
89
+ }
90
+ if (!attributes.title) {
91
+ attributes.title = (0, _utils.truncateWhiteSpace)(supportedNode.getAttribute("title"));
92
+ }
93
+ if (!attributes.inputValue) {
94
+ attributes.inputValue = (0, _utils.truncateWhiteSpace)(getNodeAttributeValue(supportedNode, "value", "INPUT"));
95
+ }
96
+ if (!attributes.imgSrc) {
97
+ attributes.imgSrc = (0, _utils.truncateWhiteSpace)(getNodeAttributeValue(supportedNode, "src", "IMG"));
98
+ }
99
+ }
100
+ if (supportedNode.nodeValue) {
101
+ attributes.texts.push(supportedNode.nodeValue);
102
+ }
103
+ });
104
+ return attributes;
105
+ };
106
+
107
+ /**
108
+ * Extracts a link-name from a given node.
109
+ *
110
+ * The returned link-name is set to one of the following (in order of priority):
111
+ *
112
+ * 1. Clicked node innerText
113
+ * 2. Clicked node textContent
114
+ * 3. Clicked node and its child nodes nodeValue appended together.
115
+ * 4. Clicked node alt attribute or node descendant alt attribute.
116
+ * Whichever is found first.
117
+ * 5. Clicked node text attribute or node descendant text attribute.
118
+ * Whichever is found first.
119
+ * 6. Clicked node INPUT descendant value attribute.
120
+ * Whichever is found first.
121
+ * 7. Clicked node IMG descendant src attribute.
122
+ * Whichever is found first.
123
+ *
124
+ * @param {*} node The node to find link text for.
125
+ * @returns {string} link-name or an empty string if not link-name is found.
126
+ */
127
+ var _default = exports.default = function _default(node) {
128
+ var nodeText = (0, _utils.truncateWhiteSpace)(node.innerText || node.textContent);
129
+ var nodes = extractSupportedNodes(node);
130
+ // if contains unsupported nodes we want children node attributes
131
+ if (!nodeText || nodes.includesUnsupportedNodes) {
132
+ var attributesMap = getChildrenAttributes(nodes);
133
+ nodeText = (0, _utils.truncateWhiteSpace)(attributesMap.texts.join(""));
134
+ if (!nodeText) {
135
+ nodeText = attributesMap.alt || attributesMap.title || attributesMap.inputValue || attributesMap.imgSrc;
136
+ }
137
+ }
138
+ return nodeText || "";
139
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _utils = require("./utils.js");
5
+ var _index = require("../../utils/index.js");
6
+ /*
7
+ Copyright 2022 Adobe. All rights reserved.
8
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License. You may obtain a copy
10
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software distributed under
13
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
+ OF ANY KIND, either express or implied. See the License for the specific language
15
+ governing permissions and limitations under the License.
16
+ */
17
+
18
+ var semanticElements = /^(HEADER|MAIN|FOOTER|NAV)$/i;
19
+ var getAriaRegionLabel = function getAriaRegionLabel(node) {
20
+ var regionLabel;
21
+ if (node.role === "region" && (0, _index.isNonEmptyString)(node["aria-label"])) {
22
+ regionLabel = node["aria-label"];
23
+ }
24
+ return regionLabel;
25
+ };
26
+ var getSectionNodeName = function getSectionNodeName(node) {
27
+ var nodeName;
28
+ if (node && node.nodeName) {
29
+ if (node.nodeName.match(semanticElements)) {
30
+ nodeName = node.nodeName;
31
+ }
32
+ }
33
+ return nodeName;
34
+ };
35
+
36
+ /**
37
+ * Extracts a node link-region.
38
+ *
39
+ * The link-region is determined by traversing up the DOM
40
+ * looking for a region that is determined in order of priority:
41
+ *
42
+ * 1. element.id
43
+ * 2. Aria region label
44
+ * 3. Semantic element name
45
+ * 4. BODY (if no other link-region is found).
46
+ *
47
+ * @param {*} node The node to find link region for.
48
+ * @returns {string} link-region.
49
+ */
50
+ var _default = exports.default = function _default(node) {
51
+ var linkParentNode = node.parentNode;
52
+ var regionName;
53
+ while (linkParentNode) {
54
+ regionName = (0, _utils.truncateWhiteSpace)(linkParentNode.id || getAriaRegionLabel(linkParentNode) || getSectionNodeName(linkParentNode));
55
+ if (regionName) {
56
+ return regionName;
57
+ }
58
+ linkParentNode = linkParentNode.parentNode;
59
+ }
60
+ return "BODY";
61
+ };
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _attachClickActivityCollector = require("./attachClickActivityCollector.js");
5
+ var _configValidators = require("./configValidators.js");
6
+ var _createLinkClick = require("./createLinkClick.js");
7
+ var _createGetLinkDetails = require("./createGetLinkDetails.js");
8
+ var _getLinkName = require("./getLinkName.js");
9
+ var _getLinkRegion = require("./getLinkRegion.js");
10
+ var _utils = require("./utils.js");
11
+ /*
12
+ Copyright 2019 Adobe. All rights reserved.
13
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
+ you may not use this file except in compliance with the License. You may obtain a copy
15
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
16
+
17
+ Unless required by applicable law or agreed to in writing, software distributed under
18
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
+ OF ANY KIND, either express or implied. See the License for the specific language
20
+ governing permissions and limitations under the License.
21
+ */
22
+
23
+ var _getLinkDetails = (0, _createGetLinkDetails.default)({
24
+ window: window,
25
+ getLinkName: _getLinkName.default,
26
+ getLinkRegion: _getLinkRegion.default,
27
+ getAbsoluteUrlFromAnchorElement: _utils.getAbsoluteUrlFromAnchorElement,
28
+ findSupportedAnchorElement: _utils.findSupportedAnchorElement,
29
+ determineLinkType: _utils.determineLinkType
30
+ });
31
+ var createActivityCollector = function createActivityCollector(_ref) {
32
+ var config = _ref.config,
33
+ eventManager = _ref.eventManager,
34
+ handleError = _ref.handleError,
35
+ logger = _ref.logger;
36
+ var linkClick = (0, _createLinkClick.default)({
37
+ getLinkDetails: _getLinkDetails,
38
+ config: config,
39
+ logger: logger
40
+ });
41
+ return {
42
+ lifecycle: {
43
+ onComponentsRegistered: function onComponentsRegistered(tools) {
44
+ var lifecycle = tools.lifecycle;
45
+ (0, _attachClickActivityCollector.default)({
46
+ eventManager: eventManager,
47
+ lifecycle: lifecycle,
48
+ handleError: handleError
49
+ });
50
+ // TODO: createScrollActivityCollector ...
51
+ },
52
+ onClick: function onClick(_ref2) {
53
+ var event = _ref2.event,
54
+ clickedElement = _ref2.clickedElement;
55
+ linkClick({
56
+ targetElement: clickedElement,
57
+ event: event
58
+ });
59
+ }
60
+ }
61
+ };
62
+ };
63
+ createActivityCollector.namespace = "ActivityCollector";
64
+ createActivityCollector.configValidators = _configValidators.default;
65
+ createActivityCollector.buildOnInstanceConfiguredExtraParams = function (_ref3) {
66
+ var config = _ref3.config,
67
+ logger = _ref3.logger;
68
+ return {
69
+ getLinkDetails: function getLinkDetails(targetElement) {
70
+ return _getLinkDetails({
71
+ targetElement: targetElement,
72
+ config: config,
73
+ logger: logger
74
+ });
75
+ }
76
+ };
77
+ };
78
+ var _default = exports.default = createActivityCollector;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ exports.urlStartsWithScheme = exports.truncateWhiteSpace = exports.trimQueryFromUrl = exports.isSupportedAnchorElement = exports.isExitLink = exports.isEmptyString = exports.isDownloadLink = exports.getAbsoluteUrlFromAnchorElement = exports.findSupportedAnchorElement = exports.determineLinkType = void 0;
4
+ /*
5
+ Copyright 2019 Adobe. All rights reserved.
6
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License. You may obtain a copy
8
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software distributed under
11
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ OF ANY KIND, either express or implied. See the License for the specific language
13
+ governing permissions and limitations under the License.
14
+ */
15
+
16
+ var urlStartsWithScheme = exports.urlStartsWithScheme = function urlStartsWithScheme(url) {
17
+ return url && /^[a-z0-9]+:\/\//i.test(url);
18
+ };
19
+ var getAbsoluteUrlFromAnchorElement = exports.getAbsoluteUrlFromAnchorElement = function getAbsoluteUrlFromAnchorElement(window, element) {
20
+ var loc = window.location;
21
+ var url = element.href ? element.href : "";
22
+ var protocol = element.protocol,
23
+ host = element.host;
24
+ if (!urlStartsWithScheme(url)) {
25
+ if (!protocol) {
26
+ protocol = loc.protocol ? loc.protocol : "";
27
+ }
28
+ protocol = protocol ? protocol + "//" : "";
29
+ if (!host) {
30
+ host = loc.host ? loc.host : "";
31
+ }
32
+ var path = "";
33
+ if (url.substring(0, 1) !== "/") {
34
+ var indx = loc.pathname.lastIndexOf("/");
35
+ indx = indx < 0 ? 0 : indx;
36
+ path = loc.pathname.substring(0, indx);
37
+ }
38
+ url = "" + protocol + host + path + "/" + url;
39
+ }
40
+ return url;
41
+ };
42
+ var isSupportedAnchorElement = exports.isSupportedAnchorElement = function isSupportedAnchorElement(element) {
43
+ if (element.href && (element.tagName === "A" || element.tagName === "AREA") && (!element.onclick || !element.protocol || element.protocol.toLowerCase().indexOf("javascript") < 0)) {
44
+ return true;
45
+ }
46
+ return false;
47
+ };
48
+ var trimQueryFromUrl = exports.trimQueryFromUrl = function trimQueryFromUrl(url) {
49
+ var questionMarkIndex = url.indexOf("?");
50
+ var hashIndex = url.indexOf("#");
51
+ if (questionMarkIndex >= 0 && (questionMarkIndex < hashIndex || hashIndex < 0)) {
52
+ return url.substring(0, questionMarkIndex);
53
+ }
54
+ if (hashIndex >= 0) {
55
+ return url.substring(0, hashIndex);
56
+ }
57
+ return url;
58
+ };
59
+ var isDownloadLink = exports.isDownloadLink = function isDownloadLink(downloadLinkQualifier, linkUrl, clickedObj) {
60
+ var re = new RegExp(downloadLinkQualifier);
61
+ var trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
62
+ return clickedObj.download ? true : re.test(trimmedLinkUrl);
63
+ };
64
+ var isExitLink = exports.isExitLink = function isExitLink(window, linkUrl) {
65
+ var currentHostname = window.location.hostname.toLowerCase();
66
+ var trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
67
+ if (trimmedLinkUrl.indexOf(currentHostname) >= 0) {
68
+ return false;
69
+ }
70
+ return true;
71
+ };
72
+
73
+ /**
74
+ * Reduces repeated whitespace within a string. Whitespace surrounding the string
75
+ * is trimmed and any occurrence of whitespace within the string is replaced with
76
+ * a single space.
77
+ * @param {string} str String to be formatted.
78
+ * @returns {string} Formatted string.
79
+ */
80
+ var truncateWhiteSpace = exports.truncateWhiteSpace = function truncateWhiteSpace(str) {
81
+ return str && str.replace(/\s+/g, " ").trim();
82
+ };
83
+ var isEmptyString = exports.isEmptyString = function isEmptyString(str) {
84
+ return !str || str.length === 0;
85
+ };
86
+ var determineLinkType = exports.determineLinkType = function determineLinkType(window, config, linkUrl, clickedObj) {
87
+ var linkType = "other";
88
+ if (isDownloadLink(config.downloadLinkQualifier, linkUrl, clickedObj)) {
89
+ linkType = "download";
90
+ } else if (isExitLink(window, linkUrl)) {
91
+ linkType = "exit";
92
+ }
93
+ return linkType;
94
+ };
95
+ var findSupportedAnchorElement = exports.findSupportedAnchorElement = function findSupportedAnchorElement(targetElement) {
96
+ var node = targetElement;
97
+ while (node) {
98
+ if (isSupportedAnchorElement(node)) {
99
+ return node;
100
+ }
101
+ node = node.parentNode;
102
+ }
103
+ return null;
104
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ exports.default = void 0;
4
+ var _index = require("../../utils/index.js");
5
+ var _injectProcessDestinations = require("./injectProcessDestinations.js");
6
+ var _injectProcessResponse = require("./injectProcessResponse.js");
7
+ /*
8
+ Copyright 2019 Adobe. All rights reserved.
9
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
+ you may not use this file except in compliance with the License. You may obtain a copy
11
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software distributed under
14
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
+ OF ANY KIND, either express or implied. See the License for the specific language
16
+ governing permissions and limitations under the License.
17
+ */
18
+
19
+ var createAudiences = function createAudiences(_ref) {
20
+ var logger = _ref.logger,
21
+ fireReferrerHideableImage = _ref.fireReferrerHideableImage;
22
+ // we override the js-cookie converter to encode the cookie value similar on how it is in DIL (PDCL-10238)
23
+ var cookieJarWithEncoding = _index.cookieJar.withConverter({
24
+ write: function write(value) {
25
+ return encodeURIComponent(value);
26
+ }
27
+ });
28
+ var loggingCookieJar = (0, _index.createLoggingCookieJar)({
29
+ logger: logger,
30
+ cookieJar: cookieJarWithEncoding
31
+ });
32
+ var processDestinations = (0, _injectProcessDestinations.default)({
33
+ fireReferrerHideableImage: fireReferrerHideableImage,
34
+ logger: logger,
35
+ cookieJar: loggingCookieJar,
36
+ isPageSsl: window.location.protocol === "https:"
37
+ });
38
+ var processResponse = (0, _injectProcessResponse.default)({
39
+ processDestinations: processDestinations
40
+ });
41
+ return {
42
+ lifecycle: {
43
+ onResponse: processResponse
44
+ },
45
+ commands: {}
46
+ };
47
+ };
48
+ createAudiences.namespace = "Audiences";
49
+ var _default = exports.default = createAudiences;