@apps-in-toss/web-framework 2.5.0 → 2.5.2

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.
@@ -138138,6 +138138,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
138138
138138
  var isRNApp = getAppsInTossGlobals().webViewType == null;
138139
138139
  return (0, import_jsx_runtime14.jsx)(NavigationBarContextProvider, {
138140
138140
  children: isRNApp ? (0, import_jsx_runtime14.jsx)(import_analytics.Analytics.Screen, {
138141
+ onLog: params => sendLog({
138142
+ log_type: params.log_type,
138143
+ log_name: "appsintoss_app_visit__appssintoss_systemlog",
138144
+ params: {
138145
+ ...params.params,
138146
+ schema_id: 5175906,
138147
+ app_name: import_react_native21.Granite.appName,
138148
+ log_name: params.log_name
138149
+ }
138150
+ }, {
138151
+ pipelines: ["core"]
138152
+ }),
138141
138153
  children: (0, import_jsx_runtime14.jsx)(RNAppContainer, {
138142
138154
  children
138143
138155
  })
@@ -138155,7 +138167,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
138155
138167
  var AppsInToss = {
138156
138168
  registerApp
138157
138169
  };
138158
- var import_native_modules19 = _$$_REQUIRE(_dependencyMap[5], "@apps-in-toss/native-modules");
138170
+ var import_native_modules18 = _$$_REQUIRE(_dependencyMap[5], "@apps-in-toss/native-modules");
138159
138171
  var appsInTossAsyncBridges = __toESM(_$$_REQUIRE(_dependencyMap[14], "@apps-in-toss/native-modules/async-bridges"), 1);
138160
138172
  var appsInTossConstantBridges = __toESM(_$$_REQUIRE(_dependencyMap[15], "@apps-in-toss/native-modules/constant-bridges"), 1);
138161
138173
  var appsInTossEventBridges = __toESM(_$$_REQUIRE(_dependencyMap[16], "@apps-in-toss/native-modules/event-bridges"), 1);
@@ -139291,7 +139303,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139291
139303
  console.log("[webViewDebugLog]", event);
139292
139304
  }
139293
139305
  }
139294
- var import_native_modules18 = _$$_REQUIRE(_dependencyMap[5], "@apps-in-toss/native-modules");
139295
139306
  var import_react_native35 = _$$_REQUIRE(_dependencyMap[6], "@granite-js/react-native");
139296
139307
  var extractDateFromUUIDv7 = uuid => {
139297
139308
  var timestampHex = uuid.split("-").join("").slice(0, 12);
@@ -139324,18 +139335,34 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139324
139335
  var _getGroupId = getGroupId(url),
139325
139336
  groupId = _getGroupId.groupId,
139326
139337
  search = _getGroupId.search;
139327
- var log = {
139328
- log_type: "screen",
139329
- log_name: `${groupId}::screen`,
139338
+ var logType = "screen";
139339
+ var logName = `${groupId}::screen`;
139340
+ var params = {
139341
+ search,
139342
+ referrer: getReferrer2(),
139343
+ document_title: title,
139344
+ app_name: import_react_native35.Granite.appName,
139345
+ deployment_id: env.getDeploymentId(),
139346
+ deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
139347
+ };
139348
+ sendLog({
139349
+ log_type: logType,
139350
+ log_name: logName,
139351
+ params
139352
+ }, {
139353
+ pipelines: ["partner"]
139354
+ });
139355
+ sendLog({
139356
+ log_type: logType,
139357
+ log_name: "appsintoss_app_visit__appssintoss_systemlog",
139330
139358
  params: {
139331
- search,
139332
- referrer: getReferrer2(),
139333
- document_title: title,
139334
- deployment_id: env.getDeploymentId(),
139335
- deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
139359
+ ...params,
139360
+ schema_id: 5175906,
139361
+ log_name: logName
139336
139362
  }
139337
- };
139338
- return (0, import_native_modules18.eventLog)(log);
139363
+ }, {
139364
+ pipelines: ["core"]
139365
+ });
139339
139366
  };
139340
139367
  var import_jsx_runtime19 = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime");
139341
139368
  var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
@@ -139368,7 +139395,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139368
139395
  var devUrl = `http://${local.host}:${local.port}`;
139369
139396
  return mergeSchemeQueryParamsInto(devUrl);
139370
139397
  }
139371
- var _ref49 = (0, import_native_modules19.safeSyncPostMessage)("getWebBundleURL", {}),
139398
+ var _ref49 = (0, import_native_modules18.safeSyncPostMessage)("getWebBundleURL", {}),
139372
139399
  rawUrl = _ref49.url;
139373
139400
  var url = mergeSchemeQueryParamsInto(rawUrl);
139374
139401
  var deploymentId = env.getDeploymentId();
@@ -139425,7 +139452,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139425
139452
  onEvent,
139426
139453
  onError,
139427
139454
  options
139428
- }) => import_native_modules19.appsInTossEvent.addEventListener("updateLocationEvent", {
139455
+ }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", {
139429
139456
  onEvent,
139430
139457
  onError,
139431
139458
  options
@@ -139437,20 +139464,20 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139437
139464
  onEvent,
139438
139465
  onError,
139439
139466
  options
139440
- }) => import_native_modules19.appsInTossEvent.addEventListener("appBridgeCallbackEvent", {
139467
+ }) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", {
139441
139468
  onEvent,
139442
139469
  onError,
139443
139470
  options
139444
139471
  }),
139445
- loadAppsInTossAdMob: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob,
139446
- showAppsInTossAdMob: import_native_modules19.GoogleAdMob.showAppsInTossAdMob,
139472
+ loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
139473
+ showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
139447
139474
  loadFullScreenAd: loadFullScreenAdForWeb,
139448
139475
  showFullScreenAd,
139449
139476
  fetchTossAd,
139450
- iapCreateOneTimePurchaseOrder: import_native_modules19.IAP.createOneTimePurchaseOrder,
139451
- requestSubscriptionPurchase: import_native_modules19.IAP.createSubscriptionPurchaseOrder,
139452
- requestOneTimePurchase: import_native_modules19.requestOneTimePurchase,
139453
- requestNotificationAgreement: import_native_modules19.requestNotificationAgreement
139477
+ iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
139478
+ requestSubscriptionPurchase: import_native_modules18.IAP.createSubscriptionPurchaseOrder,
139479
+ requestOneTimePurchase: import_native_modules18.requestOneTimePurchase,
139480
+ requestNotificationAgreement: import_native_modules18.requestNotificationAgreement
139454
139481
  },
139455
139482
  constantHandlerMap: {
139456
139483
  ...appsInTossConstantBridges,
@@ -139461,11 +139488,11 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139461
139488
  right: insets.right
139462
139489
  }),
139463
139490
  ...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
139464
- getServerTime_isSupported: import_native_modules19.getServerTime.isSupported,
139465
- requestReview_isSupported: import_native_modules19.requestReview.isSupported,
139466
- loadAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob.isSupported,
139467
- showAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.showAppsInTossAdMob.isSupported,
139468
- isAppsInTossAdMobLoaded_isSupported: import_native_modules19.GoogleAdMob.isAppsInTossAdMobLoaded.isSupported,
139491
+ getServerTime_isSupported: import_native_modules18.getServerTime.isSupported,
139492
+ requestReview_isSupported: import_native_modules18.requestReview.isSupported,
139493
+ loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
139494
+ showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
139495
+ isAppsInTossAdMobLoaded_isSupported: import_native_modules18.GoogleAdMob.isAppsInTossAdMobLoaded.isSupported,
139469
139496
  loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
139470
139497
  showFullScreenAd_isSupported: showFullScreenAd.isSupported,
139471
139498
  fetchTossAd_isSupported: fetchTossAd.isSupported,
@@ -139475,7 +139502,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139475
139502
  },
139476
139503
  asyncHandlerMap: {
139477
139504
  ...appsInTossAsyncBridges,
139478
- getServerTime: import_native_modules19.getServerTime,
139505
+ getServerTime: import_native_modules18.getServerTime,
139479
139506
  setIosSwipeGestureEnabled: options => {
139480
139507
  setAllowsBackForwardNavigationGestures(options.isEnabled);
139481
139508
  return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
@@ -139505,18 +139532,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
139505
139532
  fetchContacts: appsInTossAsyncBridges.fetchContacts,
139506
139533
  getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
139507
139534
  openCamera: appsInTossAsyncBridges.openCamera,
139508
- getStorageItem: import_native_modules19.Storage.getItem,
139509
- setStorageItem: import_native_modules19.Storage.setItem,
139510
- removeStorageItem: import_native_modules19.Storage.removeItem,
139511
- clearItems: import_native_modules19.Storage.clearItems,
139512
- iapGetProductItemList: import_native_modules19.IAP.getProductItemList,
139513
- iapCreateOneTimePurchaseOrder: import_native_modules19.iapCreateOneTimePurchaseOrder,
139514
- processProductGrant: import_native_modules19.processProductGrant,
139515
- getPendingOrders: import_native_modules19.IAP.getPendingOrders,
139516
- getCompletedOrRefundedOrders: import_native_modules19.IAP.getCompletedOrRefundedOrders,
139517
- completeProductGrant: import_native_modules19.IAP.completeProductGrant,
139518
- getSubscriptionInfo: import_native_modules19.IAP.getSubscriptionInfo,
139519
- isAppsInTossAdMobLoaded: import_native_modules19.GoogleAdMob.isAppsInTossAdMobLoaded,
139535
+ getStorageItem: import_native_modules18.Storage.getItem,
139536
+ setStorageItem: import_native_modules18.Storage.setItem,
139537
+ removeStorageItem: import_native_modules18.Storage.removeItem,
139538
+ clearItems: import_native_modules18.Storage.clearItems,
139539
+ iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
139540
+ iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
139541
+ processProductGrant: import_native_modules18.processProductGrant,
139542
+ getPendingOrders: import_native_modules18.IAP.getPendingOrders,
139543
+ getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
139544
+ completeProductGrant: import_native_modules18.IAP.completeProductGrant,
139545
+ getSubscriptionInfo: import_native_modules18.IAP.getSubscriptionInfo,
139546
+ isAppsInTossAdMobLoaded: import_native_modules18.GoogleAdMob.isAppsInTossAdMobLoaded,
139520
139547
  tossAdEventLog,
139521
139548
  memoryDebugLog: webViewMemoryDebugLog,
139522
139549
  debugLog: function () {
@@ -141048,12 +141075,14 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
141048
141075
  loggerFunction = _config?.logger;
141049
141076
  }
141050
141077
  return {
141051
- screen: (groupId, params = {}) => {
141052
- loggerFunction?.({
141078
+ screen: (groupId, params = {}, onLog) => {
141079
+ var payload = {
141053
141080
  log_type: "screen",
141054
141081
  log_name: createLogName(groupId, "screen"),
141055
141082
  params
141056
- });
141083
+ };
141084
+ loggerFunction?.(payload);
141085
+ onLog?.(payload);
141057
141086
  },
141058
141087
  event: (groupId, params) => {
141059
141088
  var log_name = params.log_name,
@@ -141091,8 +141120,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
141091
141120
  return LOGGER_SHIM;
141092
141121
  }
141093
141122
  return {
141094
- screen: (_groupId, params2) => {
141095
- getLogger().screen(_groupId, params2);
141123
+ screen: (_groupId, params2, onLog) => {
141124
+ getLogger().screen(_groupId, params2, onLog);
141096
141125
  },
141097
141126
  event: _params => {
141098
141127
  getLogger().event(groupId, {
@@ -141366,10 +141395,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
141366
141395
  var session = useVisibilitySession();
141367
141396
  var logger = useLogger();
141368
141397
  return (0, import_react12.useMemo)(() => ({
141369
- log: (groupId, params) => {
141398
+ log: (groupId, params, onLog) => {
141370
141399
  var canConsume = session.consume();
141371
141400
  if (canConsume) {
141372
- logger.screen(groupId, params);
141401
+ logger.screen(groupId, params, onLog);
141373
141402
  }
141374
141403
  }
141375
141404
  }), [logger, session]);
@@ -141407,14 +141436,15 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
141407
141436
  children,
141408
141437
  groupId,
141409
141438
  params,
141410
- log = true
141439
+ log = true,
141440
+ onLog
141411
141441
  }) {
141412
141442
  var logger = useScreenLogger();
141413
141443
  (0, import_react13.useEffect)(() => {
141414
141444
  if (log) {
141415
- logger.log(groupId, params);
141445
+ logger.log(groupId, params, onLog);
141416
141446
  }
141417
- }, [groupId, params, log, logger]);
141447
+ }, [groupId, params, log, logger, onLog]);
141418
141448
  return (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, {
141419
141449
  children
141420
141450
  });
@@ -213815,7 +213845,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
213815
213845
  }
213816
213846
  \`;document.head.appendChild(e);})();
213817
213847
  `,
213818
- m = '"use strict";(()=>{var fe=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let r=this._window.__GRANITE_NATIVE_EMITTER;if(!r)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return r.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},E=new fe,W=()=>Math.random().toString(36).substring(2,15),z=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[r,n]of Object.entries(e))t[r]=n;return t}return e};function c(e){return(...t)=>{let r=W(),n=[],o=()=>{for(let s of n)s()};return new Promise((s,a)=>{n.push(E.on(`${e}/resolve/${r}`,i=>{o(),s(i)})),n.push(E.on(`${e}/reject/${r}`,i=>{o(),a(z(i))})),E.postMessage({type:"method",functionName:e,eventId:r,args:t})})}}function D(e){return t=>{let r=W(),n=[E.on(`${e}/onEvent/${r}`,o=>{t.onEvent(o)}),E.on(`${e}/onError/${r}`,o=>{t.onError(z(o))})];return E.postMessage({type:"addEventListener",functionName:e,eventId:r,args:t.options}),()=>{E.postMessage({type:"removeEventListener",functionName:e,eventId:r}),n.forEach(o=>o())}}}function v(e){return()=>E.getConstant(e)}var ve=function(){return{emit:function(t,r){for(var n=this.events[t]||[],o=0,s=n.length;o<s;o++)n[o](r)},events:{},on:function(t,r){var n=this,o,s;return((o=this.events)[s=t]||(o[s]=[])).push(r),function(){var a;n.events[t]=(a=n.events[t])===null||a===void 0?void 0:a.filter(function(i){return r!==i})}}}};typeof window<"u"&&(window.__GRANITE_NATIVE_EMITTER=ve());var at=c("closeView"),it=c("generateHapticFeedback"),dt=c("share"),ct=c("setSecureScreen"),ut=c("setScreenAwakeMode"),pt=c("getNetworkStatus"),mt=c("setIosSwipeGestureEnabled"),lt=c("openURL"),gt=c("openPermissionDialog"),ft=c("getPermission"),vt=c("requestPermission"),ht=v("setClipboardText"),wt=v("getClipboardText"),Et=v("fetchContacts"),bt=v("fetchAlbumPhotos"),At=v("getCurrentLocation"),_t=v("openCamera"),Ct=c("appLogin"),St=c("eventLog"),It=c("getTossShareLink"),Tt=c("setDeviceOrientation"),yt=c("checkoutPayment"),Rt=c("requestTossPayPaysBilling"),Lt=c("saveBase64Data"),Pt=c("appsInTossSignTossCert"),xt=c("getGameCenterGameProfile"),Dt=c("openGameCenterLeaderboard"),Nt=c("submitGameCenterLeaderBoardScore"),Mt=c("getAnonymousKey"),Ft=c("getUserKeyForGame"),Gt=c("grantPromotionReward"),Bt=c("grantPromotionRewardForGame"),kt=c("getIsTossLoginIntegratedService"),Ot=c("getServerTime"),Vt=c("requestReview"),Ht=v("getLocale"),qt=v("getSchemeUri"),Ut=v("getPlatformOS"),Wt=v("getOperationalEnvironment"),zt=v("getTossAppVersion"),$t=v("getDeviceId"),jt=v("getGroupId"),Kt=D("contactsViral"),Jt=D("startUpdateLocation"),Xt=D("onVisibilityChangedByTransparentServiceWeb");var S=class extends Error{constructor({methodName:e,message:t}){super(),this.name=`${e} permission error`,this.message=t}},$=class extends S{constructor(){super({methodName:"fetchAlbumPhotos",message:"\\uC0AC\\uC9C4\\uCCA9 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},j=class extends S{constructor(){super({methodName:"fetchContacts",message:"\\uC5F0\\uB77D\\uCC98 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},K=class extends S{constructor(){super({methodName:"openCamera",message:"\\uCE74\\uBA54\\uB77C \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}};var V=class extends S{constructor(){super({methodName:"getCurrentLocation",message:"\\uC704\\uCE58 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},J=V,X=class extends S{constructor(){super({methodName:"getClipboardText",message:"\\uD074\\uB9BD\\uBCF4\\uB4DC \\uC77D\\uAE30 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},Y=class extends S{constructor(){super({methodName:"setClipboardText",message:"\\uD074\\uB9BD\\uBCF4\\uB4DC \\uC4F0\\uAE30 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}};var he=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let r=this._window.__GRANITE_NATIVE_EMITTER;if(!r)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return r.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},b=new he,ie=()=>Math.random().toString(36).substring(2,15),de=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[r,n]of Object.entries(e))t[r]=n;return t}return e};function d(e){return(...t)=>{let r=ie(),n=[],o=()=>{for(let s of n)s()};return new Promise((s,a)=>{n.push(b.on(`${e}/resolve/${r}`,i=>{o(),s(i)})),n.push(b.on(`${e}/reject/${r}`,i=>{o(),a(de(i))})),b.postMessage({type:"method",functionName:e,eventId:r,args:t})})}}function A(e){return t=>{let r=ie(),n=[b.on(`${e}/onEvent/${r}`,o=>{t.onEvent(o)}),b.on(`${e}/onError/${r}`,o=>{t.onError(de(o))})];return b.postMessage({type:"addEventListener",functionName:e,eventId:r,args:t.options}),()=>{b.postMessage({type:"removeEventListener",functionName:e,eventId:r}),n.forEach(o=>o())}}}function p(e){return()=>b.getConstant(e)}var ar={getItem:d("getStorageItem"),setItem:d("setStorageItem"),removeItem:d("removeStorageItem"),clearItems:d("clearItems")},we=/^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\\\-]+(?:\\.[\\da-z\\\\-]+)*))?(?:\\+[\\da-z\\\\-]+(?:\\.[\\da-z\\\\-]+)*)?)?)?$/i,Z=e=>["*","x","X"].includes(e),Q=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Ee=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],be=(e,t)=>{if(Z(e)||Z(t))return 0;let[r,n]=Ee(Q(e),Q(t));return r>n?1:r<n?-1:0},ee=e=>{if(typeof e!="string")throw new TypeError("Invalid argument: expected a string");let t=e.match(we);if(!t)throw new Error(`Invalid semver: \'${e}\'`);let[,r,n,o,s,a]=t;return[r,n,o,s,a]},te=(e,t)=>{let r=Math.max(e.length,t.length);for(let n=0;n<r;n++){let o=e[n]??"0",s=t[n]??"0",a=be(o,s);if(a!==0)return a}return 0},Ae=(e,t)=>{let r=ee(e),n=ee(t),o=r.pop(),s=n.pop(),a=te(r,n);return a!==0?a:o&&s?te(o.split("."),s.split(".")):o?-1:s?1:0};function H(e){if(p("getOperationalEnvironment")()==="sandbox")return!0;let r=p("getTossAppVersion")(),o=p("getPlatformOS")()==="ios"?e.ios:e.android;return o===void 0?!1:o==="always"?!0:o==="never"?!1:Ae(r,o)>=0}function re(e){return d("processProductGrant")(e)}var ir={createOneTimePurchaseOrder:e=>{let t=H({android:"5.219.0",ios:"5.219.0"}),r=()=>{};if(!t)return r;let n=H({android:"5.231.1",ios:"5.230.0"}),{options:o,onEvent:s,onError:a}=e,i=o.sku??o.productId;return n?A("requestOneTimePurchase")({options:{sku:i},onEvent:async l=>{if(l.type==="purchased"){let u=await o.processProductGrant({orderId:l.data.orderId});await re({orderId:l.data.orderId,isProductGranted:u}).catch(a)}else s(l)},onError:l=>{a(l)}}):(d("iapCreateOneTimePurchaseOrder")({productId:i}).then(u=>{Promise.resolve(o.processProductGrant({orderId:u.orderId})).then(()=>{s({type:"success",data:u})}).catch(f=>{a(f)})}).catch(u=>{a(u)}),r)},createSubscriptionPurchaseOrder:e=>{let t=H({android:"5.248.0",ios:"5.249.0"}),r=()=>{};if(!t)return r;let{options:n,onEvent:o,onError:s}=e,{sku:a,offerId:i,processProductGrant:m}=n;return A("requestSubscriptionPurchase")({options:{sku:a,offerId:i??null},onEvent:async u=>{if(u.type==="purchased"){let f=await m({orderId:u.data.orderId,subscriptionId:u.data.subscriptionId});await re({orderId:u.data.orderId,isProductGranted:f}).catch(s)}else o(u)},onError:u=>{s(u)}})},getProductItemList:d("iapGetProductItemList"),getPendingOrders:d("getPendingOrders"),getCompletedOrRefundedOrders:d("getCompletedOrRefundedOrders"),completeProductGrant:d("completeProductGrant"),getSubscriptionInfo:d("getSubscriptionInfo")},dr=p("getSafeAreaInsets");var cr=p("getSafeAreaInsets");var ur={loadAppsInTossAdMob:Object.assign(A("loadAppsInTossAdMob"),{isSupported:p("loadAppsInTossAdMob_isSupported")}),showAppsInTossAdMob:Object.assign(A("showAppsInTossAdMob"),{isSupported:p("showAppsInTossAdMob_isSupported")}),isAppsInTossAdMobLoaded:Object.assign(d("isAppsInTossAdMobLoaded"),{isSupported:p("isAppsInTossAdMobLoaded_isSupported")})};var pr={getDeploymentId:p("getDeploymentId")},mr=p("deploymentId"),lr=p("brandDisplayName"),gr=p("brandIcon"),fr=p("brandPrimaryColor");var vr={addAccessoryButton:d("addAccessoryButton"),removeAccessoryButton:d("removeAccessoryButton")},_e=d("requestPermission"),Ce=d("getPermission"),Se=d("openPermissionDialog");function I({permission:e,handler:t,error:r}){let n=async(...o)=>{if(await _e(e)==="denied")throw new r;return t(...o)};return n.getPermission=()=>Ce(e),n.openPermissionDialog=()=>Se(e),n}var wr=I({handler:e=>d("fetchAlbumPhotos")(e),permission:{name:"photos",access:"read"},error:$}),br=I({handler:e=>d("fetchContacts")(e),permission:{name:"contacts",access:"read"},error:j}),_r=I({handler:e=>d("getCurrentLocation")(e),permission:{name:"geolocation",access:"access"},error:V}),Sr=I({handler:e=>d("openCamera")(e),permission:{name:"camera",access:"access"},error:K}),Tr=I({handler:e=>d("setClipboardText")(e),permission:{name:"clipboard",access:"write"},error:Y}),Rr=I({handler:()=>d("getClipboardText")(),permission:{name:"clipboard",access:"read"},error:X}),Ie=d("getPermission"),Te=d("openPermissionDialog"),ce=e=>A("updateLocationEvent")({...e,onError:t=>{let r=new J;return t instanceof Error&&t.name===r.name?e.onError(r):e.onError(t)}});ce.getPermission=()=>Ie({name:"geolocation",access:"access"});ce.openPermissionDialog=()=>Te({name:"geolocation",access:"access"});var Pr=Object.assign(A("loadFullScreenAd"),{isSupported:p("loadFullScreenAd_isSupported")}),xr=Object.assign(A("showFullScreenAd"),{isSupported:p("showFullScreenAd_isSupported")}),P=new WeakMap;function ye(e,t){let r=P.get(e);if(r)return r;let n=t(),o=!1,s={destroy(){o||(o=!0,P.get(e)===s&&P.delete(e),n.destroy())}};return P.set(e,s),s}function Re(){P=new WeakMap}var Le=d("openURL");function Pe(e){let t=xe(e);return Le(t)}function xe(e){return["http://","https://"].some(r=>e.startsWith(r))?De(e):e}function De(e){return`supertoss://web?url=${encodeURIComponent(e)}&external=true`}var ne="https://static.toss.im/ads/sdk/toss-ads-space-kit-1.3.0.js",oe=15e3,N=null;function C(){if(!(typeof window>"u"))return window.TossAdsSpaceKit}function Ne(){if(typeof window>"u"||typeof document>"u")return Promise.reject(new Error("Ads SDK can only be loaded in a browser environment."));let e=C();if(e)return Promise.resolve(e);if(N)return N;let t=new Promise((r,n)=>{let o=document.createElement("script"),s=()=>{o.removeEventListener("load",a),o.removeEventListener("error",i),window.clearTimeout(m),N=null},a=()=>{let l=C();if(l){s(),r(l);return}s(),n(new Error("Ads SDK script loaded but window.TossAdsSpaceKit was not exposed."))},i=()=>{s(),n(new Error(`Failed to load Ads SDK script from ${ne}.`))},m=window.setTimeout(()=>{s(),n(new Error(`Loading Ads SDK timed out after ${oe}ms.`))},oe);o.addEventListener("load",a),o.addEventListener("error",i),o.async=!0,o.src=ne,document.head.appendChild(o)});return N=t,t}var _=Object.assign(A("fetchTossAd"),{isSupported:p("fetchTossAd_isSupported")}),Me=d("tossAdEventLog"),Fe=new Set(["1","2"]),ue="\\uC798\\uBABB\\uB41C \\uC694\\uCCAD\\uC774\\uC5D0\\uC694. \\uD544\\uC694\\uD55C \\uAC12\\uC774 \\uBE44\\uC5B4 \\uC788\\uC5B4\\uC694.";function M(e){return e.trim()}function q(){return new Error(ue)}function Ge(){return{resultType:"FAIL",error:{reason:ue}}}function Be(e){return new Promise((t,r)=>{if(!_.isSupported()){r(new Error("fetchTossAd is not supported in this environment."));return}let n=M(e.adGroupId);if(n.length===0){r(q());return}return _({options:{...e,adGroupId:n},onEvent:t,onError:r})})}function se(e){let t=Array.isArray(e.ads)?e.ads.filter(r=>Fe.has(String(r.styleId))):[];return{requestId:e.requestId??"",status:e.status??"OK",ads:t,ext:e.ext}}function ke(e){return Oe(e)?e.resultType!=="SUCCESS"?e:e.success?{...e,success:se(e.success)}:{resultType:"FAIL",error:{reason:"fetchTossAd returned SUCCESS without payload"}}:Ve(e)?{resultType:"SUCCESS",success:se(e)}:{resultType:"FAIL",error:{reason:"Invalid response from fetchTossAd"}}}function Oe(e){return!!(e&&typeof e=="object"&&"resultType"in e)}function Ve(e){return!!(e&&typeof e=="object"&&"ads"in e)}function He(){return async(e,t)=>{let r=M(t.spaceUnitId);if(r.length===0)return Ge();try{let n=await Be({adGroupId:r,sdkId:"108",availableStyleIds:["1","2"]});return ke(n)}catch(n){return{resultType:"FAIL",error:{reason:n instanceof Error?n.message:"Unknown fetchTossAd error"}}}}}var L=null;function qe(e){let{callbacks:t}=e,r=()=>t?.onInitialized?.(),n=a=>{let i=a instanceof Error?a:new Error(String(a));t?.onInitializationFailed?.(i)};if(C()?.isInitialized()){r();return}if(L!=null){L.then(r).catch(n);return}let s=Ne().then(a=>{if(a.isInitialized())return;let m={environment:"live",customAdFetcher:He(),opener:Pe};a.init(m)});L=s,s.then(r).catch(n).finally(()=>{L===s&&(L=null)})}function Ue(e,t,r={}){let{callbacks:n}=r,o=M(e),s=a=>{let i=a instanceof Error?a:new Error(String(a));n?.onAdFailedToRender?.({slotId:"",adGroupId:o,adMetadata:{},error:{code:0,message:i.message}})};try{let a=o;if(a.length===0)throw q();let i=C();if(!i)throw new Error("[toss-ad] Call initialize() before attaching an ad.");if(!i.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads.");let m=typeof t=="string"?document.querySelector(t):t;if(!m)throw new Error(`[toss-ad] Failed to find target element: ${t}`);let l={spaceId:a,autoLoad:!0,theme:r.theme,padding:r.padding,callbacks:me(o,r.callbacks)};i.banner.createSlot(m,l)}catch(a){s(a)}}var We="16px 20px",ze="20px",$e="auto",je="blackAndWhite",Ke="expanded",h="toss-ads-attach",ae="toss-ads-attach-style",pe="data-toss-ads-attach-banner-wrapper";function Je(e){let t=e.ownerDocument;if(!t||t.getElementById(ae))return;let r=t.createElement("style");r.id=ae,r.textContent=`\n .${h} { background: #ffffff; }\n .${h}.toss-ads-tone-grey { background: #f2f4f7; }\n @media (prefers-color-scheme: dark) {\n .${h} { background: #17171c; }\n .${h}.toss-ads-tone-grey { background: #101013; }\n }\n .${h}.toss-ads-theme-light { background: #ffffff; }\n .${h}.toss-ads-theme-light.toss-ads-tone-grey { background: #f2f4f7; }\n .${h}.toss-ads-theme-dark { background: #17171c; }\n .${h}.toss-ads-theme-dark.toss-ads-tone-grey { background: #101013; }\n `;let n=t.head??t.body??t.documentElement;n&&n.appendChild(r)}function Xe(e){Array.from(e.children).forEach(t=>{t instanceof HTMLElement&&t.getAttribute(pe)==="true"&&e.removeChild(t)})}function Ye(e,t,r={}){let{callbacks:n,theme:o=$e,tone:s=je,variant:a=Ke}=r,i=M(e),m=u=>{let f=u instanceof Error?u:new Error(String(u));n?.onAdFailedToRender?.({slotId:"",adGroupId:i,adMetadata:{},error:{code:0,message:f.message}})},l=me(i,n);try{let u=i;if(u.length===0)throw q();let f=C();if(!f)throw new Error("[toss-ad] Call initialize() before attaching an ad.");if(!f.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads.");let R=typeof t=="string"?document.querySelector(t):t;if(!R)throw new Error(`[toss-ad] Failed to find target element: ${t}`);return ye(R,()=>{let g=document.createElement("div");g.style.width="100%",g.style.height="100%",g.style.boxSizing="border-box",g.style.display="flex",g.style.flexDirection="column",g.style.justifyContent="center",g.style.overflow="hidden",g.setAttribute(pe,"true"),a==="card"&&(g.style.padding="0 10px");let w=document.createElement("div");w.classList.add(h),s==="grey"&&w.classList.add("toss-ads-tone-grey"),o==="light"?w.classList.add("toss-ads-theme-light"):o==="dark"&&w.classList.add("toss-ads-theme-dark"),a==="card"&&(w.style.borderRadius="16px",w.style.overflow="hidden"),g.appendChild(w);let x=!1,U=null;try{Je(R),Xe(R),R.appendChild(g),x=!0;let O={spaceId:u,autoLoad:!0,theme:o==="auto"?void 0:o,renderPadding:ge=>ge==="1"?We:ze,callbacks:l};U=f.banner.createSlot(w,O)}catch(O){throw x&&g.parentNode&&g.parentNode.removeChild(g),O}return{destroy(){U?.destroy(),x&&g.parentNode&&g.parentNode.removeChild(g),x=!1}}})}catch(u){return m(u),{destroy(){}}}}function Ze(e){let t=C();t?.banner&&t.banner.destroy(e)}function Qe(){let e=C();e?.banner&&(e.banner.destroyAll(),Re())}function me(e,t){if(!t)return;let r=n=>{let o={...n??{}};return o.adGroupId=o.adGroupId??o.spaceId??e,delete o.spaceId,o};return{onAdRendered:n=>t.onAdRendered?.(r(n)),onAdViewable:n=>t.onAdViewable?.(r(n)),onAdClicked:n=>t.onAdClicked?.(r(n)),onAdImpression:n=>{Me({log_name:"display_ads_all::impression__1px_banner",log_type:"event",params:{event_type:"impression",schema_id:1812034,request_id:n?.adMetadata?.requestId??""}}),t.onAdImpression?.(r(n))},onAdFailedToRender:n=>t.onAdFailedToRender?.({...r(n),error:n?.error??{code:0,message:"UNKNOWN"}}),onNoFill:n=>t.onNoFill?.(r(n))}}var Dr={initialize:Object.assign(qe,{isSupported:_.isSupported}),attach:Object.assign(Ue,{isSupported:_.isSupported}),attachBanner:Object.assign(Ye,{isSupported:_.isSupported}),destroy:Object.assign(Ze,{isSupported:_.isSupported}),destroyAll:Object.assign(Qe,{isSupported:_.isSupported})},Nr=Object.assign(d("getServerTime"),{isSupported:p("getServerTime_isSupported")}),Mr=Object.assign(d("requestReview"),{isSupported:p("requestReview_isSupported")});var F=class{_log=d("debugLog");log(t,r){try{this._log({log_name:`apps_in_toss_webview_${t}`,log_type:"debug",params:{...r,...this.getCommonParams()}})}catch{}}getCommonParams(){return{...this.getLocationInfo(),...this.getNavigatorInfo(),...this.getScreenInfo(),appName:window.__appsInToss.appName,deploymentId:window.__appsInToss.deploymentId,sessionId:window.__appsInToss.sessionId,isGame:window.__appsInToss.webViewType==="game",timestampMs:Date.now()}}getLocationInfo(){return{url:window.location.href,urlOrigin:window.location.origin,urlHost:window.location.hostname,urlPath:window.location.pathname,urlSearch:window.location.search}}getNavigatorInfo(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory?navigator.deviceMemory*1024*1024:void 0,maxTouchPoints:navigator.maxTouchPoints}}getScreenInfo(){return{screenWidth:screen.width,screenHeight:screen.height,availableScreenWidth:screen.availWidth,availableScreenHeight:screen.availHeight,devicePixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}};var G=class{callbacks={};on(t,r){return typeof this.callbacks[t]>"u"&&(this.callbacks[t]=[]),this.callbacks[t].push(r),()=>{this.callbacks[t]=this.callbacks[t]?.filter(n=>n!==r)??[]}}emit(t,r){this.callbacks[t]?.forEach(n=>n(r))}};window.__appsInToss={appName:p("getAppName")(),deploymentId:p("getDeploymentId")(),webViewType:p("getWebViewType")(),sessionId:Math.random().toString(36).substring(2),eventEmitter:new G,debugLogger:new F};var T=/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/;function B(e){window.fetch=new Proxy(window.fetch,{apply:e})}(()=>{if(window.__appsInToss.webViewType!=="game"||typeof caches>"u")return;let e="@apps-in-toss/caches/",t=`${e}${window.__appsInToss.deploymentId}`;window.addEventListener("load",async()=>{let r=await caches.keys();for(let n of r)n.startsWith(e)&&n!==t&&await caches.delete(n)}),B(async(r,n,o)=>{let s=new Request(o[0],o[1]);if(!T.test(s.url))return await r.call(n,s);let a=await caches.open(t),i=await a.match(s);if(i){let l=i.headers.get("ETag"),u=i.headers.get("Last-Modified");l&&s.headers.set("If-None-Match",l),u&&s.headers.set("If-Modified-Since",u);let f=await r.call(n,s);return f.status===304?(i.__revalidateResponse=f,i):(a.put(s,f.clone()),f)}let m=await r.call(n,s);return a.put(s,m.clone()),m})})();B(async(e,t,r)=>{let n=new Request(r[0],r[1]),o=Date.now();window.__appsInToss.eventEmitter.emit("fetchRequest",{request:n});try{let s=await e.call(t,n);return window.__appsInToss.eventEmitter.emit("fetchResponse",{request:n,response:s,requestAt:o}),s}catch(s){throw window.__appsInToss.eventEmitter.emit("fetchError",{request:n,requestAt:o,error:s}),s}});HTMLCanvasElement.prototype.getContext=new Proxy(HTMLCanvasElement.prototype.getContext,{apply:(e,t,r)=>{let n=e.apply(t,r);return(n instanceof WebGL2RenderingContext||n instanceof WebGLRenderingContext)&&window.__appsInToss.eventEmitter.emit("webglGetContext",{canvas:t,context:n}),n}});var le=window.__appsInToss.debugLogger;le.log("load_start",{});window.addEventListener("load",()=>{let e=performance.timeOrigin,t=performance.getEntriesByType?.("navigation")[0]??null,r=typeof e<"u"&&t!==null,n=r?{navigationStartAtMs:e+t.startTime,navigationRedirectStartAtMs:e+t.redirectStart,navigationRedirectEndAtMs:e+t.redirectEnd,navigationRedirectCount:t.redirectCount,navigationServiceWorkerStartAtMs:e+t.workerStart,navigationFetchStartAtMs:e+t.fetchStart,navigationDomainLookupStartAtMs:e+t.domainLookupStart,navigationDomainLookupEndAtMs:e+t.domainLookupEnd,navigationConnectStartAtMs:e+t.connectStart,navigationSecureConnectStartAtMs:e+t.secureConnectionStart,navigationConnectEndAtMs:e+t.connectEnd,navigationRequestStartAtMs:e+t.requestStart,navigationResponseStartAtMs:e+t.responseStart,navigationResponseEndAtMs:e+t.responseEnd,navigationDomInteractiveAtMs:e+t.domInteractive,navigationDomContentLoadedEventStartAtMs:e+t.domContentLoadedEventStart,navigationDomContentLoadedEventEndAtMs:e+t.domContentLoadedEventEnd,navigationDomCompleteAtMs:e+t.domComplete}:{};le.log("load_complete",{isNavigationDebugSupported:r,...n})});function y(e,t){return parseFloat(e.toFixed(t))}(()=>{if(typeof performance.memory>"u"||typeof performance.memory.usedJSHeapSize>"u"||typeof performance.memory.totalJSHeapSize>"u"||typeof performance.memory.jsHeapSizeLimit>"u")return;function e(t){window.__appsInToss.debugLogger.log(t,{usedJSHeapSize:y(performance.memory.usedJSHeapSize/1024,2),totalJSHeapSize:y(performance.memory.totalJSHeapSize/1024,2),jsHeapSizeLimit:y(performance.memory.jsHeapSizeLimit/1024,2)})}e("memory_usage_first_0s"),setTimeout(()=>e("memory_usage_first_1s"),1e3),setTimeout(()=>e("memory_usage_first_10s"),1e4),setTimeout(()=>e("memory_usage_first_30s"),3e4),setTimeout(()=>e("memory_usage_first_60s"),6e4),setInterval(()=>e("memory_usage_every_180s"),18e4)})();(()=>{let e=window.__appsInToss.debugLogger,t=performance.timeOrigin;if(typeof t>"u"||typeof PerformanceObserver>"u")return;new PerformanceObserver(o=>{o.getEntries().forEach(a=>{a.name==="first-paint"?e.log("first_paint",{fpStartAtMs:t+a.startTime}):a.name==="first-contentful-paint"&&e.log("first_contentful_paint",{fcpStartAtMs:t+a.startTime})})}).observe({type:"paint"}),new PerformanceObserver(o=>{o.getEntries().forEach(a=>{e.log("largest_contentful_paint",{lcpStartAtMs:t+a.startTime,lcpRenderSize:a.size})})}).observe({type:"largest-contentful-paint"})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.eventEmitter.on("webglGetContext",({canvas:t,context:r})=>{if(t.getAttribute("id")!=="unity-canvas")return;e();let n=r.getExtension("WEBGL_debug_renderer_info"),o=r.getParameter(r.MAX_VIEWPORT_DIMS),s={webGLRenderer:r.getParameter(r.RENDERER),webGLVendor:r.getParameter(r.VENDOR),webGLVersion:r.getParameter(r.VERSION),webGLShadingLanguageVersion:r.getParameter(r.SHADING_LANGUAGE_VERSION),webGLMaxTextureSize:r.getParameter(r.MAX_TEXTURE_SIZE),webGLMaxViewportWidth:o[0],webGLMaxViewportHeight:o[1],webGLMaxRenderbufferSize:r.getParameter(r.MAX_RENDERBUFFER_SIZE)},a=n?{webGLUnmaskedVendor:r.getParameter(n.UNMASKED_VENDOR_WEBGL),webGLUnmaskedRenderer:r.getParameter(n.UNMASKED_RENDERER_WEBGL)}:{};window.__appsInToss.debugLogger.log("unity_webgl_info",{...s,...a})})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.debugLogger,t=window.__appsInToss.eventEmitter;t.on("fetchRequest",({request:n})=>{T.test(n.url)&&e.log("game_resource_download_start",{gameResourceRequestURL:n.url})});function r({request:n,requestAt:o,error:s}){e.log("game_resource_download_error",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:o,gameResourceError:s instanceof Error?s.message:"Unknown Error"})}t.on("fetchResponse",async({request:n,requestAt:o,response:s})=>{if(!T.test(n.url))return;let a=await s.clone().blob().then(m=>y(m.size/1024,2)).catch(m=>(r({request:n,requestAt:o,error:m}),null));if(a===null)return;let i=Date.now();e.log("game_resource_download_end",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:o,gameResourceResponseAtMs:i,gameResourceResponseSize:a,gameResourceResponseStatus:s.__revalidateResponse?.status??s.status,gameResourceDownloadDurationMs:i-o})}),t.on("fetchError",async({request:n,requestAt:o,error:s})=>{T.test(n.url)&&r({request:n,requestAt:o,error:s})})})();var k=[];function et(){let e=0;function t(r){let n=performance.now();if(r<n-1e3){k.push(e);return}e+=1,window.requestAnimationFrame(()=>t(r))}window.requestAnimationFrame(()=>t(performance.now()))}function tt(){if(k.length===0)return;let e=k;k=[];let t=rt(e).toSorted(),r={};for(let o=0;o<=100;o+=10){let s=t[Math.floor((t.length-1)*(o/100))];s&&(r[`fpsP${o}`]=s)}let n=t.reduce((o,s)=>o+s,0);r.fpsAverage=n/t.length,window.__appsInToss.debugLogger.log("fps_every_300s",r)}function rt(e){let t=new Set(e);return Array.from(t.values())}setInterval(()=>et(),1e3);setInterval(()=>tt(),3e5);})();\n';
213848
+ m = '"use strict";(()=>{var ve=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let r=this._window.__GRANITE_NATIVE_EMITTER;if(!r)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return r.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},E=new ve,z=()=>Math.random().toString(36).substring(2,15),$=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[r,n]of Object.entries(e))t[r]=n;return t}return e};function c(e){return(...t)=>{let r=z(),n=[],o=()=>{for(let s of n)s()};return new Promise((s,a)=>{n.push(E.on(`${e}/resolve/${r}`,i=>{o(),s(i)})),n.push(E.on(`${e}/reject/${r}`,i=>{o(),a($(i))})),E.postMessage({type:"method",functionName:e,eventId:r,args:t})})}}function D(e){return t=>{let r=z(),n=[E.on(`${e}/onEvent/${r}`,o=>{t.onEvent(o)}),E.on(`${e}/onError/${r}`,o=>{t.onError($(o))})];return E.postMessage({type:"addEventListener",functionName:e,eventId:r,args:t.options}),()=>{E.postMessage({type:"removeEventListener",functionName:e,eventId:r}),n.forEach(o=>o())}}}function v(e){return()=>E.getConstant(e)}var he=function(){return{emit:function(t,r){for(var n=this.events[t]||[],o=0,s=n.length;o<s;o++)n[o](r)},events:{},on:function(t,r){var n=this,o,s;return((o=this.events)[s=t]||(o[s]=[])).push(r),function(){var a;n.events[t]=(a=n.events[t])===null||a===void 0?void 0:a.filter(function(i){return r!==i})}}}};typeof window<"u"&&(window.__GRANITE_NATIVE_EMITTER=he());var it=c("closeView"),dt=c("generateHapticFeedback"),ct=c("share"),ut=c("setSecureScreen"),pt=c("setScreenAwakeMode"),lt=c("getNetworkStatus"),mt=c("setIosSwipeGestureEnabled"),gt=c("openURL"),ft=c("openPermissionDialog"),vt=c("getPermission"),ht=c("requestPermission"),wt=v("setClipboardText"),Et=v("getClipboardText"),At=v("fetchContacts"),bt=v("fetchAlbumPhotos"),_t=v("getCurrentLocation"),St=v("openCamera"),Ct=c("appLogin"),It=c("eventLog"),yt=c("getTossShareLink"),Tt=c("setDeviceOrientation"),Rt=c("checkoutPayment"),Lt=c("requestTossPayPaysBilling"),Pt=c("saveBase64Data"),xt=c("appsInTossSignTossCert"),Dt=c("getGameCenterGameProfile"),Nt=c("openGameCenterLeaderboard"),Mt=c("submitGameCenterLeaderBoardScore"),Ft=c("getAnonymousKey"),Gt=c("getUserKeyForGame"),Bt=c("grantPromotionReward"),kt=c("grantPromotionRewardForGame"),Ot=c("getIsTossLoginIntegratedService"),Vt=c("getServerTime"),Ht=c("requestReview"),qt=v("getLocale"),Ut=v("getSchemeUri"),Wt=v("getPlatformOS"),zt=v("getOperationalEnvironment"),$t=v("getTossAppVersion"),jt=v("getDeviceId"),Kt=v("getGroupId"),Jt=D("contactsViral"),Xt=D("startUpdateLocation"),Yt=D("onVisibilityChangedByTransparentServiceWeb");var C=class extends Error{constructor({methodName:e,message:t}){super(),this.name=`${e} permission error`,this.message=t}},j=class extends C{constructor(){super({methodName:"fetchAlbumPhotos",message:"\\uC0AC\\uC9C4\\uCCA9 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},K=class extends C{constructor(){super({methodName:"fetchContacts",message:"\\uC5F0\\uB77D\\uCC98 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},J=class extends C{constructor(){super({methodName:"openCamera",message:"\\uCE74\\uBA54\\uB77C \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}};var V=class extends C{constructor(){super({methodName:"getCurrentLocation",message:"\\uC704\\uCE58 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},X=V,Y=class extends C{constructor(){super({methodName:"getClipboardText",message:"\\uD074\\uB9BD\\uBCF4\\uB4DC \\uC77D\\uAE30 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}},Z=class extends C{constructor(){super({methodName:"setClipboardText",message:"\\uD074\\uB9BD\\uBCF4\\uB4DC \\uC4F0\\uAE30 \\uAD8C\\uD55C\\uC774 \\uAC70\\uBD80\\uB418\\uC5C8\\uC5B4\\uC694."})}};var we=class{get _window(){return typeof window<"u"?window:{ReactNativeWebView:{postMessage:()=>{}},__GRANITE_NATIVE_EMITTER:{on:()=>()=>{}},__CONSTANT_HANDLER_MAP:{}}}postMessage(e){let t=this._window.ReactNativeWebView;if(!t)throw new Error("ReactNativeWebView is not available in browser environment");t.postMessage(JSON.stringify(e))}on(e,t){let r=this._window.__GRANITE_NATIVE_EMITTER;if(!r)throw new Error("__GRANITE_NATIVE_EMITTER is not available");return r.on(e,t)}getConstant(e){let t=this._window.__CONSTANT_HANDLER_MAP;if(t&&e in t)return t[e];throw new Error(`${e} is not a constant handler`)}},A=new we,de=()=>Math.random().toString(36).substring(2,15),ce=e=>{if(e&&e.__isError){let t=new Error(e.message);for(let[r,n]of Object.entries(e))t[r]=n;return t}return e};function d(e){return(...t)=>{let r=de(),n=[],o=()=>{for(let s of n)s()};return new Promise((s,a)=>{n.push(A.on(`${e}/resolve/${r}`,i=>{o(),s(i)})),n.push(A.on(`${e}/reject/${r}`,i=>{o(),a(ce(i))})),A.postMessage({type:"method",functionName:e,eventId:r,args:t})})}}function b(e){return t=>{let r=de(),n=[A.on(`${e}/onEvent/${r}`,o=>{t.onEvent(o)}),A.on(`${e}/onError/${r}`,o=>{t.onError(ce(o))})];return A.postMessage({type:"addEventListener",functionName:e,eventId:r,args:t.options}),()=>{A.postMessage({type:"removeEventListener",functionName:e,eventId:r}),n.forEach(o=>o())}}}function p(e){return()=>A.getConstant(e)}var ir={getItem:d("getStorageItem"),setItem:d("setStorageItem"),removeItem:d("removeStorageItem"),clearItems:d("clearItems")},Ee=/^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\\\-]+(?:\\.[\\da-z\\\\-]+)*))?(?:\\+[\\da-z\\\\-]+(?:\\.[\\da-z\\\\-]+)*)?)?)?$/i,Q=e=>["*","x","X"].includes(e),ee=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Ae=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],be=(e,t)=>{if(Q(e)||Q(t))return 0;let[r,n]=Ae(ee(e),ee(t));return r>n?1:r<n?-1:0},te=e=>{if(typeof e!="string")throw new TypeError("Invalid argument: expected a string");let t=e.match(Ee);if(!t)throw new Error(`Invalid semver: \'${e}\'`);let[,r,n,o,s,a]=t;return[r,n,o,s,a]},re=(e,t)=>{let r=Math.max(e.length,t.length);for(let n=0;n<r;n++){let o=e[n]??"0",s=t[n]??"0",a=be(o,s);if(a!==0)return a}return 0},_e=(e,t)=>{let r=te(e),n=te(t),o=r.pop(),s=n.pop(),a=re(r,n);return a!==0?a:o&&s?re(o.split("."),s.split(".")):o?-1:s?1:0};function H(e){if(p("getOperationalEnvironment")()==="sandbox")return!0;let r=p("getTossAppVersion")(),o=p("getPlatformOS")()==="ios"?e.ios:e.android;return o===void 0?!1:o==="always"?!0:o==="never"?!1:_e(r,o)>=0}function ne(e){return d("processProductGrant")(e)}var dr={createOneTimePurchaseOrder:e=>{let t=H({android:"5.219.0",ios:"5.219.0"}),r=()=>{};if(!t)return r;let n=H({android:"5.231.1",ios:"5.230.0"}),{options:o,onEvent:s,onError:a}=e,i=o.sku??o.productId;return n?b("requestOneTimePurchase")({options:{sku:i},onEvent:async g=>{if(g.type==="purchased"){let u=await o.processProductGrant({orderId:g.data.orderId});await ne({orderId:g.data.orderId,isProductGranted:u}).catch(a)}else s(g)},onError:g=>{a(g)}}):(d("iapCreateOneTimePurchaseOrder")({productId:i}).then(u=>{Promise.resolve(o.processProductGrant({orderId:u.orderId})).then(()=>{s({type:"success",data:u})}).catch(f=>{a(f)})}).catch(u=>{a(u)}),r)},createSubscriptionPurchaseOrder:e=>{let t=H({android:"5.248.0",ios:"5.249.0"}),r=()=>{};if(!t)return r;let{options:n,onEvent:o,onError:s}=e,{sku:a,offerId:i,processProductGrant:m}=n;return b("requestSubscriptionPurchase")({options:{sku:a,offerId:i??null},onEvent:async u=>{if(u.type==="purchased"){let f=await m({orderId:u.data.orderId,subscriptionId:u.data.subscriptionId});await ne({orderId:u.data.orderId,isProductGranted:f}).catch(s)}else o(u)},onError:u=>{s(u)}})},getProductItemList:d("iapGetProductItemList"),getPendingOrders:d("getPendingOrders"),getCompletedOrRefundedOrders:d("getCompletedOrRefundedOrders"),completeProductGrant:d("completeProductGrant"),getSubscriptionInfo:d("getSubscriptionInfo")},cr=p("getSafeAreaInsets");var ur=p("getSafeAreaInsets");var pr={loadAppsInTossAdMob:Object.assign(b("loadAppsInTossAdMob"),{isSupported:p("loadAppsInTossAdMob_isSupported")}),showAppsInTossAdMob:Object.assign(b("showAppsInTossAdMob"),{isSupported:p("showAppsInTossAdMob_isSupported")}),isAppsInTossAdMobLoaded:Object.assign(d("isAppsInTossAdMobLoaded"),{isSupported:p("isAppsInTossAdMobLoaded_isSupported")})};var lr={getDeploymentId:p("getDeploymentId")},mr=p("deploymentId"),gr=p("brandDisplayName"),fr=p("brandIcon"),vr=p("brandPrimaryColor");var hr={addAccessoryButton:d("addAccessoryButton"),removeAccessoryButton:d("removeAccessoryButton")},Se=d("requestPermission"),Ce=d("getPermission"),Ie=d("openPermissionDialog");function I({permission:e,handler:t,error:r}){let n=async(...o)=>{if(await Se(e)==="denied")throw new r;return t(...o)};return n.getPermission=()=>Ce(e),n.openPermissionDialog=()=>Ie(e),n}var Er=I({handler:e=>d("fetchAlbumPhotos")(e),permission:{name:"photos",access:"read"},error:j}),br=I({handler:e=>d("fetchContacts")(e),permission:{name:"contacts",access:"read"},error:K}),Sr=I({handler:e=>d("getCurrentLocation")(e),permission:{name:"geolocation",access:"access"},error:V}),Ir=I({handler:e=>d("openCamera")(e),permission:{name:"camera",access:"access"},error:J}),Tr=I({handler:e=>d("setClipboardText")(e),permission:{name:"clipboard",access:"write"},error:Z}),Lr=I({handler:()=>d("getClipboardText")(),permission:{name:"clipboard",access:"read"},error:Y}),ye=d("getPermission"),Te=d("openPermissionDialog"),ue=e=>b("updateLocationEvent")({...e,onError:t=>{let r=new X;return t instanceof Error&&t.name===r.name?e.onError(r):e.onError(t)}});ue.getPermission=()=>ye({name:"geolocation",access:"access"});ue.openPermissionDialog=()=>Te({name:"geolocation",access:"access"});var xr=Object.assign(b("loadFullScreenAd"),{isSupported:p("loadFullScreenAd_isSupported")}),Dr=Object.assign(b("showFullScreenAd"),{isSupported:p("showFullScreenAd_isSupported")}),P=new WeakMap;function Re(e,t){let r=P.get(e);if(r)return r;let n=t(),o=!1,s={destroy(){o||(o=!0,P.get(e)===s&&P.delete(e),n.destroy())}};return P.set(e,s),s}function Le(){P=new WeakMap}var Pe=d("openURL");function xe(e){let t=De(e);return Pe(t)}function De(e){return["http://","https://"].some(r=>e.startsWith(r))?Ne(e):e}function Ne(e){return`supertoss://web?url=${encodeURIComponent(e)}&external=true`}var oe="https://static.toss.im/ads/sdk/toss-ads-space-kit-1.3.0.js",se=15e3,N=null;function S(){if(!(typeof window>"u"))return window.TossAdsSpaceKit}function Me(){if(typeof window>"u"||typeof document>"u")return Promise.reject(new Error("Ads SDK can only be loaded in a browser environment."));let e=S();if(e)return Promise.resolve(e);if(N)return N;let t=new Promise((r,n)=>{let o=document.createElement("script"),s=()=>{o.removeEventListener("load",a),o.removeEventListener("error",i),window.clearTimeout(m),N=null},a=()=>{let g=S();if(g){s(),r(g);return}s(),n(new Error("Ads SDK script loaded but window.TossAdsSpaceKit was not exposed."))},i=()=>{s(),n(new Error(`Failed to load Ads SDK script from ${oe}.`))},m=window.setTimeout(()=>{s(),n(new Error(`Loading Ads SDK timed out after ${se}ms.`))},se);o.addEventListener("load",a),o.addEventListener("error",i),o.async=!0,o.src=oe,document.head.appendChild(o)});return N=t,t}var _=Object.assign(b("fetchTossAd"),{isSupported:p("fetchTossAd_isSupported")}),Fe=d("tossAdEventLog"),Ge=new Set(["1","2"]),pe="\\uC798\\uBABB\\uB41C \\uC694\\uCCAD\\uC774\\uC5D0\\uC694. \\uD544\\uC694\\uD55C \\uAC12\\uC774 \\uBE44\\uC5B4 \\uC788\\uC5B4\\uC694.";function M(e){return e.trim()}function U(){return new Error(pe)}function Be(){return{resultType:"FAIL",error:{reason:pe}}}function ke(e){return new Promise((t,r)=>{if(!_.isSupported()){r(new Error("fetchTossAd is not supported in this environment."));return}let n=M(e.adGroupId);if(n.length===0){r(U());return}return _({options:{...e,adGroupId:n},onEvent:t,onError:r})})}function ae(e){let t=Array.isArray(e.ads)?e.ads.filter(r=>Ge.has(String(r.styleId))):[];return{requestId:e.requestId??"",status:e.status??"OK",ads:t,ext:e.ext}}function Oe(e){return Ve(e)?e.resultType!=="SUCCESS"?e:e.success?{...e,success:ae(e.success)}:{resultType:"FAIL",error:{reason:"fetchTossAd returned SUCCESS without payload"}}:He(e)?{resultType:"SUCCESS",success:ae(e)}:{resultType:"FAIL",error:{reason:"Invalid response from fetchTossAd"}}}function Ve(e){return!!(e&&typeof e=="object"&&"resultType"in e)}function He(e){return!!(e&&typeof e=="object"&&"ads"in e)}function qe(){return async(e,t)=>{let r=M(t.spaceUnitId);if(r.length===0)return Be();try{let n=await ke({adGroupId:r,sdkId:"108",availableStyleIds:["1","2"]});return Oe(n)}catch(n){return{resultType:"FAIL",error:{reason:n instanceof Error?n.message:"Unknown fetchTossAd error"}}}}}var L=null;function Ue(e){let{callbacks:t}=e,r=()=>t?.onInitialized?.(),n=a=>{let i=a instanceof Error?a:new Error(String(a));t?.onInitializationFailed?.(i)};if(S()?.isInitialized()){r();return}if(L!=null){L.then(r).catch(n);return}let s=Me().then(a=>{if(a.isInitialized())return;let m={environment:"live",customAdFetcher:qe(),opener:xe};a.init(m)});L=s,s.then(r).catch(n).finally(()=>{L===s&&(L=null)})}function We(e,t,r={}){let{callbacks:n}=r,o=M(e),s=a=>{let i=a instanceof Error?a:new Error(String(a));n?.onAdFailedToRender?.({slotId:"",adGroupId:o,adMetadata:{},error:{code:0,message:i.message}})};try{let a=o;if(a.length===0)throw U();let i=S();if(!i)throw new Error("[toss-ad] Call initialize() before attaching an ad.");if(!i.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads.");let m=typeof t=="string"?document.querySelector(t):t;if(!m)throw new Error(`[toss-ad] Failed to find target element: ${t}`);let g={spaceId:a,autoLoad:!0,theme:r.theme,padding:r.padding,callbacks:me(o,r.callbacks)};i.banner.createSlot(m,g)}catch(a){s(a)}}var ze="16px 20px",$e="20px",je="auto",Ke="blackAndWhite",Je="expanded",h="toss-ads-attach",ie="toss-ads-attach-style",le="data-toss-ads-attach-banner-wrapper",q=\'"Toss Product Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif\';function Xe(e){let t=e.ownerDocument;if(!t||t.getElementById(ie))return;let r=t.createElement("style");r.id=ie,r.textContent=`\n .${h},\n .${h} * {\n font-family: ${q};\n font-style: normal;\n }\n .${h} { background: #ffffff; }\n .${h}.toss-ads-tone-grey { background: #f2f4f7; }\n @media (prefers-color-scheme: dark) {\n .${h} { background: #17171c; }\n .${h}.toss-ads-tone-grey { background: #101013; }\n }\n .${h}.toss-ads-theme-light { background: #ffffff; }\n .${h}.toss-ads-theme-light.toss-ads-tone-grey { background: #f2f4f7; }\n .${h}.toss-ads-theme-dark { background: #17171c; }\n .${h}.toss-ads-theme-dark.toss-ads-tone-grey { background: #101013; }\n `;let n=t.head??t.body??t.documentElement;n&&n.appendChild(r)}function Ye(e){Array.from(e.children).forEach(t=>{t instanceof HTMLElement&&t.getAttribute(le)==="true"&&e.removeChild(t)})}function Ze(e,t,r={}){let{callbacks:n,theme:o=je,tone:s=Ke,variant:a=Je}=r,i=M(e),m=u=>{let f=u instanceof Error?u:new Error(String(u));n?.onAdFailedToRender?.({slotId:"",adGroupId:i,adMetadata:{},error:{code:0,message:f.message}})},g=me(i,n);try{let u=i;if(u.length===0)throw U();let f=S();if(!f)throw new Error("[toss-ad] Call initialize() before attaching an ad.");if(!f.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads.");let R=typeof t=="string"?document.querySelector(t):t;if(!R)throw new Error(`[toss-ad] Failed to find target element: ${t}`);return Re(R,()=>{let l=document.createElement("div");l.style.width="100%",l.style.height="100%",l.style.boxSizing="border-box",l.style.display="flex",l.style.flexDirection="column",l.style.fontFamily=q,l.style.fontStyle="normal",l.style.justifyContent="center",l.style.overflow="hidden",l.setAttribute(le,"true"),a==="card"&&(l.style.padding="0 10px");let w=document.createElement("div");w.classList.add(h),w.style.fontFamily=q,w.style.fontStyle="normal",s==="grey"&&w.classList.add("toss-ads-tone-grey"),o==="light"?w.classList.add("toss-ads-theme-light"):o==="dark"&&w.classList.add("toss-ads-theme-dark"),a==="card"&&(w.style.borderRadius="16px",w.style.overflow="hidden"),l.appendChild(w);let x=!1,W=null;try{Xe(R),Ye(R),R.appendChild(l),x=!0;let O={spaceId:u,autoLoad:!0,theme:o==="auto"?void 0:o,renderPadding:fe=>fe==="1"?ze:$e,callbacks:g};W=f.banner.createSlot(w,O)}catch(O){throw x&&l.parentNode&&l.parentNode.removeChild(l),O}return{destroy(){W?.destroy(),x&&l.parentNode&&l.parentNode.removeChild(l),x=!1}}})}catch(u){return m(u),{destroy(){}}}}function Qe(e){let t=S();t?.banner&&t.banner.destroy(e)}function et(){let e=S();e?.banner&&(e.banner.destroyAll(),Le())}function me(e,t){if(!t)return;let r=n=>{let o={...n??{}};return o.adGroupId=o.adGroupId??o.spaceId??e,delete o.spaceId,o};return{onAdRendered:n=>t.onAdRendered?.(r(n)),onAdViewable:n=>t.onAdViewable?.(r(n)),onAdClicked:n=>t.onAdClicked?.(r(n)),onAdImpression:n=>{Fe({log_name:"display_ads_all::impression__1px_banner",log_type:"event",params:{event_type:"impression",schema_id:1812034,request_id:n?.adMetadata?.requestId??""}}),t.onAdImpression?.(r(n))},onAdFailedToRender:n=>t.onAdFailedToRender?.({...r(n),error:n?.error??{code:0,message:"UNKNOWN"}}),onNoFill:n=>t.onNoFill?.(r(n))}}var Nr={initialize:Object.assign(Ue,{isSupported:_.isSupported}),attach:Object.assign(We,{isSupported:_.isSupported}),attachBanner:Object.assign(Ze,{isSupported:_.isSupported}),destroy:Object.assign(Qe,{isSupported:_.isSupported}),destroyAll:Object.assign(et,{isSupported:_.isSupported})},Mr=Object.assign(d("getServerTime"),{isSupported:p("getServerTime_isSupported")}),Fr=Object.assign(d("requestReview"),{isSupported:p("requestReview_isSupported")});var F=class{_log=d("debugLog");log(t,r){try{this._log({log_name:`apps_in_toss_webview_${t}`,log_type:"debug",params:{...r,...this.getCommonParams()}})}catch{}}getCommonParams(){return{...this.getLocationInfo(),...this.getNavigatorInfo(),...this.getScreenInfo(),appName:window.__appsInToss.appName,deploymentId:window.__appsInToss.deploymentId,sessionId:window.__appsInToss.sessionId,isGame:window.__appsInToss.webViewType==="game",timestampMs:Date.now()}}getLocationInfo(){return{url:window.location.href,urlOrigin:window.location.origin,urlHost:window.location.hostname,urlPath:window.location.pathname,urlSearch:window.location.search}}getNavigatorInfo(){return{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookieEnabled:navigator.cookieEnabled,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:navigator.deviceMemory?navigator.deviceMemory*1024*1024:void 0,maxTouchPoints:navigator.maxTouchPoints}}getScreenInfo(){return{screenWidth:screen.width,screenHeight:screen.height,availableScreenWidth:screen.availWidth,availableScreenHeight:screen.availHeight,devicePixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}};var G=class{callbacks={};on(t,r){return typeof this.callbacks[t]>"u"&&(this.callbacks[t]=[]),this.callbacks[t].push(r),()=>{this.callbacks[t]=this.callbacks[t]?.filter(n=>n!==r)??[]}}emit(t,r){this.callbacks[t]?.forEach(n=>n(r))}};window.__appsInToss={appName:p("getAppName")(),deploymentId:p("getDeploymentId")(),webViewType:p("getWebViewType")(),sessionId:Math.random().toString(36).substring(2),eventEmitter:new G,debugLogger:new F};var y=/\\.(data|wasm|framework\\.js)(?:\\.gz|\\.br|\\.unityweb)?$/;function B(e){window.fetch=new Proxy(window.fetch,{apply:e})}(()=>{if(window.__appsInToss.webViewType!=="game"||typeof caches>"u")return;let e="@apps-in-toss/caches/",t=`${e}${window.__appsInToss.deploymentId}`;window.addEventListener("load",async()=>{let r=await caches.keys();for(let n of r)n.startsWith(e)&&n!==t&&await caches.delete(n)}),B(async(r,n,o)=>{let s=new Request(o[0],o[1]);if(!y.test(s.url))return await r.call(n,s);let a=await caches.open(t),i=await a.match(s);if(i){let g=i.headers.get("ETag"),u=i.headers.get("Last-Modified");g&&s.headers.set("If-None-Match",g),u&&s.headers.set("If-Modified-Since",u);let f=await r.call(n,s);return f.status===304?(i.__revalidateResponse=f,i):(a.put(s,f.clone()),f)}let m=await r.call(n,s);return a.put(s,m.clone()),m})})();B(async(e,t,r)=>{let n=new Request(r[0],r[1]),o=Date.now();window.__appsInToss.eventEmitter.emit("fetchRequest",{request:n});try{let s=await e.call(t,n);return window.__appsInToss.eventEmitter.emit("fetchResponse",{request:n,response:s,requestAt:o}),s}catch(s){throw window.__appsInToss.eventEmitter.emit("fetchError",{request:n,requestAt:o,error:s}),s}});HTMLCanvasElement.prototype.getContext=new Proxy(HTMLCanvasElement.prototype.getContext,{apply:(e,t,r)=>{let n=e.apply(t,r);return(n instanceof WebGL2RenderingContext||n instanceof WebGLRenderingContext)&&window.__appsInToss.eventEmitter.emit("webglGetContext",{canvas:t,context:n}),n}});var ge=window.__appsInToss.debugLogger;ge.log("load_start",{});window.addEventListener("load",()=>{let e=performance.timeOrigin,t=performance.getEntriesByType?.("navigation")[0]??null,r=typeof e<"u"&&t!==null,n=r?{navigationStartAtMs:e+t.startTime,navigationRedirectStartAtMs:e+t.redirectStart,navigationRedirectEndAtMs:e+t.redirectEnd,navigationRedirectCount:t.redirectCount,navigationServiceWorkerStartAtMs:e+t.workerStart,navigationFetchStartAtMs:e+t.fetchStart,navigationDomainLookupStartAtMs:e+t.domainLookupStart,navigationDomainLookupEndAtMs:e+t.domainLookupEnd,navigationConnectStartAtMs:e+t.connectStart,navigationSecureConnectStartAtMs:e+t.secureConnectionStart,navigationConnectEndAtMs:e+t.connectEnd,navigationRequestStartAtMs:e+t.requestStart,navigationResponseStartAtMs:e+t.responseStart,navigationResponseEndAtMs:e+t.responseEnd,navigationDomInteractiveAtMs:e+t.domInteractive,navigationDomContentLoadedEventStartAtMs:e+t.domContentLoadedEventStart,navigationDomContentLoadedEventEndAtMs:e+t.domContentLoadedEventEnd,navigationDomCompleteAtMs:e+t.domComplete}:{};ge.log("load_complete",{isNavigationDebugSupported:r,...n})});function T(e,t){return parseFloat(e.toFixed(t))}(()=>{if(typeof performance.memory>"u"||typeof performance.memory.usedJSHeapSize>"u"||typeof performance.memory.totalJSHeapSize>"u"||typeof performance.memory.jsHeapSizeLimit>"u")return;function e(t){window.__appsInToss.debugLogger.log(t,{usedJSHeapSize:T(performance.memory.usedJSHeapSize/1024,2),totalJSHeapSize:T(performance.memory.totalJSHeapSize/1024,2),jsHeapSizeLimit:T(performance.memory.jsHeapSizeLimit/1024,2)})}e("memory_usage_first_0s"),setTimeout(()=>e("memory_usage_first_1s"),1e3),setTimeout(()=>e("memory_usage_first_10s"),1e4),setTimeout(()=>e("memory_usage_first_30s"),3e4),setTimeout(()=>e("memory_usage_first_60s"),6e4),setInterval(()=>e("memory_usage_every_180s"),18e4)})();(()=>{let e=window.__appsInToss.debugLogger,t=performance.timeOrigin;if(typeof t>"u"||typeof PerformanceObserver>"u")return;new PerformanceObserver(o=>{o.getEntries().forEach(a=>{a.name==="first-paint"?e.log("first_paint",{fpStartAtMs:t+a.startTime}):a.name==="first-contentful-paint"&&e.log("first_contentful_paint",{fcpStartAtMs:t+a.startTime})})}).observe({type:"paint"}),new PerformanceObserver(o=>{o.getEntries().forEach(a=>{e.log("largest_contentful_paint",{lcpStartAtMs:t+a.startTime,lcpRenderSize:a.size})})}).observe({type:"largest-contentful-paint"})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.eventEmitter.on("webglGetContext",({canvas:t,context:r})=>{if(t.getAttribute("id")!=="unity-canvas")return;e();let n=r.getExtension("WEBGL_debug_renderer_info"),o=r.getParameter(r.MAX_VIEWPORT_DIMS),s={webGLRenderer:r.getParameter(r.RENDERER),webGLVendor:r.getParameter(r.VENDOR),webGLVersion:r.getParameter(r.VERSION),webGLShadingLanguageVersion:r.getParameter(r.SHADING_LANGUAGE_VERSION),webGLMaxTextureSize:r.getParameter(r.MAX_TEXTURE_SIZE),webGLMaxViewportWidth:o[0],webGLMaxViewportHeight:o[1],webGLMaxRenderbufferSize:r.getParameter(r.MAX_RENDERBUFFER_SIZE)},a=n?{webGLUnmaskedVendor:r.getParameter(n.UNMASKED_VENDOR_WEBGL),webGLUnmaskedRenderer:r.getParameter(n.UNMASKED_RENDERER_WEBGL)}:{};window.__appsInToss.debugLogger.log("unity_webgl_info",{...s,...a})})})();(()=>{if(window.__appsInToss.webViewType!=="game")return;let e=window.__appsInToss.debugLogger,t=window.__appsInToss.eventEmitter;t.on("fetchRequest",({request:n})=>{y.test(n.url)&&e.log("game_resource_download_start",{gameResourceRequestURL:n.url})});function r({request:n,requestAt:o,error:s}){e.log("game_resource_download_error",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:o,gameResourceError:s instanceof Error?s.message:"Unknown Error"})}t.on("fetchResponse",async({request:n,requestAt:o,response:s})=>{if(!y.test(n.url))return;let a=await s.clone().blob().then(m=>T(m.size/1024,2)).catch(m=>(r({request:n,requestAt:o,error:m}),null));if(a===null)return;let i=Date.now();e.log("game_resource_download_end",{gameResourceRequestURL:n.url,gameResourceRequestAtMs:o,gameResourceResponseAtMs:i,gameResourceResponseSize:a,gameResourceResponseStatus:s.__revalidateResponse?.status??s.status,gameResourceDownloadDurationMs:i-o})}),t.on("fetchError",async({request:n,requestAt:o,error:s})=>{y.test(n.url)&&r({request:n,requestAt:o,error:s})})})();var k=[];function tt(){let e=0;function t(r){let n=performance.now();if(r<n-1e3){k.push(e);return}e+=1,window.requestAnimationFrame(()=>t(r))}window.requestAnimationFrame(()=>t(performance.now()))}function rt(){if(k.length===0)return;let e=k;k=[];let t=nt(e).toSorted(),r={};for(let o=0;o<=100;o+=10){let s=t[Math.floor((t.length-1)*(o/100))];s&&(r[`fpsP${o}`]=s)}let n=t.reduce((o,s)=>o+s,0);r.fpsAverage=n/t.length,window.__appsInToss.debugLogger.log("fps_every_300s",r)}function nt(e){let t=new Set(e);return Array.from(t.values())}setInterval(()=>tt(),1e3);setInterval(()=>rt(),3e5);})();\n';
213819
213849
  0 && (module.exports = {
213820
213850
  afterDocumentLoad,
213821
213851
  beforeDocumentLoad