weixin-js-sdk.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. import {
  2. __commonJS
  3. } from "./chunk-UQGIA5KH.js";
  4. // ../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/weixin-js-sdk/index.js
  5. var require_weixin_js_sdk = __commonJS({
  6. "../../../../../../Users/xuruhua/Desktop/zx/new-zx-front-app/node_modules/weixin-js-sdk/index.js"(exports, module) {
  7. !function(e, n) {
  8. module.exports = n(e);
  9. }(typeof window === "object" && window, function(r, e) {
  10. if (!r) {
  11. console.warn("can't use weixin-js-sdk in server side");
  12. return;
  13. }
  14. var a, c, n, i, t, o, s, d, l, u, p, f, m, g, h, S, y, I, v, _, w, T;
  15. if (!r.jWeixin)
  16. return a = {
  17. config: "preVerifyJSAPI",
  18. onMenuShareTimeline: "menu:share:timeline",
  19. onMenuShareAppMessage: "menu:share:appmessage",
  20. onMenuShareQQ: "menu:share:qq",
  21. onMenuShareWeibo: "menu:share:weiboApp",
  22. onMenuShareQZone: "menu:share:QZone",
  23. previewImage: "imagePreview",
  24. getLocation: "geoLocation",
  25. openProductSpecificView: "openProductViewWithPid",
  26. addCard: "batchAddCard",
  27. openCard: "batchViewCard",
  28. chooseWXPay: "getBrandWCPayRequest",
  29. openEnterpriseRedPacket: "getRecevieBizHongBaoRequest",
  30. startSearchBeacons: "startMonitoringBeacons",
  31. stopSearchBeacons: "stopMonitoringBeacons",
  32. onSearchBeacons: "onBeaconsInRange",
  33. consumeAndShareCard: "consumedShareCard",
  34. openAddress: "editAddress"
  35. }, c = function() {
  36. var e2, n2 = {};
  37. for (e2 in a)
  38. n2[a[e2]] = e2;
  39. return n2;
  40. }(), n = r.document, i = n.title, t = navigator.userAgent.toLowerCase(), f = navigator.platform.toLowerCase(), o = !(!f.match("mac") && !f.match("win")), s = -1 != t.indexOf("wxdebugger"), d = -1 != t.indexOf("micromessenger"), l = -1 != t.indexOf("android"), u = -1 != t.indexOf("iphone") || -1 != t.indexOf("ipad"), p = (f = t.match(/micromessenger\/(\d+\.\d+\.\d+)/) || t.match(/micromessenger\/(\d+\.\d+)/)) ? f[1] : "", m = {
  41. initStartTime: L(),
  42. initEndTime: 0,
  43. preVerifyStartTime: 0,
  44. preVerifyEndTime: 0
  45. }, g = {
  46. version: 1,
  47. appId: "",
  48. initTime: 0,
  49. preVerifyTime: 0,
  50. networkType: "",
  51. isPreVerifyOk: 1,
  52. systemType: u ? 1 : l ? 2 : -1,
  53. clientVersion: p,
  54. url: encodeURIComponent(location.href)
  55. }, h = {}, S = { _completes: [] }, y = { state: 0, data: {} }, O(function() {
  56. m.initEndTime = L();
  57. }), I = false, v = [], _ = {
  58. config: function(e2) {
  59. C("config", h = e2);
  60. var o2 = false !== h.check;
  61. O(function() {
  62. if (o2)
  63. k(
  64. a.config,
  65. {
  66. verifyJsApiList: A(h.jsApiList),
  67. verifyOpenTagList: A(h.openTagList)
  68. },
  69. (S._complete = function(e4) {
  70. m.preVerifyEndTime = L(), y.state = 1, y.data = e4;
  71. }, S.success = function(e4) {
  72. g.isPreVerifyOk = 0;
  73. }, S.fail = function(e4) {
  74. S._fail ? S._fail(e4) : y.state = -1;
  75. }, (t2 = S._completes).push(function() {
  76. B();
  77. }), S.complete = function(e4) {
  78. for (var n3 = 0, i3 = t2.length; n3 < i3; ++n3)
  79. t2[n3]();
  80. S._completes = [];
  81. }, S)
  82. ), m.preVerifyStartTime = L();
  83. else {
  84. y.state = 1;
  85. for (var e3 = S._completes, n2 = 0, i2 = e3.length; n2 < i2; ++n2)
  86. e3[n2]();
  87. S._completes = [];
  88. }
  89. var t2;
  90. }), _.invoke || (_.invoke = function(e3, n2, i2) {
  91. r.WeixinJSBridge && WeixinJSBridge.invoke(e3, P(n2), i2);
  92. }, _.on = function(e3, n2) {
  93. r.WeixinJSBridge && WeixinJSBridge.on(e3, n2);
  94. });
  95. },
  96. ready: function(e2) {
  97. (0 != y.state || (S._completes.push(e2), !d && h.debug)) && e2();
  98. },
  99. error: function(e2) {
  100. p < "6.0.2" || (-1 == y.state ? e2(y.data) : S._fail = e2);
  101. },
  102. checkJsApi: function(e2) {
  103. k(
  104. "checkJsApi",
  105. { jsApiList: A(e2.jsApiList) },
  106. (e2._complete = function(e3) {
  107. l && (i2 = e3.checkResult) && (e3.checkResult = JSON.parse(i2));
  108. var n2, i2 = e3, t2 = i2.checkResult;
  109. for (n2 in t2) {
  110. var o2 = c[n2];
  111. o2 && (t2[o2] = t2[n2], delete t2[n2]);
  112. }
  113. }, e2)
  114. );
  115. },
  116. onMenuShareTimeline: function(e2) {
  117. M(
  118. a.onMenuShareTimeline,
  119. {
  120. complete: function() {
  121. k(
  122. "shareTimeline",
  123. {
  124. title: e2.title || i,
  125. desc: e2.title || i,
  126. img_url: e2.imgUrl || "",
  127. link: e2.link || location.href,
  128. type: e2.type || "link",
  129. data_url: e2.dataUrl || ""
  130. },
  131. e2
  132. );
  133. }
  134. },
  135. e2
  136. );
  137. },
  138. onMenuShareAppMessage: function(n2) {
  139. M(
  140. a.onMenuShareAppMessage,
  141. {
  142. complete: function(e2) {
  143. "favorite" === e2.scene ? k("sendAppMessage", {
  144. title: n2.title || i,
  145. desc: n2.desc || "",
  146. link: n2.link || location.href,
  147. img_url: n2.imgUrl || "",
  148. type: n2.type || "link",
  149. data_url: n2.dataUrl || ""
  150. }) : k(
  151. "sendAppMessage",
  152. {
  153. title: n2.title || i,
  154. desc: n2.desc || "",
  155. link: n2.link || location.href,
  156. img_url: n2.imgUrl || "",
  157. type: n2.type || "link",
  158. data_url: n2.dataUrl || ""
  159. },
  160. n2
  161. );
  162. }
  163. },
  164. n2
  165. );
  166. },
  167. onMenuShareQQ: function(e2) {
  168. M(
  169. a.onMenuShareQQ,
  170. {
  171. complete: function() {
  172. k(
  173. "shareQQ",
  174. {
  175. title: e2.title || i,
  176. desc: e2.desc || "",
  177. img_url: e2.imgUrl || "",
  178. link: e2.link || location.href
  179. },
  180. e2
  181. );
  182. }
  183. },
  184. e2
  185. );
  186. },
  187. onMenuShareWeibo: function(e2) {
  188. M(
  189. a.onMenuShareWeibo,
  190. {
  191. complete: function() {
  192. k(
  193. "shareWeiboApp",
  194. {
  195. title: e2.title || i,
  196. desc: e2.desc || "",
  197. img_url: e2.imgUrl || "",
  198. link: e2.link || location.href
  199. },
  200. e2
  201. );
  202. }
  203. },
  204. e2
  205. );
  206. },
  207. onMenuShareQZone: function(e2) {
  208. M(
  209. a.onMenuShareQZone,
  210. {
  211. complete: function() {
  212. k(
  213. "shareQZone",
  214. {
  215. title: e2.title || i,
  216. desc: e2.desc || "",
  217. img_url: e2.imgUrl || "",
  218. link: e2.link || location.href
  219. },
  220. e2
  221. );
  222. }
  223. },
  224. e2
  225. );
  226. },
  227. updateTimelineShareData: function(e2) {
  228. k(
  229. "updateTimelineShareData",
  230. { title: e2.title, link: e2.link, imgUrl: e2.imgUrl },
  231. e2
  232. );
  233. },
  234. updateAppMessageShareData: function(e2) {
  235. k(
  236. "updateAppMessageShareData",
  237. { title: e2.title, desc: e2.desc, link: e2.link, imgUrl: e2.imgUrl },
  238. e2
  239. );
  240. },
  241. startRecord: function(e2) {
  242. k("startRecord", {}, e2);
  243. },
  244. stopRecord: function(e2) {
  245. k("stopRecord", {}, e2);
  246. },
  247. onVoiceRecordEnd: function(e2) {
  248. M("onVoiceRecordEnd", e2);
  249. },
  250. playVoice: function(e2) {
  251. k("playVoice", { localId: e2.localId }, e2);
  252. },
  253. pauseVoice: function(e2) {
  254. k("pauseVoice", { localId: e2.localId }, e2);
  255. },
  256. stopVoice: function(e2) {
  257. k("stopVoice", { localId: e2.localId }, e2);
  258. },
  259. onVoicePlayEnd: function(e2) {
  260. M("onVoicePlayEnd", e2);
  261. },
  262. uploadVoice: function(e2) {
  263. k(
  264. "uploadVoice",
  265. {
  266. localId: e2.localId,
  267. isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1
  268. },
  269. e2
  270. );
  271. },
  272. downloadVoice: function(e2) {
  273. k(
  274. "downloadVoice",
  275. {
  276. serverId: e2.serverId,
  277. isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1
  278. },
  279. e2
  280. );
  281. },
  282. translateVoice: function(e2) {
  283. k(
  284. "translateVoice",
  285. {
  286. localId: e2.localId,
  287. isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1
  288. },
  289. e2
  290. );
  291. },
  292. chooseImage: function(e2) {
  293. k(
  294. "chooseImage",
  295. {
  296. scene: "1|2",
  297. count: e2.count || 9,
  298. sizeType: e2.sizeType || ["original", "compressed"],
  299. sourceType: e2.sourceType || ["album", "camera"]
  300. },
  301. (e2._complete = function(e3) {
  302. if (l) {
  303. var n2 = e3.localIds;
  304. try {
  305. n2 && (e3.localIds = JSON.parse(n2));
  306. } catch (e4) {
  307. }
  308. }
  309. }, e2)
  310. );
  311. },
  312. getLocation: function(e2) {
  313. e2 = e2 || {}, k(
  314. a.getLocation,
  315. { type: e2.type || "wgs84" },
  316. (e2._complete = function(e3) {
  317. delete e3.type;
  318. }, e2)
  319. );
  320. },
  321. previewImage: function(e2) {
  322. k(a.previewImage, { current: e2.current, urls: e2.urls }, e2);
  323. },
  324. uploadImage: function(e2) {
  325. k(
  326. "uploadImage",
  327. {
  328. localId: e2.localId,
  329. isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1
  330. },
  331. e2
  332. );
  333. },
  334. downloadImage: function(e2) {
  335. k(
  336. "downloadImage",
  337. {
  338. serverId: e2.serverId,
  339. isShowProgressTips: 0 == e2.isShowProgressTips ? 0 : 1
  340. },
  341. e2
  342. );
  343. },
  344. getLocalImgData: function(e2) {
  345. false === I ? (I = true, k(
  346. "getLocalImgData",
  347. { localId: e2.localId },
  348. (e2._complete = function(e3) {
  349. var n2;
  350. I = false, 0 < v.length && (n2 = v.shift(), wx.getLocalImgData(n2));
  351. }, e2)
  352. )) : v.push(e2);
  353. },
  354. getNetworkType: function(e2) {
  355. k(
  356. "getNetworkType",
  357. {},
  358. (e2._complete = function(e3) {
  359. var n2 = e3, e3 = n2.errMsg, i2 = (n2.errMsg = "getNetworkType:ok", n2.subtype);
  360. if (delete n2.subtype, i2)
  361. n2.networkType = i2;
  362. else {
  363. var i2 = e3.indexOf(":"), t2 = e3.substring(i2 + 1);
  364. switch (t2) {
  365. case "wifi":
  366. case "edge":
  367. case "wwan":
  368. n2.networkType = t2;
  369. break;
  370. default:
  371. n2.errMsg = "getNetworkType:fail";
  372. }
  373. }
  374. }, e2)
  375. );
  376. },
  377. openLocation: function(e2) {
  378. k(
  379. "openLocation",
  380. {
  381. latitude: e2.latitude,
  382. longitude: e2.longitude,
  383. name: e2.name || "",
  384. address: e2.address || "",
  385. scale: e2.scale || 28,
  386. infoUrl: e2.infoUrl || ""
  387. },
  388. e2
  389. );
  390. },
  391. hideOptionMenu: function(e2) {
  392. k("hideOptionMenu", {}, e2);
  393. },
  394. showOptionMenu: function(e2) {
  395. k("showOptionMenu", {}, e2);
  396. },
  397. closeWindow: function(e2) {
  398. k("closeWindow", {}, e2 = e2 || {});
  399. },
  400. hideMenuItems: function(e2) {
  401. k("hideMenuItems", { menuList: e2.menuList }, e2);
  402. },
  403. showMenuItems: function(e2) {
  404. k("showMenuItems", { menuList: e2.menuList }, e2);
  405. },
  406. hideAllNonBaseMenuItem: function(e2) {
  407. k("hideAllNonBaseMenuItem", {}, e2);
  408. },
  409. showAllNonBaseMenuItem: function(e2) {
  410. k("showAllNonBaseMenuItem", {}, e2);
  411. },
  412. scanQRCode: function(e2) {
  413. k(
  414. "scanQRCode",
  415. {
  416. needResult: (e2 = e2 || {}).needResult || 0,
  417. scanType: e2.scanType || ["qrCode", "barCode"]
  418. },
  419. (e2._complete = function(e3) {
  420. var n2;
  421. u && (n2 = e3.resultStr) && (n2 = JSON.parse(n2), e3.resultStr = n2 && n2.scan_code && n2.scan_code.scan_result);
  422. }, e2)
  423. );
  424. },
  425. openAddress: function(e2) {
  426. k(
  427. a.openAddress,
  428. {},
  429. (e2._complete = function(e3) {
  430. (e3 = e3).postalCode = e3.addressPostalCode, delete e3.addressPostalCode, e3.provinceName = e3.proviceFirstStageName, delete e3.proviceFirstStageName, e3.cityName = e3.addressCitySecondStageName, delete e3.addressCitySecondStageName, e3.countryName = e3.addressCountiesThirdStageName, delete e3.addressCountiesThirdStageName, e3.detailInfo = e3.addressDetailInfo, delete e3.addressDetailInfo;
  431. }, e2)
  432. );
  433. },
  434. openProductSpecificView: function(e2) {
  435. k(
  436. a.openProductSpecificView,
  437. {
  438. pid: e2.productId,
  439. view_type: e2.viewType || 0,
  440. ext_info: e2.extInfo
  441. },
  442. e2
  443. );
  444. },
  445. addCard: function(e2) {
  446. for (var n2 = e2.cardList, i2 = [], t2 = 0, o2 = n2.length; t2 < o2; ++t2) {
  447. var r2 = n2[t2], r2 = { card_id: r2.cardId, card_ext: r2.cardExt };
  448. i2.push(r2);
  449. }
  450. k(
  451. a.addCard,
  452. { card_list: i2 },
  453. (e2._complete = function(e3) {
  454. if (n3 = e3.card_list) {
  455. for (var n3, i3 = 0, t3 = (n3 = JSON.parse(n3)).length; i3 < t3; ++i3) {
  456. var o3 = n3[i3];
  457. o3.cardId = o3.card_id, o3.cardExt = o3.card_ext, o3.isSuccess = !!o3.is_succ, delete o3.card_id, delete o3.card_ext, delete o3.is_succ;
  458. }
  459. e3.cardList = n3, delete e3.card_list;
  460. }
  461. }, e2)
  462. );
  463. },
  464. chooseCard: function(e2) {
  465. k(
  466. "chooseCard",
  467. {
  468. app_id: h.appId,
  469. location_id: e2.shopId || "",
  470. sign_type: e2.signType || "SHA1",
  471. card_id: e2.cardId || "",
  472. card_type: e2.cardType || "",
  473. card_sign: e2.cardSign,
  474. time_stamp: e2.timestamp + "",
  475. nonce_str: e2.nonceStr
  476. },
  477. (e2._complete = function(e3) {
  478. e3.cardList = e3.choose_card_info, delete e3.choose_card_info;
  479. }, e2)
  480. );
  481. },
  482. openCard: function(e2) {
  483. for (var n2 = e2.cardList, i2 = [], t2 = 0, o2 = n2.length; t2 < o2; ++t2) {
  484. var r2 = n2[t2], r2 = { card_id: r2.cardId, code: r2.code };
  485. i2.push(r2);
  486. }
  487. k(a.openCard, { card_list: i2 }, e2);
  488. },
  489. consumeAndShareCard: function(e2) {
  490. k(
  491. a.consumeAndShareCard,
  492. { consumedCardId: e2.cardId, consumedCode: e2.code },
  493. e2
  494. );
  495. },
  496. chooseWXPay: function(e2) {
  497. k(a.chooseWXPay, x(e2), e2), B({ jsApiName: "chooseWXPay" });
  498. },
  499. openEnterpriseRedPacket: function(e2) {
  500. k(a.openEnterpriseRedPacket, x(e2), e2);
  501. },
  502. startSearchBeacons: function(e2) {
  503. k(a.startSearchBeacons, { ticket: e2.ticket }, e2);
  504. },
  505. stopSearchBeacons: function(e2) {
  506. k(a.stopSearchBeacons, {}, e2);
  507. },
  508. onSearchBeacons: function(e2) {
  509. M(a.onSearchBeacons, e2);
  510. },
  511. openEnterpriseChat: function(e2) {
  512. k(
  513. "openEnterpriseChat",
  514. { useridlist: e2.userIds, chatname: e2.groupName },
  515. e2
  516. );
  517. },
  518. launchMiniProgram: function(e2) {
  519. k(
  520. "launchMiniProgram",
  521. {
  522. targetAppId: e2.targetAppId,
  523. path: function(e3) {
  524. var n2;
  525. if ("string" == typeof e3 && 0 < e3.length)
  526. return n2 = e3.split("?")[0], n2 += ".html", void 0 !== (e3 = e3.split("?")[1]) ? n2 + "?" + e3 : n2;
  527. }(e2.path),
  528. envVersion: e2.envVersion
  529. },
  530. e2
  531. );
  532. },
  533. openBusinessView: function(e2) {
  534. k(
  535. "openBusinessView",
  536. {
  537. businessType: e2.businessType,
  538. queryString: e2.queryString || "",
  539. envVersion: e2.envVersion
  540. },
  541. (e2._complete = function(n2) {
  542. if (l) {
  543. var e3 = n2.extraData;
  544. if (e3)
  545. try {
  546. n2.extraData = JSON.parse(e3);
  547. } catch (e4) {
  548. n2.extraData = {};
  549. }
  550. }
  551. }, e2)
  552. );
  553. },
  554. miniProgram: {
  555. navigateBack: function(e2) {
  556. e2 = e2 || {}, O(function() {
  557. k(
  558. "invokeMiniProgramAPI",
  559. { name: "navigateBack", arg: { delta: e2.delta || 1 } },
  560. e2
  561. );
  562. });
  563. },
  564. navigateTo: function(e2) {
  565. O(function() {
  566. k(
  567. "invokeMiniProgramAPI",
  568. { name: "navigateTo", arg: { url: e2.url } },
  569. e2
  570. );
  571. });
  572. },
  573. redirectTo: function(e2) {
  574. O(function() {
  575. k(
  576. "invokeMiniProgramAPI",
  577. { name: "redirectTo", arg: { url: e2.url } },
  578. e2
  579. );
  580. });
  581. },
  582. switchTab: function(e2) {
  583. O(function() {
  584. k(
  585. "invokeMiniProgramAPI",
  586. { name: "switchTab", arg: { url: e2.url } },
  587. e2
  588. );
  589. });
  590. },
  591. reLaunch: function(e2) {
  592. O(function() {
  593. k(
  594. "invokeMiniProgramAPI",
  595. { name: "reLaunch", arg: { url: e2.url } },
  596. e2
  597. );
  598. });
  599. },
  600. postMessage: function(e2) {
  601. O(function() {
  602. k(
  603. "invokeMiniProgramAPI",
  604. { name: "postMessage", arg: e2.data || {} },
  605. e2
  606. );
  607. });
  608. },
  609. getEnv: function(e2) {
  610. O(function() {
  611. e2({ miniprogram: "miniprogram" === r.__wxjs_environment });
  612. });
  613. }
  614. }
  615. }, w = 1, T = {}, n.addEventListener(
  616. "error",
  617. function(e2) {
  618. var n2, i2, t2;
  619. l || (t2 = (n2 = e2.target).tagName, i2 = n2.src, "IMG" != t2 && "VIDEO" != t2 && "AUDIO" != t2 && "SOURCE" != t2) || -1 != i2.indexOf("wxlocalresource://") && (e2.preventDefault(), e2.stopPropagation(), (t2 = n2["wx-id"]) || (t2 = w++, n2["wx-id"] = t2), T[t2] || (T[t2] = true, wx.ready(function() {
  620. wx.getLocalImgData({
  621. localId: i2,
  622. success: function(e3) {
  623. n2.src = e3.localData;
  624. }
  625. });
  626. })));
  627. },
  628. true
  629. ), n.addEventListener(
  630. "load",
  631. function(e2) {
  632. var n2;
  633. l || (n2 = (e2 = e2.target).tagName, e2.src, "IMG" != n2 && "VIDEO" != n2 && "AUDIO" != n2 && "SOURCE" != n2) || (n2 = e2["wx-id"]) && (T[n2] = false);
  634. },
  635. true
  636. ), e && (r.wx = r.jWeixin = _), _;
  637. else
  638. return r.jWeixin;
  639. function k(n2, e2, i2) {
  640. r.WeixinJSBridge ? WeixinJSBridge.invoke(n2, P(e2), function(e3) {
  641. V(n2, e3, i2);
  642. }) : C(n2, i2);
  643. }
  644. function M(n2, i2, t2) {
  645. r.WeixinJSBridge ? WeixinJSBridge.on(n2, function(e2) {
  646. t2 && t2.trigger && t2.trigger(e2), V(n2, e2, i2);
  647. }) : C(n2, t2 || i2);
  648. }
  649. function P(e2) {
  650. return (e2 = e2 || {}).appId = h.appId, e2.verifyAppId = h.appId, e2.verifySignType = "sha1", e2.verifyTimestamp = h.timestamp + "", e2.verifyNonceStr = h.nonceStr, e2.verifySignature = h.signature, e2;
  651. }
  652. function x(e2) {
  653. return {
  654. timeStamp: e2.timestamp + "",
  655. nonceStr: e2.nonceStr,
  656. package: e2.package,
  657. paySign: e2.paySign,
  658. signType: e2.signType || "SHA1"
  659. };
  660. }
  661. function V(e2, n2, i2) {
  662. "openEnterpriseChat" != e2 && "openBusinessView" !== e2 || (n2.errCode = n2.err_code), delete n2.err_code, delete n2.err_desc, delete n2.err_detail;
  663. var t2 = n2.errMsg, e2 = (t2 || (t2 = n2.err_msg, delete n2.err_msg, t2 = function(e3, n3) {
  664. var i3 = c[e3];
  665. i3 && (e3 = i3);
  666. i3 = "ok";
  667. {
  668. var t3;
  669. n3 && (t3 = n3.indexOf(":"), "access denied" != (i3 = (i3 = (i3 = -1 != (i3 = -1 != (i3 = "failed" == (i3 = "confirm" == (i3 = n3.substring(t3 + 1)) ? "ok" : i3) ? "fail" : i3).indexOf("failed_") ? i3.substring(7) : i3).indexOf("fail_") ? i3.substring(5) : i3).replace(/_/g, " ")).toLowerCase()) && "no permission to execute" != i3 || (i3 = "permission denied"), "" == (i3 = "config" == e3 && "function not exist" == i3 ? "ok" : i3)) && (i3 = "fail");
  670. }
  671. return n3 = e3 + ":" + i3;
  672. }(e2, t2), n2.errMsg = t2), (i2 = i2 || {})._complete && (i2._complete(n2), delete i2._complete), t2 = n2.errMsg || "", h.debug && !i2.isInnerInvoke && alert(JSON.stringify(n2)), t2.indexOf(":"));
  673. switch (t2.substring(e2 + 1)) {
  674. case "ok":
  675. i2.success && i2.success(n2);
  676. break;
  677. case "cancel":
  678. i2.cancel && i2.cancel(n2);
  679. break;
  680. default:
  681. i2.fail && i2.fail(n2);
  682. }
  683. i2.complete && i2.complete(n2);
  684. }
  685. function A(e2) {
  686. if (e2) {
  687. for (var n2 = 0, i2 = e2.length; n2 < i2; ++n2) {
  688. var t2 = e2[n2], t2 = a[t2];
  689. t2 && (e2[n2] = t2);
  690. }
  691. return e2;
  692. }
  693. }
  694. function C(e2, n2) {
  695. var i2;
  696. !h.debug || n2 && n2.isInnerInvoke || ((i2 = c[e2]) && (e2 = i2), n2 && n2._complete && delete n2._complete, console.log('"' + e2 + '",', n2 || ""));
  697. }
  698. function B(n2) {
  699. var i2;
  700. o || s || h.debug || p < "6.0.2" || g.systemType < 0 || (i2 = new Image(), g.appId = h.appId, g.initTime = m.initEndTime - m.initStartTime, g.preVerifyTime = m.preVerifyEndTime - m.preVerifyStartTime, _.getNetworkType({
  701. isInnerInvoke: true,
  702. success: function(e2) {
  703. g.networkType = e2.networkType;
  704. e2 = "https://open.weixin.qq.com/sdk/report?v=" + g.version + "&o=" + g.isPreVerifyOk + "&s=" + g.systemType + "&c=" + g.clientVersion + "&a=" + g.appId + "&n=" + g.networkType + "&i=" + g.initTime + "&p=" + g.preVerifyTime + "&u=" + g.url + "&jsapi_name=" + (n2 ? n2.jsApiName : "");
  705. i2.src = e2;
  706. }
  707. }));
  708. }
  709. function L() {
  710. return (/* @__PURE__ */ new Date()).getTime();
  711. }
  712. function O(e2) {
  713. d && (r.WeixinJSBridge ? e2() : n.addEventListener && n.addEventListener("WeixinJSBridgeReady", e2, false));
  714. }
  715. });
  716. }
  717. });
  718. export default require_weixin_js_sdk();
  719. //# sourceMappingURL=weixin-js-sdk.js.map