MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

third_party/subscriptions-project/swg.js:9854–9900  ·  view source on GitHub ↗

* @param {!./deps.DepsDef} deps * @param {!../api/subscriptions.OffersRequest|undefined} options

(deps, options)

Source from the content-addressed store, hash-verified

9852 * @param {!../api/subscriptions.OffersRequest|undefined} options
9853 */
9854 constructor(deps, options) {
9855 /** @private @const {!./deps.DepsDef} */
9856 this.deps_ = deps;
9857
9858 /** @private @const {!../api/subscriptions.OffersRequest|undefined} */
9859 this.options_ = options;
9860
9861 /** @private @const {!Window} */
9862 this.win_ = deps.win();
9863
9864 /** @private @const {!./client-config-manager.ClientConfigManager} */
9865 this.clientConfigManager_ = deps.clientConfigManager();
9866
9867 /** @private @const {!../components/activities.ActivityPorts} */
9868 this.activityPorts_ = deps.activities();
9869
9870 /** @private @const {!../components/dialog-manager.DialogManager} */
9871 this.dialogManager_ = deps.dialogManager();
9872
9873 this.activityIframeView_ = null;
9874
9875 // Default to showing close button.
9876 const isClosable = options?.isClosable ?? true;
9877
9878 /** @private @const {!Promise<!ActivityIframeView>} */
9879 this.activityIframeViewPromise_ = this.clientConfigManager_
9880 .getClientConfig()
9881 .then((clientConfig) => {
9882 return this.shouldShow_(clientConfig)
9883 ? new ActivityIframeView(
9884 this.win_,
9885 this.activityPorts_,
9886 this.getUrl_(clientConfig, deps.pageConfig()),
9887 feArgs({
9888 'productId': deps.pageConfig().getProductId(),
9889 'publicationId': deps.pageConfig().getPublicationId(),
9890 'productType': ProductType.UI_CONTRIBUTION,
9891 'list': (options && options.list) || 'default',
9892 'skus': (options && options.skus) || null,
9893 'isClosable': isClosable,
9894 'supportsEventManager': true,
9895 }),
9896 /* shouldFadeBody */ true
9897 )
9898 : null;
9899 });
9900 }
9901
9902 /**
9903 * @param {AlreadySubscribedResponse} response

Callers

nothing calls this directly

Calls 12

shouldShow_Method · 0.95
getUrl_Method · 0.95
feArgsFunction · 0.85
clientConfigManagerMethod · 0.80
activitiesMethod · 0.80
dialogManagerMethod · 0.80
getClientConfigMethod · 0.80
pageConfigMethod · 0.80
getProductIdMethod · 0.80
getPublicationIdMethod · 0.80
winMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected