{"version":3,"sources":["jsdelivr-header.js","/npm/wx-bridge@0.0.39/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,IAAM,CAAC,EAEP,UAAY,CAAC,EAAI,IACd,IAAI,SAAQ,CAAC,EAAS,KAC3B,GAAG,GACD,OAAO,OAAO,CAAC,EAAG,EAAS,CACzB,QAAS,EACT,KAAM,IAET,IAIC,eAAiB,CACrB,UACA,aACA,cACA,iBACA,eACA,QACA,aACA,aACA,YACA,WACA,iBACA,kBACA,cACA,YACA,YACA,cACA,YACA,eACA,mBACA,gBACA,cACA,eACA,WACA,cACA,cACA,aACA,eACA,eACA,yBACA,wBACA,eACA,cACA,iBACA,oBACA,WACA,eACA,8BACA,YACA,6BACA,qCACA,oBACA,uBACA,mBACA,8BACA,sBACA,qBACA,gCACA,iCACA,uBACA,+BACA,sBACA,2BACA,wBACA,SAGF,OAAO,KAAK,IAAI,SAAQ,IACtB,QAAQ,GACN,IAAa,cAAR,EACH,IAAI,GAAO,GAAW,UAAU,EAAK,CAAE,KAAM,UAAW,IACxD,MAEF,IAAa,eAAR,EACH,IAAI,GAAO,IACT,MAAM,EAAM,EAAQ,KAAO,EAE3B,IAAiC,IAA7B,EAAI,QAAQ,cAAkD,IAA5B,EAAI,QAAQ,WAQhD,OAAO,UAAU,EAAK,CACpB,cAAe,iBACf,kBAAmB,OACf,EAAQ,IAAM,EAAU,CAAC,EAC7B,QAVF,KAAK,QAAQ,QAAQ,GAGrB,OAAO,SAAS,KAAO,CASzB,EAEF,MAEF,IAAa,cAAR,EACL,IAAa,eAAR,EACL,IAAa,aAAR,EACH,IAAI,GAAO,IACT,MAAM,EAAM,EAAQ,KAAO,EAE3B,OAAO,UAAU,EAAK,IAChB,EAAQ,IAAM,EAAU,CAAC,EAC7B,OACA,EAEJ,MAEF,KAAK,eAAe,SAAS,GAC3B,IAAI,GAAO,GAAW,UAAU,EAAK,GACrC,MAEF,QACE,IAAI,GAAO,GAAG,GAClB,mBAGa","file":"/npm/wx-bridge@0.0.39/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/wx-bridge@0.0.39/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const $wx = {};\r\n\r\nconst promisify = (fn, options) => {\r\n  return new Promise((resolve, reject) => {\r\n    wx[fn](\r\n      Object.assign({}, options, {\r\n        success: resolve,\r\n        fail: reject\r\n      })\r\n    );\r\n  });\r\n};\r\n\r\nconst asyncFunctions = [\r\n  \"request\",\r\n  \"getSetting\",\r\n  \"getUserInfo\",\r\n  \"getUserProfile\",\r\n  \"checkSession\",\r\n  \"login\",\r\n  \"navigateTo\",\r\n  \"redirectTo\",\r\n  \"switchTab\",\r\n  \"reLaunch\",\r\n  \"requestPayment\",\r\n  \"showActionSheet\",\r\n  \"showLoading\",\r\n  \"showModal\",\r\n  \"showToast\",\r\n  \"hideLoading\",\r\n  \"hideToast\",\r\n  \"getImageInfo\",\r\n  \"setClipboardData\",\r\n  \"makePhoneCall\",\r\n  \"getLocation\",\r\n  \"openLocation\",\r\n  \"scanCode\",\r\n  \"chooseImage\",\r\n  \"chooseVideo\",\r\n  \"uploadFile\",\r\n  \"navigateBack\",\r\n  \"downloadFile\",\r\n  \"saveImageToPhotosAlbum\",\r\n  \"setNavigationBarTitle\",\r\n  \"previewImage\",\r\n  \"openSetting\",\r\n  \"chooseLocation\",\r\n  \"chooseMessageFile\",\r\n  \"saveFile\",\r\n  \"openDocument\",\r\n  \"writeBLECharacteristicValue\",\r\n  \"setBLEMTU\",\r\n  \"readBLECharacteristicValue\",\r\n  \"notifyBLECharacteristicValueChange\",\r\n  \"makeBluetoothPair\",\r\n  \"getBLEDeviceServices\",\r\n  \"getBLEDeviceRSSI\",\r\n  \"getBLEDeviceCharacteristics\",\r\n  \"createBLEConnection\",\r\n  \"closeBLEConnection\",\r\n  \"stopBluetoothDevicesDiscovery\",\r\n  \"startBluetoothDevicesDiscovery\",\r\n  \"openBluetoothAdapter\",\r\n  \"getConnectedBluetoothDevices\",\r\n  \"getBluetoothDevices\",\r\n  \"getBluetoothAdapterState\",\r\n  \"closeBluetoothAdapter\",\r\n  \"share\"\r\n];\r\n\r\nObject.keys(wx).forEach(key => {\r\n  switch (true) {\r\n    case key === \"showToast\":\r\n      $wx[key] = options => promisify(key, { icon: \"none\", ...options });\r\n      break;\r\n\r\n    case key === \"navigateTo\":\r\n      $wx[key] = options => {\r\n        const url = options.url || options;\r\n\r\n        if (url.indexOf(\"https://\") !== -1 || url.indexOf(\"http://\") !== -1) {\r\n          // #ifdef APP-PLUS\r\n          plus.runtime.openWeb(url);\r\n          // #endif\r\n          // #ifdef H5\r\n          window.location.href = url;\r\n          // #endif\r\n        } else {\r\n          return promisify(key, {\r\n            animationType: \"slide-in-right\",\r\n            animationDuration: 200,\r\n            ...(options.url ? options : {}),\r\n            url\r\n          });\r\n        }\r\n      };\r\n      break;\r\n\r\n    case key === \"switchTab\":\r\n    case key === \"redirectTo\":\r\n    case key === \"reLaunch\":\r\n      $wx[key] = options => {\r\n        const url = options.url || options;\r\n\r\n        return promisify(key, {\r\n          ...(options.url ? options : {}),\r\n          url\r\n        });\r\n      };\r\n      break;\r\n\r\n    case asyncFunctions.includes(key):\r\n      $wx[key] = options => promisify(key, options);\r\n      break;\r\n\r\n    default:\r\n      $wx[key] = wx[key];\r\n  }\r\n});\r\n\r\nexport default $wx;\r\n"]}