/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/react-native-hot-updated@0.0.1/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const HotUpdate=require("react-native").NativeModules.HotUpdate;import{NativeAppEventEmitter}from"react-native";let host="http://update.reactnative.cn/api";export const downloadRootDir=HotUpdate.downloadRootDir;export const packageVersion=HotUpdate.packageVersion;export const currentVersion=HotUpdate.currentVersion;export const isFirstTime=HotUpdate.isFirstTime;export const isRolledBack=HotUpdate.isRolledBack;export async function checkUpdate(t){const e=await fetch(`${host}/checkUpdate/${t}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({packageVersion:packageVersion,hash:currentVersion})});if(200!==e.status)throw new Error((await e.json()).message);return await e.json()}export async function downloadUpdate(t){if(t.update)return t.diffUrl?await HotUpdate.downloadPatchFromPpk({updateUrl:t.diffUrl,hashName:t.hash,originHashName:currentVersion}):t.pdiffUrl?await HotUpdate.downloadPatchFromPackage({updateUrl:t.pdiffUrl,hashName:t.hash}):await HotUpdate.downloadUpdate({updateUrl:t.updateUrl,hashName:t.hash}),t.hash}export async function switchVersion(t){HotUpdate.reloadUpdate({hashName:t})}export async function switchVersionLater(t){HotUpdate.setNeedUpdate({hashName:t})}export function markSuccess(){HotUpdate.markSuccess()}NativeAppEventEmitter.addListener("RCTHotUpdateDownloadProgress",(t=>{})),NativeAppEventEmitter.addListener("RCTHotUpdateUnzipProgress",(t=>{}));
//# sourceMappingURL=/sm/7ec9aab344047de98aba34f69c7fa6d4485d2ef904cb0f30b8ddb1740c814f8a.map