zmp-sdk 2.16.3 → 2.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17892,7 +17892,7 @@
17892
17892
  var version$2 = ''; // empty string to avoid regexp issues
17893
17893
  var versions = {};
17894
17894
  var release$1 = {};
17895
- var config$1 = {};
17895
+ var config = {};
17896
17896
 
17897
17897
  function noop$1() {}
17898
17898
 
@@ -17969,7 +17969,7 @@
17969
17969
  hrtime: hrtime,
17970
17970
  platform: platform$2,
17971
17971
  release: release$1,
17972
- config: config$1,
17972
+ config: config,
17973
17973
  uptime: uptime$1
17974
17974
  };
17975
17975
 
@@ -34930,12 +34930,39 @@
34930
34930
  return ck;
34931
34931
  };
34932
34932
 
34933
+ const Byte = 1;
34934
+ const KB = 1024 * Byte;
34935
+ const MB = 1024 * KB;
34933
34936
  const ZAPP_ID = window.zAppID;
34934
34937
  const APP_ID = window.APP_ID;
34935
34938
  const APP_CONFIG = window.APP_CONFIG || {};
34939
+ const MINI_APP_LINK = 'https://zalo.me/app/link/zapps';
34940
+ const MINI_APP_INTERNAL_LINK = 'https://h5.zdn.vn/zapps';
34941
+ const COOKIE_NAME = {
34942
+ ZOAUTH: `h5.zdn.vn_zoauth`,
34943
+ ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
34944
+ JS_TOKEN: `h5.zdn.vn_zlink3rd`,
34945
+ ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
34946
+ };
34947
+ const APIS = {
34948
+ GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
34949
+ GET_ACCESS_TOKEN: 'https://h5.zalo.me/openapi/access_token',
34950
+ GET_ACCESS_TOKEN_V3: 'https://oauth.zaloapp.com/v3/access_token'
34951
+ };
34952
+ const STORAGE_LIMIT = 5 * MB;
34953
+ const NETWORK_TYPE = (isAndroid) => ({
34954
+ NONE: isAndroid ? -2 : 0,
34955
+ WIFI: isAndroid ? 0 : 1,
34956
+ '2G': isAndroid ? 2 : 2,
34957
+ '3G': isAndroid ? 15 : 2,
34958
+ '4G': isAndroid ? 13 : 2
34959
+ });
34960
+ const MEDIA_PICKER_LIMIT = 1 * MB;
34961
+ const MEDIA_PICKER_UPLOAD_SERVER = 'https://zapi-server.tungnt.xyz/upload/photos';
34936
34962
  const ACTION = {
34937
34963
  GET_DOWNLOADED_STICKER: {
34938
- name: 'action.get.downloaded.sticker'
34964
+ name: 'action.get.downloaded.sticker',
34965
+ have_callback: true
34939
34966
  },
34940
34967
  OPEN_SHARE_STICKER: {
34941
34968
  name: 'action.open.share.sticker'
@@ -35025,19 +35052,23 @@
35025
35052
  name: 'action.open.sendsticker'
35026
35053
  },
35027
35054
  REPORT_ABUSE: {
35028
- name: 'action.report.abuse'
35055
+ name: 'action.report.abuse',
35056
+ have_callback: true
35029
35057
  },
35030
35058
  FOLLOW_OA: {
35031
- name: 'action.follow.oa'
35059
+ name: 'action.follow.oa',
35060
+ have_callback: true
35032
35061
  },
35033
35062
  UNFOLLOW_OA: {
35034
- name: 'action.unfollow.oa'
35063
+ name: 'action.unfollow.oa',
35064
+ have_callback: true
35035
35065
  },
35036
35066
  OPEN_GAMEDETAIL: {
35037
35067
  name: 'action.open.gamedetail'
35038
35068
  },
35039
35069
  OPEN_SHARESHEET: {
35040
- name: 'action.open.sharesheet'
35070
+ name: 'action.open.sharesheet',
35071
+ have_callback: true
35041
35072
  },
35042
35073
  REQUEST_PERMISSION_CAMERA: {
35043
35074
  name: 'action.request.permission.camera'
@@ -35064,18 +35095,21 @@
35064
35095
  },
35065
35096
  CREATE_OPTIONS_MENU: {
35066
35097
  name: 'action.create.options.menu',
35067
- skip_jump: true
35098
+ skip_jump: true,
35099
+ have_callback: true
35068
35100
  },
35069
35101
  CREATE_SHORTCUT: {
35070
35102
  name: 'action.create.shortcut'
35071
35103
  },
35072
35104
  CHANGE_ACTIONBAR_LEFTBUTTON_TYPE: {
35073
35105
  name: 'action.change.actionbar.leftbutton.type',
35074
- skip_jump: true
35106
+ skip_jump: true,
35107
+ have_callback: true
35075
35108
  },
35076
35109
  WINDOW_CLOSE: {
35077
35110
  name: 'action.window.close',
35078
- skip_jump: true
35111
+ skip_jump: true,
35112
+ have_callback: true
35079
35113
  },
35080
35114
  WEBVIEW_CHECKRESERROR: {
35081
35115
  name: 'action.webview.checkResError'
@@ -35088,7 +35122,8 @@
35088
35122
  },
35089
35123
  ZBROWSER_JSBRIDGE: {
35090
35124
  name: 'action.zbrowser.jsbridge',
35091
- skip_jump: true
35125
+ skip_jump: true,
35126
+ have_callback: true
35092
35127
  },
35093
35128
  PROMPT_AUTHENTICATION: {
35094
35129
  name: 'action.prompt.authentication'
@@ -35104,13 +35139,16 @@
35104
35139
  name: 'action.open.appstore'
35105
35140
  },
35106
35141
  GET_LOCATION: {
35107
- name: 'action.get.location'
35142
+ name: 'action.get.location',
35143
+ have_callback: true
35108
35144
  },
35109
35145
  QUERY_LOCATION_HIDE: {
35110
- name: 'action.query.location.hide'
35146
+ name: 'action.query.location.hide',
35147
+ have_callback: true
35111
35148
  },
35112
35149
  SHOW_TOAST: {
35113
- name: 'action.show.toast'
35150
+ name: 'action.show.toast',
35151
+ have_callback: true
35114
35152
  },
35115
35153
  OPEN_APP: {
35116
35154
  name: 'action.open.app'
@@ -35128,10 +35166,12 @@
35128
35166
  name: 'action.open.sms'
35129
35167
  },
35130
35168
  VIEW_MYQR: {
35131
- name: 'action.view.myqr'
35169
+ name: 'action.view.myqr',
35170
+ have_callback: true
35132
35171
  },
35133
35172
  KEEP_SCREEN: {
35134
- name: 'action.keep.screen'
35173
+ name: 'action.keep.screen',
35174
+ have_callback: true
35135
35175
  },
35136
35176
  CHANGE_AUTOROTATE: {
35137
35177
  name: 'action.change.autorotate',
@@ -35150,25 +35190,31 @@
35150
35190
  name: 'action.open.inapprw'
35151
35191
  },
35152
35192
  ZALORUN_GETTRACKINGSTATUS: {
35153
- name: 'action.zalorun.getTrackingStatus'
35193
+ name: 'action.zalorun.getTrackingStatus',
35194
+ have_callback: true
35154
35195
  },
35155
35196
  ZALORUN_SETTRACKINGSTATUS: {
35156
- name: 'action.zalorun.setTrackingStatus'
35197
+ name: 'action.zalorun.setTrackingStatus',
35198
+ have_callback: true
35157
35199
  },
35158
35200
  ZALORUN_GETDAYSTEP: {
35159
- name: 'action.zalorun.getDayStep'
35201
+ name: 'action.zalorun.getDayStep',
35202
+ have_callback: true
35160
35203
  },
35161
35204
  ZALORUN_FORCESUBMITDATA: {
35162
- name: 'action.zalorun.forceSubmitData'
35205
+ name: 'action.zalorun.forceSubmitData',
35206
+ have_callback: true
35163
35207
  },
35164
35208
  ZALORUN_SETWEIGHT: {
35165
- name: 'action.zalorun.setWeight'
35209
+ name: 'action.zalorun.setWeight',
35210
+ have_callback: true
35166
35211
  },
35167
35212
  OPEN_PROFILE_EXT: {
35168
35213
  name: 'action.open.profile.ext'
35169
35214
  },
35170
35215
  DOWNLOAD_CATE: {
35171
- name: 'action.download.cate'
35216
+ name: 'action.download.cate',
35217
+ have_callback: true
35172
35218
  },
35173
35219
  JUMP_LOGIN: {
35174
35220
  name: 'action.jump.login',
@@ -35234,28 +35280,6 @@
35234
35280
  version_live: { iOS: 999 }
35235
35281
  }
35236
35282
  };
35237
- const ACTION_HAVE_CALLBACK = [
35238
- ACTION.GET_DOWNLOADED_STICKER.name,
35239
- ACTION.REPORT_ABUSE.name,
35240
- ACTION.FOLLOW_OA.name,
35241
- ACTION.UNFOLLOW_OA.name,
35242
- ACTION.OPEN_SHARESHEET.name,
35243
- ACTION.CREATE_OPTIONS_MENU.name,
35244
- ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name,
35245
- ACTION.WINDOW_CLOSE.name,
35246
- ACTION.ZBROWSER_JSBRIDGE.name,
35247
- ACTION.GET_LOCATION.name,
35248
- ACTION.QUERY_LOCATION_HIDE.name,
35249
- ACTION.SHOW_TOAST.name,
35250
- ACTION.VIEW_MYQR.name,
35251
- ACTION.KEEP_SCREEN.name,
35252
- ACTION.ZALORUN_GETTRACKINGSTATUS.name,
35253
- ACTION.ZALORUN_SETTRACKINGSTATUS.name,
35254
- ACTION.ZALORUN_GETDAYSTEP.name,
35255
- ACTION.ZALORUN_FORCESUBMITDATA.name,
35256
- ACTION.ZALORUN_SETWEIGHT.name,
35257
- ACTION.DOWNLOAD_CATE.name
35258
- ];
35259
35283
  const RESPONSE_CODE = {
35260
35284
  BAD_REQUEST: -1400,
35261
35285
  INTERNAL_SERVER_ERROR: -1500,
@@ -35511,6 +35535,96 @@
35511
35535
  }
35512
35536
  };
35513
35537
 
35538
+ function encode(bag) {
35539
+ var pairs = [];
35540
+ for (var key in bag) {
35541
+ if (bag.hasOwnProperty(key)) {
35542
+ var value = bag[key];
35543
+ if (typeof value === "undefined") {
35544
+ return;
35545
+ }
35546
+ if (value === null) {
35547
+ pairs.push(key);
35548
+ return;
35549
+ }
35550
+ pairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
35551
+ }
35552
+ }
35553
+ return pairs.join("&");
35554
+ }
35555
+ function decode(str, strict) {
35556
+ var data = {};
35557
+ if (str === "") {
35558
+ return data;
35559
+ }
35560
+ var pairs = str.split("&");
35561
+ for (var i = 0; i < pairs.length; i++) {
35562
+ var pair = pairs[i].split("=", 2);
35563
+ var key = decodeURIComponent(pair[0]);
35564
+ if (strict && Object.prototype.hasOwnProperty.call(data, key)) {
35565
+ throw new URIError("Duplicate key: " + key);
35566
+ }
35567
+ data[key] = pair.length === 2 ? decodeURIComponent(pair[1]) : null;
35568
+ }
35569
+ return data;
35570
+ }
35571
+ function appendToUrl(url, params) {
35572
+ return (url +
35573
+ (url.indexOf("?") !== -1 ? "&" : "?") +
35574
+ (typeof params === "string" ? params : QueryString.encode(params)));
35575
+ }
35576
+ function getParameterByName(name, url) {
35577
+ if (!url) {
35578
+ url = window.location.href;
35579
+ }
35580
+ name = name.replace(/[\[\]]/g, "\\$&");
35581
+ var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
35582
+ if (!results)
35583
+ return null;
35584
+ if (!results[2])
35585
+ return "";
35586
+ return decodeURIComponent(results[2].replace(/\+/g, " "));
35587
+ }
35588
+ function getParamsAsObject(query) {
35589
+ var params = {};
35590
+ if (!query)
35591
+ return params;
35592
+ var values = query.split("&");
35593
+ values.map(function (item) {
35594
+ var data = item.split("=");
35595
+ if (!data || data.length != 2)
35596
+ return;
35597
+ params[data[0]] = decodeURIComponent(data[1].replace(/\+/g, " "));
35598
+ });
35599
+ return params;
35600
+ }
35601
+ function toQueryString(data) {
35602
+ if (!data)
35603
+ return "";
35604
+ if ((typeof data === "undefined" ? "undefined" : typeof (data)) != "object")
35605
+ return data;
35606
+ var key = Object.keys(data);
35607
+ var params = [];
35608
+ key.map(function (k) {
35609
+ var v = data[k];
35610
+ if ((typeof v === "undefined" ? "undefined" : typeof (v)) == "object")
35611
+ v = JSON.stringify(v);
35612
+ else
35613
+ v = encodeURIComponent(v);
35614
+ var item = [k, v].join("=");
35615
+ params.push(item);
35616
+ });
35617
+ return params.join("&");
35618
+ }
35619
+ const QueryString = {
35620
+ encode: encode,
35621
+ decode: decode,
35622
+ appendToUrl: appendToUrl,
35623
+ getParameterByName: getParameterByName,
35624
+ getParamsAsObject: getParamsAsObject,
35625
+ toQueryString: toQueryString,
35626
+ };
35627
+
35514
35628
  const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
35515
35629
  const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
35516
35630
  const REGEXP_SPACES = new RegExp('\\s', 'g');
@@ -35731,13 +35845,12 @@
35731
35845
  }
35732
35846
  };
35733
35847
  const checkIOSSupportAction = (action) => {
35734
- var _a, _b;
35735
- const key = action.slice(7, action.length).replace(/\./gi, '_').toUpperCase();
35848
+ var _a;
35736
35849
  const zaloIOSVersion = getZaloVersion();
35737
- const actionVersionLive = ((_b = (_a = ACTION[key]) === null || _a === void 0 ? void 0 : _a.version_live) === null || _b === void 0 ? void 0 : _b.iOS) || 0;
35850
+ const actionVersionLive = ((_a = action === null || action === void 0 ? void 0 : action.version_live) === null || _a === void 0 ? void 0 : _a.iOS) || 0;
35738
35851
  if (Array.isArray(window.ignoreCheckSupport) &&
35739
35852
  window.ignoreCheckSupport.length > 0 &&
35740
- window.ignoreCheckSupport.includes(action)) {
35853
+ window.ignoreCheckSupport.includes(action.name)) {
35741
35854
  return true;
35742
35855
  }
35743
35856
  return zaloIOSVersion >= actionVersionLive;
@@ -35819,7 +35932,36 @@
35819
35932
  return {
35820
35933
  error: false
35821
35934
  };
35822
- };
35935
+ };
35936
+ const getAppInfo = (appId, versionStatus, currentVersion) => __awaiter(void 0, void 0, void 0, function* () {
35937
+ const inputData = {
35938
+ appId,
35939
+ versionStatus
35940
+ };
35941
+ if (!lodash.isUndefined(currentVersion)) {
35942
+ inputData.currentVersion = currentVersion;
35943
+ }
35944
+ const api = QueryString.appendToUrl(`${API_DOMAIN}${H5_API.GET_APP_INFO}`, inputData);
35945
+ const msgApi = yield fetch(api, {
35946
+ credentials: 'include'
35947
+ });
35948
+ if (msgApi.ok) {
35949
+ const appInfo = yield msgApi.json();
35950
+ if (appInfo.err < 0 || !appInfo.data) {
35951
+ throw new Error(appInfo);
35952
+ }
35953
+ const info = {
35954
+ name: appInfo.data.name,
35955
+ version: appInfo.data.version,
35956
+ description: appInfo.data.description,
35957
+ appUrl: appInfo.data.appUrl,
35958
+ qrCodeUrl: appInfo.data.qrCodeUrl,
35959
+ logoUrl: appInfo.data.logoUrl
35960
+ };
35961
+ return info;
35962
+ }
35963
+ throw new Error("Can't get app info");
35964
+ });
35823
35965
 
35824
35966
  var eventemitter3 = createCommonjsModule(function (module) {
35825
35967
 
@@ -36191,129 +36333,6 @@
36191
36333
  }
36192
36334
  }
36193
36335
 
36194
- var config = (() => {
36195
- const Byte = 1;
36196
- const KB = 1024 * Byte;
36197
- const MB = 1024 * KB;
36198
- const device = checkPlatform();
36199
- return {
36200
- MINI_APP_LINK: 'https://zalo.me/app/link/zapps',
36201
- MINI_APP_INTERNAL_LINK: 'https://h5.zdn.vn/zapps',
36202
- COOKIE_NAME: {
36203
- ZOAUTH: `h5.zdn.vn_zoauth`,
36204
- ZACC_SESSiON: `h5.zdn.vn_zacc_session`,
36205
- JS_TOKEN: `h5.zdn.vn_zlink3rd`,
36206
- ZOAUTH_VRF: `h5.zdn.vn_zoauth_vrf`
36207
- },
36208
- APIS: {
36209
- GET_USER_INFO: 'https://graph.zalo.me/v2.0/me',
36210
- GET_ACCESS_TOKEN: 'https://h5.zalo.me/openapi/access_token',
36211
- GET_ACCESS_TOKEN_V3: 'https://oauth.zaloapp.com/v3/access_token'
36212
- },
36213
- STORAGE_DATA_LIMIT: 100 * KB,
36214
- STORAGE_LIMIT: 5 * MB,
36215
- NETWORK_TYPE: {
36216
- NONE: device.isAndroid ? -2 : 0,
36217
- WIFI: device.isAndroid ? 0 : 1,
36218
- '2G': device.isAndroid ? 2 : 2,
36219
- '3G': device.isAndroid ? 15 : 2,
36220
- '4G': device.isAndroid ? 13 : 2
36221
- },
36222
- MEDIA_PICKER_LIMIT: 1 * MB,
36223
- MEDIA_PICKER_UPLOAD_SERVER: 'https://zapi-server.tungnt.xyz/upload/photos'
36224
- };
36225
- })();
36226
-
36227
- function encode(bag) {
36228
- var pairs = [];
36229
- for (var key in bag) {
36230
- if (bag.hasOwnProperty(key)) {
36231
- var value = bag[key];
36232
- if (typeof value === "undefined") {
36233
- return;
36234
- }
36235
- if (value === null) {
36236
- pairs.push(key);
36237
- return;
36238
- }
36239
- pairs.push(encodeURIComponent(key) + "=" + encodeURIComponent(value));
36240
- }
36241
- }
36242
- return pairs.join("&");
36243
- }
36244
- function decode(str, strict) {
36245
- var data = {};
36246
- if (str === "") {
36247
- return data;
36248
- }
36249
- var pairs = str.split("&");
36250
- for (var i = 0; i < pairs.length; i++) {
36251
- var pair = pairs[i].split("=", 2);
36252
- var key = decodeURIComponent(pair[0]);
36253
- if (strict && Object.prototype.hasOwnProperty.call(data, key)) {
36254
- throw new URIError("Duplicate key: " + key);
36255
- }
36256
- data[key] = pair.length === 2 ? decodeURIComponent(pair[1]) : null;
36257
- }
36258
- return data;
36259
- }
36260
- function appendToUrl(url, params) {
36261
- return (url +
36262
- (url.indexOf("?") !== -1 ? "&" : "?") +
36263
- (typeof params === "string" ? params : QueryString.encode(params)));
36264
- }
36265
- function getParameterByName(name, url) {
36266
- if (!url) {
36267
- url = window.location.href;
36268
- }
36269
- name = name.replace(/[\[\]]/g, "\\$&");
36270
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
36271
- if (!results)
36272
- return null;
36273
- if (!results[2])
36274
- return "";
36275
- return decodeURIComponent(results[2].replace(/\+/g, " "));
36276
- }
36277
- function getParamsAsObject(query) {
36278
- var params = {};
36279
- if (!query)
36280
- return params;
36281
- var values = query.split("&");
36282
- values.map(function (item) {
36283
- var data = item.split("=");
36284
- if (!data || data.length != 2)
36285
- return;
36286
- params[data[0]] = decodeURIComponent(data[1].replace(/\+/g, " "));
36287
- });
36288
- return params;
36289
- }
36290
- function toQueryString(data) {
36291
- if (!data)
36292
- return "";
36293
- if ((typeof data === "undefined" ? "undefined" : typeof (data)) != "object")
36294
- return data;
36295
- var key = Object.keys(data);
36296
- var params = [];
36297
- key.map(function (k) {
36298
- var v = data[k];
36299
- if ((typeof v === "undefined" ? "undefined" : typeof (v)) == "object")
36300
- v = JSON.stringify(v);
36301
- else
36302
- v = encodeURIComponent(v);
36303
- var item = [k, v].join("=");
36304
- params.push(item);
36305
- });
36306
- return params.join("&");
36307
- }
36308
- const QueryString = {
36309
- encode: encode,
36310
- decode: decode,
36311
- appendToUrl: appendToUrl,
36312
- getParameterByName: getParameterByName,
36313
- getParamsAsObject: getParamsAsObject,
36314
- toQueryString: toQueryString,
36315
- };
36316
-
36317
36336
  var wrappers = {};
36318
36337
  var WrapperFn = function wrapFunction(fn, type, source) {
36319
36338
  var t = type || 'default';
@@ -36575,8 +36594,9 @@
36575
36594
  }
36576
36595
  jsCall(action, options, callback, isMultiCallback = false, nRetry = 3, haveTimeout = true) {
36577
36596
  try {
36578
- const key = generateUniqueString(action);
36579
- if (!this._device.isMobile || lodash.isEmpty(action)) {
36597
+ const actionName = action.name;
36598
+ const key = generateUniqueString(actionName);
36599
+ if (!this._device.isMobile || lodash.isEmpty(actionName)) {
36580
36600
  this.onJSCall(key, {
36581
36601
  error_code: -13,
36582
36602
  error_message: 'params invalid!',
@@ -36585,7 +36605,7 @@
36585
36605
  jsToken: this._jsAccessTk,
36586
36606
  access_token: this._accessTk
36587
36607
  },
36588
- action: action
36608
+ action: actionName
36589
36609
  });
36590
36610
  return false;
36591
36611
  }
@@ -36599,11 +36619,11 @@
36599
36619
  error_code: -14,
36600
36620
  error_message: 'Request Timeout!',
36601
36621
  data: {},
36602
- action: action
36622
+ action: actionName
36603
36623
  };
36604
36624
  this._jsCallFuncCallbacks[key] = {
36605
36625
  timeout: haveTimeout &&
36606
- ACTION_HAVE_CALLBACK.includes(action) &&
36626
+ action.have_callback &&
36607
36627
  setTimeout(() => {
36608
36628
  this.onJSCall(key, timeoutCallback);
36609
36629
  }, 8000),
@@ -36613,14 +36633,14 @@
36613
36633
  options = serialize(options);
36614
36634
  if (isMultiCallback) {
36615
36635
  if (this._device.isIOS) {
36616
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, window.onMultiJSCall(key));
36636
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, window.onMultiJSCall(key));
36617
36637
  }
36618
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, `window.onMultiJSCall('${key}')`);
36638
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, `window.onMultiJSCall('${key}')`);
36619
36639
  }
36620
36640
  if (this._device.isIOS) {
36621
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, window.onJSCall(key));
36641
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, window.onJSCall(key));
36622
36642
  }
36623
- return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, action, this._accessTk, options, `window.onJSCall('${key}')`);
36643
+ return ZaloJavaScriptInterface.jsCall(this._jsAccessTk, actionName, this._accessTk, options, `window.onJSCall('${key}')`);
36624
36644
  }
36625
36645
  catch (error) {
36626
36646
  if (nRetry-- > 0) {
@@ -36638,7 +36658,7 @@
36638
36658
  jsToken: this._jsAccessTk,
36639
36659
  access_token: this._accessTk
36640
36660
  },
36641
- action: action,
36661
+ action: actionName,
36642
36662
  js_error: error
36643
36663
  };
36644
36664
  this.onJSCall(key, errorCallback);
@@ -36669,7 +36689,7 @@
36669
36689
  __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsAccessTk = value;
36670
36690
  }
36671
36691
  callNative(action, data, option) {
36672
- this.debug(action, data);
36692
+ this.debug(action.name, data);
36673
36693
  return new Promise((resolve, reject) => {
36674
36694
  const fn = (cb) => __awaiter(this, void 0, void 0, function* () {
36675
36695
  try {
@@ -36685,7 +36705,7 @@
36685
36705
  else if (cb && cb.error_code < 0) {
36686
36706
  try {
36687
36707
  window.zmpSentry &&
36688
- window.zmpSentry.captureMessage(`${action}: call native fail`, {
36708
+ window.zmpSentry.captureMessage(`${action.name}: call native fail`, {
36689
36709
  extra: {
36690
36710
  data: data,
36691
36711
  rs: cb
@@ -36720,7 +36740,7 @@
36720
36740
  }
36721
36741
  _ZJSBridgeProvider_bridge = new WeakMap();
36722
36742
 
36723
- var version = "2.16.3";
36743
+ var version = "2.16.4";
36724
36744
 
36725
36745
  class Basics {
36726
36746
  /**
@@ -36762,31 +36782,9 @@
36762
36782
  */
36763
36783
  static getAppInfo() {
36764
36784
  return __awaiter(this, void 0, void 0, function* () {
36765
- let info = {};
36766
36785
  const appId = this.getAppId();
36767
36786
  const systemInfo = this.getSystemInfo();
36768
- const api = QueryString.appendToUrl(`${API_DOMAIN}${H5_API.GET_APP_INFO}`, {
36769
- appId,
36770
- versionStatus: 0,
36771
- currentVersion: systemInfo.version
36772
- });
36773
- const msgApi = yield fetch(api, {
36774
- credentials: 'include'
36775
- });
36776
- if (msgApi.ok) {
36777
- const appInfo = yield msgApi.json();
36778
- if (appInfo.err < 0 || !appInfo.data) {
36779
- throw new Error(appInfo);
36780
- }
36781
- info = {
36782
- name: appInfo.data.name,
36783
- version: appInfo.data.version,
36784
- description: appInfo.data.description,
36785
- appUrl: appInfo.data.appUrl,
36786
- qrCodeUrl: appInfo.data.qrCodeUrl
36787
- };
36788
- }
36789
- return info;
36787
+ return yield getAppInfo(appId, 0, systemInfo.version);
36790
36788
  });
36791
36789
  }
36792
36790
  }
@@ -36825,7 +36823,7 @@
36825
36823
  */
36826
36824
  static setNavigationBarTitle(object) {
36827
36825
  return __awaiter(this, void 0, void 0, function* () {
36828
- yield this.callNative(ACTION.CHANGE_TITLE_HEADER.name, {
36826
+ yield this.callNative(ACTION.CHANGE_TITLE_HEADER, {
36829
36827
  title: object.title
36830
36828
  }, {
36831
36829
  haveTimeout: false
@@ -36873,7 +36871,7 @@
36873
36871
  actionBarType = HIDE_ACTION_BAR;
36874
36872
  }
36875
36873
  this.setActionBarConfig((state) => (Object.assign(Object.assign({}, state), { actionbarType: actionBarType, dataConfig: Object.assign(Object.assign({}, state.dataConfig), dataConfig) })));
36876
- yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, Object.assign({}, this.getActionBarConfig()), {
36874
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR, Object.assign({}, this.getActionBarConfig()), {
36877
36875
  haveTimeout: false
36878
36876
  });
36879
36877
  });
@@ -36917,7 +36915,7 @@
36917
36915
  ? ACTION_LEFT_BUTTON_TYPE.SHOW_HOME
36918
36916
  : ACTION_LEFT_BUTTON_TYPE.HIDE_HOME;
36919
36917
  this.setActionBarConfig((state) => (Object.assign(Object.assign({}, state), { buttonType: leftButtonType, dataConfig: Object.assign(Object.assign({}, state.dataConfig), { viewInLeftType: leftButtonType }), homeConfig: Object.assign(Object.assign({}, state.homeConfig), { enable: showHomeButton }) })));
36920
- yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE.name, Object.assign({}, this.getActionBarConfig()), {
36918
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR_LEFTBUTTON_TYPE, Object.assign({}, this.getActionBarConfig()), {
36921
36919
  haveTimeout: false
36922
36920
  });
36923
36921
  });
@@ -36959,7 +36957,7 @@
36959
36957
  */
36960
36958
  static setNavigationBarRightButton(object) {
36961
36959
  return __awaiter(this, void 0, void 0, function* () {
36962
- yield this.callNative(ACTION.CREATE_OPTIONS_MENU.name, {
36960
+ yield this.callNative(ACTION.CREATE_OPTIONS_MENU, {
36963
36961
  supportToolBar: object.supportToolBar,
36964
36962
  reset: object.reset,
36965
36963
  menuListItems: object.menuListItems,
@@ -36995,7 +36993,7 @@
36995
36993
  return __awaiter(this, void 0, void 0, function* () {
36996
36994
  if (lodash.isString(object.backgroundColor) &&
36997
36995
  object.backgroundColor.length > 0) {
36998
- yield this.callNative(ACTION.CHANGE_ACTIONBAR.name, {
36996
+ yield this.callNative(ACTION.CHANGE_ACTIONBAR, {
36999
36997
  actionbarType: this.isShowNavBar ? 5 : 6,
37000
36998
  dataConfig: {
37001
36999
  backgroundColor: object.backgroundColor,
@@ -37107,7 +37105,7 @@
37107
37105
  */
37108
37106
  static setDeviceOrientation(object) {
37109
37107
  return __awaiter(this, void 0, void 0, function* () {
37110
- yield this.callNative(ACTION.CHANGE_AUTOROTATE.name, {
37108
+ yield this.callNative(ACTION.CHANGE_AUTOROTATE, {
37111
37109
  autoRotate: OrientationType[object.rotate]
37112
37110
  });
37113
37111
  });
@@ -37131,26 +37129,27 @@
37131
37129
  */
37132
37130
  static getNetworkType(object) {
37133
37131
  return __awaiter(this, void 0, void 0, function* () {
37134
- const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE.name, {
37132
+ const resData = yield this.callNative(ACTION.WEBVIEW_NETWORKTYPE, {
37135
37133
  url: window.location.href,
37136
37134
  featureId: ''
37137
37135
  }).then((data) => {
37138
37136
  const network = data.network;
37139
37137
  let networkType;
37138
+ const isAndroid = checkPlatform().isAndroid;
37140
37139
  switch (network) {
37141
- case config.NETWORK_TYPE.NONE:
37140
+ case NETWORK_TYPE(isAndroid).NONE:
37142
37141
  networkType = NetworkType.none;
37143
37142
  break;
37144
- case config.NETWORK_TYPE.WIFI:
37143
+ case NETWORK_TYPE(isAndroid).WIFI:
37145
37144
  networkType = NetworkType.wifi;
37146
37145
  break;
37147
- case config.NETWORK_TYPE['2G']:
37146
+ case NETWORK_TYPE(isAndroid)['2G']:
37148
37147
  networkType = NetworkType.cellular;
37149
37148
  break;
37150
- case config.NETWORK_TYPE['3G']:
37149
+ case NETWORK_TYPE(isAndroid)['3G']:
37151
37150
  networkType = NetworkType.cellular;
37152
37151
  break;
37153
- case config.NETWORK_TYPE['4G']:
37152
+ case NETWORK_TYPE(isAndroid)['4G']:
37154
37153
  networkType = NetworkType.cellular;
37155
37154
  break;
37156
37155
  default:
@@ -37244,7 +37243,7 @@
37244
37243
  items: Array.isArray(object === null || object === void 0 ? void 0 : object.items) ? object === null || object === void 0 ? void 0 : object.items : []
37245
37244
  }
37246
37245
  };
37247
- yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
37246
+ yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
37248
37247
  return true;
37249
37248
  });
37250
37249
  }
@@ -37263,7 +37262,7 @@
37263
37262
  const data = {
37264
37263
  subaction: 2
37265
37264
  };
37266
- yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data));
37265
+ yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data));
37267
37266
  return true;
37268
37267
  });
37269
37268
  }
@@ -37284,7 +37283,7 @@
37284
37283
  const data = {
37285
37284
  subaction: 1
37286
37285
  };
37287
- const resData = yield this.callNative(ACTION.SCAN_IBEACON.name, Object.assign({}, data), {
37286
+ const resData = yield this.callNative(ACTION.SCAN_IBEACON, Object.assign({}, data), {
37288
37287
  isMultiCallback: true
37289
37288
  }).then((resData) => {
37290
37289
  const res = {
@@ -37326,7 +37325,9 @@
37326
37325
  */
37327
37326
  static stopBluetoothDevicesDiscovery() {
37328
37327
  return __awaiter(this, void 0, void 0, function* () {
37329
- return this.callNative('', {});
37328
+ return this.callNative({
37329
+ name: ''
37330
+ }, {});
37330
37331
  });
37331
37332
  }
37332
37333
  /**
@@ -37351,7 +37352,9 @@
37351
37352
  */
37352
37353
  static startBluetoothDevicesDiscovery(object) {
37353
37354
  return __awaiter(this, void 0, void 0, function* () {
37354
- return this.callNative('', Object.assign({}, object));
37355
+ return this.callNative({
37356
+ name: ''
37357
+ }, Object.assign({}, object));
37355
37358
  });
37356
37359
  }
37357
37360
  /**
@@ -37373,7 +37376,9 @@
37373
37376
  */
37374
37377
  static openBluetoothAdapter() {
37375
37378
  return __awaiter(this, void 0, void 0, function* () {
37376
- return this.callNative('', {});
37379
+ return this.callNative({
37380
+ name: ''
37381
+ }, {});
37377
37382
  });
37378
37383
  }
37379
37384
  /**
@@ -37391,7 +37396,9 @@
37391
37396
  */
37392
37397
  static onBluetoothDeviceFound() {
37393
37398
  return __awaiter(this, void 0, void 0, function* () {
37394
- return this.callNative('', {});
37399
+ return this.callNative({
37400
+ name: ''
37401
+ }, {});
37395
37402
  });
37396
37403
  }
37397
37404
  /**
@@ -37437,7 +37444,9 @@
37437
37444
  const data = {
37438
37445
  services: object.services || []
37439
37446
  };
37440
- return this.callNative('', data);
37447
+ return this.callNative({
37448
+ name: ''
37449
+ }, data);
37441
37450
  });
37442
37451
  }
37443
37452
  /**
@@ -37456,7 +37465,9 @@
37456
37465
  */
37457
37466
  static getBluetoothDevices() {
37458
37467
  return __awaiter(this, void 0, void 0, function* () {
37459
- return this.callNative('', {});
37468
+ return this.callNative({
37469
+ name: ''
37470
+ }, {});
37460
37471
  });
37461
37472
  }
37462
37473
  /**
@@ -37475,7 +37486,9 @@
37475
37486
  */
37476
37487
  static getBluetoothAdapterState() {
37477
37488
  return __awaiter(this, void 0, void 0, function* () {
37478
- return this.callNative('', {});
37489
+ return this.callNative({
37490
+ name: ''
37491
+ }, {});
37479
37492
  });
37480
37493
  }
37481
37494
  /**
@@ -37494,7 +37507,9 @@
37494
37507
  */
37495
37508
  static closeBluetoothAdapter() {
37496
37509
  return __awaiter(this, void 0, void 0, function* () {
37497
- return this.callNative('', {});
37510
+ return this.callNative({
37511
+ name: ''
37512
+ }, {});
37498
37513
  });
37499
37514
  }
37500
37515
  /**
@@ -37506,7 +37521,7 @@
37506
37521
  */
37507
37522
  static scanQRCode(object) {
37508
37523
  return __awaiter(this, void 0, void 0, function* () {
37509
- return yield this.callNative(ACTION.OPEN_QR.name, {
37524
+ return yield this.callNative(ACTION.OPEN_QR, {
37510
37525
  skipOpenLink: true
37511
37526
  });
37512
37527
  });
@@ -37520,7 +37535,7 @@
37520
37535
  */
37521
37536
  static showToast(object) {
37522
37537
  return __awaiter(this, void 0, void 0, function* () {
37523
- yield this.callNative(ACTION.SHOW_TOAST.name, {
37538
+ yield this.callNative(ACTION.SHOW_TOAST, {
37524
37539
  toast: object.message
37525
37540
  });
37526
37541
  });
@@ -37534,7 +37549,7 @@
37534
37549
  */
37535
37550
  static hideKeyboard(object) {
37536
37551
  return __awaiter(this, void 0, void 0, function* () {
37537
- yield this.callNative(ACTION.HIDE_KEYBOARD.name, {});
37552
+ yield this.callNative(ACTION.HIDE_KEYBOARD, {});
37538
37553
  });
37539
37554
  }
37540
37555
  /**
@@ -37546,7 +37561,7 @@
37546
37561
  */
37547
37562
  static openPhone(object) {
37548
37563
  return __awaiter(this, void 0, void 0, function* () {
37549
- yield this.callNative(ACTION.OPEN_PHONE.name, {
37564
+ yield this.callNative(ACTION.OPEN_PHONE, {
37550
37565
  phoneNum: object.phoneNumber,
37551
37566
  phoneCode: object.phoneNumber
37552
37567
  });
@@ -37561,7 +37576,7 @@
37561
37576
  */
37562
37577
  static openSMS(object) {
37563
37578
  return __awaiter(this, void 0, void 0, function* () {
37564
- yield this.callNative(ACTION.OPEN_SMS.name, {
37579
+ yield this.callNative(ACTION.OPEN_SMS, {
37565
37580
  content: object.content,
37566
37581
  phoneCode: object.phoneNumber
37567
37582
  });
@@ -37576,7 +37591,7 @@
37576
37591
  */
37577
37592
  static keepScreen(object) {
37578
37593
  return __awaiter(this, void 0, void 0, function* () {
37579
- return yield this.callNative(ACTION.KEEP_SCREEN.name, {
37594
+ return yield this.callNative(ACTION.KEEP_SCREEN, {
37580
37595
  data: {
37581
37596
  keep_screen_on: object.keepScreenOn ? 1 : 0
37582
37597
  }
@@ -37592,7 +37607,7 @@
37592
37607
  */
37593
37608
  static openBioAuthentication(object) {
37594
37609
  return __awaiter(this, void 0, void 0, function* () {
37595
- return yield this.callNative(ACTION.PROMPT_AUTHENTICATION.name, {
37610
+ return yield this.callNative(ACTION.PROMPT_AUTHENTICATION, {
37596
37611
  secret_data: object.secretData,
37597
37612
  app_id: this.getZAppId(),
37598
37613
  ui: {
@@ -37631,7 +37646,7 @@
37631
37646
  */
37632
37647
  static checkStateBioAuthentication(object) {
37633
37648
  return __awaiter(this, void 0, void 0, function* () {
37634
- return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE.name, {}).then((data) => {
37649
+ return yield this.callNative(ACTION.PROMPT_AUTHENTICATION_CHECK_STATE, {}).then((data) => {
37635
37650
  return {
37636
37651
  bioState: data === null || data === void 0 ? void 0 : data.bio_state
37637
37652
  };
@@ -37647,7 +37662,7 @@
37647
37662
  */
37648
37663
  static vibrate(object) {
37649
37664
  return __awaiter(this, void 0, void 0, function* () {
37650
- return yield this.callNative(ACTION.INTERACTIVE_VIBRATION.name, {
37665
+ return yield this.callNative(ACTION.INTERACTIVE_VIBRATION, {
37651
37666
  type: VibrateType[object.type],
37652
37667
  vibrate_time: object.milliseconds
37653
37668
  });
@@ -37666,7 +37681,7 @@
37666
37681
  if (lodash.isString(object.password) && object.password.length > 0) {
37667
37682
  securityType = 'wpa_wpa2';
37668
37683
  }
37669
- return yield this.callNative(ACTION.MP_JOIN_WIFI.name, {
37684
+ return yield this.callNative(ACTION.MP_JOIN_WIFI, {
37670
37685
  ssid: object.SSID,
37671
37686
  securityType: securityType,
37672
37687
  password: object.password,
@@ -37694,7 +37709,7 @@
37694
37709
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37695
37710
  keys: new Set(),
37696
37711
  currentSize: 0,
37697
- limitSize: config.STORAGE_LIMIT
37712
+ limitSize: STORAGE_LIMIT
37698
37713
  });
37699
37714
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37700
37715
  this.findAllCurrentDataByApp(prefix);
@@ -37757,7 +37772,7 @@
37757
37772
  currentSize: lodash.isNumber(currentSize)
37758
37773
  ? Number((currentSize / 1024).toFixed(2))
37759
37774
  : 0,
37760
- limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37775
+ limitSize: Number((STORAGE_LIMIT / 1024).toFixed(2))
37761
37776
  };
37762
37777
  }
37763
37778
  remove(keys) {
@@ -37803,13 +37818,13 @@
37803
37818
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37804
37819
  keys: new Set(),
37805
37820
  currentSize: 0,
37806
- limitSize: config.STORAGE_LIMIT
37821
+ limitSize: STORAGE_LIMIT
37807
37822
  });
37808
37823
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37809
37824
  }
37810
37825
  get(keys) {
37811
37826
  return __awaiter(this, void 0, void 0, function* () {
37812
- return yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37827
+ return yield this.callNative(ACTION.ZBROWSER_MPDS, {
37813
37828
  mpds_action: 'mpds.get',
37814
37829
  mpds_data: {
37815
37830
  keys
@@ -37828,7 +37843,7 @@
37828
37843
  }
37829
37844
  set(data) {
37830
37845
  return __awaiter(this, void 0, void 0, function* () {
37831
- const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37846
+ const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37832
37847
  mpds_action: 'mpds.set',
37833
37848
  mpds_data: {
37834
37849
  map: data
@@ -37848,7 +37863,7 @@
37848
37863
  }
37849
37864
  getInfo() {
37850
37865
  return __awaiter(this, void 0, void 0, function* () {
37851
- const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37866
+ const currentSize = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37852
37867
  mpds_action: 'mpds.get.size',
37853
37868
  mpds_data: {},
37854
37869
  appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
@@ -37863,13 +37878,13 @@
37863
37878
  });
37864
37879
  return {
37865
37880
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37866
- limitSize: Number(config.STORAGE_LIMIT / 1024)
37881
+ limitSize: Number(STORAGE_LIMIT / 1024)
37867
37882
  };
37868
37883
  });
37869
37884
  }
37870
37885
  remove(keys) {
37871
37886
  return __awaiter(this, void 0, void 0, function* () {
37872
- const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37887
+ const errorKeys = yield this.callNative(ACTION.ZBROWSER_MPDS, {
37873
37888
  mpds_action: 'mpds.remove.key',
37874
37889
  mpds_data: {
37875
37890
  keys: keys
@@ -37889,7 +37904,7 @@
37889
37904
  }
37890
37905
  clear() {
37891
37906
  return __awaiter(this, void 0, void 0, function* () {
37892
- yield this.callNative(ACTION.ZBROWSER_MPDS.name, {
37907
+ yield this.callNative(ACTION.ZBROWSER_MPDS, {
37893
37908
  mpds_action: 'mpds.clear.appData',
37894
37909
  mpds_data: {},
37895
37910
  appId: __classPrivateFieldGet(this, _NativeResourceStorage_appId)
@@ -38119,7 +38134,7 @@
38119
38134
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38120
38135
  }
38121
38136
  const userInfo = yield axios
38122
- .get(config.APIS.GET_USER_INFO, {
38137
+ .get(APIS.GET_USER_INFO, {
38123
38138
  params: {
38124
38139
  fields: fields,
38125
38140
  access_token: accessToken
@@ -38152,7 +38167,7 @@
38152
38167
  */
38153
38168
  static getPhoneNumber(object) {
38154
38169
  return __awaiter(this, void 0, void 0, function* () {
38155
- return yield this.callNative(ACTION.MP_GET_NUMBER.name, {}, {
38170
+ return yield this.callNative(ACTION.MP_GET_NUMBER, {}, {
38156
38171
  isMultiCallback: true,
38157
38172
  callback: (nativeData, error) => {
38158
38173
  if (nativeData.error_code === 0) {
@@ -38182,7 +38197,7 @@
38182
38197
  */
38183
38198
  static closeApp(object) {
38184
38199
  return __awaiter(this, void 0, void 0, function* () {
38185
- yield this.callNative(ACTION.WINDOW_CLOSE.name, {});
38200
+ yield this.callNative(ACTION.WINDOW_CLOSE, {});
38186
38201
  });
38187
38202
  }
38188
38203
  /**
@@ -38202,10 +38217,12 @@
38202
38217
  return [key, value].join('=');
38203
38218
  })
38204
38219
  .join('&');
38205
- yield this.callNative(ACTION.OPEN_MP.name, {
38206
- mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38220
+ const appInfo = yield getAppInfo(appId, 0);
38221
+ yield this.callNative(ACTION.OPEN_MP, {
38222
+ mpUrl: `${MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38207
38223
  mpInfo: {
38208
- appId: appId
38224
+ appId: appId,
38225
+ appAvtUrl: appInfo.logoUrl || ''
38209
38226
  }
38210
38227
  });
38211
38228
  });
@@ -38220,7 +38237,7 @@
38220
38237
  */
38221
38238
  static openWebview(object) {
38222
38239
  return __awaiter(this, void 0, void 0, function* () {
38223
- yield this.callNative(ACTION.OPEN_INAPP.name, {
38240
+ yield this.callNative(ACTION.OPEN_INAPP, {
38224
38241
  url: object.url
38225
38242
  });
38226
38243
  });
@@ -38245,7 +38262,7 @@
38245
38262
  */
38246
38263
  static getLocation(object) {
38247
38264
  return __awaiter(this, void 0, void 0, function* () {
38248
- return yield this.callNative(ACTION.GET_LOCATION.name, {
38265
+ return yield this.callNative(ACTION.GET_LOCATION, {
38249
38266
  silent_request: false,
38250
38267
  permission_description: 'Cho phép Zalo truy cập vào vị trí của thiết bị này?'
38251
38268
  }, {
@@ -38284,7 +38301,7 @@
38284
38301
  */
38285
38302
  static sendLocation(object) {
38286
38303
  return __awaiter(this, void 0, void 0, function* () {
38287
- yield this.callNative(ACTION.QUERY_LOCATION_HIDE.name, {
38304
+ yield this.callNative(ACTION.QUERY_LOCATION_HIDE, {
38288
38305
  title: object.title,
38289
38306
  touserid: object.toUserId,
38290
38307
  zapp: this.getZAppId()
@@ -38304,7 +38321,7 @@
38304
38321
  */
38305
38322
  static requestCameraPermission(object) {
38306
38323
  return __awaiter(this, void 0, void 0, function* () {
38307
- return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA.name, {}, {
38324
+ return yield this.callNative(ACTION.REQUEST_PERMISSION_CAMERA, {}, {
38308
38325
  callback: (nativeData, error) => {
38309
38326
  if (nativeData.error_code === -2 || nativeData.error_code >= 0) {
38310
38327
  return Promise.resolve({
@@ -38340,7 +38357,7 @@
38340
38357
  imageUrl: object.imageUrl
38341
38358
  };
38342
38359
  }
38343
- return yield this.callNative(ACTION.SAVE_IMAGE_GALLERY.name, Object.assign({}, data));
38360
+ return yield this.callNative(ACTION.SAVE_IMAGE_GALLERY, Object.assign({}, data));
38344
38361
  });
38345
38362
  }
38346
38363
  }
@@ -38355,7 +38372,7 @@
38355
38372
  */
38356
38373
  static viewOAQr(object) {
38357
38374
  return __awaiter(this, void 0, void 0, function* () {
38358
- yield this.callNative(ACTION.VIEW_MYQR.name, {
38375
+ yield this.callNative(ACTION.VIEW_MYQR, {
38359
38376
  dpn: object.displayName,
38360
38377
  uid: object.id,
38361
38378
  zapp: this.getZAppId()
@@ -38374,7 +38391,7 @@
38374
38391
  */
38375
38392
  static openProfile(object) {
38376
38393
  return __awaiter(this, void 0, void 0, function* () {
38377
- return yield this.callNative(ACTION.OPEN_PROFILE.name, {
38394
+ return yield this.callNative(ACTION.OPEN_PROFILE, {
38378
38395
  uId: object.id,
38379
38396
  type: ProfileType[object.type],
38380
38397
  zapp: this.getZAppId(),
@@ -38392,7 +38409,7 @@
38392
38409
  */
38393
38410
  static openChat(object) {
38394
38411
  return __awaiter(this, void 0, void 0, function* () {
38395
- return yield this.callNative(ACTION.OPEN_CHAT.name, {
38412
+ return yield this.callNative(ACTION.OPEN_CHAT, {
38396
38413
  uId: object.id,
38397
38414
  type: ChatType[object.type],
38398
38415
  zapp: this.getZAppId(),
@@ -38433,7 +38450,7 @@
38433
38450
  };
38434
38451
  break;
38435
38452
  }
38436
- return yield this.callNative(ACTION.OPEN_POSTFEED.name, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
38453
+ return yield this.callNative(ACTION.OPEN_POSTFEED, Object.assign(Object.assign({ type: PostFeedType[object.type] }, reqData), { zapp: this.getZAppId() })).then((res) => {
38437
38454
  return {
38438
38455
  status: res.status,
38439
38456
  shareType: res.share_type,
@@ -38452,7 +38469,7 @@
38452
38469
  */
38453
38470
  static followOA(object) {
38454
38471
  return __awaiter(this, void 0, void 0, function* () {
38455
- yield this.callNative(ACTION.FOLLOW_OA.name, {
38472
+ yield this.callNative(ACTION.FOLLOW_OA, {
38456
38473
  uid: object.id,
38457
38474
  showDialogConfirm: true,
38458
38475
  zapp: this.getZAppId()
@@ -38471,7 +38488,7 @@
38471
38488
  */
38472
38489
  static unfollowOA(object) {
38473
38490
  return __awaiter(this, void 0, void 0, function* () {
38474
- yield this.callNative(ACTION.UNFOLLOW_OA.name, {
38491
+ yield this.callNative(ACTION.UNFOLLOW_OA, {
38475
38492
  uid: object.id,
38476
38493
  zapp: this.getZAppId()
38477
38494
  }, {
@@ -38551,7 +38568,7 @@
38551
38568
  object.type = 'link';
38552
38569
  }
38553
38570
  }
38554
- return yield this.callNative(ACTION.OPEN_SHARESHEET.name, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38571
+ return yield this.callNative(ACTION.OPEN_SHARESHEET, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38555
38572
  haveTimeout: false
38556
38573
  }).then((res) => {
38557
38574
  return {
@@ -38572,7 +38589,7 @@
38572
38589
  */
38573
38590
  static createShortcut(url, title, icon) {
38574
38591
  return __awaiter(this, void 0, void 0, function* () {
38575
- return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38592
+ return yield this.callNative(ACTION.CREATE_SHORTCUT, {
38576
38593
  url: url,
38577
38594
  title: title,
38578
38595
  iconUrl: icon
@@ -38589,7 +38606,7 @@
38589
38606
  */
38590
38607
  static openProfilePicker(object) {
38591
38608
  return __awaiter(this, void 0, void 0, function* () {
38592
- return yield this.callNative(ACTION.MP_OPEN_PROFILE_PICKER.name, {
38609
+ return yield this.callNative(ACTION.MP_OPEN_PROFILE_PICKER, {
38593
38610
  maxProfile: object === null || object === void 0 ? void 0 : object.maxProfile
38594
38611
  }, {
38595
38612
  isMultiCallback: true,
@@ -38615,7 +38632,7 @@
38615
38632
  */
38616
38633
  static getActionsSupported(object) {
38617
38634
  return __awaiter(this, void 0, void 0, function* () {
38618
- return yield this.callNative(ACTION.GET_SUPPORTED_ACTIONS.name, {}, {
38635
+ return yield this.callNative(ACTION.GET_SUPPORTED_ACTIONS, {}, {
38619
38636
  isMultiCallback: false,
38620
38637
  callback: (nativeData, error) => {
38621
38638
  const platform = getPlatform();
@@ -38650,14 +38667,14 @@
38650
38667
  return __awaiter(this, void 0, void 0, function* () {
38651
38668
  const uploadSetting = {
38652
38669
  type: 0,
38653
- url: config.MEDIA_PICKER_UPLOAD_SERVER,
38654
- maxSize: config.MEDIA_PICKER_LIMIT
38670
+ url: MEDIA_PICKER_UPLOAD_SERVER,
38671
+ maxSize: MEDIA_PICKER_LIMIT
38655
38672
  };
38656
38673
  const defaultEditView = {
38657
38674
  enable: 1,
38658
38675
  aspect_ratio: '1:1'
38659
38676
  };
38660
- return yield this.callNative(ACTION.PICK_MEDIA.name, {
38677
+ return yield this.callNative(ACTION.PICK_MEDIA, {
38661
38678
  media_type: MediaPickerType[type],
38662
38679
  edit_view: Object.assign(Object.assign({}, defaultEditView), editView),
38663
38680
  silent_request: silentRequest,
@@ -38689,7 +38706,7 @@
38689
38706
  */
38690
38707
  static openOutApp(url) {
38691
38708
  return __awaiter(this, void 0, void 0, function* () {
38692
- return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38709
+ return yield this.callNative(ACTION.OPEN_OUTAPP, {
38693
38710
  url: url
38694
38711
  });
38695
38712
  });
@@ -38728,7 +38745,7 @@
38728
38745
  */
38729
38746
  static sendDataToPreviousMiniApp(object) {
38730
38747
  return __awaiter(this, void 0, void 0, function* () {
38731
- return yield this.callNative(ACTION.WEBVIEW_SET_RESULT.name, {
38748
+ return yield this.callNative(ACTION.WEBVIEW_SET_RESULT, {
38732
38749
  result: stringifyData(object.data)
38733
38750
  });
38734
38751
  });
@@ -38788,10 +38805,10 @@
38788
38805
  resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies));
38789
38806
  }
38790
38807
  else {
38791
- this.callNative('action.jump.login', {})
38808
+ this.callNative(ACTION.JUMP_LOGIN, {})
38792
38809
  .then((data) => {
38793
38810
  const cookies = (data && data.cookiesOAuthLogins) || [];
38794
- const jsToken = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.JS_TOKEN);
38811
+ const jsToken = cookies.find((cookie) => cookie.name === COOKIE_NAME.JS_TOKEN);
38795
38812
  if (jsToken) {
38796
38813
  this.setJSToken(jsToken.value);
38797
38814
  window.ZJSBridge.setJSToken &&
@@ -38898,7 +38915,7 @@
38898
38915
  },
38899
38916
  homeConfig: {
38900
38917
  enable: showHomeButton,
38901
- url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38918
+ url: `${MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38902
38919
  }
38903
38920
  });
38904
38921
  }
@@ -38920,8 +38937,8 @@
38920
38937
  login(object) {
38921
38938
  return __awaiter(this, void 0, void 0, function* () {
38922
38939
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38923
- const zOAuthCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH);
38924
- const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH_VRF);
38940
+ const zOAuthCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH);
38941
+ const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === COOKIE_NAME.ZOAUTH_VRF);
38925
38942
  if (!lodash.isUndefined(zOAuthCookie) &&
38926
38943
  !lodash.isNull(zOAuthCookie) &&
38927
38944
  lodash.isString(zOAuthCookie.value)) {
@@ -38946,10 +38963,10 @@
38946
38963
  loginZaloV3() {
38947
38964
  return __awaiter(this, void 0, void 0, function* () {
38948
38965
  return yield axios
38949
- .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38966
+ .get(APIS.GET_ACCESS_TOKEN_V3, {
38950
38967
  params: {
38951
38968
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38952
- redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38969
+ redirect_uri: `${MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38953
38970
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38954
38971
  isSDK: true
38955
38972
  }
@@ -38983,13 +39000,13 @@
38983
39000
  inputData.append('grant_type', 'refresh_token');
38984
39001
  inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38985
39002
  }
38986
- const config$1 = {
39003
+ const config = {
38987
39004
  headers: {
38988
39005
  'Content-Type': 'application/x-www-form-urlencoded'
38989
39006
  }
38990
39007
  };
38991
39008
  return yield axios
38992
- .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
39009
+ .post(APIS.GET_ACCESS_TOKEN, inputData, config)
38993
39010
  .then((response) => {
38994
39011
  const resData = response.data;
38995
39012
  if (resData.refresh_token) {
@@ -40832,8 +40849,8 @@
40832
40849
  createShortcut(object) {
40833
40850
  return __awaiter(this, void 0, void 0, function* () {
40834
40851
  const isIOS = checkPlatform().isIOS;
40835
- let iconURL = getMetaValue('og:image:url');
40836
- console.log('iconURL', iconURL);
40852
+ let iconURL = getMetaValue('og:image:url') || '';
40853
+ iconURL = iconURL.replace(/^zbrowser?:/, '');
40837
40854
  if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
40838
40855
  iconURL = `https:${iconURL}`;
40839
40856
  }
@@ -40847,7 +40864,7 @@
40847
40864
  return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openOutApp(encodeURI(iosShortcutURL));
40848
40865
  }
40849
40866
  else
40850
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${config.MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40867
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40851
40868
  });
40852
40869
  }
40853
40870
  openBioAuthentication(object) {