@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.
- package/dist/prebuilt/dev.android.rn84.js +80 -50
- package/dist/prebuilt/dev.ios.rn84.js +80 -50
- package/dist/prebuilt/prod.android.rn72.js +59 -23
- package/dist/prebuilt/prod.android.rn84.js +59 -23
- package/dist/prebuilt/prod.ios.rn72.js +59 -23
- package/dist/prebuilt/prod.ios.rn84.js +59 -23
- package/package.json +8 -8
|
@@ -138599,6 +138599,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
138599
138599
|
var isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
138600
138600
|
return (0, import_jsx_runtime14.jsx)(NavigationBarContextProvider, {
|
|
138601
138601
|
children: isRNApp ? (0, import_jsx_runtime14.jsx)(import_analytics.Analytics.Screen, {
|
|
138602
|
+
onLog: params => sendLog({
|
|
138603
|
+
log_type: params.log_type,
|
|
138604
|
+
log_name: "appsintoss_app_visit__appssintoss_systemlog",
|
|
138605
|
+
params: {
|
|
138606
|
+
...params.params,
|
|
138607
|
+
schema_id: 5175906,
|
|
138608
|
+
app_name: import_react_native21.Granite.appName,
|
|
138609
|
+
log_name: params.log_name
|
|
138610
|
+
}
|
|
138611
|
+
}, {
|
|
138612
|
+
pipelines: ["core"]
|
|
138613
|
+
}),
|
|
138602
138614
|
children: (0, import_jsx_runtime14.jsx)(RNAppContainer, {
|
|
138603
138615
|
children
|
|
138604
138616
|
})
|
|
@@ -138616,7 +138628,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
138616
138628
|
var AppsInToss = {
|
|
138617
138629
|
registerApp
|
|
138618
138630
|
};
|
|
138619
|
-
var
|
|
138631
|
+
var import_native_modules18 = _$$_REQUIRE(_dependencyMap[5], "@apps-in-toss/native-modules");
|
|
138620
138632
|
var appsInTossAsyncBridges = __toESM(_$$_REQUIRE(_dependencyMap[14], "@apps-in-toss/native-modules/async-bridges"), 1);
|
|
138621
138633
|
var appsInTossConstantBridges = __toESM(_$$_REQUIRE(_dependencyMap[15], "@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
138622
138634
|
var appsInTossEventBridges = __toESM(_$$_REQUIRE(_dependencyMap[16], "@apps-in-toss/native-modules/event-bridges"), 1);
|
|
@@ -139752,7 +139764,6 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139752
139764
|
console.log("[webViewDebugLog]", event);
|
|
139753
139765
|
}
|
|
139754
139766
|
}
|
|
139755
|
-
var import_native_modules18 = _$$_REQUIRE(_dependencyMap[5], "@apps-in-toss/native-modules");
|
|
139756
139767
|
var import_react_native35 = _$$_REQUIRE(_dependencyMap[6], "@granite-js/react-native");
|
|
139757
139768
|
var extractDateFromUUIDv7 = uuid => {
|
|
139758
139769
|
var timestampHex = uuid.split("-").join("").slice(0, 12);
|
|
@@ -139785,18 +139796,34 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139785
139796
|
var _getGroupId = getGroupId(url),
|
|
139786
139797
|
groupId = _getGroupId.groupId,
|
|
139787
139798
|
search = _getGroupId.search;
|
|
139788
|
-
var
|
|
139789
|
-
|
|
139790
|
-
|
|
139799
|
+
var logType = "screen";
|
|
139800
|
+
var logName = `${groupId}::screen`;
|
|
139801
|
+
var params = {
|
|
139802
|
+
search,
|
|
139803
|
+
referrer: getReferrer2(),
|
|
139804
|
+
document_title: title,
|
|
139805
|
+
app_name: import_react_native35.Granite.appName,
|
|
139806
|
+
deployment_id: env.getDeploymentId(),
|
|
139807
|
+
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
139808
|
+
};
|
|
139809
|
+
sendLog({
|
|
139810
|
+
log_type: logType,
|
|
139811
|
+
log_name: logName,
|
|
139812
|
+
params
|
|
139813
|
+
}, {
|
|
139814
|
+
pipelines: ["partner"]
|
|
139815
|
+
});
|
|
139816
|
+
sendLog({
|
|
139817
|
+
log_type: logType,
|
|
139818
|
+
log_name: "appsintoss_app_visit__appssintoss_systemlog",
|
|
139791
139819
|
params: {
|
|
139792
|
-
|
|
139793
|
-
|
|
139794
|
-
|
|
139795
|
-
deployment_id: env.getDeploymentId(),
|
|
139796
|
-
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
139820
|
+
...params,
|
|
139821
|
+
schema_id: 5175906,
|
|
139822
|
+
log_name: logName
|
|
139797
139823
|
}
|
|
139798
|
-
}
|
|
139799
|
-
|
|
139824
|
+
}, {
|
|
139825
|
+
pipelines: ["core"]
|
|
139826
|
+
});
|
|
139800
139827
|
};
|
|
139801
139828
|
var import_jsx_runtime19 = _$$_REQUIRE(_dependencyMap[10], "react/jsx-runtime");
|
|
139802
139829
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
@@ -139829,7 +139856,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139829
139856
|
var devUrl = `http://${local.host}:${local.port}`;
|
|
139830
139857
|
return mergeSchemeQueryParamsInto(devUrl);
|
|
139831
139858
|
}
|
|
139832
|
-
var _ref49 = (0,
|
|
139859
|
+
var _ref49 = (0, import_native_modules18.safeSyncPostMessage)("getWebBundleURL", {}),
|
|
139833
139860
|
rawUrl = _ref49.url;
|
|
139834
139861
|
var url = mergeSchemeQueryParamsInto(rawUrl);
|
|
139835
139862
|
var deploymentId = env.getDeploymentId();
|
|
@@ -139886,7 +139913,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139886
139913
|
onEvent,
|
|
139887
139914
|
onError,
|
|
139888
139915
|
options
|
|
139889
|
-
}) =>
|
|
139916
|
+
}) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", {
|
|
139890
139917
|
onEvent,
|
|
139891
139918
|
onError,
|
|
139892
139919
|
options
|
|
@@ -139898,20 +139925,20 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139898
139925
|
onEvent,
|
|
139899
139926
|
onError,
|
|
139900
139927
|
options
|
|
139901
|
-
}) =>
|
|
139928
|
+
}) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", {
|
|
139902
139929
|
onEvent,
|
|
139903
139930
|
onError,
|
|
139904
139931
|
options
|
|
139905
139932
|
}),
|
|
139906
|
-
loadAppsInTossAdMob:
|
|
139907
|
-
showAppsInTossAdMob:
|
|
139933
|
+
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
139934
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
139908
139935
|
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
139909
139936
|
showFullScreenAd,
|
|
139910
139937
|
fetchTossAd,
|
|
139911
|
-
iapCreateOneTimePurchaseOrder:
|
|
139912
|
-
requestSubscriptionPurchase:
|
|
139913
|
-
requestOneTimePurchase:
|
|
139914
|
-
requestNotificationAgreement:
|
|
139938
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
139939
|
+
requestSubscriptionPurchase: import_native_modules18.IAP.createSubscriptionPurchaseOrder,
|
|
139940
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase,
|
|
139941
|
+
requestNotificationAgreement: import_native_modules18.requestNotificationAgreement
|
|
139915
139942
|
},
|
|
139916
139943
|
constantHandlerMap: {
|
|
139917
139944
|
...appsInTossConstantBridges,
|
|
@@ -139922,11 +139949,11 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139922
139949
|
right: insets.right
|
|
139923
139950
|
}),
|
|
139924
139951
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
139925
|
-
getServerTime_isSupported:
|
|
139926
|
-
requestReview_isSupported:
|
|
139927
|
-
loadAppsInTossAdMob_isSupported:
|
|
139928
|
-
showAppsInTossAdMob_isSupported:
|
|
139929
|
-
isAppsInTossAdMobLoaded_isSupported:
|
|
139952
|
+
getServerTime_isSupported: import_native_modules18.getServerTime.isSupported,
|
|
139953
|
+
requestReview_isSupported: import_native_modules18.requestReview.isSupported,
|
|
139954
|
+
loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
139955
|
+
showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
139956
|
+
isAppsInTossAdMobLoaded_isSupported: import_native_modules18.GoogleAdMob.isAppsInTossAdMobLoaded.isSupported,
|
|
139930
139957
|
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
139931
139958
|
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
139932
139959
|
fetchTossAd_isSupported: fetchTossAd.isSupported,
|
|
@@ -139936,7 +139963,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139936
139963
|
},
|
|
139937
139964
|
asyncHandlerMap: {
|
|
139938
139965
|
...appsInTossAsyncBridges,
|
|
139939
|
-
getServerTime:
|
|
139966
|
+
getServerTime: import_native_modules18.getServerTime,
|
|
139940
139967
|
setIosSwipeGestureEnabled: options => {
|
|
139941
139968
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
139942
139969
|
return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
@@ -139966,18 +139993,18 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
139966
139993
|
fetchContacts: appsInTossAsyncBridges.fetchContacts,
|
|
139967
139994
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
139968
139995
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
139969
|
-
getStorageItem:
|
|
139970
|
-
setStorageItem:
|
|
139971
|
-
removeStorageItem:
|
|
139972
|
-
clearItems:
|
|
139973
|
-
iapGetProductItemList:
|
|
139974
|
-
iapCreateOneTimePurchaseOrder:
|
|
139975
|
-
processProductGrant:
|
|
139976
|
-
getPendingOrders:
|
|
139977
|
-
getCompletedOrRefundedOrders:
|
|
139978
|
-
completeProductGrant:
|
|
139979
|
-
getSubscriptionInfo:
|
|
139980
|
-
isAppsInTossAdMobLoaded:
|
|
139996
|
+
getStorageItem: import_native_modules18.Storage.getItem,
|
|
139997
|
+
setStorageItem: import_native_modules18.Storage.setItem,
|
|
139998
|
+
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
139999
|
+
clearItems: import_native_modules18.Storage.clearItems,
|
|
140000
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
140001
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
140002
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
140003
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
140004
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
140005
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant,
|
|
140006
|
+
getSubscriptionInfo: import_native_modules18.IAP.getSubscriptionInfo,
|
|
140007
|
+
isAppsInTossAdMobLoaded: import_native_modules18.GoogleAdMob.isAppsInTossAdMobLoaded,
|
|
139981
140008
|
tossAdEventLog,
|
|
139982
140009
|
memoryDebugLog: webViewMemoryDebugLog,
|
|
139983
140010
|
debugLog: function () {
|
|
@@ -141509,12 +141536,14 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
141509
141536
|
loggerFunction = _config?.logger;
|
|
141510
141537
|
}
|
|
141511
141538
|
return {
|
|
141512
|
-
screen: (groupId, params = {}) => {
|
|
141513
|
-
|
|
141539
|
+
screen: (groupId, params = {}, onLog) => {
|
|
141540
|
+
var payload = {
|
|
141514
141541
|
log_type: "screen",
|
|
141515
141542
|
log_name: createLogName(groupId, "screen"),
|
|
141516
141543
|
params
|
|
141517
|
-
}
|
|
141544
|
+
};
|
|
141545
|
+
loggerFunction?.(payload);
|
|
141546
|
+
onLog?.(payload);
|
|
141518
141547
|
},
|
|
141519
141548
|
event: (groupId, params) => {
|
|
141520
141549
|
var log_name = params.log_name,
|
|
@@ -141552,8 +141581,8 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
141552
141581
|
return LOGGER_SHIM;
|
|
141553
141582
|
}
|
|
141554
141583
|
return {
|
|
141555
|
-
screen: (_groupId, params2) => {
|
|
141556
|
-
getLogger().screen(_groupId, params2);
|
|
141584
|
+
screen: (_groupId, params2, onLog) => {
|
|
141585
|
+
getLogger().screen(_groupId, params2, onLog);
|
|
141557
141586
|
},
|
|
141558
141587
|
event: _params => {
|
|
141559
141588
|
getLogger().event(groupId, {
|
|
@@ -141827,10 +141856,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
141827
141856
|
var session = useVisibilitySession();
|
|
141828
141857
|
var logger = useLogger();
|
|
141829
141858
|
return (0, import_react12.useMemo)(() => ({
|
|
141830
|
-
log: (groupId, params) => {
|
|
141859
|
+
log: (groupId, params, onLog) => {
|
|
141831
141860
|
var canConsume = session.consume();
|
|
141832
141861
|
if (canConsume) {
|
|
141833
|
-
logger.screen(groupId, params);
|
|
141862
|
+
logger.screen(groupId, params, onLog);
|
|
141834
141863
|
}
|
|
141835
141864
|
}
|
|
141836
141865
|
}), [logger, session]);
|
|
@@ -141868,14 +141897,15 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
141868
141897
|
children,
|
|
141869
141898
|
groupId,
|
|
141870
141899
|
params,
|
|
141871
|
-
log = true
|
|
141900
|
+
log = true,
|
|
141901
|
+
onLog
|
|
141872
141902
|
}) {
|
|
141873
141903
|
var logger = useScreenLogger();
|
|
141874
141904
|
(0, import_react13.useEffect)(() => {
|
|
141875
141905
|
if (log) {
|
|
141876
|
-
logger.log(groupId, params);
|
|
141906
|
+
logger.log(groupId, params, onLog);
|
|
141877
141907
|
}
|
|
141878
|
-
}, [groupId, params, log, logger]);
|
|
141908
|
+
}, [groupId, params, log, logger, onLog]);
|
|
141879
141909
|
return (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, {
|
|
141880
141910
|
children
|
|
141881
141911
|
});
|
|
@@ -214387,7 +214417,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
|
|
|
214387
214417
|
}
|
|
214388
214418
|
\`;document.head.appendChild(e);})();
|
|
214389
214419
|
`,
|
|
214390
|
-
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';
|
|
214420
|
+
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';
|
|
214391
214421
|
0 && (module.exports = {
|
|
214392
214422
|
afterDocumentLoad,
|
|
214393
214423
|
beforeDocumentLoad
|