@apps-in-toss/framework 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -31,54 +31,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
- Accuracy: () => Accuracy,
35
34
  Analytics: () => Analytics2,
36
35
  AppsInToss: () => AppsInToss,
37
- AppsInTossModule: () => AppsInTossModule,
38
- BedrockCoreModule: () => BedrockCoreModule,
39
- BedrockModule: () => BedrockModule,
40
- GoogleAdMob: () => GoogleAdMob,
41
- IAP: () => IAP,
42
- INTERNAL__AppsInTossModule: () => AppsInTossModuleInstance,
43
- INTERNAL__module: () => INTERNAL__module,
44
36
  INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
45
- Storage: () => Storage,
46
- TossPay: () => TossPay,
47
37
  WebView: () => WebView,
48
- appLogin: () => appLogin,
49
- appsInTossEvent: () => appsInTossEvent,
50
- closeView: () => closeView,
51
- contactsViral: () => contactsViral,
52
38
  env: () => env,
53
- eventLog: () => eventLog,
54
- fetchAlbumPhotos: () => fetchAlbumPhotos,
55
- fetchContacts: () => fetchContacts,
56
- generateHapticFeedback: () => generateHapticFeedback,
57
- getClipboardText: () => getClipboardText,
58
- getCurrentLocation: () => getCurrentLocation,
59
- getDeviceId: () => getDeviceId,
60
- getGameCenterGameProfile: () => getGameCenterGameProfile,
61
- getLocale: () => getLocale,
62
- getNetworkStatus: () => getNetworkStatus,
63
- getOperationalEnvironment: () => getOperationalEnvironment,
64
- getPlatformOS: () => getPlatformOS,
65
- getSchemeUri: () => getSchemeUri,
66
- getTossAppVersion: () => getTossAppVersion,
67
- getTossShareLink: () => getTossShareLink,
68
- isMinVersionSupported: () => isMinVersionSupported,
69
- onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb,
70
- openCamera: () => openCamera,
71
- openGameCenterLeaderboard: () => openGameCenterLeaderboard,
72
- openURL: () => openURL2,
73
- saveBase64Data: () => saveBase64Data,
74
- setClipboardText: () => setClipboardText,
75
- setDeviceOrientation: () => setDeviceOrientation,
76
- setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled,
77
- setScreenAwakeMode: () => setScreenAwakeMode,
78
- setSecureScreen: () => setSecureScreen,
79
- share: () => share,
80
- startUpdateLocation: () => startUpdateLocation,
81
- submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore,
82
39
  useCreateUserAgent: () => useCreateUserAgent,
83
40
  useGeolocation: () => useGeolocation
84
41
  });
@@ -87,694 +44,13 @@ var import_analytics2 = require("@apps-in-toss/analytics");
87
44
 
88
45
  // src/core/registerApp.tsx
89
46
  var import_analytics = require("@apps-in-toss/analytics");
90
-
91
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
92
- var import_react_native = require("@granite-js/react-native");
93
- var import_react_native2 = require("@granite-js/react-native");
94
- var import_react_native3 = require("@granite-js/react-native");
95
- var import_react_native4 = require("react-native");
96
- var import_react_native5 = require("react-native");
97
- var import_react_native6 = require("@granite-js/react-native");
47
+ var import_native_modules4 = require("@apps-in-toss/native-modules");
98
48
  var import_react_native7 = require("@granite-js/react-native");
99
- var import_react_native8 = require("react-native");
100
-
101
- // ../../.yarn/cache/es-toolkit-npm-1.39.3-b94f623c91-1c85e518b1.zip/node_modules/es-toolkit/dist/function/noop.mjs
102
- function noop() {
103
- }
104
-
105
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/dist/index.js
106
- var import_react_native9 = require("@granite-js/react-native");
107
- var import_react_native10 = require("react-native");
108
- var import_react_native11 = require("react-native");
109
- var import_react_native12 = require("react-native");
110
- var import_react_native13 = require("react-native");
111
- var import_react_native14 = require("react-native");
112
- var import_react_native15 = require("react-native");
113
- var EntryMessageExitedEvent = class extends import_react_native2.GraniteEventDefinition {
114
- name = "entryMessageExited";
115
- remove() {
116
- }
117
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
118
- listener(_) {
119
- }
120
- };
121
- var Module = import_react_native4.TurboModuleRegistry.getEnforcing("AppsInTossModule");
122
- var AppsInTossModuleInstance = Module;
123
- var AppsInTossModule = Module;
124
- function getPermission(permission) {
125
- return AppsInTossModule.getPermission(permission);
126
- }
127
- function openPermissionDialog(permission) {
128
- return AppsInTossModule.openPermissionDialog(permission);
129
- }
130
- async function requestPermission(permission) {
131
- const permissionStatus = await getPermission(permission);
132
- switch (permissionStatus) {
133
- case "allowed":
134
- case "denied":
135
- return permissionStatus;
136
- default:
137
- return openPermissionDialog(permission);
138
- }
139
- }
140
- var nativeEventEmitter = new import_react_native5.NativeEventEmitter(AppsInTossModuleInstance);
141
- var UpdateLocationEvent = class extends import_react_native3.GraniteEventDefinition {
142
- name = "updateLocationEvent";
143
- subscriptionCount = 0;
144
- ref = {
145
- remove: () => {
146
- }
147
- };
148
- remove() {
149
- if (--this.subscriptionCount === 0) {
150
- AppsInTossModuleInstance.stopUpdateLocation({});
151
- }
152
- this.ref.remove();
153
- }
154
- listener(options, onEvent, onError) {
155
- requestPermission({ name: "geolocation", access: "access" }).then((permissionStatus) => {
156
- if (permissionStatus === "denied") {
157
- onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
158
- return;
159
- }
160
- void AppsInTossModuleInstance.startUpdateLocation(options).catch(onError);
161
- const subscription = nativeEventEmitter.addListener("updateLocation", onEvent);
162
- this.ref = {
163
- remove: () => subscription?.remove()
164
- };
165
- this.subscriptionCount++;
166
- }).catch(onError);
167
- }
168
- };
169
- function generateUUID(placeholder) {
170
- return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID);
171
- }
172
- var INTERNAL__callbacks = /* @__PURE__ */ new Map();
173
- function invokeAppBridgeCallback(id, ...args) {
174
- const callback = INTERNAL__callbacks.get(id);
175
- callback?.call(null, ...args);
176
- return Boolean(callback);
177
- }
178
- function invokeAppBridgeMethod(methodName, params, callbacks) {
179
- const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
180
- const { callbackMap, unregisterAll } = registerCallbacks(appBridgeCallbacks);
181
- const promise = AppsInTossModuleInstance[methodName]({
182
- params,
183
- callbacks: callbackMap
184
- });
185
- void promise.then(onSuccess).catch(onError);
186
- return unregisterAll;
187
- }
188
- function registerCallbacks(callbacks) {
189
- const callbackMap = {};
190
- for (const [callbackName, callback] of Object.entries(callbacks)) {
191
- const id = registerCallback(callback, callbackName);
192
- callbackMap[callbackName] = id;
193
- }
194
- const unregisterAll = () => {
195
- Object.values(callbackMap).forEach(unregisterCallback);
196
- };
197
- return { callbackMap, unregisterAll };
198
- }
199
- function registerCallback(callback, name = "unnamed") {
200
- const uniqueId = generateUUID();
201
- const callbackId = `${uniqueId}__${name}`;
202
- INTERNAL__callbacks.set(callbackId, callback);
203
- return callbackId;
204
- }
205
- function unregisterCallback(id) {
206
- INTERNAL__callbacks.delete(id);
207
- }
208
- function getCallbackIds() {
209
- return Array.from(INTERNAL__callbacks.keys());
210
- }
211
- var INTERNAL__appBridgeHandler = {
212
- invokeAppBridgeCallback,
213
- invokeAppBridgeMethod,
214
- registerCallback,
215
- unregisterCallback,
216
- getCallbackIds
217
- };
218
- var UNSAFE__nativeEventEmitter = nativeEventEmitter;
219
- var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends import_react_native6.GraniteEventDefinition {
220
- static INTERNAL__appBridgeSubscription;
221
- name = "appBridgeCallbackEvent";
222
- constructor() {
223
- super();
224
- this.registerAppBridgeCallbackEventListener();
225
- }
226
- remove() {
227
- }
228
- listener() {
229
- }
230
- registerAppBridgeCallbackEventListener() {
231
- if (_AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription != null) {
232
- return;
233
- }
234
- _AppBridgeCallbackEvent.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter.addListener(
235
- "appBridgeCallback",
236
- this.ensureInvokeAppBridgeCallback
237
- );
238
- }
239
- ensureInvokeAppBridgeCallback(result) {
240
- if (typeof result === "object" && typeof result.name === "string") {
241
- INTERNAL__appBridgeHandler.invokeAppBridgeCallback(result.name, result.params);
242
- } else {
243
- console.warn("Invalid app bridge callback result:", result);
244
- }
245
- }
246
- };
247
- var VisibilityChangedByTransparentServiceWebEvent = class extends import_react_native7.GraniteEventDefinition {
248
- name = "onVisibilityChangedByTransparentServiceWeb";
249
- subscription = null;
250
- remove() {
251
- this.subscription?.remove();
252
- this.subscription = null;
253
- }
254
- listener(options, onEvent, onError) {
255
- const subscription = nativeEventEmitter.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
256
- if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
257
- if (params.callbackId === options.callbackId) {
258
- onEvent(params.isVisible);
259
- }
260
- } else {
261
- onError(new Error("Invalid visibility changed by transparent service web result"));
262
- }
263
- });
264
- this.subscription = subscription;
265
- }
266
- isVisibilityChangedByTransparentServiceWebResult(params) {
267
- return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
268
- }
269
- };
270
- var appsInTossEvent = new import_react_native.GraniteEvent([
271
- new UpdateLocationEvent(),
272
- new EntryMessageExitedEvent(),
273
- // Internal events
274
- new AppBridgeCallbackEvent(),
275
- new VisibilityChangedByTransparentServiceWebEvent()
276
- ]);
277
- function startUpdateLocation(eventParams) {
278
- return appsInTossEvent.addEventListener("updateLocationEvent", eventParams);
279
- }
280
- var SEMVER_REGEX = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
281
- var isWildcard = (val) => ["*", "x", "X"].includes(val);
282
- var tryParse = (val) => {
283
- const num = parseInt(val, 10);
284
- return isNaN(num) ? val : num;
285
- };
286
- var coerceTypes = (a, b) => {
287
- return typeof a === typeof b ? [a, b] : [String(a), String(b)];
288
- };
289
- var compareValues = (a, b) => {
290
- if (isWildcard(a) || isWildcard(b)) {
291
- return 0;
292
- }
293
- const [aVal, bVal] = coerceTypes(tryParse(a), tryParse(b));
294
- if (aVal > bVal) {
295
- return 1;
296
- }
297
- if (aVal < bVal) {
298
- return -1;
299
- }
300
- return 0;
301
- };
302
- var parseVersion = (version) => {
303
- if (typeof version !== "string") {
304
- throw new TypeError("Invalid argument: expected a string");
305
- }
306
- const match = version.match(SEMVER_REGEX);
307
- if (!match) {
308
- throw new Error(`Invalid semver: '${version}'`);
309
- }
310
- const [, major, minor, patch, build, preRelease] = match;
311
- return [major, minor, patch, build, preRelease];
312
- };
313
- var compareSegments = (a, b) => {
314
- const maxLength = Math.max(a.length, b.length);
315
- for (let i = 0; i < maxLength; i++) {
316
- const segA = a[i] ?? "0";
317
- const segB = b[i] ?? "0";
318
- const result = compareValues(segA, segB);
319
- if (result !== 0) {
320
- return result;
321
- }
322
- }
323
- return 0;
324
- };
325
- var compareVersions = (v1, v2) => {
326
- const seg1 = parseVersion(v1);
327
- const seg2 = parseVersion(v2);
328
- const preRelease1 = seg1.pop();
329
- const preRelease2 = seg2.pop();
330
- const mainCompare = compareSegments(seg1, seg2);
331
- if (mainCompare !== 0) {
332
- return mainCompare;
333
- }
334
- if (preRelease1 && preRelease2) {
335
- return compareSegments(preRelease1.split("."), preRelease2.split("."));
336
- }
337
- if (preRelease1) {
338
- return -1;
339
- }
340
- if (preRelease2) {
341
- return 1;
342
- }
343
- return 0;
344
- };
345
- function isMinVersionSupported(minVersions) {
346
- const operationalEnvironment2 = AppsInTossModule.operationalEnvironment;
347
- if (operationalEnvironment2 === "sandbox") {
348
- return true;
349
- }
350
- const currentVersion = AppsInTossModule.tossAppVersion;
351
- const isIOS = import_react_native8.Platform.OS === "ios";
352
- const minVersion = isIOS ? minVersions.ios : minVersions.android;
353
- if (minVersion === void 0) {
354
- return false;
355
- }
356
- if (minVersion === "always") {
357
- return true;
358
- }
359
- if (minVersion === "never") {
360
- return false;
361
- }
362
- return compareVersions(currentVersion, minVersion) >= 0;
363
- }
364
- function contactsViral(params) {
365
- const isSupported = isMinVersionSupported({
366
- android: "5.223.0",
367
- ios: "5.223.0"
368
- });
369
- if (!isSupported) {
370
- return () => {
371
- };
372
- }
373
- const { onEvent, onError, options } = params;
374
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("contactsViral", options, {
375
- onRewardFromContactsViral: (result) => {
376
- onEvent({ type: "sendViral", data: result });
377
- },
378
- onSuccess: (result) => {
379
- onEvent({ type: "close", data: result });
380
- },
381
- onError
382
- });
383
- return unregisterCallbacks;
384
- }
385
- function onVisibilityChangedByTransparentServiceWeb(eventParams) {
386
- return appsInTossEvent.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
387
- }
388
- function getOperationalEnvironment() {
389
- return AppsInTossModule.operationalEnvironment;
390
- }
391
- function loadAdMobInterstitialAd(params) {
392
- if (!loadAdMobInterstitialAd.isSupported()) {
393
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
394
- return noop;
395
- }
396
- const { onEvent, onError, options } = params;
397
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobInterstitialAd", options, {
398
- onAdClicked: () => {
399
- onEvent({ type: "clicked" });
400
- },
401
- onAdDismissed: () => {
402
- onEvent({ type: "dismissed" });
403
- },
404
- onAdFailedToShow: () => {
405
- onEvent({ type: "failedToShow" });
406
- },
407
- onAdImpression: () => {
408
- onEvent({ type: "impression" });
409
- },
410
- onAdShow: () => {
411
- onEvent({ type: "show" });
412
- },
413
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
414
- onError
415
- });
416
- return unregisterCallbacks;
417
- }
418
- function showAdMobInterstitialAd(params) {
419
- if (!showAdMobInterstitialAd.isSupported()) {
420
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
421
- return noop;
422
- }
423
- const { onEvent, onError, options } = params;
424
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobInterstitialAd", options, {
425
- onSuccess: () => onEvent({ type: "requested" }),
426
- onError
427
- });
428
- return unregisterCallbacks;
429
- }
430
- function loadAdMobRewardedAd(params) {
431
- if (!loadAdMobRewardedAd.isSupported()) {
432
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
433
- return noop;
434
- }
435
- const { onEvent, onError, options } = params;
436
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAdMobRewardedAd", options, {
437
- onAdClicked: () => {
438
- onEvent({ type: "clicked" });
439
- },
440
- onAdDismissed: () => {
441
- onEvent({ type: "dismissed" });
442
- },
443
- onAdFailedToShow: () => {
444
- onEvent({ type: "failedToShow" });
445
- },
446
- onAdImpression: () => {
447
- onEvent({ type: "impression" });
448
- },
449
- onAdShow: () => {
450
- onEvent({ type: "show" });
451
- },
452
- onUserEarnedReward: () => {
453
- onEvent({ type: "userEarnedReward" });
454
- },
455
- onSuccess: (result) => onEvent({ type: "loaded", data: result }),
456
- onError
457
- });
458
- return unregisterCallbacks;
459
- }
460
- function showAdMobRewardedAd(params) {
461
- if (!showAdMobRewardedAd.isSupported()) {
462
- params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
463
- return noop;
464
- }
465
- const { onEvent, onError, options } = params;
466
- const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAdMobRewardedAd", options, {
467
- onSuccess: () => onEvent({ type: "requested" }),
468
- onError
469
- });
470
- return unregisterCallbacks;
471
- }
472
- var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
473
- var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION = "5.209.0";
474
- var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
475
- var ENVIRONMENT = getOperationalEnvironment();
476
- function createIsSupported() {
477
- return () => {
478
- if (ENVIRONMENT !== "toss") {
479
- return false;
480
- }
481
- return isMinVersionSupported({
482
- android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION,
483
- ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION
484
- });
485
- };
486
- }
487
- loadAdMobInterstitialAd.isSupported = createIsSupported();
488
- loadAdMobRewardedAd.isSupported = createIsSupported();
489
- showAdMobInterstitialAd.isSupported = createIsSupported();
490
- showAdMobRewardedAd.isSupported = createIsSupported();
491
- async function checkoutPayment(options) {
492
- return AppsInTossModule.checkoutPayment({ params: options });
493
- }
494
- async function appLogin() {
495
- return AppsInTossModule.appLogin({});
496
- }
497
- function normalizeParams(params) {
498
- return Object.fromEntries(
499
- Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
500
- );
501
- }
502
- async function eventLog(params) {
503
- if (AppsInTossModule.operationalEnvironment === "sandbox") {
504
- console.log("[eventLogDebug]", {
505
- log_name: params.log_name,
506
- log_type: params.log_type,
507
- params: normalizeParams(params.params)
508
- });
509
- return;
510
- }
511
- const isSupported = isMinVersionSupported({
512
- android: "5.208.0",
513
- ios: "5.208.0"
514
- });
515
- if (!isSupported) {
516
- return;
517
- }
518
- return AppsInTossModule.eventLog({
519
- log_name: params.log_name,
520
- log_type: params.log_type,
521
- params: normalizeParams(params.params)
522
- });
523
- }
524
- var DEFAULT_MAX_COUNT = 10;
525
- var DEFAULT_MAX_WIDTH = 1024;
526
- async function fetchAlbumPhotos(options) {
527
- const permissionStatus = await requestPermission({ name: "photos", access: "read" });
528
- if (permissionStatus === "denied") {
529
- throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
530
- }
531
- const albumPhotos = await AppsInTossModule.fetchAlbumPhotos({
532
- ...options,
533
- maxCount: options.maxCount ?? DEFAULT_MAX_COUNT,
534
- maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH
535
- });
536
- return albumPhotos;
537
- }
538
- async function fetchContacts(options) {
539
- const permissionStatus = await requestPermission({ name: "contacts", access: "read" });
540
- if (permissionStatus === "denied") {
541
- throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
542
- }
543
- const contacts = await AppsInTossModule.fetchContacts(options);
544
- return {
545
- result: contacts.result,
546
- nextOffset: contacts.nextOffset ?? null,
547
- done: contacts.done
548
- };
549
- }
550
- async function getClipboardText() {
551
- const permissionStatus = await requestPermission({ name: "clipboard", access: "read" });
552
- if (permissionStatus === "denied") {
553
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
554
- }
555
- return AppsInTossModule.getClipboardText({});
556
- }
557
- async function getCurrentLocation(options) {
558
- const permissionStatus = await requestPermission({ name: "geolocation", access: "access" });
559
- if (permissionStatus === "denied") {
560
- throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
561
- }
562
- const position = await AppsInTossModule.getCurrentLocation(options);
563
- return position;
564
- }
565
- function getDeviceId() {
566
- return AppsInTossModule.deviceId;
567
- }
568
- function getTossAppVersion() {
569
- return AppsInTossModule.tossAppVersion;
570
- }
571
- async function getTossShareLink(path) {
572
- const { shareLink } = await AppsInTossModule.getTossShareLink({});
573
- const shareUrl = new URL(shareLink);
574
- shareUrl.searchParams.set("deep_link_value", path);
575
- shareUrl.searchParams.set("af_dp", path);
576
- return shareUrl.toString();
577
- }
578
- async function createOneTimePurchaseOrder(params) {
579
- const isSupported = isMinVersionSupported({
580
- android: "5.219.0",
581
- ios: "5.219.0"
582
- });
583
- if (!isSupported) {
584
- return;
585
- }
586
- return AppsInTossModule.iapCreateOneTimePurchaseOrder(params);
587
- }
588
- async function getProductItemList() {
589
- const isSupported = isMinVersionSupported({
590
- android: "5.219.0",
591
- ios: "5.219.0"
592
- });
593
- if (!isSupported) {
594
- return;
595
- }
596
- return AppsInTossModule.iapGetProductItemList({});
597
- }
598
- var IAP = {
599
- createOneTimePurchaseOrder,
600
- getProductItemList
601
- };
602
- async function openCamera(options) {
603
- const permissionStatus = await requestPermission({ name: "camera", access: "access" });
604
- if (permissionStatus === "denied") {
605
- throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
606
- }
607
- const photo = await AppsInTossModule.openCamera({ base64: false, maxWidth: 1024, ...options });
608
- return photo;
609
- }
610
- async function saveBase64Data(params) {
611
- const isSupported = isMinVersionSupported({
612
- android: "5.218.0",
613
- ios: "5.216.0"
614
- });
615
- if (!isSupported) {
616
- console.warn("saveBase64Data is not supported in this app version");
617
- return;
618
- }
619
- await AppsInTossModule.saveBase64Data(params);
620
- }
621
- async function setClipboardText(text) {
622
- const permissionStatus = await requestPermission({ name: "clipboard", access: "write" });
623
- if (permissionStatus === "denied") {
624
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
625
- }
626
- return AppsInTossModule.setClipboardText({ text });
627
- }
628
- async function setDeviceOrientation(options) {
629
- const isSupported = isMinVersionSupported({
630
- android: "5.215.0",
631
- ios: "5.215.0"
632
- });
633
- if (!isSupported) {
634
- return;
635
- }
636
- return AppsInTossModule.setDeviceOrientation(options);
637
- }
638
- function getItem(key) {
639
- return AppsInTossModule.getStorageItem({ key });
640
- }
641
- function setItem(key, value) {
642
- return AppsInTossModule.setStorageItem({
643
- key,
644
- value
645
- });
646
- }
647
- function removeItem(key) {
648
- return AppsInTossModule.removeStorageItem({ key });
649
- }
650
- function clearItems() {
651
- return AppsInTossModule.clearStorage({});
652
- }
653
- var Storage = {
654
- getItem,
655
- setItem,
656
- removeItem,
657
- clearItems
658
- };
659
- var GAME_CENTER_MIN_VERSION = {
660
- android: "5.221.0",
661
- ios: "5.221.0"
662
- };
663
- async function openGameCenterLeaderboard() {
664
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION)) {
665
- return;
666
- }
667
- const appName = global.__granite?.app?.name;
668
- if (appName == null) {
669
- throw new Error("Cannot get app name");
670
- }
671
- const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
672
- url.searchParams.set("appName", appName);
673
- url.searchParams.set("referrer", `appsintoss.${appName}`);
674
- return (0, import_react_native9.openURL)(url.toString());
675
- }
676
- async function getGameCenterGameProfile() {
677
- const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
678
- if (!isSupported) {
679
- return;
680
- }
681
- return AppsInTossModule.getGameCenterGameProfile({});
682
- }
683
- async function submitGameCenterLeaderBoardScore(params) {
684
- const isSupported = isMinVersionSupported(GAME_CENTER_MIN_VERSION);
685
- if (!isSupported) {
686
- return;
687
- }
688
- return AppsInTossModule.submitGameCenterLeaderBoardScore(params);
689
- }
690
- var TossPay = {
691
- checkoutPayment
692
- };
693
- var GoogleAdMob = {
694
- loadAdMobInterstitialAd,
695
- showAdMobInterstitialAd,
696
- loadAdMobRewardedAd,
697
- showAdMobRewardedAd
698
- };
699
- var BedrockModule = import_react_native10.NativeModules.BedrockModule;
700
- async function closeView() {
701
- return BedrockModule.closeView();
702
- }
703
- function getLocale() {
704
- const locale = BedrockModule?.DeviceInfo?.locale ?? "ko-KR";
705
- if (import_react_native11.Platform.OS === "android") {
706
- return replaceUnderbarToHypen(locale);
707
- }
708
- return locale;
709
- }
710
- function replaceUnderbarToHypen(locale) {
711
- return locale.replace(/_/g, "-");
712
- }
713
- function getSchemeUri() {
714
- return BedrockModule.schemeUri;
715
- }
716
- function generateHapticFeedback(options) {
717
- return BedrockModule.generateHapticFeedback(options);
718
- }
719
- async function share(message) {
720
- BedrockModule.share(message);
721
- }
722
- function setSecureScreen(options) {
723
- return BedrockModule.setSecureScreen(options);
724
- }
725
- async function setScreenAwakeMode(options) {
726
- return BedrockModule.setScreenAwakeMode(options);
727
- }
728
- function getNetworkStatus() {
729
- return BedrockModule.getNetworkStatus();
730
- }
731
- async function setIosSwipeGestureEnabled(options) {
732
- if (BedrockModule.setIosSwipeGestureEnabled == null) {
733
- return;
734
- }
735
- return BedrockModule.setIosSwipeGestureEnabled(options);
736
- }
737
- function openURL2(url) {
738
- return import_react_native12.Linking.openURL(url);
739
- }
740
- function getPlatformOS() {
741
- return import_react_native13.Platform.OS;
742
- }
743
- var BedrockCoreModule = import_react_native14.NativeModules.BedrockCoreModule;
744
- var Accuracy = /* @__PURE__ */ ((Accuracy2) => {
745
- Accuracy2[Accuracy2["Lowest"] = 1] = "Lowest";
746
- Accuracy2[Accuracy2["Low"] = 2] = "Low";
747
- Accuracy2[Accuracy2["Balanced"] = 3] = "Balanced";
748
- Accuracy2[Accuracy2["High"] = 4] = "High";
749
- Accuracy2[Accuracy2["Highest"] = 5] = "Highest";
750
- Accuracy2[Accuracy2["BestForNavigation"] = 6] = "BestForNavigation";
751
- return Accuracy2;
752
- })(Accuracy || {});
753
- var TossCoreModule = import_react_native15.NativeModules.TossCoreModule;
754
- function tossCoreEventLog(params) {
755
- const supported = isMinVersionSupported({ ios: "5.210.0", android: "5.210.0" });
756
- const isSandbox = getOperationalEnvironment() === "sandbox";
757
- if (!supported || isSandbox) {
758
- return;
759
- }
760
- TossCoreModule.eventLog({
761
- params: {
762
- log_name: params.log_name,
763
- log_type: params.log_type,
764
- params: params.params
765
- }
766
- });
767
- }
768
- var INTERNAL__module = {
769
- tossCoreEventLog
770
- };
771
-
772
- // src/core/registerApp.tsx
773
- var import_react_native35 = require("@granite-js/react-native");
774
- var import_react_native36 = require("@toss-design-system/react-native");
49
+ var import_react_native8 = require("@toss-design-system/react-native");
775
50
 
776
51
  // src/core/components/AppEvent.tsx
777
- var import_react_native19 = require("@granite-js/react-native");
52
+ var import_native_modules2 = require("@apps-in-toss/native-modules");
53
+ var import_react_native4 = require("@granite-js/react-native");
778
54
  var import_react3 = require("react");
779
55
 
780
56
  // src/env.ts
@@ -783,16 +59,17 @@ var env = {
783
59
  };
784
60
 
785
61
  // src/hooks/useCaptureExitLog.ts
786
- var import_react_native18 = require("@granite-js/react-native");
62
+ var import_native_modules = require("@apps-in-toss/native-modules");
63
+ var import_react_native3 = require("@granite-js/react-native");
787
64
  var import_react2 = require("react");
788
65
 
789
66
  // src/core/hooks/useReferrer.ts
790
- var import_react_native16 = require("@granite-js/react-native");
67
+ var import_react_native = require("@granite-js/react-native");
791
68
  var import_react = require("react");
792
69
  function useReferrer() {
793
70
  return (0, import_react.useMemo)(() => {
794
71
  try {
795
- return new URL((0, import_react_native16.getSchemeUri)()).searchParams.get("referrer");
72
+ return new URL((0, import_react_native.getSchemeUri)()).searchParams.get("referrer");
796
73
  } catch {
797
74
  return null;
798
75
  }
@@ -800,10 +77,10 @@ function useReferrer() {
800
77
  }
801
78
 
802
79
  // src/utils/isPrivateScheme.ts
803
- var import_react_native17 = require("@granite-js/react-native");
80
+ var import_react_native2 = require("@granite-js/react-native");
804
81
  function isPrivateScheme() {
805
82
  try {
806
- return new URL((0, import_react_native17.getSchemeUri)()).protocol === "intoss-private:";
83
+ return new URL((0, import_react_native2.getSchemeUri)()).protocol === "intoss-private:";
807
84
  } catch {
808
85
  return false;
809
86
  }
@@ -814,7 +91,7 @@ var EXIT_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression_
814
91
  var EXIT_IMPRESSION_SCHEMA_ID = 1631628;
815
92
  function useCaptureExitLog() {
816
93
  const referrer = useReferrer();
817
- const visible = (0, import_react_native18.useVisibility)();
94
+ const visible = (0, import_react_native3.useVisibility)();
818
95
  const enterTime = (0, import_react2.useRef)(void 0);
819
96
  (0, import_react2.useEffect)(() => {
820
97
  if (visible === true) {
@@ -827,7 +104,7 @@ function useCaptureExitLog() {
827
104
  return;
828
105
  }
829
106
  const stayTime = Math.floor(exitTime - enterTime.current);
830
- INTERNAL__module.tossCoreEventLog({
107
+ import_native_modules.INTERNAL__module.tossCoreEventLog({
831
108
  log_name: EXIT_IMPRESSION_LOG_NAME,
832
109
  log_type: "event",
833
110
  params: {
@@ -835,7 +112,7 @@ function useCaptureExitLog() {
835
112
  event_type: "impression",
836
113
  referrer,
837
114
  deployment_id: env.getDeploymentId(),
838
- app_name: import_react_native18.Granite.appName,
115
+ app_name: import_react_native3.Granite.appName,
839
116
  is_private: isPrivateScheme(),
840
117
  stay_time: stayTime.toString(),
841
118
  exit_time: exitTime.toString()
@@ -853,7 +130,7 @@ var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
853
130
  function EntryAppEvent() {
854
131
  const referrer = useReferrer() ?? "";
855
132
  (0, import_react3.useEffect)(() => {
856
- INTERNAL__module.tossCoreEventLog({
133
+ import_native_modules2.INTERNAL__module.tossCoreEventLog({
857
134
  log_name: "appsintoss_app_visit::impression__enter_appsintoss",
858
135
  log_type: "info",
859
136
  params: {
@@ -861,7 +138,7 @@ function EntryAppEvent() {
861
138
  schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
862
139
  referrer,
863
140
  deployment_id: env.getDeploymentId(),
864
- app_name: import_react_native19.Granite.appName,
141
+ app_name: import_react_native4.Granite.appName,
865
142
  is_private: isPrivateScheme()
866
143
  }
867
144
  });
@@ -870,14 +147,14 @@ function EntryAppEvent() {
870
147
  }
871
148
  function SystemAppEvent({ ...initialProps }) {
872
149
  (0, import_react3.useEffect)(() => {
873
- INTERNAL__module.tossCoreEventLog({
150
+ import_native_modules2.INTERNAL__module.tossCoreEventLog({
874
151
  log_name: "AppsInTossInitialProps",
875
152
  log_type: "debug",
876
153
  params: {
877
154
  ...initialProps,
878
- schemeUri: (0, import_react_native19.getSchemeUri)(),
155
+ schemeUri: (0, import_react_native4.getSchemeUri)(),
879
156
  deployment_id: env.getDeploymentId(),
880
- app_name: import_react_native19.Granite.appName,
157
+ app_name: import_react_native4.Granite.appName,
881
158
  is_private: isPrivateScheme()
882
159
  }
883
160
  });
@@ -885,7 +162,7 @@ function SystemAppEvent({ ...initialProps }) {
885
162
  return null;
886
163
  }
887
164
  function StayTimeAppEvent() {
888
- const visible = (0, import_react_native19.useVisibility)();
165
+ const visible = (0, import_react_native4.useVisibility)();
889
166
  const { captureExitLog } = useCaptureExitLog();
890
167
  (0, import_react3.useEffect)(() => {
891
168
  if (visible === false) {
@@ -901,19 +178,20 @@ var AppEvent = {
901
178
  };
902
179
 
903
180
  // src/core/components/AppUpdate.tsx
904
- var import_react_native20 = require("@granite-js/react-native");
181
+ var import_react_native5 = require("@granite-js/react-native");
905
182
  var import_react4 = require("react");
906
183
  var import_jsx_runtime = require("react/jsx-runtime");
907
184
  var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
908
185
  function AppUpdate() {
909
186
  (0, import_react4.useEffect)(() => {
910
- (0, import_react_native20.openURL)(`supertoss://closePage?url=${UPDATE_SCHEME}`);
187
+ (0, import_react_native5.openURL)(`supertoss://closePage?url=${UPDATE_SCHEME}`);
911
188
  }, []);
912
189
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
913
190
  }
914
191
 
915
192
  // src/core/hooks/useAppsInTossBridge.ts
916
- var import_react_native21 = require("@toss-design-system/react-native");
193
+ var import_native_modules3 = require("@apps-in-toss/native-modules");
194
+ var import_react_native6 = require("@toss-design-system/react-native");
917
195
  var import_react5 = require("react");
918
196
 
919
197
  // src/core/utils/getAppsInTossGlobals.ts
@@ -931,7 +209,7 @@ function toIcon(source) {
931
209
 
932
210
  // src/core/hooks/useAppsInTossBridge.ts
933
211
  function useAppsInTossBridge() {
934
- const controller = (0, import_react_native21.useBridge)();
212
+ const controller = (0, import_react_native6.useBridge)();
935
213
  const appsInTossGlobals2 = getAppsInTossGlobals();
936
214
  (0, import_react5.useEffect)(() => {
937
215
  const commonProps = {
@@ -943,656 +221,16 @@ function useAppsInTossBridge() {
943
221
  controller.open({
944
222
  ...commonProps,
945
223
  onExited: () => {
946
- appsInTossEvent.emit("entryMessageExited", void 0);
224
+ import_native_modules3.appsInTossEvent.emit("entryMessageExited", void 0);
947
225
  }
948
226
  });
949
227
  }, []);
950
228
  }
951
229
 
952
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/async-bridges.ts
953
- var async_bridges_exports = {};
954
- __export(async_bridges_exports, {
955
- appLogin: () => appLogin2,
956
- checkoutPayment: () => checkoutPayment2,
957
- closeView: () => closeView2,
958
- eventLog: () => eventLog2,
959
- fetchAlbumPhotos: () => fetchAlbumPhotos2,
960
- fetchContacts: () => fetchContacts2,
961
- generateHapticFeedback: () => generateHapticFeedback2,
962
- getClipboardText: () => getClipboardText2,
963
- getCurrentLocation: () => getCurrentLocation2,
964
- getGameCenterGameProfile: () => getGameCenterGameProfile2,
965
- getNetworkStatus: () => getNetworkStatus2,
966
- getTossShareLink: () => getTossShareLink2,
967
- openCamera: () => openCamera2,
968
- openGameCenterLeaderboard: () => openGameCenterLeaderboard2,
969
- openURL: () => openURL4,
970
- saveBase64Data: () => saveBase64Data2,
971
- setClipboardText: () => setClipboardText2,
972
- setDeviceOrientation: () => setDeviceOrientation2,
973
- setIosSwipeGestureEnabled: () => setIosSwipeGestureEnabled2,
974
- setScreenAwakeMode: () => setScreenAwakeMode2,
975
- setSecureScreen: () => setSecureScreen2,
976
- share: () => share2,
977
- submitGameCenterLeaderBoardScore: () => submitGameCenterLeaderBoardScore2
978
- });
979
-
980
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/BedrockModule.ts
981
- var import_react_native22 = require("react-native");
982
- var BedrockModule2 = import_react_native22.NativeModules.BedrockModule;
983
-
984
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/closeView.ts
985
- async function closeView2() {
986
- return BedrockModule2.closeView();
987
- }
988
-
989
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/generateHapticFeedback/index.ts
990
- function generateHapticFeedback2(options) {
991
- return BedrockModule2.generateHapticFeedback(options);
992
- }
993
-
994
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/share.ts
995
- async function share2(message) {
996
- BedrockModule2.share(message);
997
- }
998
-
999
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setSecureScreen.ts
1000
- function setSecureScreen2(options) {
1001
- return BedrockModule2.setSecureScreen(options);
1002
- }
1003
-
1004
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setScreenAwakeMode.ts
1005
- async function setScreenAwakeMode2(options) {
1006
- return BedrockModule2.setScreenAwakeMode(options);
1007
- }
1008
-
1009
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getNetworkStatus/index.ts
1010
- function getNetworkStatus2() {
1011
- return BedrockModule2.getNetworkStatus();
1012
- }
1013
-
1014
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/setIosSwipeGestureEnabled.ts
1015
- async function setIosSwipeGestureEnabled2(options) {
1016
- if (BedrockModule2.setIosSwipeGestureEnabled == null) {
1017
- return;
1018
- }
1019
- return BedrockModule2.setIosSwipeGestureEnabled(options);
1020
- }
1021
-
1022
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/openURL.ts
1023
- var import_react_native23 = require("react-native");
1024
- function openURL4(url) {
1025
- return import_react_native23.Linking.openURL(url);
1026
- }
1027
-
1028
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/AppsInTossModule.ts
1029
- var import_react_native24 = require("react-native");
1030
- var Module2 = import_react_native24.TurboModuleRegistry.getEnforcing("AppsInTossModule");
1031
- var AppsInTossModuleInstance2 = Module2;
1032
- var AppsInTossModule2 = Module2;
1033
-
1034
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getPermission.ts
1035
- function getPermission2(permission) {
1036
- return AppsInTossModule2.getPermission(permission);
1037
- }
1038
-
1039
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openPermissionDialog.ts
1040
- function openPermissionDialog2(permission) {
1041
- return AppsInTossModule2.openPermissionDialog(permission);
1042
- }
1043
-
1044
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/requestPermission.ts
1045
- async function requestPermission2(permission) {
1046
- const permissionStatus = await getPermission2(permission);
1047
- switch (permissionStatus) {
1048
- case "allowed":
1049
- case "denied":
1050
- return permissionStatus;
1051
- default:
1052
- return openPermissionDialog2(permission);
1053
- }
1054
- }
1055
-
1056
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setClipboardText.ts
1057
- async function setClipboardText2(text) {
1058
- const permissionStatus = await requestPermission2({ name: "clipboard", access: "write" });
1059
- if (permissionStatus === "denied") {
1060
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1061
- }
1062
- return AppsInTossModule2.setClipboardText({ text });
1063
- }
1064
-
1065
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getClipboardText.ts
1066
- async function getClipboardText2() {
1067
- const permissionStatus = await requestPermission2({ name: "clipboard", access: "read" });
1068
- if (permissionStatus === "denied") {
1069
- throw new Error("\uD074\uB9BD\uBCF4\uB4DC \uC77D\uAE30 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1070
- }
1071
- return AppsInTossModule2.getClipboardText({});
1072
- }
1073
-
1074
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchContacts.ts
1075
- async function fetchContacts2(options) {
1076
- const permissionStatus = await requestPermission2({ name: "contacts", access: "read" });
1077
- if (permissionStatus === "denied") {
1078
- throw new Error("\uC5F0\uB77D\uCC98 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1079
- }
1080
- const contacts = await AppsInTossModule2.fetchContacts(options);
1081
- return {
1082
- result: contacts.result,
1083
- nextOffset: contacts.nextOffset ?? null,
1084
- done: contacts.done
1085
- };
1086
- }
1087
-
1088
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/fetchAlbumPhotos.ts
1089
- var DEFAULT_MAX_COUNT2 = 10;
1090
- var DEFAULT_MAX_WIDTH2 = 1024;
1091
- async function fetchAlbumPhotos2(options) {
1092
- const permissionStatus = await requestPermission2({ name: "photos", access: "read" });
1093
- if (permissionStatus === "denied") {
1094
- throw new Error("\uC0AC\uC9C4\uCCA9 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1095
- }
1096
- const albumPhotos = await AppsInTossModule2.fetchAlbumPhotos({
1097
- ...options,
1098
- maxCount: options.maxCount ?? DEFAULT_MAX_COUNT2,
1099
- maxWidth: options.maxWidth ?? DEFAULT_MAX_WIDTH2
1100
- });
1101
- return albumPhotos;
1102
- }
1103
-
1104
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getCurrentLocation.ts
1105
- async function getCurrentLocation2(options) {
1106
- const permissionStatus = await requestPermission2({ name: "geolocation", access: "access" });
1107
- if (permissionStatus === "denied") {
1108
- throw new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1109
- }
1110
- const position = await AppsInTossModule2.getCurrentLocation(options);
1111
- return position;
1112
- }
1113
-
1114
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openCamera.ts
1115
- async function openCamera2(options) {
1116
- const permissionStatus = await requestPermission2({ name: "camera", access: "access" });
1117
- if (permissionStatus === "denied") {
1118
- throw new Error("\uCE74\uBA54\uB77C \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694.");
1119
- }
1120
- const photo = await AppsInTossModule2.openCamera({ base64: false, maxWidth: 1024, ...options });
1121
- return photo;
1122
- }
1123
-
1124
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/appLogin.ts
1125
- async function appLogin2() {
1126
- return AppsInTossModule2.appLogin({});
1127
- }
1128
-
1129
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
1130
- var import_react_native25 = require("react-native");
1131
-
1132
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/compareVersion.ts
1133
- var SEMVER_REGEX2 = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i;
1134
- var isWildcard2 = (val) => ["*", "x", "X"].includes(val);
1135
- var tryParse2 = (val) => {
1136
- const num = parseInt(val, 10);
1137
- return isNaN(num) ? val : num;
1138
- };
1139
- var coerceTypes2 = (a, b) => {
1140
- return typeof a === typeof b ? [a, b] : [String(a), String(b)];
1141
- };
1142
- var compareValues2 = (a, b) => {
1143
- if (isWildcard2(a) || isWildcard2(b)) {
1144
- return 0;
1145
- }
1146
- const [aVal, bVal] = coerceTypes2(tryParse2(a), tryParse2(b));
1147
- if (aVal > bVal) {
1148
- return 1;
1149
- }
1150
- if (aVal < bVal) {
1151
- return -1;
1152
- }
1153
- return 0;
1154
- };
1155
- var parseVersion2 = (version) => {
1156
- if (typeof version !== "string") {
1157
- throw new TypeError("Invalid argument: expected a string");
1158
- }
1159
- const match = version.match(SEMVER_REGEX2);
1160
- if (!match) {
1161
- throw new Error(`Invalid semver: '${version}'`);
1162
- }
1163
- const [, major, minor, patch, build, preRelease] = match;
1164
- return [major, minor, patch, build, preRelease];
1165
- };
1166
- var compareSegments2 = (a, b) => {
1167
- const maxLength = Math.max(a.length, b.length);
1168
- for (let i = 0; i < maxLength; i++) {
1169
- const segA = a[i] ?? "0";
1170
- const segB = b[i] ?? "0";
1171
- const result = compareValues2(segA, segB);
1172
- if (result !== 0) {
1173
- return result;
1174
- }
1175
- }
1176
- return 0;
1177
- };
1178
- var compareVersions2 = (v1, v2) => {
1179
- const seg1 = parseVersion2(v1);
1180
- const seg2 = parseVersion2(v2);
1181
- const preRelease1 = seg1.pop();
1182
- const preRelease2 = seg2.pop();
1183
- const mainCompare = compareSegments2(seg1, seg2);
1184
- if (mainCompare !== 0) {
1185
- return mainCompare;
1186
- }
1187
- if (preRelease1 && preRelease2) {
1188
- return compareSegments2(preRelease1.split("."), preRelease2.split("."));
1189
- }
1190
- if (preRelease1) {
1191
- return -1;
1192
- }
1193
- if (preRelease2) {
1194
- return 1;
1195
- }
1196
- return 0;
1197
- };
1198
-
1199
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/isMinVersionSupported.ts
1200
- function isMinVersionSupported2(minVersions) {
1201
- const operationalEnvironment2 = AppsInTossModule2.operationalEnvironment;
1202
- if (operationalEnvironment2 === "sandbox") {
1203
- return true;
1204
- }
1205
- const currentVersion = AppsInTossModule2.tossAppVersion;
1206
- const isIOS = import_react_native25.Platform.OS === "ios";
1207
- const minVersion = isIOS ? minVersions.ios : minVersions.android;
1208
- if (minVersion === void 0) {
1209
- return false;
1210
- }
1211
- if (minVersion === "always") {
1212
- return true;
1213
- }
1214
- if (minVersion === "never") {
1215
- return false;
1216
- }
1217
- return compareVersions2(currentVersion, minVersion) >= 0;
1218
- }
1219
-
1220
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/eventLog.ts
1221
- function normalizeParams2(params) {
1222
- return Object.fromEntries(
1223
- Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
1224
- );
1225
- }
1226
- async function eventLog2(params) {
1227
- if (AppsInTossModule2.operationalEnvironment === "sandbox") {
1228
- console.log("[eventLogDebug]", {
1229
- log_name: params.log_name,
1230
- log_type: params.log_type,
1231
- params: normalizeParams2(params.params)
1232
- });
1233
- return;
1234
- }
1235
- const isSupported = isMinVersionSupported2({
1236
- android: "5.208.0",
1237
- ios: "5.208.0"
1238
- });
1239
- if (!isSupported) {
1240
- return;
1241
- }
1242
- return AppsInTossModule2.eventLog({
1243
- log_name: params.log_name,
1244
- log_type: params.log_type,
1245
- params: normalizeParams2(params.params)
1246
- });
1247
- }
1248
-
1249
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossShareLink.ts
1250
- async function getTossShareLink2(path) {
1251
- const { shareLink } = await AppsInTossModule2.getTossShareLink({});
1252
- const shareUrl = new URL(shareLink);
1253
- shareUrl.searchParams.set("deep_link_value", path);
1254
- shareUrl.searchParams.set("af_dp", path);
1255
- return shareUrl.toString();
1256
- }
1257
-
1258
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/setDeviceOrientation.ts
1259
- async function setDeviceOrientation2(options) {
1260
- const isSupported = isMinVersionSupported2({
1261
- android: "5.215.0",
1262
- ios: "5.215.0"
1263
- });
1264
- if (!isSupported) {
1265
- return;
1266
- }
1267
- return AppsInTossModule2.setDeviceOrientation(options);
1268
- }
1269
-
1270
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/checkoutPayment.ts
1271
- async function checkoutPayment2(options) {
1272
- return AppsInTossModule2.checkoutPayment({ params: options });
1273
- }
1274
-
1275
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/saveBase64Data.ts
1276
- async function saveBase64Data2(params) {
1277
- const isSupported = isMinVersionSupported2({
1278
- android: "5.218.0",
1279
- ios: "5.216.0"
1280
- });
1281
- if (!isSupported) {
1282
- console.warn("saveBase64Data is not supported in this app version");
1283
- return;
1284
- }
1285
- await AppsInTossModule2.saveBase64Data(params);
1286
- }
1287
-
1288
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/constants.ts
1289
- var GAME_CENTER_MIN_VERSION2 = {
1290
- android: "5.221.0",
1291
- ios: "5.221.0"
1292
- };
1293
-
1294
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getGameCenterGameProfile.ts
1295
- async function getGameCenterGameProfile2() {
1296
- const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
1297
- if (!isSupported) {
1298
- return;
1299
- }
1300
- return AppsInTossModule2.getGameCenterGameProfile({});
1301
- }
1302
-
1303
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/openGameCenterLeaderboard.ts
1304
- var import_react_native26 = require("@granite-js/react-native");
1305
- async function openGameCenterLeaderboard2() {
1306
- if (!isMinVersionSupported2(GAME_CENTER_MIN_VERSION2)) {
1307
- return;
1308
- }
1309
- const appName = global.__granite?.app?.name;
1310
- if (appName == null) {
1311
- throw new Error("Cannot get app name");
1312
- }
1313
- const url = new URL("servicetoss://game-center/leaderboard?_navbar=hide");
1314
- url.searchParams.set("appName", appName);
1315
- url.searchParams.set("referrer", `appsintoss.${appName}`);
1316
- return (0, import_react_native26.openURL)(url.toString());
1317
- }
1318
-
1319
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/submitGameCenterLeaderBoardScore.ts
1320
- async function submitGameCenterLeaderBoardScore2(params) {
1321
- const isSupported = isMinVersionSupported2(GAME_CENTER_MIN_VERSION2);
1322
- if (!isSupported) {
1323
- return;
1324
- }
1325
- return AppsInTossModule2.submitGameCenterLeaderBoardScore(params);
1326
- }
1327
-
1328
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/constant-bridges.ts
1329
- var constant_bridges_exports = {};
1330
- __export(constant_bridges_exports, {
1331
- getDeviceId: () => getDeviceId2,
1332
- getLocale: () => getLocale2,
1333
- getOperationalEnvironment: () => getOperationalEnvironment2,
1334
- getPlatformOS: () => getPlatformOS2,
1335
- getSchemeUri: () => getSchemeUri5,
1336
- getTossAppVersion: () => getTossAppVersion2
1337
- });
1338
-
1339
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getLocale.ts
1340
- var import_react_native27 = require("react-native");
1341
- function getLocale2() {
1342
- const locale = BedrockModule2?.DeviceInfo?.locale ?? "ko-KR";
1343
- if (import_react_native27.Platform.OS === "android") {
1344
- return replaceUnderbarToHypen2(locale);
1345
- }
1346
- return locale;
1347
- }
1348
- function replaceUnderbarToHypen2(locale) {
1349
- return locale.replace(/_/g, "-");
1350
- }
1351
-
1352
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getSchemeUri.ts
1353
- function getSchemeUri5() {
1354
- return BedrockModule2.schemeUri;
1355
- }
1356
-
1357
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/BedrockModule/native-modules/natives/getPlatformOS.ts
1358
- var import_react_native28 = require("react-native");
1359
- function getPlatformOS2() {
1360
- return import_react_native28.Platform.OS;
1361
- }
1362
-
1363
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getOperationalEnvironment.ts
1364
- function getOperationalEnvironment2() {
1365
- return AppsInTossModule2.operationalEnvironment;
1366
- }
1367
-
1368
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getTossAppVersion.ts
1369
- function getTossAppVersion2() {
1370
- return AppsInTossModule2.tossAppVersion;
1371
- }
1372
-
1373
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-modules/getDeviceId.ts
1374
- function getDeviceId2() {
1375
- return AppsInTossModule2.deviceId;
1376
- }
1377
-
1378
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/event-bridges.ts
1379
- var event_bridges_exports = {};
1380
- __export(event_bridges_exports, {
1381
- contactsViral: () => contactsViral2,
1382
- onVisibilityChangedByTransparentServiceWeb: () => onVisibilityChangedByTransparentServiceWeb2,
1383
- startUpdateLocation: () => startUpdateLocation2
1384
- });
1385
-
1386
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1387
- var import_react_native34 = require("@granite-js/react-native");
1388
-
1389
- // ../../.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
1390
- var import_react_native29 = require("@granite-js/react-native");
1391
- var EntryMessageExitedEvent2 = class extends import_react_native29.GraniteEventDefinition {
1392
- name = "entryMessageExited";
1393
- remove() {
1394
- }
1395
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1396
- listener(_) {
1397
- }
1398
- };
1399
-
1400
- // ../../.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
1401
- var import_react_native31 = require("@granite-js/react-native");
1402
-
1403
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/nativeEventEmitter.ts
1404
- var import_react_native30 = require("react-native");
1405
- var nativeEventEmitter2 = new import_react_native30.NativeEventEmitter(AppsInTossModuleInstance2);
1406
-
1407
- // ../../.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
1408
- var UpdateLocationEvent2 = class extends import_react_native31.GraniteEventDefinition {
1409
- name = "updateLocationEvent";
1410
- subscriptionCount = 0;
1411
- ref = {
1412
- remove: () => {
1413
- }
1414
- };
1415
- remove() {
1416
- if (--this.subscriptionCount === 0) {
1417
- AppsInTossModuleInstance2.stopUpdateLocation({});
1418
- }
1419
- this.ref.remove();
1420
- }
1421
- listener(options, onEvent, onError) {
1422
- requestPermission2({ name: "geolocation", access: "access" }).then((permissionStatus) => {
1423
- if (permissionStatus === "denied") {
1424
- onError(new Error("\uC704\uCE58 \uAD8C\uD55C\uC774 \uAC70\uBD80\uB418\uC5C8\uC5B4\uC694."));
1425
- return;
1426
- }
1427
- void AppsInTossModuleInstance2.startUpdateLocation(options).catch(onError);
1428
- const subscription = nativeEventEmitter2.addListener("updateLocation", onEvent);
1429
- this.ref = {
1430
- remove: () => subscription?.remove()
1431
- };
1432
- this.subscriptionCount++;
1433
- }).catch(onError);
1434
- }
1435
- };
1436
-
1437
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1438
- var import_react_native32 = require("@granite-js/react-native");
1439
-
1440
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/utils/generateUUID.ts
1441
- function generateUUID2(placeholder) {
1442
- return placeholder ? (placeholder ^ Math.random() * 16 >> placeholder / 4).toString(16) : (String(1e7) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, generateUUID2);
1443
- }
1444
-
1445
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/appBridge.ts
1446
- var INTERNAL__callbacks2 = /* @__PURE__ */ new Map();
1447
- function invokeAppBridgeCallback2(id, ...args) {
1448
- const callback = INTERNAL__callbacks2.get(id);
1449
- callback?.call(null, ...args);
1450
- return Boolean(callback);
1451
- }
1452
- function invokeAppBridgeMethod2(methodName, params, callbacks) {
1453
- const { onSuccess, onError, ...appBridgeCallbacks } = callbacks;
1454
- const { callbackMap, unregisterAll } = registerCallbacks2(appBridgeCallbacks);
1455
- const promise = AppsInTossModuleInstance2[methodName]({
1456
- params,
1457
- callbacks: callbackMap
1458
- });
1459
- void promise.then(onSuccess).catch(onError);
1460
- return unregisterAll;
1461
- }
1462
- function registerCallbacks2(callbacks) {
1463
- const callbackMap = {};
1464
- for (const [callbackName, callback] of Object.entries(callbacks)) {
1465
- const id = registerCallback2(callback, callbackName);
1466
- callbackMap[callbackName] = id;
1467
- }
1468
- const unregisterAll = () => {
1469
- Object.values(callbackMap).forEach(unregisterCallback2);
1470
- };
1471
- return { callbackMap, unregisterAll };
1472
- }
1473
- function registerCallback2(callback, name = "unnamed") {
1474
- const uniqueId = generateUUID2();
1475
- const callbackId = `${uniqueId}__${name}`;
1476
- INTERNAL__callbacks2.set(callbackId, callback);
1477
- return callbackId;
1478
- }
1479
- function unregisterCallback2(id) {
1480
- INTERNAL__callbacks2.delete(id);
1481
- }
1482
- function getCallbackIds2() {
1483
- return Array.from(INTERNAL__callbacks2.keys());
1484
- }
1485
- var INTERNAL__appBridgeHandler2 = {
1486
- invokeAppBridgeCallback: invokeAppBridgeCallback2,
1487
- invokeAppBridgeMethod: invokeAppBridgeMethod2,
1488
- registerCallback: registerCallback2,
1489
- unregisterCallback: unregisterCallback2,
1490
- getCallbackIds: getCallbackIds2
1491
- };
1492
-
1493
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
1494
- var UNSAFE__nativeEventEmitter2 = nativeEventEmitter2;
1495
- var AppBridgeCallbackEvent2 = class _AppBridgeCallbackEvent2 extends import_react_native32.GraniteEventDefinition {
1496
- static INTERNAL__appBridgeSubscription;
1497
- name = "appBridgeCallbackEvent";
1498
- constructor() {
1499
- super();
1500
- this.registerAppBridgeCallbackEventListener();
1501
- }
1502
- remove() {
1503
- }
1504
- listener() {
1505
- }
1506
- registerAppBridgeCallbackEventListener() {
1507
- if (_AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription != null) {
1508
- return;
1509
- }
1510
- _AppBridgeCallbackEvent2.INTERNAL__appBridgeSubscription = UNSAFE__nativeEventEmitter2.addListener(
1511
- "appBridgeCallback",
1512
- this.ensureInvokeAppBridgeCallback
1513
- );
1514
- }
1515
- ensureInvokeAppBridgeCallback(result) {
1516
- if (typeof result === "object" && typeof result.name === "string") {
1517
- INTERNAL__appBridgeHandler2.invokeAppBridgeCallback(result.name, result.params);
1518
- } else {
1519
- console.warn("Invalid app bridge callback result:", result);
1520
- }
1521
- }
1522
- };
1523
-
1524
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
1525
- var import_react_native33 = require("@granite-js/react-native");
1526
- var VisibilityChangedByTransparentServiceWebEvent2 = class extends import_react_native33.GraniteEventDefinition {
1527
- name = "onVisibilityChangedByTransparentServiceWeb";
1528
- subscription = null;
1529
- remove() {
1530
- this.subscription?.remove();
1531
- this.subscription = null;
1532
- }
1533
- listener(options, onEvent, onError) {
1534
- const subscription = nativeEventEmitter2.addListener("visibilityChangedByTransparentServiceWeb", (params) => {
1535
- if (this.isVisibilityChangedByTransparentServiceWebResult(params)) {
1536
- if (params.callbackId === options.callbackId) {
1537
- onEvent(params.isVisible);
1538
- }
1539
- } else {
1540
- onError(new Error("Invalid visibility changed by transparent service web result"));
1541
- }
1542
- });
1543
- this.subscription = subscription;
1544
- }
1545
- isVisibilityChangedByTransparentServiceWebResult(params) {
1546
- return typeof params === "object" && typeof params.callbackId === "string" && typeof params.isVisible === "boolean";
1547
- }
1548
- };
1549
-
1550
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts
1551
- var appsInTossEvent2 = new import_react_native34.GraniteEvent([
1552
- new UpdateLocationEvent2(),
1553
- new EntryMessageExitedEvent2(),
1554
- // Internal events
1555
- new AppBridgeCallbackEvent2(),
1556
- new VisibilityChangedByTransparentServiceWebEvent2()
1557
- ]);
1558
-
1559
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/startUpdateLocation.ts
1560
- function startUpdateLocation2(eventParams) {
1561
- return appsInTossEvent2.addEventListener("updateLocationEvent", eventParams);
1562
- }
1563
-
1564
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/internal/onVisibilityChangedByTransparentServiceWeb.ts
1565
- function onVisibilityChangedByTransparentServiceWeb2(eventParams) {
1566
- return appsInTossEvent2.addEventListener("onVisibilityChangedByTransparentServiceWeb", eventParams);
1567
- }
1568
-
1569
- // ../../.yarn/__virtual__/@apps-in-toss-native-modules-virtual-79d3aa8191/1/apps-in-toss-packages/native-modules/src/AppsInTossModule/native-event-emitter/contactsViral.ts
1570
- function contactsViral2(params) {
1571
- const isSupported = isMinVersionSupported2({
1572
- android: "5.223.0",
1573
- ios: "5.223.0"
1574
- });
1575
- if (!isSupported) {
1576
- return () => {
1577
- };
1578
- }
1579
- const { onEvent, onError, options } = params;
1580
- const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod("contactsViral", options, {
1581
- onRewardFromContactsViral: (result) => {
1582
- onEvent({ type: "sendViral", data: result });
1583
- },
1584
- onSuccess: (result) => {
1585
- onEvent({ type: "close", data: result });
1586
- },
1587
- onError
1588
- });
1589
- return unregisterCallbacks;
1590
- }
1591
-
1592
230
  // src/core/registerApp.tsx
1593
231
  var import_jsx_runtime2 = require("react/jsx-runtime");
1594
232
  function AppsInTossContainer(Container, { children, ...initialProps }) {
1595
- if (!isMinVersionSupported({
233
+ if (!(0, import_native_modules4.isMinVersionSupported)({
1596
234
  android: "5.220.0",
1597
235
  ios: "5.221.0"
1598
236
  })) {
@@ -1606,7 +244,7 @@ function AppsInTossContainer(Container, { children, ...initialProps }) {
1606
244
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.StayTime, {}),
1607
245
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.Entry, {}),
1608
246
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AppEvent.System, { ...initialProps }),
1609
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native36.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TDSContainer, { ...initialProps, children }) }) })
247
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native8.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TDSContainer, { ...initialProps, children }) }) })
1610
248
  ] });
1611
249
  }
1612
250
  function TDSContainer({ children }) {
@@ -1615,12 +253,13 @@ function TDSContainer({ children }) {
1615
253
  }
1616
254
  function registerApp(container, { context, analytics }) {
1617
255
  import_analytics.Analytics.init({
1618
- logger: (params) => void eventLog2(params),
256
+ logger: (params) => void (0, import_native_modules4.eventLog)(params),
1619
257
  debug: analytics?.debug ?? __DEV__
1620
258
  });
1621
- const App = import_react_native35.Granite.registerApp(AppsInTossContainer.bind(null, container), {
259
+ const App = import_react_native7.Granite.registerApp(AppsInTossContainer.bind(null, container), {
1622
260
  appName: getAppName(),
1623
261
  context,
262
+ setIosSwipeGestureEnabled: import_native_modules4.setIosSwipeGestureEnabled,
1624
263
  router: {
1625
264
  screenContainer: import_analytics.Analytics.Screen,
1626
265
  defaultScreenOption: {
@@ -1646,42 +285,49 @@ var AppsInToss = {
1646
285
  };
1647
286
 
1648
287
  // src/components/WebView.tsx
1649
- var import_react_native55 = require("@granite-js/react-native");
288
+ var import_native_modules12 = require("@apps-in-toss/native-modules");
289
+ var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
290
+ var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
291
+ var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
292
+ var import_react_native27 = require("@granite-js/react-native");
1650
293
  var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridges"), 1);
1651
294
  var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
1652
- var import_react_native56 = require("@toss-design-system/react-native");
295
+ var import_react_native28 = require("@toss-design-system/react-native");
1653
296
  var import_private3 = require("@toss-design-system/react-native/private");
1654
297
  var import_react11 = require("react");
1655
- var import_react_native57 = require("react-native");
298
+ var import_react_native29 = require("react-native");
1656
299
 
1657
300
  // src/components/GameWebView.tsx
301
+ var import_native_modules8 = require("@apps-in-toss/native-modules");
1658
302
  var import_react_native_webview = require("@granite-js/native/react-native-webview");
1659
- var import_react_native49 = require("@granite-js/react-native");
1660
- var import_react_native50 = require("@toss-design-system/react-native");
303
+ var import_react_native21 = require("@granite-js/react-native");
304
+ var import_react_native22 = require("@toss-design-system/react-native");
1661
305
  var import_es_hangul2 = require("es-hangul");
1662
306
  var import_react8 = require("react");
1663
- var import_react_native51 = require("react-native");
307
+ var import_react_native23 = require("react-native");
1664
308
 
1665
309
  // src/components/GameProfile.tsx
1666
- var import_react_native42 = require("@toss-design-system/react-native");
310
+ var import_native_modules7 = require("@apps-in-toss/native-modules");
311
+ var import_react_native14 = require("@toss-design-system/react-native");
1667
312
  var import_react7 = require("react");
1668
- var import_react_native43 = require("react-native");
313
+ var import_react_native15 = require("react-native");
1669
314
 
1670
315
  // src/constant/game-center.ts
1671
316
  var GAME_PROFILE_WEBVIEW_URL = "https://service.toss.im/game-center/profile";
1672
- var GAME_CENTER_MIN_VERSION3 = {
317
+ var GAME_CENTER_MIN_VERSION = {
1673
318
  android: "5.221.0",
1674
319
  ios: "5.221.0"
1675
320
  };
1676
321
 
1677
322
  // src/hooks/useGameCenterProfile.ts
1678
- var import_react_native40 = require("@granite-js/react-native");
1679
- var import_react_native41 = require("@toss-design-system/react-native");
323
+ var import_native_modules6 = require("@apps-in-toss/native-modules");
324
+ var import_react_native12 = require("@granite-js/react-native");
325
+ var import_react_native13 = require("@toss-design-system/react-native");
1680
326
  var import_es_hangul = require("es-hangul");
1681
327
  var import_react6 = require("react");
1682
328
 
1683
329
  // src/components/GameProfileToast.tsx
1684
- var import_react_native37 = require("@toss-design-system/react-native");
330
+ var import_react_native9 = require("@toss-design-system/react-native");
1685
331
  var import_private = require("@toss-design-system/react-native/private");
1686
332
  var import_jsx_runtime3 = require("react/jsx-runtime");
1687
333
  var useGameProfileToast = () => {
@@ -1690,7 +336,7 @@ var useGameProfileToast = () => {
1690
336
  return new Promise((resolve) => {
1691
337
  overlay.open(({ isOpen, close, exit }) => {
1692
338
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1693
- import_react_native37.Toast,
339
+ import_react_native9.Toast,
1694
340
  {
1695
341
  open: isOpen,
1696
342
  onClose: () => {
@@ -1701,10 +347,10 @@ var useGameProfileToast = () => {
1701
347
  position: "top",
1702
348
  text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
1703
349
  icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1704
- import_react_native37.Asset.Image,
350
+ import_react_native9.Asset.Image,
1705
351
  {
1706
352
  style: { borderRadius: 64, overflow: "hidden" },
1707
- frameShape: import_react_native37.Asset.frameShape.CleanW32,
353
+ frameShape: import_react_native9.Asset.frameShape.CleanW32,
1708
354
  source: { uri: profileImageUri }
1709
355
  }
1710
356
  )
@@ -1723,18 +369,19 @@ var DEFAULT_ERROR = {
1723
369
  };
1724
370
 
1725
371
  // src/utils/market.ts
1726
- var import_react_native38 = require("react-native");
372
+ var import_react_native10 = require("react-native");
1727
373
  var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
1728
374
  var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
1729
375
  var getMarketLink = () => {
1730
- return import_react_native38.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
376
+ return import_react_native10.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
1731
377
  };
1732
378
 
1733
379
  // src/utils/openTransparentWebView.ts
1734
- var import_react_native39 = require("@granite-js/react-native");
380
+ var import_react_native11 = require("@granite-js/react-native");
1735
381
 
1736
382
  // src/private.ts
1737
- var INTERNAL__onVisibilityChangedByTransparentServiceWeb = onVisibilityChangedByTransparentServiceWeb;
383
+ var import_native_modules5 = require("@apps-in-toss/native-modules");
384
+ var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules5.onVisibilityChangedByTransparentServiceWeb;
1738
385
 
1739
386
  // src/utils/openTransparentWebView.ts
1740
387
  var openTransparentWebView = ({
@@ -1764,7 +411,7 @@ var openTransparentWebView = ({
1764
411
  }
1765
412
  }
1766
413
  });
1767
- (0, import_react_native39.openURL)(url.toString());
414
+ (0, import_react_native11.openURL)(url.toString());
1768
415
  };
1769
416
 
1770
417
  // src/hooks/useGameCenterProfile.ts
@@ -1777,14 +424,14 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
1777
424
  const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
1778
425
  const [isWebviewLoading, setIsWebviewLoading] = (0, import_react6.useState)(false);
1779
426
  const isCompletedProfileFlow = (0, import_react6.useRef)(false);
1780
- const { openAlert, openConfirm } = (0, import_react_native41.useDialog)();
427
+ const { openAlert, openConfirm } = (0, import_react_native13.useDialog)();
1781
428
  const { openGameProfileToast } = useGameProfileToast();
1782
429
  const openErrorAlert = (0, import_react6.useCallback)(async () => {
1783
430
  await openAlert({
1784
431
  title: DEFAULT_ERROR.title,
1785
432
  description: DEFAULT_ERROR.description
1786
433
  });
1787
- (0, import_react_native40.closeView)();
434
+ (0, import_react_native12.closeView)();
1788
435
  }, [openAlert]);
1789
436
  const openProfileWebview = (0, import_react6.useCallback)(() => {
1790
437
  if (isWebviewLoading) {
@@ -1798,7 +445,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
1798
445
  try {
1799
446
  setIsWebviewLoading(false);
1800
447
  setIsProfileDataRefetching(true);
1801
- const data = await getGameCenterGameProfile();
448
+ const data = await (0, import_native_modules6.getGameCenterGameProfile)();
1802
449
  setProfileData(data);
1803
450
  setIsProfileDataRefetching(false);
1804
451
  if (data?.statusCode === "SUCCESS") {
@@ -1829,11 +476,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
1829
476
  closeOnDimmerClick: true
1830
477
  });
1831
478
  if (!isConfirmed) {
1832
- (0, import_react_native40.closeView)();
479
+ (0, import_react_native12.closeView)();
1833
480
  return;
1834
481
  }
1835
482
  const STORE_SCHEME = getMarketLink();
1836
- (0, import_react_native40.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
483
+ (0, import_react_native12.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
1837
484
  }, [openConfirm]);
1838
485
  return {
1839
486
  profileData,
@@ -1881,7 +528,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1881
528
  (0, import_react7.useEffect)(() => {
1882
529
  try {
1883
530
  const getProfileData = async () => {
1884
- const data = await getGameCenterGameProfile();
531
+ const data = await (0, import_native_modules7.getGameCenterGameProfile)();
1885
532
  setProfileData(data);
1886
533
  setIsProfileDataLoading(false);
1887
534
  };
@@ -1900,7 +547,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1900
547
  return;
1901
548
  }
1902
549
  isCompletedProfileFlow.current = true;
1903
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
550
+ if (!(0, import_native_modules7.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1904
551
  updateAppToSupportedMinVersion();
1905
552
  return;
1906
553
  }
@@ -1921,11 +568,11 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1921
568
  profileData,
1922
569
  updateAppToSupportedMinVersion
1923
570
  ]);
1924
- if (!isMinVersionSupported(GAME_CENTER_MIN_VERSION3)) {
571
+ if (!(0, import_native_modules7.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1925
572
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1926
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
573
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native15.View, { style: { flex: 1, position: "relative" }, children }),
1927
574
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1928
- import_react_native43.Pressable,
575
+ import_react_native15.Pressable,
1929
576
  {
1930
577
  style: {
1931
578
  ...overlayStyle
@@ -1939,9 +586,9 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1939
586
  }
1940
587
  if (shouldShowLoadingOverlay || isProfileDataRefetching) {
1941
588
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1942
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
589
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native15.View, { style: { flex: 1, position: "relative" }, children }),
1943
590
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1944
- import_react_native43.View,
591
+ import_react_native15.View,
1945
592
  {
1946
593
  style: {
1947
594
  ...overlayStyle,
@@ -1949,16 +596,16 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1949
596
  alignItems: "center",
1950
597
  backgroundColor: "rgba(0, 0, 0, 0.2)"
1951
598
  },
1952
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native42.Loader, { size: "large", type: "light" })
599
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native14.Loader, { size: "large", type: "light" })
1953
600
  }
1954
601
  )
1955
602
  ] });
1956
603
  }
1957
604
  if (shouldShowProfileNotFoundOverlay) {
1958
605
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1959
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }),
606
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native15.View, { style: { flex: 1, position: "relative" }, children }),
1960
607
  shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1961
- import_react_native43.Pressable,
608
+ import_react_native15.Pressable,
1962
609
  {
1963
610
  style: {
1964
611
  ...overlayStyle
@@ -1970,7 +617,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1970
617
  )
1971
618
  ] });
1972
619
  }
1973
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native43.View, { style: { flex: 1, position: "relative" }, children }) });
620
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native15.View, { style: { flex: 1, position: "relative" }, children }) });
1974
621
  };
1975
622
  var overlayStyle = {
1976
623
  position: "absolute",
@@ -1983,18 +630,18 @@ var overlayStyle = {
1983
630
 
1984
631
  // src/components/GameWebViewNavigationBar/GameNavigationBar.tsx
1985
632
  var import_react_native_svg = require("@granite-js/native/react-native-svg");
1986
- var import_react_native47 = require("@toss-design-system/react-native");
1987
- var import_react_native48 = require("react-native");
633
+ var import_react_native19 = require("@toss-design-system/react-native");
634
+ var import_react_native20 = require("react-native");
1988
635
 
1989
636
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
1990
- var import_react_native45 = require("react-native");
637
+ var import_react_native17 = require("react-native");
1991
638
 
1992
639
  // src/components/GameWebViewNavigationBar/byPlatform.ts
1993
- var import_react_native44 = require("react-native");
640
+ var import_react_native16 = require("react-native");
1994
641
  function byPlatform({
1995
642
  ...props
1996
643
  }) {
1997
- return (props[import_react_native44.Platform.OS] ?? props.fallback)();
644
+ return (props[import_react_native16.Platform.OS] ?? props.fallback)();
1998
645
  }
1999
646
 
2000
647
  // src/components/GameWebViewNavigationBar/constants.ts
@@ -2004,10 +651,10 @@ var IOS_DEFAULT_MARGIN = 20;
2004
651
  // src/components/GameWebViewNavigationBar/HeaderRight.tsx
2005
652
  var import_jsx_runtime5 = require("react/jsx-runtime");
2006
653
  function IOSHeaderRight(props) {
2007
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native45.View, { style: styles.ios, ...props });
654
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native17.View, { style: styles.ios, ...props });
2008
655
  }
2009
656
  function AndroidHeaderRight(props) {
2010
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native45.View, { style: styles.android, ...props });
657
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native17.View, { style: styles.android, ...props });
2011
658
  }
2012
659
  function HeaderRight(props) {
2013
660
  return byPlatform({
@@ -2016,7 +663,7 @@ function HeaderRight(props) {
2016
663
  fallback: () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IOSHeaderRight, { ...props })
2017
664
  });
2018
665
  }
2019
- var styles = import_react_native45.StyleSheet.create({
666
+ var styles = import_react_native17.StyleSheet.create({
2020
667
  ios: {
2021
668
  marginRight: -IOS_DEFAULT_MARGIN + RIGHT_MARGIN,
2022
669
  flexDirection: "row"
@@ -2028,10 +675,10 @@ var styles = import_react_native45.StyleSheet.create({
2028
675
 
2029
676
  // src/components/GameWebViewNavigationBar/useSafeAreaTop.ts
2030
677
  var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
2031
- var import_react_native46 = require("react-native");
678
+ var import_react_native18 = require("react-native");
2032
679
  function useSafeAreaTop() {
2033
680
  const safeAreaInsets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
2034
- const hasDynamicIsland = import_react_native46.Platform.OS === "ios" && safeAreaInsets.top > 50;
681
+ const hasDynamicIsland = import_react_native18.Platform.OS === "ios" && safeAreaInsets.top > 50;
2035
682
  const safeAreaTop = hasDynamicIsland ? safeAreaInsets.top - 5 : safeAreaInsets.top;
2036
683
  return safeAreaTop;
2037
684
  }
@@ -2042,31 +689,31 @@ var originXML = '<svg fill="none" height="30" viewBox="0 0 30 30" width="30" xml
2042
689
  function GameNavigationBar({ onClose }) {
2043
690
  const safeAreaTop = useSafeAreaTop();
2044
691
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2045
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native47.PageNavbar, { preference: { type: "none" } }),
692
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native19.PageNavbar, { preference: { type: "none" } }),
2046
693
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2047
- import_react_native48.View,
694
+ import_react_native20.View,
2048
695
  {
2049
696
  style: {
2050
697
  width: "100%",
2051
- height: import_react_native48.Platform.OS === "ios" ? 44 : 54,
698
+ height: import_react_native20.Platform.OS === "ios" ? 44 : 54,
2052
699
  flexDirection: "row",
2053
700
  alignItems: "center",
2054
701
  justifyContent: "flex-end",
2055
702
  position: "absolute",
2056
703
  zIndex: Z_INDEX.CLOSE_BUTTON,
2057
704
  marginTop: safeAreaTop,
2058
- paddingRight: import_react_native48.Platform.OS === "ios" ? 10 : 8
705
+ paddingRight: import_react_native20.Platform.OS === "ios" ? 10 : 8
2059
706
  },
2060
707
  pointerEvents: "box-none",
2061
708
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(HeaderRight, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2062
- import_react_native48.TouchableOpacity,
709
+ import_react_native20.TouchableOpacity,
2063
710
  {
2064
711
  hitSlop: { left: 8, right: 8 },
2065
712
  accessibilityRole: "button",
2066
713
  accessible: true,
2067
714
  accessibilityLabel: "\uAC8C\uC784\uC885\uB8CC",
2068
715
  style: {
2069
- padding: import_react_native48.Platform.OS === "ios" ? 7 : 9
716
+ padding: import_react_native20.Platform.OS === "ios" ? 7 : 9
2070
717
  },
2071
718
  onPress: onClose,
2072
719
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_svg.SvgXml, { xml: originXML, width: 30, height: 30 })
@@ -2080,7 +727,7 @@ function GameNavigationBar({ onClose }) {
2080
727
  // src/components/GameWebView.tsx
2081
728
  var import_jsx_runtime7 = require("react/jsx-runtime");
2082
729
  var GameWebView = (0, import_react8.forwardRef)(function GameWebView2(props, ref) {
2083
- const { openConfirm } = (0, import_react_native50.useDialog)();
730
+ const { openConfirm } = (0, import_react_native22.useDialog)();
2084
731
  const { brandDisplayName } = getAppsInTossGlobals();
2085
732
  const { captureExitLog } = useCaptureExitLog();
2086
733
  const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react8.useState)(false);
@@ -2093,14 +740,14 @@ var GameWebView = (0, import_react8.forwardRef)(function GameWebView2(props, ref
2093
740
  });
2094
741
  if (isConfirmed) {
2095
742
  captureExitLog(Date.now());
2096
- (0, import_react_native49.closeView)();
743
+ (0, import_react_native21.closeView)();
2097
744
  }
2098
745
  }, [brandDisplayName, captureExitLog, openConfirm]);
2099
746
  (0, import_react8.useEffect)(() => {
2100
- if (import_react_native51.Platform.OS === "ios") {
2101
- setIosSwipeGestureEnabled({ isEnabled: false });
747
+ if (import_react_native23.Platform.OS === "ios") {
748
+ (0, import_native_modules8.setIosSwipeGestureEnabled)({ isEnabled: false });
2102
749
  return () => {
2103
- setIosSwipeGestureEnabled({ isEnabled: true });
750
+ (0, import_native_modules8.setIosSwipeGestureEnabled)({ isEnabled: true });
2104
751
  };
2105
752
  }
2106
753
  return;
@@ -2110,13 +757,13 @@ var GameWebView = (0, import_react8.forwardRef)(function GameWebView2(props, ref
2110
757
  handleClose();
2111
758
  return true;
2112
759
  };
2113
- import_react_native51.BackHandler.addEventListener("hardwareBackPress", backHandler);
760
+ import_react_native23.BackHandler.addEventListener("hardwareBackPress", backHandler);
2114
761
  return () => {
2115
- import_react_native51.BackHandler.removeEventListener("hardwareBackPress", backHandler);
762
+ import_react_native23.BackHandler.removeEventListener("hardwareBackPress", backHandler);
2116
763
  };
2117
764
  }, [handleClose]);
2118
765
  (0, import_react8.useEffect)(() => {
2119
- appsInTossEvent.addEventListener("entryMessageExited", {
766
+ import_native_modules8.appsInTossEvent.addEventListener("entryMessageExited", {
2120
767
  onEvent: () => {
2121
768
  setIsEntryMessageExited(true);
2122
769
  }
@@ -2124,7 +771,7 @@ var GameWebView = (0, import_react8.forwardRef)(function GameWebView2(props, ref
2124
771
  }, []);
2125
772
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2126
773
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GameNavigationBar, { onClose: handleClose }),
2127
- getOperationalEnvironment() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props })
774
+ (0, import_native_modules8.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_webview.WebView, { ref, ...props })
2128
775
  ] });
2129
776
  });
2130
777
 
@@ -2256,7 +903,8 @@ function useBridgeHandler({
2256
903
  }
2257
904
 
2258
905
  // src/hooks/useCreateUserAgent.ts
2259
- var import_react_native52 = require("react-native");
906
+ var import_native_modules9 = require("@apps-in-toss/native-modules");
907
+ var import_react_native24 = require("react-native");
2260
908
  var FontA11yCategory = {
2261
909
  Large: "Large",
2262
910
  xLarge: "xLarge",
@@ -2389,9 +1037,9 @@ function useCreateUserAgent({
2389
1037
  safeArea,
2390
1038
  safeAreaBottomTransparency
2391
1039
  }) {
2392
- const platform = getPlatformOS();
2393
- const appVersion = getTossAppVersion();
2394
- const { fontScale } = (0, import_react_native52.useWindowDimensions)();
1040
+ const platform = (0, import_native_modules9.getPlatformOS)();
1041
+ const appVersion = (0, import_native_modules9.getTossAppVersion)();
1042
+ const { fontScale } = (0, import_react_native24.useWindowDimensions)();
2395
1043
  const platformString = platform === "ios" ? "iPhone" : "Android";
2396
1044
  const fontA11y = mapFontScaleToCategory(fontScale, platform);
2397
1045
  const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
@@ -2411,16 +1059,17 @@ function useCreateUserAgent({
2411
1059
  }
2412
1060
 
2413
1061
  // src/hooks/useGeolocation.ts
2414
- var import_react_native53 = require("@granite-js/react-native");
1062
+ var import_native_modules10 = require("@apps-in-toss/native-modules");
1063
+ var import_react_native25 = require("@granite-js/react-native");
2415
1064
  var import_react10 = require("react");
2416
1065
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2417
- const isVisible = (0, import_react_native53.useVisibility)();
1066
+ const isVisible = (0, import_react_native25.useVisibility)();
2418
1067
  const [location, setLocation] = (0, import_react10.useState)(null);
2419
1068
  (0, import_react10.useEffect)(() => {
2420
1069
  if (!isVisible) {
2421
1070
  return;
2422
1071
  }
2423
- return startUpdateLocation({
1072
+ return (0, import_native_modules10.startUpdateLocation)({
2424
1073
  options: {
2425
1074
  accuracy,
2426
1075
  distanceInterval,
@@ -2434,7 +1083,8 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2434
1083
  }
2435
1084
 
2436
1085
  // src/utils/log.ts
2437
- var import_react_native54 = require("@granite-js/react-native");
1086
+ var import_native_modules11 = require("@apps-in-toss/native-modules");
1087
+ var import_react_native26 = require("@granite-js/react-native");
2438
1088
 
2439
1089
  // src/utils/extractDateFromUUIDv7.ts
2440
1090
  var extractDateFromUUIDv7 = (uuid) => {
@@ -2460,7 +1110,7 @@ var getGroupId = (url) => {
2460
1110
  };
2461
1111
  var getReferrer = () => {
2462
1112
  try {
2463
- const referrer = new URL((0, import_react_native54.getSchemeUri)());
1113
+ const referrer = new URL((0, import_react_native26.getSchemeUri)());
2464
1114
  return referrer.searchParams.get("referrer");
2465
1115
  } catch {
2466
1116
  return "";
@@ -2478,22 +1128,22 @@ var trackScreen = (url) => {
2478
1128
  deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
2479
1129
  }
2480
1130
  };
2481
- return eventLog(log);
1131
+ return (0, import_native_modules11.eventLog)(log);
2482
1132
  };
2483
1133
 
2484
1134
  // src/components/WebView.tsx
2485
1135
  var import_jsx_runtime8 = require("react/jsx-runtime");
2486
1136
  var appsInTossGlobals = getAppsInTossGlobals();
2487
- var operationalEnvironment = getOperationalEnvironment2();
1137
+ var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
2488
1138
  var TYPES = ["partner", "external", "game"];
2489
1139
  var WEBVIEW_TYPES = {
2490
- partner: import_react_native56.PartnerWebViewScreen,
2491
- external: import_react_native56.ExternalWebViewScreen,
1140
+ partner: import_react_native28.PartnerWebViewScreen,
1141
+ external: import_react_native28.ExternalWebViewScreen,
2492
1142
  game: GameWebView
2493
1143
  };
2494
1144
  function mergeSchemeQueryParamsInto(url) {
2495
1145
  const baseUrl = new URL(url);
2496
- const schemeUrl = new URL((0, import_react_native55.getSchemeUri)());
1146
+ const schemeUrl = new URL((0, import_react_native27.getSchemeUri)());
2497
1147
  baseUrl.pathname = schemeUrl.pathname;
2498
1148
  for (const [key, value] of schemeUrl.searchParams.entries()) {
2499
1149
  baseUrl.searchParams.set(key, value);
@@ -2505,7 +1155,7 @@ function getWebViewUri(local) {
2505
1155
  const devUrl = `http://${local.host}:${local.port}`;
2506
1156
  return mergeSchemeQueryParamsInto(devUrl).toString();
2507
1157
  }
2508
- const { url: rawUrl } = AppsInTossModule.getWebBundleURL({});
1158
+ const { url: rawUrl } = import_native_modules12.AppsInTossModule.getWebBundleURL({});
2509
1159
  const url = mergeSchemeQueryParamsInto(rawUrl);
2510
1160
  const deploymentId = env.getDeploymentId();
2511
1161
  if (deploymentId) {
@@ -2517,12 +1167,12 @@ function WebView({ type, local, onMessage, ...props }) {
2517
1167
  if (!TYPES.includes(type)) {
2518
1168
  throw new Error(`Invalid WebView type: '${type}'`);
2519
1169
  }
2520
- const graniteEvent = (0, import_react_native55.useGraniteEvent)();
1170
+ const graniteEvent = (0, import_react_native27.useGraniteEvent)();
2521
1171
  const uri = (0, import_react11.useMemo)(() => getWebViewUri(local), [local]);
2522
1172
  const top = (0, import_private3.useSafeAreaTop)();
2523
1173
  const bottom = (0, import_private3.useSafeAreaBottom)();
2524
1174
  const global2 = getAppsInTossGlobals();
2525
- const partner = (0, import_react_native56.usePartnerNavigation)();
1175
+ const partner = (0, import_react_native28.usePartnerNavigation)();
2526
1176
  const disableTextSelectionCSS = `
2527
1177
  (function() {
2528
1178
  const style = document.createElement('style');
@@ -2538,55 +1188,55 @@ function WebView({ type, local, onMessage, ...props }) {
2538
1188
  injectedJavaScript: [disableTextSelectionCSS].join("\n"),
2539
1189
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2540
1190
  eventListenerMap: {
2541
- ...event_bridges_exports,
2542
- navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native56.tdsEvent.addEventListener("navigationAccessoryEvent", {
1191
+ ...appsInTossEventBridges,
1192
+ navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native28.tdsEvent.addEventListener("navigationAccessoryEvent", {
2543
1193
  onEvent,
2544
1194
  onError
2545
1195
  }),
2546
1196
  backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
2547
- entryMessageExited: ({ onEvent, onError }) => appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
2548
- updateLocationEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1197
+ entryMessageExited: ({ onEvent, onError }) => import_native_modules12.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
1198
+ updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules12.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
2549
1199
  /** @internal */
2550
- appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
1200
+ appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules12.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
2551
1201
  /** AdMob */
2552
- loadAdMobInterstitialAd: GoogleAdMob.loadAdMobInterstitialAd,
2553
- showAdMobInterstitialAd: GoogleAdMob.showAdMobInterstitialAd,
2554
- loadAdMobRewardedAd: GoogleAdMob.loadAdMobRewardedAd,
2555
- showAdMobRewardedAd: GoogleAdMob.showAdMobRewardedAd
1202
+ loadAdMobInterstitialAd: import_native_modules12.GoogleAdMob.loadAdMobInterstitialAd,
1203
+ showAdMobInterstitialAd: import_native_modules12.GoogleAdMob.showAdMobInterstitialAd,
1204
+ loadAdMobRewardedAd: import_native_modules12.GoogleAdMob.loadAdMobRewardedAd,
1205
+ showAdMobRewardedAd: import_native_modules12.GoogleAdMob.showAdMobRewardedAd
2556
1206
  },
2557
1207
  constantHandlerMap: {
2558
1208
  ...graniteConstantBridges,
2559
- ...constant_bridges_exports,
1209
+ ...appsInTossConstantBridges,
2560
1210
  getSafeAreaTop: () => top,
2561
1211
  getSafeAreaBottom: () => bottom,
2562
1212
  ...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
2563
1213
  /** AdMob */
2564
- loadAdMobInterstitialAd_isSupported: GoogleAdMob.loadAdMobInterstitialAd.isSupported,
2565
- showAdMobInterstitialAd_isSupported: GoogleAdMob.showAdMobInterstitialAd.isSupported,
2566
- loadAdMobRewardedAd_isSupported: GoogleAdMob.loadAdMobRewardedAd.isSupported,
2567
- showAdMobRewardedAd_isSupported: GoogleAdMob.showAdMobRewardedAd.isSupported,
1214
+ loadAdMobInterstitialAd_isSupported: import_native_modules12.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
1215
+ showAdMobInterstitialAd_isSupported: import_native_modules12.GoogleAdMob.showAdMobInterstitialAd.isSupported,
1216
+ loadAdMobRewardedAd_isSupported: import_native_modules12.GoogleAdMob.loadAdMobRewardedAd.isSupported,
1217
+ showAdMobRewardedAd_isSupported: import_native_modules12.GoogleAdMob.showAdMobRewardedAd.isSupported,
2568
1218
  /** env */
2569
1219
  getDeploymentId: env.getDeploymentId
2570
1220
  },
2571
1221
  asyncHandlerMap: {
2572
1222
  ...graniteAsyncBridges,
2573
- ...async_bridges_exports,
1223
+ ...appsInTossAsyncBridges,
2574
1224
  setIosSwipeGestureEnabled: (options) => {
2575
1225
  setAllowsBackForwardNavigationGestures(options.isEnabled);
2576
- return setIosSwipeGestureEnabled2(options);
1226
+ return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
2577
1227
  },
2578
1228
  addAccessoryButton: async (params) => partner.addAccessoryButton(params),
2579
1229
  removeAccessoryButton: async () => partner.removeAccessoryButton(),
2580
1230
  /** internal */
2581
- openPermissionDialog: AppsInTossModule.openPermissionDialog,
1231
+ openPermissionDialog: import_native_modules12.AppsInTossModule.openPermissionDialog,
2582
1232
  /** Storage */
2583
- getStorageItem: Storage.getItem,
2584
- setStorageItem: Storage.setItem,
2585
- removeStorageItem: Storage.removeItem,
2586
- clearItems: Storage.clearItems,
1233
+ getStorageItem: import_native_modules12.Storage.getItem,
1234
+ setStorageItem: import_native_modules12.Storage.setItem,
1235
+ removeStorageItem: import_native_modules12.Storage.removeItem,
1236
+ clearItems: import_native_modules12.Storage.clearItems,
2587
1237
  /** IAP */
2588
- iapCreateOneTimePurchaseOrder: IAP.createOneTimePurchaseOrder,
2589
- iapGetProductItemList: IAP.getProductItemList
1238
+ iapCreateOneTimePurchaseOrder: import_native_modules12.IAP.createOneTimePurchaseOrder,
1239
+ iapGetProductItemList: import_native_modules12.IAP.getProductItemList
2590
1240
  }
2591
1241
  });
2592
1242
  const baseProps = (0, import_react11.useMemo)(() => {
@@ -2640,8 +1290,8 @@ function WebView({ type, local, onMessage, ...props }) {
2640
1290
  }
2641
1291
  }, [canHistoryGoBack, handler]);
2642
1292
  (0, import_react11.useEffect)(() => {
2643
- import_react_native57.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
2644
- return () => import_react_native57.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
1293
+ import_react_native29.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
1294
+ return () => import_react_native29.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
2645
1295
  }, [handleBackEvent]);
2646
1296
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2647
1297
  BaseWebView,
@@ -2656,7 +1306,7 @@ function WebView({ type, local, onMessage, ...props }) {
2656
1306
  "User-Agent": userAgent
2657
1307
  }
2658
1308
  },
2659
- userAgent: import_react_native57.Platform.OS === "ios" ? userAgent : void 0,
1309
+ userAgent: import_react_native29.Platform.OS === "ios" ? userAgent : void 0,
2660
1310
  sharedCookiesEnabled: true,
2661
1311
  webviewDebuggingEnabled: webViewDebuggingEnabled,
2662
1312
  thirdPartyCookiesEnabled: true,
@@ -2664,7 +1314,7 @@ function WebView({ type, local, onMessage, ...props }) {
2664
1314
  onNavigationStateChange: handleNavigationStateChange,
2665
1315
  injectedJavaScript: handler.injectedJavaScript,
2666
1316
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
2667
- decelerationRate: import_react_native57.Platform.OS === "ios" ? 1 : void 0,
1317
+ decelerationRate: import_react_native29.Platform.OS === "ios" ? 1 : void 0,
2668
1318
  allowsBackForwardNavigationGestures
2669
1319
  }
2670
1320
  );
@@ -2678,6 +1328,7 @@ function ensureValue(value, name) {
2678
1328
 
2679
1329
  // src/index.ts
2680
1330
  __reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
1331
+ __reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
2681
1332
  var Analytics2 = {
2682
1333
  init: import_analytics2.Analytics.init,
2683
1334
  Impression: import_analytics2.Analytics.Impression,
@@ -2686,55 +1337,13 @@ var Analytics2 = {
2686
1337
  };
2687
1338
  // Annotate the CommonJS export names for ESM import in node:
2688
1339
  0 && (module.exports = {
2689
- Accuracy,
2690
1340
  Analytics,
2691
1341
  AppsInToss,
2692
- AppsInTossModule,
2693
- BedrockCoreModule,
2694
- BedrockModule,
2695
- GoogleAdMob,
2696
- IAP,
2697
- INTERNAL__AppsInTossModule,
2698
- INTERNAL__module,
2699
1342
  INTERNAL__onVisibilityChangedByTransparentServiceWeb,
2700
- Storage,
2701
- TossPay,
2702
1343
  WebView,
2703
- appLogin,
2704
- appsInTossEvent,
2705
- closeView,
2706
- contactsViral,
2707
1344
  env,
2708
- eventLog,
2709
- fetchAlbumPhotos,
2710
- fetchContacts,
2711
- generateHapticFeedback,
2712
- getClipboardText,
2713
- getCurrentLocation,
2714
- getDeviceId,
2715
- getGameCenterGameProfile,
2716
- getLocale,
2717
- getNetworkStatus,
2718
- getOperationalEnvironment,
2719
- getPlatformOS,
2720
- getSchemeUri,
2721
- getTossAppVersion,
2722
- getTossShareLink,
2723
- isMinVersionSupported,
2724
- onVisibilityChangedByTransparentServiceWeb,
2725
- openCamera,
2726
- openGameCenterLeaderboard,
2727
- openURL,
2728
- saveBase64Data,
2729
- setClipboardText,
2730
- setDeviceOrientation,
2731
- setIosSwipeGestureEnabled,
2732
- setScreenAwakeMode,
2733
- setSecureScreen,
2734
- share,
2735
- startUpdateLocation,
2736
- submitGameCenterLeaderBoardScore,
2737
1345
  useCreateUserAgent,
2738
1346
  useGeolocation,
2739
- ...require("@apps-in-toss/analytics")
1347
+ ...require("@apps-in-toss/analytics"),
1348
+ ...require("@apps-in-toss/native-modules")
2740
1349
  });