@adobe/alloy 2.20.0-beta.2 → 2.20.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libEs5/baseCode/index.js +61 -0
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +53 -0
- package/libEs5/components/ActivityCollector/configValidators.js +22 -0
- package/libEs5/components/ActivityCollector/createGetLinkDetails.js +68 -0
- package/libEs5/components/ActivityCollector/createLinkClick.js +38 -0
- package/libEs5/components/ActivityCollector/getLinkName.js +139 -0
- package/libEs5/components/ActivityCollector/getLinkRegion.js +61 -0
- package/libEs5/components/ActivityCollector/index.js +78 -0
- package/libEs5/components/ActivityCollector/utils.js +104 -0
- package/libEs5/components/Audiences/index.js +49 -0
- package/libEs5/components/Audiences/injectProcessDestinations.js +67 -0
- package/libEs5/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs5/components/Context/createComponent.js +39 -0
- package/libEs5/components/Context/implementationDetails.js +27 -0
- package/libEs5/components/Context/index.js +59 -0
- package/libEs5/components/Context/injectDevice.js +66 -0
- package/libEs5/components/Context/injectEnvironment.js +40 -0
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +58 -0
- package/libEs5/components/Context/injectPlaceContext.js +32 -0
- package/libEs5/components/Context/injectTimestamp.js +23 -0
- package/libEs5/components/Context/injectWeb.js +30 -0
- package/libEs5/components/DataCollector/index.js +110 -0
- package/libEs5/components/DataCollector/validateApplyResponse.js +35 -0
- package/libEs5/components/DataCollector/validateUserEventOptions.js +50 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +31 -0
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs5/components/DecisioningEngine/constants.js +28 -0
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +35 -0
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +30 -0
- package/libEs5/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +27 -0
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +50 -0
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +82 -0
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +48 -0
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +130 -0
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +48 -0
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +89 -0
- package/libEs5/components/DecisioningEngine/index.js +119 -0
- package/libEs5/components/DecisioningEngine/utils.js +82 -0
- package/libEs5/components/EventMerge/createComponent.js +24 -0
- package/libEs5/components/EventMerge/createEventMergeId.js +20 -0
- package/libEs5/components/EventMerge/index.js +24 -0
- package/libEs5/components/Identity/addEcidQueryToPayload.js +22 -0
- package/libEs5/components/Identity/addEcidToPayload.js +20 -0
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +25 -0
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +45 -0
- package/libEs5/components/Identity/configValidators.js +21 -0
- package/libEs5/components/Identity/constants/authState.js +18 -0
- package/libEs5/components/Identity/constants/defaultIdSyncTtlMinutes.js +15 -0
- package/libEs5/components/Identity/createComponent.js +97 -0
- package/libEs5/components/Identity/createLegacyIdentity.js +72 -0
- package/libEs5/components/Identity/getEcidFromResponse.js +23 -0
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +35 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +29 -0
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +29 -0
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +27 -0
- package/libEs5/components/Identity/index.js +129 -0
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +31 -0
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +68 -0
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +100 -0
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +20 -0
- package/libEs5/components/Identity/injectProcessIdSyncs.js +41 -0
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +33 -0
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +34 -0
- package/libEs5/components/Identity/visitorService/getVisitor.js +19 -0
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +144 -0
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +49 -0
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +245 -0
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +87 -0
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +181 -0
- package/libEs5/components/LegacyMediaAnalytics/index.js +71 -0
- package/libEs5/components/LibraryInfo/index.js +68 -0
- package/libEs5/components/MachineLearning/index.js +26 -0
- package/libEs5/components/MachineLearning/processResponse.js +19 -0
- package/libEs5/components/Personalization/constants/loggerMessage.js +16 -0
- package/libEs5/components/Personalization/constants/scopeType.js +18 -0
- package/libEs5/components/Personalization/constants/surface.js +19 -0
- package/libEs5/components/Personalization/createActionsProvider.js +71 -0
- package/libEs5/components/Personalization/createApplyPropositions.js +115 -0
- package/libEs5/components/Personalization/createClickStorage.js +64 -0
- package/libEs5/components/Personalization/createCollect.js +53 -0
- package/libEs5/components/Personalization/createComponent.js +145 -0
- package/libEs5/components/Personalization/createFetchDataHandler.js +92 -0
- package/libEs5/components/Personalization/createGetPageLocation.js +20 -0
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +29 -0
- package/libEs5/components/Personalization/createNotificationHandler.js +38 -0
- package/libEs5/components/Personalization/createOnClickHandler.js +51 -0
- package/libEs5/components/Personalization/createOnDecisionHandler.js +43 -0
- package/libEs5/components/Personalization/createPersonalizationDetails.js +104 -0
- package/libEs5/components/Personalization/createPreprocessors.js +23 -0
- package/libEs5/components/Personalization/createSetTargetMigration.js +28 -0
- package/libEs5/components/Personalization/createViewCacheManager.js +90 -0
- package/libEs5/components/Personalization/createViewChangeHandler.js +45 -0
- package/libEs5/components/Personalization/dom-actions/action.js +120 -0
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +41 -0
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +32 -0
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +108 -0
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +25 -0
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +27 -0
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +21 -0
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +35 -0
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/index.js +100 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +25 -0
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +24 -0
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +104 -0
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +17 -0
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +23 -0
- package/libEs5/components/Personalization/dom-actions/images.js +36 -0
- package/libEs5/components/Personalization/dom-actions/index.js +9 -0
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +35 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +31 -0
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +31 -0
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +32 -0
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +36 -0
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +54 -0
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +20 -0
- package/libEs5/components/Personalization/dom-actions/scripts.js +90 -0
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +20 -0
- package/libEs5/components/Personalization/dom-actions/setHtml.js +27 -0
- package/libEs5/components/Personalization/dom-actions/setStyles.js +25 -0
- package/libEs5/components/Personalization/dom-actions/setText.js +17 -0
- package/libEs5/components/Personalization/dom-actions/swapImage.js +31 -0
- package/libEs5/components/Personalization/event.js +49 -0
- package/libEs5/components/Personalization/flicker/index.js +86 -0
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +71 -0
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +43 -0
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +78 -0
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +194 -0
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +44 -0
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +118 -0
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +20 -0
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +286 -0
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +22 -0
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +51 -0
- package/libEs5/components/Personalization/index.js +162 -0
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +24 -0
- package/libEs5/components/Personalization/utils/createAsyncArray.js +38 -0
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +18 -0
- package/libEs5/components/Personalization/utils/surfaceUtils.js +101 -0
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +34 -0
- package/libEs5/components/Privacy/computeConsentHash.js +33 -0
- package/libEs5/components/Privacy/createComponent.js +88 -0
- package/libEs5/components/Privacy/createConsentHashStore.js +59 -0
- package/libEs5/components/Privacy/createConsentRequest.js +29 -0
- package/libEs5/components/Privacy/createConsentRequestPayload.js +33 -0
- package/libEs5/components/Privacy/createStoredConsent.js +31 -0
- package/libEs5/components/Privacy/index.js +63 -0
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +47 -0
- package/libEs5/components/Privacy/parseConsentCookie.js +37 -0
- package/libEs5/components/Privacy/validateSetConsentOptions.js +21 -0
- package/libEs5/components/StreamingMedia/configValidators.js +24 -0
- package/libEs5/components/StreamingMedia/constants/eventTypes.js +34 -0
- package/libEs5/components/StreamingMedia/constants/playbackState.js +19 -0
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +112 -0
- package/libEs5/components/StreamingMedia/createMediaRequest.js +29 -0
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +57 -0
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +58 -0
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +72 -0
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +90 -0
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +52 -0
- package/libEs5/components/StreamingMedia/index.js +69 -0
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +40 -0
- package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +35 -0
- package/libEs5/constants/apiVersion.js +15 -0
- package/libEs5/constants/browser.js +22 -0
- package/libEs5/constants/consentPurpose.js +16 -0
- package/libEs5/constants/consentStatus.js +18 -0
- package/libEs5/constants/contentType.js +16 -0
- package/libEs5/constants/cookieNameKey.js +18 -0
- package/libEs5/constants/cookieNamePrefix.js +16 -0
- package/libEs5/constants/coreCommands.js +17 -0
- package/libEs5/constants/debugQueryParam.js +15 -0
- package/libEs5/constants/decisionProvider.js +15 -0
- package/libEs5/constants/domain.js +17 -0
- package/libEs5/constants/ecidNamespace.js +15 -0
- package/libEs5/constants/edgeBasePath.js +15 -0
- package/libEs5/constants/elementAttribute.js +16 -0
- package/libEs5/constants/eventType.js +20 -0
- package/libEs5/constants/handle.js +15 -0
- package/libEs5/constants/highEntropyUserAgentClientHints.js +15 -0
- package/libEs5/constants/httpHeaderNames.js +17 -0
- package/libEs5/constants/httpStatusCode.js +20 -0
- package/libEs5/constants/identityMapAuthenticatedState.js +17 -0
- package/libEs5/constants/legacyCookies.js +18 -0
- package/libEs5/constants/libraryName.js +15 -0
- package/libEs5/constants/libraryVersion.js +17 -0
- package/libEs5/constants/namespace.js +15 -0
- package/libEs5/constants/pageWideScope.js +15 -0
- package/libEs5/constants/propositionEventType.js +32 -0
- package/libEs5/constants/queryStringIdentityParam.js +15 -0
- package/libEs5/constants/schema.js +25 -0
- package/libEs5/constants/shadowSeparator.js +15 -0
- package/libEs5/constants/tagName.js +22 -0
- package/libEs5/core/buildAndValidateConfig.js +115 -0
- package/libEs5/core/componentCreators.js +39 -0
- package/libEs5/core/config/createConfig.js +20 -0
- package/libEs5/core/config/createCoreConfigs.js +31 -0
- package/libEs5/core/consent/createConsent.js +61 -0
- package/libEs5/core/consent/createConsentStateMachine.js +137 -0
- package/libEs5/core/createComponentRegistry.js +86 -0
- package/libEs5/core/createCookieTransfer.js +80 -0
- package/libEs5/core/createEvent.js +170 -0
- package/libEs5/core/createEventManager.js +144 -0
- package/libEs5/core/createInstanceFunction.js +27 -0
- package/libEs5/core/createLifecycle.js +74 -0
- package/libEs5/core/createLogController.js +70 -0
- package/libEs5/core/createLogger.js +103 -0
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +27 -0
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +66 -0
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +42 -0
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +35 -0
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +99 -0
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +28 -0
- package/libEs5/core/index.js +238 -0
- package/libEs5/core/initializeComponents.js +41 -0
- package/libEs5/core/injectCreateResponse.js +77 -0
- package/libEs5/core/injectExecuteCommand.js +104 -0
- package/libEs5/core/injectHandleError.js +36 -0
- package/libEs5/core/injectShouldTransferCookie.js +28 -0
- package/libEs5/core/network/getRequestRetryDelay.js +73 -0
- package/libEs5/core/network/injectSendNetworkRequest.js +102 -0
- package/libEs5/core/network/isRequestRetryable.js +27 -0
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +39 -0
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +44 -0
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +50 -0
- package/libEs5/core/validateCommandOptions.js +34 -0
- package/libEs5/index.js +59 -0
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +24 -0
- package/libEs5/utils/assign.js +16 -0
- package/libEs5/utils/assignConcatArrayValues.js +48 -0
- package/libEs5/utils/assignIf.js +21 -0
- package/libEs5/utils/clone.js +22 -0
- package/libEs5/utils/cookieJar.js +21 -0
- package/libEs5/utils/crc32.js +36 -0
- package/libEs5/utils/createCallbackAggregator.js +38 -0
- package/libEs5/utils/createLoggingCookieJar.js +33 -0
- package/libEs5/utils/createMerger.js +33 -0
- package/libEs5/utils/createSubscription.js +90 -0
- package/libEs5/utils/createTaskQueue.js +50 -0
- package/libEs5/utils/deduplicateArray.js +31 -0
- package/libEs5/utils/deepAssign.js +48 -0
- package/libEs5/utils/defer.js +26 -0
- package/libEs5/utils/dom/appendNode.js +17 -0
- package/libEs5/utils/dom/awaitSelector.js +105 -0
- package/libEs5/utils/dom/createNode.js +47 -0
- package/libEs5/utils/dom/index.js +58 -0
- package/libEs5/utils/dom/isShadowSelector.js +18 -0
- package/libEs5/utils/dom/matchesSelector.js +28 -0
- package/libEs5/utils/dom/querySelectorAll.js +32 -0
- package/libEs5/utils/dom/removeNode.js +21 -0
- package/libEs5/utils/dom/selectNodes.js +30 -0
- package/libEs5/utils/dom/selectNodesWithShadow.js +66 -0
- package/libEs5/utils/endsWith.js +23 -0
- package/libEs5/utils/filterObject.js +55 -0
- package/libEs5/utils/find.js +30 -0
- package/libEs5/utils/fireImage.js +38 -0
- package/libEs5/utils/flatMap.js +17 -0
- package/libEs5/utils/flattenArray.js +36 -0
- package/libEs5/utils/flattenObject.js +42 -0
- package/libEs5/utils/getApexDomain.js +45 -0
- package/libEs5/utils/getBrowser.js +35 -0
- package/libEs5/utils/getLastArrayItems.js +23 -0
- package/libEs5/utils/getNamespacedCookieName.js +19 -0
- package/libEs5/utils/groupBy.js +31 -0
- package/libEs5/utils/includes.js +23 -0
- package/libEs5/utils/index.js +408 -0
- package/libEs5/utils/injectDoesIdentityCookieExist.js +27 -0
- package/libEs5/utils/injectFireReferrerHideableImage.js +75 -0
- package/libEs5/utils/injectStorage.js +74 -0
- package/libEs5/utils/intersection.js +26 -0
- package/libEs5/utils/isBlankString.js +23 -0
- package/libEs5/utils/isBoolean.js +22 -0
- package/libEs5/utils/isEmptyObject.js +23 -0
- package/libEs5/utils/isFunction.js +22 -0
- package/libEs5/utils/isInteger.js +24 -0
- package/libEs5/utils/isNamespacedCookieName.js +26 -0
- package/libEs5/utils/isNil.js +22 -0
- package/libEs5/utils/isNonEmptyArray.js +22 -0
- package/libEs5/utils/isNonEmptyString.js +23 -0
- package/libEs5/utils/isNumber.js +23 -0
- package/libEs5/utils/isObject.js +23 -0
- package/libEs5/utils/isString.js +22 -0
- package/libEs5/utils/isUnique.js +30 -0
- package/libEs5/utils/isValidRegExp.js +26 -0
- package/libEs5/utils/memoize.js +36 -0
- package/libEs5/utils/noop.js +18 -0
- package/libEs5/utils/padStart.js +27 -0
- package/libEs5/utils/parseUrl.js +72 -0
- package/libEs5/utils/prepareConfigOverridesForEdge.js +52 -0
- package/libEs5/utils/querystring.js +16 -0
- package/libEs5/utils/request/createAddIdentity.js +22 -0
- package/libEs5/utils/request/createDataCollectionRequest.js +68 -0
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +35 -0
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +44 -0
- package/libEs5/utils/request/createHasIdentity.js +19 -0
- package/libEs5/utils/request/createRequest.js +62 -0
- package/libEs5/utils/request/createRequestParams.js +44 -0
- package/libEs5/utils/request/createRequestPayload.js +36 -0
- package/libEs5/utils/request/index.js +58 -0
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +17 -0
- package/libEs5/utils/stackError.js +34 -0
- package/libEs5/utils/startsWith.js +23 -0
- package/libEs5/utils/stringToBoolean.js +18 -0
- package/libEs5/utils/toArray.js +23 -0
- package/libEs5/utils/toError.js +23 -0
- package/libEs5/utils/toISOStringLocal.js +39 -0
- package/libEs5/utils/toInteger.js +31 -0
- package/libEs5/utils/updateErrorMessage.js +24 -0
- package/libEs5/utils/uuid.js +16 -0
- package/libEs5/utils/validateConfigOverride.js +16 -0
- package/libEs5/utils/validateIdentityMap.js +25 -0
- package/libEs5/utils/validation/booleanValidator.js +20 -0
- package/libEs5/utils/validation/callbackValidator.js +20 -0
- package/libEs5/utils/validation/createAnyOfValidator.js +32 -0
- package/libEs5/utils/validation/createArrayOfValidator.js +34 -0
- package/libEs5/utils/validation/createDefaultValidator.js +22 -0
- package/libEs5/utils/validation/createDeprecatedValidator.js +44 -0
- package/libEs5/utils/validation/createLiteralValidator.js +21 -0
- package/libEs5/utils/validation/createMapOfValuesValidator.js +40 -0
- package/libEs5/utils/validation/createMaximumValidator.js +21 -0
- package/libEs5/utils/validation/createMinimumValidator.js +21 -0
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +29 -0
- package/libEs5/utils/validation/createNonEmptyValidator.js +27 -0
- package/libEs5/utils/validation/createObjectOfValidator.js +48 -0
- package/libEs5/utils/validation/createUniqueItemsValidator.js +21 -0
- package/libEs5/utils/validation/createUniqueValidator.js +23 -0
- package/libEs5/utils/validation/domainValidator.js +21 -0
- package/libEs5/utils/validation/index.js +239 -0
- package/libEs5/utils/validation/integerValidator.js +20 -0
- package/libEs5/utils/validation/matchesRegexpValidator.js +21 -0
- package/libEs5/utils/validation/numberValidator.js +20 -0
- package/libEs5/utils/validation/regexpValidator.js +20 -0
- package/libEs5/utils/validation/requiredValidator.js +20 -0
- package/libEs5/utils/validation/stringValidator.js +20 -0
- package/libEs5/utils/validation/utils.js +137 -0
- package/libEs5/utils/values.js +25 -0
- package/libEs6/baseCode/index.js +61 -0
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +52 -0
- package/libEs6/components/ActivityCollector/configValidators.js +19 -0
- package/libEs6/components/ActivityCollector/createGetLinkDetails.js +70 -0
- package/libEs6/components/ActivityCollector/createLinkClick.js +37 -0
- package/libEs6/components/ActivityCollector/getLinkName.js +136 -0
- package/libEs6/components/ActivityCollector/getLinkRegion.js +58 -0
- package/libEs6/components/ActivityCollector/index.js +80 -0
- package/libEs6/components/ActivityCollector/utils.js +104 -0
- package/libEs6/components/Audiences/index.js +47 -0
- package/libEs6/components/Audiences/injectProcessDestinations.js +60 -0
- package/libEs6/components/Audiences/injectProcessResponse.js +38 -0
- package/libEs6/components/Context/createComponent.js +34 -0
- package/libEs6/components/Context/implementationDetails.js +24 -0
- package/libEs6/components/Context/index.js +52 -0
- package/libEs6/components/Context/injectDevice.js +70 -0
- package/libEs6/components/Context/injectEnvironment.js +42 -0
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +45 -0
- package/libEs6/components/Context/injectPlaceContext.js +29 -0
- package/libEs6/components/Context/injectTimestamp.js +21 -0
- package/libEs6/components/Context/injectWeb.js +28 -0
- package/libEs6/components/DataCollector/index.js +106 -0
- package/libEs6/components/DataCollector/validateApplyResponse.js +33 -0
- package/libEs6/components/DataCollector/validateUserEventOptions.js +49 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +30 -0
- package/libEs6/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +24 -0
- package/libEs6/components/DecisioningEngine/constants.js +25 -0
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +31 -0
- package/libEs6/components/DecisioningEngine/createConsequenceAdapter.js +29 -0
- package/libEs6/components/DecisioningEngine/createContextProvider.js +95 -0
- package/libEs6/components/DecisioningEngine/createDecisionHistory.js +25 -0
- package/libEs6/components/DecisioningEngine/createDecisionProvider.js +41 -0
- package/libEs6/components/DecisioningEngine/createEvaluableRulesetPayload.js +79 -0
- package/libEs6/components/DecisioningEngine/createEvaluateRulesetsCommand.js +45 -0
- package/libEs6/components/DecisioningEngine/createEventRegistry.js +120 -0
- package/libEs6/components/DecisioningEngine/createOnResponseHandler.js +45 -0
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +79 -0
- package/libEs6/components/DecisioningEngine/index.js +124 -0
- package/libEs6/components/DecisioningEngine/utils.js +83 -0
- package/libEs6/components/EventMerge/createComponent.js +23 -0
- package/libEs6/components/EventMerge/createEventMergeId.js +18 -0
- package/libEs6/components/EventMerge/index.js +21 -0
- package/libEs6/components/Identity/addEcidQueryToPayload.js +20 -0
- package/libEs6/components/Identity/addEcidToPayload.js +18 -0
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +23 -0
- package/libEs6/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +31 -0
- package/libEs6/components/Identity/configValidators.js +18 -0
- package/libEs6/components/Identity/constants/authState.js +15 -0
- package/libEs6/components/Identity/constants/defaultIdSyncTtlMinutes.js +13 -0
- package/libEs6/components/Identity/createComponent.js +97 -0
- package/libEs6/components/Identity/createLegacyIdentity.js +69 -0
- package/libEs6/components/Identity/getEcidFromResponse.js +19 -0
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +34 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +28 -0
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +27 -0
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +25 -0
- package/libEs6/components/Identity/index.js +125 -0
- package/libEs6/components/Identity/injectAddLegacyEcidToPayload.js +30 -0
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +59 -0
- package/libEs6/components/Identity/injectAwaitIdentityCookie.js +52 -0
- package/libEs6/components/Identity/injectEnsureSingleIdentity.js +98 -0
- package/libEs6/components/Identity/injectHandleResponseForIdSyncs.js +19 -0
- package/libEs6/components/Identity/injectProcessIdSyncs.js +34 -0
- package/libEs6/components/Identity/injectSetDomainForInitialIdentityPayload.js +32 -0
- package/libEs6/components/Identity/visitorService/awaitVisitorOptIn.js +33 -0
- package/libEs6/components/Identity/visitorService/getVisitor.js +17 -0
- package/libEs6/components/Identity/visitorService/injectGetEcidFromVisitor.js +48 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/constants.js +141 -0
- package/libEs6/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +46 -0
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +239 -0
- package/libEs6/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +85 -0
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +180 -0
- package/libEs6/components/LegacyMediaAnalytics/index.js +67 -0
- package/libEs6/components/LibraryInfo/index.js +59 -0
- package/libEs6/components/MachineLearning/index.js +23 -0
- package/libEs6/components/MachineLearning/processResponse.js +18 -0
- package/libEs6/components/Personalization/constants/loggerMessage.js +13 -0
- package/libEs6/components/Personalization/constants/scopeType.js +15 -0
- package/libEs6/components/Personalization/constants/surface.js +16 -0
- package/libEs6/components/Personalization/createActionsProvider.js +70 -0
- package/libEs6/components/Personalization/createApplyPropositions.js +103 -0
- package/libEs6/components/Personalization/createClickStorage.js +58 -0
- package/libEs6/components/Personalization/createCollect.js +48 -0
- package/libEs6/components/Personalization/createComponent.js +133 -0
- package/libEs6/components/Personalization/createFetchDataHandler.js +84 -0
- package/libEs6/components/Personalization/createGetPageLocation.js +17 -0
- package/libEs6/components/Personalization/createHandleConsentFlicker.js +26 -0
- package/libEs6/components/Personalization/createNotificationHandler.js +33 -0
- package/libEs6/components/Personalization/createOnClickHandler.js +52 -0
- package/libEs6/components/Personalization/createOnDecisionHandler.js +42 -0
- package/libEs6/components/Personalization/createPersonalizationDetails.js +94 -0
- package/libEs6/components/Personalization/createPreprocessors.js +19 -0
- package/libEs6/components/Personalization/createSetTargetMigration.js +27 -0
- package/libEs6/components/Personalization/createViewCacheManager.js +81 -0
- package/libEs6/components/Personalization/createViewChangeHandler.js +47 -0
- package/libEs6/components/Personalization/dom-actions/action.js +49 -0
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +36 -0
- package/libEs6/components/Personalization/dom-actions/appendHtml.js +30 -0
- package/libEs6/components/Personalization/dom-actions/clicks/collectClicks.js +91 -0
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +18 -0
- package/libEs6/components/Personalization/dom-actions/createRedirect.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/createFragment.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildNodes.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getChildren.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/getElementById.js +21 -0
- package/libEs6/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/getNonce.js +33 -0
- package/libEs6/components/Personalization/dom-actions/dom/getParent.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/helperForEq.js +19 -0
- package/libEs6/components/Personalization/dom-actions/dom/index.js +26 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertAfter.js +23 -0
- package/libEs6/components/Personalization/dom-actions/dom/insertBefore.js +22 -0
- package/libEs6/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +35 -0
- package/libEs6/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +102 -0
- package/libEs6/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
- package/libEs6/components/Personalization/dom-actions/dom/setStyle.js +21 -0
- package/libEs6/components/Personalization/dom-actions/images.js +31 -0
- package/libEs6/components/Personalization/dom-actions/index.js +13 -0
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +33 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlAfter.js +29 -0
- package/libEs6/components/Personalization/dom-actions/insertHtmlBefore.js +29 -0
- package/libEs6/components/Personalization/dom-actions/prependHtml.js +45 -0
- package/libEs6/components/Personalization/dom-actions/rearrangeChildren.js +31 -0
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +34 -0
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +51 -0
- package/libEs6/components/Personalization/dom-actions/replaceHtml.js +18 -0
- package/libEs6/components/Personalization/dom-actions/scripts.js +85 -0
- package/libEs6/components/Personalization/dom-actions/setAttributes.js +18 -0
- package/libEs6/components/Personalization/dom-actions/setHtml.js +24 -0
- package/libEs6/components/Personalization/dom-actions/setStyles.js +22 -0
- package/libEs6/components/Personalization/dom-actions/setText.js +15 -0
- package/libEs6/components/Personalization/dom-actions/swapImage.js +29 -0
- package/libEs6/components/Personalization/event.js +45 -0
- package/libEs6/components/Personalization/flicker/index.js +82 -0
- package/libEs6/components/Personalization/handlers/createProcessDomAction.js +61 -0
- package/libEs6/components/Personalization/handlers/createProcessHtmlContent.js +40 -0
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +77 -0
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +175 -0
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +41 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +110 -0
- package/libEs6/components/Personalization/handlers/processDefaultContent.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +293 -0
- package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +17 -0
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +49 -0
- package/libEs6/components/Personalization/index.js +167 -0
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +21 -0
- package/libEs6/components/Personalization/utils/createAsyncArray.js +35 -0
- package/libEs6/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
- package/libEs6/components/Personalization/utils/surfaceUtils.js +76 -0
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +31 -0
- package/libEs6/components/Privacy/computeConsentHash.js +30 -0
- package/libEs6/components/Privacy/createComponent.js +85 -0
- package/libEs6/components/Privacy/createConsentHashStore.js +57 -0
- package/libEs6/components/Privacy/createConsentRequest.js +28 -0
- package/libEs6/components/Privacy/createConsentRequestPayload.js +31 -0
- package/libEs6/components/Privacy/createStoredConsent.js +30 -0
- package/libEs6/components/Privacy/index.js +63 -0
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +45 -0
- package/libEs6/components/Privacy/parseConsentCookie.js +26 -0
- package/libEs6/components/Privacy/validateSetConsentOptions.js +18 -0
- package/libEs6/components/StreamingMedia/configValidators.js +22 -0
- package/libEs6/components/StreamingMedia/constants/eventTypes.js +31 -0
- package/libEs6/components/StreamingMedia/constants/playbackState.js +16 -0
- package/libEs6/components/StreamingMedia/createMediaEventManager.js +122 -0
- package/libEs6/components/StreamingMedia/createMediaRequest.js +28 -0
- package/libEs6/components/StreamingMedia/createMediaResponseHandler.js +58 -0
- package/libEs6/components/StreamingMedia/createMediaSessionCacheManager.js +59 -0
- package/libEs6/components/StreamingMedia/createStreamingMediaComponent.js +69 -0
- package/libEs6/components/StreamingMedia/createTrackMediaEvent.js +88 -0
- package/libEs6/components/StreamingMedia/createTrackMediaSession.js +51 -0
- package/libEs6/components/StreamingMedia/index.js +64 -0
- package/libEs6/components/StreamingMedia/validateMediaEventOptions.js +33 -0
- package/libEs6/components/StreamingMedia/validateMediaSessionOptions.js +34 -0
- package/libEs6/constants/apiVersion.js +12 -0
- package/libEs6/constants/browser.js +19 -0
- package/libEs6/constants/consentPurpose.js +13 -0
- package/libEs6/constants/consentStatus.js +15 -0
- package/libEs6/constants/contentType.js +13 -0
- package/libEs6/constants/cookieNameKey.js +15 -0
- package/libEs6/constants/cookieNamePrefix.js +14 -0
- package/libEs6/constants/coreCommands.js +14 -0
- package/libEs6/constants/debugQueryParam.js +13 -0
- package/libEs6/constants/decisionProvider.js +12 -0
- package/libEs6/constants/domain.js +14 -0
- package/libEs6/constants/ecidNamespace.js +13 -0
- package/libEs6/constants/edgeBasePath.js +12 -0
- package/libEs6/constants/elementAttribute.js +13 -0
- package/libEs6/constants/eventType.js +17 -0
- package/libEs6/constants/handle.js +12 -0
- package/libEs6/constants/highEntropyUserAgentClientHints.js +13 -0
- package/libEs6/constants/httpHeaderNames.js +14 -0
- package/libEs6/constants/httpStatusCode.js +17 -0
- package/libEs6/constants/identityMapAuthenticatedState.js +14 -0
- package/libEs6/constants/legacyCookies.js +15 -0
- package/libEs6/constants/libraryName.js +13 -0
- package/libEs6/constants/libraryVersion.js +16 -0
- package/libEs6/constants/namespace.js +13 -0
- package/libEs6/constants/pageWideScope.js +13 -0
- package/libEs6/constants/propositionEventType.js +33 -0
- package/libEs6/constants/queryStringIdentityParam.js +13 -0
- package/libEs6/constants/schema.js +22 -0
- package/libEs6/constants/shadowSeparator.js +13 -0
- package/libEs6/constants/tagName.js +19 -0
- package/libEs6/core/buildAndValidateConfig.js +94 -0
- package/libEs6/core/componentCreators.js +47 -0
- package/libEs6/core/config/createConfig.js +17 -0
- package/libEs6/core/config/createCoreConfigs.js +27 -0
- package/libEs6/core/consent/createConsent.js +60 -0
- package/libEs6/core/consent/createConsentStateMachine.js +125 -0
- package/libEs6/core/createComponentRegistry.js +83 -0
- package/libEs6/core/createCookieTransfer.js +78 -0
- package/libEs6/core/createEvent.js +161 -0
- package/libEs6/core/createEventManager.js +135 -0
- package/libEs6/core/createInstanceFunction.js +25 -0
- package/libEs6/core/createLifecycle.js +65 -0
- package/libEs6/core/createLogController.js +68 -0
- package/libEs6/core/createLogger.js +99 -0
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +24 -0
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +58 -0
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +39 -0
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +32 -0
- package/libEs6/core/edgeNetwork/injectProcessWarningsAndErrors.js +42 -0
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +100 -0
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +21 -0
- package/libEs6/core/index.js +236 -0
- package/libEs6/core/initializeComponents.js +40 -0
- package/libEs6/core/injectCreateResponse.js +70 -0
- package/libEs6/core/injectExecuteCommand.js +100 -0
- package/libEs6/core/injectHandleError.js +33 -0
- package/libEs6/core/injectShouldTransferCookie.js +25 -0
- package/libEs6/core/network/getRequestRetryDelay.js +72 -0
- package/libEs6/core/network/injectSendNetworkRequest.js +96 -0
- package/libEs6/core/network/isRequestRetryable.js +25 -0
- package/libEs6/core/network/requestMethods/injectSendBeaconRequest.js +38 -0
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +41 -0
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +49 -0
- package/libEs6/core/validateCommandOptions.js +33 -0
- package/libEs6/index.js +55 -0
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +20 -0
- package/libEs6/utils/assign.js +14 -0
- package/libEs6/utils/assignConcatArrayValues.js +36 -0
- package/libEs6/utils/assignIf.js +19 -0
- package/libEs6/utils/clone.js +18 -0
- package/libEs6/utils/cookieJar.js +19 -0
- package/libEs6/utils/crc32.js +33 -0
- package/libEs6/utils/createCallbackAggregator.js +31 -0
- package/libEs6/utils/createLoggingCookieJar.js +28 -0
- package/libEs6/utils/createMerger.js +30 -0
- package/libEs6/utils/createSubscription.js +70 -0
- package/libEs6/utils/createTaskQueue.js +48 -0
- package/libEs6/utils/deduplicateArray.js +23 -0
- package/libEs6/utils/deepAssign.js +40 -0
- package/libEs6/utils/defer.js +24 -0
- package/libEs6/utils/dom/appendNode.js +15 -0
- package/libEs6/utils/dom/awaitSelector.js +98 -0
- package/libEs6/utils/dom/createNode.js +38 -0
- package/libEs6/utils/dom/index.js +20 -0
- package/libEs6/utils/dom/isShadowSelector.js +14 -0
- package/libEs6/utils/dom/matchesSelector.js +26 -0
- package/libEs6/utils/dom/querySelectorAll.js +29 -0
- package/libEs6/utils/dom/removeNode.js +19 -0
- package/libEs6/utils/dom/selectNodes.js +28 -0
- package/libEs6/utils/dom/selectNodesWithShadow.js +63 -0
- package/libEs6/utils/endsWith.js +19 -0
- package/libEs6/utils/filterObject.js +55 -0
- package/libEs6/utils/find.js +28 -0
- package/libEs6/utils/fireImage.js +37 -0
- package/libEs6/utils/flatMap.js +14 -0
- package/libEs6/utils/flattenArray.js +26 -0
- package/libEs6/utils/flattenObject.js +28 -0
- package/libEs6/utils/getApexDomain.js +42 -0
- package/libEs6/utils/getBrowser.js +65 -0
- package/libEs6/utils/getLastArrayItems.js +19 -0
- package/libEs6/utils/getNamespacedCookieName.js +15 -0
- package/libEs6/utils/groupBy.js +29 -0
- package/libEs6/utils/includes.js +21 -0
- package/libEs6/utils/index.js +71 -0
- package/libEs6/utils/injectDoesIdentityCookieExist.js +24 -0
- package/libEs6/utils/injectFireReferrerHideableImage.js +65 -0
- package/libEs6/utils/injectStorage.js +69 -0
- package/libEs6/utils/intersection.js +21 -0
- package/libEs6/utils/isBlankString.js +20 -0
- package/libEs6/utils/isBoolean.js +18 -0
- package/libEs6/utils/isEmptyObject.js +20 -0
- package/libEs6/utils/isFunction.js +18 -0
- package/libEs6/utils/isInteger.js +23 -0
- package/libEs6/utils/isNamespacedCookieName.js +23 -0
- package/libEs6/utils/isNil.js +18 -0
- package/libEs6/utils/isNonEmptyArray.js +18 -0
- package/libEs6/utils/isNonEmptyString.js +20 -0
- package/libEs6/utils/isNumber.js +19 -0
- package/libEs6/utils/isObject.js +20 -0
- package/libEs6/utils/isString.js +18 -0
- package/libEs6/utils/isUnique.js +27 -0
- package/libEs6/utils/isValidRegExp.js +24 -0
- package/libEs6/utils/memoize.js +34 -0
- package/libEs6/utils/noop.js +16 -0
- package/libEs6/utils/padStart.js +25 -0
- package/libEs6/utils/parseUrl.js +62 -0
- package/libEs6/utils/prepareConfigOverridesForEdge.js +50 -0
- package/libEs6/utils/querystring.js +14 -0
- package/libEs6/utils/request/createAddIdentity.js +19 -0
- package/libEs6/utils/request/createDataCollectionRequest.js +69 -0
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +30 -0
- package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +42 -0
- package/libEs6/utils/request/createHasIdentity.js +15 -0
- package/libEs6/utils/request/createRequest.js +63 -0
- package/libEs6/utils/request/createRequestParams.js +40 -0
- package/libEs6/utils/request/createRequestPayload.js +35 -0
- package/libEs6/utils/request/index.js +20 -0
- package/libEs6/utils/sanitizeOrgIdForCookieName.js +13 -0
- package/libEs6/utils/stackError.js +34 -0
- package/libEs6/utils/startsWith.js +19 -0
- package/libEs6/utils/stringToBoolean.js +15 -0
- package/libEs6/utils/toArray.js +21 -0
- package/libEs6/utils/toError.js +21 -0
- package/libEs6/utils/toISOStringLocal.js +37 -0
- package/libEs6/utils/toInteger.js +30 -0
- package/libEs6/utils/updateErrorMessage.js +23 -0
- package/libEs6/utils/uuid.js +14 -0
- package/libEs6/utils/validateConfigOverride.js +14 -0
- package/libEs6/utils/validateIdentityMap.js +23 -0
- package/libEs6/utils/validation/booleanValidator.js +18 -0
- package/libEs6/utils/validation/callbackValidator.js +17 -0
- package/libEs6/utils/validation/createAnyOfValidator.js +26 -0
- package/libEs6/utils/validation/createArrayOfValidator.js +28 -0
- package/libEs6/utils/validation/createDefaultValidator.js +18 -0
- package/libEs6/utils/validation/createDeprecatedValidator.js +37 -0
- package/libEs6/utils/validation/createLiteralValidator.js +16 -0
- package/libEs6/utils/validation/createMapOfValuesValidator.js +35 -0
- package/libEs6/utils/validation/createMaximumValidator.js +16 -0
- package/libEs6/utils/validation/createMinimumValidator.js +16 -0
- package/libEs6/utils/validation/createNoUnknownFieldsValidator.js +25 -0
- package/libEs6/utils/validation/createNonEmptyValidator.js +23 -0
- package/libEs6/utils/validation/createObjectOfValidator.js +43 -0
- package/libEs6/utils/validation/createUniqueItemsValidator.js +18 -0
- package/libEs6/utils/validation/createUniqueValidator.js +21 -0
- package/libEs6/utils/validation/domainValidator.js +17 -0
- package/libEs6/utils/validation/index.js +232 -0
- package/libEs6/utils/validation/integerValidator.js +18 -0
- package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
- package/libEs6/utils/validation/numberValidator.js +18 -0
- package/libEs6/utils/validation/regexpValidator.js +18 -0
- package/libEs6/utils/validation/requiredValidator.js +18 -0
- package/libEs6/utils/validation/stringValidator.js +17 -0
- package/libEs6/utils/validation/utils.js +127 -0
- package/libEs6/utils/values.js +21 -0
- package/package.json +2 -2
package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { getNonce } from "../../dom-actions/dom/index.js";
|
|
14
|
+
import { parseAnchor, removeElementById } from "../utils.js";
|
|
15
|
+
import { TEXT_HTML } from "../../../../constants/contentType.js";
|
|
16
|
+
import { assign, includes, isNonEmptyString, values } from "../../../../utils/index.js";
|
|
17
|
+
import { createNode } from "../../../../utils/dom/index.js";
|
|
18
|
+
import { objectOf } from "../../../../utils/validation/index.js";
|
|
19
|
+
import { PropositionEventType } from "../../../../constants/propositionEventType.js";
|
|
20
|
+
import { EVENT_TYPE_TRUE, INTERACT } from "../../../../constants/eventType.js";
|
|
21
|
+
import createRedirect from "../../dom-actions/createRedirect.js";
|
|
22
|
+
const MESSAGING_CONTAINER_ID = "alloy-messaging-container";
|
|
23
|
+
const OVERLAY_CONTAINER_ID = "alloy-overlay-container";
|
|
24
|
+
const IFRAME_ID = "alloy-content-iframe";
|
|
25
|
+
const dismissMessage = () => [MESSAGING_CONTAINER_ID, OVERLAY_CONTAINER_ID].forEach(removeElementById);
|
|
26
|
+
export const createIframeClickHandler = (interact, navigateToUrl = createRedirect(window)) => {
|
|
27
|
+
return event => {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
event.stopImmediatePropagation();
|
|
30
|
+
const {
|
|
31
|
+
target
|
|
32
|
+
} = event;
|
|
33
|
+
const anchor = target.tagName.toLowerCase() === "a" ? target : target.closest("a");
|
|
34
|
+
if (!anchor) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const {
|
|
38
|
+
action,
|
|
39
|
+
interaction,
|
|
40
|
+
link,
|
|
41
|
+
label,
|
|
42
|
+
uuid
|
|
43
|
+
} = parseAnchor(anchor);
|
|
44
|
+
interact(action, {
|
|
45
|
+
label,
|
|
46
|
+
id: interaction,
|
|
47
|
+
uuid,
|
|
48
|
+
link
|
|
49
|
+
});
|
|
50
|
+
if (action === "dismiss") {
|
|
51
|
+
dismissMessage();
|
|
52
|
+
}
|
|
53
|
+
if (isNonEmptyString(link) && link.length > 0) {
|
|
54
|
+
navigateToUrl(link, true);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export const createIframe = (htmlContent, clickHandler) => {
|
|
59
|
+
const parser = new DOMParser();
|
|
60
|
+
const htmlDocument = parser.parseFromString(htmlContent, TEXT_HTML);
|
|
61
|
+
const scriptTag = htmlDocument.querySelector("script");
|
|
62
|
+
if (scriptTag) {
|
|
63
|
+
scriptTag.setAttribute("nonce", getNonce());
|
|
64
|
+
}
|
|
65
|
+
const element = createNode("iframe", {
|
|
66
|
+
src: URL.createObjectURL(new Blob([htmlDocument.documentElement.outerHTML], {
|
|
67
|
+
type: "text/html"
|
|
68
|
+
})),
|
|
69
|
+
id: IFRAME_ID
|
|
70
|
+
});
|
|
71
|
+
element.addEventListener("load", () => {
|
|
72
|
+
const {
|
|
73
|
+
addEventListener
|
|
74
|
+
} = element.contentDocument || element.contentWindow.document;
|
|
75
|
+
addEventListener("click", clickHandler);
|
|
76
|
+
});
|
|
77
|
+
return element;
|
|
78
|
+
};
|
|
79
|
+
const renderMessage = (iframe, webParameters, container, overlay) => {
|
|
80
|
+
[{
|
|
81
|
+
id: OVERLAY_CONTAINER_ID,
|
|
82
|
+
element: overlay
|
|
83
|
+
}, {
|
|
84
|
+
id: MESSAGING_CONTAINER_ID,
|
|
85
|
+
element: container
|
|
86
|
+
}, {
|
|
87
|
+
id: IFRAME_ID,
|
|
88
|
+
element: iframe
|
|
89
|
+
}].forEach(({
|
|
90
|
+
id,
|
|
91
|
+
element
|
|
92
|
+
}) => {
|
|
93
|
+
const {
|
|
94
|
+
style = {},
|
|
95
|
+
params = {}
|
|
96
|
+
} = webParameters[id];
|
|
97
|
+
assign(element.style, style);
|
|
98
|
+
const {
|
|
99
|
+
parentElement = "body",
|
|
100
|
+
insertionMethod = "appendChild",
|
|
101
|
+
enabled = true
|
|
102
|
+
} = params;
|
|
103
|
+
const parent = document.querySelector(parentElement);
|
|
104
|
+
if (enabled && parent && typeof parent[insertionMethod] === "function") {
|
|
105
|
+
parent[insertionMethod](element);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
export const buildStyleFromMobileParameters = mobileParameters => {
|
|
110
|
+
const {
|
|
111
|
+
verticalAlign,
|
|
112
|
+
width,
|
|
113
|
+
horizontalAlign,
|
|
114
|
+
backdropColor,
|
|
115
|
+
height,
|
|
116
|
+
cornerRadius,
|
|
117
|
+
horizontalInset,
|
|
118
|
+
verticalInset,
|
|
119
|
+
uiTakeover = false
|
|
120
|
+
} = mobileParameters;
|
|
121
|
+
const style = {
|
|
122
|
+
width: width ? `${width}%` : "100%",
|
|
123
|
+
backgroundColor: backdropColor || "rgba(0, 0, 0, 0.5)",
|
|
124
|
+
borderRadius: cornerRadius ? `${cornerRadius}px` : "0px",
|
|
125
|
+
border: "none",
|
|
126
|
+
position: uiTakeover ? "fixed" : "relative",
|
|
127
|
+
overflow: "hidden"
|
|
128
|
+
};
|
|
129
|
+
if (horizontalAlign === "left") {
|
|
130
|
+
style.left = horizontalInset ? `${horizontalInset}%` : "0";
|
|
131
|
+
} else if (horizontalAlign === "right") {
|
|
132
|
+
style.right = horizontalInset ? `${horizontalInset}%` : "0";
|
|
133
|
+
} else if (horizontalAlign === "center") {
|
|
134
|
+
style.left = "50%";
|
|
135
|
+
style.transform = "translateX(-50%)";
|
|
136
|
+
}
|
|
137
|
+
if (verticalAlign === "top") {
|
|
138
|
+
style.top = verticalInset ? `${verticalInset}%` : "0";
|
|
139
|
+
} else if (verticalAlign === "bottom") {
|
|
140
|
+
style.position = "fixed";
|
|
141
|
+
style.bottom = verticalInset ? `${verticalInset}%` : "0";
|
|
142
|
+
} else if (verticalAlign === "center") {
|
|
143
|
+
style.top = "50%";
|
|
144
|
+
style.transform = `${horizontalAlign === "center" ? `${style.transform} ` : ""}translateY(-50%)`;
|
|
145
|
+
style.display = "flex";
|
|
146
|
+
style.alignItems = "center";
|
|
147
|
+
style.justifyContent = "center";
|
|
148
|
+
}
|
|
149
|
+
if (height) {
|
|
150
|
+
style.height = `${height}vh`;
|
|
151
|
+
} else {
|
|
152
|
+
style.height = "100%";
|
|
153
|
+
}
|
|
154
|
+
return style;
|
|
155
|
+
};
|
|
156
|
+
export const mobileOverlay = mobileParameters => {
|
|
157
|
+
const {
|
|
158
|
+
backdropOpacity,
|
|
159
|
+
backdropColor
|
|
160
|
+
} = mobileParameters;
|
|
161
|
+
const opacity = backdropOpacity || 0.5;
|
|
162
|
+
const color = backdropColor || "#FFFFFF";
|
|
163
|
+
const style = {
|
|
164
|
+
position: "fixed",
|
|
165
|
+
top: "0",
|
|
166
|
+
left: "0",
|
|
167
|
+
width: "100%",
|
|
168
|
+
height: "100%",
|
|
169
|
+
background: "transparent",
|
|
170
|
+
opacity,
|
|
171
|
+
backgroundColor: color
|
|
172
|
+
};
|
|
173
|
+
return style;
|
|
174
|
+
};
|
|
175
|
+
const REQUIRED_PARAMS = ["enabled", "parentElement", "insertionMethod"];
|
|
176
|
+
const isValidWebParameters = webParameters => {
|
|
177
|
+
if (!webParameters) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
const ids = Object.keys(webParameters);
|
|
181
|
+
if (!includes(ids, MESSAGING_CONTAINER_ID)) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
if (!includes(ids, OVERLAY_CONTAINER_ID)) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
const valuesArray = values(webParameters);
|
|
188
|
+
for (let i = 0; i < valuesArray.length; i += 1) {
|
|
189
|
+
if (!objectOf(valuesArray[i], "style")) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (!objectOf(valuesArray[i], "params")) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
for (let j = 0; j < REQUIRED_PARAMS.length; j += 1) {
|
|
196
|
+
if (!objectOf(valuesArray[i].params, REQUIRED_PARAMS[j])) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
};
|
|
203
|
+
const generateWebParameters = mobileParameters => {
|
|
204
|
+
if (!mobileParameters) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const {
|
|
208
|
+
uiTakeover = false
|
|
209
|
+
} = mobileParameters;
|
|
210
|
+
return {
|
|
211
|
+
[IFRAME_ID]: {
|
|
212
|
+
style: {
|
|
213
|
+
border: "none",
|
|
214
|
+
width: "100%",
|
|
215
|
+
height: "100%"
|
|
216
|
+
},
|
|
217
|
+
params: {
|
|
218
|
+
enabled: true,
|
|
219
|
+
parentElement: "#alloy-messaging-container",
|
|
220
|
+
insertionMethod: "appendChild"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
[MESSAGING_CONTAINER_ID]: {
|
|
224
|
+
style: buildStyleFromMobileParameters(mobileParameters),
|
|
225
|
+
params: {
|
|
226
|
+
enabled: true,
|
|
227
|
+
parentElement: "body",
|
|
228
|
+
insertionMethod: "appendChild"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
[OVERLAY_CONTAINER_ID]: {
|
|
232
|
+
style: mobileOverlay(mobileParameters),
|
|
233
|
+
params: {
|
|
234
|
+
enabled: uiTakeover === true,
|
|
235
|
+
parentElement: "body",
|
|
236
|
+
insertionMethod: "appendChild"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// eslint-disable-next-line default-param-last
|
|
243
|
+
export const displayHTMLContentInIframe = (settings = {}, interact) => {
|
|
244
|
+
dismissMessage();
|
|
245
|
+
const {
|
|
246
|
+
content,
|
|
247
|
+
contentType,
|
|
248
|
+
mobileParameters
|
|
249
|
+
} = settings;
|
|
250
|
+
let {
|
|
251
|
+
webParameters
|
|
252
|
+
} = settings;
|
|
253
|
+
if (contentType !== TEXT_HTML) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const container = createNode("div", {
|
|
257
|
+
id: MESSAGING_CONTAINER_ID
|
|
258
|
+
});
|
|
259
|
+
const iframe = createIframe(content, createIframeClickHandler(interact));
|
|
260
|
+
const overlay = createNode("div", {
|
|
261
|
+
id: OVERLAY_CONTAINER_ID
|
|
262
|
+
});
|
|
263
|
+
if (!isValidWebParameters(webParameters)) {
|
|
264
|
+
webParameters = generateWebParameters(mobileParameters);
|
|
265
|
+
}
|
|
266
|
+
if (!webParameters) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
renderMessage(iframe, webParameters, container, overlay);
|
|
270
|
+
};
|
|
271
|
+
export default ((settings, collect) => {
|
|
272
|
+
return new Promise(resolve => {
|
|
273
|
+
const {
|
|
274
|
+
meta
|
|
275
|
+
} = settings;
|
|
276
|
+
displayHTMLContentInIframe(settings, (action, propositionAction) => {
|
|
277
|
+
const propositionEventTypes = {};
|
|
278
|
+
propositionEventTypes[PropositionEventType.INTERACT] = EVENT_TYPE_TRUE;
|
|
279
|
+
if (Object.values(PropositionEventType).indexOf(action) !== -1) {
|
|
280
|
+
propositionEventTypes[action] = EVENT_TYPE_TRUE;
|
|
281
|
+
}
|
|
282
|
+
collect({
|
|
283
|
+
decisionsMeta: [meta],
|
|
284
|
+
propositionAction,
|
|
285
|
+
eventType: INTERACT,
|
|
286
|
+
propositionEventTypes: Object.keys(propositionEventTypes)
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
resolve({
|
|
290
|
+
meta
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
});
|
package/libEs6/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import displayIframeContent from "./actions/displayIframeContent.js";
|
|
13
|
+
export default (collect => {
|
|
14
|
+
return {
|
|
15
|
+
defaultContent: settings => displayIframeContent(settings, collect)
|
|
16
|
+
};
|
|
17
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { isNonEmptyArray, queryString, startsWith } from "../../../utils/index.js";
|
|
13
|
+
import { removeNode, selectNodes } from "../../../utils/dom/index.js";
|
|
14
|
+
export const removeElementById = id => {
|
|
15
|
+
const element = selectNodes(`#${id}`, document);
|
|
16
|
+
if (element && element.length > 0) {
|
|
17
|
+
removeNode(element[0]);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export const parseAnchor = anchor => {
|
|
21
|
+
const nothing = {};
|
|
22
|
+
if (!anchor || anchor.tagName.toLowerCase() !== "a") {
|
|
23
|
+
return nothing;
|
|
24
|
+
}
|
|
25
|
+
const {
|
|
26
|
+
href
|
|
27
|
+
} = anchor;
|
|
28
|
+
if (!href || !startsWith(href, "adbinapp://")) {
|
|
29
|
+
return nothing;
|
|
30
|
+
}
|
|
31
|
+
const hrefParts = href.split("?");
|
|
32
|
+
const action = hrefParts[0].split("://")[1];
|
|
33
|
+
const label = anchor.innerText;
|
|
34
|
+
const uuid = anchor.getAttribute("data-uuid") || "";
|
|
35
|
+
let interaction;
|
|
36
|
+
let link;
|
|
37
|
+
if (isNonEmptyArray(hrefParts)) {
|
|
38
|
+
const queryParams = queryString.parse(hrefParts[1]);
|
|
39
|
+
interaction = queryParams.interaction || "";
|
|
40
|
+
link = decodeURIComponent(queryParams.link || "");
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
action,
|
|
44
|
+
interaction,
|
|
45
|
+
link,
|
|
46
|
+
label,
|
|
47
|
+
uuid
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. Ackll rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { boolean, objectOf, string } from "../../utils/validation/index.js";
|
|
14
|
+
import createComponent from "./createComponent.js";
|
|
15
|
+
import { initDomActionsModules } from "./dom-actions/index.js";
|
|
16
|
+
import createCollect from "./createCollect.js";
|
|
17
|
+
import { hideContainers, showContainers } from "./flicker/index.js";
|
|
18
|
+
import createFetchDataHandler from "./createFetchDataHandler.js";
|
|
19
|
+
import collectClicks from "./dom-actions/clicks/collectClicks.js";
|
|
20
|
+
import isAuthoringModeEnabled from "./utils/isAuthoringModeEnabled.js";
|
|
21
|
+
import { mergeDecisionsMeta, mergeQuery } from "./event.js";
|
|
22
|
+
import createOnClickHandler from "./createOnClickHandler.js";
|
|
23
|
+
import createViewCacheManager from "./createViewCacheManager.js";
|
|
24
|
+
import createViewChangeHandler from "./createViewChangeHandler.js";
|
|
25
|
+
import createClickStorage from "./createClickStorage.js";
|
|
26
|
+
import createApplyPropositions from "./createApplyPropositions.js";
|
|
27
|
+
import createGetPageLocation from "./createGetPageLocation.js";
|
|
28
|
+
import createSetTargetMigration from "./createSetTargetMigration.js";
|
|
29
|
+
import remapCustomCodeOffers from "./dom-actions/remapCustomCodeOffers.js";
|
|
30
|
+
import remapHeadOffers from "./dom-actions/remapHeadOffers.js";
|
|
31
|
+
import createPreprocess from "./dom-actions/createPreprocess.js";
|
|
32
|
+
import injectCreateProposition from "./handlers/injectCreateProposition.js";
|
|
33
|
+
import createAsyncArray from "./utils/createAsyncArray.js";
|
|
34
|
+
import * as schema from "../../constants/schema.js";
|
|
35
|
+
import processDefaultContent from "./handlers/processDefaultContent.js";
|
|
36
|
+
import { isPageWideSurface } from "./utils/surfaceUtils.js";
|
|
37
|
+
import createProcessDomAction from "./handlers/createProcessDomAction.js";
|
|
38
|
+
import createProcessHtmlContent from "./handlers/createProcessHtmlContent.js";
|
|
39
|
+
import createProcessRedirect from "./handlers/createProcessRedirect.js";
|
|
40
|
+
import createProcessPropositions from "./handlers/createProcessPropositions.js";
|
|
41
|
+
import createOnDecisionHandler from "./createOnDecisionHandler.js";
|
|
42
|
+
import createProcessInAppMessage from "./handlers/createProcessInAppMessage.js";
|
|
43
|
+
import initInAppMessageActionsModules from "./in-app-message-actions/initInAppMessageActionsModules.js";
|
|
44
|
+
import createRedirect from "./dom-actions/createRedirect.js";
|
|
45
|
+
import createNotificationHandler from "./createNotificationHandler.js";
|
|
46
|
+
import createHandleConsentFlicker from "./createHandleConsentFlicker.js";
|
|
47
|
+
const createPersonalization = ({
|
|
48
|
+
config,
|
|
49
|
+
logger,
|
|
50
|
+
eventManager,
|
|
51
|
+
consent
|
|
52
|
+
}) => {
|
|
53
|
+
const {
|
|
54
|
+
targetMigrationEnabled,
|
|
55
|
+
prehidingStyle
|
|
56
|
+
} = config;
|
|
57
|
+
const collect = createCollect({
|
|
58
|
+
eventManager,
|
|
59
|
+
mergeDecisionsMeta
|
|
60
|
+
});
|
|
61
|
+
const {
|
|
62
|
+
getClickMetasBySelector,
|
|
63
|
+
getClickSelectors,
|
|
64
|
+
storeClickMetrics
|
|
65
|
+
} = createClickStorage();
|
|
66
|
+
const getPageLocation = createGetPageLocation({
|
|
67
|
+
window
|
|
68
|
+
});
|
|
69
|
+
const domActionsModules = initDomActionsModules();
|
|
70
|
+
const preprocess = createPreprocess([remapHeadOffers, remapCustomCodeOffers]);
|
|
71
|
+
const createProposition = injectCreateProposition({
|
|
72
|
+
preprocess,
|
|
73
|
+
isPageWideSurface
|
|
74
|
+
});
|
|
75
|
+
const viewCache = createViewCacheManager({
|
|
76
|
+
createProposition
|
|
77
|
+
});
|
|
78
|
+
const executeRedirect = createRedirect(window);
|
|
79
|
+
const schemaProcessors = {
|
|
80
|
+
[schema.DEFAULT_CONTENT_ITEM]: processDefaultContent,
|
|
81
|
+
[schema.DOM_ACTION]: createProcessDomAction({
|
|
82
|
+
modules: domActionsModules,
|
|
83
|
+
logger,
|
|
84
|
+
storeClickMetrics
|
|
85
|
+
}),
|
|
86
|
+
[schema.HTML_CONTENT_ITEM]: createProcessHtmlContent({
|
|
87
|
+
modules: domActionsModules,
|
|
88
|
+
logger
|
|
89
|
+
}),
|
|
90
|
+
[schema.REDIRECT_ITEM]: createProcessRedirect({
|
|
91
|
+
logger,
|
|
92
|
+
executeRedirect,
|
|
93
|
+
collect
|
|
94
|
+
}),
|
|
95
|
+
[schema.MESSAGE_IN_APP]: createProcessInAppMessage({
|
|
96
|
+
modules: initInAppMessageActionsModules(collect),
|
|
97
|
+
logger
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
const processPropositions = createProcessPropositions({
|
|
101
|
+
schemaProcessors,
|
|
102
|
+
logger
|
|
103
|
+
});
|
|
104
|
+
const renderedPropositions = createAsyncArray();
|
|
105
|
+
const notificationHandler = createNotificationHandler(collect, renderedPropositions);
|
|
106
|
+
const fetchDataHandler = createFetchDataHandler({
|
|
107
|
+
prehidingStyle,
|
|
108
|
+
showContainers,
|
|
109
|
+
hideContainers,
|
|
110
|
+
mergeQuery,
|
|
111
|
+
processPropositions,
|
|
112
|
+
createProposition,
|
|
113
|
+
notificationHandler,
|
|
114
|
+
consent
|
|
115
|
+
});
|
|
116
|
+
const onClickHandler = createOnClickHandler({
|
|
117
|
+
mergeDecisionsMeta,
|
|
118
|
+
collectClicks,
|
|
119
|
+
getClickSelectors,
|
|
120
|
+
getClickMetasBySelector
|
|
121
|
+
});
|
|
122
|
+
const viewChangeHandler = createViewChangeHandler({
|
|
123
|
+
processPropositions,
|
|
124
|
+
viewCache
|
|
125
|
+
});
|
|
126
|
+
const applyPropositions = createApplyPropositions({
|
|
127
|
+
processPropositions,
|
|
128
|
+
createProposition,
|
|
129
|
+
renderedPropositions,
|
|
130
|
+
viewCache
|
|
131
|
+
});
|
|
132
|
+
const setTargetMigration = createSetTargetMigration({
|
|
133
|
+
targetMigrationEnabled
|
|
134
|
+
});
|
|
135
|
+
const onDecisionHandler = createOnDecisionHandler({
|
|
136
|
+
processPropositions,
|
|
137
|
+
createProposition,
|
|
138
|
+
notificationHandler
|
|
139
|
+
});
|
|
140
|
+
const handleConsentFlicker = createHandleConsentFlicker({
|
|
141
|
+
showContainers,
|
|
142
|
+
consent
|
|
143
|
+
});
|
|
144
|
+
return createComponent({
|
|
145
|
+
getPageLocation,
|
|
146
|
+
logger,
|
|
147
|
+
fetchDataHandler,
|
|
148
|
+
viewChangeHandler,
|
|
149
|
+
onClickHandler,
|
|
150
|
+
isAuthoringModeEnabled,
|
|
151
|
+
mergeQuery,
|
|
152
|
+
viewCache,
|
|
153
|
+
showContainers,
|
|
154
|
+
applyPropositions,
|
|
155
|
+
setTargetMigration,
|
|
156
|
+
mergeDecisionsMeta,
|
|
157
|
+
renderedPropositions,
|
|
158
|
+
onDecisionHandler,
|
|
159
|
+
handleConsentFlicker
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
createPersonalization.namespace = "Personalization";
|
|
163
|
+
createPersonalization.configValidators = objectOf({
|
|
164
|
+
prehidingStyle: string().nonEmpty(),
|
|
165
|
+
targetMigrationEnabled: boolean().default(false)
|
|
166
|
+
});
|
|
167
|
+
export default createPersonalization;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2021 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { assign } from "../../../utils/index.js";
|
|
14
|
+
export default (({
|
|
15
|
+
decisions,
|
|
16
|
+
renderAttempted
|
|
17
|
+
}) => {
|
|
18
|
+
return decisions.map(decision => assign({
|
|
19
|
+
renderAttempted
|
|
20
|
+
}, decision));
|
|
21
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export default (() => {
|
|
13
|
+
let latest = Promise.resolve([]);
|
|
14
|
+
return {
|
|
15
|
+
concat(promise) {
|
|
16
|
+
latest = latest.then(existingPropositions => {
|
|
17
|
+
return promise.then(newPropositions => {
|
|
18
|
+
return existingPropositions.concat(newPropositions);
|
|
19
|
+
}).catch(() => {
|
|
20
|
+
return existingPropositions;
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Clears the saved propositions, waiting until the next propositions are resolved and available.
|
|
26
|
+
*
|
|
27
|
+
* @returns {Promise<Array>} A promise that resolves to the latest propositions.
|
|
28
|
+
*/
|
|
29
|
+
clear() {
|
|
30
|
+
const oldLatest = latest;
|
|
31
|
+
latest = Promise.resolve([]);
|
|
32
|
+
return oldLatest;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default ((doc = document) => {
|
|
14
|
+
return doc.location.href.indexOf("adobe_authoring_enabled") !== -1;
|
|
15
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { WEB, WEBAPP, SURFACE_TYPE_DELIMITER, FRAGMENT_DELIMITER } from "../constants/surface.js";
|
|
14
|
+
import { startsWith, isNil, isNonEmptyString, includes } from "../../../utils/index.js";
|
|
15
|
+
const SURFACE_REGEX = /^(\w+):\/\/([^/#]+)(\/[^#]*)?(#.*)?$/;
|
|
16
|
+
const AUTHORITY_REGEX = /^(?:.*@)?(?:[a-z\d\u00a1-\uffff.-]+|\[[a-f\d:]+])(?::\d+)?$/;
|
|
17
|
+
const PATH_REGEX = /^\/(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})*$/;
|
|
18
|
+
const FRAGMENT_REGEX = /^#(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})+$/;
|
|
19
|
+
const normalizePath = (path = "/") => {
|
|
20
|
+
let end = path.length;
|
|
21
|
+
while (end > 0 && "/".indexOf(path.charAt(end - 1)) !== -1) {
|
|
22
|
+
end -= 1;
|
|
23
|
+
}
|
|
24
|
+
return path.substring(0, end) || "/";
|
|
25
|
+
};
|
|
26
|
+
const getSurfaceType = surfaceTypeMatch => isNonEmptyString(surfaceTypeMatch) ? surfaceTypeMatch.toLowerCase() : "";
|
|
27
|
+
const getAuthority = authorityMatch => isNonEmptyString(authorityMatch) ? authorityMatch.toLowerCase() : "";
|
|
28
|
+
const getPath = pathMatch => isNonEmptyString(pathMatch) ? normalizePath(pathMatch) : "/";
|
|
29
|
+
const parseSurface = surfaceString => {
|
|
30
|
+
const matched = surfaceString.match(SURFACE_REGEX);
|
|
31
|
+
return matched ? {
|
|
32
|
+
surfaceType: getSurfaceType(matched[1]),
|
|
33
|
+
authority: getAuthority(matched[2]),
|
|
34
|
+
path: getPath(matched[3]),
|
|
35
|
+
fragment: matched[4]
|
|
36
|
+
} : null;
|
|
37
|
+
};
|
|
38
|
+
const stringifySurface = surface => `${surface.surfaceType}${SURFACE_TYPE_DELIMITER}${surface.authority}${surface.path || ""}${surface.fragment || ""}`;
|
|
39
|
+
export const buildPageSurface = getPageLocation => {
|
|
40
|
+
const location = getPageLocation();
|
|
41
|
+
const host = location.host.toLowerCase();
|
|
42
|
+
const path = location.pathname;
|
|
43
|
+
return WEB + SURFACE_TYPE_DELIMITER + host + normalizePath(path);
|
|
44
|
+
};
|
|
45
|
+
const expandFragmentSurface = (surface, getPageLocation) => startsWith(surface, FRAGMENT_DELIMITER) ? buildPageSurface(getPageLocation) + surface : surface;
|
|
46
|
+
const validateSurface = (surface, getPageLocation, logger) => {
|
|
47
|
+
const invalidateSurface = validationError => {
|
|
48
|
+
logger.warn(validationError);
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
if (!isNonEmptyString(surface)) {
|
|
52
|
+
return invalidateSurface(`Invalid surface: ${surface}`);
|
|
53
|
+
}
|
|
54
|
+
const expanded = expandFragmentSurface(surface, getPageLocation);
|
|
55
|
+
const parsed = parseSurface(expanded);
|
|
56
|
+
if (parsed === null) {
|
|
57
|
+
return invalidateSurface(`Invalid surface: ${surface}`);
|
|
58
|
+
}
|
|
59
|
+
if (!includes([WEB, WEBAPP], parsed.surfaceType)) {
|
|
60
|
+
return invalidateSurface(`Unsupported surface type ${parsed.surfaceType} in surface: ${surface}`);
|
|
61
|
+
}
|
|
62
|
+
if (!parsed.authority || !AUTHORITY_REGEX.test(parsed.authority)) {
|
|
63
|
+
return invalidateSurface(`Invalid authority ${parsed.authority} in surface: ${surface}`);
|
|
64
|
+
}
|
|
65
|
+
if (parsed.path && !PATH_REGEX.test(parsed.path)) {
|
|
66
|
+
return invalidateSurface(`Invalid path ${parsed.path} in surface: ${surface}`);
|
|
67
|
+
}
|
|
68
|
+
if (parsed.fragment && !FRAGMENT_REGEX.test(parsed.fragment)) {
|
|
69
|
+
return invalidateSurface(`Invalid fragment ${parsed.fragment} in surface: ${surface}`);
|
|
70
|
+
}
|
|
71
|
+
return parsed;
|
|
72
|
+
};
|
|
73
|
+
export const isPageWideSurface = scope => !!scope && scope.indexOf(WEB + SURFACE_TYPE_DELIMITER) === 0 && scope.indexOf(FRAGMENT_DELIMITER) === -1;
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line default-param-last
|
|
76
|
+
export const normalizeSurfaces = (surfaces = [], getPageLocation, logger) => surfaces.map(surface => validateSurface(surface, getPageLocation, logger)).filter(surface => !isNil(surface)).map(stringifySurface);
|