zmp-sdk 2.16.3 → 2.16.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.
@@ -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.6";
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) {
@@ -38165,7 +38180,7 @@
38165
38180
  return Promise.reject(error);
38166
38181
  }
38167
38182
  },
38168
- delay: this.isIOS ? 200 : 0
38183
+ delay: this.isIOS ? 400 : 0
38169
38184
  });
38170
38185
  });
38171
38186
  }
@@ -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
  }, {
@@ -38270,7 +38287,7 @@
38270
38287
  return Promise.reject(error);
38271
38288
  }
38272
38289
  },
38273
- delay: this.isIOS ? 200 : 0
38290
+ delay: this.isIOS ? 400 : 0
38274
38291
  });
38275
38292
  });
38276
38293
  }
@@ -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
  });
@@ -38753,51 +38770,51 @@
38753
38770
  }
38754
38771
  }
38755
38772
 
38756
- var _ZaloMiniProgramSDK_zAppId, _ZaloMiniProgramSDK_appId, _ZaloMiniProgramSDK_appConfig, _ZaloMiniProgramSDK_zOAuth, _ZaloMiniProgramSDK_zOAuthVrf, _ZaloMiniProgramSDK_accessToken, _ZaloMiniProgramSDK_refreshToken, _ZaloMiniProgramSDK_cache, _ZaloMiniProgramSDK_prevGetTokenTimestamp, _ZaloMiniProgramSDK_tokenExpiresIn, _ZaloMiniProgramSDK_cookies, _ZaloMiniProgramSDK_actionBarConfig, _ZaloMiniProgramSDK_callJump, _ZaloMiniProgramSDK_setNavigationBarRightButton, _ZaloMiniProgramSDK_getActionsSupported;
38757
- class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38773
+ var _ZaloMiniProgramSDKService_zAppId, _ZaloMiniProgramSDKService_appId, _ZaloMiniProgramSDKService_appConfig, _ZaloMiniProgramSDKService_zOAuth, _ZaloMiniProgramSDKService_zOAuthVrf, _ZaloMiniProgramSDKService_accessToken, _ZaloMiniProgramSDKService_refreshToken, _ZaloMiniProgramSDKService_cache, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, _ZaloMiniProgramSDKService_tokenExpiresIn, _ZaloMiniProgramSDKService_cookies, _ZaloMiniProgramSDKService_actionBarConfig, _ZaloMiniProgramSDKService_callJump, _ZaloMiniProgramSDKService_setNavigationBarRightButton, _ZaloMiniProgramSDKService_getActionsSupported;
38774
+ class ZaloMiniProgramSDKService extends ZJSBridgeProvider {
38758
38775
  constructor() {
38759
- var _a, _b, _c, _d, _e, _f, _g, _h;
38776
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
38760
38777
  super();
38761
- _ZaloMiniProgramSDK_zAppId.set(this, ZAPP_ID);
38762
- _ZaloMiniProgramSDK_appId.set(this, APP_ID);
38763
- _ZaloMiniProgramSDK_appConfig.set(this, APP_CONFIG);
38764
- _ZaloMiniProgramSDK_zOAuth.set(this, void 0);
38765
- _ZaloMiniProgramSDK_zOAuthVrf.set(this, void 0);
38766
- _ZaloMiniProgramSDK_accessToken.set(this, void 0);
38767
- _ZaloMiniProgramSDK_refreshToken.set(this, null);
38768
- _ZaloMiniProgramSDK_cache.set(this, {
38778
+ _ZaloMiniProgramSDKService_zAppId.set(this, ZAPP_ID);
38779
+ _ZaloMiniProgramSDKService_appId.set(this, APP_ID);
38780
+ _ZaloMiniProgramSDKService_appConfig.set(this, APP_CONFIG);
38781
+ _ZaloMiniProgramSDKService_zOAuth.set(this, void 0);
38782
+ _ZaloMiniProgramSDKService_zOAuthVrf.set(this, void 0);
38783
+ _ZaloMiniProgramSDKService_accessToken.set(this, void 0);
38784
+ _ZaloMiniProgramSDKService_refreshToken.set(this, null);
38785
+ _ZaloMiniProgramSDKService_cache.set(this, {
38769
38786
  timer: {
38770
38787
  getToken: 0
38771
38788
  }
38772
38789
  });
38773
- _ZaloMiniProgramSDK_prevGetTokenTimestamp.set(this, void 0);
38774
- _ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
38775
- _ZaloMiniProgramSDK_cookies.set(this, null);
38790
+ _ZaloMiniProgramSDKService_prevGetTokenTimestamp.set(this, void 0);
38791
+ _ZaloMiniProgramSDKService_tokenExpiresIn.set(this, void 0);
38792
+ _ZaloMiniProgramSDKService_cookies.set(this, null);
38776
38793
  this.events = ZMPEEmitter.getInstance();
38777
38794
  this.isIOS = checkPlatform().isIOS;
38778
- _ZaloMiniProgramSDK_actionBarConfig.set(this, void 0);
38795
+ _ZaloMiniProgramSDKService_actionBarConfig.set(this, void 0);
38779
38796
  this.getActionBarConfig = () => {
38780
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig);
38797
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_actionBarConfig);
38781
38798
  };
38782
38799
  this.setActionBarConfig = (setState) => {
38783
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_actionBarConfig, setState(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig)));
38800
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_actionBarConfig, setState(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_actionBarConfig)));
38784
38801
  };
38785
- _ZaloMiniProgramSDK_callJump.set(this, () => {
38802
+ _ZaloMiniProgramSDKService_callJump.set(this, () => {
38786
38803
  return new Promise((resolve, reject) => {
38787
- if (!lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies)) && !lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies))) {
38788
- resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_cookies));
38804
+ if (!lodash.isUndefined(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies)) && !lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_cookies))) {
38805
+ resolve(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_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 &&
38798
38815
  window.ZJSBridge.setJSToken(jsToken.value);
38799
38816
  }
38800
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_cookies, cookies);
38817
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_cookies, cookies);
38801
38818
  resolve(cookies);
38802
38819
  })
38803
38820
  .catch((error) => {
@@ -38806,7 +38823,7 @@
38806
38823
  }
38807
38824
  });
38808
38825
  });
38809
- _ZaloMiniProgramSDK_setNavigationBarRightButton.set(this, NavigationBar.setNavigationBarRightButton);
38826
+ _ZaloMiniProgramSDKService_setNavigationBarRightButton.set(this, NavigationBar.setNavigationBarRightButton);
38810
38827
  this.getVersion = Basics.getVersion;
38811
38828
  this.getSystemInfo = Basics.getSystemInfo;
38812
38829
  this.setNavigationBarTitle = NavigationBar.setNavigationBarTitle;
@@ -38864,81 +38881,81 @@
38864
38881
  this.onCallbackData = Routing.onCallbackData;
38865
38882
  this.getPhoneNumber = OpenApi.getPhoneNumber;
38866
38883
  this.openProfilePicker = Zalo.openProfilePicker;
38867
- _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38884
+ _ZaloMiniProgramSDKService_getActionsSupported.set(this, Zalo.getActionsSupported);
38868
38885
  this.connectWifi = Device.connectWifi;
38869
38886
  this.openMediaPicker = Zalo.openMediaPicker;
38870
38887
  this.openOutApp = Zalo.openOutApp;
38871
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38872
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38873
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
38888
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, null);
38889
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuthVrf, null);
38890
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, null);
38874
38891
  this.isShowNavBar = true;
38875
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, 0);
38876
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, 0);
38877
- const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
38878
- ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
38892
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, 0);
38893
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, 0);
38894
+ const showHomeButton = ((_b = (_a = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.leftButton) === 'home' ||
38895
+ ((_d = (_c = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _c === void 0 ? void 0 : _c.app) === null || _d === void 0 ? void 0 : _d.leftButton) === 'both'
38879
38896
  ? ACTION_LEFT_BUTTON_TYPE.SHOW_HOME
38880
38897
  : ACTION_LEFT_BUTTON_TYPE.HIDE_HOME;
38881
38898
  const currentUrl = new URL(location.href);
38882
- const actionBarType = lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor) &&
38883
- __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor.length > 0
38899
+ const actionBarType = lodash.isString((_f = (_e = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _e === void 0 ? void 0 : _e.app) === null || _f === void 0 ? void 0 : _f.headerColor) &&
38900
+ ((_j = (_h = (_g = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _g === void 0 ? void 0 : _g.app) === null || _h === void 0 ? void 0 : _h.headerColor) === null || _j === void 0 ? void 0 : _j.length) > 0
38884
38901
  ? SHOW_ACTION_BAR
38885
38902
  : HIDE_ACTION_BAR;
38886
- const leftButtonType = ((_f = (_e = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _e === void 0 ? void 0 : _e.app) === null || _f === void 0 ? void 0 : _f.leftButton) === 'none' ||
38887
- ((_h = (_g = __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig)) === null || _g === void 0 ? void 0 : _g.app) === null || _h === void 0 ? void 0 : _h.leftButton) === 'home'
38903
+ const leftButtonType = ((_l = (_k = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _k === void 0 ? void 0 : _k.app) === null || _l === void 0 ? void 0 : _l.leftButton) === 'none' ||
38904
+ ((_o = (_m = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _m === void 0 ? void 0 : _m.app) === null || _o === void 0 ? void 0 : _o.leftButton) === 'home'
38888
38905
  ? ACTION_LEFT_BUTTON_TYPE.HIDE_BACK
38889
38906
  : ACTION_LEFT_BUTTON_TYPE.SHOW_BACK;
38890
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_actionBarConfig, {
38907
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_actionBarConfig, {
38891
38908
  actionbarType: actionBarType,
38892
38909
  buttonType: leftButtonType,
38893
38910
  dataConfig: {
38894
- backgroundColor: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.headerColor || '',
38895
- textColor: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appConfig).app.textColor || '',
38911
+ backgroundColor: ((_q = (_p = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _p === void 0 ? void 0 : _p.app) === null || _q === void 0 ? void 0 : _q.headerColor) || '',
38912
+ textColor: ((_s = (_r = __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appConfig)) === null || _r === void 0 ? void 0 : _r.app) === null || _s === void 0 ? void 0 : _s.textColor) || '',
38896
38913
  viewInLeftType: leftButtonType,
38897
38914
  confirmToExit: 1
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
  }
38905
38922
  static getInstance() {
38906
- if (!ZaloMiniProgramSDK.instance) {
38907
- ZaloMiniProgramSDK.instance = new ZaloMiniProgramSDK();
38923
+ if (!ZaloMiniProgramSDKService.instance) {
38924
+ ZaloMiniProgramSDKService.instance = new ZaloMiniProgramSDKService();
38908
38925
  }
38909
- return ZaloMiniProgramSDK.instance;
38926
+ return ZaloMiniProgramSDKService.instance;
38910
38927
  }
38911
38928
  getLoginStatus() {
38912
- return lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) && __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken).length > 0;
38929
+ return lodash.isString(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) && __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken).length > 0;
38913
38930
  }
38914
38931
  getAppId() {
38915
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId);
38932
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId);
38916
38933
  }
38917
38934
  getZAppId() {
38918
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId);
38935
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zAppId);
38919
38936
  }
38920
38937
  login(object) {
38921
38938
  return __awaiter(this, void 0, void 0, function* () {
38922
- 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);
38939
+ const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_callJump).call(this);
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)) {
38928
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, zOAuthCookie.value);
38945
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuth, zOAuthCookie.value);
38929
38946
  if (!lodash.isUndefined(zOAuthVrfCookie) &&
38930
38947
  !lodash.isNull(zOAuthVrfCookie) &&
38931
38948
  lodash.isString(zOAuthVrfCookie.value)) {
38932
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, zOAuthVrfCookie.value);
38949
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_zOAuthVrf, zOAuthVrfCookie.value);
38933
38950
  yield this.loginZaloV4();
38934
38951
  }
38935
38952
  else {
38936
38953
  yield this.loginZaloV3();
38937
38954
  }
38938
- if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
38955
+ if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) {
38939
38956
  throw apiResponse.error.loginFailed();
38940
38957
  }
38941
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
38958
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
38942
38959
  }
38943
38960
  throw apiResponse.error.loginFailed();
38944
38961
  });
@@ -38946,25 +38963,25 @@
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
- app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38952
- redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38953
- code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38968
+ app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zAppId),
38969
+ redirect_uri: `${MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId)}/`,
38970
+ code: __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuth),
38954
38971
  isSDK: true
38955
38972
  }
38956
38973
  })
38957
38974
  .then((response) => {
38958
38975
  let resData = response.data;
38959
38976
  if (resData.access_token) {
38960
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
38977
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, resData.access_token);
38961
38978
  const expiresIn = parseInt(resData.expires_in) * 1000;
38962
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
38963
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
38964
- this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38979
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, expiresIn);
38980
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, new Date().getTime());
38981
+ this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
38965
38982
  window.ZJSBridge.setZAccSession &&
38966
- window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
38967
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
38983
+ window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
38984
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
38968
38985
  }
38969
38986
  return null;
38970
38987
  });
@@ -38973,37 +38990,37 @@
38973
38990
  loginZaloV4() {
38974
38991
  return __awaiter(this, void 0, void 0, function* () {
38975
38992
  const inputData = new URLSearchParams();
38976
- inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId));
38977
- inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth) || '');
38978
- inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuthVrf) || '');
38979
- if (lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken))) {
38993
+ inputData.append('app_id', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_appId));
38994
+ inputData.append('code', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuth) || '');
38995
+ inputData.append('code_verifier', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_zOAuthVrf) || '');
38996
+ if (lodash.isNull(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_refreshToken))) {
38980
38997
  inputData.append('grant_type', 'authorization_code');
38981
38998
  }
38982
38999
  else {
38983
39000
  inputData.append('grant_type', 'refresh_token');
38984
- inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
39001
+ inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_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) {
38996
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_refreshToken, resData.refresh_token);
39013
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_refreshToken, resData.refresh_token);
38997
39014
  }
38998
39015
  if (resData.access_token) {
38999
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, resData.access_token);
39016
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_accessToken, resData.access_token);
39000
39017
  const expiresIn = parseInt(resData.expires_in) * 1000;
39001
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_tokenExpiresIn, expiresIn);
39002
- __classPrivateFieldSet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp, new Date().getTime());
39003
- this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39018
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_tokenExpiresIn, expiresIn);
39019
+ __classPrivateFieldSet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp, new Date().getTime());
39020
+ this.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
39004
39021
  window.ZJSBridge.setZAccSession &&
39005
- window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken) || '');
39006
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39022
+ window.ZJSBridge.setZAccSession(__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken) || '');
39023
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
39007
39024
  }
39008
39025
  return null;
39009
39026
  });
@@ -39011,43 +39028,43 @@
39011
39028
  }
39012
39029
  getAccessToken(object) {
39013
39030
  return __awaiter(this, void 0, void 0, function* () {
39014
- const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDK_prevGetTokenTimestamp);
39015
- if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken)) {
39031
+ const deltaTime = new Date().getTime() - __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_prevGetTokenTimestamp);
39032
+ if (!__classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken)) {
39016
39033
  throw apiResponse.error.loginRequired();
39017
39034
  }
39018
- if (deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDK_tokenExpiresIn))
39019
- return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_accessToken);
39035
+ if (deltaTime < __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_tokenExpiresIn))
39036
+ return __classPrivateFieldGet(this, _ZaloMiniProgramSDKService_accessToken);
39020
39037
  return yield this.login();
39021
39038
  });
39022
39039
  }
39023
39040
  }
39024
- _ZaloMiniProgramSDK_zAppId = new WeakMap(), _ZaloMiniProgramSDK_appId = new WeakMap(), _ZaloMiniProgramSDK_appConfig = new WeakMap(), _ZaloMiniProgramSDK_zOAuth = new WeakMap(), _ZaloMiniProgramSDK_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDK_accessToken = new WeakMap(), _ZaloMiniProgramSDK_refreshToken = new WeakMap(), _ZaloMiniProgramSDK_cache = new WeakMap(), _ZaloMiniProgramSDK_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDK_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDK_cookies = new WeakMap(), _ZaloMiniProgramSDK_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDK_callJump = new WeakMap(), _ZaloMiniProgramSDK_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDK_getActionsSupported = new WeakMap();
39041
+ _ZaloMiniProgramSDKService_zAppId = new WeakMap(), _ZaloMiniProgramSDKService_appId = new WeakMap(), _ZaloMiniProgramSDKService_appConfig = new WeakMap(), _ZaloMiniProgramSDKService_zOAuth = new WeakMap(), _ZaloMiniProgramSDKService_zOAuthVrf = new WeakMap(), _ZaloMiniProgramSDKService_accessToken = new WeakMap(), _ZaloMiniProgramSDKService_refreshToken = new WeakMap(), _ZaloMiniProgramSDKService_cache = new WeakMap(), _ZaloMiniProgramSDKService_prevGetTokenTimestamp = new WeakMap(), _ZaloMiniProgramSDKService_tokenExpiresIn = new WeakMap(), _ZaloMiniProgramSDKService_cookies = new WeakMap(), _ZaloMiniProgramSDKService_actionBarConfig = new WeakMap(), _ZaloMiniProgramSDKService_callJump = new WeakMap(), _ZaloMiniProgramSDKService_setNavigationBarRightButton = new WeakMap(), _ZaloMiniProgramSDKService_getActionsSupported = new WeakMap();
39025
39042
 
39026
- var _MockSDK_appId, _MockSDK_appConfig, _MockSDK_zOAuth, _MockSDK_accessToken, _MockSDK_cache, _MockSDK_loggedId;
39027
- class MockSDK {
39043
+ var _MockSDKService_appId, _MockSDKService_appConfig, _MockSDKService_zOAuth, _MockSDKService_accessToken, _MockSDKService_cache, _MockSDKService_loggedId;
39044
+ class MockSDKService {
39028
39045
  constructor() {
39029
- _MockSDK_appId.set(this, ZAPP_ID);
39030
- _MockSDK_appConfig.set(this, APP_CONFIG);
39031
- _MockSDK_zOAuth.set(this, 'DEFAULT ZOAUTH');
39032
- _MockSDK_accessToken.set(this, 'DEFAULT ACCESS TOKEN');
39033
- _MockSDK_cache.set(this, {
39046
+ _MockSDKService_appId.set(this, ZAPP_ID);
39047
+ _MockSDKService_appConfig.set(this, APP_CONFIG);
39048
+ _MockSDKService_zOAuth.set(this, 'DEFAULT ZOAUTH');
39049
+ _MockSDKService_accessToken.set(this, 'DEFAULT ACCESS TOKEN');
39050
+ _MockSDKService_cache.set(this, {
39034
39051
  timer: {
39035
39052
  getToken: 0
39036
39053
  }
39037
39054
  });
39038
- _MockSDK_loggedId.set(this, false);
39055
+ _MockSDKService_loggedId.set(this, false);
39039
39056
  this.getLoginStatus = () => {
39040
- return __classPrivateFieldGet(this, _MockSDK_loggedId);
39057
+ return __classPrivateFieldGet(this, _MockSDKService_loggedId);
39041
39058
  };
39042
39059
  this.getAppId = () => {
39043
- return __classPrivateFieldGet(this, _MockSDK_appId);
39060
+ return __classPrivateFieldGet(this, _MockSDKService_appId);
39044
39061
  };
39045
39062
  this.login = () => {
39046
- __classPrivateFieldSet(this, _MockSDK_loggedId, true);
39047
- return Promise.resolve(__classPrivateFieldGet(this, _MockSDK_zOAuth));
39063
+ __classPrivateFieldSet(this, _MockSDKService_loggedId, true);
39064
+ return Promise.resolve(__classPrivateFieldGet(this, _MockSDKService_zOAuth));
39048
39065
  };
39049
39066
  this.getAccessToken = () => {
39050
- return Promise.resolve(__classPrivateFieldGet(this, _MockSDK_accessToken));
39067
+ return Promise.resolve(__classPrivateFieldGet(this, _MockSDKService_accessToken));
39051
39068
  };
39052
39069
  this.getVersion = Basics.getVersion;
39053
39070
  this.getSystemInfo = Basics.getSystemInfo;
@@ -39358,7 +39375,7 @@
39358
39375
  });
39359
39376
  }
39360
39377
  }
39361
- _MockSDK_appId = new WeakMap(), _MockSDK_appConfig = new WeakMap(), _MockSDK_zOAuth = new WeakMap(), _MockSDK_accessToken = new WeakMap(), _MockSDK_cache = new WeakMap(), _MockSDK_loggedId = new WeakMap();
39378
+ _MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
39362
39379
 
39363
39380
  /*! *****************************************************************************
39364
39381
  Copyright (C) Microsoft. All rights reserved.
@@ -40594,12 +40611,12 @@
40594
40611
  return descriptor;
40595
40612
  };
40596
40613
 
40597
- var _SDKCreator_sdkManager;
40614
+ var _SDKCreator_sdkService;
40598
40615
  class SDKCreator {
40599
40616
  constructor() {
40600
40617
  this.events = ZMPEEmitter.getInstance();
40601
- _SDKCreator_sdkManager.set(this, void 0);
40602
- __classPrivateFieldSet(this, _SDKCreator_sdkManager, this.getInstance());
40618
+ _SDKCreator_sdkService.set(this, void 0);
40619
+ __classPrivateFieldSet(this, _SDKCreator_sdkService, this.getServiceInstance());
40603
40620
  this.events.addListener = (event, fn, context) => {
40604
40621
  const stringifyEventName = event;
40605
40622
  return this.events.addListener(Events[stringifyEventName], fn, context);
@@ -40622,11 +40639,11 @@
40622
40639
  */
40623
40640
  login(object) {
40624
40641
  return __awaiter(this, void 0, void 0, function* () {
40625
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).login(object);
40642
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).login(object);
40626
40643
  });
40627
40644
  }
40628
40645
  getLoginStatus() {
40629
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getLoginStatus();
40646
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getLoginStatus();
40630
40647
  }
40631
40648
  /**
40632
40649
  * Get Access Token.
@@ -40645,264 +40662,266 @@
40645
40662
  */
40646
40663
  getAccessToken(object) {
40647
40664
  return __awaiter(this, void 0, void 0, function* () {
40648
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getAccessToken(object);
40665
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getAccessToken(object);
40649
40666
  });
40650
40667
  }
40651
40668
  getVersion() {
40652
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getVersion();
40669
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getVersion();
40653
40670
  }
40654
40671
  getSystemInfo() {
40655
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getSystemInfo();
40672
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getSystemInfo();
40656
40673
  }
40657
40674
  setNavigationBarTitle(object) {
40658
40675
  return __awaiter(this, void 0, void 0, function* () {
40659
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarTitle(object);
40676
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarTitle(object);
40660
40677
  });
40661
40678
  }
40662
40679
  setNavigationBarColor(object) {
40663
40680
  return __awaiter(this, void 0, void 0, function* () {
40664
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarColor(object);
40681
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarColor(object);
40665
40682
  });
40666
40683
  }
40667
40684
  setBackgroundColor(object) {
40668
40685
  return __awaiter(this, void 0, void 0, function* () {
40669
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setBackgroundColor(object);
40686
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setBackgroundColor(object);
40670
40687
  });
40671
40688
  }
40672
40689
  setNavigationBarLeftButton(object) {
40673
40690
  return __awaiter(this, void 0, void 0, function* () {
40674
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setNavigationBarLeftButton(object);
40691
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setNavigationBarLeftButton(object);
40675
40692
  });
40676
40693
  }
40677
40694
  setDeviceOrientation(object) {
40678
40695
  return __awaiter(this, void 0, void 0, function* () {
40679
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setDeviceOrientation(object);
40696
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setDeviceOrientation(object);
40680
40697
  });
40681
40698
  }
40682
40699
  setStorage(object) {
40683
40700
  return __awaiter(this, void 0, void 0, function* () {
40684
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).setStorage(object);
40701
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).setStorage(object);
40685
40702
  });
40686
40703
  }
40687
40704
  getStorage(object) {
40688
40705
  return __awaiter(this, void 0, void 0, function* () {
40689
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getStorage(object);
40706
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getStorage(object);
40690
40707
  });
40691
40708
  }
40692
40709
  getStorageInfo(object) {
40693
40710
  return __awaiter(this, void 0, void 0, function* () {
40694
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getStorageInfo(object);
40711
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getStorageInfo(object);
40695
40712
  });
40696
40713
  }
40697
40714
  removeStorage(object) {
40698
40715
  return __awaiter(this, void 0, void 0, function* () {
40699
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).removeStorage(object);
40716
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).removeStorage(object);
40700
40717
  });
40701
40718
  }
40702
40719
  clearStorage(object) {
40703
40720
  return __awaiter(this, void 0, void 0, function* () {
40704
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).clearStorage(object);
40721
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).clearStorage(object);
40705
40722
  });
40706
40723
  }
40707
40724
  getUserInfo(object) {
40708
40725
  return __awaiter(this, void 0, void 0, function* () {
40709
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getUserInfo(object);
40726
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getUserInfo(object);
40710
40727
  });
40711
40728
  }
40712
40729
  getNetworkType(object) {
40713
40730
  return __awaiter(this, void 0, void 0, function* () {
40714
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getNetworkType(object);
40731
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getNetworkType(object);
40715
40732
  });
40716
40733
  }
40717
40734
  onNetworkStatusChange(callback) {
40718
40735
  return __awaiter(this, void 0, void 0, function* () {
40719
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onNetworkStatusChange(callback);
40736
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onNetworkStatusChange(callback);
40720
40737
  });
40721
40738
  }
40722
40739
  startBeaconDiscovery(object) {
40723
40740
  return __awaiter(this, void 0, void 0, function* () {
40724
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).startBeaconDiscovery(object);
40741
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).startBeaconDiscovery(object);
40725
40742
  });
40726
40743
  }
40727
40744
  stopBeaconDiscovery(object) {
40728
40745
  return __awaiter(this, void 0, void 0, function* () {
40729
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).stopBeaconDiscovery(object);
40746
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).stopBeaconDiscovery(object);
40730
40747
  });
40731
40748
  }
40732
40749
  getBeacons(object) {
40733
40750
  return __awaiter(this, void 0, void 0, function* () {
40734
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBeacons(object);
40751
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBeacons(object);
40735
40752
  });
40736
40753
  }
40737
40754
  closeApp(object) {
40738
40755
  return __awaiter(this, void 0, void 0, function* () {
40739
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).closeApp(object);
40756
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).closeApp(object);
40740
40757
  });
40741
40758
  }
40742
40759
  getLocation(object) {
40743
40760
  return __awaiter(this, void 0, void 0, function* () {
40744
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getLocation(object);
40761
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getLocation(object);
40745
40762
  });
40746
40763
  }
40747
40764
  stopBluetoothDevicesDiscovery() {
40748
40765
  return __awaiter(this, void 0, void 0, function* () {
40749
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).stopBluetoothDevicesDiscovery();
40766
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).stopBluetoothDevicesDiscovery();
40750
40767
  });
40751
40768
  }
40752
40769
  startBluetoothDevicesDiscovery(object) {
40753
40770
  return __awaiter(this, void 0, void 0, function* () {
40754
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).startBluetoothDevicesDiscovery(object);
40771
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).startBluetoothDevicesDiscovery(object);
40755
40772
  });
40756
40773
  }
40757
40774
  openBluetoothAdapter() {
40758
40775
  return __awaiter(this, void 0, void 0, function* () {
40759
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openBluetoothAdapter();
40776
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openBluetoothAdapter();
40760
40777
  });
40761
40778
  }
40762
40779
  onBluetoothDeviceFound() {
40763
40780
  return __awaiter(this, void 0, void 0, function* () {
40764
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onBluetoothDeviceFound();
40781
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onBluetoothDeviceFound();
40765
40782
  });
40766
40783
  }
40767
40784
  onBluetoothAdapterStateChange() {
40768
40785
  return __awaiter(this, void 0, void 0, function* () {
40769
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onBluetoothAdapterStateChange();
40786
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onBluetoothAdapterStateChange();
40770
40787
  });
40771
40788
  }
40772
40789
  getConnectedBluetoothDevices(object) {
40773
40790
  return __awaiter(this, void 0, void 0, function* () {
40774
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getConnectedBluetoothDevices(object);
40791
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getConnectedBluetoothDevices(object);
40775
40792
  });
40776
40793
  }
40777
40794
  getBluetoothDevices() {
40778
40795
  return __awaiter(this, void 0, void 0, function* () {
40779
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBluetoothDevices();
40796
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBluetoothDevices();
40780
40797
  });
40781
40798
  }
40782
40799
  getBluetoothAdapterState() {
40783
40800
  return __awaiter(this, void 0, void 0, function* () {
40784
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getBluetoothAdapterState();
40801
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getBluetoothAdapterState();
40785
40802
  });
40786
40803
  }
40787
40804
  closeBluetoothAdapter() {
40788
40805
  return __awaiter(this, void 0, void 0, function* () {
40789
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).closeBluetoothAdapter();
40806
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).closeBluetoothAdapter();
40790
40807
  });
40791
40808
  }
40792
40809
  scanQRCode(object) {
40793
40810
  return __awaiter(this, void 0, void 0, function* () {
40794
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).scanQRCode(object);
40811
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).scanQRCode(object);
40795
40812
  });
40796
40813
  }
40797
40814
  openProfile(object) {
40798
40815
  return __awaiter(this, void 0, void 0, function* () {
40799
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfile(object);
40816
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openProfile(object);
40800
40817
  });
40801
40818
  }
40802
40819
  openChat(object) {
40803
40820
  return __awaiter(this, void 0, void 0, function* () {
40804
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openChat(object);
40821
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openChat(object);
40805
40822
  });
40806
40823
  }
40807
40824
  openPostFeed(object) {
40808
40825
  return __awaiter(this, void 0, void 0, function* () {
40809
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openPostFeed(object);
40826
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openPostFeed(object);
40810
40827
  });
40811
40828
  }
40812
40829
  followOA(object) {
40813
40830
  return __awaiter(this, void 0, void 0, function* () {
40814
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).followOA(object);
40831
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).followOA(object);
40815
40832
  });
40816
40833
  }
40817
40834
  unfollowOA(object) {
40818
40835
  return __awaiter(this, void 0, void 0, function* () {
40819
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).unFollowOA(object);
40836
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).unFollowOA(object);
40820
40837
  });
40821
40838
  }
40822
40839
  openShareSheet(object) {
40823
40840
  return __awaiter(this, void 0, void 0, function* () {
40824
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openShareSheet(object);
40841
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openShareSheet(object);
40825
40842
  });
40826
40843
  }
40827
40844
  requestCameraPermission(object) {
40828
40845
  return __awaiter(this, void 0, void 0, function* () {
40829
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).requestCameraPermission(object);
40846
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).requestCameraPermission(object);
40830
40847
  });
40831
40848
  }
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
  }
40840
40857
  const title = document.title;
40841
- const searchParams = object.params ? new URLSearchParams(object.params) : new URLSearchParams();
40858
+ const searchParams = object.params
40859
+ ? new URLSearchParams(object.params)
40860
+ : new URLSearchParams();
40842
40861
  if (isIOS) {
40843
40862
  searchParams.append('appId', APP_ID);
40844
40863
  searchParams.append('appName', title);
40845
40864
  searchParams.append('appIcon', iconURL);
40846
40865
  const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40847
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openOutApp(encodeURI(iosShortcutURL));
40866
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openOutApp(encodeURI(iosShortcutURL));
40848
40867
  }
40849
40868
  else
40850
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${config.MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40869
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).createShortcut(`${MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40851
40870
  });
40852
40871
  }
40853
40872
  openBioAuthentication(object) {
40854
40873
  return __awaiter(this, void 0, void 0, function* () {
40855
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openBioAuthentication(object);
40874
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openBioAuthentication(object);
40856
40875
  });
40857
40876
  }
40858
40877
  checkStateBioAuthentication(object) {
40859
40878
  return __awaiter(this, void 0, void 0, function* () {
40860
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).checkStateBioAuthentication(object);
40879
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).checkStateBioAuthentication(object);
40861
40880
  });
40862
40881
  }
40863
40882
  sendLocation(object) {
40864
40883
  return __awaiter(this, void 0, void 0, function* () {
40865
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).sendLocation(object);
40884
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).sendLocation(object);
40866
40885
  });
40867
40886
  }
40868
40887
  showToast(object) {
40869
40888
  return __awaiter(this, void 0, void 0, function* () {
40870
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).showToast(object);
40889
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).showToast(object);
40871
40890
  });
40872
40891
  }
40873
40892
  hideKeyboard(object) {
40874
40893
  return __awaiter(this, void 0, void 0, function* () {
40875
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).hideKeyboard(object);
40894
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).hideKeyboard(object);
40876
40895
  });
40877
40896
  }
40878
40897
  openPhone(object) {
40879
40898
  return __awaiter(this, void 0, void 0, function* () {
40880
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openPhone(object);
40899
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openPhone(object);
40881
40900
  });
40882
40901
  }
40883
40902
  openSMS(object) {
40884
40903
  return __awaiter(this, void 0, void 0, function* () {
40885
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openSMS(object);
40904
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openSMS(object);
40886
40905
  });
40887
40906
  }
40888
40907
  viewOAQr(object) {
40889
40908
  return __awaiter(this, void 0, void 0, function* () {
40890
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).viewOAQr(object);
40909
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).viewOAQr(object);
40891
40910
  });
40892
40911
  }
40893
40912
  keepScreen(object) {
40894
40913
  return __awaiter(this, void 0, void 0, function* () {
40895
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).keepScreen(object);
40914
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).keepScreen(object);
40896
40915
  });
40897
40916
  }
40898
40917
  saveImageToGallery(object) {
40899
40918
  return __awaiter(this, void 0, void 0, function* () {
40900
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).saveImageToPhotosAlbum(object);
40919
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).saveImageToPhotosAlbum(object);
40901
40920
  });
40902
40921
  }
40903
40922
  saveImageToPhotosAlbum(object) {
40904
40923
  return __awaiter(this, void 0, void 0, function* () {
40905
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).saveImageToPhotosAlbum(object);
40924
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).saveImageToPhotosAlbum(object);
40906
40925
  });
40907
40926
  }
40908
40927
  openMiniApp(object) {
@@ -40917,46 +40936,46 @@
40917
40936
  });
40918
40937
  object.params = params;
40919
40938
  }
40920
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openMiniApp(object);
40939
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openMiniApp(object);
40921
40940
  });
40922
40941
  }
40923
40942
  vibrate(object) {
40924
40943
  return __awaiter(this, void 0, void 0, function* () {
40925
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).vibrate(object);
40944
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).vibrate(object);
40926
40945
  });
40927
40946
  }
40928
40947
  openWebview(object) {
40929
40948
  return __awaiter(this, void 0, void 0, function* () {
40930
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openWebview(object);
40949
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openWebview(object);
40931
40950
  });
40932
40951
  }
40933
40952
  getRouteParams() {
40934
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getRouteParams();
40953
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getRouteParams();
40935
40954
  }
40936
40955
  getAppInfo(object) {
40937
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).getAppInfo();
40956
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).getAppInfo();
40938
40957
  }
40939
40958
  sendDataToPreviousMiniApp(object) {
40940
- return __classPrivateFieldGet(this, _SDKCreator_sdkManager).sendDataToPreviousMiniApp(object);
40959
+ return __classPrivateFieldGet(this, _SDKCreator_sdkService).sendDataToPreviousMiniApp(object);
40941
40960
  }
40942
40961
  onCallbackData(callback) {
40943
40962
  return __awaiter(this, void 0, void 0, function* () {
40944
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).onCallbackData(callback);
40963
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).onCallbackData(callback);
40945
40964
  });
40946
40965
  }
40947
40966
  getPhoneNumber(object) {
40948
40967
  return __awaiter(this, void 0, void 0, function* () {
40949
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).getPhoneNumber();
40968
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).getPhoneNumber();
40950
40969
  });
40951
40970
  }
40952
40971
  openProfilePicker(object) {
40953
40972
  return __awaiter(this, void 0, void 0, function* () {
40954
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openProfilePicker(object);
40973
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openProfilePicker(object);
40955
40974
  });
40956
40975
  }
40957
40976
  connectWifi(object) {
40958
40977
  return __awaiter(this, void 0, void 0, function* () {
40959
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).connectWifi(object);
40978
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).connectWifi(object);
40960
40979
  });
40961
40980
  }
40962
40981
  openMediaPicker(object) {
@@ -40972,7 +40991,7 @@
40972
40991
  editView.aspect_ratio = (_c = object.editView) === null || _c === void 0 ? void 0 : _c.aspectRatio;
40973
40992
  const silentRequest = object.silentRequest === true ? 1 : 0;
40974
40993
  const maxSelectItem = object.maxSelectItem;
40975
- return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openMediaPicker(object.type, editView, silentRequest, maxSelectItem);
40994
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkService).openMediaPicker(object.type, editView, silentRequest, maxSelectItem);
40976
40995
  });
40977
40996
  }
40978
40997
  getShareableLink(object) {
@@ -40983,7 +41002,7 @@
40983
41002
  });
40984
41003
  }
40985
41004
  }
40986
- _SDKCreator_sdkManager = new WeakMap();
41005
+ _SDKCreator_sdkService = new WeakMap();
40987
41006
  __decorate([
40988
41007
  handleError
40989
41008
  ], SDKCreator.prototype, "login", null);
@@ -41389,13 +41408,13 @@
41389
41408
  }))
41390
41409
  ], SDKCreator.prototype, "getShareableLink", null);
41391
41410
  class ZaloMiniAppSDKCreator extends SDKCreator {
41392
- getInstance() {
41393
- return ZaloMiniProgramSDK.getInstance();
41411
+ getServiceInstance() {
41412
+ return ZaloMiniProgramSDKService.getInstance();
41394
41413
  }
41395
41414
  }
41396
41415
  class MockSDKCreator extends SDKCreator {
41397
- getInstance() {
41398
- return new MockSDK();
41416
+ getServiceInstance() {
41417
+ return new MockSDKService();
41399
41418
  }
41400
41419
  }
41401
41420