@series-inc/venus-sdk 3.2.0 → 3.2.1-beta.1

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.
@@ -125,13 +125,6 @@ interface NotificationsApi {
125
125
  setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
126
126
  }
127
127
 
128
- interface ShowConfirmOptions {
129
- confirmText?: string;
130
- cancelText?: string;
131
- }
132
- interface ShowAlertOptions {
133
- buttonText?: string;
134
- }
135
128
  interface ShowToastOptions {
136
129
  duration?: number;
137
130
  variant?: 'success' | 'error' | 'warning' | 'info';
@@ -140,21 +133,7 @@ interface ShowToastOptions {
140
133
  };
141
134
  }
142
135
  interface PopupsApi {
143
- showAlert(title: string, message: string, options?: ShowAlertOptions): Promise<void>;
144
- showConfirm(title: string, message: string, options?: ShowConfirmOptions): Promise<boolean>;
145
136
  showToast(message: string, options?: ShowToastOptions): Promise<boolean>;
146
- showActionSheet(items: ActionSheetItem[], options?: ShowActionSheetOptions): Promise<string | number | null>;
147
- }
148
- interface ActionSheetItem {
149
- id?: string;
150
- label: string;
151
- icon?: string;
152
- }
153
- interface ShowActionSheetOptions {
154
- title?: string;
155
- message?: string;
156
- cancelButtonText?: string;
157
- disableCancel?: boolean;
158
137
  }
159
138
 
160
139
  interface ProfileApi {
@@ -820,7 +799,6 @@ interface LoggingApi {
820
799
 
821
800
  interface SharedAssetsApi {
822
801
  loadAssetsBundle(game: string, bundleKey: string): Promise<ArrayBuffer>;
823
- loadLibraryCode(libraryKey: string): Promise<string>;
824
802
  }
825
803
 
826
804
  declare class RpcSharedAssetsApi implements SharedAssetsApi {
@@ -828,7 +806,6 @@ declare class RpcSharedAssetsApi implements SharedAssetsApi {
828
806
  private readonly rpcClient;
829
807
  constructor(rpcClient: RpcClient, venusApi: VenusAPI);
830
808
  loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
831
- loadLibraryCode(libraryKey: string): Promise<string>;
832
809
  }
833
810
  interface LoadEmbeddedAssetsRequest {
834
811
  assetKey: string;
@@ -1359,11 +1336,6 @@ interface VenusExecuteRecipeResult {
1359
1336
  amountFulfilled?: number;
1360
1337
  partialSuccess?: boolean;
1361
1338
  }
1362
- interface ActionSheetOption {
1363
- label: string;
1364
- icon?: string;
1365
- id?: string;
1366
- }
1367
1339
  interface Profile {
1368
1340
  id: string;
1369
1341
  username: string;
@@ -1430,44 +1402,6 @@ interface VenusAPI {
1430
1402
  getLaunchParams(): Record<string, string>;
1431
1403
  getLocale(): string;
1432
1404
  getLanguageCode(): string;
1433
- /**
1434
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1435
- */
1436
- showToast(message: string | {
1437
- message: string;
1438
- duration?: number;
1439
- variant?: string;
1440
- action?: {
1441
- label: string;
1442
- };
1443
- }): Promise<boolean>;
1444
- /**
1445
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1446
- */
1447
- showAlert(options: {
1448
- title: string;
1449
- message: string;
1450
- buttonText?: string;
1451
- }): Promise<void>;
1452
- /**
1453
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1454
- */
1455
- showConfirm(options: {
1456
- title: string;
1457
- message: string;
1458
- confirmText?: string;
1459
- cancelText?: string;
1460
- }): Promise<boolean>;
1461
- /**
1462
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1463
- */
1464
- showActionSheet(options: {
1465
- title: string;
1466
- message?: string;
1467
- options: ActionSheetOption[];
1468
- cancelButtonText?: string;
1469
- disableCancel?: boolean;
1470
- }): Promise<string | number | null>;
1471
1405
  triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
1472
1406
  deviceCache: {
1473
1407
  setItem(key: string, value: string): Promise<void>;
@@ -1614,4 +1548,4 @@ interface AdsApi {
1614
1548
  showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
1615
1549
  }
1616
1550
 
1617
- export { type SubPath as $, type ActionSheetOption as A, type BatchRecipeRequirementsResult as B, type ScheduleLocalNotification as C, type ScheduleNotificationOptions as D, type PopupsApi as E, type ActionSheetItem as F, type ShowActionSheetOptions as G, type Host as H, type ShowAlertOptions as I, type ShowConfirmOptions as J, type ShowToastOptions as K, type ShowInterstitialAdOptions as L, type ShowRewardedAdOptions as M, type NavigationApi as N, type ProfileApi as O, type Profile as P, type QuitOptions as Q, type RecipeRequirementResult as R, type SimulationRunSummary as S, type DeviceApi as T, type DeviceInfo as U, type VenusAPI as V, type EnvironmentApi as W, type EnvironmentInfo as X, type SystemApi as Y, type SafeArea as Z, type CdnApi as _, type VenusSimulationStateResponse as a, type SubmitScoreParams as a$, type FetchBlobOptions as a0, type TimeApi as a1, type ServerTimeData as a2, type GetFutureTimeOptions as a3, type AiApi as a4, type AiChatCompletionRequest as a5, type AiChatCompletionData as a6, type HapticsApi as a7, HapticFeedbackStyle as a8, type FeaturesApi as a9, type Recipe as aA, type GetBatchRecipeRequirements as aB, type TriggerRecipeChainOptions as aC, type RoomDataUpdate as aD, type RoomMessageEvent as aE, type ProposedMoveEvent as aF, VenusTransport as aG, type RoomsApi as aH, type CreateRoomOptions as aI, type JoinOrCreateRoomOptions as aJ, type JoinOrCreateResult as aK, type ListRoomsOptions as aL, type UpdateRoomDataOptions as aM, type RoomMessageRequest as aN, type StartRoomGameOptions as aO, type ProposeMoveRequest as aP, type ProposeMoveResult as aQ, type ValidateMoveVerdict as aR, type ValidateMoveResult as aS, type RoomSubscriptionOptions as aT, type LoggingApi as aU, type IapApi as aV, type SpendCurrencyOptions as aW, type LoadEmbeddedAssetsResponse as aX, type SharedAssetsApi as aY, type LeaderboardApi as aZ, type ScoreToken as a_, type Experiment as aa, type LifecycleApi as ab, type SleepCallback as ac, type Subscription as ad, type AwakeCallback as ae, type PauseCallback as af, type ResumeCallback as ag, type QuitCallback as ah, type SimulationApi as ai, type SimulationSlotValidationResult as aj, type SimulationBatchOperation as ak, type SimulationBatchOperationsResult as al, type SimulationAvailableItem as am, type SimulationPowerPreview as an, type SimulationSlotMutationResult as ao, type SimulationSlotContainer as ap, type SimulationAssignment as aq, type SimulationState as ar, type ExecuteRecipeOptions as as, type ExecuteRecipeResponse as at, type CollectRecipeResult as au, type GetActiveRunsOptions as av, type ExecuteScopedRecipeOptions as aw, type ExecuteScopedRecipeResult as ax, type GetAvailableRecipesOptions as ay, type GetAvailableRecipesResult as az, type SimulationUpdateType as b, type SubmitScoreResult as b0, type GetPagedScoresOptions as b1, type PagedScoresResponse as b2, type PlayerRankOptions as b3, type PlayerRankResult as b4, type GetPodiumScoresOptions as b5, type PodiumScoresResponse as b6, type PreloaderApi as b7, type SocialApi as b8, type ShareMetadata as b9, type SimulationRoomActiveRecipe as bA, type SimulationRoomState as bB, type SimulationBatchOperationAssign as bC, type SimulationBatchOperationRemove as bD, type SimulationBatchOperationResult as bE, RpcSharedAssetsApi as bF, type LoadEmbeddedAssetsRequest as bG, type LeaderboardModeConfig as bH, type LeaderboardPeriodType as bI, type LeaderboardPeriodConfig as bJ, type LeaderboardAntiCheatConfig as bK, type LeaderboardDisplaySettings as bL, type LeaderboardConfig as bM, type LeaderboardEntry as bN, type PodiumScoresContext as bO, type HudInsets as bP, createHost as bQ, type ShareLinkResult as ba, type SocialQRCodeOptions as bb, type QRCodeResult as bc, type Avatar3dApi as bd, type AssetManifest as be, type Avatar3dConfig as bf, type ShowEditorOptions as bg, type Avatar3dEdits as bh, type AdsApi as bi, type InitializationOptions as bj, type InitializationContext as bk, type AiMessage as bl, type Asset as bm, type Category as bn, MockAvatarApi as bo, type TimeIntervalTriggerInput as bp, type NotificationTriggerInput as bq, type OnRequestCallback as br, type OnResponseCallback as bs, type OnNotificationCallback as bt, type RpcTransport as bu, type JoinRoomMatchCriteria as bv, type RoomMessageEventType as bw, type VenusRoomPayload as bx, type RecipeInfo as by, type SimulationPersonalState as bz, type SimulationEntityUpdate as c, type SimulationActiveRunsUpdate as d, type SimulationSnapshotUpdate as e, type SimulationUpdateData as f, type SimulationSubscribeOptions as g, type VenusSimulationEffect as h, type VenusSimulationRecipe as i, type VenusSimulationConfig as j, type RecipeRequirementQuery as k, type VenusExecuteRecipeOptions as l, type VenusExecuteScopedRecipeOptions as m, type VenusAvailableRecipe as n, type VenusCollectRecipeResult as o, type VenusExecuteRecipeResult as p, VenusRoom as q, type AnalyticsApi as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NotificationsApi as z };
1551
+ export { type AiApi as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type ScheduleNotificationOptions as C, type PopupsApi as D, type ShowToastOptions as E, type ShowInterstitialAdOptions as F, type ShowRewardedAdOptions as G, type Host as H, type ProfileApi as I, type DeviceApi as J, type DeviceInfo as K, type EnvironmentApi as L, type EnvironmentInfo as M, type NavigationApi as N, type SystemApi as O, type Profile as P, type QuitOptions as Q, type RecipeRequirementResult as R, type SimulationRunSummary as S, type SafeArea as T, type CdnApi as U, type VenusAPI as V, type SubPath as W, type FetchBlobOptions as X, type TimeApi as Y, type ServerTimeData as Z, type GetFutureTimeOptions as _, type VenusSimulationStateResponse as a, type PlayerRankResult as a$, type AiChatCompletionRequest as a0, type AiChatCompletionData as a1, type HapticsApi as a2, HapticFeedbackStyle as a3, type FeaturesApi as a4, type Experiment as a5, type LifecycleApi as a6, type SleepCallback as a7, type Subscription as a8, type AwakeCallback as a9, type ProposedMoveEvent as aA, VenusTransport as aB, type RoomsApi as aC, type CreateRoomOptions as aD, type JoinOrCreateRoomOptions as aE, type JoinOrCreateResult as aF, type ListRoomsOptions as aG, type UpdateRoomDataOptions as aH, type RoomMessageRequest as aI, type StartRoomGameOptions as aJ, type ProposeMoveRequest as aK, type ProposeMoveResult as aL, type ValidateMoveVerdict as aM, type ValidateMoveResult as aN, type RoomSubscriptionOptions as aO, type LoggingApi as aP, type IapApi as aQ, type SpendCurrencyOptions as aR, type LoadEmbeddedAssetsResponse as aS, type SharedAssetsApi as aT, type LeaderboardApi as aU, type ScoreToken as aV, type SubmitScoreParams as aW, type SubmitScoreResult as aX, type GetPagedScoresOptions as aY, type PagedScoresResponse as aZ, type PlayerRankOptions as a_, type PauseCallback as aa, type ResumeCallback as ab, type QuitCallback as ac, type SimulationApi as ad, type SimulationSlotValidationResult as ae, type SimulationBatchOperation as af, type SimulationBatchOperationsResult as ag, type SimulationAvailableItem as ah, type SimulationPowerPreview as ai, type SimulationSlotMutationResult as aj, type SimulationSlotContainer as ak, type SimulationAssignment as al, type SimulationState as am, type ExecuteRecipeOptions as an, type ExecuteRecipeResponse as ao, type CollectRecipeResult as ap, type GetActiveRunsOptions as aq, type ExecuteScopedRecipeOptions as ar, type ExecuteScopedRecipeResult as as, type GetAvailableRecipesOptions as at, type GetAvailableRecipesResult as au, type Recipe as av, type GetBatchRecipeRequirements as aw, type TriggerRecipeChainOptions as ax, type RoomDataUpdate as ay, type RoomMessageEvent as az, type SimulationUpdateType as b, type GetPodiumScoresOptions as b0, type PodiumScoresResponse as b1, type PreloaderApi as b2, type SocialApi as b3, type ShareMetadata as b4, type ShareLinkResult as b5, type SocialQRCodeOptions as b6, type QRCodeResult as b7, type Avatar3dApi as b8, type AssetManifest as b9, RpcSharedAssetsApi as bA, type LoadEmbeddedAssetsRequest as bB, type LeaderboardModeConfig as bC, type LeaderboardPeriodType as bD, type LeaderboardPeriodConfig as bE, type LeaderboardAntiCheatConfig as bF, type LeaderboardDisplaySettings as bG, type LeaderboardConfig as bH, type LeaderboardEntry as bI, type PodiumScoresContext as bJ, type HudInsets as bK, createHost as bL, type Avatar3dConfig as ba, type ShowEditorOptions as bb, type Avatar3dEdits as bc, type AdsApi as bd, type InitializationOptions as be, type InitializationContext as bf, type AiMessage as bg, type Asset as bh, type Category as bi, MockAvatarApi as bj, type TimeIntervalTriggerInput as bk, type NotificationTriggerInput as bl, type OnRequestCallback as bm, type OnResponseCallback as bn, type OnNotificationCallback as bo, type RpcTransport as bp, type JoinRoomMatchCriteria as bq, type RoomMessageEventType as br, type VenusRoomPayload as bs, type RecipeInfo as bt, type SimulationPersonalState as bu, type SimulationRoomActiveRecipe as bv, type SimulationRoomState as bw, type SimulationBatchOperationAssign as bx, type SimulationBatchOperationRemove as by, type SimulationBatchOperationResult as bz, type SimulationEntityUpdate as c, type SimulationActiveRunsUpdate as d, type SimulationSnapshotUpdate as e, type SimulationUpdateData as f, type SimulationSubscribeOptions as g, type VenusSimulationEffect as h, type VenusSimulationRecipe as i, type VenusSimulationConfig as j, type RecipeRequirementQuery as k, type VenusExecuteRecipeOptions as l, type VenusExecuteScopedRecipeOptions as m, type VenusAvailableRecipe as n, type VenusCollectRecipeResult as o, type VenusExecuteRecipeResult as p, VenusRoom as q, type RpcRequest as r, type RpcResponse as s, type RpcNotification as t, RpcClient as u, type StorageApi as v, type NavigationStackInfo as w, type PushAppOptions as x, type NotificationsApi as y, type ScheduleLocalNotification as z };
@@ -125,13 +125,6 @@ interface NotificationsApi {
125
125
  setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
126
126
  }
127
127
 
128
- interface ShowConfirmOptions {
129
- confirmText?: string;
130
- cancelText?: string;
131
- }
132
- interface ShowAlertOptions {
133
- buttonText?: string;
134
- }
135
128
  interface ShowToastOptions {
136
129
  duration?: number;
137
130
  variant?: 'success' | 'error' | 'warning' | 'info';
@@ -140,21 +133,7 @@ interface ShowToastOptions {
140
133
  };
141
134
  }
142
135
  interface PopupsApi {
143
- showAlert(title: string, message: string, options?: ShowAlertOptions): Promise<void>;
144
- showConfirm(title: string, message: string, options?: ShowConfirmOptions): Promise<boolean>;
145
136
  showToast(message: string, options?: ShowToastOptions): Promise<boolean>;
146
- showActionSheet(items: ActionSheetItem[], options?: ShowActionSheetOptions): Promise<string | number | null>;
147
- }
148
- interface ActionSheetItem {
149
- id?: string;
150
- label: string;
151
- icon?: string;
152
- }
153
- interface ShowActionSheetOptions {
154
- title?: string;
155
- message?: string;
156
- cancelButtonText?: string;
157
- disableCancel?: boolean;
158
137
  }
159
138
 
160
139
  interface ProfileApi {
@@ -820,7 +799,6 @@ interface LoggingApi {
820
799
 
821
800
  interface SharedAssetsApi {
822
801
  loadAssetsBundle(game: string, bundleKey: string): Promise<ArrayBuffer>;
823
- loadLibraryCode(libraryKey: string): Promise<string>;
824
802
  }
825
803
 
826
804
  declare class RpcSharedAssetsApi implements SharedAssetsApi {
@@ -828,7 +806,6 @@ declare class RpcSharedAssetsApi implements SharedAssetsApi {
828
806
  private readonly rpcClient;
829
807
  constructor(rpcClient: RpcClient, venusApi: VenusAPI);
830
808
  loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
831
- loadLibraryCode(libraryKey: string): Promise<string>;
832
809
  }
833
810
  interface LoadEmbeddedAssetsRequest {
834
811
  assetKey: string;
@@ -1359,11 +1336,6 @@ interface VenusExecuteRecipeResult {
1359
1336
  amountFulfilled?: number;
1360
1337
  partialSuccess?: boolean;
1361
1338
  }
1362
- interface ActionSheetOption {
1363
- label: string;
1364
- icon?: string;
1365
- id?: string;
1366
- }
1367
1339
  interface Profile {
1368
1340
  id: string;
1369
1341
  username: string;
@@ -1430,44 +1402,6 @@ interface VenusAPI {
1430
1402
  getLaunchParams(): Record<string, string>;
1431
1403
  getLocale(): string;
1432
1404
  getLanguageCode(): string;
1433
- /**
1434
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1435
- */
1436
- showToast(message: string | {
1437
- message: string;
1438
- duration?: number;
1439
- variant?: string;
1440
- action?: {
1441
- label: string;
1442
- };
1443
- }): Promise<boolean>;
1444
- /**
1445
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1446
- */
1447
- showAlert(options: {
1448
- title: string;
1449
- message: string;
1450
- buttonText?: string;
1451
- }): Promise<void>;
1452
- /**
1453
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1454
- */
1455
- showConfirm(options: {
1456
- title: string;
1457
- message: string;
1458
- confirmText?: string;
1459
- cancelText?: string;
1460
- }): Promise<boolean>;
1461
- /**
1462
- * @deprecated Please use the popups API. (e.g, VenusAPI.popups)
1463
- */
1464
- showActionSheet(options: {
1465
- title: string;
1466
- message?: string;
1467
- options: ActionSheetOption[];
1468
- cancelButtonText?: string;
1469
- disableCancel?: boolean;
1470
- }): Promise<string | number | null>;
1471
1405
  triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
1472
1406
  deviceCache: {
1473
1407
  setItem(key: string, value: string): Promise<void>;
@@ -1614,4 +1548,4 @@ interface AdsApi {
1614
1548
  showInterstitialAd(options?: ShowInterstitialAdOptions): Promise<boolean>;
1615
1549
  }
1616
1550
 
1617
- export { type SubPath as $, type ActionSheetOption as A, type BatchRecipeRequirementsResult as B, type ScheduleLocalNotification as C, type ScheduleNotificationOptions as D, type PopupsApi as E, type ActionSheetItem as F, type ShowActionSheetOptions as G, type Host as H, type ShowAlertOptions as I, type ShowConfirmOptions as J, type ShowToastOptions as K, type ShowInterstitialAdOptions as L, type ShowRewardedAdOptions as M, type NavigationApi as N, type ProfileApi as O, type Profile as P, type QuitOptions as Q, type RecipeRequirementResult as R, type SimulationRunSummary as S, type DeviceApi as T, type DeviceInfo as U, type VenusAPI as V, type EnvironmentApi as W, type EnvironmentInfo as X, type SystemApi as Y, type SafeArea as Z, type CdnApi as _, type VenusSimulationStateResponse as a, type SubmitScoreParams as a$, type FetchBlobOptions as a0, type TimeApi as a1, type ServerTimeData as a2, type GetFutureTimeOptions as a3, type AiApi as a4, type AiChatCompletionRequest as a5, type AiChatCompletionData as a6, type HapticsApi as a7, HapticFeedbackStyle as a8, type FeaturesApi as a9, type Recipe as aA, type GetBatchRecipeRequirements as aB, type TriggerRecipeChainOptions as aC, type RoomDataUpdate as aD, type RoomMessageEvent as aE, type ProposedMoveEvent as aF, VenusTransport as aG, type RoomsApi as aH, type CreateRoomOptions as aI, type JoinOrCreateRoomOptions as aJ, type JoinOrCreateResult as aK, type ListRoomsOptions as aL, type UpdateRoomDataOptions as aM, type RoomMessageRequest as aN, type StartRoomGameOptions as aO, type ProposeMoveRequest as aP, type ProposeMoveResult as aQ, type ValidateMoveVerdict as aR, type ValidateMoveResult as aS, type RoomSubscriptionOptions as aT, type LoggingApi as aU, type IapApi as aV, type SpendCurrencyOptions as aW, type LoadEmbeddedAssetsResponse as aX, type SharedAssetsApi as aY, type LeaderboardApi as aZ, type ScoreToken as a_, type Experiment as aa, type LifecycleApi as ab, type SleepCallback as ac, type Subscription as ad, type AwakeCallback as ae, type PauseCallback as af, type ResumeCallback as ag, type QuitCallback as ah, type SimulationApi as ai, type SimulationSlotValidationResult as aj, type SimulationBatchOperation as ak, type SimulationBatchOperationsResult as al, type SimulationAvailableItem as am, type SimulationPowerPreview as an, type SimulationSlotMutationResult as ao, type SimulationSlotContainer as ap, type SimulationAssignment as aq, type SimulationState as ar, type ExecuteRecipeOptions as as, type ExecuteRecipeResponse as at, type CollectRecipeResult as au, type GetActiveRunsOptions as av, type ExecuteScopedRecipeOptions as aw, type ExecuteScopedRecipeResult as ax, type GetAvailableRecipesOptions as ay, type GetAvailableRecipesResult as az, type SimulationUpdateType as b, type SubmitScoreResult as b0, type GetPagedScoresOptions as b1, type PagedScoresResponse as b2, type PlayerRankOptions as b3, type PlayerRankResult as b4, type GetPodiumScoresOptions as b5, type PodiumScoresResponse as b6, type PreloaderApi as b7, type SocialApi as b8, type ShareMetadata as b9, type SimulationRoomActiveRecipe as bA, type SimulationRoomState as bB, type SimulationBatchOperationAssign as bC, type SimulationBatchOperationRemove as bD, type SimulationBatchOperationResult as bE, RpcSharedAssetsApi as bF, type LoadEmbeddedAssetsRequest as bG, type LeaderboardModeConfig as bH, type LeaderboardPeriodType as bI, type LeaderboardPeriodConfig as bJ, type LeaderboardAntiCheatConfig as bK, type LeaderboardDisplaySettings as bL, type LeaderboardConfig as bM, type LeaderboardEntry as bN, type PodiumScoresContext as bO, type HudInsets as bP, createHost as bQ, type ShareLinkResult as ba, type SocialQRCodeOptions as bb, type QRCodeResult as bc, type Avatar3dApi as bd, type AssetManifest as be, type Avatar3dConfig as bf, type ShowEditorOptions as bg, type Avatar3dEdits as bh, type AdsApi as bi, type InitializationOptions as bj, type InitializationContext as bk, type AiMessage as bl, type Asset as bm, type Category as bn, MockAvatarApi as bo, type TimeIntervalTriggerInput as bp, type NotificationTriggerInput as bq, type OnRequestCallback as br, type OnResponseCallback as bs, type OnNotificationCallback as bt, type RpcTransport as bu, type JoinRoomMatchCriteria as bv, type RoomMessageEventType as bw, type VenusRoomPayload as bx, type RecipeInfo as by, type SimulationPersonalState as bz, type SimulationEntityUpdate as c, type SimulationActiveRunsUpdate as d, type SimulationSnapshotUpdate as e, type SimulationUpdateData as f, type SimulationSubscribeOptions as g, type VenusSimulationEffect as h, type VenusSimulationRecipe as i, type VenusSimulationConfig as j, type RecipeRequirementQuery as k, type VenusExecuteRecipeOptions as l, type VenusExecuteScopedRecipeOptions as m, type VenusAvailableRecipe as n, type VenusCollectRecipeResult as o, type VenusExecuteRecipeResult as p, VenusRoom as q, type AnalyticsApi as r, type RpcRequest as s, type RpcResponse as t, type RpcNotification as u, RpcClient as v, type StorageApi as w, type NavigationStackInfo as x, type PushAppOptions as y, type NotificationsApi as z };
1551
+ export { type AiApi as $, type AnalyticsApi as A, type BatchRecipeRequirementsResult as B, type ScheduleNotificationOptions as C, type PopupsApi as D, type ShowToastOptions as E, type ShowInterstitialAdOptions as F, type ShowRewardedAdOptions as G, type Host as H, type ProfileApi as I, type DeviceApi as J, type DeviceInfo as K, type EnvironmentApi as L, type EnvironmentInfo as M, type NavigationApi as N, type SystemApi as O, type Profile as P, type QuitOptions as Q, type RecipeRequirementResult as R, type SimulationRunSummary as S, type SafeArea as T, type CdnApi as U, type VenusAPI as V, type SubPath as W, type FetchBlobOptions as X, type TimeApi as Y, type ServerTimeData as Z, type GetFutureTimeOptions as _, type VenusSimulationStateResponse as a, type PlayerRankResult as a$, type AiChatCompletionRequest as a0, type AiChatCompletionData as a1, type HapticsApi as a2, HapticFeedbackStyle as a3, type FeaturesApi as a4, type Experiment as a5, type LifecycleApi as a6, type SleepCallback as a7, type Subscription as a8, type AwakeCallback as a9, type ProposedMoveEvent as aA, VenusTransport as aB, type RoomsApi as aC, type CreateRoomOptions as aD, type JoinOrCreateRoomOptions as aE, type JoinOrCreateResult as aF, type ListRoomsOptions as aG, type UpdateRoomDataOptions as aH, type RoomMessageRequest as aI, type StartRoomGameOptions as aJ, type ProposeMoveRequest as aK, type ProposeMoveResult as aL, type ValidateMoveVerdict as aM, type ValidateMoveResult as aN, type RoomSubscriptionOptions as aO, type LoggingApi as aP, type IapApi as aQ, type SpendCurrencyOptions as aR, type LoadEmbeddedAssetsResponse as aS, type SharedAssetsApi as aT, type LeaderboardApi as aU, type ScoreToken as aV, type SubmitScoreParams as aW, type SubmitScoreResult as aX, type GetPagedScoresOptions as aY, type PagedScoresResponse as aZ, type PlayerRankOptions as a_, type PauseCallback as aa, type ResumeCallback as ab, type QuitCallback as ac, type SimulationApi as ad, type SimulationSlotValidationResult as ae, type SimulationBatchOperation as af, type SimulationBatchOperationsResult as ag, type SimulationAvailableItem as ah, type SimulationPowerPreview as ai, type SimulationSlotMutationResult as aj, type SimulationSlotContainer as ak, type SimulationAssignment as al, type SimulationState as am, type ExecuteRecipeOptions as an, type ExecuteRecipeResponse as ao, type CollectRecipeResult as ap, type GetActiveRunsOptions as aq, type ExecuteScopedRecipeOptions as ar, type ExecuteScopedRecipeResult as as, type GetAvailableRecipesOptions as at, type GetAvailableRecipesResult as au, type Recipe as av, type GetBatchRecipeRequirements as aw, type TriggerRecipeChainOptions as ax, type RoomDataUpdate as ay, type RoomMessageEvent as az, type SimulationUpdateType as b, type GetPodiumScoresOptions as b0, type PodiumScoresResponse as b1, type PreloaderApi as b2, type SocialApi as b3, type ShareMetadata as b4, type ShareLinkResult as b5, type SocialQRCodeOptions as b6, type QRCodeResult as b7, type Avatar3dApi as b8, type AssetManifest as b9, RpcSharedAssetsApi as bA, type LoadEmbeddedAssetsRequest as bB, type LeaderboardModeConfig as bC, type LeaderboardPeriodType as bD, type LeaderboardPeriodConfig as bE, type LeaderboardAntiCheatConfig as bF, type LeaderboardDisplaySettings as bG, type LeaderboardConfig as bH, type LeaderboardEntry as bI, type PodiumScoresContext as bJ, type HudInsets as bK, createHost as bL, type Avatar3dConfig as ba, type ShowEditorOptions as bb, type Avatar3dEdits as bc, type AdsApi as bd, type InitializationOptions as be, type InitializationContext as bf, type AiMessage as bg, type Asset as bh, type Category as bi, MockAvatarApi as bj, type TimeIntervalTriggerInput as bk, type NotificationTriggerInput as bl, type OnRequestCallback as bm, type OnResponseCallback as bn, type OnNotificationCallback as bo, type RpcTransport as bp, type JoinRoomMatchCriteria as bq, type RoomMessageEventType as br, type VenusRoomPayload as bs, type RecipeInfo as bt, type SimulationPersonalState as bu, type SimulationRoomActiveRecipe as bv, type SimulationRoomState as bw, type SimulationBatchOperationAssign as bx, type SimulationBatchOperationRemove as by, type SimulationBatchOperationResult as bz, type SimulationEntityUpdate as c, type SimulationActiveRunsUpdate as d, type SimulationSnapshotUpdate as e, type SimulationUpdateData as f, type SimulationSubscribeOptions as g, type VenusSimulationEffect as h, type VenusSimulationRecipe as i, type VenusSimulationConfig as j, type RecipeRequirementQuery as k, type VenusExecuteRecipeOptions as l, type VenusExecuteScopedRecipeOptions as m, type VenusAvailableRecipe as n, type VenusCollectRecipeResult as o, type VenusExecuteRecipeResult as p, VenusRoom as q, type RpcRequest as r, type RpcResponse as s, type RpcNotification as t, RpcClient as u, type StorageApi as v, type NavigationStackInfo as w, type PushAppOptions as x, type NotificationsApi as y, type ScheduleLocalNotification as z };
@@ -1,4 +1,4 @@
1
- // raw-loader:/Users/pchan/Development/series/venus/venus-sdk/packages/api/src/webview/webviewLibraryShim.js
1
+ // raw-loader:E:\SeriesAI\venus\venus-sdk\packages\api\src\webview\webviewLibraryShim.js
2
2
  var webviewLibraryShim_default = "/**\r\n * Venus Embedded Libraries WebView Shim\r\n *\r\n * This code is injected into H5 game WebViews BEFORE the game's main script runs.\r\n * It bootstraps the embedded libraries system by:\r\n * 1. Reading window.__venusLibrariesConfig (set by the Vite plugin)\r\n * 2. Loading libraries via RPC (mobile) or CDN (web)\r\n * 3. Registering libraries in window.__venusLibraryExports\r\n * 4. Allowing the game's virtual modules to access them\r\n *\r\n * This shim is NOT imported by H5 games - it's injected by the Venus host via\r\n * injectedJavaScriptBeforeContentLoaded in H5AppPoolRenderer.\r\n */\r\n\r\n;(function () {\r\n if (typeof window === 'undefined') {\r\n return\r\n }\r\n\r\n if (window.__venusLibraryShim && window.__venusLibraryShim.__initialized) {\r\n return\r\n }\r\n\r\n var RESPONSE_TYPE = 'H5_RESPONSE'\r\n var REQUEST_TYPE = 'H5_LOAD_EMBEDDED_ASSET'\r\n var REQUEST_TIMEOUT_MS = 12000\r\n var pendingRequests = new Map()\r\n\r\n function ensureConfig() {\r\n if (!window.__venusLibrariesConfig) {\r\n window.__venusLibrariesConfig = {\r\n enabled: false,\r\n required: [],\r\n manifest: {},\r\n cdnBase: '',\r\n }\r\n }\r\n if (!window.__venusLibrariesConfig.manifest) {\r\n window.__venusLibrariesConfig.manifest = {}\r\n }\r\n if (!Array.isArray(window.__venusLibrariesConfig.required)) {\r\n window.__venusLibrariesConfig.required = []\r\n }\r\n return window.__venusLibrariesConfig\r\n }\r\n\r\n function ensureExportsRegistry() {\r\n if (!window.__venusLibraryExports) {\r\n window.__venusLibraryExports = {}\r\n }\r\n return window.__venusLibraryExports\r\n }\r\n\r\n function hasHostBridge() {\r\n return !!(\r\n window.ReactNativeWebView &&\r\n typeof window.ReactNativeWebView.postMessage === 'function'\r\n )\r\n }\r\n\r\n function registerResponseListeners() {\r\n if (\r\n window.__venusLibraryShim &&\r\n window.__venusLibraryShim.__listenerRegistered\r\n ) {\r\n return\r\n }\r\n\r\n function handleMessage(event) {\r\n var payload = parsePayload(event && event.data)\r\n if (!payload || payload.type !== RESPONSE_TYPE || !payload.data) {\r\n return\r\n }\r\n var requestId = payload.data.requestId\r\n if (!requestId || !pendingRequests.has(requestId)) {\r\n return\r\n }\r\n var pending = pendingRequests.get(requestId)\r\n pendingRequests.delete(requestId)\r\n clearTimeout(pending.timeout)\r\n\r\n if (payload.data.success === false) {\r\n pending.reject(\r\n new Error(payload.data.error || 'Embedded library load failed'),\r\n )\r\n return\r\n }\r\n\r\n var value = payload.data.value || payload.data\r\n if (!value || !value.base64Data) {\r\n pending.reject(\r\n new Error('Embedded library response was missing base64Data'),\r\n )\r\n return\r\n }\r\n\r\n pending.resolve(value.base64Data)\r\n }\r\n\r\n if (\r\n typeof document !== 'undefined' &&\r\n typeof document.addEventListener === 'function'\r\n ) {\r\n document.addEventListener('message', handleMessage, false)\r\n }\r\n if (\r\n typeof window !== 'undefined' &&\r\n typeof window.addEventListener === 'function'\r\n ) {\r\n window.addEventListener('message', handleMessage, false)\r\n }\r\n\r\n if (!window.__venusLibraryShim) {\r\n window.__venusLibraryShim = {}\r\n }\r\n window.__venusLibraryShim.__listenerRegistered = true\r\n }\r\n\r\n function parsePayload(raw) {\r\n if (!raw || typeof raw !== 'string') {\r\n return null\r\n }\r\n try {\r\n return JSON.parse(raw)\r\n } catch (error) {\r\n return null\r\n }\r\n }\r\n\r\n function createRequestId(libraryKey) {\r\n var sanitized = ''\r\n for (var i = 0; i < libraryKey.length; i++) {\r\n var c = libraryKey.charAt(i)\r\n if (\r\n (c >= 'a' && c <= 'z') ||\r\n (c >= 'A' && c <= 'Z') ||\r\n (c >= '0' && c <= '9') ||\r\n c === '-' ||\r\n c === '_'\r\n ) {\r\n sanitized += c\r\n } else {\r\n sanitized += '_'\r\n }\r\n }\r\n return (\r\n 'embedded-lib-' +\r\n sanitized +\r\n '-' +\r\n Date.now() +\r\n '-' +\r\n Math.random().toString(36).slice(2)\r\n )\r\n }\r\n\r\n function postHostRequest(assetKey, requestId) {\r\n if (!hasHostBridge()) {\r\n throw new Error('Host bridge is unavailable')\r\n }\r\n var bridge = window.ReactNativeWebView\r\n var message = {\r\n type: REQUEST_TYPE,\r\n direction: 'H5_TO_APP',\r\n data: {\r\n requestId: requestId,\r\n assetKey: assetKey,\r\n },\r\n instanceId:\r\n (window._venusInitState && window._venusInitState.poolId) || 'unknown',\r\n timestamp: Date.now(),\r\n }\r\n bridge.postMessage(JSON.stringify(message))\r\n }\r\n\r\n function loadLibraryViaHost(assetKey, libraryKey) {\r\n return new Promise(function (resolve, reject) {\r\n var requestId = createRequestId(libraryKey)\r\n var timeout = setTimeout(function () {\r\n pendingRequests.delete(requestId)\r\n reject(new Error('Timed out loading embedded library: ' + libraryKey))\r\n }, REQUEST_TIMEOUT_MS)\r\n\r\n pendingRequests.set(requestId, {\r\n resolve: resolve,\r\n reject: reject,\r\n timeout: timeout,\r\n })\r\n\r\n try {\r\n postHostRequest(assetKey, requestId)\r\n } catch (error) {\r\n pendingRequests.delete(requestId)\r\n clearTimeout(timeout)\r\n reject(error)\r\n }\r\n })\r\n }\r\n\r\n function buildCdnUrl(config, entry) {\r\n var base = config.cdnBase || ''\r\n if (!base.endsWith('/')) {\r\n base += '/'\r\n }\r\n var path = entry.cdnPath\r\n if (path.charAt(0) === '/') {\r\n path = path.substring(1)\r\n }\r\n return base + path\r\n }\r\n\r\n async function loadLibraryViaCdn(config, entry, libraryKey) {\r\n if (!config.cdnBase) {\r\n throw new Error('CDN base URL is not configured')\r\n }\r\n var url = buildCdnUrl(config, entry)\r\n var response = await fetch(url, { credentials: 'omit' })\r\n if (!response.ok) {\r\n throw new Error(\r\n 'Failed to fetch embedded library from CDN: ' + libraryKey,\r\n )\r\n }\r\n return await response.text()\r\n }\r\n\r\n function decodeBase64ToUtf8(base64) {\r\n if (typeof base64 !== 'string') {\r\n throw new Error('Invalid base64 payload')\r\n }\r\n\r\n if (typeof atob === 'function') {\r\n var binary = atob(base64)\r\n if (typeof TextDecoder !== 'undefined') {\r\n var len = binary.length\r\n var bytes = new Uint8Array(len)\r\n for (var i = 0; i < len; i++) {\r\n bytes[i] = binary.charCodeAt(i)\r\n }\r\n return new TextDecoder('utf-8').decode(bytes)\r\n }\r\n return decodeURIComponent(escape(binary))\r\n }\r\n\r\n var bufferCtor =\r\n (typeof globalThis !== 'undefined' && globalThis.Buffer) ||\r\n (typeof window !== 'undefined' && window.Buffer)\r\n if (bufferCtor) {\r\n return bufferCtor.from(base64, 'base64').toString('utf-8')\r\n }\r\n\r\n throw new Error('No base64 decoder available')\r\n }\r\n\r\n function evaluateLibrarySource(libraryKey, globalVar, source) {\r\n var registry = ensureExportsRegistry()\r\n if (!source) {\r\n throw new Error('Embedded library source was empty for ' + libraryKey)\r\n }\r\n\r\n var previousValue = window[globalVar]\r\n try {\r\n var executor = new Function(\r\n source + '\\n//# sourceURL=venus-library-' + libraryKey + '.js',\r\n )\r\n executor.call(window)\r\n } catch (error) {\r\n throw new Error(\r\n 'Failed to evaluate embedded library ' +\r\n libraryKey +\r\n ': ' +\r\n (error && error.message ? error.message : error),\r\n )\r\n }\r\n\r\n var exported = window[globalVar] || previousValue\r\n if (!exported) {\r\n throw new Error(\r\n 'Embedded library ' + libraryKey + ' did not register ' + globalVar,\r\n )\r\n }\r\n\r\n registry[libraryKey] = exported\r\n return exported\r\n }\r\n\r\n async function ensureLibraryLoaded(config, libraryKey) {\r\n var registry = ensureExportsRegistry()\r\n if (registry[libraryKey]) {\r\n return registry[libraryKey]\r\n }\r\n\r\n var entry = config.manifest && config.manifest[libraryKey]\r\n if (!entry) {\r\n throw new Error('No manifest entry for embedded library ' + libraryKey)\r\n }\r\n\r\n var source = null\r\n if (config.useHost !== false && hasHostBridge()) {\r\n try {\r\n var base64 = await loadLibraryViaHost(entry.assetKey, libraryKey)\r\n source = decodeBase64ToUtf8(base64)\r\n } catch (error) {\r\n // Log the RPC error loudly before fallback\r\n console.error(\r\n '[Venus Libraries] Failed to load ' +\r\n libraryKey +\r\n ' from host via RPC:',\r\n error,\r\n )\r\n console.warn(\r\n '[Venus Libraries] Falling back to CDN for ' +\r\n libraryKey +\r\n '. This may indicate an asset packaging issue.',\r\n )\r\n }\r\n }\r\n\r\n if (!source) {\r\n source = await loadLibraryViaCdn(config, entry, libraryKey)\r\n }\r\n\r\n return evaluateLibrarySource(libraryKey, entry.globalVar, source)\r\n }\r\n\r\n async function bootstrap() {\r\n try {\r\n registerResponseListeners()\r\n getBootstrapPromise()\r\n\r\n var config = ensureConfig()\r\n\r\n if (!config.enabled) {\r\n if (bootstrapResolve) bootstrapResolve()\r\n return\r\n }\r\n\r\n if (!Array.isArray(config.required) || config.required.length === 0) {\r\n if (bootstrapResolve) bootstrapResolve()\r\n return\r\n }\r\n\r\n // Group libraries by load stage for parallel loading within stages\r\n var librariesByStage = {}\r\n for (var i = 0; i < config.required.length; i++) {\r\n var libraryKey = config.required[i]\r\n var entry = config.manifest[libraryKey]\r\n var stage = entry.loadStage || 0\r\n if (!librariesByStage[stage]) librariesByStage[stage] = []\r\n librariesByStage[stage].push(libraryKey)\r\n }\r\n\r\n // Load stages sequentially, libraries within each stage in parallel\r\n var stages = Object.keys(librariesByStage).sort(function (a, b) {\r\n return parseInt(a, 10) - parseInt(b, 10)\r\n })\r\n\r\n for (var s = 0; s < stages.length; s++) {\r\n var stage = stages[s]\r\n var libs = librariesByStage[stage]\r\n\r\n // Load all libraries in this stage in parallel\r\n var stagePromises = libs.map(function (libraryKey) {\r\n return ensureLibraryLoaded(config, libraryKey).catch(\r\n function (error) {\r\n console.error(\r\n '[Venus Libraries] Failed to load library ' + libraryKey,\r\n error,\r\n )\r\n throw error\r\n },\r\n )\r\n })\r\n\r\n await Promise.all(stagePromises)\r\n }\r\n\r\n if (bootstrapResolve) bootstrapResolve()\r\n } catch (error) {\r\n console.error('[Venus Libraries] Bootstrap error', error)\r\n if (bootstrapReject) bootstrapReject(error)\r\n throw error\r\n }\r\n }\r\n\r\n // Create a promise that resolves when bootstrap completes\r\n var bootstrapPromise = null\r\n var bootstrapResolve = null\r\n var bootstrapReject = null\r\n\r\n function getBootstrapPromise() {\r\n if (!bootstrapPromise) {\r\n bootstrapPromise = new Promise(function (resolve, reject) {\r\n bootstrapResolve = resolve\r\n bootstrapReject = reject\r\n })\r\n }\r\n return bootstrapPromise\r\n }\r\n\r\n window.__venusLibraryShim = {\r\n bootstrap: bootstrap,\r\n ready: getBootstrapPromise,\r\n getExports: function (libraryKey) {\r\n var registry = ensureExportsRegistry()\r\n return registry[libraryKey]\r\n },\r\n __initialized: true,\r\n }\r\n})()\r\n";
3
3
 
4
4
  // src/webview/webviewLibraryShimSource.ts
@@ -8,5 +8,5 @@ function getWebviewLibraryShimSource() {
8
8
  }
9
9
 
10
10
  export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource };
11
- //# sourceMappingURL=chunk-UXY5CKKG.mjs.map
12
- //# sourceMappingURL=chunk-UXY5CKKG.mjs.map
11
+ //# sourceMappingURL=chunk-3ZNKYBXC.mjs.map
12
+ //# sourceMappingURL=chunk-3ZNKYBXC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["raw-loader:E:/SeriesAI/venus/venus-sdk/packages/api/src/webview/webviewLibraryShim.js","../src/webview/webviewLibraryShimSource.ts"],"names":[],"mappings":";AAAA,IAAO,0BAAA,GAAQ,omYAAA;;;ACcR,IAAM,2BAAA,GAA8B;AAEpC,SAAS,2BAAA,GAAsC;AACpD,EAAA,OAAO,2BAAA;AACT","file":"chunk-3ZNKYBXC.mjs","sourcesContent":["export default \"/**\\r\\n * Venus Embedded Libraries WebView Shim\\r\\n *\\r\\n * This code is injected into H5 game WebViews BEFORE the game's main script runs.\\r\\n * It bootstraps the embedded libraries system by:\\r\\n * 1. Reading window.__venusLibrariesConfig (set by the Vite plugin)\\r\\n * 2. Loading libraries via RPC (mobile) or CDN (web)\\r\\n * 3. Registering libraries in window.__venusLibraryExports\\r\\n * 4. Allowing the game's virtual modules to access them\\r\\n *\\r\\n * This shim is NOT imported by H5 games - it's injected by the Venus host via\\r\\n * injectedJavaScriptBeforeContentLoaded in H5AppPoolRenderer.\\r\\n */\\r\\n\\r\\n;(function () {\\r\\n if (typeof window === 'undefined') {\\r\\n return\\r\\n }\\r\\n\\r\\n if (window.__venusLibraryShim && window.__venusLibraryShim.__initialized) {\\r\\n return\\r\\n }\\r\\n\\r\\n var RESPONSE_TYPE = 'H5_RESPONSE'\\r\\n var REQUEST_TYPE = 'H5_LOAD_EMBEDDED_ASSET'\\r\\n var REQUEST_TIMEOUT_MS = 12000\\r\\n var pendingRequests = new Map()\\r\\n\\r\\n function ensureConfig() {\\r\\n if (!window.__venusLibrariesConfig) {\\r\\n window.__venusLibrariesConfig = {\\r\\n enabled: false,\\r\\n required: [],\\r\\n manifest: {},\\r\\n cdnBase: '',\\r\\n }\\r\\n }\\r\\n if (!window.__venusLibrariesConfig.manifest) {\\r\\n window.__venusLibrariesConfig.manifest = {}\\r\\n }\\r\\n if (!Array.isArray(window.__venusLibrariesConfig.required)) {\\r\\n window.__venusLibrariesConfig.required = []\\r\\n }\\r\\n return window.__venusLibrariesConfig\\r\\n }\\r\\n\\r\\n function ensureExportsRegistry() {\\r\\n if (!window.__venusLibraryExports) {\\r\\n window.__venusLibraryExports = {}\\r\\n }\\r\\n return window.__venusLibraryExports\\r\\n }\\r\\n\\r\\n function hasHostBridge() {\\r\\n return !!(\\r\\n window.ReactNativeWebView &&\\r\\n typeof window.ReactNativeWebView.postMessage === 'function'\\r\\n )\\r\\n }\\r\\n\\r\\n function registerResponseListeners() {\\r\\n if (\\r\\n window.__venusLibraryShim &&\\r\\n window.__venusLibraryShim.__listenerRegistered\\r\\n ) {\\r\\n return\\r\\n }\\r\\n\\r\\n function handleMessage(event) {\\r\\n var payload = parsePayload(event && event.data)\\r\\n if (!payload || payload.type !== RESPONSE_TYPE || !payload.data) {\\r\\n return\\r\\n }\\r\\n var requestId = payload.data.requestId\\r\\n if (!requestId || !pendingRequests.has(requestId)) {\\r\\n return\\r\\n }\\r\\n var pending = pendingRequests.get(requestId)\\r\\n pendingRequests.delete(requestId)\\r\\n clearTimeout(pending.timeout)\\r\\n\\r\\n if (payload.data.success === false) {\\r\\n pending.reject(\\r\\n new Error(payload.data.error || 'Embedded library load failed'),\\r\\n )\\r\\n return\\r\\n }\\r\\n\\r\\n var value = payload.data.value || payload.data\\r\\n if (!value || !value.base64Data) {\\r\\n pending.reject(\\r\\n new Error('Embedded library response was missing base64Data'),\\r\\n )\\r\\n return\\r\\n }\\r\\n\\r\\n pending.resolve(value.base64Data)\\r\\n }\\r\\n\\r\\n if (\\r\\n typeof document !== 'undefined' &&\\r\\n typeof document.addEventListener === 'function'\\r\\n ) {\\r\\n document.addEventListener('message', handleMessage, false)\\r\\n }\\r\\n if (\\r\\n typeof window !== 'undefined' &&\\r\\n typeof window.addEventListener === 'function'\\r\\n ) {\\r\\n window.addEventListener('message', handleMessage, false)\\r\\n }\\r\\n\\r\\n if (!window.__venusLibraryShim) {\\r\\n window.__venusLibraryShim = {}\\r\\n }\\r\\n window.__venusLibraryShim.__listenerRegistered = true\\r\\n }\\r\\n\\r\\n function parsePayload(raw) {\\r\\n if (!raw || typeof raw !== 'string') {\\r\\n return null\\r\\n }\\r\\n try {\\r\\n return JSON.parse(raw)\\r\\n } catch (error) {\\r\\n return null\\r\\n }\\r\\n }\\r\\n\\r\\n function createRequestId(libraryKey) {\\r\\n var sanitized = ''\\r\\n for (var i = 0; i < libraryKey.length; i++) {\\r\\n var c = libraryKey.charAt(i)\\r\\n if (\\r\\n (c >= 'a' && c <= 'z') ||\\r\\n (c >= 'A' && c <= 'Z') ||\\r\\n (c >= '0' && c <= '9') ||\\r\\n c === '-' ||\\r\\n c === '_'\\r\\n ) {\\r\\n sanitized += c\\r\\n } else {\\r\\n sanitized += '_'\\r\\n }\\r\\n }\\r\\n return (\\r\\n 'embedded-lib-' +\\r\\n sanitized +\\r\\n '-' +\\r\\n Date.now() +\\r\\n '-' +\\r\\n Math.random().toString(36).slice(2)\\r\\n )\\r\\n }\\r\\n\\r\\n function postHostRequest(assetKey, requestId) {\\r\\n if (!hasHostBridge()) {\\r\\n throw new Error('Host bridge is unavailable')\\r\\n }\\r\\n var bridge = window.ReactNativeWebView\\r\\n var message = {\\r\\n type: REQUEST_TYPE,\\r\\n direction: 'H5_TO_APP',\\r\\n data: {\\r\\n requestId: requestId,\\r\\n assetKey: assetKey,\\r\\n },\\r\\n instanceId:\\r\\n (window._venusInitState && window._venusInitState.poolId) || 'unknown',\\r\\n timestamp: Date.now(),\\r\\n }\\r\\n bridge.postMessage(JSON.stringify(message))\\r\\n }\\r\\n\\r\\n function loadLibraryViaHost(assetKey, libraryKey) {\\r\\n return new Promise(function (resolve, reject) {\\r\\n var requestId = createRequestId(libraryKey)\\r\\n var timeout = setTimeout(function () {\\r\\n pendingRequests.delete(requestId)\\r\\n reject(new Error('Timed out loading embedded library: ' + libraryKey))\\r\\n }, REQUEST_TIMEOUT_MS)\\r\\n\\r\\n pendingRequests.set(requestId, {\\r\\n resolve: resolve,\\r\\n reject: reject,\\r\\n timeout: timeout,\\r\\n })\\r\\n\\r\\n try {\\r\\n postHostRequest(assetKey, requestId)\\r\\n } catch (error) {\\r\\n pendingRequests.delete(requestId)\\r\\n clearTimeout(timeout)\\r\\n reject(error)\\r\\n }\\r\\n })\\r\\n }\\r\\n\\r\\n function buildCdnUrl(config, entry) {\\r\\n var base = config.cdnBase || ''\\r\\n if (!base.endsWith('/')) {\\r\\n base += '/'\\r\\n }\\r\\n var path = entry.cdnPath\\r\\n if (path.charAt(0) === '/') {\\r\\n path = path.substring(1)\\r\\n }\\r\\n return base + path\\r\\n }\\r\\n\\r\\n async function loadLibraryViaCdn(config, entry, libraryKey) {\\r\\n if (!config.cdnBase) {\\r\\n throw new Error('CDN base URL is not configured')\\r\\n }\\r\\n var url = buildCdnUrl(config, entry)\\r\\n var response = await fetch(url, { credentials: 'omit' })\\r\\n if (!response.ok) {\\r\\n throw new Error(\\r\\n 'Failed to fetch embedded library from CDN: ' + libraryKey,\\r\\n )\\r\\n }\\r\\n return await response.text()\\r\\n }\\r\\n\\r\\n function decodeBase64ToUtf8(base64) {\\r\\n if (typeof base64 !== 'string') {\\r\\n throw new Error('Invalid base64 payload')\\r\\n }\\r\\n\\r\\n if (typeof atob === 'function') {\\r\\n var binary = atob(base64)\\r\\n if (typeof TextDecoder !== 'undefined') {\\r\\n var len = binary.length\\r\\n var bytes = new Uint8Array(len)\\r\\n for (var i = 0; i < len; i++) {\\r\\n bytes[i] = binary.charCodeAt(i)\\r\\n }\\r\\n return new TextDecoder('utf-8').decode(bytes)\\r\\n }\\r\\n return decodeURIComponent(escape(binary))\\r\\n }\\r\\n\\r\\n var bufferCtor =\\r\\n (typeof globalThis !== 'undefined' && globalThis.Buffer) ||\\r\\n (typeof window !== 'undefined' && window.Buffer)\\r\\n if (bufferCtor) {\\r\\n return bufferCtor.from(base64, 'base64').toString('utf-8')\\r\\n }\\r\\n\\r\\n throw new Error('No base64 decoder available')\\r\\n }\\r\\n\\r\\n function evaluateLibrarySource(libraryKey, globalVar, source) {\\r\\n var registry = ensureExportsRegistry()\\r\\n if (!source) {\\r\\n throw new Error('Embedded library source was empty for ' + libraryKey)\\r\\n }\\r\\n\\r\\n var previousValue = window[globalVar]\\r\\n try {\\r\\n var executor = new Function(\\r\\n source + '\\\\n//# sourceURL=venus-library-' + libraryKey + '.js',\\r\\n )\\r\\n executor.call(window)\\r\\n } catch (error) {\\r\\n throw new Error(\\r\\n 'Failed to evaluate embedded library ' +\\r\\n libraryKey +\\r\\n ': ' +\\r\\n (error && error.message ? error.message : error),\\r\\n )\\r\\n }\\r\\n\\r\\n var exported = window[globalVar] || previousValue\\r\\n if (!exported) {\\r\\n throw new Error(\\r\\n 'Embedded library ' + libraryKey + ' did not register ' + globalVar,\\r\\n )\\r\\n }\\r\\n\\r\\n registry[libraryKey] = exported\\r\\n return exported\\r\\n }\\r\\n\\r\\n async function ensureLibraryLoaded(config, libraryKey) {\\r\\n var registry = ensureExportsRegistry()\\r\\n if (registry[libraryKey]) {\\r\\n return registry[libraryKey]\\r\\n }\\r\\n\\r\\n var entry = config.manifest && config.manifest[libraryKey]\\r\\n if (!entry) {\\r\\n throw new Error('No manifest entry for embedded library ' + libraryKey)\\r\\n }\\r\\n\\r\\n var source = null\\r\\n if (config.useHost !== false && hasHostBridge()) {\\r\\n try {\\r\\n var base64 = await loadLibraryViaHost(entry.assetKey, libraryKey)\\r\\n source = decodeBase64ToUtf8(base64)\\r\\n } catch (error) {\\r\\n // Log the RPC error loudly before fallback\\r\\n console.error(\\r\\n '[Venus Libraries] Failed to load ' +\\r\\n libraryKey +\\r\\n ' from host via RPC:',\\r\\n error,\\r\\n )\\r\\n console.warn(\\r\\n '[Venus Libraries] Falling back to CDN for ' +\\r\\n libraryKey +\\r\\n '. This may indicate an asset packaging issue.',\\r\\n )\\r\\n }\\r\\n }\\r\\n\\r\\n if (!source) {\\r\\n source = await loadLibraryViaCdn(config, entry, libraryKey)\\r\\n }\\r\\n\\r\\n return evaluateLibrarySource(libraryKey, entry.globalVar, source)\\r\\n }\\r\\n\\r\\n async function bootstrap() {\\r\\n try {\\r\\n registerResponseListeners()\\r\\n getBootstrapPromise()\\r\\n\\r\\n var config = ensureConfig()\\r\\n\\r\\n if (!config.enabled) {\\r\\n if (bootstrapResolve) bootstrapResolve()\\r\\n return\\r\\n }\\r\\n\\r\\n if (!Array.isArray(config.required) || config.required.length === 0) {\\r\\n if (bootstrapResolve) bootstrapResolve()\\r\\n return\\r\\n }\\r\\n\\r\\n // Group libraries by load stage for parallel loading within stages\\r\\n var librariesByStage = {}\\r\\n for (var i = 0; i < config.required.length; i++) {\\r\\n var libraryKey = config.required[i]\\r\\n var entry = config.manifest[libraryKey]\\r\\n var stage = entry.loadStage || 0\\r\\n if (!librariesByStage[stage]) librariesByStage[stage] = []\\r\\n librariesByStage[stage].push(libraryKey)\\r\\n }\\r\\n\\r\\n // Load stages sequentially, libraries within each stage in parallel\\r\\n var stages = Object.keys(librariesByStage).sort(function (a, b) {\\r\\n return parseInt(a, 10) - parseInt(b, 10)\\r\\n })\\r\\n\\r\\n for (var s = 0; s < stages.length; s++) {\\r\\n var stage = stages[s]\\r\\n var libs = librariesByStage[stage]\\r\\n\\r\\n // Load all libraries in this stage in parallel\\r\\n var stagePromises = libs.map(function (libraryKey) {\\r\\n return ensureLibraryLoaded(config, libraryKey).catch(\\r\\n function (error) {\\r\\n console.error(\\r\\n '[Venus Libraries] Failed to load library ' + libraryKey,\\r\\n error,\\r\\n )\\r\\n throw error\\r\\n },\\r\\n )\\r\\n })\\r\\n\\r\\n await Promise.all(stagePromises)\\r\\n }\\r\\n\\r\\n if (bootstrapResolve) bootstrapResolve()\\r\\n } catch (error) {\\r\\n console.error('[Venus Libraries] Bootstrap error', error)\\r\\n if (bootstrapReject) bootstrapReject(error)\\r\\n throw error\\r\\n }\\r\\n }\\r\\n\\r\\n // Create a promise that resolves when bootstrap completes\\r\\n var bootstrapPromise = null\\r\\n var bootstrapResolve = null\\r\\n var bootstrapReject = null\\r\\n\\r\\n function getBootstrapPromise() {\\r\\n if (!bootstrapPromise) {\\r\\n bootstrapPromise = new Promise(function (resolve, reject) {\\r\\n bootstrapResolve = resolve\\r\\n bootstrapReject = reject\\r\\n })\\r\\n }\\r\\n return bootstrapPromise\\r\\n }\\r\\n\\r\\n window.__venusLibraryShim = {\\r\\n bootstrap: bootstrap,\\r\\n ready: getBootstrapPromise,\\r\\n getExports: function (libraryKey) {\\r\\n var registry = ensureExportsRegistry()\\r\\n return registry[libraryKey]\\r\\n },\\r\\n __initialized: true,\\r\\n }\\r\\n})()\\r\\n\"","/**\r\n * Webview Library Shim Source\r\n *\r\n * This module exports the shim code that is injected into H5 game WebViews.\r\n * The actual shim code is in webviewLibraryShim.js and imported as a raw string.\r\n *\r\n * Using Vite's ?raw import allows us to:\r\n * - Keep the shim as actual JavaScript (not a string literal)\r\n * - Get proper IDE support (syntax highlighting, linting)\r\n * - Avoid escaping issues\r\n */\r\n\r\nimport shimSource from './webviewLibraryShim.js?raw'\r\n\r\nexport const WEBVIEW_LIBRARY_SHIM_SOURCE = shimSource\r\n\r\nexport function getWebviewLibraryShimSource(): string {\r\n return WEBVIEW_LIBRARY_SHIM_SOURCE\r\n}\r\n"]}