@paypay/mini-app-js-sdk 2.18.0 → 2.20.0
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/client/index.d.ts +2 -0
- package/dist/client/supportedFunctionsList.d.ts +2 -2
- package/dist/core/coreFunctions/getLoginUrl.d.ts +17 -0
- package/dist/core/coreFunctions/index.d.ts +1 -0
- package/dist/core/coreFunctions/logEvent.d.ts +2 -2
- package/dist/mini-app-api.d.ts +19 -25
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +43 -15
- package/dist/model/bridge/getExternalLinkageInformation.d.ts +3 -0
- package/dist/model/bridge/render.d.ts +1 -1
- package/dist/model/bridge/renderLoginButton.d.ts +1 -1
- package/dist/model/bridge/renderPayButton.d.ts +2 -2
- package/dist/package/lottie/lottie.d.ts +1 -1
- package/dist/resources/locales/smartPayment/en.d.ts +13 -0
- package/dist/resources/locales/smartPayment/ja.d.ts +13 -0
- package/dist/resources/locales/topup/index.d.ts +53 -0
- package/dist/resources/locales/topup/ja.d.ts +26 -0
- package/dist/types/GetExternalLinkageInformationResult.d.ts +14 -0
- package/dist/types/getDeviceInformation.d.ts +7 -0
- package/dist/types/getLoginUrl.d.ts +8 -0
- package/dist/types/getPermissionStatus.d.ts +1 -0
- package/dist/types/getTransactionInfo.d.ts +7 -3
- package/dist/types.d.ts +2 -4
- package/dist/utils/analytics.d.ts +8 -2
- package/dist/utils/getLanguage.d.ts +2 -403
- package/dist/utils/helper.d.ts +1 -3
- package/package.json +7 -1
- package/dist/model/bridge/copyToClipboard.d.ts +0 -2
- package/dist/model/bridge/getLoginUrl.d.ts +0 -11
- package/dist/model/bridge/getSessionData.d.ts +0 -2
- package/dist/model/bridge/getStorageData.d.ts +0 -2
- package/dist/model/bridge/removeStorageData.d.ts +0 -2
- package/dist/model/bridge/setSessionData.d.ts +0 -2
- package/dist/model/bridge/setStorageData.d.ts +0 -2
- package/dist/model/bridge/setTitle.d.ts +0 -2
- package/dist/resources/en.d.ts +0 -383
- package/dist/resources/ja.d.ts +0 -402
package/dist/client/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { MiniAppStatusType } from '../model/miniAppStatus';
|
|
|
5
5
|
import { VerifyMultiFactorAuthStatus } from '../types/verifyMultiFactorAuthResult';
|
|
6
6
|
import { InitClientParams } from '../types/init';
|
|
7
7
|
import { GetKycPassportInfoResult } from '../types/getKycPassportInfo';
|
|
8
|
+
import type { GetLoginUrlParams } from '../types/getLoginUrl';
|
|
8
9
|
declare function init(params: InitClientParams): void;
|
|
9
10
|
declare function verifyMultiFactorAuthResult(params: NativeParams<VerifyMultiFactorAuthStatus>): void;
|
|
10
11
|
declare function getKycPassportInfo(params: NativeParams<GetKycPassportInfoResult>): void;
|
|
@@ -41,6 +42,7 @@ declare const clientFunctions: {
|
|
|
41
42
|
statusCode: MiniAppStatusType;
|
|
42
43
|
}, import('../types').MiniAppErrorResultType>) => void;
|
|
43
44
|
getPaymentSettings: (params: NativeParams<import("../core/coreFunctions/getPaymentSettings").PaymentSettingsType, import('../types').MiniAppErrorResultType>) => void;
|
|
45
|
+
getLoginUrl: (params: GetLoginUrlParams) => void;
|
|
44
46
|
};
|
|
45
47
|
declare type ClientSDKType = Omit<MiniAppModule, keyof typeof clientFunctions> & typeof clientFunctions;
|
|
46
48
|
declare const client: ClientSDKType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const miniAppSupportedFunctions: readonly ["init", "openWebview", "openMap", "closeApp", "makePayment", "topup", "setSessionData", "getSessionData", "setStorageData", "getStorageData", "removeStorageData", "getPermissionStatus", "scanCode", "showAlert", "showErrorSheet", "getTopBarHeight", "setTitle", "showUpdateWarning", "getPlatformInformation", "openApp", "share", "getKycInformation", "getUserLocation", "checkPaymentMethod", "registerKyc", "startMultiFactorAuth", "verifyMultiFactorAuthResult", "getBankInfo", "logout", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "copyToClipboard", "registerUserInfo", "setEnablePullDownRefresh", "registerEmail", "checkAccessToken", "debug", "inputAddress", "getDeviceInformation", "openMiniApp", "request", "requestInternal", "registerPaymentFeatures", "initKycPassport", "getKycPassportInfo", "shortcutExists", "addShortcut", "logAppsFlyerEvent", "getAllUserAddresses", "getUserPaymentFeatureSettings", "getPaymentSettings", "getTransactionInfo", "getTransactions", "getPayPayCardInfo"];
|
|
2
|
-
export declare const smartPaymentSupportedFunctions: readonly ["init", "createOrder", "makePayment", "render", "logout", "getAuthStatus", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "getCashbackInformation", "renderCoupons"];
|
|
1
|
+
export declare const miniAppSupportedFunctions: readonly ["init", "openWebview", "openMap", "closeApp", "makePayment", "topup", "setSessionData", "getSessionData", "setStorageData", "getStorageData", "removeStorageData", "getPermissionStatus", "scanCode", "showAlert", "showErrorSheet", "getTopBarHeight", "setTitle", "showUpdateWarning", "getPlatformInformation", "openApp", "share", "getKycInformation", "getUserLocation", "checkPaymentMethod", "registerKyc", "startMultiFactorAuth", "verifyMultiFactorAuthResult", "getBankInfo", "logout", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "copyToClipboard", "registerUserInfo", "setEnablePullDownRefresh", "registerEmail", "checkAccessToken", "debug", "inputAddress", "getDeviceInformation", "openMiniApp", "request", "requestInternal", "registerPaymentFeatures", "initKycPassport", "getKycPassportInfo", "shortcutExists", "addShortcut", "logAppsFlyerEvent", "getAllUserAddresses", "getUserPaymentFeatureSettings", "getPaymentSettings", "getTransactionInfo", "getTransactions", "getPayPayCardInfo", "getExternalLinkageInformation"];
|
|
2
|
+
export declare const smartPaymentSupportedFunctions: readonly ["init", "createOrder", "makePayment", "render", "logout", "getAuthStatus", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "getCashbackInformation", "renderCoupons", "getLoginUrl"];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MiniAppFunctionContext, PostLogInRedirectParams, RedirectType } from '../../types';
|
|
2
|
+
import { PKCEChallengeType } from '../../types/getAuthStatus';
|
|
3
|
+
interface GetLoginUrlInternalParams extends PostLogInRedirectParams {
|
|
4
|
+
pkceCodeChallenge: PKCEChallengeType;
|
|
5
|
+
scopes?: Array<string>;
|
|
6
|
+
}
|
|
7
|
+
export declare const getLoginUrlEndpoint = "public/auth/v1/loginUrl";
|
|
8
|
+
export declare function getLoginUrl(params: {
|
|
9
|
+
redirectUrl: string;
|
|
10
|
+
redirectType?: RedirectType;
|
|
11
|
+
}, context: MiniAppFunctionContext): Promise<{
|
|
12
|
+
url: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function getLoginUrlInternal({ pkceCodeChallenge, postLoginRedirectUrl, postLoginRedirectType, scopes, }: GetLoginUrlInternalParams): Promise<string>;
|
|
15
|
+
export declare function getLoginUrlWithPkce(params: Omit<GetLoginUrlInternalParams, 'pkceCodeChallenge'>, clientOrigin: string): Promise<string>;
|
|
16
|
+
export declare function getLoginUrlIfUserNotSignedIn(params: Omit<GetLoginUrlInternalParams, 'pkceCodeChallenge'>, context: MiniAppFunctionContext): Promise<string | undefined>;
|
|
17
|
+
export {};
|
|
@@ -3,11 +3,11 @@ interface LogEventParams {
|
|
|
3
3
|
sendImmediately?: boolean;
|
|
4
4
|
clientId?: string;
|
|
5
5
|
event_category?: string;
|
|
6
|
-
event_label_suffix?: string;
|
|
7
6
|
screen_name?: string;
|
|
8
7
|
event_action?: string;
|
|
9
8
|
error_value?: string;
|
|
10
9
|
event_label2?: unknown;
|
|
10
|
+
merchant_id?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare function logEvent({ eventName, sendImmediately, clientId, event_category,
|
|
12
|
+
export declare function logEvent({ eventName, sendImmediately, clientId, event_category, screen_name, ...params }: LogEventParams): void;
|
|
13
13
|
export {};
|
package/dist/mini-app-api.d.ts
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsBridgeModule } from './jsbridge-core/module';
|
|
3
|
-
import { AddShortcutParams, CloseAppParams, CopyToClipBoardParams, GetCashbackInfoParams, GetDataParams, LogAppsFlyerEventParams, MapParams, MiniAppFunctionContext, MiniAppResult, OpenAppParams, OpenMiniAppParams, RegisterPaymentFeaturesParams, RegisterUserInfoParams, RemoveDataParams, RequestInternalParams, RequestParams, ScanCodeParams, SetDataParams, SetEnablePullDownRefreshParams, SetTitleParams, ShareParams, ShortcutExistsParams, ShowAlertParams, ShowErrorSheetParams, SmsAuthParams } from './types';
|
|
4
|
-
import { TopupParams } from './types/topup';
|
|
5
|
-
import { GetPlatformInformationResult } from './types/getPlatformInformation';
|
|
6
|
-
import { ShowUpdateWarningParams } from './types/showUpdateWarning';
|
|
7
|
-
import { InitParams } from './types/init';
|
|
1
|
+
import { CheckPaymentMethodParams } from './types/checkPaymentMethod';
|
|
8
2
|
import { GetAuthStatusParams } from './types/getAuthStatus';
|
|
9
3
|
import { GetBalanceParams } from './types/getBalance';
|
|
10
|
-
import { OpenWebviewParams } from './types/openWebview';
|
|
11
4
|
import { GetDeviceInformationResult } from './types/getDeviceInformation';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
5
|
+
import { GetKycInformationParams } from './types/getKycInformation';
|
|
6
|
+
import { GetKycPassportInfoParams } from './types/getKycPassportInfo';
|
|
7
|
+
import { GetPermissionStatusParams } from './types/getPermissionStatus';
|
|
8
|
+
import { GetPlatformInformationResult } from './types/getPlatformInformation';
|
|
9
|
+
import { GetTransactionsParams } from './types/getTransactions';
|
|
10
|
+
import { GetUserAddressParams, InputAddressParams } from './types/getUserAddress';
|
|
16
11
|
import { GetUserLocationParams } from './types/getUserLocation';
|
|
17
|
-
import { LogoutResult } from './types/logout';
|
|
18
12
|
import { GetUserPaymentFeatureSettingsParams } from './types/getUserPaymentFeatureSettings';
|
|
19
|
-
import {
|
|
20
|
-
import { GetKycPassportInfoParams } from './types/getKycPassportInfo';
|
|
13
|
+
import { InitParams } from './types/init';
|
|
21
14
|
import { InitKycPassportParams } from './types/initKycPassport';
|
|
15
|
+
import { LogoutResult } from './types/logout';
|
|
16
|
+
import { MakePaymentParams } from './types/makePayment';
|
|
17
|
+
import { OpenWebviewParams } from './types/openWebview';
|
|
22
18
|
import { RegisterKycParams } from './types/registerKycParams';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
19
|
+
import { ShowUpdateWarningParams } from './types/showUpdateWarning';
|
|
20
|
+
import { StartMultiFactorAuthParams } from './types/startMultiFactorAuth';
|
|
21
|
+
import { TopupParams } from './types/topup';
|
|
22
|
+
import { VerifyMultiFactorAuthResultParams } from './types/verifyMultiFactorAuthResult';
|
|
23
|
+
import { JsBridge, NativeParams } from './jsbridge-core/jsbridge';
|
|
24
|
+
import { JsBridgeModule } from './jsbridge-core/module';
|
|
25
|
+
import { AddShortcutParams, CloseAppParams, GetCashbackInfoParams, LogAppsFlyerEventParams, MapParams, MiniAppFunctionContext, MiniAppResult, OpenAppParams, OpenMiniAppParams, RegisterPaymentFeaturesParams, RegisterUserInfoParams, RequestInternalParams, RequestParams, ScanCodeParams, SetEnablePullDownRefreshParams, ShareParams, ShortcutExistsParams, ShowAlertParams, ShowErrorSheetParams, SmsAuthParams } from './types';
|
|
26
26
|
export declare class MiniAppModule extends JsBridgeModule {
|
|
27
27
|
constructor(jsBridge: JsBridge);
|
|
28
28
|
private detectMode;
|
|
29
29
|
init(params: InitParams, context: MiniAppFunctionContext): void;
|
|
30
|
-
copyToClipboard(params: CopyToClipBoardParams): void;
|
|
31
30
|
getCashbackInformation(params: GetCashbackInfoParams): void;
|
|
32
31
|
openWebview(params: OpenWebviewParams): void;
|
|
33
32
|
openMap(params: MapParams): void;
|
|
@@ -42,17 +41,11 @@ export declare class MiniAppModule extends JsBridgeModule {
|
|
|
42
41
|
createOrder(params: MakePaymentParams): void;
|
|
43
42
|
getUserProfile(params: NativeParams<MiniAppResult>): void;
|
|
44
43
|
topup(params: TopupParams): void;
|
|
45
|
-
setSessionData(params: SetDataParams): void;
|
|
46
|
-
getSessionData(params: GetDataParams): void;
|
|
47
|
-
setStorageData(params: SetDataParams): void;
|
|
48
|
-
getStorageData(params: GetDataParams): void;
|
|
49
|
-
removeStorageData(params: RemoveDataParams): void;
|
|
50
44
|
getPermissionStatus(params: GetPermissionStatusParams): void;
|
|
51
45
|
scanCode(params: ScanCodeParams): void;
|
|
52
46
|
showAlert(params: ShowAlertParams): void;
|
|
53
47
|
showErrorSheet(params: ShowErrorSheetParams): void;
|
|
54
48
|
getTopBarHeight(params: NativeParams<MiniAppResult>): void;
|
|
55
|
-
setTitle(params: SetTitleParams): void;
|
|
56
49
|
showUpdateWarning(params: ShowUpdateWarningParams): void;
|
|
57
50
|
getPlatformInformation(params: NativeParams<GetPlatformInformationResult>): void;
|
|
58
51
|
getDeviceInformation(params: NativeParams<GetDeviceInformationResult>): void;
|
|
@@ -88,4 +81,5 @@ export declare class MiniAppModule extends JsBridgeModule {
|
|
|
88
81
|
}): void;
|
|
89
82
|
getTransactions(params: GetTransactionsParams): void;
|
|
90
83
|
getPayPayCardInfo(params: NativeParams<MiniAppResult>): void;
|
|
84
|
+
getExternalLinkageInformation(params: NativeParams<MiniAppResult>): void;
|
|
91
85
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var p=document.createElement("style");p.appendChild(document.createTextNode(".ppmna-reset-css{all:initial}.ppmna-reset-css *{text-align:unset;color:unset;background:initial;background-color:transparent;margin:revert;padding:revert;font-weight:revert;font-style:unset;font-size:unset;-webkit-user-select:none;user-select:none;border:unset;border-radius:revert;vertical-align:unset;word-break:unset;outline:none;box-sizing:content-box}.ppmna-reset-css * img{display:inline-block}.ppmna-reset-css * input,.ppmna-reset-css * select{-webkit-user-select:auto;user-select:auto}.ppmna-reset-css * li{list-style:none}.ppmna-reset-css * :where(*:not(svg,svg *)){all:revert}.pp-smartButtonWrapper .pp-smartBtn{display:flex;align-items:center;border-radius:8px;border:none;font-size:14px;font-weight:600;line-height:22px;color:#fff;padding:0;width:100%;height:44px;margin:auto;-webkit-tap-highlight-color:transparent;text-decoration:none;box-sizing:border-box}.pp-smartButtonWrapper .pp-smartBtn.pp-sm .pp-leftSection .pp-btnContent{flex-direction:column}.pp-smartButtonWrapper .pp-smartBtn.pp-light{background:#fff;color:#242323}.pp-smartButtonWrapper .pp-smartBtn.pp-dark{background:#000}.pp-smartButtonWrapper .pp-smartBtn.pp-red{background:#ff0033}.pp-smartButtonWrapper .pp-smartBtn.pp-login{min-width:180px}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-sm{width:180px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light{border:1px solid #e4e4e8}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light .pp-userProfile{margin-right:4px}.pp-smartButtonWrapper .pp-smartBtn.pp-login .pp-leftSection .pp-btnContent{display:grid}.pp-smartButtonWrapper .pp-smartBtn.pp-pay{min-width:160px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light{border:1px solid #dddddd}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light .pp-cashbackInfo{color:#ff954c;background:#fff0e5}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-red .pp-cashbackInfo{color:#f03}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-ja .pp-cashbackInfo{padding:2px 16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm{width:160px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm.pp-cashback{height:66px;flex-direction:column;justify-content:center}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-cashbackInfo{margin:8px 0 0}.pp-smartButtonWrapper .pp-smartBtn.pp-pay .pp-leftSection .pp-img{width:24px;height:24px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText{font-size:16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-cashback .pp-leftSection .pp-btnContent,.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText .pp-leftSection .pp-btnContent{margin-left:4px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection{display:flex;justify-content:center;align-items:center;width:100%;box-sizing:border-box;padding:0 8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-img{width:20px;height:20px;display:inline-block}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent{margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent .pp-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-smartButtonWrapper .pp-smartBtn .pp-cashbackInfo{font-size:12px;color:#242323;background:#fff;line-height:14px;padding:2px 8px;border-radius:9px;margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-userProfile{width:34px;height:34px;border-radius:50%;margin-right:5px}.pp-smartButtonWrapper.pp-button{padding:0;margin:0;background:none;border:none;width:100%;border-radius:8px;-webkit-tap-highlight-color:transparent;font-family:revert!important}.pp-smartButtonWrapper.pp-button *{font-family:revert!important}")),document.head.appendChild(p)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))a.call(t,n)&&i(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>new Promise(((o,r)=>{var a=e=>{try{s(n.next(e))}catch(t){r(t)}},i=e=>{try{s(n.throw(e))}catch(t){r(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,i);s((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var u=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=d({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var i in r)r[i]&&(a+="; "+i,!0!==r[i]&&(a+="="+r[i].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var a=n[r].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(o[s]=t.read(i,s),e===s)break}catch(c){}}return e?o[e]:o}},remove:function(e,t){o(e,"",d({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,d({},this.attributes,t))},withConverter:function(t){return e(d({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),p=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.claimCouponImmediately="ppjssdk.claimCouponImmediately",e.merchant="ppjssdk.merchant",e.consumedOTT="ppjssdk.consumedOTT",e))(p||{});const m={success:"success",fail:"fail",complete:"complete"},g={init:"init",getBankInfo:"getBankInfo",showAlert:"showAlert",render:"render",makePayment:"makePayment",getUAID:"getUAID",logout:"logout",startMultiFactorAuth:"startMultiFactorAuth",verifyMultiFactorAuthResult:"verifyMultiFactorAuthResult",getPermissionStatus:"getPermissionStatus",registerKyc:"registerKyc",getKycInformation:"getKycInformation",getUserAddress:"getUserAddress",getUserLocation:"getUserLocation",getUserProfile:"getUserProfile",registerEmail:"registerEmail",showUpdateWarning:"showUpdateWarning",showErrorSheet:"showErrorSheet",getPlatformInformation:"getPlatformInformation",share:"share",setTitle:"setTitle",getTopBarHeight:"getTopBarHeight",openWebview:"openWebview",openMap:"openMap",closeApp:"closeApp",openApp:"openApp",checkPaymentMethod:"checkPaymentMethod",getBalance:"getBalance",topup:"topup",registerPaymentFeatures:"registerPaymentFeatures",registerUserInfo:"registerUserInfo",requestInternal:"requestInternal",scanCode:"scanCode",getAuthStatus:"getAuthStatus",openMiniApp:"openMiniApp",inputAddress:"inputAddress",checkAccessToken:"checkAccessToken",getCashbackInformation:"getCashbackInformation",request:"request",getDeviceInformation:"getDeviceInformation",debug:"debug",copyToClipboard:"copyToClipboard",createOrder:"createOrder",handleMessageFromNative:"handleMessageFromNative",initKycPassport:"initKycPassport",smsAuth:"smsAuth",getKycPassportInfo:"getKycPassportInfo",renderCoupons:"renderCoupons"},f="reload",h="link",v="saveRefreshToken",E="saveCodeVerifier",I="makeVisible",y="consoleDebugInfo",b="_PayPayJsBridge",A=["init","openWebview","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","logAppsFlyerEvent","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo"];function _(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const T=_("icon-paypay-rec.svg"),w=_("icon-paypay-rec-white.svg"),S="2.18.0",k=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),N=k.origin,O=new URL(`./iframe.html?v=${S}&rev=7c80dbc`,k).href,P=new URL(`./coupon/iframe.html?v=${S}`,k).href;var C=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e.noLocationData="NO_LOCATION_DATA",e.functionNotFound="FUNCTION_NOT_FOUND",e.originNotAllowed="ORIGIN_NOT_ALLOWED",e.messageSendingFailed="MESSAGE_SENDING_FAILED",e.transactionNotFound="TRANSACTION_NOT_FOUND",e.unexpectedOperation="UNEXPECTED_OP",e.merchantTimeout="MERCHANT_TIMEOUT",e))(C||{});Object.prototype.toString;function D(e){return e&&e.Math==Math?e:void 0}const R="object"==typeof globalThis&&D(globalThis)||"object"==typeof window&&D(window)||"object"==typeof self&&D(self)||"object"==typeof global&&D(global)||function(){return this}()||{};const U=["debug","info","warn","error","log","assert","trace"],L={};function F(e){if(!("console"in R))return e();const t=R.console,n={},o=Object.keys(L);o.forEach((e=>{const o=L[e];n[e]=t[e],t[e]=o}));try{return e()}finally{o.forEach((e=>{t[e]=n[e]}))}}!function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?U.forEach((n=>{t[n]=(...t)=>{e&&F((()=>{R.console[n](`Sentry Logger [${n}]:`,...t)}))}})):U.forEach((e=>{t[e]=()=>{}}))}();var M;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(M||(M={}));const j=R,B={nowSeconds:()=>Date.now()/1e3};const x="undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__||"[object process]"!==Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(){const{performance:e}=j;if(!e||!e.now)return;return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}():function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(n){return}var e,t}(),V=void 0===x?B:{nowSeconds:()=>(x.timeOrigin+x.now())/1e3};B.nowSeconds.bind(B),V.nowSeconds.bind(V);(()=>{const{performance:e}=j;if(!e||!e.now)return;const t=36e5,n=e.now(),o=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,a=r<t,i=e.timing&&e.timing.navigationStart,s="number"==typeof i?Math.abs(i+n-o):t;(a||s<t)&&(r<=s&&e.timeOrigin)})();const W=[C.sdkNotInitialized,C.userCanceled,C.userCanceledSimilarTxn,C.suspectedDuplicatePayment,C.noSufficientFund];function q(e,t,n){W.includes(n),0}!function(){try{return localStorage.getItem("ppjssdk.canWriteToLocalStorage"),!0}catch(e){return console.log(e),!1}}();const z=["ab.ca","ac.ac","ac.ae","ac.at","ac.be","ac.cn","ac.il","ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.sg","ad.jp","adm.br","adv.br","ah.cn","am.br","arq.br","art.br","arts.ro","asn.au","asso.fr","asso.mc","bc.ca","bio.br","biz.pl","biz.tr","bj.cn","bel.tr","br.com","cn.com","cng.br","cnt.br","co.ac","co.at","co.de","co.gl","co.hk","co.id","co.il","co.in","co.jp","co.kr","co.mg","co.ms","co.nz","co.th","cp.tz","co.uk","co.ve","co.vi","co.za","com.ag","com.ai","com.ar","com.au","com.br","com.co","com.cn","com.cy","com.de","com.do","com.ec","com.es","com.fj","com.fr","com.gl","com.gt","com.hk","com.hr","com.hu","com.kg","com.ki","com.lc","com.mg","com.mm","com.ms","com.mt","com.mu","com.mx","com.my","com.na","com.nf","com.ng","com.ni","com.pa","com.ph","com.pl","com.pt","com.qa","com.ro","com.ru","com.sb","com.sc","com.sg","com.sv","com.tr","com.tw","com.ua","com.uy","com.ve","com.vn","cq.cn","de.com","de.org","ecn.br","ed.jp","edu.au","edu.cn","edu.hk","edu.mm","edu.my","edu.pl","edu.pt","edu.qa","edu.sg","edu.tr","edu.tw","eng.br","ernet.in","esp.br","etc.br","eti.br","eu.com","eu.int","eu.lv","firm.in","firm.ro","fm.br","fot.br","fst.br","g12.br","gb.com","gb.net","gd.cn","gen.in","go.jp","go.kr","go.th","gov.au","gov.az","gov.br","gov.cn","gov.il","gov.in","gov.mm","gov.my","gov.qa","gov.sg","gov.tr","gov.tw","gov.uk","govt.nz","gr.jp","gs.cn","gv.ac","gv.at","gx.cn","gz.cn","he.cn","hi.cn","hk.cn","hl.cn","hu.com","id.au","idv.tw","in.ua","in.th","ind.br","ind.in","inf.br","info.pl","info.ro","info.tr","info.ve","iwi.nz","jl.cn","jor.br","js.cn","jus.br","k12.il","k12.tr","kr.com","lel.br","lg.jp","ln.cn","ltd.uk","mb.ca","me.uk","med.br","mi.th","mil.br","mil.uk","mo.cn","mod.uk","muni.il","nb.ca","ne.jp","ne.kr","net.ag","net.ai","net.au","net.br","net.cn","net.do","net.gl","net.hk","net.il","net.in","net.kg","net.ki","net.lc","net.mg","net.mm","net.mu","net.ni","net.nz","net.pl","net.ru","net.sb","net.sc","net.sg","net.th","net.tr","net.tw","net.uk","net.ve","nf.ca","nhs.uk","nm.cn","nm.kr","no.com","nom.br","nom.ni","nom.ro","ns.ca","nt.ca","nt.ro","ntr.br","nx.cn","odo.br","off.ai","on.ca","or.ac","or.at","or.jp","or.kr","or.th","org.ag","org.ai","org.au","org.br","org.cn","org.do","org.es","org.gl","org.hk","org.in","org.kg","org.ki","org.lc","org.mg","org.mm","org.ms","org.nf","org.ng","org.ni","org.nz","org.pl","org.ro","org.ru","org.sb","org.sc","org.sg","org.tr","org.tw","org.uk","org.ve","pe.ca","plc.uk","ppg.br","pro.br","psc.br","psi.br","qc.ca","qc.com","qh.cn","rec.br","rec.ro","res.in","sa.com","sc.cn","sch.uk","se.com","se.net","sh.cn","sk.ca","slg.br","sn.cn","store.ro","tj.cn","tm.fr","tm.mc","tm.ro","tmp.br","tur.br","tv.br","tv.tr","tw.cn","uk.com","uk.net","us.com","uy.com","vet.br","waw.pl","web.ve","www.ro","xj.cn","xz.cn","yk.ca","yn.cn","zj.cn","zlg.br"];function K(e,t){return e?function(e){const t=e.split(".");if(function(e){return/(^\s*(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))\s*$)/.test(e)}(n=e)||function(e){return/(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$)/.test(e)}(n)||t.length<=2)return e;var n;const o=t.slice(t.length-2).join(".");return z.includes(o)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}function H(){return Math.random().toString(36).substring(7)}function $(e){return e===N}function Y(e){return e?String(e):""}function G(e,t){u.remove(e),u.remove(e,{domain:t})}C.notAuthorized,C.badRequest,C.badRequestInsufficientParameter,C.insufficientScope,C.insufficientScope;let J=[];function Q(e){J=J.filter((t=>t!==e))}function X(){const e=H();return J.push(e),e}function Z(e,t,n,o){return function(r={}){const a=n(),i=null==o?void 0:o(r);a.logEvent(s({event_action:`pp_${e}_called`},i)),t(r).then((t=>{var n;a.logEvent(s({event_action:`pp_${e}_success`},i)),null==(n=r.success)||n.call(r,t)})).catch((t=>{var n;console.error(t.message),a.logEvent(s({event_action:`pp_${e}_fail`,error_value:t.errorCode},i)),null==(n=r.fail)||n.call(r,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=r.complete)||e.call(r)}))}}class ee extends Error{constructor(e,t){super(e),this.errorCode=t}}class te{constructor(e,t){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.messageEventHandler=this.messageEventHandler.bind(this),this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,C.originNotAllowed):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}handleRequest(e){return l(this,null,(function*(){const t=e.data.functionName,n=this.functions[t];n||this.sendErrorResponse(e,`Function '${t}' does not exists on the target window`,C.functionNotFound);try{const t={clientOrigin:e.origin};this.sendSuccessResponse(e,yield n(...e.data.params,t))}catch(o){let t="Some error ocurred while processing the request",n=C.unknown;o instanceof ee&&(t=o.message,n=o.errorCode),this.sendErrorResponse(e,t,n)}}))}handleResponse(e){if(!this.deferredCallbacks[e.data.key])return void console.warn(`Callback for ${e.data.functionName} not found`);const[t,n]=this.deferredCallbacks[e.data.key];delete this.deferredCallbacks[e.data.key],"success"===e.data.status?t(e.data.result):n(new ee(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){q(e.data.functionName,0,n),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage(s({forWindowBridge:!0,type:"response",key:e.data.key,functionName:e.data.functionName},t),e.origin)}static init(e,t){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return te.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get(n,o){return(...r)=>new Promise(((a,i)=>l(this,null,(function*(){const s=o.toString(),c=`${s}--${H()}`;try{const o=yield e();if(!o)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[a,i],o.postMessage({forWindowBridge:!0,type:"request",functionName:s,key:c,params:JSON.parse(JSON.stringify(r))},t)}catch(l){delete n.deferredCallbacks[c],i(new ee(l.message,C.messageSendingFailed))}}))))}})}}var ne=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(ne||{});const oe="ppmna-iframe",re="ppsdk-container";let ae,ie;function se(){return ae||(ae=function(){if(document.getElementById(oe))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",re),e.setAttribute("class",re),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),ae}function ce(e){const t=se();t&&(t.style.display=e?"initial":"none")}function le(){return ie||(ie=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",O),n.setAttribute("name",oe),n.setAttribute("id",oe),n.setAttribute("class",oe),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n)},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=se();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),ie}let de,ue=!1;te.init({}),le();const pe=te.getTargetWindowFunctionProxy((function(){return le().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),N);function me(){return pe}function ge(e){const t=new URL(window.location.href),n=t.searchParams.get("token"),o=t.searchParams.get("one_time_token"),r=u.get(p.refreshToken)||"",a=u.get(p.codeVerifier)||"";ue=!!e.useAllFunctions,(n||o)&&function(e){e.searchParams.delete("token"),e.searchParams.delete("one_time_token"),e.search=e.searchParams.toString();const t=e.toString().replace(e.origin,"");history.replaceState(null,"",t)}(t);const i={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:n,ott:o,refreshToken:r,clientVersion:"2.18.0",codeVerifier:a};let l;de=new Promise((e=>l=e));const d=()=>{var t;l(!0),null==(t=e.complete)||t.call(e)};le().then((()=>{ye(g.init,!1,c(s({},e),{complete:d}),i)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:C.sdkNotInitialized}),d()}))}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&$(e.origin))if(e.data.name===f&&window.location.reload(),e.data.name!==I){if(e.data.name===h){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===v){const{refreshToken:t,domain:n,isSecure:o}=e.data.data;!function(e,t,n){G(p.refreshToken,t),u.set(p.refreshToken,e,{domain:t,expires:90,secure:n})}(t,n,o)}if(e.data.name===E){const{codeVerifier:t,domain:n,isSecure:o}=e.data.data;!function(e,t,n){G(p.codeVerifier,t),u.set(p.codeVerifier,e,{domain:t,secure:n})}(t,n,o)}if(e.data.name===y){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else ce(!0)}));const fe=Z("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:a,locale:i}=e,s=document.getElementById(o);if(!s)throw new ee("Invalid coupon container Id",C.badRequestInsufficientParameter);const c=yield pe.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:a});try{const e=document.createElement("iframe");e.src=P,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(!1),s.innerHTML="",s.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=te.getTargetWindowFunctionProxy((()=>e.contentWindow),N);yield n.renderCoupons({coupons:c,merchantId:t,locale:i})}catch(l){throw new ee(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,C.unknown)}}))),me,(e=>({event_label_suffix:e.merchant,event_label2:e.couponId})));const he=Z("logout",(()=>l(this,null,(function*(){try{const e=K(yield pe.logout(),window.location.hostname);return G(p.refreshToken,e),G(p.codeVerifier,e),{statusCode:ne.loggedOut}}catch(e){throw new ee(`An error ocurred while trying to logout the user, error=${e}`,C.unknown)}}))),me),ve=Z("getPaymentSettings",pe.getPaymentSettings,me);function Ee(e,t,n){var o,r,a;e.result===m.fail&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===m.success&&(null==(r=null==t?void 0:t.success)||r.call(t,null==e?void 0:e.data)),e.result===m.complete&&(null==(a=null==t?void 0:t.complete)||a.call(t),removeEventListener("message",n),Q(e.messageId),J.length>0||ce(!1))}function Ie(e){return l(this,null,(function*(){var t;const n=yield le().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),N)}))}function ye(e,t,n,o){const r=X();t&&ce(!0);const a=t=>{$(t.origin)&&t.data.name===e&&t.data.messageId===r&&Ee(t.data,n,a)};addEventListener("message",a),Ie({name:e,params:o,messageId:r})}!function(e){const t=window;(!t.hasOwnProperty(b)||t[b]!==e)&&(t[b]=e)}({_handleMessageFromNative:e=>{le().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:g.handleMessageFromNative,params:{json:e}})),N)}))}});const be=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData"],Ae=["renderCoupons"],_e=new Proxy({init:ge,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);ye(g.verifyMultiFactorAuthResult,!1,e,c(s({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void ye(g.share,!1,e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:C.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n;document.title=(null==e?void 0:e.title)||"",null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},render:function(e){var t;if(!(null==e?void 0:e.containerId)||!document.getElementById(null==e?void 0:e.containerId))return null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:C.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=X(),o=t=>{var r,a;if(!$(t.origin)||t.data.name!==g.render||t.data.messageId!==n)return;const i=null==(r=t.data)?void 0:r.data,c=null==(a=t.data)?void 0:a.data;t.data.result===m.success&&(!function(e,t){var n,o,r,a,i,c,l;const d=document.getElementById(t.containerId),u=document.createElement("button");u.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const p=function(e){return"red"===e?w:T}(null==t?void 0:t.theme),m=(null==(o=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:o.length)?"pp-cashback":"",f=t.isShortText?"pp-shortText":"",h=null!=(r=null==t?void 0:t.buttonSize)?r:"lg",v=null!=(a=null==t?void 0:t.theme)?a:"light",E=document.createElement("a");E.className=`pp-smartBtn pp-${v} pp-${h} pp-${Y(t.type)} pp-${e.preferredLanguage} ${m} ${f}`,E.href=Y(e.data.loginUrl);const I=document.createElement("span");I.className="pp-leftSection";const y=document.createElement("img");y.className="pp-img",y.src=p,y.alt="",I.appendChild(y);const b=document.createElement("span");b.className="pp-btnContent";const A=document.createElement("span");A.className="pp-title",A.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,b.appendChild(A),I.appendChild(b),E.append(I);const _=document.createElement("span");(null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo)&&(_.className="pp-cashbackInfo",_.innerText=null==(l=null==e?void 0:e.data)?void 0:l.cashbackInfo,b.append(_));if(e.data.avatarUrl){const t=document.createElement("img");t.className="pp-userProfile",t.src=e.data.avatarUrl,t.addEventListener("error",(function(e){var t;const n=e.target;null==(t=null==n?void 0:n.parentNode)||t.removeChild(n)})),E.append(t)}u.append(E),d&&(d.innerHTML="",d.appendChild(u),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&u.addEventListener("click",(e=>{var n;e.preventDefault(),(null==t?void 0:t.callback)?null==(n=null==t?void 0:t.callback)||n.call(t):t.orderInfo&&ye(g.makePayment,!0,t,s({},t.orderInfo))})))}(c,e),"pay"===i.type&&(null==c?void 0:c.isJustLoggedIn)&&e.autoInvoke&&(null==c?void 0:c.isLoggedIn)&&ye(g.makePayment,!0,e,s({},e.orderInfo))),t.data.result===m.complete&&(Q(t.data.messageId),removeEventListener("message",o))};addEventListener("message",o),Ie({name:g.render,params:c(s({},e),{redirectUrl:e.redirectUrl||window.location.href}),messageId:n})},renderCoupons:fe,scanCode:function(e){var t;const n=c(s({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});ye(g.scanCode,!1,e,n)},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const a=document.execCommand("copy");document.body.removeChild(r),a?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:C.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;ye(g.getKycPassportInfo,!1,e,c(s({},e),{url:t}))},logout:he,getPaymentSettings:ve},{get(e,t){const n=t;if(!ue&&!function(e){return A.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return o=>l(this,null,(function*(){var r,a;if(!be.includes(n)&&!(yield de)){if(!Ae.includes(n)||!o.clientId)return null==(r=o.fail)||r.call(o,{errorCode:C.sdkNotInitialized}),void(null==(a=o.complete)||a.call(o));ge({clientId:o.clientId,env:o.env}),yield de}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](o);ye(t,!1,o,o)}))}});!function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)_e[t](n)}}(),_e.revision="7c80dbc";const Te=_e;window._pp=Te;return Te}();
|
|
2
|
+
var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))a.call(t,n)&&i(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>new Promise(((o,r)=>{var a=e=>{try{s(n.next(e))}catch(t){r(t)}},i=e=>{try{s(n.throw(e))}catch(t){r(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,i);s((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var u=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=d({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var i in r)r[i]&&(a+="; "+i,!0!==r[i]&&(a+="="+r[i].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+a}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var a=n[r].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(o[s]=t.read(i,s),e===s)break}catch(c){}}return e?o[e]:o}},remove:function(e,t){o(e,"",d({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,d({},this.attributes,t))},withConverter:function(t){return e(d({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),p=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.claimCouponImmediately="ppjssdk.claimCouponImmediately",e.merchant="ppjssdk.merchant",e.consumedOTT="ppjssdk.consumedOTT",e))(p||{});const m={success:"success",fail:"fail",complete:"complete"},g={init:"init",getBankInfo:"getBankInfo",showAlert:"showAlert",render:"render",makePayment:"makePayment",getUAID:"getUAID",logout:"logout",startMultiFactorAuth:"startMultiFactorAuth",verifyMultiFactorAuthResult:"verifyMultiFactorAuthResult",getPermissionStatus:"getPermissionStatus",registerKyc:"registerKyc",getKycInformation:"getKycInformation",getUserAddress:"getUserAddress",getUserLocation:"getUserLocation",getUserProfile:"getUserProfile",registerEmail:"registerEmail",showUpdateWarning:"showUpdateWarning",showErrorSheet:"showErrorSheet",getPlatformInformation:"getPlatformInformation",share:"share",getTopBarHeight:"getTopBarHeight",openWebview:"openWebview",openMap:"openMap",closeApp:"closeApp",openApp:"openApp",checkPaymentMethod:"checkPaymentMethod",getBalance:"getBalance",topup:"topup",registerPaymentFeatures:"registerPaymentFeatures",registerUserInfo:"registerUserInfo",requestInternal:"requestInternal",scanCode:"scanCode",getAuthStatus:"getAuthStatus",openMiniApp:"openMiniApp",inputAddress:"inputAddress",checkAccessToken:"checkAccessToken",getCashbackInformation:"getCashbackInformation",request:"request",getDeviceInformation:"getDeviceInformation",debug:"debug",createOrder:"createOrder",handleMessageFromNative:"handleMessageFromNative",initKycPassport:"initKycPassport",smsAuth:"smsAuth",getKycPassportInfo:"getKycPassportInfo"},f="reload",h="link",v="saveRefreshToken",E="saveCodeVerifier",I="makeVisible",y="consoleDebugInfo",A="_PayPayJsBridge",_=["init","openWebview","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","logAppsFlyerEvent","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo","getExternalLinkageInformation"];function b(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const T=b("icon-paypay-rec.svg"),w=b("icon-paypay-rec-white.svg"),N="2.20.0",S=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),k=S.origin,O=new URL(`./iframe.html?v=${N}&rev=8ad09df`,S).href,P=new URL(`./coupon/iframe.html?v=${N}`,S).href;var C=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e.noLocationData="NO_LOCATION_DATA",e.functionNotFound="FUNCTION_NOT_FOUND",e.originNotAllowed="ORIGIN_NOT_ALLOWED",e.messageSendingFailed="MESSAGE_SENDING_FAILED",e.transactionNotFound="TRANSACTION_NOT_FOUND",e.unexpectedOperation="UNEXPECTED_OP",e.merchantTimeout="MERCHANT_TIMEOUT",e))(C||{});Object.prototype.toString;function D(e){return e&&e.Math==Math?e:void 0}const R="object"==typeof globalThis&&D(globalThis)||"object"==typeof window&&D(window)||"object"==typeof self&&D(self)||"object"==typeof global&&D(global)||function(){return this}()||{};const U=["debug","info","warn","error","log","assert","trace"],L={};function F(e){if(!("console"in R))return e();const t=R.console,n={},o=Object.keys(L);o.forEach((e=>{const o=L[e];n[e]=t[e],t[e]=o}));try{return e()}finally{o.forEach((e=>{t[e]=n[e]}))}}!function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?U.forEach((n=>{t[n]=(...t)=>{e&&F((()=>{R.console[n](`Sentry Logger [${n}]:`,...t)}))}})):U.forEach((e=>{t[e]=()=>{}}))}();var M;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(M||(M={}));const j=R,B={nowSeconds:()=>Date.now()/1e3};const x="undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__||"[object process]"!==Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(){const{performance:e}=j;if(!e||!e.now)return;return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}():function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(n){return}var e,t}(),V=void 0===x?B:{nowSeconds:()=>(x.timeOrigin+x.now())/1e3};B.nowSeconds.bind(B),V.nowSeconds.bind(V);(()=>{const{performance:e}=j;if(!e||!e.now)return;const t=36e5,n=e.now(),o=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,a=r<t,i=e.timing&&e.timing.navigationStart,s="number"==typeof i?Math.abs(i+n-o):t;(a||s<t)&&(r<=s&&e.timeOrigin)})();const W=[C.sdkNotInitialized,C.notAuthorized,C.userCanceled,C.userCanceledSimilarTxn,C.suspectedDuplicatePayment,C.noSufficientFund];function q(e,t,n){W.includes(n),0}let $;!function(){try{return localStorage.getItem("ppjssdk.canWriteToLocalStorage"),!0}catch(e){return console.log(e),!1}}();const z=["ab.ca","ac.ac","ac.ae","ac.at","ac.be","ac.cn","ac.il","ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.sg","ad.jp","adm.br","adv.br","ah.cn","am.br","arq.br","art.br","arts.ro","asn.au","asso.fr","asso.mc","bc.ca","bio.br","biz.pl","biz.tr","bj.cn","bel.tr","br.com","cn.com","cng.br","cnt.br","co.ac","co.at","co.de","co.gl","co.hk","co.id","co.il","co.in","co.jp","co.kr","co.mg","co.ms","co.nz","co.th","cp.tz","co.uk","co.ve","co.vi","co.za","com.ag","com.ai","com.ar","com.au","com.br","com.co","com.cn","com.cy","com.de","com.do","com.ec","com.es","com.fj","com.fr","com.gl","com.gt","com.hk","com.hr","com.hu","com.kg","com.ki","com.lc","com.mg","com.mm","com.ms","com.mt","com.mu","com.mx","com.my","com.na","com.nf","com.ng","com.ni","com.pa","com.ph","com.pl","com.pt","com.qa","com.ro","com.ru","com.sb","com.sc","com.sg","com.sv","com.tr","com.tw","com.ua","com.uy","com.ve","com.vn","cq.cn","de.com","de.org","ecn.br","ed.jp","edu.au","edu.cn","edu.hk","edu.mm","edu.my","edu.pl","edu.pt","edu.qa","edu.sg","edu.tr","edu.tw","eng.br","ernet.in","esp.br","etc.br","eti.br","eu.com","eu.int","eu.lv","firm.in","firm.ro","fm.br","fot.br","fst.br","g12.br","gb.com","gb.net","gd.cn","gen.in","go.jp","go.kr","go.th","gov.au","gov.az","gov.br","gov.cn","gov.il","gov.in","gov.mm","gov.my","gov.qa","gov.sg","gov.tr","gov.tw","gov.uk","govt.nz","gr.jp","gs.cn","gv.ac","gv.at","gx.cn","gz.cn","he.cn","hi.cn","hk.cn","hl.cn","hu.com","id.au","idv.tw","in.ua","in.th","ind.br","ind.in","inf.br","info.pl","info.ro","info.tr","info.ve","iwi.nz","jl.cn","jor.br","js.cn","jus.br","k12.il","k12.tr","kr.com","lel.br","lg.jp","ln.cn","ltd.uk","mb.ca","me.uk","med.br","mi.th","mil.br","mil.uk","mo.cn","mod.uk","muni.il","nb.ca","ne.jp","ne.kr","net.ag","net.ai","net.au","net.br","net.cn","net.do","net.gl","net.hk","net.il","net.in","net.kg","net.ki","net.lc","net.mg","net.mm","net.mu","net.ni","net.nz","net.pl","net.ru","net.sb","net.sc","net.sg","net.th","net.tr","net.tw","net.uk","net.ve","nf.ca","nhs.uk","nm.cn","nm.kr","no.com","nom.br","nom.ni","nom.ro","ns.ca","nt.ca","nt.ro","ntr.br","nx.cn","odo.br","off.ai","on.ca","or.ac","or.at","or.jp","or.kr","or.th","org.ag","org.ai","org.au","org.br","org.cn","org.do","org.es","org.gl","org.hk","org.in","org.kg","org.ki","org.lc","org.mg","org.mm","org.ms","org.nf","org.ng","org.ni","org.nz","org.pl","org.ro","org.ru","org.sb","org.sc","org.sg","org.tr","org.tw","org.uk","org.ve","pe.ca","plc.uk","ppg.br","pro.br","psc.br","psi.br","qc.ca","qc.com","qh.cn","rec.br","rec.ro","res.in","sa.com","sc.cn","sch.uk","se.com","se.net","sh.cn","sk.ca","slg.br","sn.cn","store.ro","tj.cn","tm.fr","tm.mc","tm.ro","tmp.br","tur.br","tv.br","tv.tr","tw.cn","uk.com","uk.net","us.com","uy.com","vet.br","waw.pl","web.ve","www.ro","xj.cn","xz.cn","yk.ca","yn.cn","zj.cn","zlg.br"];function K(e,t){return e?function(e){const t=e.split(".");if(function(e){return/(^\s*(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))\s*$)/.test(e)}(n=e)||function(e){return/(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$)/.test(e)}(n)||t.length<=2)return e;var n;const o=t.slice(t.length-2).join(".");return z.includes(o)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}function H(){return Math.random().toString(36).substring(7)}function Y(e){var t,n;const o=null!=(n=null!=(t=null==e?void 0:e.clientId)?t:$)?n:"",r=(null==e?void 0:e.featureName)?`_${null==e?void 0:e.featureName}`:"";return`${(null==e?void 0:e.sdkType)?e.sdkType:navigator.userAgent.includes("PayPayMiniApp/")?"miniapp":"smartpayment"}_${o}${r}`}function G(e){return e===k}function J(e){return e?String(e):""}function Q(e,t){u.remove(e),u.remove(e,{domain:t})}C.notAuthorized,C.badRequest,C.badRequestInsufficientParameter,C.insufficientScope,C.insufficientScope;let X=[];function Z(e){X=X.filter((t=>t!==e))}function ee(){const e=H();return X.push(e),e}function te(e,t,n,o){return function(r={}){const a=n(),i=null==o?void 0:o(r);a.logEvent(s({event_action:`pp_${e}_called`,event_category:Y({featureName:e})},i)),t(r).then((t=>{var n;a.logEvent(s({event_action:`pp_${e}_success`,event_category:Y({featureName:e})},i)),null==(n=r.success)||n.call(r,t)})).catch((t=>{var n;console.error(t.message),a.logEvent(s({event_action:`pp_${e}_fail`,event_category:Y({featureName:e}),error_value:t.errorCode},i)),null==(n=r.fail)||n.call(r,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=r.complete)||e.call(r)}))}}class ne extends Error{constructor(e,t){super(e),this.errorCode=t}}class oe{constructor(e,t){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.messageEventHandler=this.messageEventHandler.bind(this),this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,C.originNotAllowed):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}handleRequest(e){return l(this,null,(function*(){const t=e.data.functionName,n=this.functions[t];n||this.sendErrorResponse(e,`Function '${t}' does not exists on the target window`,C.functionNotFound);try{const t={clientOrigin:e.origin};this.sendSuccessResponse(e,yield n(...e.data.params,t))}catch(o){let t="Some error ocurred while processing the request",n=C.unknown;o instanceof ne&&(t=o.message,n=o.errorCode),this.sendErrorResponse(e,t,n)}}))}handleResponse(e){if(!this.deferredCallbacks[e.data.key])return void console.warn(`Callback for ${e.data.functionName} not found`);const[t,n]=this.deferredCallbacks[e.data.key];delete this.deferredCallbacks[e.data.key],"success"===e.data.status?t(e.data.result):n(new ne(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){q(e.data.functionName,0,n),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage(s({forWindowBridge:!0,type:"response",key:e.data.key,functionName:e.data.functionName},t),e.origin)}static init(e,t){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return oe.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get(n,o){return(...r)=>new Promise(((a,i)=>l(this,null,(function*(){const s=o.toString(),c=`${s}--${H()}`;try{const o=yield e();if(!o)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[a,i],o.postMessage({forWindowBridge:!0,type:"request",functionName:s,key:c,params:JSON.parse(JSON.stringify(r))},t)}catch(l){delete n.deferredCallbacks[c],i(new ne(l.message,C.messageSendingFailed))}}))))}})}}var re=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(re||{});const ae="ppmna-iframe",ie="ppsdk-container";let se,ce;function le(){return se||(se=function(){if(document.getElementById(ae))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",ie),e.setAttribute("class",ie),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),se}function de(e){const t=le();t&&(t.style.display=e?"initial":"none")}function ue(){return ce||(ce=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",O),n.setAttribute("name",ae),n.setAttribute("id",ae),n.setAttribute("class",ae),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n)},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=le();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),ce}let pe,me=!1;oe.init({}),ue();const ge=oe.getTargetWindowFunctionProxy((function(){return ue().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),k);function fe(){return ge}function he(e){const t=new URL(window.location.href),n=t.searchParams.get("token"),o=t.searchParams.get("one_time_token"),r=u.get(p.refreshToken)||"",a=u.get(p.codeVerifier)||"";me=!!e.useAllFunctions,(n||o)&&function(e){e.searchParams.delete("token"),e.searchParams.delete("one_time_token"),e.search=e.searchParams.toString();const t=e.toString().replace(e.origin,"");history.replaceState(null,"",t)}(t);const i={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:n,ott:o,refreshToken:r,clientVersion:"2.20.0",codeVerifier:a};let l;pe=new Promise((e=>l=e));const d=()=>{var t;l(!0),null==(t=e.complete)||t.call(e)};ue().then((()=>{be(g.init,!1,c(s({},e),{complete:d}),i)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:C.sdkNotInitialized}),d()}))}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&G(e.origin))if(e.data.name===f&&window.location.reload(),e.data.name!==I){if(e.data.name===h){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===v){const{refreshToken:t,domain:n,isSecure:o}=e.data.data;!function(e,t,n){Q(p.refreshToken,t),u.set(p.refreshToken,e,{domain:t,expires:90,secure:n})}(t,n,o)}if(e.data.name===E){const{codeVerifier:t,domain:n,isSecure:o}=e.data.data;!function(e,t,n){Q(p.codeVerifier,t),u.set(p.codeVerifier,e,{domain:t,secure:n})}(t,n,o)}if(e.data.name===y){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else de(!0)}));const ve=te("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:a,locale:i}=e,s=document.getElementById(o);if(!s)throw new ne("Invalid coupon container Id",C.badRequestInsufficientParameter);const c=yield ge.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:a});try{const e=document.createElement("iframe");e.src=P,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(!1),s.innerHTML="",s.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=oe.getTargetWindowFunctionProxy((()=>e.contentWindow),k);yield n.renderCoupons({coupons:c,merchantId:t,locale:i})}catch(l){throw new ne(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,C.unknown)}}))),fe,(e=>({event_label2:e.couponId,merchant_id:e.merchant})));const Ee=te("logout",(()=>l(this,null,(function*(){try{const e=K(yield ge.logout(),window.location.hostname);return Q(p.refreshToken,e),Q(p.codeVerifier,e),{statusCode:re.loggedOut}}catch(e){throw new ne(`An error ocurred while trying to logout the user, error=${e}`,C.unknown)}}))),fe),Ie=te("getPaymentSettings",ge.getPaymentSettings,fe),ye=te("getLoginUrl",(e=>ge.getLoginUrl({redirectUrl:e.redirectUrl||location.href,redirectType:e.redirectType})),fe);function Ae(e,t,n){var o,r,a;e.result===m.fail&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===m.success&&(null==(r=null==t?void 0:t.success)||r.call(t,null==e?void 0:e.data)),e.result===m.complete&&(null==(a=null==t?void 0:t.complete)||a.call(t),removeEventListener("message",n),Z(e.messageId),X.length>0||de(!1))}function _e(e){return l(this,null,(function*(){var t;const n=yield ue().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),k)}))}function be(e,t,n,o){const r=ee();t&&de(!0);const a=t=>{G(t.origin)&&t.data.name===e&&t.data.messageId===r&&Ae(t.data,n,a)};addEventListener("message",a),_e({name:e,params:o,messageId:r})}!function(e){const t=window;(!t.hasOwnProperty(A)||t[A]!==e)&&(t[A]=e)}({_handleMessageFromNative:e=>{ue().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:g.handleMessageFromNative,params:{json:e}})),k)}))}});const Te=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],we=["renderCoupons"],Ne=new Proxy({init:he,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);be(g.verifyMultiFactorAuthResult,!1,e,c(s({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void be(g.share,!1,e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:C.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n;document.title=(null==e?void 0:e.title)||"",null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},render:function(e){var t;if(!(null==e?void 0:e.containerId)||!document.getElementById(null==e?void 0:e.containerId))return null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:C.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=ee(),o=t=>{var r,a;if(!G(t.origin)||t.data.name!==g.render||t.data.messageId!==n)return;const i=null==(r=t.data)?void 0:r.data,c=null==(a=t.data)?void 0:a.data;t.data.result===m.success&&(!function(e,t){var n,o,r,a,i,c,l;const d=document.getElementById(t.containerId),u=document.createElement("button");u.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const p=function(e){return"red"===e?w:T}(null==t?void 0:t.theme),m=(null==(o=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:o.length)?"pp-cashback":"",f=t.isShortText?"pp-shortText":"",h=null!=(r=null==t?void 0:t.buttonSize)?r:"lg",v=null!=(a=null==t?void 0:t.theme)?a:"light",E=document.createElement("a");E.className=`pp-smartBtn pp-${v} pp-${h} pp-${J(t.type)} pp-${e.preferredLanguage} ${m} ${f}`,E.href=J(e.data.loginUrl);const I=document.createElement("span");I.className="pp-leftSection";const y=document.createElement("img");y.className="pp-img",y.src=p,y.alt="",I.appendChild(y);const A=document.createElement("span");A.className="pp-btnContent";const _=document.createElement("span");_.className="pp-title",_.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,A.appendChild(_),I.appendChild(A),E.append(I);const b=document.createElement("span");(null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo)&&(b.className="pp-cashbackInfo",b.innerText=null==(l=null==e?void 0:e.data)?void 0:l.cashbackInfo,A.append(b));if(e.data.avatarUrl){const t=document.createElement("img");t.className="pp-userProfile",t.src=e.data.avatarUrl,t.addEventListener("error",(function(e){var t;const n=e.target;null==(t=null==n?void 0:n.parentNode)||t.removeChild(n)})),E.append(t)}u.append(E),d&&(d.innerHTML="",d.appendChild(u),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&u.addEventListener("click",(e=>{var n;e.preventDefault(),(null==t?void 0:t.callback)?null==(n=null==t?void 0:t.callback)||n.call(t):t.orderInfo&&be(g.makePayment,!0,t,s({},t.orderInfo))})))}(c,e),"pay"===i.type&&(null==c?void 0:c.isJustLoggedIn)&&e.autoInvoke&&(null==c?void 0:c.isLoggedIn)&&be(g.makePayment,!0,e,s({},e.orderInfo))),t.data.result===m.complete&&(Z(t.data.messageId),removeEventListener("message",o))};addEventListener("message",o),_e({name:g.render,params:c(s({},e),{redirectUrl:e.redirectUrl||window.location.href}),messageId:n})},renderCoupons:ve,scanCode:function(e){var t;const n=c(s({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});be(g.scanCode,!1,e,n)},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const a=document.execCommand("copy");document.body.removeChild(r),a?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:C.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;be(g.getKycPassportInfo,!1,e,c(s({},e),{url:t}))},logout:Ee,getPaymentSettings:Ie,getLoginUrl:ye},{get(e,t){const n=t;if(!me&&!function(e){return _.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return o=>l(this,null,(function*(){var r,a;if(!Te.includes(n)&&!(yield pe)){if(!we.includes(n)||!o.clientId)return null==(r=o.fail)||r.call(o,{errorCode:C.sdkNotInitialized}),void(null==(a=o.complete)||a.call(o));he({clientId:o.clientId,env:o.env}),yield pe}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](o);be(t,!1,o,o)}))}});!function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)Ne[t](n)}}(),Ne.revision="8ad09df";const Se=Ne;window._pp=Se;return Se}();
|
|
@@ -183,7 +183,6 @@ const PPFunctionName = {
|
|
|
183
183
|
showErrorSheet: "showErrorSheet",
|
|
184
184
|
getPlatformInformation: "getPlatformInformation",
|
|
185
185
|
share: "share",
|
|
186
|
-
setTitle: "setTitle",
|
|
187
186
|
getTopBarHeight: "getTopBarHeight",
|
|
188
187
|
openWebview: "openWebview",
|
|
189
188
|
openMap: "openMap",
|
|
@@ -204,13 +203,11 @@ const PPFunctionName = {
|
|
|
204
203
|
request: "request",
|
|
205
204
|
getDeviceInformation: "getDeviceInformation",
|
|
206
205
|
debug: "debug",
|
|
207
|
-
copyToClipboard: "copyToClipboard",
|
|
208
206
|
createOrder: "createOrder",
|
|
209
207
|
handleMessageFromNative: "handleMessageFromNative",
|
|
210
208
|
initKycPassport: "initKycPassport",
|
|
211
209
|
smsAuth: "smsAuth",
|
|
212
|
-
getKycPassportInfo: "getKycPassportInfo"
|
|
213
|
-
renderCoupons: "renderCoupons"
|
|
210
|
+
getKycPassportInfo: "getKycPassportInfo"
|
|
214
211
|
};
|
|
215
212
|
const PPUtilFunctionName = {
|
|
216
213
|
reload: "reload",
|
|
@@ -277,15 +274,16 @@ const miniAppSupportedFunctions = [
|
|
|
277
274
|
"getPaymentSettings",
|
|
278
275
|
"getTransactionInfo",
|
|
279
276
|
"getTransactions",
|
|
280
|
-
"getPayPayCardInfo"
|
|
277
|
+
"getPayPayCardInfo",
|
|
278
|
+
"getExternalLinkageInformation"
|
|
281
279
|
];
|
|
282
280
|
function url(path) {
|
|
283
281
|
return "https://image.paypay.ne.jp/miniapps/mini-app-sdk/" + path;
|
|
284
282
|
}
|
|
285
283
|
const img_paypayRec = url("icon-paypay-rec.svg");
|
|
286
284
|
const img_paypayRecWhite = url("icon-paypay-rec-white.svg");
|
|
287
|
-
const JS_SDK_VERSION = "2.
|
|
288
|
-
const REVISION = "
|
|
285
|
+
const JS_SDK_VERSION = "2.20.0";
|
|
286
|
+
const REVISION = "8ad09df";
|
|
289
287
|
const coreBaseUrl = new URL("https://mini-app-sdk-core.paypay.ne.jp/");
|
|
290
288
|
const CORE_IFRAME_ORIGIN = coreBaseUrl.origin;
|
|
291
289
|
const CORE_IFRAME_URL = new URL(
|
|
@@ -1666,6 +1664,7 @@ function captureMessage(message, captureContext) {
|
|
|
1666
1664
|
}
|
|
1667
1665
|
const errorsToIgnore = [
|
|
1668
1666
|
MiniAppErrorType.sdkNotInitialized,
|
|
1667
|
+
MiniAppErrorType.notAuthorized,
|
|
1669
1668
|
MiniAppErrorType.userCanceled,
|
|
1670
1669
|
MiniAppErrorType.userCanceledSimilarTxn,
|
|
1671
1670
|
MiniAppErrorType.suspectedDuplicatePayment,
|
|
@@ -1679,8 +1678,12 @@ function sendWindowBridgeErrorToSentry(functionName, message, error) {
|
|
|
1679
1678
|
);
|
|
1680
1679
|
}
|
|
1681
1680
|
}
|
|
1681
|
+
let clientId;
|
|
1682
1682
|
if (!isEnableLocalStorage())
|
|
1683
1683
|
;
|
|
1684
|
+
function getClientId() {
|
|
1685
|
+
return clientId;
|
|
1686
|
+
}
|
|
1684
1687
|
function isEnableLocalStorage() {
|
|
1685
1688
|
try {
|
|
1686
1689
|
localStorage.getItem("ppjssdk.canWriteToLocalStorage");
|
|
@@ -2048,9 +2051,19 @@ function getDomain(subdomainCookieSharing, hostname) {
|
|
|
2048
2051
|
OP_OUT_OF_SCOPE: MiniAppErrorType.insufficientScope,
|
|
2049
2052
|
MINI_APP_SCOPE_NOT_FOUND: MiniAppErrorType.insufficientScope
|
|
2050
2053
|
});
|
|
2054
|
+
function isPayPayMiniApp() {
|
|
2055
|
+
return navigator.userAgent.includes("PayPayMiniApp/");
|
|
2056
|
+
}
|
|
2051
2057
|
function getRandomString() {
|
|
2052
2058
|
return Math.random().toString(36).substring(7);
|
|
2053
2059
|
}
|
|
2060
|
+
function getEventCategory(params) {
|
|
2061
|
+
var _a, _b;
|
|
2062
|
+
const clientId2 = (_b = (_a = params == null ? void 0 : params.clientId) != null ? _a : getClientId()) != null ? _b : "";
|
|
2063
|
+
const featureName = (params == null ? void 0 : params.featureName) ? `_${params == null ? void 0 : params.featureName}` : "";
|
|
2064
|
+
const sdkType = (params == null ? void 0 : params.sdkType) ? params.sdkType : isPayPayMiniApp() ? "miniapp" : "smartpayment";
|
|
2065
|
+
return `${sdkType}_${clientId2}${featureName}`;
|
|
2066
|
+
}
|
|
2054
2067
|
function checkIFrameOrigin(origin) {
|
|
2055
2068
|
return origin === CORE_IFRAME_ORIGIN;
|
|
2056
2069
|
}
|
|
@@ -2122,12 +2135,14 @@ function promiseToCallback(functionName, target, getCore2, getLoggingParams) {
|
|
|
2122
2135
|
const core2 = getCore2();
|
|
2123
2136
|
const loggingParams = getLoggingParams == null ? void 0 : getLoggingParams(params);
|
|
2124
2137
|
void core2.logEvent(__spreadValues({
|
|
2125
|
-
event_action: `pp_${functionName}_called
|
|
2138
|
+
event_action: `pp_${functionName}_called`,
|
|
2139
|
+
event_category: getEventCategory({ featureName: functionName })
|
|
2126
2140
|
}, loggingParams));
|
|
2127
2141
|
target(params).then((result) => {
|
|
2128
2142
|
var _a;
|
|
2129
2143
|
void core2.logEvent(__spreadValues({
|
|
2130
|
-
event_action: `pp_${functionName}_success
|
|
2144
|
+
event_action: `pp_${functionName}_success`,
|
|
2145
|
+
event_category: getEventCategory({ featureName: functionName })
|
|
2131
2146
|
}, loggingParams));
|
|
2132
2147
|
(_a = params.success) == null ? void 0 : _a.call(params, result);
|
|
2133
2148
|
}).catch((error) => {
|
|
@@ -2135,6 +2150,7 @@ function promiseToCallback(functionName, target, getCore2, getLoggingParams) {
|
|
|
2135
2150
|
console.error(error.message);
|
|
2136
2151
|
void core2.logEvent(__spreadValues({
|
|
2137
2152
|
event_action: `pp_${functionName}_fail`,
|
|
2153
|
+
event_category: getEventCategory({ featureName: functionName }),
|
|
2138
2154
|
error_value: error.errorCode
|
|
2139
2155
|
}, loggingParams));
|
|
2140
2156
|
(_a = params.fail) == null ? void 0 : _a.call(params, { errorCode: error.errorCode });
|
|
@@ -2513,7 +2529,7 @@ function init(params) {
|
|
|
2513
2529
|
const ott = url2.searchParams.get("one_time_token");
|
|
2514
2530
|
const refreshToken = getRefreshToken();
|
|
2515
2531
|
const codeVerifier = getCodeVerifier();
|
|
2516
|
-
const clientVersion = "2.
|
|
2532
|
+
const clientVersion = "2.20.0";
|
|
2517
2533
|
useAllFunctions = !!params.useAllFunctions;
|
|
2518
2534
|
if (token || ott) {
|
|
2519
2535
|
removeTokenFromUrl(url2);
|
|
@@ -2684,8 +2700,8 @@ const renderCoupons = promiseToCallback(
|
|
|
2684
2700
|
}),
|
|
2685
2701
|
getCore,
|
|
2686
2702
|
(params) => ({
|
|
2687
|
-
|
|
2688
|
-
|
|
2703
|
+
event_label2: params.couponId,
|
|
2704
|
+
merchant_id: params.merchant
|
|
2689
2705
|
})
|
|
2690
2706
|
);
|
|
2691
2707
|
function scanCode(params) {
|
|
@@ -2756,6 +2772,16 @@ const getPaymentSettings = promiseToCallback(
|
|
|
2756
2772
|
core.getPaymentSettings,
|
|
2757
2773
|
getCore
|
|
2758
2774
|
);
|
|
2775
|
+
const getLoginUrl = promiseToCallback(
|
|
2776
|
+
"getLoginUrl",
|
|
2777
|
+
(params) => {
|
|
2778
|
+
return core.getLoginUrl({
|
|
2779
|
+
redirectUrl: params.redirectUrl || location.href,
|
|
2780
|
+
redirectType: params.redirectType
|
|
2781
|
+
});
|
|
2782
|
+
},
|
|
2783
|
+
getCore
|
|
2784
|
+
);
|
|
2759
2785
|
function copyToClipboard(params) {
|
|
2760
2786
|
var _a, _b, _c;
|
|
2761
2787
|
const textarea = document.createElement("textarea");
|
|
@@ -2926,7 +2952,8 @@ const clientFunctions = {
|
|
|
2926
2952
|
removeStorageData,
|
|
2927
2953
|
getKycPassportInfo,
|
|
2928
2954
|
logout,
|
|
2929
|
-
getPaymentSettings
|
|
2955
|
+
getPaymentSettings,
|
|
2956
|
+
getLoginUrl
|
|
2930
2957
|
};
|
|
2931
2958
|
const initExemptedFunctions = [
|
|
2932
2959
|
"init",
|
|
@@ -2936,7 +2963,8 @@ const initExemptedFunctions = [
|
|
|
2936
2963
|
"setSessionData",
|
|
2937
2964
|
"getStorageData",
|
|
2938
2965
|
"setStorageData",
|
|
2939
|
-
"removeStorageData"
|
|
2966
|
+
"removeStorageData",
|
|
2967
|
+
"getLoginUrl"
|
|
2940
2968
|
];
|
|
2941
2969
|
const autoInitFunctions = ["renderCoupons"];
|
|
2942
2970
|
const proxy = new Proxy(clientFunctions, {
|
|
@@ -2982,7 +3010,7 @@ function executePendingFunctionCalls() {
|
|
|
2982
3010
|
}
|
|
2983
3011
|
}
|
|
2984
3012
|
executePendingFunctionCalls();
|
|
2985
|
-
proxy.revision = "
|
|
3013
|
+
proxy.revision = "8ad09df";
|
|
2986
3014
|
const client = proxy;
|
|
2987
3015
|
window._pp = client;
|
|
2988
3016
|
const miniAppSdk = client;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { NativeParams } from '../../jsbridge-core/jsbridge';
|
|
2
|
+
import { GetExternalLinkageInformationResult } from '../../types/GetExternalLinkageInformationResult';
|
|
3
|
+
export declare function getExternalLinkageInformation(params: NativeParams<GetExternalLinkageInformationResult>): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MiniAppFunctionContext, RenderSmartButtonParams } from '../../types';
|
|
2
2
|
export declare function getRenderButtonInfo(params: RenderSmartButtonParams, context: MiniAppFunctionContext): Promise<{
|
|
3
3
|
data: import('../../types').SmartButtonParam;
|
|
4
|
-
preferredLanguage:
|
|
4
|
+
preferredLanguage: "en" | "ja";
|
|
5
5
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MiniAppFunctionContext, RenderSmartButtonParams, SmartButtonParam } from '../../types';
|
|
2
2
|
export declare function getRenderLoginInfo(params: RenderSmartButtonParams, context: MiniAppFunctionContext): Promise<{
|
|
3
3
|
data: SmartButtonParam;
|
|
4
|
-
preferredLanguage:
|
|
4
|
+
preferredLanguage: "en" | "ja";
|
|
5
5
|
}>;
|
|
@@ -2,13 +2,13 @@ import { MiniAppFunctionContext, RenderSmartButtonParams, SmartButtonParam } fro
|
|
|
2
2
|
export declare function getRenderPayInfo(params: RenderSmartButtonParams, context: MiniAppFunctionContext): Promise<{
|
|
3
3
|
renderParams: RenderSmartButtonParams;
|
|
4
4
|
data: SmartButtonParam;
|
|
5
|
-
preferredLanguage:
|
|
5
|
+
preferredLanguage: "en" | "ja";
|
|
6
6
|
isLoggedIn?: undefined;
|
|
7
7
|
isJustLoggedIn?: undefined;
|
|
8
8
|
} | {
|
|
9
9
|
renderParams: RenderSmartButtonParams;
|
|
10
10
|
data: SmartButtonParam;
|
|
11
11
|
isLoggedIn: boolean;
|
|
12
|
-
preferredLanguage:
|
|
12
|
+
preferredLanguage: "en" | "ja";
|
|
13
13
|
isJustLoggedIn: boolean;
|
|
14
14
|
}>;
|
|
@@ -67,8 +67,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
67
|
}>> & {
|
|
68
68
|
"onCreate-lottie"?: ((_p: AnimationItem) => any) | undefined;
|
|
69
69
|
}, {
|
|
70
|
-
path: string;
|
|
71
70
|
type: TRenderType;
|
|
71
|
+
path: string;
|
|
72
72
|
loop: boolean;
|
|
73
73
|
autoplay: boolean;
|
|
74
74
|
styles: Record<string, any>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ja: {
|
|
3
|
+
topupCompletion: {
|
|
4
|
+
title: string;
|
|
5
|
+
idInfo: string;
|
|
6
|
+
copied: string;
|
|
7
|
+
};
|
|
8
|
+
paymentMethod: {
|
|
9
|
+
expired: string;
|
|
10
|
+
ordinary: string;
|
|
11
|
+
current: string;
|
|
12
|
+
checkGreen: string;
|
|
13
|
+
authenticated: string;
|
|
14
|
+
yjTitle: string;
|
|
15
|
+
ppCardTitle: string;
|
|
16
|
+
brand: string;
|
|
17
|
+
};
|
|
18
|
+
paymentMethodStatus: {
|
|
19
|
+
ACTIVATED: string;
|
|
20
|
+
OFF: string;
|
|
21
|
+
APPLYING: string;
|
|
22
|
+
MAINTENANCE: string;
|
|
23
|
+
BUSY: string;
|
|
24
|
+
SUSPENDED: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
en: {
|
|
28
|
+
topupCompletion: {
|
|
29
|
+
title: string;
|
|
30
|
+
idInfo: string;
|
|
31
|
+
copied: string;
|
|
32
|
+
};
|
|
33
|
+
paymentMethod: {
|
|
34
|
+
expired: string;
|
|
35
|
+
ordinary: string;
|
|
36
|
+
current: string;
|
|
37
|
+
checkGreen: string;
|
|
38
|
+
authenticated: string;
|
|
39
|
+
yjTitle: string;
|
|
40
|
+
ppCardTitle: string;
|
|
41
|
+
brand: string;
|
|
42
|
+
};
|
|
43
|
+
paymentMethodStatus: {
|
|
44
|
+
ACTIVATED: string;
|
|
45
|
+
OFF: string;
|
|
46
|
+
APPLYING: string;
|
|
47
|
+
MAINTENANCE: string;
|
|
48
|
+
BUSY: string;
|
|
49
|
+
SUSPENDED: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export default _default;
|