@alipay/ams-checkout 0.0.1713146800-dev.0 → 0.0.1713838058-dev.0

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.
@@ -12,8 +12,8 @@ var _queryParse = queryParse(),
12
12
  groupId = _queryParse.groupId,
13
13
  host = _queryParse.requestHost;
14
14
  export var requestHost = {
15
- local: 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
16
- dev: host || 'http://imgs-1529.gz00b.dev.alipay.net/mgw.htm',
15
+ local: 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
16
+ dev: host || 'http://imgs-8452.sggz00b.dev.alipay.net/mgw.htm',
17
17
  sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
18
18
  pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
19
19
  prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -22,7 +22,7 @@ export var requestHost = {
22
22
  export var clientId = '5J5Y8X4E2Y25GR00690';
23
23
  export var tntInstId = 'ALIPW3SG';
24
24
  export var appId = 'ANTOM_PAYMENT_WEB';
25
- export var sofaId = groupId || 'GROUP_20231218150235';
25
+ export var sofaId = groupId || 'GROUP_20240304204929';
26
26
  export var hostSignMap = function hostSignMap(hostSign, env) {
27
27
  var map = {
28
28
  SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
@@ -7,6 +7,7 @@ export declare class AMSComponent extends CoreInstance {
7
7
  _componentApp: ComponentApp;
8
8
  channelType: componentSignEnum[];
9
9
  productSceneVersion: string;
10
+ timer: any;
10
11
  constructor(options: IoptionsParams);
11
12
  private parameterInitAndCheck;
12
13
  private pluginAppendIframe;
@@ -74,7 +74,7 @@ var handleSessionData = function handleSessionData(originSessionData) {
74
74
  parseData = _parseSessionData2[0],
75
75
  sessionData = _parseSessionData2[1];
76
76
  resetEasyPaySceneVersion(parseData);
77
- return [parseData, sessionData];
77
+ return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
78
78
  };
79
79
  var handleParams = function handleParams(params) {
80
80
  var _params = Object.assign({
@@ -116,6 +116,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
116
116
  _defineProperty(_assertThisInitialized(_this), "_componentApp", void 0);
117
117
  _defineProperty(_assertThisInitialized(_this), "channelType", void 0);
118
118
  _defineProperty(_assertThisInitialized(_this), "productSceneVersion", void 0);
119
+ _defineProperty(_assertThisInitialized(_this), "timer", void 0);
119
120
  var ComponentPlugin = new ComponentApp();
120
121
  ComponentPlugin.setRender(createIframeNode);
121
122
  ComponentPlugin.setPreloadRender(createPreloadIframeNode);
@@ -361,7 +362,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
361
362
  channelType: channelType
362
363
  });
363
364
  }
364
- setTimeout(function () {
365
+ this.timer = setTimeout(function () {
365
366
  _this5.clearPreloadIframe(true);
366
367
  }, MAX_CLEAR_TIME);
367
368
  }
@@ -369,6 +370,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
369
370
  key: "clearPreloadIframe",
370
371
  value: function clearPreloadIframe() {
371
372
  var isTimeOut = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
373
+ !isTimeOut && clearTimeout(this.timer);
372
374
  if (Array.isArray(this.channelType)) {
373
375
  for (var i = 0; i < this.channelType.length; i++) {
374
376
  var iframe = document.getElementById("ams-checkout-component-".concat(this.channelType[i], "-").concat(this.productSceneVersion));
@@ -56,7 +56,8 @@ var AMSSDK = /*#__PURE__*/function () {
56
56
  this._storageId = _storageId;
57
57
 
58
58
  // TODO Consumption data analysis control parameters
59
- this.logger = new Logger(LogConfig, (options === null || options === void 0 ? void 0 : options.environment) !== environmentEnum.prod);
59
+ this.logger = new Logger(LogConfig, ![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment));
60
+ Logger.setInstance(this.logger);
60
61
  this.logger.setMedta({
61
62
  instanceId: this._instanceId
62
63
  });
@@ -65,14 +66,15 @@ var AMSSDK = /*#__PURE__*/function () {
65
66
  title: 'NEW_AMSSDK_BY_MECHANT',
66
67
  msg: "".concat(options === null || options === void 0 ? void 0 : options.environment, "_").concat(options === null || options === void 0 ? void 0 : options.locale, "}")
67
68
  }).send();
68
- this.preInitSecurity();
69
+ this.preInitSecurity(options);
69
70
  }
70
71
  _createClass(AMSSDK, [{
71
72
  key: "preInitSecurity",
72
- value: function preInitSecurity() {
73
+ value: function preInitSecurity(options) {
73
74
  var _this$options;
74
75
  var antomSDKConfigKey = 'antomSDKConfigKey';
75
76
  var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
77
+ if (![environmentEnum.prod, environmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
76
78
  if (checkTimeElapsed()) {
77
79
  antomConfig({
78
80
  env: this.options.env.environment
@@ -86,7 +88,7 @@ var AMSSDK = /*#__PURE__*/function () {
86
88
  var matchingConfig = config['pl_sec'].find(function (item) {
87
89
  var _item$v, _item$v2, _item$platform;
88
90
  var minVersion = item === null || item === void 0 || (_item$v = item.v) === null || _item$v === void 0 ? void 0 : _item$v.split('|')[0];
89
- var maxVersion = (item === null || item === void 0 || (_item$v2 = item.v) === null || _item$v2 === void 0 ? void 0 : _item$v2.split('|')[1]) || '999.9.9';
91
+ var maxVersion = (item === null || item === void 0 || (_item$v2 = item.v) === null || _item$v2 === void 0 ? void 0 : _item$v2.split('|')[1]) || '999999.9.9';
90
92
  var matchVersion = compareVersion(sdkVersion, minVersion) >= 0 && compareVersion(maxVersion, sdkVersion) >= 0;
91
93
  return ((item === null || item === void 0 || (_item$platform = item.platform) === null || _item$platform === void 0 ? void 0 : _item$platform.includes('Web')) || (item === null || item === void 0 ? void 0 : item.platform) === '') && (item === null || item === void 0 ? void 0 : item.product) === product && (!(item !== null && item !== void 0 && item.v) || matchVersion);
92
94
  });
@@ -1,15 +1,18 @@
1
- import { renderDisplayTypeEnum, componentSignEnum, Ianalytics } from '../../types';
2
- export declare const getAppPath: (environment: string, appVersion: string, componentSign: componentSignEnum, productSceneVersion: string, extendInfo: string) => any;
1
+ import { componentSignEnum, Ianalytics, renderDisplayTypeEnum } from '../../types';
2
+ export declare const getAppPath: (environment: string, appVersion: string, componentSign: componentSignEnum, productScene: string, productSceneVersion: string, extendInfo: string, mid: string) => any;
3
3
  export declare const getAppDomain: (domainParams: {
4
4
  environment: string;
5
5
  appVersion: string;
6
6
  componentSign: componentSignEnum;
7
+ productScene: string;
7
8
  productSceneVersion: string;
8
9
  extendInfo: string;
10
+ mid: string;
9
11
  }) => string;
10
12
  export declare const getIframeUrl: (iframeParams: {
11
13
  componentSign: componentSignEnum;
12
14
  analytics?: Ianalytics;
15
+ productScene: string;
13
16
  productSceneVersion: string;
14
17
  environment: string;
15
18
  appVersion: string;
@@ -19,6 +22,7 @@ export declare const getIframeUrl: (iframeParams: {
19
22
  renderDisplayType: renderDisplayTypeEnum;
20
23
  isPreload?: string;
21
24
  hostSign?: string;
25
+ mid: string;
22
26
  }) => {
23
27
  path: string;
24
28
  locationSearch: string;
@@ -10,12 +10,40 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
10
10
  * 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
11
11
  */
12
12
  import { marmotMap, sdkVersion } from "../../config/index";
13
- import { getViewPort, queryParse, serialize } from "../../util/index";
14
13
  import { componentSignEnum } from "../../types";
15
- var getAppVersion = function getAppVersion(_extendInfo) {
14
+ import { isDebugLog } from "../../util/debug";
15
+ import { getViewPort, queryParse, serialize } from "../../util/index";
16
+ import { Logger } from "../../util/logger";
17
+ import { getLastAppVersion, getMatchAppVersion, setLastAppVersion } from "../../util/upgrade";
18
+ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
16
19
  try {
17
- var info = JSON.parse(_extendInfo);
18
- return info.versionMap.web[sdkVersion].targetWebVerison;
20
+ var _Logger$getInstance;
21
+ var appVersion = getMatchAppVersion(_extendInfo, {
22
+ sdkVersion: sdkVersion,
23
+ productScene: productScene,
24
+ mid: mid
25
+ });
26
+ // 有sessionData加载时
27
+ (_Logger$getInstance = Logger.getInstance()) === null || _Logger$getInstance === void 0 || _Logger$getInstance.logInfo({
28
+ title: 'sdk_event_appUpgradeInfo'
29
+ }, {
30
+ appUpgradeVersion: appVersion,
31
+ appUpgraded: appVersion ? true : false,
32
+ isPreload: _extendInfo ? false : true,
33
+ extendInfo: _extendInfo,
34
+ productScene: productScene,
35
+ mid: mid
36
+ });
37
+ // 没有匹配到版本,查询上次的加载版本
38
+ if (!appVersion) {
39
+ appVersion = getLastAppVersion(productScene);
40
+ return appVersion;
41
+ }
42
+ // 不为空时代表是有sessionData,因此要保存当前版本
43
+ if (_extendInfo) {
44
+ setLastAppVersion(productScene, appVersion);
45
+ }
46
+ return appVersion;
19
47
  } catch (error) {
20
48
  return '';
21
49
  }
@@ -34,13 +62,26 @@ export var getAppPath = function getAppPath() {
34
62
  var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
35
63
  var appVersion = arguments.length > 1 ? arguments[1] : undefined;
36
64
  var componentSign = arguments.length > 2 ? arguments[2] : undefined;
37
- var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
38
- var extendInfo = arguments.length > 4 ? arguments[4] : undefined;
65
+ var productScene = arguments.length > 3 ? arguments[3] : undefined;
66
+ var productSceneVersion = arguments.length > 4 ? arguments[4] : undefined;
67
+ var extendInfo = arguments.length > 5 ? arguments[5] : undefined;
68
+ var mid = arguments.length > 6 ? arguments[6] : undefined;
39
69
  var _ref = queryParse() || {},
40
70
  urlTestHost = _ref.host;
41
- var finalAppVersion = getAppVersion(extendInfo) || appVersion;
71
+ var upgradeAppVersion = getAppVersion(extendInfo, productScene, mid);
72
+ var finalAppVersion = upgradeAppVersion || appVersion;
73
+ // 当有升级版本时,更新到全局字段
74
+ if (upgradeAppVersion) {
75
+ var _Logger$getInstance2;
76
+ (_Logger$getInstance2 = Logger.getInstance()) === null || _Logger$getInstance2 === void 0 || _Logger$getInstance2.setMedta({
77
+ webAppVersion: finalAppVersion
78
+ });
79
+ }
80
+ if (isDebugLog()) {
81
+ console.log('appUpgrade#getAppPath#finalAppVersion', finalAppVersion);
82
+ console.log('appUpgrade#getAppPath#extendInfo', extendInfo, mid);
83
+ }
42
84
  var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
43
-
44
85
  // only for test while testurl?host=https://xxxxx.test.html
45
86
  if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
46
87
  return urlTestHost;
@@ -51,10 +92,12 @@ export var getAppDomain = function getAppDomain(domainParams) {
51
92
  var environment = domainParams.environment,
52
93
  appVersion = domainParams.appVersion,
53
94
  componentSign = domainParams.componentSign,
95
+ productScene = domainParams.productScene,
54
96
  productSceneVersion = domainParams.productSceneVersion,
55
- extendInfo = domainParams.extendInfo;
97
+ extendInfo = domainParams.extendInfo,
98
+ mid = domainParams.mid;
56
99
  var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
57
- var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo));
100
+ var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo, mid));
58
101
  return macth && macth[0] || '';
59
102
  };
60
103
  export var getIframeUrl = function getIframeUrl(iframeParams) {
@@ -63,6 +106,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
63
106
  analytics = _iframeParams$analyti === void 0 ? {
64
107
  enabled: true
65
108
  } : _iframeParams$analyti,
109
+ productScene = iframeParams.productScene,
66
110
  productSceneVersion = iframeParams.productSceneVersion,
67
111
  environment = iframeParams.environment,
68
112
  appVersion = iframeParams.appVersion,
@@ -73,8 +117,15 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
73
117
  _iframeParams$isPrelo = iframeParams.isPreload,
74
118
  isPreload = _iframeParams$isPrelo === void 0 ? '' : _iframeParams$isPrelo,
75
119
  _iframeParams$hostSig = iframeParams.hostSign,
76
- hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig;
77
- var path = getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo || '');
120
+ hostSign = _iframeParams$hostSig === void 0 ? '' : _iframeParams$hostSig,
121
+ _iframeParams$mid = iframeParams.mid,
122
+ mid = _iframeParams$mid === void 0 ? '' : _iframeParams$mid;
123
+ var path = getAppPath(environment, appVersion, componentSign, productScene, productSceneVersion, extendInfo || '', mid);
124
+ var appMatched = getMatchAppVersion(extendInfo, {
125
+ sdkVersion: sdkVersion,
126
+ productScene: productScene,
127
+ mid: mid
128
+ }) ? 'true' : 'false';
78
129
  var initialScale = 1;
79
130
  var scale = getViewPort('initial-scale') || initialScale;
80
131
  var _queryParse = queryParse(),
@@ -91,6 +142,7 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
91
142
  locale: locale,
92
143
  scale: scale,
93
144
  instanceId: instanceId,
145
+ appMatched: appMatched,
94
146
  analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
95
147
  sdkVersion: sdkVersion,
96
148
  refUrl: window.location.href,
@@ -106,6 +158,10 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
106
158
  if (_displayType) urlParams.displayType = _displayType;
107
159
  if (isPreload) urlParams.isPreload = isPreload;
108
160
  var locationSearch = serialize(urlParams);
161
+ if (isDebugLog()) {
162
+ console.log('appUpgrade#getIframeUrl#appMatched', appMatched);
163
+ console.log('appUpgrade#getIframeUrl#url', path, locationSearch);
164
+ }
109
165
  return {
110
166
  path: path,
111
167
  locationSearch: locationSearch
@@ -8,7 +8,7 @@
8
8
  import { ANIMATION_TIME, closeImg, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, LOADING_ID, MOCKUP_ID } from "../../constant";
9
9
  import { platformEnum } from "../../types";
10
10
  import { addSetFontSizeEvent, amsSetSize, getDesignFontSize } from "../../util";
11
- var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
11
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(MOCKUP_ID, "-hidden{\nanimation: ").concat(MOCKUP_ID, "-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ").concat(MOCKUP_ID, "-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n");
12
12
  export var componentAddCSS = function componentAddCSS() {
13
13
  var style = document.createElement('style');
14
14
  style.type = 'text/css';
@@ -25,7 +25,6 @@ export default class ComponentApp {
25
25
  private _renderDisplayType;
26
26
  private _multipleCallbackEvents;
27
27
  _merchantAppointParam: IMerchantAppointParam;
28
- private _webAppHeartBeatTimeoutId;
29
28
  private _webAppHeartBeatTimeoutFn;
30
29
  constructor();
31
30
  /**
@@ -98,7 +97,7 @@ export default class ComponentApp {
98
97
  */
99
98
  dispatchToApp(payload: {
100
99
  context: eventPayloadContext;
101
- }, targetElement?: any): any;
100
+ }, targetElement?: any, sendLog?: boolean): any;
102
101
  /**
103
102
  * @description Subscribe to messages from SDK
104
103
  */