@apps-in-toss/framework 1.1.3 → 1.2.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
@@ -34,21 +34,24 @@ __export(src_exports, {
34
34
  Analytics: () => Analytics2,
35
35
  AppsInToss: () => AppsInToss,
36
36
  INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
37
+ OverlayProvider: () => import_private9.OverlayProvider,
37
38
  WebView: () => WebView,
38
39
  env: () => env,
39
40
  useCreateUserAgent: () => useCreateUserAgent,
40
41
  useGeolocation: () => useGeolocation,
41
- useTopNavigation: () => import_private8.useTopNavigation
42
+ useOverlay: () => import_private9.useOverlay,
43
+ useTopNavigation: () => import_private9.useTopNavigation,
44
+ useWaitForReturnNavigator: () => useWaitForReturnNavigator
42
45
  });
43
46
  module.exports = __toCommonJS(src_exports);
44
47
  var import_analytics2 = require("@apps-in-toss/analytics");
45
48
 
46
49
  // src/core/registerApp.tsx
47
50
  var import_analytics = require("@apps-in-toss/analytics");
48
- var import_native_modules8 = require("@apps-in-toss/native-modules");
49
- var import_react_native17 = require("@granite-js/react-native");
50
- var import_react_native18 = require("@toss-design-system/react-native");
51
- var import_react_native19 = require("react-native");
51
+ var import_native_modules9 = require("@apps-in-toss/native-modules");
52
+ var import_react_native15 = require("@granite-js/react-native");
53
+ var import_tds_react_native6 = require("@toss/tds-react-native");
54
+ var import_react_native16 = require("react-native");
52
55
 
53
56
  // src/core/components/AppEvent.tsx
54
57
  var import_native_modules2 = require("@apps-in-toss/native-modules");
@@ -193,7 +196,7 @@ function AppUpdate() {
193
196
 
194
197
  // src/core/hooks/useAppsInTossBridge.ts
195
198
  var import_native_modules3 = require("@apps-in-toss/native-modules");
196
- var import_react_native6 = require("@toss-design-system/react-native");
199
+ var import_tds_react_native = require("@toss/tds-react-native");
197
200
  var import_react5 = require("react");
198
201
 
199
202
  // src/core/utils/getAppsInTossGlobals.ts
@@ -211,7 +214,7 @@ function toIcon(source) {
211
214
 
212
215
  // src/core/hooks/useAppsInTossBridge.ts
213
216
  function useAppsInTossBridge() {
214
- const controller = (0, import_react_native6.useBridge)();
217
+ const controller = (0, import_tds_react_native.useBridge)();
215
218
  const appsInTossGlobals = getAppsInTossGlobals();
216
219
  (0, import_react5.useEffect)(() => {
217
220
  const commonProps = {
@@ -230,19 +233,19 @@ function useAppsInTossBridge() {
230
233
  }
231
234
 
232
235
  // src/components/NavigationBar/RNNavigationBar.tsx
233
- var import_react_native14 = require("@granite-js/react-native");
234
- var import_react_native15 = require("@toss-design-system/react-native");
235
- var import_private2 = require("@toss-design-system/react-native/private");
236
+ var import_react_native13 = require("@granite-js/react-native");
237
+ var import_tds_react_native5 = require("@toss/tds-react-native");
238
+ var import_private3 = require("@toss/tds-react-native/private");
236
239
  var import_es_hangul = require("es-hangul");
237
240
  var import_react9 = require("react");
238
- var import_react_native16 = require("react-native");
241
+ var import_react_native14 = require("react-native");
239
242
 
240
243
  // src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
241
244
  var import_react6 = require("react");
242
245
 
243
246
  // src/components/NavigationBar/common/useNavigationBarLogging.tsx
244
247
  var import_native_modules4 = require("@apps-in-toss/native-modules");
245
- var import_react_native7 = require("@granite-js/react-native");
248
+ var import_react_native6 = require("@granite-js/react-native");
246
249
  var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
247
250
  var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
248
251
  var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
@@ -257,7 +260,7 @@ function useNavigationBarLogging() {
257
260
  const referrer = useReferrer();
258
261
  const baseParams = {
259
262
  referrer,
260
- app_name: import_react_native7.Granite.appName
263
+ app_name: import_react_native6.Granite.appName
261
264
  };
262
265
  const logNavBarImpression = (naviBarConfig) => {
263
266
  import_native_modules4.INTERNAL__module.tossCoreEventLog({
@@ -342,15 +345,22 @@ function NavigationBarImpressionArea({
342
345
  }
343
346
 
344
347
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
345
- var import_native_modules7 = require("@apps-in-toss/native-modules");
348
+ var import_native_modules8 = require("@apps-in-toss/native-modules");
346
349
  var import_react_native12 = require("@granite-js/react-native");
347
- var import_react_native13 = require("@toss-design-system/react-native");
348
- var import_private = require("@toss-design-system/react-native/private");
350
+ var import_tds_react_native4 = require("@toss/tds-react-native");
351
+ var import_private2 = require("@toss/tds-react-native/private");
349
352
  var import_react8 = require("react");
350
353
 
354
+ // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
355
+ var import_native_modules6 = require("@apps-in-toss/native-modules");
356
+ var import_react_native8 = require("@granite-js/react-native");
357
+ var import_tds_react_native2 = require("@toss/tds-react-native");
358
+ var import_private = require("@toss/tds-react-native/private");
359
+ var import_react_native9 = require("react-native");
360
+
351
361
  // src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
352
362
  var import_native_modules5 = require("@apps-in-toss/native-modules");
353
- var import_react_native8 = require("@granite-js/react-native");
363
+ var import_react_native7 = require("@granite-js/react-native");
354
364
  var BOTTOM_SHEET_SCHEMA_ID = 1596825;
355
365
  var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
356
366
  var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
@@ -363,7 +373,7 @@ function useMoreButtonBottomSheetLogging() {
363
373
  const referrer = useReferrer();
364
374
  const baseParams = {
365
375
  referrer,
366
- app_name: import_react_native8.Granite.appName
376
+ app_name: import_react_native7.Granite.appName
367
377
  };
368
378
  const logBottomSheetShow = () => {
369
379
  import_native_modules5.INTERNAL__module.tossCoreEventLog({
@@ -417,23 +427,90 @@ function useMoreButtonBottomSheetLogging() {
417
427
  };
418
428
  }
419
429
 
430
+ // src/core/utils/url.ts
431
+ function addParamsToUrl(url, params) {
432
+ const urlObj = new URL(url);
433
+ for (const [key, value] of Object.entries(params)) {
434
+ urlObj.searchParams.set(key, value);
435
+ }
436
+ return urlObj.toString();
437
+ }
438
+
439
+ // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
440
+ var import_jsx_runtime3 = require("react/jsx-runtime");
441
+ var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
442
+ var APP_SHARE_MENU_INFO = {
443
+ contactItemName: "\uACF5\uC720\uD558\uAE30",
444
+ contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
445
+ };
446
+ function AppShareListMenu() {
447
+ const globals = getAppsInTossGlobals();
448
+ const adaptive = (0, import_private.useAdaptive)();
449
+ const logging = useMoreButtonBottomSheetLogging();
450
+ const initialScheme = (0, import_react_native8.getSchemeUri)();
451
+ const isSandbox = (0, import_native_modules6.getOperationalEnvironment)() === "sandbox";
452
+ const { openConfirm } = (0, import_tds_react_native2.useDialog)();
453
+ const schemeForShare = addParamsToUrl(initialScheme, {
454
+ referrer: SHARE_SCHEME_REFERRER
455
+ });
456
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
457
+ import_tds_react_native2.ListRow,
458
+ {
459
+ left: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
460
+ import_tds_react_native2.ListRow.Icon,
461
+ {
462
+ color: globals.brandPrimaryColor,
463
+ source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
464
+ type: "background"
465
+ }
466
+ ),
467
+ contents: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
468
+ import_tds_react_native2.ListRow.Texts,
469
+ {
470
+ type: "1RowTypeA",
471
+ top: APP_SHARE_MENU_INFO.contactItemName,
472
+ topProps: { color: adaptive.grey700 }
473
+ }
474
+ ),
475
+ verticalPadding: "extraSmall",
476
+ onPress: () => {
477
+ if (isSandbox) {
478
+ openConfirm({
479
+ title: "\uACF5\uC720\uD558\uAE30 \uAE30\uB2A5 \uBBF8\uC9C0\uC6D0",
480
+ description: "\uC0CC\uB4DC\uBC15\uC2A4 \uD658\uACBD\uC5D0\uC11C\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4\uC694. \uCF58\uC194\uC744 \uD1B5\uD574 \uD1A0\uC2A4\uC571\uC5D0\uC11C \uD14C\uC2A4\uD2B8\uD574 \uC8FC\uC138\uC694.",
481
+ rightButton: "\uD655\uC778",
482
+ closeOnDimmerClick: true
483
+ });
484
+ return;
485
+ }
486
+ logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
487
+ import_react_native9.NativeModules.AppsInTossModule.shareWithScheme({
488
+ params: {
489
+ schemeURL: schemeForShare
490
+ }
491
+ });
492
+ }
493
+ }
494
+ );
495
+ }
496
+
420
497
  // src/hooks/useAppUpdateDialog.tsx
421
- var import_native_modules6 = require("@apps-in-toss/native-modules");
422
- var import_react_native10 = require("@granite-js/react-native");
423
- var import_react_native11 = require("@toss-design-system/react-native");
498
+ var import_native_modules7 = require("@apps-in-toss/native-modules");
499
+ var import_react_native11 = require("@granite-js/react-native");
500
+ var import_tds_react_native3 = require("@toss/tds-react-native");
424
501
  var import_react7 = require("react");
425
502
 
426
503
  // src/utils/market.ts
427
- var import_react_native9 = require("react-native");
504
+ var import_react_native10 = require("react-native");
428
505
  var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
429
506
  var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
430
507
  var getMarketLink = () => {
431
- return import_react_native9.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
508
+ return import_react_native10.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
432
509
  };
433
510
 
434
511
  // src/hooks/useAppUpdateDialog.tsx
435
512
  function useAppUpdateDialog() {
436
- const { openConfirm } = (0, import_react_native11.useDialog)();
513
+ const { openConfirm } = (0, import_tds_react_native3.useDialog)();
437
514
  const logging = useAppUpdateDialogLogging();
438
515
  const openAppUpdateDialog = (0, import_react7.useCallback)(
439
516
  async ({
@@ -456,7 +533,7 @@ function useAppUpdateDialog() {
456
533
  }
457
534
  logging.update();
458
535
  const STORE_SCHEME = getMarketLink();
459
- (0, import_react_native10.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
536
+ (0, import_react_native11.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
460
537
  },
461
538
  [logging, openConfirm]
462
539
  );
@@ -472,10 +549,10 @@ function useAppUpdateDialogLogging() {
472
549
  const referrer = useReferrer();
473
550
  const baseParams = {
474
551
  referrer,
475
- app_name: import_react_native10.Granite.appName
552
+ app_name: import_react_native11.Granite.appName
476
553
  };
477
554
  const logUpdateClick = () => {
478
- import_native_modules6.INTERNAL__module.tossCoreEventLog({
555
+ import_native_modules7.INTERNAL__module.tossCoreEventLog({
479
556
  log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
480
557
  log_type: "event",
481
558
  params: {
@@ -487,7 +564,7 @@ function useAppUpdateDialogLogging() {
487
564
  });
488
565
  };
489
566
  const logCloseClick = () => {
490
- import_native_modules6.INTERNAL__module.tossCoreEventLog({
567
+ import_native_modules7.INTERNAL__module.tossCoreEventLog({
491
568
  log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
492
569
  log_type: "event",
493
570
  params: {
@@ -499,7 +576,7 @@ function useAppUpdateDialogLogging() {
499
576
  });
500
577
  };
501
578
  const logDialogShow = () => {
502
- import_native_modules6.INTERNAL__module.tossCoreEventLog({
579
+ import_native_modules7.INTERNAL__module.tossCoreEventLog({
503
580
  log_name: UPDATE_DIALOG_LOG_NAME,
504
581
  log_type: "popup",
505
582
  params: {
@@ -520,25 +597,33 @@ function ensureValue(value, name) {
520
597
  }
521
598
 
522
599
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
523
- var import_jsx_runtime3 = require("react/jsx-runtime");
600
+ var import_jsx_runtime4 = require("react/jsx-runtime");
524
601
  var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
602
+ var MIN_VERSION = {
603
+ BOTTOM_SHEET: {
604
+ android: "5.226.0",
605
+ ios: "5.226.0"
606
+ },
607
+ SHARE_LIST_MENU: {
608
+ android: "5.230.0",
609
+ ios: "5.230.0"
610
+ }
611
+ };
525
612
  function useMoreButtonBottomSheet() {
526
613
  const globals = getAppsInTossGlobals();
527
- const adaptive = (0, import_private.useAdaptive)();
614
+ const adaptive = (0, import_private2.useAdaptive)();
528
615
  const [itemList, setItemList] = (0, import_react8.useState)([]);
529
616
  const appUpdateDialog = useAppUpdateDialog();
530
617
  const logging = useMoreButtonBottomSheetLogging();
531
- const overlay = (0, import_private.useOverlay)();
618
+ const overlay = (0, import_private2.useOverlay)();
532
619
  const title = ensureValue(globals.brandDisplayName, "displayName");
533
- const isSupported = (0, import_native_modules7.isMinVersionSupported)({
534
- android: "5.226.0",
535
- ios: "5.226.0"
536
- });
620
+ const isBottomSheetSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
621
+ const isShareListMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
537
622
  (0, import_react8.useEffect)(() => {
538
- if (!isSupported) {
623
+ if (!isBottomSheetSupported) {
539
624
  return;
540
625
  }
541
- import_native_modules7.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
626
+ import_native_modules8.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
542
627
  APP_BRIDGE_METHOD_NAME,
543
628
  {},
544
629
  {
@@ -546,10 +631,10 @@ function useMoreButtonBottomSheet() {
546
631
  onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
547
632
  }
548
633
  );
549
- }, [isSupported]);
634
+ }, [isBottomSheetSupported]);
550
635
  const onClickHandler = async () => {
551
636
  logging.open();
552
- if (!isSupported) {
637
+ if (!isBottomSheetSupported) {
553
638
  await appUpdateDialog.open({
554
639
  title: `\uC774 \uAE30\uB2A5\uC744 \uC4F0\uB824\uBA74 \uC571 \uC5C5\uB370\uC774\uD2B8\uAC00 \uD544\uC694\uD574\uC694`,
555
640
  description: `\uBB38\uC758, \uAD8C\uD55C \uC124\uC815, \uC2E0\uACE0 \uB4F1 \uAE30\uB2A5\uC744 \uC4F8 \uC218 \uC788\uC5B4\uC694`
@@ -561,18 +646,18 @@ function useMoreButtonBottomSheet() {
561
646
  logging.close();
562
647
  close();
563
648
  };
564
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
565
- import_react_native13.BottomSheet.Root,
649
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
650
+ import_tds_react_native4.BottomSheet.Root,
566
651
  {
567
- header: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
568
- import_react_native13.ListHeader,
652
+ header: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
653
+ import_tds_react_native4.ListHeader,
569
654
  {
570
- title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native13.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
655
+ title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tds_react_native4.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
571
656
  }
572
657
  ),
573
658
  open: isOpen,
574
- cta: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
575
- import_react_native13.BottomSheet.CTA,
659
+ cta: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
660
+ import_tds_react_native4.BottomSheet.CTA,
576
661
  {
577
662
  size: "large",
578
663
  type: "dark",
@@ -585,35 +670,38 @@ function useMoreButtonBottomSheet() {
585
670
  ),
586
671
  onClose: handleClose,
587
672
  onExited: exit,
588
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native13.List, { rowSeparator: "none", children: itemList.map((item) => {
589
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
590
- import_react_native13.ListRow,
591
- {
592
- left: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
593
- import_react_native13.ListRow.Icon,
594
- {
595
- color: globals.brandPrimaryColor,
596
- source: { uri: item.contactIconUrl },
597
- type: "background"
598
- }
599
- ),
600
- contents: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
601
- import_react_native13.ListRow.Texts,
602
- {
603
- type: "1RowTypeA",
604
- top: item.contactItemName,
605
- topProps: { color: adaptive.grey700 }
673
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_tds_react_native4.List, { rowSeparator: "none", children: [
674
+ itemList.map((item) => {
675
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
676
+ import_tds_react_native4.ListRow,
677
+ {
678
+ left: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
679
+ import_tds_react_native4.ListRow.Icon,
680
+ {
681
+ color: globals.brandPrimaryColor,
682
+ source: { uri: item.contactIconUrl },
683
+ type: "background"
684
+ }
685
+ ),
686
+ contents: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
687
+ import_tds_react_native4.ListRow.Texts,
688
+ {
689
+ type: "1RowTypeA",
690
+ top: item.contactItemName,
691
+ topProps: { color: adaptive.grey700 }
692
+ }
693
+ ),
694
+ verticalPadding: "extraSmall",
695
+ onPress: () => {
696
+ logging.menuClick({ title: item.contactItemName });
697
+ (0, import_react_native12.openURL)(item.contactUri);
606
698
  }
607
- ),
608
- verticalPadding: "extraSmall",
609
- onPress: () => {
610
- logging.menuClick({ title: item.contactItemName });
611
- (0, import_react_native12.openURL)(item.contactUri);
612
- }
613
- },
614
- item.contactItemName
615
- );
616
- }) })
699
+ },
700
+ item.contactItemName
701
+ );
702
+ }),
703
+ isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AppShareListMenu, {})
704
+ ] })
617
705
  }
618
706
  ) });
619
707
  });
@@ -625,7 +713,7 @@ function BottomSheetImpressionArea({ children }) {
625
713
  (0, import_react8.useEffect)(() => {
626
714
  logging.show();
627
715
  }, [logging]);
628
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
716
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
629
717
  }
630
718
 
631
719
  // src/core/utils/safeParseNavigationBar.ts
@@ -641,20 +729,20 @@ function safeParseNavigationBar(navigationBar) {
641
729
  }
642
730
 
643
731
  // src/components/NavigationBar/RNNavigationBar.tsx
644
- var import_jsx_runtime4 = require("react/jsx-runtime");
732
+ var import_jsx_runtime5 = require("react/jsx-runtime");
645
733
  function RNNavigationBar() {
646
734
  const globals = getAppsInTossGlobals();
647
735
  const { captureExitLog } = useCaptureExitLog();
648
736
  const logging = useNavigationBarLogging();
649
- const { openConfirm } = (0, import_react_native15.useDialog)();
737
+ const { openConfirm } = (0, import_tds_react_native5.useDialog)();
650
738
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
651
739
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
652
740
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
653
741
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
654
742
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
655
- const backEventContext = (0, import_react_native14.useBackEventContext)();
743
+ const backEventContext = (0, import_react_native13.useBackEventContext)();
656
744
  const handleBackOrClose = useBackOrCloseNavigation();
657
- const navigation = (0, import_react_native14.useNavigation)();
745
+ const navigation = (0, import_react_native13.useNavigation)();
658
746
  const handlePressTitle = (0, import_react9.useCallback)(() => {
659
747
  logging.homeButtonClick();
660
748
  navigation.navigate("/");
@@ -671,7 +759,7 @@ function RNNavigationBar() {
671
759
  logging.closePopupCtaClick(isConfirmed);
672
760
  if (isConfirmed) {
673
761
  captureExitLog(Date.now());
674
- (0, import_react_native14.closeView)();
762
+ (0, import_react_native13.closeView)();
675
763
  }
676
764
  }, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
677
765
  const handleBack = (0, import_react9.useCallback)(() => {
@@ -686,13 +774,13 @@ function RNNavigationBar() {
686
774
  handleBack();
687
775
  return true;
688
776
  };
689
- import_react_native16.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
777
+ import_react_native14.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
690
778
  return () => {
691
- import_react_native16.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
779
+ import_react_native14.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
692
780
  };
693
781
  }, [handleBack]);
694
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
695
- import_private2.TopNavigation,
782
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
783
+ import_private3.TopNavigation,
696
784
  {
697
785
  title: globals.brandDisplayName,
698
786
  icon: toIcon(globals.brandIcon),
@@ -706,59 +794,59 @@ function RNNavigationBar() {
706
794
  icon: initialAccessoryButton.icon,
707
795
  id: initialAccessoryButton.id
708
796
  } : void 0,
709
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_private2.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_private2.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
797
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
710
798
  }
711
799
  ) });
712
800
  }
713
801
  function useBackOrCloseNavigation() {
714
- const navigation = (0, import_react_native14.useNavigation)();
802
+ const navigation = (0, import_react_native13.useNavigation)();
715
803
  const { captureExitLog } = useCaptureExitLog();
716
804
  return (0, import_react9.useCallback)(() => {
717
805
  if (navigation.canGoBack()) {
718
806
  navigation.goBack();
719
807
  } else {
720
808
  captureExitLog(Date.now());
721
- (0, import_react_native14.closeView)();
809
+ (0, import_react_native13.closeView)();
722
810
  }
723
811
  }, [captureExitLog, navigation]);
724
812
  }
725
813
 
726
814
  // src/core/registerApp.tsx
727
- var import_jsx_runtime5 = require("react/jsx-runtime");
815
+ var import_jsx_runtime6 = require("react/jsx-runtime");
728
816
  function AppsInTossContainer(Container, { children, ...initialProps }) {
729
- if (!(0, import_native_modules8.isMinVersionSupported)({
817
+ if (!(0, import_native_modules9.isMinVersionSupported)({
730
818
  android: "5.220.0",
731
819
  ios: "5.221.0"
732
820
  })) {
733
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
734
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.Entry, {}),
735
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.System, { ...initialProps }),
736
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppUpdate, {})
821
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
822
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
823
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
824
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppUpdate, {})
737
825
  ] });
738
826
  }
739
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
740
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.StayTime, {}),
741
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.Entry, {}),
742
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.System, { ...initialProps }),
743
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native18.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TDSContainer, { ...initialProps, children }) }) })
827
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
828
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.StayTime, {}),
829
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
830
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
831
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_tds_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TDSContainer, { ...initialProps, children }) }) })
744
832
  ] });
745
833
  }
746
834
  function TDSContainer({ children }) {
747
835
  useAppsInTossBridge();
748
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
836
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
749
837
  }
750
838
  function registerApp(container, { context, analytics }) {
751
839
  const appName = getAppName();
752
- const isRegistered = import_react_native19.AppRegistry.getAppKeys().includes(appName);
840
+ const isRegistered = import_react_native16.AppRegistry.getAppKeys().includes(appName);
753
841
  if (!isRegistered) {
754
842
  import_analytics.Analytics.init({
755
- logger: (params) => void (0, import_native_modules8.eventLog)(params),
843
+ logger: (params) => void (0, import_native_modules9.eventLog)(params),
756
844
  debug: analytics?.debug ?? __DEV__
757
845
  });
758
- const App = import_react_native17.Granite.registerApp(AppsInTossContainer.bind(null, container), {
846
+ const App = import_react_native15.Granite.registerApp(AppsInTossContainer.bind(null, container), {
759
847
  appName,
760
848
  context,
761
- setIosSwipeGestureEnabled: import_native_modules8.setIosSwipeGestureEnabled,
849
+ setIosSwipeGestureEnabled: import_native_modules9.setIosSwipeGestureEnabled,
762
850
  router: {
763
851
  screenContainer: AppsInTossScreenContainer,
764
852
  defaultScreenOption: {
@@ -772,8 +860,8 @@ function registerApp(container, { context, analytics }) {
772
860
  }
773
861
  function AppsInTossScreenContainer({ children }) {
774
862
  const isReactNativeService = getAppsInTossGlobals().webViewType == null;
775
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_analytics.Analytics.Screen, { children: [
776
- isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RNNavigationBar, {}),
863
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_analytics.Analytics.Screen, { children: [
864
+ isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RNNavigationBar, {}),
777
865
  children
778
866
  ] });
779
867
  }
@@ -796,25 +884,23 @@ var import_native_modules17 = require("@apps-in-toss/native-modules");
796
884
  var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
797
885
  var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
798
886
  var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
799
- var import_react_native36 = require("@granite-js/react-native");
800
- var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridges"), 1);
801
- var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
802
- var import_react_native37 = require("@toss-design-system/react-native");
803
- var import_private7 = require("@toss-design-system/react-native/private");
804
- var import_react19 = require("react");
805
- var import_react_native38 = require("react-native");
887
+ var import_react_native29 = require("@granite-js/react-native");
888
+ var import_tds_react_native13 = require("@toss/tds-react-native");
889
+ var import_private8 = require("@toss/tds-react-native/private");
890
+ var import_react21 = require("react");
891
+ var import_react_native30 = require("react-native");
806
892
 
807
893
  // src/components/GameWebView.tsx
808
- var import_native_modules12 = require("@apps-in-toss/native-modules");
894
+ var import_native_modules13 = require("@apps-in-toss/native-modules");
809
895
  var import_react_native_webview = require("@granite-js/native/react-native-webview");
810
896
  var import_react13 = require("react");
811
- var import_react_native29 = require("react-native");
897
+ var import_react_native22 = require("react-native");
812
898
 
813
899
  // src/components/GameProfile.tsx
814
- var import_native_modules11 = require("@apps-in-toss/native-modules");
815
- var import_react_native24 = require("@toss-design-system/react-native");
900
+ var import_native_modules12 = require("@apps-in-toss/native-modules");
901
+ var import_tds_react_native9 = require("@toss/tds-react-native");
816
902
  var import_react11 = require("react");
817
- var import_react_native25 = require("react-native");
903
+ var import_react_native19 = require("react-native");
818
904
 
819
905
  // src/constant/game-center.ts
820
906
  var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
@@ -824,23 +910,23 @@ var GAME_CENTER_MIN_VERSION = {
824
910
  };
825
911
 
826
912
  // src/hooks/useGameCenterProfile.ts
827
- var import_native_modules10 = require("@apps-in-toss/native-modules");
828
- var import_react_native22 = require("@granite-js/react-native");
829
- var import_react_native23 = require("@toss-design-system/react-native");
913
+ var import_native_modules11 = require("@apps-in-toss/native-modules");
914
+ var import_react_native18 = require("@granite-js/react-native");
915
+ var import_tds_react_native8 = require("@toss/tds-react-native");
830
916
  var import_es_hangul2 = require("es-hangul");
831
917
  var import_react10 = require("react");
832
918
 
833
919
  // src/components/GameProfileToast.tsx
834
- var import_react_native20 = require("@toss-design-system/react-native");
835
- var import_private3 = require("@toss-design-system/react-native/private");
836
- var import_jsx_runtime6 = require("react/jsx-runtime");
920
+ var import_tds_react_native7 = require("@toss/tds-react-native");
921
+ var import_private4 = require("@toss/tds-react-native/private");
922
+ var import_jsx_runtime7 = require("react/jsx-runtime");
837
923
  var useGameProfileToast = () => {
838
- const overlay = (0, import_private3.useOverlay)();
924
+ const overlay = (0, import_private4.useOverlay)();
839
925
  const openGameProfileToast = (nickname, profileImageUri) => {
840
926
  return new Promise((resolve) => {
841
927
  overlay.open(({ isOpen, close, exit }) => {
842
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_private3.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_private3.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
843
- import_react_native20.Toast,
928
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private4.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private4.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
929
+ import_tds_react_native7.Toast,
844
930
  {
845
931
  open: isOpen,
846
932
  onClose: () => {
@@ -850,11 +936,11 @@ var useGameProfileToast = () => {
850
936
  onExited: exit,
851
937
  position: "top",
852
938
  text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
853
- icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
854
- import_react_native20.Asset.Image,
939
+ icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
940
+ import_tds_react_native7.Asset.Image,
855
941
  {
856
942
  style: { borderRadius: 64, overflow: "hidden" },
857
- frameShape: import_react_native20.Asset.frameShape.CleanW32,
943
+ frameShape: import_tds_react_native7.Asset.frameShape.CleanW32,
858
944
  source: { uri: profileImageUri }
859
945
  }
860
946
  )
@@ -873,11 +959,11 @@ var DEFAULT_ERROR = {
873
959
  };
874
960
 
875
961
  // src/utils/openTransparentWebView.ts
876
- var import_react_native21 = require("@granite-js/react-native");
962
+ var import_react_native17 = require("@granite-js/react-native");
877
963
 
878
964
  // src/private.ts
879
- var import_native_modules9 = require("@apps-in-toss/native-modules");
880
- var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules9.onVisibilityChangedByTransparentServiceWeb;
965
+ var import_native_modules10 = require("@apps-in-toss/native-modules");
966
+ var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules10.onVisibilityChangedByTransparentServiceWeb;
881
967
 
882
968
  // src/utils/openTransparentWebView.ts
883
969
  var openTransparentWebView = ({
@@ -907,7 +993,7 @@ var openTransparentWebView = ({
907
993
  }
908
994
  }
909
995
  });
910
- (0, import_react_native21.openURL)(url.toString());
996
+ (0, import_react_native17.openURL)(url.toString());
911
997
  };
912
998
 
913
999
  // src/hooks/useGameCenterProfile.ts
@@ -920,14 +1006,14 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
920
1006
  const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
921
1007
  const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
922
1008
  const isCompletedProfileFlow = (0, import_react10.useRef)(false);
923
- const { openAlert, openConfirm } = (0, import_react_native23.useDialog)();
1009
+ const { openAlert, openConfirm } = (0, import_tds_react_native8.useDialog)();
924
1010
  const { openGameProfileToast } = useGameProfileToast();
925
1011
  const openErrorAlert = (0, import_react10.useCallback)(async () => {
926
1012
  await openAlert({
927
1013
  title: DEFAULT_ERROR.title,
928
1014
  description: DEFAULT_ERROR.description
929
1015
  });
930
- (0, import_react_native22.closeView)();
1016
+ (0, import_react_native18.closeView)();
931
1017
  }, [openAlert]);
932
1018
  const openProfileWebview = (0, import_react10.useCallback)(() => {
933
1019
  if (isWebviewLoading) {
@@ -941,7 +1027,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
941
1027
  try {
942
1028
  setIsWebviewLoading(false);
943
1029
  setIsProfileDataRefetching(true);
944
- const data = await (0, import_native_modules10.getGameCenterGameProfile)();
1030
+ const data = await (0, import_native_modules11.getGameCenterGameProfile)();
945
1031
  setProfileData(data);
946
1032
  setIsProfileDataRefetching(false);
947
1033
  if (data?.statusCode === "SUCCESS") {
@@ -972,11 +1058,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
972
1058
  closeOnDimmerClick: true
973
1059
  });
974
1060
  if (!isConfirmed) {
975
- (0, import_react_native22.closeView)();
1061
+ (0, import_react_native18.closeView)();
976
1062
  return;
977
1063
  }
978
1064
  const STORE_SCHEME = getMarketLink();
979
- (0, import_react_native22.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
1065
+ (0, import_react_native18.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
980
1066
  }, [openConfirm]);
981
1067
  return {
982
1068
  profileData,
@@ -1005,7 +1091,7 @@ var Z_INDEX = {
1005
1091
  };
1006
1092
 
1007
1093
  // src/components/GameProfile.tsx
1008
- var import_jsx_runtime7 = require("react/jsx-runtime");
1094
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1009
1095
  var GameProfile = ({ children, isReadyForProfileUI }) => {
1010
1096
  const {
1011
1097
  profileData,
@@ -1024,7 +1110,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1024
1110
  (0, import_react11.useEffect)(() => {
1025
1111
  try {
1026
1112
  const getProfileData = async () => {
1027
- const data = await (0, import_native_modules11.getGameCenterGameProfile)();
1113
+ const data = await (0, import_native_modules12.getGameCenterGameProfile)();
1028
1114
  setProfileData(data);
1029
1115
  setIsProfileDataLoading(false);
1030
1116
  };
@@ -1043,7 +1129,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1043
1129
  return;
1044
1130
  }
1045
1131
  isCompletedProfileFlow.current = true;
1046
- if (!(0, import_native_modules11.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1132
+ if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1047
1133
  updateAppToSupportedMinVersion();
1048
1134
  return;
1049
1135
  }
@@ -1064,11 +1150,11 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1064
1150
  profileData,
1065
1151
  updateAppToSupportedMinVersion
1066
1152
  ]);
1067
- if (!(0, import_native_modules11.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1068
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1069
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
1070
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1071
- import_react_native25.Pressable,
1153
+ if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
1154
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1155
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
1156
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1157
+ import_react_native19.Pressable,
1072
1158
  {
1073
1159
  style: {
1074
1160
  ...overlayStyle
@@ -1081,10 +1167,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1081
1167
  ] });
1082
1168
  }
1083
1169
  if (shouldShowLoadingOverlay || isProfileDataRefetching) {
1084
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1085
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
1086
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1087
- import_react_native25.View,
1170
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1171
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1173
+ import_react_native19.View,
1088
1174
  {
1089
1175
  style: {
1090
1176
  ...overlayStyle,
@@ -1092,16 +1178,16 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1092
1178
  alignItems: "center",
1093
1179
  backgroundColor: "rgba(0, 0, 0, 0.2)"
1094
1180
  },
1095
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native24.Loader, { size: "large", type: "light" })
1181
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.Loader, { size: "large", type: "light" })
1096
1182
  }
1097
1183
  )
1098
1184
  ] });
1099
1185
  }
1100
1186
  if (shouldShowProfileNotFoundOverlay) {
1101
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1102
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
1103
- shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1104
- import_react_native25.Pressable,
1187
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1188
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
1189
+ shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1190
+ import_react_native19.Pressable,
1105
1191
  {
1106
1192
  style: {
1107
1193
  ...overlayStyle
@@ -1113,7 +1199,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
1113
1199
  )
1114
1200
  ] });
1115
1201
  }
1116
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }) });
1202
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }) });
1117
1203
  };
1118
1204
  var overlayStyle = {
1119
1205
  position: "absolute",
@@ -1125,16 +1211,16 @@ var overlayStyle = {
1125
1211
  };
1126
1212
 
1127
1213
  // src/components/NavigationBar/GameWebviewNavigationBar.tsx
1128
- var import_react_native26 = require("@granite-js/react-native");
1129
- var import_react_native27 = require("@toss-design-system/react-native");
1130
- var import_private5 = require("@toss-design-system/react-native/private");
1214
+ var import_react_native20 = require("@granite-js/react-native");
1215
+ var import_tds_react_native10 = require("@toss/tds-react-native");
1216
+ var import_private6 = require("@toss/tds-react-native/private");
1131
1217
  var import_es_hangul3 = require("es-hangul");
1132
1218
  var import_react12 = require("react");
1133
- var import_react_native28 = require("react-native");
1134
- var import_jsx_runtime8 = require("react/jsx-runtime");
1219
+ var import_react_native21 = require("react-native");
1220
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1135
1221
  function GameWebviewNavigationBar() {
1136
- const safeAreaTop = (0, import_private5.useSafeAreaTop)();
1137
- const { openConfirm } = (0, import_react_native27.useDialog)();
1222
+ const safeAreaTop = (0, import_private6.useSafeAreaTop)();
1223
+ const { openConfirm } = (0, import_tds_react_native10.useDialog)();
1138
1224
  const { captureExitLog } = useCaptureExitLog();
1139
1225
  const global2 = getAppsInTossGlobals();
1140
1226
  const logging = useNavigationBarLogging();
@@ -1142,6 +1228,7 @@ function GameWebviewNavigationBar() {
1142
1228
  const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
1143
1229
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
1144
1230
  const handleGameWebviewClose = (0, import_react12.useCallback)(async () => {
1231
+ logging.closeButtonClick();
1145
1232
  const isConfirmed = await openConfirm({
1146
1233
  title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1147
1234
  leftButton: "\uCDE8\uC18C",
@@ -1152,26 +1239,18 @@ function GameWebviewNavigationBar() {
1152
1239
  logging.closePopupCtaClick(isConfirmed);
1153
1240
  if (isConfirmed) {
1154
1241
  captureExitLog(Date.now());
1155
- (0, import_react_native26.closeView)();
1242
+ (0, import_react_native20.closeView)();
1156
1243
  }
1157
1244
  }, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
1158
- (0, import_react12.useEffect)(() => {
1159
- const handleAndroidBackEvent = () => {
1160
- handleGameWebviewClose();
1161
- return true;
1162
- };
1163
- import_react_native28.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
1164
- return () => import_react_native28.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
1165
- }, [handleGameWebviewClose]);
1166
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1167
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native27.PageNavbar, { preference: { type: "none" } }),
1168
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1169
- import_react_native28.View,
1245
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1246
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
1247
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1248
+ import_react_native21.View,
1170
1249
  {
1171
1250
  style: {
1172
1251
  width: "100%",
1173
1252
  // TODO: UI관련 스타일 설정은 TDS로 이관
1174
- height: import_react_native28.Platform.OS === "ios" ? 44 : 54,
1253
+ height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
1175
1254
  flexDirection: "row",
1176
1255
  alignItems: "center",
1177
1256
  justifyContent: "flex-end",
@@ -1181,13 +1260,12 @@ function GameWebviewNavigationBar() {
1181
1260
  paddingRight: 10
1182
1261
  },
1183
1262
  pointerEvents: "box-none",
1184
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1185
- import_private5.NavigationRightContent,
1263
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1264
+ import_private6.NavigationRightContent,
1186
1265
  {
1187
1266
  fixedRightButton: initialAccessoryButton,
1188
1267
  onPressDots: openMoreButtonBottomSheet,
1189
1268
  onPressClose: () => {
1190
- logging.closeButtonClick();
1191
1269
  handleGameWebviewClose();
1192
1270
  },
1193
1271
  theme: "dark"
@@ -1199,58 +1277,52 @@ function GameWebviewNavigationBar() {
1199
1277
  }
1200
1278
 
1201
1279
  // src/components/GameWebView.tsx
1202
- var import_jsx_runtime9 = require("react/jsx-runtime");
1280
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1203
1281
  var GameWebView = (0, import_react13.forwardRef)(function GameWebView2(props, ref) {
1204
1282
  const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react13.useState)(false);
1205
1283
  (0, import_react13.useEffect)(() => {
1206
- if (import_react_native29.Platform.OS === "ios") {
1207
- (0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
1284
+ if (import_react_native22.Platform.OS === "ios") {
1285
+ (0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
1208
1286
  return () => {
1209
- (0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
1287
+ (0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
1210
1288
  };
1211
1289
  }
1212
1290
  return;
1213
1291
  }, []);
1214
1292
  (0, import_react13.useEffect)(() => {
1215
- import_native_modules12.appsInTossEvent.addEventListener("entryMessageExited", {
1293
+ import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
1216
1294
  onEvent: () => {
1217
1295
  setIsEntryMessageExited(true);
1218
1296
  }
1219
1297
  });
1220
1298
  }, []);
1221
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1222
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameWebviewNavigationBar, {}),
1223
- (0, import_native_modules12.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_webview.WebView, { ref, ...props })
1299
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1300
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameWebviewNavigationBar, {}),
1301
+ (0, import_native_modules13.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_webview.WebView, { ref, ...props })
1224
1302
  ] });
1225
1303
  });
1226
1304
 
1227
1305
  // src/components/PartnerWebView.tsx
1228
- var import_native_modules14 = require("@apps-in-toss/native-modules");
1229
1306
  var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
1230
- var import_react16 = require("react");
1231
- var import_react_native33 = require("react-native");
1307
+ var import_react15 = require("react");
1232
1308
 
1233
1309
  // src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
1234
- var import_react_native30 = require("@granite-js/react-native");
1235
- var import_react_native31 = require("@toss-design-system/react-native");
1236
- var import_private6 = require("@toss-design-system/react-native/private");
1310
+ var import_react_native23 = require("@granite-js/react-native");
1311
+ var import_tds_react_native11 = require("@toss/tds-react-native");
1312
+ var import_private7 = require("@toss/tds-react-native/private");
1237
1313
  var import_es_hangul4 = require("es-hangul");
1238
1314
  var import_react14 = require("react");
1239
- var import_jsx_runtime10 = require("react/jsx-runtime");
1240
- function PartnerWebviewNavigationBar({ handleBackEvent, handleHomeIconButtonClick }) {
1315
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1316
+ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1241
1317
  const globals = getAppsInTossGlobals();
1242
1318
  const { captureExitLog } = useCaptureExitLog();
1243
1319
  const logging = useNavigationBarLogging();
1244
- const { openConfirm } = (0, import_react_native31.useDialog)();
1320
+ const { openConfirm } = (0, import_tds_react_native11.useDialog)();
1245
1321
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1246
1322
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1247
1323
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1248
1324
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1249
1325
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
1250
- const handlePressTitle = (0, import_react14.useCallback)(() => {
1251
- logging.homeButtonClick();
1252
- handleHomeIconButtonClick();
1253
- }, [handleHomeIconButtonClick, logging]);
1254
1326
  const handleClose = (0, import_react14.useCallback)(async () => {
1255
1327
  logging.closeButtonClick();
1256
1328
  const isConfirmed = await openConfirm({
@@ -1263,210 +1335,36 @@ function PartnerWebviewNavigationBar({ handleBackEvent, handleHomeIconButtonClic
1263
1335
  logging.closePopupCtaClick(isConfirmed);
1264
1336
  if (isConfirmed) {
1265
1337
  captureExitLog(Date.now());
1266
- (0, import_react_native30.closeView)();
1338
+ (0, import_react_native23.closeView)();
1267
1339
  }
1268
1340
  }, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
1269
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1270
- import_private6.TopNavigation,
1341
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1342
+ import_private7.TopNavigation,
1271
1343
  {
1272
1344
  title: globals.brandDisplayName,
1273
1345
  icon: toIcon(globals.brandIcon),
1274
1346
  onPressDots: openMoreButtonBottomSheet,
1275
1347
  contentVisible: true,
1276
- onPressTitle: withHomeButton ? handlePressTitle : void 0,
1348
+ onPressTitle: withHomeButton ? onHomeButtonClick : void 0,
1277
1349
  onPressClose: handleClose,
1278
1350
  withHome: withHomeButton,
1279
1351
  fixedRightButton: initialAccessoryButton,
1280
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private6.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private6.NavigationBackButton, { onPress: handleBackEvent, canGoBack: false }) })
1352
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
1281
1353
  }
1282
1354
  ) });
1283
1355
  }
1284
1356
 
1285
- // src/core/utils/mergeRefs.ts
1286
- function mergeRefs(...refs) {
1287
- return (value) => {
1288
- refs.forEach((ref) => {
1289
- if (typeof ref === "function") {
1290
- ref(value);
1291
- } else if (ref != null) {
1292
- ref.current = value;
1293
- }
1294
- });
1295
- };
1296
- }
1297
-
1298
- // src/hooks/useWebviewHistoryStack.tsx
1299
- var import_react15 = require("react");
1300
- var INITIAL_STATE = { stack: [], index: -1 };
1301
- function reducer(state, action) {
1302
- switch (action.type) {
1303
- case "NAVIGATION_CHANGE": {
1304
- const { url, canGoForward } = action;
1305
- if (state.stack.length === 0) {
1306
- return { stack: [url], index: 0 };
1307
- }
1308
- const { stack, index } = state;
1309
- const cur = stack[index];
1310
- if (url === cur) {
1311
- return state;
1312
- }
1313
- const prev = index > 0 ? stack[index - 1] : void 0;
1314
- const next = index < stack.length - 1 ? stack[index + 1] : void 0;
1315
- if (prev && url === prev && canGoForward) {
1316
- return { ...state, index: index - 1 };
1317
- }
1318
- if (next && url === next) {
1319
- return { ...state, index: index + 1 };
1320
- }
1321
- const base = stack.slice(0, index + 1);
1322
- const nextStack = [...base, url];
1323
- return { stack: nextStack, index: nextStack.length - 1 };
1324
- }
1325
- default:
1326
- return state;
1327
- }
1328
- }
1329
- function useWebViewHistory() {
1330
- const [state, dispatch] = (0, import_react15.useReducer)(reducer, INITIAL_STATE);
1331
- const onNavigationStateChange = (0, import_react15.useCallback)(({ url, canGoForward: canGoForward2 }) => {
1332
- dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
1333
- }, []);
1334
- const { canGoBack, canGoForward } = (0, import_react15.useMemo)(() => {
1335
- const canBack = state.index > 0;
1336
- const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
1337
- return { canGoBack: canBack, canGoForward: canFwd };
1338
- }, [state.index, state.stack.length]);
1339
- return { onNavigationStateChange, canGoBack, canGoForward };
1340
- }
1341
-
1342
- // src/utils/log.ts
1343
- var import_native_modules13 = require("@apps-in-toss/native-modules");
1344
- var import_react_native32 = require("@granite-js/react-native");
1345
-
1346
- // src/utils/extractDateFromUUIDv7.ts
1347
- var extractDateFromUUIDv7 = (uuid) => {
1348
- const timestampHex = uuid.split("-").join("").slice(0, 12);
1349
- const timestamp = Number.parseInt(timestampHex, 16);
1350
- return new Date(timestamp);
1351
- };
1352
-
1353
- // src/utils/log.ts
1354
- var getGroupId = (url) => {
1355
- try {
1356
- const urlObject = new URL(url);
1357
- return {
1358
- groupId: urlObject.pathname,
1359
- search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
1360
- };
1361
- } catch {
1362
- return {
1363
- groupId: "unknown",
1364
- search: "unknown"
1365
- };
1366
- }
1367
- };
1368
- var getReferrer = () => {
1369
- try {
1370
- const referrer = new URL((0, import_react_native32.getSchemeUri)());
1371
- return referrer.searchParams.get("referrer");
1372
- } catch {
1373
- return "";
1374
- }
1375
- };
1376
- var trackScreen = (url) => {
1377
- const { groupId, search } = getGroupId(url);
1378
- const log = {
1379
- log_type: "screen",
1380
- log_name: `${groupId}::screen`,
1381
- params: {
1382
- search,
1383
- referrer: getReferrer(),
1384
- deployment_id: env.getDeploymentId(),
1385
- deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
1386
- }
1387
- };
1388
- return (0, import_native_modules13.eventLog)(log);
1389
- };
1390
-
1391
1357
  // src/components/PartnerWebView.tsx
1392
- var import_jsx_runtime11 = require("react/jsx-runtime");
1393
- var PartnerWebView = (0, import_react16.forwardRef)(
1394
- function PartnerWebViewScreen(webViewProps, ref) {
1395
- const webViewRef = (0, import_react16.useRef)(null);
1396
- const refs = mergeRefs(ref, webViewRef);
1397
- const { captureExitLog } = useCaptureExitLog();
1398
- const { canGoBack, onNavigationStateChange } = useWebViewHistory();
1399
- const historyBackScript = `
1400
- (function() {
1401
- window.history.back();
1402
- true;
1403
- })();
1404
- `;
1405
- const historyHomeScript = `
1406
- (function() {
1407
- window.location.href = '/';
1408
- true;
1409
- })();
1410
- `;
1411
- const handleBackEvent = (0, import_react16.useCallback)(() => {
1412
- if (canGoBack) {
1413
- webViewRef.current?.injectJavaScript(historyBackScript);
1414
- } else {
1415
- captureExitLog(Date.now());
1416
- (0, import_native_modules14.closeView)();
1417
- }
1418
- }, [canGoBack, captureExitLog, historyBackScript]);
1419
- (0, import_react16.useEffect)(() => {
1420
- const handleAndroidBackEvent = () => {
1421
- if (canGoBack) {
1422
- webViewRef.current?.injectJavaScript(historyBackScript);
1423
- return true;
1424
- } else {
1425
- captureExitLog(Date.now());
1426
- return false;
1427
- }
1428
- };
1429
- import_react_native33.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
1430
- return () => import_react_native33.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
1431
- }, [canGoBack, captureExitLog, historyBackScript]);
1432
- const handleHomeIconButtonClick = (0, import_react16.useCallback)(() => {
1433
- webViewRef.current?.injectJavaScript(historyHomeScript);
1434
- }, [historyHomeScript]);
1435
- const handleNavigationStateChange = (0, import_react16.useCallback)(
1436
- (event) => {
1437
- if (event.url) {
1438
- trackScreen(event.url);
1439
- }
1440
- onNavigationStateChange(event);
1441
- },
1442
- [onNavigationStateChange]
1443
- );
1444
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1445
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1446
- PartnerWebviewNavigationBar,
1447
- {
1448
- handleBackEvent,
1449
- handleHomeIconButtonClick
1450
- }
1451
- ),
1452
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1453
- import_react_native_webview2.WebView,
1454
- {
1455
- ref: refs,
1456
- ...webViewProps,
1457
- style: { flex: 1 },
1458
- onNavigationStateChange: (event) => {
1459
- webViewProps?.onNavigationStateChange?.(event);
1460
- handleNavigationStateChange(event);
1461
- }
1462
- }
1463
- )
1464
- ] });
1465
- }
1466
- );
1358
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1359
+ var PartnerWebView = (0, import_react15.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
1360
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1361
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
1362
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
1363
+ ] });
1364
+ });
1467
1365
 
1468
1366
  // src/bridge-handler/useBridgeHandler.tsx
1469
- var import_react17 = require("react");
1367
+ var import_react16 = require("react");
1470
1368
  function serializeError(error) {
1471
1369
  return JSON.stringify(error, (_, value) => {
1472
1370
  if (value instanceof Error) {
@@ -1519,8 +1417,8 @@ function useBridgeHandler({
1519
1417
  eventListenerMap,
1520
1418
  injectedJavaScript: originalInjectedJavaScript
1521
1419
  }) {
1522
- const ref = (0, import_react17.useRef)(null);
1523
- const injectedJavaScript = (0, import_react17.useMemo)(
1420
+ const ref = (0, import_react16.useRef)(null);
1421
+ const injectedJavaScript = (0, import_react16.useMemo)(
1524
1422
  () => [
1525
1423
  `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
1526
1424
  Object.entries(constantHandlerMap).reduce(
@@ -1547,7 +1445,7 @@ function useBridgeHandler({
1547
1445
  window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
1548
1446
  `);
1549
1447
  };
1550
- const $onMessage = (0, import_react17.useCallback)(
1448
+ const $onMessage = (0, import_react16.useCallback)(
1551
1449
  async (e) => {
1552
1450
  onMessage?.(e);
1553
1451
  const data = JSON.parse(e.nativeEvent.data);
@@ -1597,9 +1495,158 @@ function useBridgeHandler({
1597
1495
  };
1598
1496
  }
1599
1497
 
1498
+ // src/core/hooks/useWebBackHandler.tsx
1499
+ var import_react_native24 = require("@granite-js/react-native");
1500
+ var import_tds_react_native12 = require("@toss/tds-react-native");
1501
+ var import_es_hangul5 = require("es-hangul");
1502
+ var import_react18 = require("react");
1503
+
1504
+ // src/hooks/useWebviewHistoryStack.tsx
1505
+ var import_react17 = require("react");
1506
+ var INITIAL_STATE = { stack: [], index: -1 };
1507
+ function reducer(state, action) {
1508
+ switch (action.type) {
1509
+ case "NAVIGATION_CHANGE": {
1510
+ const { url, canGoForward } = action;
1511
+ if (state.stack.length === 0) {
1512
+ return { stack: [url], index: 0 };
1513
+ }
1514
+ const { stack, index } = state;
1515
+ const cur = stack[index];
1516
+ if (url === cur) {
1517
+ return state;
1518
+ }
1519
+ const prev = index > 0 ? stack[index - 1] : void 0;
1520
+ const next = index < stack.length - 1 ? stack[index + 1] : void 0;
1521
+ if (prev && url === prev && canGoForward) {
1522
+ return { ...state, index: index - 1 };
1523
+ }
1524
+ if (next && url === next) {
1525
+ return { ...state, index: index + 1 };
1526
+ }
1527
+ const base = stack.slice(0, index + 1);
1528
+ const nextStack = [...base, url];
1529
+ return { stack: nextStack, index: nextStack.length - 1 };
1530
+ }
1531
+ default:
1532
+ return state;
1533
+ }
1534
+ }
1535
+ function useWebViewHistory() {
1536
+ const [state, dispatch] = (0, import_react17.useReducer)(reducer, INITIAL_STATE);
1537
+ const onNavigationStateChange = (0, import_react17.useCallback)(({ url, canGoForward: canGoForward2 }) => {
1538
+ dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
1539
+ }, []);
1540
+ const { canGoBack, canGoForward } = (0, import_react17.useMemo)(() => {
1541
+ const canBack = state.index > 0;
1542
+ const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
1543
+ return { canGoBack: canBack, canGoForward: canFwd };
1544
+ }, [state.index, state.stack.length]);
1545
+ return { onNavigationStateChange, hasHistory: canGoBack, canGoForward };
1546
+ }
1547
+
1548
+ // src/core/hooks/useWebBackHandler.tsx
1549
+ var HISTORY_BACK_SCRIPT = `
1550
+ (function() {
1551
+ window.history.back();
1552
+ true;
1553
+ })();
1554
+ `;
1555
+ var HISTORY_HOME_SCRIPT = `
1556
+ (function() {
1557
+ window.location.href = '/';
1558
+ true;
1559
+ })();
1560
+ `;
1561
+ function useWebBackHandler(webViewRef) {
1562
+ const { captureExitLog } = useCaptureExitLog();
1563
+ const { hasHistory, onNavigationStateChange } = useWebViewHistory();
1564
+ const {
1565
+ handlersRef: webBackHandlersRef,
1566
+ hasBackEvent: hasWebBackEvent,
1567
+ addEventListener: addWebBackEventListener,
1568
+ removeEventListener: removeWebBackEventListener
1569
+ } = (0, import_react_native24.useBackEventState)();
1570
+ const logging = useNavigationBarLogging();
1571
+ const { openConfirm } = (0, import_tds_react_native12.useDialog)();
1572
+ const global2 = getAppsInTossGlobals();
1573
+ const addEventListener = (0, import_react18.useCallback)(
1574
+ (handler) => {
1575
+ addWebBackEventListener(handler);
1576
+ },
1577
+ [addWebBackEventListener]
1578
+ );
1579
+ const removeEventListener = (0, import_react18.useCallback)(
1580
+ (handler) => {
1581
+ removeWebBackEventListener(handler);
1582
+ },
1583
+ [removeWebBackEventListener]
1584
+ );
1585
+ const handleWebBack = (0, import_react18.useCallback)(async () => {
1586
+ if (hasWebBackEvent) {
1587
+ for (const handler of webBackHandlersRef) {
1588
+ handler();
1589
+ }
1590
+ return;
1591
+ }
1592
+ if (hasHistory) {
1593
+ webViewRef.current?.injectJavaScript(HISTORY_BACK_SCRIPT);
1594
+ } else {
1595
+ const isConfirmed = await openConfirm({
1596
+ title: `${(0, import_es_hangul5.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1597
+ leftButton: "\uCDE8\uC18C",
1598
+ rightButton: "\uC885\uB8CC\uD558\uAE30",
1599
+ closeOnDimmerClick: true,
1600
+ onEntered: logging.closePopupShow
1601
+ });
1602
+ logging.closePopupCtaClick(isConfirmed);
1603
+ if (isConfirmed) {
1604
+ captureExitLog(Date.now());
1605
+ (0, import_react_native24.closeView)();
1606
+ }
1607
+ }
1608
+ }, [
1609
+ captureExitLog,
1610
+ global2.brandDisplayName,
1611
+ hasHistory,
1612
+ hasWebBackEvent,
1613
+ webBackHandlersRef,
1614
+ logging,
1615
+ openConfirm,
1616
+ webViewRef
1617
+ ]);
1618
+ const handleWebHome = (0, import_react18.useCallback)(() => {
1619
+ logging.homeButtonClick();
1620
+ if (hasWebBackEvent) {
1621
+ for (const handler of webBackHandlersRef) {
1622
+ handler();
1623
+ }
1624
+ return;
1625
+ }
1626
+ webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
1627
+ }, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
1628
+ return (0, import_react18.useMemo)(
1629
+ () => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
1630
+ [addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
1631
+ );
1632
+ }
1633
+
1634
+ // src/core/utils/mergeRefs.ts
1635
+ function mergeRefs(...refs) {
1636
+ return (value) => {
1637
+ refs.forEach((ref) => {
1638
+ if (typeof ref === "function") {
1639
+ ref(value);
1640
+ } else if (ref != null) {
1641
+ ref.current = value;
1642
+ }
1643
+ });
1644
+ };
1645
+ }
1646
+
1600
1647
  // src/hooks/useCreateUserAgent.ts
1601
- var import_native_modules15 = require("@apps-in-toss/native-modules");
1602
- var import_react_native34 = require("react-native");
1648
+ var import_native_modules14 = require("@apps-in-toss/native-modules");
1649
+ var import_react_native25 = require("react-native");
1603
1650
  var FontA11yCategory = {
1604
1651
  Large: "Large",
1605
1652
  xLarge: "xLarge",
@@ -1732,9 +1779,9 @@ function useCreateUserAgent({
1732
1779
  safeArea,
1733
1780
  safeAreaBottomTransparency
1734
1781
  }) {
1735
- const platform = (0, import_native_modules15.getPlatformOS)();
1736
- const appVersion = (0, import_native_modules15.getTossAppVersion)();
1737
- const { fontScale } = (0, import_react_native34.useWindowDimensions)();
1782
+ const platform = (0, import_native_modules14.getPlatformOS)();
1783
+ const appVersion = (0, import_native_modules14.getTossAppVersion)();
1784
+ const { fontScale } = (0, import_react_native25.useWindowDimensions)();
1738
1785
  const platformString = platform === "ios" ? "iPhone" : "Android";
1739
1786
  const fontA11y = mapFontScaleToCategory(fontScale, platform);
1740
1787
  const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
@@ -1754,17 +1801,17 @@ function useCreateUserAgent({
1754
1801
  }
1755
1802
 
1756
1803
  // src/hooks/useGeolocation.ts
1757
- var import_native_modules16 = require("@apps-in-toss/native-modules");
1758
- var import_react_native35 = require("@granite-js/react-native");
1759
- var import_react18 = require("react");
1804
+ var import_native_modules15 = require("@apps-in-toss/native-modules");
1805
+ var import_react_native26 = require("@granite-js/react-native");
1806
+ var import_react19 = require("react");
1760
1807
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1761
- const isVisible = (0, import_react_native35.useVisibility)();
1762
- const [location, setLocation] = (0, import_react18.useState)(null);
1763
- (0, import_react18.useEffect)(() => {
1808
+ const isVisible = (0, import_react_native26.useVisibility)();
1809
+ const [location, setLocation] = (0, import_react19.useState)(null);
1810
+ (0, import_react19.useEffect)(() => {
1764
1811
  if (!isVisible) {
1765
1812
  return;
1766
1813
  }
1767
- return (0, import_native_modules16.startUpdateLocation)({
1814
+ return (0, import_native_modules15.startUpdateLocation)({
1768
1815
  options: {
1769
1816
  accuracy,
1770
1817
  distanceInterval,
@@ -1777,18 +1824,97 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1777
1824
  return location;
1778
1825
  }
1779
1826
 
1827
+ // src/hooks/useWaitForReturnNavigator.tsx
1828
+ var import_react_native27 = require("@granite-js/react-native");
1829
+ var import_react20 = require("react");
1830
+ function useWaitForReturnNavigator() {
1831
+ const callbacks = (0, import_react20.useRef)([]).current;
1832
+ const navigation = (0, import_react_native27.useNavigation)();
1833
+ const startNavigating = (0, import_react20.useCallback)(
1834
+ (route, params) => {
1835
+ return new Promise((resolve) => {
1836
+ callbacks.push(resolve);
1837
+ navigation.navigate(route, params);
1838
+ });
1839
+ },
1840
+ [callbacks, navigation]
1841
+ );
1842
+ const handleVisibilityChange = (0, import_react20.useCallback)(
1843
+ (state) => {
1844
+ if (state === "visible" && callbacks.length > 0) {
1845
+ for (const callback of callbacks) {
1846
+ callback();
1847
+ }
1848
+ callbacks.splice(0, callbacks.length);
1849
+ }
1850
+ },
1851
+ [callbacks]
1852
+ );
1853
+ (0, import_react_native27.useVisibilityChange)(handleVisibilityChange);
1854
+ return startNavigating;
1855
+ }
1856
+
1857
+ // src/utils/log.ts
1858
+ var import_native_modules16 = require("@apps-in-toss/native-modules");
1859
+ var import_react_native28 = require("@granite-js/react-native");
1860
+
1861
+ // src/utils/extractDateFromUUIDv7.ts
1862
+ var extractDateFromUUIDv7 = (uuid) => {
1863
+ const timestampHex = uuid.split("-").join("").slice(0, 12);
1864
+ const timestamp = Number.parseInt(timestampHex, 16);
1865
+ return new Date(timestamp);
1866
+ };
1867
+
1868
+ // src/utils/log.ts
1869
+ var getGroupId = (url) => {
1870
+ try {
1871
+ const urlObject = new URL(url);
1872
+ return {
1873
+ groupId: urlObject.pathname,
1874
+ search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
1875
+ };
1876
+ } catch {
1877
+ return {
1878
+ groupId: "unknown",
1879
+ search: "unknown"
1880
+ };
1881
+ }
1882
+ };
1883
+ var getReferrer = () => {
1884
+ try {
1885
+ const referrer = new URL((0, import_react_native28.getSchemeUri)());
1886
+ return referrer.searchParams.get("referrer");
1887
+ } catch {
1888
+ return "";
1889
+ }
1890
+ };
1891
+ var trackScreen = (url) => {
1892
+ const { groupId, search } = getGroupId(url);
1893
+ const log = {
1894
+ log_type: "screen",
1895
+ log_name: `${groupId}::screen`,
1896
+ params: {
1897
+ search,
1898
+ referrer: getReferrer(),
1899
+ deployment_id: env.getDeploymentId(),
1900
+ deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
1901
+ }
1902
+ };
1903
+ return (0, import_native_modules16.eventLog)(log);
1904
+ };
1905
+
1780
1906
  // src/components/WebView.tsx
1781
- var import_jsx_runtime12 = require("react/jsx-runtime");
1907
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1782
1908
  var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
1783
1909
  var TYPES = ["partner", "external", "game"];
1784
1910
  var WEBVIEW_TYPES = {
1785
1911
  partner: PartnerWebView,
1786
- external: import_react_native37.ExternalWebViewScreen,
1912
+ external: import_tds_react_native13.ExternalWebViewScreen,
1787
1913
  game: GameWebView
1788
1914
  };
1789
1915
  function mergeSchemeQueryParamsInto(url) {
1790
1916
  const baseUrl = new URL(url);
1791
- const schemeUrl = new URL((0, import_react_native36.getSchemeUri)());
1917
+ const schemeUrl = new URL((0, import_react_native29.getSchemeUri)());
1792
1918
  baseUrl.pathname = schemeUrl.pathname;
1793
1919
  for (const [key, value] of schemeUrl.searchParams.entries()) {
1794
1920
  baseUrl.searchParams.set(key, value);
@@ -1812,12 +1938,13 @@ function WebView({ type, local, onMessage, ...props }) {
1812
1938
  if (!TYPES.includes(type)) {
1813
1939
  throw new Error(`Invalid WebView type: '${type}'`);
1814
1940
  }
1815
- const graniteEvent = (0, import_react_native36.useGraniteEvent)();
1816
- const uri = (0, import_react19.useMemo)(() => getWebViewUri(local), [local]);
1817
- const top = (0, import_private7.useSafeAreaTop)();
1818
- const bottom = (0, import_private7.useSafeAreaBottom)();
1941
+ const webViewRef = (0, import_react21.useRef)(null);
1942
+ const webBackHandler = useWebBackHandler(webViewRef);
1943
+ const uri = (0, import_react21.useMemo)(() => getWebViewUri(local), [local]);
1944
+ const top = (0, import_private8.useSafeAreaTop)();
1945
+ const bottom = (0, import_private8.useSafeAreaBottom)();
1819
1946
  const global2 = getAppsInTossGlobals();
1820
- const topNavigation = (0, import_private7.useTopNavigation)();
1947
+ const topNavigation = (0, import_private8.useTopNavigation)();
1821
1948
  const disableTextSelectionCSS = `
1822
1949
  (function() {
1823
1950
  const style = document.createElement('style');
@@ -1825,7 +1952,7 @@ function WebView({ type, local, onMessage, ...props }) {
1825
1952
  document.head.appendChild(style);
1826
1953
  })();
1827
1954
  `;
1828
- const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react19.useState)(
1955
+ const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react21.useState)(
1829
1956
  props.allowsBackForwardNavigationGestures
1830
1957
  );
1831
1958
  const handler = useBridgeHandler({
@@ -1834,8 +1961,13 @@ function WebView({ type, local, onMessage, ...props }) {
1834
1961
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1835
1962
  eventListenerMap: {
1836
1963
  ...appsInTossEventBridges,
1837
- navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native37.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
1838
- backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
1964
+ navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native13.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
1965
+ backEvent: ({ onEvent }) => {
1966
+ webBackHandler.addEventListener(onEvent);
1967
+ return () => {
1968
+ webBackHandler.removeEventListener(onEvent);
1969
+ };
1970
+ },
1839
1971
  entryMessageExited: ({ onEvent, onError }) => import_native_modules17.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
1840
1972
  updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules17.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
1841
1973
  /** @internal */
@@ -1853,7 +1985,6 @@ function WebView({ type, local, onMessage, ...props }) {
1853
1985
  requestOneTimePurchase: import_native_modules17.requestOneTimePurchase
1854
1986
  },
1855
1987
  constantHandlerMap: {
1856
- ...graniteConstantBridges,
1857
1988
  ...appsInTossConstantBridges,
1858
1989
  getSafeAreaTop: () => top,
1859
1990
  getSafeAreaBottom: () => bottom,
@@ -1870,7 +2001,6 @@ function WebView({ type, local, onMessage, ...props }) {
1870
2001
  getDeploymentId: env.getDeploymentId
1871
2002
  },
1872
2003
  asyncHandlerMap: {
1873
- ...graniteAsyncBridges,
1874
2004
  ...appsInTossAsyncBridges,
1875
2005
  setIosSwipeGestureEnabled: (options) => {
1876
2006
  setAllowsBackForwardNavigationGestures(options.isEnabled);
@@ -1896,10 +2026,12 @@ function WebView({ type, local, onMessage, ...props }) {
1896
2026
  /** IAP */
1897
2027
  iapGetProductItemList: import_native_modules17.IAP.getProductItemList,
1898
2028
  iapCreateOneTimePurchaseOrder: import_native_modules17.iapCreateOneTimePurchaseOrder,
1899
- processProductGrant: import_native_modules17.processProductGrant
2029
+ processProductGrant: import_native_modules17.processProductGrant,
2030
+ getPendingOrders: import_native_modules17.IAP.getPendingOrders,
2031
+ getCompletedOrRefundedOrders: import_native_modules17.IAP.getCompletedOrRefundedOrders
1900
2032
  }
1901
2033
  });
1902
- const headerPropForExternalWebView = (0, import_react19.useMemo)(() => {
2034
+ const headerPropForExternalWebView = (0, import_react21.useMemo)(() => {
1903
2035
  const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
1904
2036
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
1905
2037
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
@@ -1919,10 +2051,19 @@ function WebView({ type, local, onMessage, ...props }) {
1919
2051
  const userAgent = useCreateUserAgent({
1920
2052
  colorPreference: "light"
1921
2053
  });
1922
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2054
+ const refs = mergeRefs(handler.ref, webViewRef);
2055
+ (0, import_react21.useEffect)(() => {
2056
+ const callback = () => {
2057
+ webBackHandler.handleWebBack();
2058
+ return true;
2059
+ };
2060
+ import_react_native30.BackHandler.addEventListener("hardwareBackPress", callback);
2061
+ return () => import_react_native30.BackHandler.removeEventListener("hardwareBackPress", callback);
2062
+ }, [webBackHandler]);
2063
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1923
2064
  BaseWebView,
1924
2065
  {
1925
- ref: handler.ref,
2066
+ ref: refs,
1926
2067
  ...props,
1927
2068
  ...headerPropForExternalWebView,
1928
2069
  source: {
@@ -1932,14 +2073,23 @@ function WebView({ type, local, onMessage, ...props }) {
1932
2073
  "User-Agent": userAgent
1933
2074
  }
1934
2075
  },
1935
- userAgent: import_react_native38.Platform.OS === "ios" ? userAgent : void 0,
2076
+ onHomeButtonClick: webBackHandler.handleWebHome,
2077
+ onBackButtonClick: webBackHandler.handleWebBack,
2078
+ onNavigationStateChange: (event) => {
2079
+ if (event.url) {
2080
+ trackScreen(event.url);
2081
+ }
2082
+ props.onNavigationStateChange?.(event);
2083
+ webBackHandler.onNavigationStateChange(event);
2084
+ },
2085
+ userAgent: import_react_native30.Platform.OS === "ios" ? userAgent : void 0,
1936
2086
  sharedCookiesEnabled: true,
1937
2087
  webviewDebuggingEnabled: webViewDebuggingEnabled,
1938
2088
  thirdPartyCookiesEnabled: true,
1939
2089
  onMessage: handler.onMessage,
1940
2090
  injectedJavaScript: handler.injectedJavaScript,
1941
2091
  injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
1942
- decelerationRate: import_react_native38.Platform.OS === "ios" ? 1 : void 0,
2092
+ decelerationRate: import_react_native30.Platform.OS === "ios" ? 1 : void 0,
1943
2093
  allowsBackForwardNavigationGestures
1944
2094
  }
1945
2095
  );
@@ -1947,7 +2097,7 @@ function WebView({ type, local, onMessage, ...props }) {
1947
2097
 
1948
2098
  // src/index.ts
1949
2099
  __reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
1950
- var import_private8 = require("@toss-design-system/react-native/private");
2100
+ var import_private9 = require("@toss/tds-react-native/private");
1951
2101
  __reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
1952
2102
  __reExport(src_exports, require("@apps-in-toss/types"), module.exports);
1953
2103
  var Analytics2 = {
@@ -1961,11 +2111,14 @@ var Analytics2 = {
1961
2111
  Analytics,
1962
2112
  AppsInToss,
1963
2113
  INTERNAL__onVisibilityChangedByTransparentServiceWeb,
2114
+ OverlayProvider,
1964
2115
  WebView,
1965
2116
  env,
1966
2117
  useCreateUserAgent,
1967
2118
  useGeolocation,
2119
+ useOverlay,
1968
2120
  useTopNavigation,
2121
+ useWaitForReturnNavigator,
1969
2122
  ...require("@apps-in-toss/analytics"),
1970
2123
  ...require("@apps-in-toss/native-modules"),
1971
2124
  ...require("@apps-in-toss/types")