@apps-in-toss/framework 0.0.0-dev.1752049503789 → 0.0.0-dev.1752114017143

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.
package/dist/index.cjs CHANGED
@@ -34,43 +34,29 @@ __export(src_exports, {
34
34
  Accuracy: () => Accuracy2,
35
35
  Analytics: () => Analytics2,
36
36
  AppsInToss: () => AppsInToss,
37
- AppsInTossModule: () => AppsInTossModule,
38
- BedrockCoreModule: () => BedrockCoreModule,
39
- BedrockModule: () => BedrockModule,
40
37
  GoogleAdMob: () => GoogleAdMob,
41
- INTERNAL__AppsInTossModule: () => AppsInTossModuleInstance,
42
- INTERNAL__module: () => INTERNAL__module,
38
+ IAP: () => IAP,
39
+ INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
43
40
  Storage: () => Storage,
44
41
  TossPay: () => TossPay,
45
42
  WebView: () => WebView,
46
43
  appLogin: () => appLogin,
47
44
  appsInTossEvent: () => appsInTossEvent,
48
- closeView: () => closeView,
49
45
  env: () => env,
50
46
  eventLog: () => eventLog,
51
47
  fetchAlbumPhotos: () => fetchAlbumPhotos,
52
48
  fetchContacts: () => fetchContacts,
53
- generateHapticFeedback: () => generateHapticFeedback,
54
49
  getClipboardText: () => getClipboardText,
55
50
  getCurrentLocation: () => getCurrentLocation,
56
51
  getDeviceId: () => getDeviceId,
57
- getLocale: () => getLocale,
58
- getNetworkStatus: () => getNetworkStatus,
59
52
  getOperationalEnvironment: () => getOperationalEnvironment,
60
- getPlatformOS: () => getPlatformOS,
61
- getSchemeUri: () => getSchemeUri,
62
53
  getTossAppVersion: () => getTossAppVersion,
63
54
  getTossShareLink: () => getTossShareLink,
64
55
  isMinVersionSupported: () => isMinVersionSupported,
65
56
  openCamera: () => openCamera,
66
- openURL: () => openURL,
67
57
  saveBase64Data: () => saveBase64Data,
68
58
  setClipboardText: () => setClipboardText,
69
59
  setDeviceOrientation: () => setDeviceOrientation,
70
- setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled,
71
- setScreenAwakeMode: () => setScreenAwakeMode,
72
- setSecureScreen: () => setSecureScreen,
73
- share: () => share,
74
60
  startUpdateLocation: () => startUpdateLocation,
75
61
  useGeolocation: () => useGeolocation
76
62
  });
@@ -79,30 +65,210 @@ var import_analytics2 = require("@apps-in-toss/analytics");
79
65
 
80
66
  // src/core/registerApp.tsx
81
67
  var import_analytics = require("@apps-in-toss/analytics");
82
- var import_react_native28 = require("@granite-js/react-native");
83
- var import_react_native29 = require("@toss-design-system/react-native");
68
+ var import_react_native6 = require("@toss-design-system/react-native");
69
+ var import_react_native_bedrock8 = require("react-native-bedrock");
84
70
 
85
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
86
- var import_react_native = require("@granite-js/react-native");
87
- var import_react_native2 = require("@granite-js/react-native");
88
- var import_react_native3 = require("@granite-js/react-native");
89
- var import_react_native4 = require("react-native");
90
- var import_react_native5 = require("react-native");
91
- var import_react_native6 = require("@granite-js/react-native");
71
+ // src/core/components/AppEvent.tsx
72
+ var import_react2 = require("react");
73
+ var import_react_native_bedrock2 = require("react-native-bedrock");
92
74
 
93
- // ../../.yarn/cache/es-toolkit-npm-1.39.3-b94f623c91-1c85e518b1.zip/node_modules/es-toolkit/dist/function/noop.mjs
94
- function noop() {
75
+ // src/env.ts
76
+ var env = {
77
+ getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
78
+ };
79
+
80
+ // src/native-modules/tossCore.ts
81
+ var import_react_native3 = require("react-native");
82
+
83
+ // src/native-modules/AppsInTossModule.ts
84
+ var import_react_native = require("react-native");
85
+ var AppsInTossModuleInstance = import_react_native.NativeModules.AppsInTossModule;
86
+ var AppsInTossModule = AppsInTossModuleInstance;
87
+
88
+ // src/native-modules/getOperationalEnvironment.ts
89
+ function getOperationalEnvironment() {
90
+ return AppsInTossModule.operationalEnvironment;
95
91
  }
96
92
 
97
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
98
- var import_react_native7 = require("react-native");
99
- var import_react_native8 = require("react-native");
100
- var import_react_native9 = require("react-native");
101
- var import_react_native10 = require("react-native");
102
- var import_react_native11 = require("react-native");
103
- var import_react_native12 = require("react-native");
104
- var import_react_native13 = require("react-native");
105
- var EntryMessageExitedEvent = class extends import_react_native2.GraniteEventDefinition {
93
+ // src/native-modules/isMinVersionSupported.ts
94
+ var import_react_native2 = require("react-native");
95
+
96
+ // src/utils/compareVersion.ts
97
+ var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
98
+ var isWildcard = (val) => ["*", "x", "X"].includes(val);
99
+ var tryParse = (val) => {
100
+ const num = parseInt(val, 10);
101
+ return isNaN(num) ? val : num;
102
+ };
103
+ var coerceTypes = (a, b) => {
104
+ return typeof a === typeof b ? [a, b] : [String(a), String(b)];
105
+ };
106
+ var compareValues = (a, b) => {
107
+ if (isWildcard(a) || isWildcard(b)) {
108
+ return 0;
109
+ }
110
+ const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
111
+ if (aVal > bVal) {
112
+ return 1;
113
+ }
114
+ if (aVal < bVal) {
115
+ return -1;
116
+ }
117
+ return 0;
118
+ };
119
+ var parseVersion = (version) => {
120
+ if (typeof version !== "string") {
121
+ throw new TypeError("Invalid argument: expected a string");
122
+ }
123
+ const match = version.match(SEMVER_REGEX);
124
+ if (!match) {
125
+ throw new Error(`Invalid semver: '${version}'`);
126
+ }
127
+ const [, major, minor, patch, build, preRelease] = match;
128
+ return [major, minor, patch, build, preRelease];
129
+ };
130
+ var compareSegments = (a, b) => {
131
+ const maxLength = Math.max(a.length, b.length);
132
+ for (let i = 0; i < maxLength; i++) {
133
+ const segA = a[i] ?? "0";
134
+ const segB = b[i] ?? "0";
135
+ const result = compareValues(segA, segB);
136
+ if (result !== 0) {
137
+ return result;
138
+ }
139
+ }
140
+ return 0;
141
+ };
142
+ var compareVersions = (v1, v2) => {
143
+ const seg1 = parseVersion(v1);
144
+ const seg2 = parseVersion(v2);
145
+ const preRelease1 = seg1.pop();
146
+ const preRelease2 = seg2.pop();
147
+ const mainCompare = compareSegments(seg1, seg2);
148
+ if (mainCompare !== 0) {
149
+ return mainCompare;
150
+ }
151
+ if (preRelease1 && preRelease2) {
152
+ return compareSegments(preRelease1.split("."), preRelease2.split("."));
153
+ }
154
+ if (preRelease1) {
155
+ return -1;
156
+ }
157
+ if (preRelease2) {
158
+ return 1;
159
+ }
160
+ return 0;
161
+ };
162
+
163
+ // src/native-modules/isMinVersionSupported.ts
164
+ function isMinVersionSupported(minVersions) {
165
+ const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
166
+ if (operationalEnvironment2 === "sandbox") {
167
+ return true;
168
+ }
169
+ const currentVersion = AppsInTossModule.tossAppVersion;
170
+ const isIOS = import_react_native2.Platform.OS === "ios";
171
+ const minVersion = isIOS ? minVersions.ios : minVersions.android;
172
+ if (minVersion === void 0) {
173
+ return false;
174
+ }
175
+ if (minVersion === "always") {
176
+ return true;
177
+ }
178
+ if (minVersion === "never") {
179
+ return false;
180
+ }
181
+ return compareVersions(currentVersion, minVersion) >= 0;
182
+ }
183
+
184
+ // src/native-modules/tossCore.ts
185
+ var TossCoreModule = import_react_native3.NativeModules.TossCoreModule;
186
+ function tossCoreEventLog(params) {
187
+ const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
188
+ const isSandbox = getOperationalEnvironment() === "sandbox";
189
+ if (!supported || isSandbox) {
190
+ return;
191
+ }
192
+ TossCoreModule.eventLog({
193
+ params: {
194
+ log_name: params.log_name,
195
+ log_type: params.log_type,
196
+ params: params.params
197
+ }
198
+ });
199
+ }
200
+
201
+ // src/core/hooks/useReferrer.ts
202
+ var import_react = require("react");
203
+ var import_react_native_bedrock = require("react-native-bedrock");
204
+ function useReferrer() {
205
+ return (0, import_react.useMemo)(() => {
206
+ try {
207
+ return new URL((0, import_react_native_bedrock.getSchemeUri)()).searchParams.get("referrer");
208
+ } catch {
209
+ return null;
210
+ }
211
+ }, []);
212
+ }
213
+
214
+ // src/core/components/AppEvent.tsx
215
+ var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
216
+ function isPrivateScheme() {
217
+ try {
218
+ return new URL((0, import_react_native_bedrock2.getSchemeUri)()).protocol === "intoss-private:";
219
+ } catch {
220
+ return false;
221
+ }
222
+ }
223
+ function EntryAppEvent() {
224
+ const referrer = useReferrer() ?? "";
225
+ (0, import_react2.useEffect)(() => {
226
+ tossCoreEventLog({
227
+ log_name: "appsintoss_app_visit::impression__enter_appsintoss",
228
+ log_type: "info",
229
+ params: {
230
+ is_transform: true,
231
+ schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
232
+ referrer,
233
+ deployment_id: env.getDeploymentId(),
234
+ app_name: import_react_native_bedrock2.Bedrock.appName,
235
+ is_private: isPrivateScheme()
236
+ }
237
+ });
238
+ }, [referrer]);
239
+ return null;
240
+ }
241
+ function SystemAppEvent({ ...initialProps }) {
242
+ (0, import_react2.useEffect)(() => {
243
+ tossCoreEventLog({
244
+ log_name: "AppsInTossInitialProps",
245
+ log_type: "debug",
246
+ params: {
247
+ ...initialProps,
248
+ schemeUri: (0, import_react_native_bedrock2.getSchemeUri)(),
249
+ deployment_id: env.getDeploymentId(),
250
+ app_name: import_react_native_bedrock2.Bedrock.appName,
251
+ is_private: isPrivateScheme()
252
+ }
253
+ });
254
+ }, [initialProps]);
255
+ return null;
256
+ }
257
+ var AppEvent = {
258
+ Entry: EntryAppEvent,
259
+ System: SystemAppEvent
260
+ };
261
+
262
+ // src/core/hooks/useAppsInTossBridge.ts
263
+ var import_react_native5 = require("@toss-design-system/react-native");
264
+ var import_react3 = require("react");
265
+
266
+ // src/native-event-emitter/appsInTossEvent.ts
267
+ var import_react_native_bedrock7 = require("react-native-bedrock");
268
+
269
+ // src/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
270
+ var import_react_native_bedrock3 = require("react-native-bedrock");
271
+ var EntryMessageExitedEvent = class extends import_react_native_bedrock3.BedrockEventDefinition {
106
272
  name = "entryMessageExited";
107
273
  remove() {
108
274
  }
@@ -110,15 +276,21 @@ var EntryMessageExitedEvent = class extends import_react_native2.GraniteEventDef
110
276
  listener(_) {
111
277
  }
112
278
  };
113
- var Module = import_react_native4.TurboModuleRegistry.getEnforcing("AppsInTossModule");
114
- var AppsInTossModuleInstance = Module;
115
- var AppsInTossModule = Module;
279
+
280
+ // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
281
+ var import_react_native_bedrock4 = require("react-native-bedrock");
282
+
283
+ // src/native-modules/getPermission.ts
116
284
  function getPermission(permission) {
117
285
  return AppsInTossModule.getPermission(permission);
118
286
  }
287
+
288
+ // src/native-modules/openPermissionDialog.ts
119
289
  function openPermissionDialog(permission) {
120
290
  return AppsInTossModule.openPermissionDialog(permission);
121
291
  }
292
+
293
+ // src/native-modules/requestPermission.ts
122
294
  async function requestPermission(permission) {
123
295
  const permissionStatus = await getPermission(permission);
124
296
  switch (permissionStatus) {
@@ -129,8 +301,13 @@ async function requestPermission(permission) {
129
301
  return openPermissionDialog(permission);
130
302
  }
131
303
  }
132
- var nativeEventEmitter = new import_react_native5.NativeEventEmitter(AppsInTossModuleInstance);
133
- var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinition {
304
+
305
+ // src/native-event-emitter/nativeEventEmitter.ts
306
+ var import_react_native4 = require("react-native");
307
+ var nativeEventEmitter = new import_react_native4.NativeEventEmitter(AppsInTossModuleInstance);
308
+
309
+ // src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
310
+ var UpdateLocationEvent = class extends import_react_native_bedrock4.BedrockEventDefinition {
134
311
  name = "updateLocationEvent";
135
312
  subscriptionCount = 0;
136
313
  ref = {
@@ -158,9 +335,16 @@ var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinit
158
335
  }).catch(onError);
159
336
  }
160
337
  };
338
+
339
+ // src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
340
+ var import_react_native_bedrock5 = require("react-native-bedrock");
341
+
342
+ // src/utils/generateUUID.ts
161
343
  function generateUUID(placeholder) {
162
344
  return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
163
345
  }
346
+
347
+ // src/native-event-emitter/internal/appBridge.ts
164
348
  var INTERNAL__callbacks = /* @__PURE__ */ new Map();
165
349
  function invokeAppBridgeCallback(id, ...args) {
166
350
  const callback = INTERNAL__callbacks.get(id);
@@ -207,8 +391,10 @@ var INTERNAL__appBridgeHandler = {
207
391
  unregisterCallback,
208
392
  getCallbackIds
209
393
  };
394
+
395
+ // src/native-event-emitter/internal/AppBridgeCallbackEvent.ts
210
396
  var UNSAFE__nativeEventEmitter = nativeEventEmitter;
211
- var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native6.GraniteEventDefinition {
397
+ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native_bedrock5.BedrockEventDefinition {
212
398
  static INTERNAL__appBridgeSubscription;
213
399
  name = "appBridgeCallbackEvent";
214
400
  constructor() {
@@ -236,505 +422,46 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_
236
422
  }
237
423
  }
238
424
  };
239
- var appsInTossEvent = new import_react_native.GraniteEvent([
240
- new AppBridgeCallbackEvent(),
241
- new UpdateLocationEvent(),
242
- new EntryMessageExitedEvent()
243
- ]);
244
- function startUpdateLocation(eventParams) {
245
- return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
246
- }
247
- function getOperationalEnvironment() {
248
- return AppsInTossModule.operationalEnvironment;
249
- }
250
- var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
251
- var isWildcard = (val) => ["*", "x", "X"].includes(val);
252
- var tryParse = (val) => {
253
- const num = parseInt(val, 10);
254
- return isNaN(num) ? val : num;
255
- };
256
- var coerceTypes = (a, b) => {
257
- return typeof a === typeof b ? [a, b] : [String(a), String(b)];
258
- };
259
- var compareValues = (a, b) => {
260
- if (isWildcard(a) || isWildcard(b)) {
261
- return 0;
262
- }
263
- const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
264
- if (aVal > bVal) {
265
- return 1;
266
- }
267
- if (aVal < bVal) {
268
- return -1;
425
+
426
+ // src/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
427
+ var import_react_native_bedrock6 = require("react-native-bedrock");
428
+ var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native_bedrock6.BedrockEventDefinition {
429
+ name = "onVisibilityChangedByTransparentServiceWeb";
430
+ subscription = null;
431
+ remove() {
432
+ this.subscription?.remove();
433
+ this.subscription = null;
269
434
  }
270
- return 0;
271
- };
272
- var parseVersion = (version) => {
273
- if (typeof version !== "string") {
274
- throw new TypeError("Invalid argument: expected a string");
435
+ listener(options, onEvent, onError) {
436
+ const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
437
+ if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
438
+ if (params.callbackId === options.callbackId) {
439
+ onEvent(params.isVisible);
440
+ }
441
+ } else {
442
+ onError(new Error("Invalid visibility changed by transparent service web result"));
443
+ }
444
+ });
445
+ this.subscription = subscription;
275
446
  }
276
- const match = version.match(SEMVER_REGEX);
277
- if (!match) {
278
- throw new Error(`Invalid semver: '${version}'`);
447
+ isVisibilityChangedByTransparentServiceWebResult(params) {
448
+ return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
279
449
  }
280
- const [, major, minor, patch, build, preRelease] = match;
281
- return [major, minor, patch, build, preRelease];
282
450
  };
283
- var compareSegments = (a, b) => {
284
- const maxLength = Math.max(a.length, b.length);
285
- for (let i = 0; i < maxLength; i++) {
286
- const segA = a[i] ?? "0";
287
- const segB = b[i] ?? "0";
288
- const result = compareValues(segA, segB);
289
- if (result !== 0) {
290
- return result;
291
- }
292
- }
293
- return 0;
294
- };
295
- var compareVersions = (v1, v2) => {
296
- const seg1 = parseVersion(v1);
297
- const seg2 = parseVersion(v2);
298
- const preRelease1 = seg1.pop();
299
- const preRelease2 = seg2.pop();
300
- const mainCompare = compareSegments(seg1, seg2);
301
- if (mainCompare !== 0) {
302
- return mainCompare;
303
- }
304
- if (preRelease1 && preRelease2) {
305
- return compareSegments(preRelease1.split("."), preRelease2.split("."));
306
- }
307
- if (preRelease1) {
308
- return -1;
309
- }
310
- if (preRelease2) {
311
- return 1;
312
- }
313
- return 0;
314
- };
315
- function isMinVersionSupported(minVersions) {
316
- const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
317
- if (operationalEnvironment2 === "sandbox") {
318
- return true;
319
- }
320
- const currentVersion = AppsInTossModule.tossAppVersion;
321
- const isIOS = import_react_native7.Platform.OS === "ios";
322
- const minVersion = isIOS ? minVersions.ios : minVersions.android;
323
- if (minVersion === void 0) {
324
- return false;
325
- }
326
- if (minVersion === "always") {
327
- return true;
328
- }
329
- if (minVersion === "never") {
330
- return false;
331
- }
332
- return compareVersions(currentVersion, minVersion) >= 0;
333
- }
334
- function loadAdMobInterstitialAd(params) {
335
- if (!loadAdMobInterstitialAd.isSupported()) {
336
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
337
- return noop;
338
- }
339
- const { onEvent, onError, options } = params;
340
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
341
- onAdClicked: () => {
342
- onEvent({ type: "clicked" });
343
- },
344
- onAdDismissed: () => {
345
- onEvent({ type: "dismissed" });
346
- },
347
- onAdFailedToShow: () => {
348
- onEvent({ type: "failedToShow" });
349
- },
350
- onAdImpression: () => {
351
- onEvent({ type: "impression" });
352
- },
353
- onAdShow: () => {
354
- onEvent({ type: "show" });
355
- },
356
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
357
- onError
358
- });
359
- return unregisterCallbacks;
360
- }
361
- function showAdMobInterstitialAd(params) {
362
- if (!showAdMobInterstitialAd.isSupported()) {
363
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
364
- return noop;
365
- }
366
- const { onEvent, onError, options } = params;
367
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
368
- onSuccess: () => onEvent({ type: "requested" }),
369
- onError
370
- });
371
- return unregisterCallbacks;
372
- }
373
- function loadAdMobRewardedAd(params) {
374
- if (!loadAdMobRewardedAd.isSupported()) {
375
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
376
- return noop;
377
- }
378
- const { onEvent, onError, options } = params;
379
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
380
- onAdClicked: () => {
381
- onEvent({ type: "clicked" });
382
- },
383
- onAdDismissed: () => {
384
- onEvent({ type: "dismissed" });
385
- },
386
- onAdFailedToShow: () => {
387
- onEvent({ type: "failedToShow" });
388
- },
389
- onAdImpression: () => {
390
- onEvent({ type: "impression" });
391
- },
392
- onAdShow: () => {
393
- onEvent({ type: "show" });
394
- },
395
- onUserEarnedReward: () => {
396
- onEvent({ type: "userEarnedReward" });
397
- },
398
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
399
- onError
400
- });
401
- return unregisterCallbacks;
402
- }
403
- function showAdMobRewardedAd(params) {
404
- if (!showAdMobRewardedAd.isSupported()) {
405
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
406
- return noop;
407
- }
408
- const { onEvent, onError, options } = params;
409
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
410
- onSuccess: () => onEvent({ type: "requested" }),
411
- onError
412
- });
413
- return unregisterCallbacks;
414
- }
415
- var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
416
- var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
417
- var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
418
- var ENVIRONMENT = getOperationalEnvironment();
419
- function createIsSupported() {
420
- return () => {
421
- if (ENVIRONMENT !== "toss") {
422
- return false;
423
- }
424
- return isMinVersionSupported({
425
- android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
426
- ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
427
- });
428
- };
429
- }
430
- loadAdMobInterstitialAd.isSupported = createIsSupported();
431
- loadAdMobRewardedAd.isSupported = createIsSupported();
432
- showAdMobInterstitialAd.isSupported = createIsSupported();
433
- showAdMobRewardedAd.isSupported = createIsSupported();
434
- async function checkoutPayment(options) {
435
- return AppsInTossModule.checkoutPayment({ params: options });
436
- }
437
- async function setClipboardText(text) {
438
- const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
439
- if (permissionStatus === "denied") {
440
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
441
- }
442
- return AppsInTossModule.setClipboardText({ text });
443
- }
444
- async function getClipboardText() {
445
- const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
446
- if (permissionStatus === "denied") {
447
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
448
- }
449
- return AppsInTossModule.getClipboardText({});
450
- }
451
- async function fetchContacts(options) {
452
- const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
453
- if (permissionStatus === "denied") {
454
- throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
455
- }
456
- const contacts = await AppsInTossModule.fetchContacts(options);
457
- return {
458
- result: contacts.result,
459
- nextOffset: contacts.nextOffset ?? null,
460
- done: contacts.done
461
- };
462
- }
463
- var DEFAULT_MAX_COUNT = 10;
464
- var DEFAULT_MAX_WIDTH = 1024;
465
- async function fetchAlbumPhotos(options) {
466
- const permissionStatus = await requestPermission({ name: "photos", access: "read" });
467
- if (permissionStatus === "denied") {
468
- throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
469
- }
470
- const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
471
- ...options,
472
- maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
473
- maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
474
- });
475
- return albumPhotos;
476
- }
477
- async function getCurrentLocation(options) {
478
- const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
479
- if (permissionStatus === "denied") {
480
- throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
481
- }
482
- const position = await AppsInTossModule.getCurrentLocation(options);
483
- return position;
484
- }
485
- async function openCamera(options) {
486
- const permissionStatus = await requestPermission({ name: "camera", access: "access" });
487
- if (permissionStatus === "denied") {
488
- throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
489
- }
490
- const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
491
- return photo;
492
- }
493
- async function appLogin() {
494
- return AppsInTossModule.appLogin({});
495
- }
496
- function getTossAppVersion() {
497
- return AppsInTossModule.tossAppVersion;
498
- }
499
- function getDeviceId() {
500
- return AppsInTossModule.deviceId;
501
- }
502
- function getItem(key) {
503
- return AppsInTossModule.getStorageItem({ key });
504
- }
505
- function setItem(key, value) {
506
- return AppsInTossModule.setStorageItem({
507
- key,
508
- value
509
- });
510
- }
511
- function removeItem(key) {
512
- return AppsInTossModule.removeStorageItem({ key });
513
- }
514
- function clearItems() {
515
- return AppsInTossModule.clearStorage({});
516
- }
517
- var Storage = {
518
- getItem,
519
- setItem,
520
- removeItem,
521
- clearItems
522
- };
523
- function normalizeParams(params) {
524
- return Object.fromEntries(
525
- Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
526
- );
527
- }
528
- async function eventLog(params) {
529
- if (AppsInTossModule.operationalEnvironment === "sandbox") {
530
- console.log("[eventLogDebug]", {
531
- log_name: params.log_name,
532
- log_type: params.log_type,
533
- params: normalizeParams(params.params)
534
- });
535
- return;
536
- }
537
- const isSupported = isMinVersionSupported({
538
- android: "5.208.0",
539
- ios: "5.208.0"
540
- });
541
- if (!isSupported) {
542
- return;
543
- }
544
- return AppsInTossModule.eventLog({
545
- log_name: params.log_name,
546
- log_type: params.log_type,
547
- params: normalizeParams(params.params)
548
- });
549
- }
550
- async function getTossShareLink(path) {
551
- const { shareLink } = await AppsInTossModule.getTossShareLink({});
552
- const shareUrl = new URL(shareLink);
553
- shareUrl.searchParams.set("deep_link_value", path);
554
- shareUrl.searchParams.set("af_dp", path);
555
- return shareUrl.toString();
556
- }
557
- async function setDeviceOrientation(options) {
558
- const isSupported = isMinVersionSupported({
559
- android: "5.215.0",
560
- ios: "5.215.0"
561
- });
562
- if (!isSupported) {
563
- return;
564
- }
565
- return AppsInTossModule.setDeviceOrientation(options);
566
- }
567
- async function saveBase64Data(params) {
568
- const isSupported = isMinVersionSupported({
569
- android: "5.218.0",
570
- ios: "5.216.0"
571
- });
572
- if (!isSupported) {
573
- console.warn("saveBase64Data is not supported in this app version");
574
- return;
575
- }
576
- await AppsInTossModule.saveBase64Data(params);
577
- }
578
- var TossPay = {
579
- checkoutPayment
580
- };
581
- var GoogleAdMob = {
582
- loadAdMobInterstitialAd,
583
- showAdMobInterstitialAd,
584
- loadAdMobRewardedAd,
585
- showAdMobRewardedAd
586
- };
587
- var BedrockModule = import_react_native8.NativeModules.BedrockModule;
588
- async function closeView() {
589
- return BedrockModule.closeView();
590
- }
591
- function getLocale() {
592
- const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
593
- if (import_react_native9.Platform.OS === "android") {
594
- return replaceUnderbarToHypen(locale);
595
- }
596
- return locale;
597
- }
598
- function replaceUnderbarToHypen(locale) {
599
- return locale.replace(/_/g, "-");
600
- }
601
- function getSchemeUri() {
602
- return BedrockModule.schemeUri;
603
- }
604
- function generateHapticFeedback(options) {
605
- return BedrockModule.generateHapticFeedback(options);
606
- }
607
- async function share(message) {
608
- BedrockModule.share(message);
609
- }
610
- function setSecureScreen(options) {
611
- return BedrockModule.setSecureScreen(options);
612
- }
613
- async function setScreenAwakeMode(options) {
614
- return BedrockModule.setScreenAwakeMode(options);
615
- }
616
- function getNetworkStatus() {
617
- return BedrockModule.getNetworkStatus();
618
- }
619
- async function setIosSwipeGestureEnabled(options) {
620
- if (BedrockModule.setIosSwipeGestureEnabled == null) {
621
- return;
622
- }
623
- return BedrockModule.setIosSwipeGestureEnabled(options);
624
- }
625
- function openURL(url) {
626
- return import_react_native10.Linking.openURL(url);
627
- }
628
- function getPlatformOS() {
629
- return import_react_native11.Platform.OS;
630
- }
631
- var BedrockCoreModule = import_react_native12.NativeModules.BedrockCoreModule;
632
- var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
633
- Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
634
- Accuracy3[Accuracy3["Low"] = 2] = "Low";
635
- Accuracy3[Accuracy3["Balanced"] = 3] = "Balanced";
636
- Accuracy3[Accuracy3["High"] = 4] = "High";
637
- Accuracy3[Accuracy3["Highest"] = 5] = "Highest";
638
- Accuracy3[Accuracy3["BestForNavigation"] = 6] = "BestForNavigation";
639
- return Accuracy3;
640
- })(Accuracy2 || {});
641
- var TossCoreModule = import_react_native13.NativeModules.TossCoreModule;
642
- function tossCoreEventLog(params) {
643
- const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
644
- const isSandbox = getOperationalEnvironment() === "sandbox";
645
- if (!supported || isSandbox) {
646
- return;
647
- }
648
- TossCoreModule.eventLog({
649
- params: {
650
- log_name: params.log_name,
651
- log_type: params.log_type,
652
- params: params.params
653
- }
654
- });
655
- }
656
- var INTERNAL__module = {
657
- tossCoreEventLog
658
- };
659
-
660
- // src/core/components/AppEvent.tsx
661
- var import_react_native15 = require("@granite-js/react-native");
662
- var import_react2 = require("react");
663
-
664
- // src/env.ts
665
- var env = {
666
- getDeploymentId: () => __DEV__ ? "local" : global.__appsInToss?.deploymentId
667
- };
668
-
669
- // src/core/hooks/useReferrer.ts
670
- var import_react_native14 = require("@granite-js/react-native");
671
- var import_react = require("react");
672
- function useReferrer() {
673
- return (0, import_react.useMemo)(() => {
674
- try {
675
- return new URL((0, import_react_native14.getSchemeUri)()).searchParams.get("referrer");
676
- } catch {
677
- return null;
678
- }
679
- }, []);
680
- }
681
-
682
- // src/core/components/AppEvent.tsx
683
- var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
684
- function isPrivateScheme() {
685
- try {
686
- return new URL((0, import_react_native15.getSchemeUri)()).protocol === "intoss-private:";
687
- } catch {
688
- return false;
689
- }
690
- }
691
- function EntryAppEvent() {
692
- const referrer = useReferrer() ?? "";
693
- (0, import_react2.useEffect)(() => {
694
- INTERNAL__module.tossCoreEventLog({
695
- log_name: "appsintoss_app_visit::impression__enter_appsintoss",
696
- log_type: "info",
697
- params: {
698
- is_transform: true,
699
- schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
700
- referrer,
701
- deployment_id: env.getDeploymentId(),
702
- app_name: import_react_native15.Granite.appName,
703
- is_private: isPrivateScheme()
704
- }
705
- });
706
- }, [referrer]);
707
- return null;
708
- }
709
- function SystemAppEvent({ ...initialProps }) {
710
- (0, import_react2.useEffect)(() => {
711
- INTERNAL__module.tossCoreEventLog({
712
- log_name: "AppsInTossInitialProps",
713
- log_type: "debug",
714
- params: {
715
- ...initialProps,
716
- schemeUri: (0, import_react_native15.getSchemeUri)(),
717
- deployment_id: env.getDeploymentId(),
718
- app_name: import_react_native15.Granite.appName,
719
- is_private: isPrivateScheme()
720
- }
721
- });
722
- }, [initialProps]);
723
- return null;
724
- }
725
- var AppEvent = {
726
- Entry: EntryAppEvent,
727
- System: SystemAppEvent
728
- };
729
-
730
- // src/core/hooks/useAppsInTossBridge.ts
731
- var import_react_native16 = require("@toss-design-system/react-native");
732
- var import_react3 = require("react");
733
-
734
- // src/core/utils/getAppsInTossGlobals.ts
735
- function getAppsInTossGlobals() {
736
- if (global.__appsInToss == null) {
737
- throw new Error("invalid apps-in-toss globals");
451
+
452
+ // src/native-event-emitter/appsInTossEvent.ts
453
+ var appsInTossEvent = new import_react_native_bedrock7.BedrockEvent([
454
+ new UpdateLocationEvent(),
455
+ new EntryMessageExitedEvent(),
456
+ // Internal events
457
+ new AppBridgeCallbackEvent(),
458
+ new VisibilityChangedByTransparentServiceWebEvent()
459
+ ]);
460
+
461
+ // src/core/utils/getAppsInTossGlobals.ts
462
+ function getAppsInTossGlobals() {
463
+ if (global.__appsInToss == null) {
464
+ throw new Error("invalid apps-in-toss globals");
738
465
  }
739
466
  return global.__appsInToss;
740
467
  }
@@ -746,7 +473,7 @@ function toIcon(source) {
746
473
 
747
474
  // src/core/hooks/useAppsInTossBridge.ts
748
475
  function useAppsInTossBridge() {
749
- const controller = (0, import_react_native16.useBridge)();
476
+ const controller = (0, import_react_native5.useBridge)();
750
477
  const appsInTossGlobals2 = getAppsInTossGlobals();
751
478
  (0, import_react3.useEffect)(() => {
752
479
  const commonProps = {
@@ -764,132 +491,56 @@ function useAppsInTossBridge() {
764
491
  }, []);
765
492
  }
766
493
 
767
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/async-bridges.ts
494
+ // src/async-bridges.ts
768
495
  var async_bridges_exports = {};
769
496
  __export(async_bridges_exports, {
770
- appLogin: () => appLogin2,
771
- checkoutPayment: () => checkoutPayment2,
772
- closeView: () => closeView2,
773
- eventLog: () => eventLog2,
774
- fetchAlbumPhotos: () => fetchAlbumPhotos2,
775
- fetchContacts: () => fetchContacts2,
776
- generateHapticFeedback: () => generateHapticFeedback2,
777
- getClipboardText: () => getClipboardText2,
778
- getCurrentLocation: () => getCurrentLocation2,
779
- getNetworkStatus: () => getNetworkStatus2,
780
- getTossShareLink: () => getTossShareLink2,
781
- openCamera: () => openCamera2,
782
- openURL: () => openURL2,
783
- saveBase64Data: () => saveBase64Data2,
784
- setClipboardText: () => setClipboardText2,
785
- setDeviceOrientation: () => setDeviceOrientation2,
786
- setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled2,
787
- setScreenAwakeMode: () => setScreenAwakeMode2,
788
- setSecureScreen: () => setSecureScreen2,
789
- share: () => share2
497
+ appLogin: () => appLogin,
498
+ checkoutPayment: () => checkoutPayment,
499
+ eventLog: () => eventLog,
500
+ fetchAlbumPhotos: () => fetchAlbumPhotos,
501
+ fetchContacts: () => fetchContacts,
502
+ getClipboardText: () => getClipboardText,
503
+ getCurrentLocation: () => getCurrentLocation,
504
+ getTossShareLink: () => getTossShareLink,
505
+ openCamera: () => openCamera,
506
+ saveBase64Data: () => saveBase64Data,
507
+ setClipboardText: () => setClipboardText,
508
+ setDeviceOrientation: () => setDeviceOrientation
790
509
  });
791
510
 
792
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/BedrockModule.ts
793
- var import_react_native17 = require("react-native");
794
- var BedrockModule2 = import_react_native17.NativeModules.BedrockModule;
795
-
796
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/closeView.ts
797
- async function closeView2() {
798
- return BedrockModule2.closeView();
799
- }
800
-
801
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
802
- function generateHapticFeedback2(options) {
803
- return BedrockModule2.generateHapticFeedback(options);
804
- }
805
-
806
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/share.ts
807
- async function share2(message) {
808
- BedrockModule2.share(message);
809
- }
810
-
811
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setSecureScreen.ts
812
- function setSecureScreen2(options) {
813
- return BedrockModule2.setSecureScreen(options);
814
- }
815
-
816
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
817
- async function setScreenAwakeMode2(options) {
818
- return BedrockModule2.setScreenAwakeMode(options);
819
- }
820
-
821
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
822
- function getNetworkStatus2() {
823
- return BedrockModule2.getNetworkStatus();
824
- }
825
-
826
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
827
- async function setIosSwipeGestureEnabled2(options) {
828
- if (BedrockModule2.setIosSwipeGestureEnabled == null) {
829
- return;
830
- }
831
- return BedrockModule2.setIosSwipeGestureEnabled(options);
832
- }
833
-
834
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/openURL.ts
835
- var import_react_native18 = require("react-native");
836
- function openURL2(url) {
837
- return import_react_native18.Linking.openURL(url);
838
- }
839
-
840
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/AppsInTossModule.ts
841
- var import_react_native19 = require("react-native");
842
- var Module2 = import_react_native19.TurboModuleRegistry.getEnforcing("AppsInTossModule");
843
- var AppsInTossModuleInstance2 = Module2;
844
- var AppsInTossModule2 = Module2;
845
-
846
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getPermission.ts
847
- function getPermission2(permission) {
848
- return AppsInTossModule2.getPermission(permission);
849
- }
850
-
851
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openPermissionDialog.ts
852
- function openPermissionDialog2(permission) {
853
- return AppsInTossModule2.openPermissionDialog(permission);
854
- }
855
-
856
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/requestPermission.ts
857
- async function requestPermission2(permission) {
858
- const permissionStatus = await getPermission2(permission);
859
- switch (permissionStatus) {
860
- case "allowed":
861
- case "denied":
862
- return permissionStatus;
863
- default:
864
- return openPermissionDialog2(permission);
865
- }
866
- }
867
-
868
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setClipboardText.ts
869
- async function setClipboardText2(text) {
870
- const permissionStatus = await requestPermission2({ name: "clipboard", access: "write" });
511
+ // src/native-modules/setClipboardText.ts
512
+ async function setClipboardText(text) {
513
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
871
514
  if (permissionStatus === "denied") {
872
515
  throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
873
516
  }
874
- return AppsInTossModule2.setClipboardText({ text });
517
+ return AppsInTossModule.setClipboardText({ text });
875
518
  }
876
519
 
877
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getClipboardText.ts
878
- async function getClipboardText2() {
879
- const permissionStatus = await requestPermission2({ name: "clipboard", access: "read" });
520
+ // src/native-modules/getClipboardText.ts
521
+ async function getClipboardText() {
522
+ const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
880
523
  if (permissionStatus === "denied") {
881
524
  throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
882
525
  }
883
- return AppsInTossModule2.getClipboardText({});
526
+ return AppsInTossModule.getClipboardText({});
884
527
  }
885
528
 
886
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchContacts.ts
887
- async function fetchContacts2(options) {
888
- const permissionStatus = await requestPermission2({ name: "contacts", access: "read" });
529
+ // src/native-modules/fetchContacts.ts
530
+ async function fetchContacts({
531
+ size,
532
+ offset,
533
+ query
534
+ }) {
535
+ const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
889
536
  if (permissionStatus === "denied") {
890
537
  throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
891
538
  }
892
- const contacts = await AppsInTossModule2.fetchContacts(options);
539
+ const contacts = await AppsInTossModule.fetchContacts({
540
+ size,
541
+ offset,
542
+ query
543
+ });
893
544
  return {
894
545
  result: contacts.result,
895
546
  nextOffset: contacts.nextOffset ?? null,
@@ -897,410 +548,113 @@ async function fetchContacts2(options) {
897
548
  };
898
549
  }
899
550
 
900
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
901
- var DEFAULT_MAX_COUNT2 = 10;
902
- var DEFAULT_MAX_WIDTH2 = 1024;
903
- async function fetchAlbumPhotos2(options) {
904
- const permissionStatus = await requestPermission2({ name: "photos", access: "read" });
551
+ // src/native-modules/fetchAlbumPhotos.ts
552
+ var DEFAULT_MAX_COUNT = 10;
553
+ var DEFAULT_MAX_WIDTH = 1024;
554
+ async function fetchAlbumPhotos(options) {
555
+ const permissionStatus = await requestPermission({ name: "photos", access: "read" });
905
556
  if (permissionStatus === "denied") {
906
557
  throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
907
558
  }
908
- const albumPhotos = await AppsInTossModule2.fetchAlbumPhotos({
559
+ const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
909
560
  ...options,
910
- maxCount: options.maxCount ?? DEFAULT_MAX_COUNT2,
911
- maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH2
561
+ maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
562
+ maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
912
563
  });
913
564
  return albumPhotos;
914
565
  }
915
566
 
916
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getCurrentLocation.ts
917
- async function getCurrentLocation2(options) {
918
- const permissionStatus = await requestPermission2({ name: "geolocation", access: "access" });
567
+ // src/native-modules/getCurrentLocation.ts
568
+ async function getCurrentLocation(options) {
569
+ const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
919
570
  if (permissionStatus === "denied") {
920
571
  throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
921
572
  }
922
- const position = await AppsInTossModule2.getCurrentLocation(options);
573
+ const position = await AppsInTossModule.getCurrentLocation(options);
923
574
  return position;
924
575
  }
925
576
 
926
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openCamera.ts
927
- async function openCamera2(options) {
928
- const permissionStatus = await requestPermission2({ name: "camera", access: "access" });
577
+ // src/native-modules/openCamera.ts
578
+ async function openCamera(options) {
579
+ const permissionStatus = await requestPermission({ name: "camera", access: "access" });
929
580
  if (permissionStatus === "denied") {
930
581
  throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
931
582
  }
932
- const photo = await AppsInTossModule2.openCamera({ base64: false, maxWidth: 1024, ...options });
583
+ const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
933
584
  return photo;
934
585
  }
935
586
 
936
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/appLogin.ts
937
- async function appLogin2() {
938
- return AppsInTossModule2.appLogin({});
587
+ // src/native-modules/appLogin.ts
588
+ async function appLogin() {
589
+ return AppsInTossModule.appLogin({});
939
590
  }
940
591
 
941
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
942
- var import_react_native20 = require("react-native");
943
-
944
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/compareVersion.ts
945
- var SEMVER_REGEX2 = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
946
- var isWildcard2 = (val) => ["*", "x", "X"].includes(val);
947
- var tryParse2 = (val) => {
948
- const num = parseInt(val, 10);
949
- return isNaN(num) ? val : num;
950
- };
951
- var coerceTypes2 = (a, b) => {
952
- return typeof a === typeof b ? [a, b] : [String(a), String(b)];
953
- };
954
- var compareValues2 = (a, b) => {
955
- if (isWildcard2(a) || isWildcard2(b)) {
956
- return 0;
957
- }
958
- const [aVal, bVal] = coerceTypes2(tryParse2(a), tryParse2(b));
959
- if (aVal > bVal) {
960
- return 1;
961
- }
962
- if (aVal < bVal) {
963
- return -1;
964
- }
965
- return 0;
966
- };
967
- var parseVersion2 = (version) => {
968
- if (typeof version !== "string") {
969
- throw new TypeError("Invalid argument: expected a string");
970
- }
971
- const match = version.match(SEMVER_REGEX2);
972
- if (!match) {
973
- throw new Error(`Invalid semver: '${version}'`);
974
- }
975
- const [, major, minor, patch, build, preRelease] = match;
976
- return [major, minor, patch, build, preRelease];
977
- };
978
- var compareSegments2 = (a, b) => {
979
- const maxLength = Math.max(a.length, b.length);
980
- for (let i = 0; i < maxLength; i++) {
981
- const segA = a[i] ?? "0";
982
- const segB = b[i] ?? "0";
983
- const result = compareValues2(segA, segB);
984
- if (result !== 0) {
985
- return result;
986
- }
987
- }
988
- return 0;
989
- };
990
- var compareVersions2 = (v1, v2) => {
991
- const seg1 = parseVersion2(v1);
992
- const seg2 = parseVersion2(v2);
993
- const preRelease1 = seg1.pop();
994
- const preRelease2 = seg2.pop();
995
- const mainCompare = compareSegments2(seg1, seg2);
996
- if (mainCompare !== 0) {
997
- return mainCompare;
998
- }
999
- if (preRelease1 && preRelease2) {
1000
- return compareSegments2(preRelease1.split("."), preRelease2.split("."));
1001
- }
1002
- if (preRelease1) {
1003
- return -1;
1004
- }
1005
- if (preRelease2) {
1006
- return 1;
1007
- }
1008
- return 0;
1009
- };
1010
-
1011
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
1012
- function isMinVersionSupported2(minVersions) {
1013
- const operationalEnvironment2 = AppsInTossModule2.operationalEnvironment;
1014
- if (operationalEnvironment2 === "sandbox") {
1015
- return true;
1016
- }
1017
- const currentVersion = AppsInTossModule2.tossAppVersion;
1018
- const isIOS = import_react_native20.Platform.OS === "ios";
1019
- const minVersion = isIOS ? minVersions.ios : minVersions.android;
1020
- if (minVersion === void 0) {
1021
- return false;
1022
- }
1023
- if (minVersion === "always") {
1024
- return true;
1025
- }
1026
- if (minVersion === "never") {
1027
- return false;
1028
- }
1029
- return compareVersions2(currentVersion, minVersion) >= 0;
592
+ // src/native-modules/checkoutPayment.ts
593
+ async function checkoutPayment(options) {
594
+ return AppsInTossModule.checkoutPayment({ params: options });
1030
595
  }
1031
596
 
1032
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/eventLog.ts
1033
- function normalizeParams2(params) {
597
+ // src/native-modules/eventLog.ts
598
+ function normalizeParams(params) {
1034
599
  return Object.fromEntries(
1035
600
  Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
1036
601
  );
1037
602
  }
1038
- async function eventLog2(params) {
1039
- if (AppsInTossModule2.operationalEnvironment === "sandbox") {
603
+ async function eventLog(params) {
604
+ if (AppsInTossModule.operationalEnvironment === "sandbox") {
1040
605
  console.log("[eventLogDebug]", {
1041
606
  log_name: params.log_name,
1042
607
  log_type: params.log_type,
1043
- params: normalizeParams2(params.params)
608
+ params: normalizeParams(params.params)
1044
609
  });
1045
610
  return;
1046
611
  }
1047
- const isSupported = isMinVersionSupported2({
612
+ const isSupported = isMinVersionSupported({
1048
613
  android: "5.208.0",
1049
614
  ios: "5.208.0"
1050
615
  });
1051
616
  if (!isSupported) {
1052
617
  return;
1053
618
  }
1054
- return AppsInTossModule2.eventLog({
619
+ return AppsInTossModule.eventLog({
1055
620
  log_name: params.log_name,
1056
621
  log_type: params.log_type,
1057
- params: normalizeParams2(params.params)
622
+ params: normalizeParams(params.params)
1058
623
  });
1059
624
  }
1060
625
 
1061
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossShareLink.ts
1062
- async function getTossShareLink2(path) {
1063
- const { shareLink } = await AppsInTossModule2.getTossShareLink({});
626
+ // src/native-modules/getTossShareLink.ts
627
+ async function getTossShareLink(path) {
628
+ const { shareLink } = await AppsInTossModule.getTossShareLink({});
1064
629
  const shareUrl = new URL(shareLink);
1065
- shareUrl.searchParams.set("deep_link_value", path);
1066
- shareUrl.searchParams.set("af_dp", path);
1067
- return shareUrl.toString();
1068
- }
1069
-
1070
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setDeviceOrientation.ts
1071
- async function setDeviceOrientation2(options) {
1072
- const isSupported = isMinVersionSupported2({
1073
- android: "5.215.0",
1074
- ios: "5.215.0"
1075
- });
1076
- if (!isSupported) {
1077
- return;
1078
- }
1079
- return AppsInTossModule2.setDeviceOrientation(options);
1080
- }
1081
-
1082
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/checkoutPayment.ts
1083
- async function checkoutPayment2(options) {
1084
- return AppsInTossModule2.checkoutPayment({ params: options });
1085
- }
1086
-
1087
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/saveBase64Data.ts
1088
- async function saveBase64Data2(params) {
1089
- const isSupported = isMinVersionSupported2({
1090
- android: "5.218.0",
1091
- ios: "5.216.0"
1092
- });
1093
- if (!isSupported) {
1094
- console.warn("saveBase64Data is not supported in this app version");
1095
- return;
1096
- }
1097
- await AppsInTossModule2.saveBase64Data(params);
1098
- }
1099
-
1100
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/constant-bridges.ts
1101
- var constant_bridges_exports = {};
1102
- __export(constant_bridges_exports, {
1103
- getDeviceId: () => getDeviceId2,
1104
- getLocale: () => getLocale2,
1105
- getOperationalEnvironment: () => getOperationalEnvironment2,
1106
- getPlatformOS: () => getPlatformOS2,
1107
- getSchemeUri: () => getSchemeUri4,
1108
- getTossAppVersion: () => getTossAppVersion2
1109
- });
1110
-
1111
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getLocale.ts
1112
- var import_react_native21 = require("react-native");
1113
- function getLocale2() {
1114
- const locale = BedrockModule2?.DeviceInfo?.locale ?? "ko-KR";
1115
- if (import_react_native21.Platform.OS === "android") {
1116
- return replaceUnderbarToHypen2(locale);
1117
- }
1118
- return locale;
1119
- }
1120
- function replaceUnderbarToHypen2(locale) {
1121
- return locale.replace(/_/g, "-");
1122
- }
1123
-
1124
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getSchemeUri.ts
1125
- function getSchemeUri4() {
1126
- return BedrockModule2.schemeUri;
1127
- }
1128
-
1129
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getPlatformOS.ts
1130
- var import_react_native22 = require("react-native");
1131
- function getPlatformOS2() {
1132
- return import_react_native22.Platform.OS;
1133
- }
1134
-
1135
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
1136
- function getOperationalEnvironment2() {
1137
- return AppsInTossModule2.operationalEnvironment;
1138
- }
1139
-
1140
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossAppVersion.ts
1141
- function getTossAppVersion2() {
1142
- return AppsInTossModule2.tossAppVersion;
1143
- }
1144
-
1145
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getDeviceId.ts
1146
- function getDeviceId2() {
1147
- return AppsInTossModule2.deviceId;
1148
- }
1149
-
1150
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/event-bridges.ts
1151
- var event_bridges_exports = {};
1152
- __export(event_bridges_exports, {
1153
- startUpdateLocation: () => startUpdateLocation2
1154
- });
1155
-
1156
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1157
- var import_react_native27 = require("@granite-js/react-native");
1158
-
1159
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/EntryMessageExitedEvent.ts
1160
- var import_react_native23 = require("@granite-js/react-native");
1161
- var EntryMessageExitedEvent2 = class extends import_react_native23.GraniteEventDefinition {
1162
- name = "entryMessageExited";
1163
- remove() {
1164
- }
1165
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1166
- listener(_) {
1167
- }
1168
- };
1169
-
1170
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
1171
- var import_react_native25 = require("@granite-js/react-native");
1172
-
1173
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
1174
- var import_react_native24 = require("react-native");
1175
- var nativeEventEmitter2 = new import_react_native24.NativeEventEmitter(AppsInTossModuleInstance2);
1176
-
1177
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
1178
- var UpdateLocationEvent2 = class extends import_react_native25.GraniteEventDefinition {
1179
- name = "updateLocationEvent";
1180
- subscriptionCount = 0;
1181
- ref = {
1182
- remove: () => {
1183
- }
1184
- };
1185
- remove() {
1186
- if (--this.subscriptionCount === 0) {
1187
- AppsInTossModuleInstance2.stopUpdateLocation({});
1188
- }
1189
- this.ref.remove();
1190
- }
1191
- listener(options, onEvent, onError) {
1192
- requestPermission2({ name: "geolocation", access: "access" }).then((permissionStatus) => {
1193
- if (permissionStatus === "denied") {
1194
- onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
1195
- return;
1196
- }
1197
- void AppsInTossModuleInstance2.startUpdateLocation(options).catch(onError);
1198
- const subscription = nativeEventEmitter2.addListener("updateLocation", onEvent);
1199
- this.ref = {
1200
- remove: () => subscription?.remove()
1201
- };
1202
- this.subscriptionCount++;
1203
- }).catch(onError);
1204
- }
1205
- };
1206
-
1207
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1208
- var import_react_native26 = require("@granite-js/react-native");
1209
-
1210
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/generateUUID.ts
1211
- function generateUUID2(placeholder) {
1212
- return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID2);
630
+ shareUrl.searchParams.set("deep_link_value", path);
631
+ shareUrl.searchParams.set("af_dp", path);
632
+ return shareUrl.toString();
1213
633
  }
1214
634
 
1215
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
1216
- var INTERNAL__callbacks2 = /* @__PURE__ */ new Map();
1217
- function invokeAppBridgeCallback2(id, ...args) {
1218
- const callback = INTERNAL__callbacks2.get(id);
1219
- callback?.call(null, ...args);
1220
- return Boolean(callback);
1221
- }
1222
- function invokeAppBridgeMethod2(methodName, params, callbacks) {
1223
- const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
1224
- const { callbackMap, unregisterAll } = registerCallbacks2(appBridgeCallbacks);
1225
- const promise = AppsInTossModuleInstance2[methodName]({
1226
- params,
1227
- callbacks: callbackMap
635
+ // src/native-modules/setDeviceOrientation.ts
636
+ async function setDeviceOrientation(options) {
637
+ const isSupported = isMinVersionSupported({
638
+ android: "5.215.0",
639
+ ios: "5.215.0"
1228
640
  });
1229
- void promise.then(onSuccess).catch(onError);
1230
- return unregisterAll;
1231
- }
1232
- function registerCallbacks2(callbacks) {
1233
- const callbackMap = {};
1234
- for (const [callbackName, callback] of Object.entries(callbacks)) {
1235
- const id = registerCallback2(callback, callbackName);
1236
- callbackMap[callbackName] = id;
641
+ if (!isSupported) {
642
+ return;
1237
643
  }
1238
- const unregisterAll = () => {
1239
- Object.values(callbackMap).forEach(unregisterCallback2);
1240
- };
1241
- return { callbackMap, unregisterAll };
1242
- }
1243
- function registerCallback2(callback, name = "unnamed") {
1244
- const uniqueId = generateUUID2();
1245
- const callbackId = `${uniqueId}__${name}`;
1246
- INTERNAL__callbacks2.set(callbackId, callback);
1247
- return callbackId;
1248
- }
1249
- function unregisterCallback2(id) {
1250
- INTERNAL__callbacks2.delete(id);
1251
- }
1252
- function getCallbackIds2() {
1253
- return Array.from(INTERNAL__callbacks2.keys());
644
+ return AppsInTossModule.setDeviceOrientation(options);
1254
645
  }
1255
- var INTERNAL__appBridgeHandler2 = {
1256
- invokeAppBridgeCallback: invokeAppBridgeCallback2,
1257
- invokeAppBridgeMethod: invokeAppBridgeMethod2,
1258
- registerCallback: registerCallback2,
1259
- unregisterCallback: unregisterCallback2,
1260
- getCallbackIds: getCallbackIds2
1261
- };
1262
646
 
1263
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1264
- var UNSAFE__nativeEventEmitter2 = nativeEventEmitter2;
1265
- var AppBridgeCallbackEvent2 = class _AppBridgeCallbackEvent2 extends import_react_native26.GraniteEventDefinition {
1266
- static INTERNAL__appBridgeSubscription;
1267
- name = "appBridgeCallbackEvent";
1268
- constructor() {
1269
- super();
1270
- this.registerAppBridgeCallbackEventListener();
1271
- }
1272
- remove() {
1273
- }
1274
- listener() {
1275
- }
1276
- registerAppBridgeCallbackEventListener() {
1277
- if (_AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription != null) {
1278
- return;
1279
- }
1280
- _AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter2.addListener(
1281
- "appBridgeCallback",
1282
- this.ensureInvokeAppBridgeCallback
1283
- );
1284
- }
1285
- ensureInvokeAppBridgeCallback(result) {
1286
- if (typeof result === "object" && typeof result.name === "string") {
1287
- INTERNAL__appBridgeHandler2.invokeAppBridgeCallback(result.name, result.params);
1288
- } else {
1289
- console.warn("Invalid app bridge callback result:", result);
1290
- }
647
+ // src/native-modules/saveBase64Data.ts
648
+ async function saveBase64Data(params) {
649
+ const isSupported = isMinVersionSupported({
650
+ android: "5.218.0",
651
+ ios: "5.216.0"
652
+ });
653
+ if (!isSupported) {
654
+ console.warn("saveBase64Data is not supported in this app version");
655
+ return;
1291
656
  }
1292
- };
1293
-
1294
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1295
- var appsInTossEvent2 = new import_react_native27.GraniteEvent([
1296
- new AppBridgeCallbackEvent2(),
1297
- new UpdateLocationEvent2(),
1298
- new EntryMessageExitedEvent2()
1299
- ]);
1300
-
1301
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
1302
- function startUpdateLocation2(eventParams) {
1303
- return appsInTossEvent2.addEventListener("updateLocationEvent", eventParams);
657
+ await AppsInTossModule.saveBase64Data(params);
1304
658
  }
1305
659
 
1306
660
  // src/core/registerApp.tsx
@@ -1309,7 +663,7 @@ function AppsInTossContainer(Container, { children, ...initialProps }) {
1309
663
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1310
664
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.Entry, {}),
1311
665
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppEvent.System, { ...initialProps }),
1312
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native29.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TDSContainer, { ...initialProps, children }) }) })
666
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TDSContainer, { ...initialProps, children }) }) })
1313
667
  ] });
1314
668
  }
1315
669
  function TDSContainer({ children }) {
@@ -1318,10 +672,10 @@ function TDSContainer({ children }) {
1318
672
  }
1319
673
  function registerApp(container, { context, analytics }) {
1320
674
  import_analytics.Analytics.init({
1321
- logger: (params) => void eventLog2(params),
675
+ logger: (params) => void eventLog(params),
1322
676
  debug: analytics?.debug ?? __DEV__
1323
677
  });
1324
- return import_react_native28.Granite.registerApp(AppsInTossContainer.bind(null, container), {
678
+ return import_react_native_bedrock8.Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
1325
679
  appName: getAppName(),
1326
680
  context,
1327
681
  router: {
@@ -1334,7 +688,7 @@ function registerApp(container, { context, analytics }) {
1334
688
  }
1335
689
  function getAppName() {
1336
690
  try {
1337
- return global.__granite.app.name;
691
+ return global.__bedrock.app.name;
1338
692
  } catch (error) {
1339
693
  console.error("unexpected error occurred while getting app name");
1340
694
  throw error;
@@ -1346,36 +700,217 @@ var AppsInToss = {
1346
700
  registerApp
1347
701
  };
1348
702
 
703
+ // src/native-event-emitter/startUpdateLocation.ts
704
+ function startUpdateLocation(eventParams) {
705
+ return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
706
+ }
707
+
708
+ // ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
709
+ function noop() {
710
+ }
711
+
712
+ // src/native-modules/ads/googleAdMob.ts
713
+ function loadAdMobInterstitialAd(params) {
714
+ if (!loadAdMobInterstitialAd.isSupported()) {
715
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
716
+ return noop;
717
+ }
718
+ const { onEvent, onError, options } = params;
719
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
720
+ onAdClicked: () => {
721
+ onEvent({ type: "clicked" });
722
+ },
723
+ onAdDismissed: () => {
724
+ onEvent({ type: "dismissed" });
725
+ },
726
+ onAdFailedToShow: () => {
727
+ onEvent({ type: "failedToShow" });
728
+ },
729
+ onAdImpression: () => {
730
+ onEvent({ type: "impression" });
731
+ },
732
+ onAdShow: () => {
733
+ onEvent({ type: "show" });
734
+ },
735
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
736
+ onError
737
+ });
738
+ return unregisterCallbacks;
739
+ }
740
+ function showAdMobInterstitialAd(params) {
741
+ if (!showAdMobInterstitialAd.isSupported()) {
742
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
743
+ return noop;
744
+ }
745
+ const { onEvent, onError, options } = params;
746
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
747
+ onSuccess: () => onEvent({ type: "requested" }),
748
+ onError
749
+ });
750
+ return unregisterCallbacks;
751
+ }
752
+ function loadAdMobRewardedAd(params) {
753
+ if (!loadAdMobRewardedAd.isSupported()) {
754
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
755
+ return noop;
756
+ }
757
+ const { onEvent, onError, options } = params;
758
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
759
+ onAdClicked: () => {
760
+ onEvent({ type: "clicked" });
761
+ },
762
+ onAdDismissed: () => {
763
+ onEvent({ type: "dismissed" });
764
+ },
765
+ onAdFailedToShow: () => {
766
+ onEvent({ type: "failedToShow" });
767
+ },
768
+ onAdImpression: () => {
769
+ onEvent({ type: "impression" });
770
+ },
771
+ onAdShow: () => {
772
+ onEvent({ type: "show" });
773
+ },
774
+ onUserEarnedReward: () => {
775
+ onEvent({ type: "userEarnedReward" });
776
+ },
777
+ onSuccess: (result) => onEvent({ type: "loaded", data: result }),
778
+ onError
779
+ });
780
+ return unregisterCallbacks;
781
+ }
782
+ function showAdMobRewardedAd(params) {
783
+ if (!showAdMobRewardedAd.isSupported()) {
784
+ params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
785
+ return noop;
786
+ }
787
+ const { onEvent, onError, options } = params;
788
+ const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
789
+ onSuccess: () => onEvent({ type: "requested" }),
790
+ onError
791
+ });
792
+ return unregisterCallbacks;
793
+ }
794
+ var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
795
+ var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
796
+ var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
797
+ var ENVIRONMENT = getOperationalEnvironment();
798
+ function createIsSupported() {
799
+ return () => {
800
+ if (ENVIRONMENT !== "toss") {
801
+ return false;
802
+ }
803
+ return isMinVersionSupported({
804
+ android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
805
+ ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
806
+ });
807
+ };
808
+ }
809
+ loadAdMobInterstitialAd.isSupported = createIsSupported();
810
+ loadAdMobRewardedAd.isSupported = createIsSupported();
811
+ showAdMobInterstitialAd.isSupported = createIsSupported();
812
+ showAdMobRewardedAd.isSupported = createIsSupported();
813
+
814
+ // src/native-modules/getTossAppVersion.ts
815
+ function getTossAppVersion() {
816
+ return AppsInTossModule.tossAppVersion;
817
+ }
818
+
819
+ // src/native-modules/getDeviceId.ts
820
+ function getDeviceId() {
821
+ return AppsInTossModule.deviceId;
822
+ }
823
+
824
+ // src/native-modules/storage.ts
825
+ function getItem(key) {
826
+ return AppsInTossModule.getStorageItem({ key });
827
+ }
828
+ function setItem(key, value) {
829
+ return AppsInTossModule.setStorageItem({
830
+ key,
831
+ value
832
+ });
833
+ }
834
+ function removeItem(key) {
835
+ return AppsInTossModule.removeStorageItem({ key });
836
+ }
837
+ function clearItems() {
838
+ return AppsInTossModule.clearStorage({});
839
+ }
840
+ var Storage = {
841
+ getItem,
842
+ setItem,
843
+ removeItem,
844
+ clearItems
845
+ };
846
+
847
+ // src/native-modules/iap.ts
848
+ async function createOneTimePurchaseOrder(params) {
849
+ const isSupported = isMinVersionSupported({
850
+ android: "5.219.0",
851
+ ios: "5.219.0"
852
+ });
853
+ if (!isSupported) {
854
+ return;
855
+ }
856
+ return AppsInTossModule.iapCreateOneTimePurchaseOrder(params);
857
+ }
858
+ async function getProductItemList() {
859
+ const isSupported = isMinVersionSupported({
860
+ android: "5.219.0",
861
+ ios: "5.219.0"
862
+ });
863
+ if (!isSupported) {
864
+ return;
865
+ }
866
+ return AppsInTossModule.iapGetProductItemList({});
867
+ }
868
+ var IAP = {
869
+ createOneTimePurchaseOrder,
870
+ getProductItemList
871
+ };
872
+
873
+ // src/native-modules/index.ts
874
+ var TossPay = {
875
+ checkoutPayment
876
+ };
877
+ var GoogleAdMob = {
878
+ loadAdMobInterstitialAd,
879
+ showAdMobInterstitialAd,
880
+ loadAdMobRewardedAd,
881
+ showAdMobRewardedAd
882
+ };
883
+
1349
884
  // src/components/WebView.tsx
1350
- var import_react_native39 = require("@granite-js/react-native");
1351
- var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridges"), 1);
1352
- var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
1353
- var import_react_native40 = require("@toss-design-system/react-native");
885
+ var import_react_native14 = require("@toss-design-system/react-native");
1354
886
  var import_private = require("@toss-design-system/react-native/private");
1355
887
  var import_react6 = require("react");
888
+ var import_react_native_bedrock11 = require("react-native-bedrock");
889
+ var bedrockAsyncBridges = __toESM(require("react-native-bedrock/async-bridges"), 1);
890
+ var bedrockConstantBridges = __toESM(require("react-native-bedrock/constant-bridges"), 1);
1356
891
 
1357
892
  // src/components/GameWebView.tsx
1358
- var import_react_native_webview = require("@granite-js/native/react-native-webview");
1359
- var import_react_native35 = require("@granite-js/react-native");
1360
- var import_react_native36 = require("@toss-design-system/react-native");
893
+ var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
894
+ var import_react_native12 = require("@toss-design-system/react-native");
1361
895
  var import_es_hangul = require("es-hangul");
1362
896
  var import_react4 = require("react");
1363
- var import_react_native37 = require("react-native");
897
+ var import_react_native13 = require("react-native");
898
+ var import_react_native_bedrock9 = require("react-native-bedrock");
1364
899
 
1365
900
  // src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
1366
- var import_react_native_svg = require("@granite-js/native/react-native-svg");
1367
- var import_react_native33 = require("@toss-design-system/react-native");
1368
- var import_react_native34 = require("react-native");
901
+ var import_react_native_svg = require("@react-native-bedrock/native/react-native-svg");
902
+ var import_react_native10 = require("@toss-design-system/react-native");
903
+ var import_react_native11 = require("react-native");
1369
904
 
1370
905
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
1371
- var import_react_native31 = require("react-native");
906
+ var import_react_native8 = require("react-native");
1372
907
 
1373
908
  // src/components/GameWebViewNavigationBar/byPlatform.ts
1374
- var import_react_native30 = require("react-native");
909
+ var import_react_native7 = require("react-native");
1375
910
  function byPlatform({
1376
911
  ...props
1377
912
  }) {
1378
- return (props[import_react_native30.Platform.OS] ?? props.fallback)();
913
+ return (props[import_react_native7.Platform.OS] ?? props.fallback)();
1379
914
  }
1380
915
 
1381
916
  // src/components/GameWebViewNavigationBar/constants.ts
@@ -1385,10 +920,10 @@ var IOS_DEFAULT_MARGIN = 20;
1385
920
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
1386
921
  var import_jsx_runtime2 = require("react/jsx-runtime");
1387
922
  function IOSHeaderRight(props) {
1388
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native31.View, { style: styles.ios, ...props });
923
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native8.View, { style: styles.ios, ...props });
1389
924
  }
1390
925
  function AndroidHeaderRight(props) {
1391
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native31.View, { style: styles.android, ...props });
926
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native8.View, { style: styles.android, ...props });
1392
927
  }
1393
928
  function HeaderRight(props) {
1394
929
  return byPlatform({
@@ -1397,7 +932,7 @@ function HeaderRight(props) {
1397
932
  fallback: () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IOSHeaderRight, { ...props })
1398
933
  });
1399
934
  }
1400
- var styles = import_react_native31.StyleSheet.create({
935
+ var styles = import_react_native8.StyleSheet.create({
1401
936
  ios: {
1402
937
  marginRight: -IOS_DEFAULT_MARGIN + RIGHT_MARGIN,
1403
938
  flexDirection: "row"
@@ -1408,11 +943,11 @@ var styles = import_react_native31.StyleSheet.create({
1408
943
  });
1409
944
 
1410
945
  // src/components/GameWebViewNavigationBar/useSafeAreaTop.ts
1411
- var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
1412
- var import_react_native32 = require("react-native");
946
+ var import_react_native_safe_area_context = require("@react-native-bedrock/native/react-native-safe-area-context");
947
+ var import_react_native9 = require("react-native");
1413
948
  function useSafeAreaTop() {
1414
949
  const safeAreaInsets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
1415
- const hasDynamicIsland = import_react_native32.Platform.OS === "ios" && safeAreaInsets.top > 50;
950
+ const hasDynamicIsland = import_react_native9.Platform.OS === "ios" && safeAreaInsets.top > 50;
1416
951
  const safeAreaTop = hasDynamicIsland ? safeAreaInsets.top - 5 : safeAreaInsets.top;
1417
952
  return safeAreaTop;
1418
953
  }
@@ -1423,31 +958,31 @@ var originXML = '<svg fill="none" height="30" viewBox="0 0 30 30" width="30" xml
1423
958
  function GameNavigationBar({ onClose }) {
1424
959
  const safeAreaTop = useSafeAreaTop();
1425
960
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1426
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native33.PageNavbar, { preference: { type: "none" } }),
961
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native10.PageNavbar, { preference: { type: "none" } }),
1427
962
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1428
- import_react_native34.View,
963
+ import_react_native11.View,
1429
964
  {
1430
965
  style: {
1431
966
  width: "100%",
1432
- height: import_react_native34.Platform.OS === "ios" ? 44 : 54,
967
+ height: import_react_native11.Platform.OS === "ios" ? 44 : 54,
1433
968
  flexDirection: "row",
1434
969
  alignItems: "center",
1435
970
  justifyContent: "flex-end",
1436
971
  position: "absolute",
1437
972
  zIndex: 9999,
1438
973
  marginTop: safeAreaTop,
1439
- paddingRight: import_react_native34.Platform.OS === "ios" ? 10 : 8
974
+ paddingRight: import_react_native11.Platform.OS === "ios" ? 10 : 8
1440
975
  },
1441
976
  pointerEvents: "box-none",
1442
977
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(HeaderRight, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1443
- import_react_native34.TouchableOpacity,
978
+ import_react_native11.TouchableOpacity,
1444
979
  {
1445
980
  hitSlop: { left: 8, right: 8 },
1446
981
  accessibilityRole: "button",
1447
982
  accessible: true,
1448
983
  accessibilityLabel: "\uAC8C\uC784\uC885\uB8CC",
1449
984
  style: {
1450
- padding: import_react_native34.Platform.OS === "ios" ? 7 : 9
985
+ padding: import_react_native11.Platform.OS === "ios" ? 7 : 9
1451
986
  },
1452
987
  onPress: onClose,
1453
988
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_svg.SvgXml, { xml: originXML, width: 30, height: 30 })
@@ -1461,7 +996,7 @@ function GameNavigationBar({ onClose }) {
1461
996
  // src/components/GameWebView.tsx
1462
997
  var import_jsx_runtime4 = require("react/jsx-runtime");
1463
998
  var GameWebView = (0, import_react4.forwardRef)(function GameWebView2(props, ref) {
1464
- const { openConfirm } = (0, import_react_native36.useDialog)();
999
+ const { openConfirm } = (0, import_react_native12.useDialog)();
1465
1000
  const { brandDisplayName } = getAppsInTossGlobals();
1466
1001
  const handleClose = (0, import_react4.useCallback)(async () => {
1467
1002
  const isConfirmed = await openConfirm({
@@ -1471,14 +1006,14 @@ var GameWebView = (0, import_react4.forwardRef)(function GameWebView2(props, ref
1471
1006
  closeOnDimmerClick: true
1472
1007
  });
1473
1008
  if (isConfirmed) {
1474
- (0, import_react_native35.closeView)();
1009
+ (0, import_react_native_bedrock9.closeView)();
1475
1010
  }
1476
1011
  }, [brandDisplayName, openConfirm]);
1477
1012
  (0, import_react4.useEffect)(() => {
1478
- if (import_react_native37.Platform.OS === "ios") {
1479
- setIosSwipeGestureEnabled({ isEnabled: false });
1013
+ if (import_react_native13.Platform.OS === "ios") {
1014
+ (0, import_react_native_bedrock9.setIosSwipeGestureEnabled)({ isEnabled: false });
1480
1015
  return () => {
1481
- setIosSwipeGestureEnabled({ isEnabled: true });
1016
+ (0, import_react_native_bedrock9.setIosSwipeGestureEnabled)({ isEnabled: true });
1482
1017
  };
1483
1018
  }
1484
1019
  return;
@@ -1488,14 +1023,14 @@ var GameWebView = (0, import_react4.forwardRef)(function GameWebView2(props, ref
1488
1023
  handleClose();
1489
1024
  return true;
1490
1025
  };
1491
- import_react_native37.BackHandler.addEventListener("hardwareBackPress", backHandler);
1026
+ import_react_native13.BackHandler.addEventListener("hardwareBackPress", backHandler);
1492
1027
  return () => {
1493
- import_react_native37.BackHandler.removeEventListener("hardwareBackPress", backHandler);
1028
+ import_react_native13.BackHandler.removeEventListener("hardwareBackPress", backHandler);
1494
1029
  };
1495
1030
  }, [handleClose]);
1496
1031
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1497
1032
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GameNavigationBar, { onClose: handleClose }),
1498
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native37.View, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native_webview.WebView, { ref, ...props }) })
1033
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native13.View, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native_webview.WebView, { ref, ...props }) })
1499
1034
  ] });
1500
1035
  });
1501
1036
 
@@ -1532,12 +1067,12 @@ function methodHandler({
1532
1067
  };
1533
1068
  wrappedFunc(...args).then((result) => {
1534
1069
  injectJavaScript?.(`
1535
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/resolve/${eventId}', ${JSON.stringify(result, null, 0)});
1070
+ window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/resolve/${eventId}', ${JSON.stringify(result, null, 0)});
1536
1071
  `);
1537
1072
  }).catch((error) => {
1538
1073
  const serializedError = serializeError(error);
1539
1074
  injectJavaScript?.(`
1540
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/reject/${eventId}', ${serializedError});
1075
+ window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/reject/${eventId}', ${serializedError});
1541
1076
  `);
1542
1077
  });
1543
1078
  }
@@ -1568,12 +1103,12 @@ function useBridgeHandler({
1568
1103
  );
1569
1104
  const createHandleOnEvent = (functionName, eventId) => (response) => {
1570
1105
  ref.current?.injectJavaScript(`
1571
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onEvent/${eventId}', ${JSON.stringify(response, null, 0)});
1106
+ window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/onEvent/${eventId}', ${JSON.stringify(response, null, 0)});
1572
1107
  `);
1573
1108
  };
1574
1109
  const createHandleOnError = (functionName, eventId) => (error) => {
1575
1110
  ref.current?.injectJavaScript(`
1576
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
1111
+ window.__BEDROCK_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
1577
1112
  `);
1578
1113
  };
1579
1114
  const $onMessage = (0, import_react5.useCallback)(
@@ -1626,8 +1161,22 @@ function useBridgeHandler({
1626
1161
  };
1627
1162
  }
1628
1163
 
1164
+ // src/constant-bridges.ts
1165
+ var constant_bridges_exports = {};
1166
+ __export(constant_bridges_exports, {
1167
+ getDeviceId: () => getDeviceId,
1168
+ getOperationalEnvironment: () => getOperationalEnvironment,
1169
+ getTossAppVersion: () => getTossAppVersion
1170
+ });
1171
+
1172
+ // src/event-bridges.ts
1173
+ var event_bridges_exports = {};
1174
+ __export(event_bridges_exports, {
1175
+ startUpdateLocation: () => startUpdateLocation
1176
+ });
1177
+
1629
1178
  // src/utils/log.ts
1630
- var import_react_native38 = require("@granite-js/react-native");
1179
+ var import_react_native_bedrock10 = require("react-native-bedrock");
1631
1180
 
1632
1181
  // src/utils/extractDateFromUUIDv7.ts
1633
1182
  var extractDateFromUUIDv7 = (uuid) => {
@@ -1653,7 +1202,7 @@ var getGroupId = (url) => {
1653
1202
  };
1654
1203
  var getReferrer = () => {
1655
1204
  try {
1656
- const referrer = new URL((0, import_react_native38.getSchemeUri)());
1205
+ const referrer = new URL((0, import_react_native_bedrock10.getSchemeUri)());
1657
1206
  return referrer.searchParams.get("referrer");
1658
1207
  } catch {
1659
1208
  return "";
@@ -1677,16 +1226,16 @@ var trackScreen = (url) => {
1677
1226
  // src/components/WebView.tsx
1678
1227
  var import_jsx_runtime5 = require("react/jsx-runtime");
1679
1228
  var appsInTossGlobals = getAppsInTossGlobals();
1680
- var operationalEnvironment = getOperationalEnvironment2();
1229
+ var operationalEnvironment = getOperationalEnvironment();
1681
1230
  var TYPES = ["partner", "external", "game"];
1682
1231
  var WEBVIEW_TYPES = {
1683
- partner: import_react_native40.PartnerWebViewScreen,
1684
- external: import_react_native40.ExternalWebViewScreen,
1232
+ partner: import_react_native14.PartnerWebViewScreen,
1233
+ external: import_react_native14.ExternalWebViewScreen,
1685
1234
  game: GameWebView
1686
1235
  };
1687
1236
  function mergeSchemeQueryParamsInto(url) {
1688
1237
  const baseUrl = new URL(url);
1689
- const schemeUrl = new URL((0, import_react_native39.getSchemeUri)());
1238
+ const schemeUrl = new URL((0, import_react_native_bedrock11.getSchemeUri)());
1690
1239
  baseUrl.pathname = schemeUrl.pathname;
1691
1240
  for (const [key, value] of schemeUrl.searchParams.entries()) {
1692
1241
  baseUrl.searchParams.set(key, value);
@@ -1710,7 +1259,7 @@ function WebView({ type, local, onMessage, ...props }) {
1710
1259
  if (!TYPES.includes(type)) {
1711
1260
  throw new Error(`Invalid WebView type: '${type}'`);
1712
1261
  }
1713
- const graniteEvent = (0, import_react_native39.useGraniteEvent)();
1262
+ const bedrockEvent = (0, import_react_native_bedrock11.useBedrockEvent)();
1714
1263
  const uri = (0, import_react6.useMemo)(() => getWebViewUri(local), [local]);
1715
1264
  const top = (0, import_private.useSafeAreaTop)();
1716
1265
  const bottom = (0, import_private.useSafeAreaBottom)();
@@ -1719,7 +1268,7 @@ function WebView({ type, local, onMessage, ...props }) {
1719
1268
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1720
1269
  eventListenerMap: {
1721
1270
  ...event_bridges_exports,
1722
- backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
1271
+ backEvent: ({ onEvent, onError, options }) => bedrockEvent.addEventListener("backEvent", { onEvent, onError, options }),
1723
1272
  entryMessageExited: ({ onEvent, onError }) => appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
1724
1273
  updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1725
1274
  /** @internal */
@@ -1731,7 +1280,7 @@ function WebView({ type, local, onMessage, ...props }) {
1731
1280
  showAdMobRewardedAd: GoogleAdMob.showAdMobRewardedAd
1732
1281
  },
1733
1282
  constantHandlerMap: {
1734
- ...graniteConstantBridges,
1283
+ ...bedrockConstantBridges,
1735
1284
  ...constant_bridges_exports,
1736
1285
  getSafeAreaTop: () => top,
1737
1286
  getSafeAreaBottom: () => bottom,
@@ -1744,7 +1293,7 @@ function WebView({ type, local, onMessage, ...props }) {
1744
1293
  getDeploymentId: env.getDeploymentId
1745
1294
  },
1746
1295
  asyncHandlerMap: {
1747
- ...graniteAsyncBridges,
1296
+ ...bedrockAsyncBridges,
1748
1297
  ...async_bridges_exports,
1749
1298
  /** internal */
1750
1299
  openPermissionDialog: AppsInTossModule.openPermissionDialog,
@@ -1752,7 +1301,10 @@ function WebView({ type, local, onMessage, ...props }) {
1752
1301
  getStorageItem: Storage.getItem,
1753
1302
  setStorageItem: Storage.setItem,
1754
1303
  removeStorageItem: Storage.removeItem,
1755
- clearItems: Storage.clearItems
1304
+ clearItems: Storage.clearItems,
1305
+ /** IAP */
1306
+ iapCreateOneTimePurchaseOrder: IAP.createOneTimePurchaseOrder,
1307
+ iapGetProductItemList: IAP.getProductItemList
1756
1308
  }
1757
1309
  });
1758
1310
  const baseProps = (0, import_react6.useMemo)(() => {
@@ -1816,10 +1368,10 @@ function ensureValue(value, name) {
1816
1368
  }
1817
1369
 
1818
1370
  // src/hooks/useGeolocation.ts
1819
- var import_react_native41 = require("@granite-js/react-native");
1820
1371
  var import_react7 = require("react");
1372
+ var import_react_native_bedrock12 = require("react-native-bedrock");
1821
1373
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1822
- const isVisible = (0, import_react_native41.useVisibility)();
1374
+ const isVisible = (0, import_react_native_bedrock12.useVisibility)();
1823
1375
  const [location, setLocation] = (0, import_react7.useState)(null);
1824
1376
  (0, import_react7.useEffect)(() => {
1825
1377
  if (!isVisible) {
@@ -1838,6 +1390,25 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1838
1390
  return location;
1839
1391
  }
1840
1392
 
1393
+ // src/types.ts
1394
+ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
1395
+ Accuracy3[Accuracy3["Lowest"] = 1] = "Lowest";
1396
+ Accuracy3[Accuracy3["Low"] = 2] = "Low";
1397
+ Accuracy3[Accuracy3["Balanced"] = 3] = "Balanced";
1398
+ Accuracy3[Accuracy3["High"] = 4] = "High";
1399
+ Accuracy3[Accuracy3["Highest"] = 5] = "Highest";
1400
+ Accuracy3[Accuracy3["BestForNavigation"] = 6] = "BestForNavigation";
1401
+ return Accuracy3;
1402
+ })(Accuracy2 || {});
1403
+
1404
+ // src/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
1405
+ function onVisibilityChangedByTransparentServiceWeb(eventParams) {
1406
+ return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
1407
+ }
1408
+
1409
+ // src/private.ts
1410
+ var INTERNAL__onVisibilityChangedByTransparentServiceWeb = onVisibilityChangedByTransparentServiceWeb;
1411
+
1841
1412
  // src/index.ts
1842
1413
  __reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
1843
1414
  var Analytics2 = {
@@ -1851,43 +1422,29 @@ var Analytics2 = {
1851
1422
  Accuracy,
1852
1423
  Analytics,
1853
1424
  AppsInToss,
1854
- AppsInTossModule,
1855
- BedrockCoreModule,
1856
- BedrockModule,
1857
1425
  GoogleAdMob,
1858
- INTERNAL__AppsInTossModule,
1859
- INTERNAL__module,
1426
+ IAP,
1427
+ INTERNAL__onVisibilityChangedByTransparentServiceWeb,
1860
1428
  Storage,
1861
1429
  TossPay,
1862
1430
  WebView,
1863
1431
  appLogin,
1864
1432
  appsInTossEvent,
1865
- closeView,
1866
1433
  env,
1867
1434
  eventLog,
1868
1435
  fetchAlbumPhotos,
1869
1436
  fetchContacts,
1870
- generateHapticFeedback,
1871
1437
  getClipboardText,
1872
1438
  getCurrentLocation,
1873
1439
  getDeviceId,
1874
- getLocale,
1875
- getNetworkStatus,
1876
1440
  getOperationalEnvironment,
1877
- getPlatformOS,
1878
- getSchemeUri,
1879
1441
  getTossAppVersion,
1880
1442
  getTossShareLink,
1881
1443
  isMinVersionSupported,
1882
1444
  openCamera,
1883
- openURL,
1884
1445
  saveBase64Data,
1885
1446
  setClipboardText,
1886
1447
  setDeviceOrientation,
1887
- setIosSwipeGestureEnabled,
1888
- setScreenAwakeMode,
1889
- setSecureScreen,
1890
- share,
1891
1448
  startUpdateLocation,
1892
1449
  useGeolocation,
1893
1450
  ...require("@apps-in-toss/analytics")