@paypay/mini-app-js-sdk 2.25.0 → 2.30.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.
@@ -6,7 +6,7 @@ export declare function getIconUrl(theme?: string): string;
6
6
  export declare function convertToString(str?: string): string;
7
7
  export declare function removeCookie(key: string, domain: string): void;
8
8
  export declare function saveRefreshToken(refreshToken: string, domain: string, isSecure: boolean): string | undefined;
9
- export declare function saveCodeVerifier(codeVerifier: string, domain: string, isSecure: boolean): string | undefined;
9
+ export declare function saveCodeVerifier(codeVerifier: string, domain: string, isSecure: boolean, expires: number | Date | undefined): string | undefined;
10
10
  export declare function getRefreshToken(): string;
11
11
  export declare function getCodeVerifier(): string;
12
12
  export declare function exposeClientJsBridge(jsBridge: ClientJsBridge): boolean;
@@ -1,11 +1,11 @@
1
1
  import { NativeParams } from '../jsbridge-core/jsbridge';
2
2
  import { MiniAppModule } from '../mini-app-api';
3
- import { CopyToClipBoardParams, GetDataParams, RemoveDataParams, RenderCouponsParams, RenderSmartButtonParams, ScanCodeClientParams, SetDataParams, SetTitleParams, ShareParams } from '../types';
4
3
  import { MiniAppStatusType } from '../model/miniAppStatus';
5
- import { VerifyMultiFactorAuthStatus } from '../types/verifyMultiFactorAuthResult';
6
- import { InitClientParams } from '../types/init';
4
+ import { CopyToClipBoardParams, GetDataParams, RemoveDataParams, RenderCouponsParams, RenderSmartButtonParams, ScanCodeClientParams, SetDataParams, SetTitleParams, ShareParams } from '../types';
7
5
  import { GetKycPassportInfoResult } from '../types/getKycPassportInfo';
8
6
  import type { GetLoginUrlParams } from '../types/getLoginUrl';
7
+ import { InitClientParams } from '../types/init';
8
+ import { VerifyMultiFactorAuthStatus } from '../types/verifyMultiFactorAuthResult';
9
9
  export declare function clearInternalInitSyncState(): void;
10
10
  declare function init(params: InitClientParams): void;
11
11
  declare function verifyMultiFactorAuthResult(params: NativeParams<VerifyMultiFactorAuthStatus>): void;
@@ -44,6 +44,7 @@ declare const clientFunctions: {
44
44
  }, import('../types').MiniAppErrorResultType>) => void;
45
45
  getPaymentSettings: (params: NativeParams<import("../core/coreFunctions/getPaymentSettings").PaymentSettingsType, import('../types').MiniAppErrorResultType>) => void;
46
46
  getLoginUrl: (params: GetLoginUrlParams) => void;
47
+ markAsReady: (params: NativeParams<void, import('../types').MiniAppErrorResultType>) => void;
47
48
  };
48
49
  declare type ClientSDKType = Omit<MiniAppModule, keyof typeof clientFunctions> & typeof clientFunctions;
49
50
  declare const client: ClientSDKType;
@@ -4,3 +4,4 @@ export { logEvent } from './logEvent';
4
4
  export { logout } from './logout';
5
5
  export { getPaymentSettings } from './getPaymentSettings';
6
6
  export { getLoginUrl } from './getLoginUrl';
7
+ export { markAsReady } from './markAsReady';
@@ -0,0 +1 @@
1
+ export declare function markAsReady(): void;
@@ -1,4 +1,6 @@
1
1
  import { MiniAppErrorType } from '../model/miniAppError';
2
+ import * as Sentry from '@sentry/browser';
2
3
  export declare function initSentry(): void;
3
4
  export declare function sendWindowBridgeErrorToSentry(functionName: string, message: string, error: MiniAppErrorType): void;
5
+ export declare function addBreadcrumbToSentry(breadcrumb: Sentry.Breadcrumb): void;
4
6
  export declare function setClientIdForSentry(clientId: string): void;
@@ -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,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,s)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s,a=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&i(e,n,t[n]);if(s)for(var n of s(t))r.call(t,n)&&i(e,n,t[n]);return e},c=(e,s)=>t(e,n(s)),l=(e,t,n)=>new Promise(((s,o)=>{var r=e=>{try{a(n.next(e))}catch(t){o(t)}},i=e=>{try{a(n.throw(e))}catch(t){o(t)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var u=function e(t,n){function s(e,s,o){if("undefined"!=typeof document){"number"==typeof(o=d({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var i in o)o[i]&&(r+="; "+i,!0!==o[i]&&(r+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(s,e)+r}}return Object.create({set:s,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],s={},o=0;o<n.length;o++){var r=n[o].split("="),i=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(s[a]=t.read(i,a),e===a)break}catch(c){}}return e?s[e]:s}},remove:function(e,t){s(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 g={success:"success",fail:"fail",complete:"complete"},h={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"},m="reload",_="link",f="saveRefreshToken",v="saveCodeVerifier",E="makeVisible",y="consoleDebugInfo",S="clientPopState",b="_PayPayJsBridge",I=["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 T(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const A=T("icon-paypay-rec.svg"),k=T("icon-paypay-rec-white.svg");var N=(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))(N||{});const w=["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 C(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 s=t.slice(t.length-2).join(".");return w.includes(s)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}N.notAuthorized,N.badRequest,N.badRequestInsufficientParameter,N.insufficientScope,N.insufficientScope;const P="2.25.0",O=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),D=O.origin,R=new URL(`./iframe.html?v=${P}&rev=e26ec27`,O).href,x=new URL(`./coupon/iframe.html?v=${P}`,O).href,U=Object.prototype.toString;function L(e){return function(e,t){return U.call(e)===`[object ${t}]`}(e,"Object")}function M(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function F(e){return e&&e.Math==Math?e:void 0}const B="object"==typeof globalThis&&F(globalThis)||"object"==typeof window&&F(window)||"object"==typeof self&&F(self)||"object"==typeof global&&F(global)||function(){return this}()||{};function j(e,t,n){const s=n||B,o=s.__SENTRY__=s.__SENTRY__||{};return o[e]||(o[e]=t())}const V=["debug","info","warn","error","log","assert","trace"],q={};function $(e){if(!("console"in B))return e();const t=B.console,n={},s=Object.keys(q);s.forEach((e=>{const s=q[e];n[e]=t[e],t[e]=s}));try{return e()}finally{s.forEach((e=>{t[e]=n[e]}))}}const Y=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?V.forEach((n=>{t[n]=(...t)=>{e&&$((()=>{B.console[n](`Sentry Logger [${n}]:`,...t)}))}})):V.forEach((e=>{t[e]=()=>{}})),t}();function W(e){return H(e,new Map)}function H(e,t){if(L(e)){const n=t.get(e);if(void 0!==n)return n;const s={};t.set(e,s);for(const o of Object.keys(e))void 0!==e[o]&&(s[o]=H(e[o],t));return s}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const s=[];return t.set(e,s),e.forEach((e=>{s.push(H(e,t))})),s}return e}function K(){const e=B,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch(s){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}var z;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(z||(z={}));class G{constructor(e){G.prototype.__init.call(this),G.prototype.__init2.call(this),G.prototype.__init3.call(this),G.prototype.__init4.call(this),this._state=z.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new G(((n,s)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(o){s(o)}else n(t)},e=>{if(t)try{n(t(e))}catch(o){s(o)}else s(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new G(((t,n)=>{let s,o;return this.then((t=>{o=!1,s=t,e&&e()}),(t=>{o=!0,s=t,e&&e()})).then((()=>{o?n(s):t(s)}))}))}__init(){this._resolve=e=>{this._setResult(z.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(z.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===z.PENDING&&(M(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===z.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===z.RESOLVED&&e[1](this._value),this._state===z.REJECTED&&e[2](this._value),e[0]=!0)}))}}}const J=B,Q={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}(),Z=void 0===X?Q:{nowSeconds:()=>(X.timeOrigin+X.now())/1e3},ee=Q.nowSeconds.bind(Q),te=Z.nowSeconds.bind(Z);(()=>{const{performance:e}=J;if(!e||!e.now)return;const t=36e5,n=e.now(),s=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-s):t,r=o<t,i=e.timing&&e.timing.navigationStart,a="number"==typeof i?Math.abs(i+n-s):t;(r||a<t)&&(o<=a&&e.timeOrigin)})();const ne="production";function se(e,t,n,s=0){return new G(((o,r)=>{const i=e[s];if(null===t||"function"!=typeof i)o(t);else{const c=i(a({},t),n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.id&&null===c&&Y.log(`Event processor "${i.id}" dropped event`),M(c)?c.then((t=>se(e,t,n,s+1).then(o))).then(null,r):se(e,c,n,s+1).then(o).then(null,r)}}))}function oe(e){const t=te(),n={sid:K(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return W({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&re(n,e),n}function re(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||te(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:K()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class ie{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ae()}static clone(e){const t=new ie;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=a({},e._tags),t._extra=a({},e._extra),t._contexts=a({},e._contexts),t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata=a({},e._sdkProcessingMetadata),t._propagationContext=a({},e._propagationContext)),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&re(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=a(a({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(a({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=a(a({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(a({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof ie?t:this}return e instanceof ie?(this._tags=a(a({},this._tags),e._tags),this._extra=a(a({},this._extra),e._extra),this._contexts=a(a({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):L(e)&&(this._tags=a(a({},this._tags),e.tags),this._extra=a(a({},this._extra),e.extra),this._contexts=a(a({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=ae(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const s=a({timestamp:ee()},e),o=this._breadcrumbs;return o.push(s),this._breadcrumbs=o.length>n?o.slice(-n):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra=a(a({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=a(a({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=a(a({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=a(a({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=a({trace:this._span.getTraceContext()},e.contexts);const t=this._span.transaction;if(t){e.sdkProcessingMetadata=a({dynamicSamplingContext:t.getDynamicSamplingContext()},e.sdkProcessingMetadata);const n=t.name;n&&(e.tags=a({transaction:n},e.tags))}}this._applyFingerprint(e);const s=this._getBreadcrumbs(),o=[...e.breadcrumbs||[],...s];return e.breadcrumbs=o.length>0?o:void 0,e.sdkProcessingMetadata=c(a(a({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),se([...n||[],...j("globalEventProcessors",(()=>[])),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=a(a({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){var t;e.fingerprint=e.fingerprint?(t=e.fingerprint,Array.isArray(t)?t:[t]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function ae(){return{traceId:K(),spanId:K().substring(16)}}const ce=4,le=100;class de{constructor(e,t=new ie,n=ce){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=ie.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:K(),s=new Error("Sentry syntheticException");return this._withClient(((o,r)=>{o.captureException(e,c(a({originalException:e,syntheticException:s},t),{event_id:n}),r)})),n}captureMessage(e,t,n){const s=this._lastEventId=n&&n.event_id?n.event_id:K(),o=new Error(e);return this._withClient(((r,i)=>{r.captureMessage(e,t,c(a({originalException:e,syntheticException:o},n),{event_id:s}),i)})),s}captureEvent(e,t){const n=t&&t.event_id?t.event_id:K();return e.type||(this._lastEventId=n),this._withClient(((s,o)=>{s.captureEvent(e,c(a({},t),{event_id:n}),o)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:r=le}=s.getOptions&&s.getOptions()||{};if(r<=0)return;const i=ee(),c=a({timestamp:i},e),l=o?$((()=>o(c,t))):c;null!==l&&(s.emit&&s.emit("beforeAddBreadcrumb",l,t),n.addBreadcrumb(l,r))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=pe(this);try{e(this)}finally{pe(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Y.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&!n){this.getClient()?console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):console.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),re(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:s,environment:o=ne}=n&&n.getOptions()||{},{userAgent:r}=B.navigator||{},i=oe(a(a({release:s,environment:o,user:t.getUser()},r&&{userAgent:r}),e)),c=t.getSession&&t.getSession();return c&&"ok"===c.status&&re(c,{status:"exited"}),this.endSession(),t.setSession(i),i}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=ue().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Y.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function ue(){return B.__SENTRY__=B.__SENTRY__||{extensions:{},hub:void 0},B}function pe(e){const t=ue(),n=he(t);return me(t,e),n}function ge(){const e=ue();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=ue()){t=e,t&&t.__SENTRY__&&t.__SENTRY__.hub&&!he(e).isOlderThan(ce)||me(e,new de);var t;return he(e)}(e)}function he(e){return j("hub",(()=>new de),e)}function me(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}const _e=[N.sdkNotInitialized,N.notAuthorized,N.userCanceled,N.userCanceledSimilarTxn,N.suspectedDuplicatePayment,N.noSufficientFund];function fe(e,t,n){_e.includes(n)||function(e,t){const n="string"==typeof t?t:void 0,s="string"!=typeof t?{captureContext:t}:void 0;ge().captureMessage(e,n,s)}(`windowBridge.${e} failed. client: unknown, error: ${n}, message: ${t}`,"log")}let ve="";function Ee(){return Math.random().toString(36).substring(7)}function ye(e){var t;const n=null!=(t=null==e?void 0:e.clientId)?t:ve,s=(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"}_${n}${s}`}function Se(e){return e===D}function be(e){return e?String(e):""}function Ie(e,t){u.remove(e),u.remove(e,{domain:t})}!function(){try{return localStorage.getItem("ppjssdk.canWriteToLocalStorage"),!0}catch(e){return console.log(e),!1}}();let Te=[];function Ae(e){Te=Te.filter((t=>t!==e))}function ke(){const e=Ee();return Te.push(e),e}function Ne(e,t,n,s){return function(o={}){const r=n(),i=null==s?void 0:s(o);r.logEvent(a({event_action:`pp_${e}_called`,event_category:ye({featureName:e})},i)),t(o).then((t=>{var n;r.logEvent(a({event_action:`pp_${e}_success`,event_category:ye({featureName:e})},i)),null==(n=o.success)||n.call(o,t)})).catch((t=>{var n;console.error(t.message),r.logEvent(a({event_action:`pp_${e}_fail`,event_category:ye({featureName:e}),error_value:t.errorCode},i)),null==(n=o.fail)||n.call(o,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=o.complete)||e.call(o)}))}}class we extends Error{constructor(e,t){super(e),this.errorCode=t}}class Ce{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`,N.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`,N.functionNotFound);try{this.sendSuccessResponse(e,yield n(...e.data.params))}catch(s){let t="Some error ocurred while processing the request",n=N.unknown;s instanceof we&&(t=s.message,n=s.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 we(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){fe(e.data.functionName,t,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(a({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 Ce.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get(n,s){return(...o)=>new Promise(((r,i)=>l(this,null,(function*(){const a=s.toString(),c=`${a}--${Ee()}`;try{const s=yield e();if(!s)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[r,i],s.postMessage({forWindowBridge:!0,type:"request",functionName:a,key:c,params:JSON.parse(JSON.stringify(o))},t)}catch(l){delete n.deferredCallbacks[c],i(new we(l.message,N.messageSendingFailed))}}))))}})}}var Pe=(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))(Pe||{});const Oe="ppmna-iframe",De="ppsdk-container";let Re,xe;function Ue(){return Re||(Re=function(){if(document.getElementById(Oe))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",De),e.setAttribute("class",De),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}()),Re}function Le(e){const t=Ue();t&&(t.style.display=e?"initial":"none")}function Me(){return xe||(xe=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",R),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 s=Ue();s&&(s.innerHTML="",s.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),xe}let Fe,Be=!1;Ce.init({}),Me(),Fe=Promise.resolve(!1);const je=Ce.getTargetWindowFunctionProxy((function(){return Me().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),D);function Ve(){return je}function qe(e){const t=new URL(window.location.href),n=t.searchParams.get("token"),s=t.searchParams.get("one_time_token"),o=u.get(p.refreshToken)||"",r=u.get(p.codeVerifier)||"";Be=!!e.useAllFunctions,(n||s)&&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:s,refreshToken:o,clientVersion:"2.25.0",codeVerifier:r};let l;const d=new Promise((e=>l=e)),g=()=>{var t;l(!0),null==(t=e.complete)||t.call(e)};Fe.then((()=>Me())).then((()=>{Ge(h.init,!1,c(a({},e),{complete:g}),i)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:N.sdkNotInitialized}),g()})),Fe=d}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&Se(e.origin))if(e.data.name===m&&window.location.reload(),e.data.name!==E){if(e.data.name===_){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===f){const{refreshToken:t,domain:n,isSecure:s}=e.data.data;!function(e,t,n){Ie(p.refreshToken,t),u.set(p.refreshToken,e,{domain:t,expires:90,secure:n})}(t,n,s)}if(e.data.name===v){const{codeVerifier:t,domain:n,isSecure:s}=e.data.data;!function(e,t,n){Ie(p.codeVerifier,t),u.set(p.codeVerifier,e,{domain:t,secure:n})}(t,n,s)}if(e.data.name===y){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else Le(!0)})),addEventListener("popstate",(()=>{Me().then((e=>{var t;const n={name:S};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,D)})).catch((e=>console.warn(e)))}));const $e=Ne("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:s,postLoginRedirectUrl:o=window.location.href,postLoginRedirectType:r,locale:i}=e,a=document.getElementById(s);if(!a)throw new we("Invalid coupon container Id",N.badRequestInsufficientParameter);const c=yield je.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:o,postLoginRedirectType:r});try{const e=document.createElement("iframe");e.src=x,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),a.innerHTML="",a.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=Ce.getTargetWindowFunctionProxy((()=>e.contentWindow),D);yield n.renderCoupons({coupons:c,merchantId:t,locale:i,postLoginRedirectUrl:o,postLoginRedirectType:r})}catch(l){throw new we(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,N.unknown)}}))),Ve,(e=>({event_label2:e.couponId,merchant_id:e.merchant})));const Ye=Ne("logout",(()=>l(this,null,(function*(){try{const e=C(yield je.logout(),window.location.hostname);return Ie(p.refreshToken,e),Ie(p.codeVerifier,e),{statusCode:Pe.loggedOut}}catch(e){throw new we(`An error ocurred while trying to logout the user, error=${e}`,N.unknown)}}))),Ve),We=Ne("getPaymentSettings",je.getPaymentSettings,Ve),He=Ne("getLoginUrl",(e=>je.getLoginUrl({redirectUrl:e.redirectUrl||location.href,redirectType:e.redirectType})),Ve);function Ke(e,t,n){var s,o,r;e.result===g.fail&&(null==(s=null==t?void 0:t.fail)||s.call(t,e.data)),e.result===g.success&&(null==(o=null==t?void 0:t.success)||o.call(t,null==e?void 0:e.data)),e.result===g.complete&&(null==(r=null==t?void 0:t.complete)||r.call(t),removeEventListener("message",n),Ae(e.messageId),Te.length>0||Le(!1))}function ze(e){return l(this,null,(function*(){var t;const n=yield Me().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),D)}))}function Ge(e,t,n,s){const o=ke();t&&Le(!0);const r=t=>{Se(t.origin)&&t.data.name===e&&t.data.messageId===o&&Ke(t.data,n,r)};addEventListener("message",r),ze({name:e,params:s,messageId:o})}!function(e){const t=window;(!t.hasOwnProperty(b)||t[b]!==e)&&(t[b]=e)}({_handleMessageFromNative:e=>{Me().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:h.handleMessageFromNative,params:{json:e}})),D)}))}});const Je=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],Qe=["renderCoupons"],Xe=new Proxy({init:qe,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);Ge(h.verifyMultiFactorAuthResult,!1,e,c(a({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void Ge(h.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:N.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:N.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=ke(),s=t=>{var o,r;if(!Se(t.origin)||t.data.name!==h.render||t.data.messageId!==n)return;const i=null==(o=t.data)?void 0:o.data,c=null==(r=t.data)?void 0:r.data;t.data.result===g.success&&(!function(e,t){var n,s,o,r,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?k:A}(null==t?void 0:t.theme),g=(null==(s=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:s.length)?"pp-cashback":"",m=t.isShortText?"pp-shortText":"",_=null!=(o=null==t?void 0:t.buttonSize)?o:"lg",f=null!=(r=null==t?void 0:t.theme)?r:"light",v=document.createElement("a");v.className=`pp-smartBtn pp-${f} pp-${_} pp-${be(t.type)} pp-${e.preferredLanguage} ${g} ${m}`,v.href=be(e.data.loginUrl);const E=document.createElement("span");E.className="pp-leftSection";const y=document.createElement("img");y.className="pp-img",y.src=p,y.alt="",E.appendChild(y);const S=document.createElement("span");S.className="pp-btnContent";const b=document.createElement("span");b.className="pp-title",b.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,S.appendChild(b),E.appendChild(S),v.append(E);const I=document.createElement("span");(null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo)&&(I.className="pp-cashbackInfo",I.innerText=null==(l=null==e?void 0:e.data)?void 0:l.cashbackInfo,S.append(I));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)})),v.append(t)}u.append(v),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&&Ge(h.makePayment,!0,t,a({},t.orderInfo))})))}(c,e),"pay"===i.type&&(null==c?void 0:c.isJustLoggedIn)&&e.autoInvoke&&(null==c?void 0:c.isLoggedIn)&&Ge(h.makePayment,!0,e,a({},e.orderInfo))),t.data.result===g.complete&&(Ae(t.data.messageId),removeEventListener("message",s))};addEventListener("message",s),ze({name:h.render,params:c(a({},e),{redirectUrl:e.redirectUrl||window.location.href}),messageId:n})},renderCoupons:$e,scanCode:function(e){var t;const n=c(a({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});Ge(h.scanCode,!1,e,n)},copyToClipboard:function(e){var t,n,s;const o=document.createElement("textarea");o.setAttribute("readonly","true"),o.setAttribute("contenteditable","true"),o.value=e.value,document.body.appendChild(o),o.select(),o.setSelectionRange(0,o.value.length);const r=document.execCommand("copy");document.body.removeChild(o),r?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:N.other}),null==(s=e.complete)||s.call(e)},getSessionData:function(e){var t,n;const s=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!=s?s:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,s;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==(s=null==e?void 0:e.complete)||s.call(e)},getStorageData:function(e){var t,n;const s=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!=s?s:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,s;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==(s=null==e?void 0:e.complete)||s.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;Ge(h.getKycPassportInfo,!1,e,c(a({},e),{url:t}))},logout:Ye,getPaymentSettings:We,getLoginUrl:He},{get(e,t){const n=t;if(!Be&&!function(e){return I.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return s=>l(this,null,(function*(){var o,r;if(!Je.includes(n)&&!(yield Fe)){if(!Qe.includes(n)||!s.clientId)return null==(o=s.fail)||o.call(s,{errorCode:N.sdkNotInitialized}),void(null==(r=s.complete)||r.call(s));qe({clientId:s.clientId,env:s.env}),yield Fe}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](s);Ge(t,!1,s,s)}))}});!function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)Xe[t](n)}}(),Xe.revision="e26ec27";const Ze=Xe;window._pp=Ze;return Ze}();
2
+ var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,i=(t,n,s)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s,a=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&i(e,n,t[n]);if(s)for(var n of s(t))r.call(t,n)&&i(e,n,t[n]);return e},c=(e,s)=>t(e,n(s)),l=(e,t,n)=>new Promise(((s,o)=>{var r=e=>{try{a(n.next(e))}catch(t){o(t)}},i=e=>{try{a(n.throw(e))}catch(t){o(t)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}var u=function e(t,n){function s(e,s,o){if("undefined"!=typeof document){"number"==typeof(o=d({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var i in o)o[i]&&(r+="; "+i,!0!==o[i]&&(r+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(s,e)+r}}return Object.create({set:s,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],s={},o=0;o<n.length;o++){var r=n[o].split("="),i=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(s[a]=t.read(i,a),e===a)break}catch(c){}}return e?s[e]:s}},remove:function(e,t){s(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 g={success:"success",fail:"fail",complete:"complete"},h={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"},m="reload",_="link",f="saveRefreshToken",v="saveCodeVerifier",E="makeVisible",y="consoleDebugInfo",S="clientPopState",b="_PayPayJsBridge",I=["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 T(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const A=T("icon-paypay-rec.svg"),w=T("icon-paypay-rec-white.svg");var k=(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.rateLimitExceeded="RATE_LIMIT_EXCEEDED",e))(k||{});const N=["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 C(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 s=t.slice(t.length-2).join(".");return N.includes(s)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}const P="2.30.0",D=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),O=D.origin,R=new URL(`./iframe.html?v=${P}&rev=2c48cd5`,D).href,L=new URL(`./coupon/iframe.html?v=${P}`,D).href,x=Object.prototype.toString;function U(e){return function(e,t){return x.call(e)===`[object ${t}]`}(e,"Object")}function M(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function F(e){return e&&e.Math==Math?e:void 0}const j="object"==typeof globalThis&&F(globalThis)||"object"==typeof window&&F(window)||"object"==typeof self&&F(self)||"object"==typeof global&&F(global)||function(){return this}()||{};function B(e,t,n){const s=n||j,o=s.__SENTRY__=s.__SENTRY__||{};return o[e]||(o[e]=t())}const V=["debug","info","warn","error","log","assert","trace"],q={};function $(e){if(!("console"in j))return e();const t=j.console,n={},s=Object.keys(q);s.forEach((e=>{const s=q[e];n[e]=t[e],t[e]=s}));try{return e()}finally{s.forEach((e=>{t[e]=n[e]}))}}const Y=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?V.forEach((n=>{t[n]=(...t)=>{e&&$((()=>{j.console[n](`Sentry Logger [${n}]:`,...t)}))}})):V.forEach((e=>{t[e]=()=>{}})),t}();function H(e){return W(e,new Map)}function W(e,t){if(U(e)){const n=t.get(e);if(void 0!==n)return n;const s={};t.set(e,s);for(const o of Object.keys(e))void 0!==e[o]&&(s[o]=W(e[o],t));return s}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const s=[];return t.set(e,s),e.forEach((e=>{s.push(W(e,t))})),s}return e}function z(){const e=j,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch(s){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}var K;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(K||(K={}));class G{constructor(e){G.prototype.__init.call(this),G.prototype.__init2.call(this),G.prototype.__init3.call(this),G.prototype.__init4.call(this),this._state=K.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new G(((n,s)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(o){s(o)}else n(t)},e=>{if(t)try{n(t(e))}catch(o){s(o)}else s(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new G(((t,n)=>{let s,o;return this.then((t=>{o=!1,s=t,e&&e()}),(t=>{o=!0,s=t,e&&e()})).then((()=>{o?n(s):t(s)}))}))}__init(){this._resolve=e=>{this._setResult(K.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(K.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===K.PENDING&&(M(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===K.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===K.RESOLVED&&e[1](this._value),this._state===K.REJECTED&&e[2](this._value),e[0]=!0)}))}}}const J=j,Q={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}(),Z=void 0===X?Q:{nowSeconds:()=>(X.timeOrigin+X.now())/1e3},ee=Q.nowSeconds.bind(Q),te=Z.nowSeconds.bind(Z);(()=>{const{performance:e}=J;if(!e||!e.now)return;const t=36e5,n=e.now(),s=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-s):t,r=o<t,i=e.timing&&e.timing.navigationStart,a="number"==typeof i?Math.abs(i+n-s):t;(r||a<t)&&(o<=a&&e.timeOrigin)})();const ne="production";function se(e,t,n,s=0){return new G(((o,r)=>{const i=e[s];if(null===t||"function"!=typeof i)o(t);else{const c=i(a({},t),n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&i.id&&null===c&&Y.log(`Event processor "${i.id}" dropped event`),M(c)?c.then((t=>se(e,t,n,s+1).then(o))).then(null,r):se(e,c,n,s+1).then(o).then(null,r)}}))}function oe(e){const t=te(),n={sid:z(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return H({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&re(n,e),n}function re(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||te(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:z()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}class ie{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ae()}static clone(e){const t=new ie;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=a({},e._tags),t._extra=a({},e._extra),t._contexts=a({},e._contexts),t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata=a({},e._sdkProcessingMetadata),t._propagationContext=a({},e._propagationContext)),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&re(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=a(a({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=c(a({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=a(a({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=c(a({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof ie?t:this}return e instanceof ie?(this._tags=a(a({},this._tags),e._tags),this._extra=a(a({},this._extra),e._extra),this._contexts=a(a({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):U(e)&&(this._tags=a(a({},this._tags),e.tags),this._extra=a(a({},this._extra),e.extra),this._contexts=a(a({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=ae(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const s=a({timestamp:ee()},e),o=this._breadcrumbs;return o.push(s),this._breadcrumbs=o.length>n?o.slice(-n):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra=a(a({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=a(a({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=a(a({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=a(a({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=a({trace:this._span.getTraceContext()},e.contexts);const t=this._span.transaction;if(t){e.sdkProcessingMetadata=a({dynamicSamplingContext:t.getDynamicSamplingContext()},e.sdkProcessingMetadata);const n=t.name;n&&(e.tags=a({transaction:n},e.tags))}}this._applyFingerprint(e);const s=this._getBreadcrumbs(),o=[...e.breadcrumbs||[],...s];return e.breadcrumbs=o.length>0?o:void 0,e.sdkProcessingMetadata=c(a(a({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),se([...n||[],...B("globalEventProcessors",(()=>[])),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=a(a({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){var t;e.fingerprint=e.fingerprint?(t=e.fingerprint,Array.isArray(t)?t:[t]):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function ae(){return{traceId:z(),spanId:z().substring(16)}}const ce=4,le=100;class de{constructor(e,t=new ie,n=ce){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=ie.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:z(),s=new Error("Sentry syntheticException");return this._withClient(((o,r)=>{o.captureException(e,c(a({originalException:e,syntheticException:s},t),{event_id:n}),r)})),n}captureMessage(e,t,n){const s=this._lastEventId=n&&n.event_id?n.event_id:z(),o=new Error(e);return this._withClient(((r,i)=>{r.captureMessage(e,t,c(a({originalException:e,syntheticException:o},n),{event_id:s}),i)})),s}captureEvent(e,t){const n=t&&t.event_id?t.event_id:z();return e.type||(this._lastEventId=n),this._withClient(((s,o)=>{s.captureEvent(e,c(a({},t),{event_id:n}),o)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:r=le}=s.getOptions&&s.getOptions()||{};if(r<=0)return;const i=ee(),c=a({timestamp:i},e),l=o?$((()=>o(c,t))):c;null!==l&&(s.emit&&s.emit("beforeAddBreadcrumb",l,t),n.addBreadcrumb(l,r))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=pe(this);try{e(this)}finally{pe(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Y.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&!n){this.getClient()?console.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):console.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),re(e,n)}(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:s,environment:o=ne}=n&&n.getOptions()||{},{userAgent:r}=j.navigator||{},i=oe(a(a({release:s,environment:o,user:t.getUser()},r&&{userAgent:r}),e)),c=t.getSession&&t.getSession();return c&&"ok"===c.status&&re(c,{status:"exited"}),this.endSession(),t.setSession(i),i}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=ue().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Y.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function ue(){return j.__SENTRY__=j.__SENTRY__||{extensions:{},hub:void 0},j}function pe(e){const t=ue(),n=he(t);return me(t,e),n}function ge(){const e=ue();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=ue()){t=e,t&&t.__SENTRY__&&t.__SENTRY__.hub&&!he(e).isOlderThan(ce)||me(e,new de);var t;return he(e)}(e)}function he(e){return B("hub",(()=>new de),e)}function me(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}const _e=[k.sdkNotInitialized,k.notAuthorized,k.userCanceled,k.userCanceledSimilarTxn,k.suspectedDuplicatePayment,k.noSufficientFund];function fe(e,t,n){_e.includes(n)||function(e,t){const n="string"==typeof t?t:void 0,s="string"!=typeof t?{captureContext:t}:void 0;ge().captureMessage(e,n,s)}(`windowBridge.${e} failed. client: unknown, error: ${n}, message: ${t}`,"log")}k.notAuthorized,k.badRequest,k.badRequestInsufficientParameter,k.insufficientScope,k.insufficientScope;let ve="";const Ee="ppjssdk.initializedAt";function ye(e){const t=function(){var e,t,n,s;let o=null;const r=navigator.userAgent.split(" PayPayMiniApp/");if(r.length>1){const i=null!=(e=r[1].split(" ")[0])?e:null;o=i?i.split("-")[0]:o,o=null!=(s=null==(n=null==(t=null==o?void 0:o.split("."))?void 0:t.slice(0,3))?void 0:n.join("."))?s:null}return o}();return!!t&&(e===t||function(e,t){const[n,s,o]=e.split(".").map((e=>Number.parseInt(e))),[r,i,a]=t.split(".").map((e=>Number.parseInt(e)));return n!==r?n>r:s!==i?s>i:o>a}(t,e))}function Se(){return Math.random().toString(36).substring(7)}function be(e){var t;const n=null!=(t=null==e?void 0:e.clientId)?t:ve,s=(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"}_${n}${s}`}function Ie(e){return e===O}function Te(e){return e?String(e):""}function Ae(e,t){u.remove(e),u.remove(e,{domain:t})}new class{constructor(){this.useLocalStorage=!0,this.memoryStorage={};try{localStorage.setItem(Ee,Date.now().toString())}catch(e){this.useLocalStorage=!1}}getItem(e){var t;if(this.useLocalStorage)try{if(null!=localStorage.getItem(Ee))return localStorage.getItem(e);console.warn("local storage value has lost unexpectedly.")}catch(n){}return this.useLocalStorage=!1,null!=(t=this.memoryStorage[e])?t:null}setItem(e,t){if(this.memoryStorage[e]=t,this.useLocalStorage)try{localStorage.setItem(e,t)}catch(n){this.useLocalStorage=!1,console.warn("localStorage has become unavailable.")}}removeItem(e){delete this.memoryStorage[e];try{localStorage.removeItem(e)}catch(t){this.useLocalStorage=!1}}clear(){try{localStorage.clear(),localStorage.setItem(Ee,Date.now().toString())}catch(e){}this.memoryStorage={}}};let we=[];function ke(e){we=we.filter((t=>t!==e))}function Ne(){const e=Se();return we.push(e),e}function Ce(e,t,n,s){return function(o={}){const r=n(),i=null==s?void 0:s(o);r.logEvent(a({event_action:`pp_${e}_called`,event_category:be({featureName:e})},i)),t(o).then((t=>{var n;r.logEvent(a({event_action:`pp_${e}_success`,event_category:be({featureName:e})},i)),null==(n=o.success)||n.call(o,t)})).catch((t=>{var n;console.error(t.message),r.logEvent(a({event_action:`pp_${e}_fail`,event_category:be({featureName:e}),error_value:t.errorCode},i)),null==(n=o.fail)||n.call(o,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=o.complete)||e.call(o)}))}}var Pe=(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))(Pe||{});class De 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`,k.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`,k.functionNotFound);try{this.sendSuccessResponse(e,yield n(...e.data.params))}catch(s){let t="Some error ocurred while processing the request",n=k.unknown;s instanceof De&&(t=s.message,n=s.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 De(e.data.message,e.data.errorCode))}sendErrorResponse(e,t,n){fe(e.data.functionName,t,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(a({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,s){return(...o)=>new Promise(((r,i)=>l(this,null,(function*(){const a=s.toString(),c=`${a}--${Se()}`;try{const s=yield e();if(!s)throw new Error("Target window is undefined");n.deferredCallbacks[c]=[r,i],s.postMessage({forWindowBridge:!0,type:"request",functionName:a,key:c,params:JSON.parse(JSON.stringify(o))},t)}catch(l){delete n.deferredCallbacks[c],i(new De(l.message,k.messageSendingFailed))}}))))}})}}const Re="4.47.0",Le="ppmna-iframe",xe="ppsdk-container";let Ue,Me;function Fe(){return Ue||(Ue=function(){if(document.getElementById(Le))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",xe),e.setAttribute("class",xe),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}()),Ue}function je(e){const t=Fe();t&&(t.style.display=e?"initial":"none")}function Be(){return Me||(Me=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",R),n.setAttribute("name",Le),n.setAttribute("id",Le),n.setAttribute("class",Le),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 s=Fe();s&&(s.innerHTML="",s.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),Me}let Ve,qe=!1;Oe.init({}),Be(),Ve=Promise.resolve(!1);const $e=Oe.getTargetWindowFunctionProxy((function(){return Be().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),O);function Ye(){return $e}function He(e){const t=new URL(window.location.href),n=t.searchParams.get("token"),s=t.searchParams.get("one_time_token"),o=u.get(p.refreshToken)||"",r=u.get(p.codeVerifier)||"";qe=!!e.useAllFunctions,(n||s)&&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:s,refreshToken:o,clientVersion:"2.30.0",codeVerifier:r};let l;const d=new Promise((e=>l=e)),g=()=>{var t;l(!0),null==(t=e.complete)||t.call(e)};Ve.then((()=>Be())).then((()=>{Xe(h.init,!1,c(a({},e),{complete:g}),i)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:k.sdkNotInitialized}),g()})),Ve=d}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&Ie(e.origin))if(e.data.name===m&&window.location.reload(),e.data.name!==E){if(e.data.name===_){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===f){const{refreshToken:t,domain:n,isSecure:s}=e.data.data;!function(e,t,n){Ae(p.refreshToken,t),u.set(p.refreshToken,e,{domain:t,expires:90,secure:n})}(t,n,s)}if(e.data.name===v){const{codeVerifier:t,domain:n,isSecure:s,expires:o}=e.data.data;!function(e,t,n,s){Ae(p.codeVerifier,t),u.set(p.codeVerifier,e,{domain:t,secure:n,expires:s})}(t,n,s,o)}if(e.data.name===y){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else je(!0)})),addEventListener("popstate",(()=>{Be().then((e=>{var t;const n={name:S};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,O)})).catch((e=>console.warn(e)))}));const We=Ce("renderCoupons",(e=>l(this,null,(function*(){const{merchant:t,couponId:n,containerId:s,postLoginRedirectUrl:o=window.location.href,postLoginRedirectType:r,locale:i}=e,a=document.getElementById(s);if(!a)throw new De("Invalid coupon container Id",k.badRequestInsufficientParameter);const c=yield $e.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:o,postLoginRedirectType:r});try{const e=document.createElement("iframe");e.src=L,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),a.innerHTML="",a.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),O);yield n.renderCoupons({coupons:c,merchantId:t,locale:i,postLoginRedirectUrl:o,postLoginRedirectType:r})}catch(l){throw new De(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${l}`,k.unknown)}}))),Ye,(e=>({event_label2:e.couponId,merchant_id:e.merchant})));const ze=Ce("logout",(()=>l(this,null,(function*(){try{const e=C(yield $e.logout(),window.location.hostname);return Ae(p.refreshToken,e),Ae(p.codeVerifier,e),{statusCode:Pe.loggedOut}}catch(e){throw new De(`An error ocurred while trying to logout the user, error=${e}`,k.unknown)}}))),Ye),Ke=Ce("getPaymentSettings",$e.getPaymentSettings,Ye),Ge=Ce("getLoginUrl",(e=>$e.getLoginUrl({redirectUrl:e.redirectUrl||location.href,redirectType:e.redirectType})),Ye);function Je(e,t,n){var s,o,r;e.result===g.fail&&(null==(s=null==t?void 0:t.fail)||s.call(t,e.data)),e.result===g.success&&(null==(o=null==t?void 0:t.success)||o.call(t,null==e?void 0:e.data)),e.result===g.complete&&(null==(r=null==t?void 0:t.complete)||r.call(t),removeEventListener("message",n),ke(e.messageId),we.length>0||je(!1))}function Qe(e){return l(this,null,(function*(){var t;const n=yield Be().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),O)}))}function Xe(e,t,n,s){const o=Ne();t&&je(!0);const r=t=>{Ie(t.origin)&&t.data.name===e&&t.data.messageId===o&&Je(t.data,n,r)};addEventListener("message",r),Qe({name:e,params:s,messageId:o})}const Ze=Ce("markAsReady",(()=>l(this,null,(function*(){ye(Re)&&(window.location.href="paypay://miniappPerformance/ready"),yield $e.markAsReady()}))),Ye);!function(e){const t=window;(!t.hasOwnProperty(b)||t[b]!==e)&&(t[b]=e)}({_handleMessageFromNative:e=>{Be().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:h.handleMessageFromNative,params:{json:e}})),O)}))}});const et=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],tt=["renderCoupons"],nt=new Proxy({init:He,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);Xe(h.verifyMultiFactorAuthResult,!1,e,c(a({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void Xe(h.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:k.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:k.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=Ne(),s=t=>{var o,r;if(!Ie(t.origin)||t.data.name!==h.render||t.data.messageId!==n)return;const i=null==(o=t.data)?void 0:o.data,c=null==(r=t.data)?void 0:r.data;t.data.result===g.success&&(!function(e,t){var n,s,o,r,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:A}(null==t?void 0:t.theme),g=(null==(s=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:s.length)?"pp-cashback":"",m=t.isShortText?"pp-shortText":"",_=null!=(o=null==t?void 0:t.buttonSize)?o:"lg",f=null!=(r=null==t?void 0:t.theme)?r:"light",v=document.createElement("a");v.className=`pp-smartBtn pp-${f} pp-${_} pp-${Te(t.type)} pp-${e.preferredLanguage} ${g} ${m}`,v.href=Te(e.data.loginUrl);const E=document.createElement("span");E.className="pp-leftSection";const y=document.createElement("img");y.className="pp-img",y.src=p,y.alt="",E.appendChild(y);const S=document.createElement("span");S.className="pp-btnContent";const b=document.createElement("span");b.className="pp-title",b.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,S.appendChild(b),E.appendChild(S),v.append(E);const I=document.createElement("span");(null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo)&&(I.className="pp-cashbackInfo",I.innerText=null==(l=null==e?void 0:e.data)?void 0:l.cashbackInfo,S.append(I));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)})),v.append(t)}u.append(v),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&&Xe(h.makePayment,!0,t,a({},t.orderInfo))})))}(c,e),"pay"===i.type&&(null==c?void 0:c.isJustLoggedIn)&&e.autoInvoke&&(null==c?void 0:c.isLoggedIn)&&Xe(h.makePayment,!0,e,a({},e.orderInfo))),t.data.result===g.complete&&(ke(t.data.messageId),removeEventListener("message",s))};addEventListener("message",s),Qe({name:h.render,params:c(a({},e),{redirectUrl:e.redirectUrl||window.location.href}),messageId:n})},renderCoupons:We,scanCode:function(e){var t;const n=c(a({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href});Xe(h.scanCode,!1,e,n)},copyToClipboard:function(e){var t,n,s;const o=document.createElement("textarea");o.setAttribute("readonly","true"),o.setAttribute("contenteditable","true"),o.value=e.value,document.body.appendChild(o),o.select(),o.setSelectionRange(0,o.value.length);const r=document.execCommand("copy");document.body.removeChild(o),r?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:k.other}),null==(s=e.complete)||s.call(e)},getSessionData:function(e){var t,n;const s=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!=s?s:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,s;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==(s=null==e?void 0:e.complete)||s.call(e)},getStorageData:function(e){var t,n;const s=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!=s?s:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,s;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==(s=null==e?void 0:e.complete)||s.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;Xe(h.getKycPassportInfo,!1,e,c(a({},e),{url:t}))},logout:ze,getPaymentSettings:Ke,getLoginUrl:Ge,markAsReady:Ze},{get(e,t){const n=t;if(!qe&&!function(e){return I.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return s=>l(this,null,(function*(){var o,r;if(!et.includes(n)&&!(yield Ve)){if(!tt.includes(n)||!s.clientId)return null==(o=s.fail)||o.call(s,{errorCode:k.sdkNotInitialized}),void(null==(r=s.complete)||r.call(s));He({clientId:s.clientId,env:s.env}),yield Ve}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](s);Xe(t,!1,s,s)}))}});!function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)nt[t](n)}}(),nt.revision="2c48cd5";const st=nt;window._pp=st;return st}();
@@ -351,6 +351,7 @@ var MiniAppErrorType = /* @__PURE__ */ ((MiniAppErrorType2) => {
351
351
  MiniAppErrorType2["transactionNotFound"] = "TRANSACTION_NOT_FOUND";
352
352
  MiniAppErrorType2["unexpectedOperation"] = "UNEXPECTED_OP";
353
353
  MiniAppErrorType2["merchantTimeout"] = "MERCHANT_TIMEOUT";
354
+ MiniAppErrorType2["rateLimitExceeded"] = "RATE_LIMIT_EXCEEDED";
354
355
  return MiniAppErrorType2;
355
356
  })(MiniAppErrorType || {});
356
357
  function isIP(hostName) {
@@ -704,15 +705,8 @@ function parseDomain(domain) {
704
705
  function getDomain(subdomainCookieSharing, hostname) {
705
706
  return subdomainCookieSharing ? parseDomain(hostname) : hostname;
706
707
  }
707
- ({
708
- UNAUTHORIZED: MiniAppErrorType.notAuthorized,
709
- BAD_REQUEST: MiniAppErrorType.badRequest,
710
- MISSING_REQUEST_PARAMS: MiniAppErrorType.badRequestInsufficientParameter,
711
- OP_OUT_OF_SCOPE: MiniAppErrorType.insufficientScope,
712
- MINI_APP_SCOPE_NOT_FOUND: MiniAppErrorType.insufficientScope
713
- });
714
- const JS_SDK_VERSION = "2.25.0";
715
- const REVISION = "e26ec27";
708
+ const JS_SDK_VERSION = "2.30.0";
709
+ const REVISION = "2c48cd5";
716
710
  const coreBaseUrl = new URL("https://mini-app-sdk-core.paypay.ne.jp/");
717
711
  const CORE_IFRAME_ORIGIN = coreBaseUrl.origin;
718
712
  const CORE_IFRAME_URL = new URL(
@@ -2037,24 +2031,107 @@ function sendWindowBridgeErrorToSentry(functionName, message, error) {
2037
2031
  );
2038
2032
  }
2039
2033
  }
2034
+ ({
2035
+ UNAUTHORIZED: MiniAppErrorType.notAuthorized,
2036
+ BAD_REQUEST: MiniAppErrorType.badRequest,
2037
+ MISSING_REQUEST_PARAMS: MiniAppErrorType.badRequestInsufficientParameter,
2038
+ OP_OUT_OF_SCOPE: MiniAppErrorType.insufficientScope,
2039
+ MINI_APP_SCOPE_NOT_FOUND: MiniAppErrorType.insufficientScope
2040
+ });
2040
2041
  let clientId = "";
2041
2042
  function getCurrentClientId() {
2042
2043
  return clientId;
2043
2044
  }
2044
- if (!isEnableLocalStorage())
2045
- ;
2046
- function isEnableLocalStorage() {
2047
- try {
2048
- localStorage.getItem("ppjssdk.canWriteToLocalStorage");
2049
- return true;
2050
- } catch (e) {
2051
- console.log(e);
2052
- return false;
2045
+ const KEY_INITIALIZED_AT = "ppjssdk.initializedAt";
2046
+ class LocalStorageProxy {
2047
+ constructor() {
2048
+ this.useLocalStorage = true;
2049
+ this.memoryStorage = {};
2050
+ try {
2051
+ localStorage.setItem(KEY_INITIALIZED_AT, Date.now().toString());
2052
+ } catch (e) {
2053
+ this.useLocalStorage = false;
2054
+ }
2055
+ }
2056
+ getItem(key) {
2057
+ var _a;
2058
+ if (this.useLocalStorage) {
2059
+ try {
2060
+ if (localStorage.getItem(KEY_INITIALIZED_AT) != null) {
2061
+ return localStorage.getItem(key);
2062
+ } else {
2063
+ console.warn("local storage value has lost unexpectedly.");
2064
+ }
2065
+ } catch (e) {
2066
+ }
2067
+ }
2068
+ this.useLocalStorage = false;
2069
+ return (_a = this.memoryStorage[key]) != null ? _a : null;
2070
+ }
2071
+ setItem(key, value) {
2072
+ this.memoryStorage[key] = value;
2073
+ if (this.useLocalStorage) {
2074
+ try {
2075
+ localStorage.setItem(key, value);
2076
+ } catch (e) {
2077
+ this.useLocalStorage = false;
2078
+ console.warn("localStorage has become unavailable.");
2079
+ }
2080
+ }
2081
+ }
2082
+ removeItem(key) {
2083
+ delete this.memoryStorage[key];
2084
+ try {
2085
+ localStorage.removeItem(key);
2086
+ } catch (e) {
2087
+ this.useLocalStorage = false;
2088
+ }
2089
+ }
2090
+ clear() {
2091
+ try {
2092
+ localStorage.clear();
2093
+ localStorage.setItem(KEY_INITIALIZED_AT, Date.now().toString());
2094
+ } catch (e) {
2095
+ }
2096
+ this.memoryStorage = {};
2053
2097
  }
2054
2098
  }
2099
+ new LocalStorageProxy();
2055
2100
  function isPayPayMiniApp() {
2056
2101
  return navigator.userAgent.includes("PayPayMiniApp/");
2057
2102
  }
2103
+ function getAppVersion() {
2104
+ var _a, _b, _c, _d;
2105
+ let appVersion = null;
2106
+ const appVersionSplit = navigator.userAgent.split(" PayPayMiniApp/");
2107
+ if (appVersionSplit.length > 1) {
2108
+ const versionData = (_a = appVersionSplit[1].split(" ")[0]) != null ? _a : null;
2109
+ appVersion = versionData ? versionData.split("-")[0] : appVersion;
2110
+ appVersion = (_d = (_c = (_b = appVersion == null ? void 0 : appVersion.split(".")) == null ? void 0 : _b.slice(0, 3)) == null ? void 0 : _c.join(".")) != null ? _d : null;
2111
+ }
2112
+ return appVersion;
2113
+ }
2114
+ function semVerCompare(a, b) {
2115
+ const [majorA, minorA, patchA] = a.split(".").map((v) => Number.parseInt(v));
2116
+ const [majorB, minorB, patchB] = b.split(".").map((v) => Number.parseInt(v));
2117
+ if (majorA !== majorB) {
2118
+ return majorA > majorB;
2119
+ }
2120
+ if (minorA !== minorB) {
2121
+ return minorA > minorB;
2122
+ }
2123
+ return patchA > patchB;
2124
+ }
2125
+ function checkVersion(minVersion) {
2126
+ const appVersion = getAppVersion();
2127
+ if (!appVersion) {
2128
+ return false;
2129
+ }
2130
+ if (minVersion === appVersion) {
2131
+ return true;
2132
+ }
2133
+ return semVerCompare(appVersion, minVersion);
2134
+ }
2058
2135
  function getRandomString() {
2059
2136
  return Math.random().toString(36).substring(7);
2060
2137
  }
@@ -2086,11 +2163,12 @@ function saveRefreshToken(refreshToken, domain, isSecure) {
2086
2163
  secure: isSecure
2087
2164
  });
2088
2165
  }
2089
- function saveCodeVerifier(codeVerifier, domain, isSecure) {
2166
+ function saveCodeVerifier(codeVerifier, domain, isSecure, expires) {
2090
2167
  removeCookie(PpLocalStorageKey.codeVerifier, domain);
2091
2168
  return api.set(PpLocalStorageKey.codeVerifier, codeVerifier, {
2092
2169
  domain,
2093
- secure: isSecure
2170
+ secure: isSecure,
2171
+ expires
2094
2172
  });
2095
2173
  }
2096
2174
  function getRefreshToken() {
@@ -2161,6 +2239,16 @@ function promiseToCallback(functionName, target, getCore2, getLoggingParams) {
2161
2239
  });
2162
2240
  };
2163
2241
  }
2242
+ var MiniAppStatusType = /* @__PURE__ */ ((MiniAppStatusType2) => {
2243
+ MiniAppStatusType2["validToken"] = "TOKEN_VALID";
2244
+ MiniAppStatusType2["initialized"] = "INITIALIZED";
2245
+ MiniAppStatusType2["emailRegistered"] = "EMAIL_REGISTERED";
2246
+ MiniAppStatusType2["emailNotVerified"] = "EMAIL_NOT_VERIFIED";
2247
+ MiniAppStatusType2["success"] = "SUCCESS";
2248
+ MiniAppStatusType2["loggedOut"] = "LOGGED_OUT";
2249
+ MiniAppStatusType2["connected"] = "CONNECTED";
2250
+ return MiniAppStatusType2;
2251
+ })(MiniAppStatusType || {});
2164
2252
  class PPError extends Error {
2165
2253
  constructor(message, errorCode) {
2166
2254
  super(message);
@@ -2386,16 +2474,15 @@ class WindowBridge {
2386
2474
  }
2387
2475
  }
2388
2476
  const style = "";
2389
- var MiniAppStatusType = /* @__PURE__ */ ((MiniAppStatusType2) => {
2390
- MiniAppStatusType2["validToken"] = "TOKEN_VALID";
2391
- MiniAppStatusType2["initialized"] = "INITIALIZED";
2392
- MiniAppStatusType2["emailRegistered"] = "EMAIL_REGISTERED";
2393
- MiniAppStatusType2["emailNotVerified"] = "EMAIL_NOT_VERIFIED";
2394
- MiniAppStatusType2["success"] = "SUCCESS";
2395
- MiniAppStatusType2["loggedOut"] = "LOGGED_OUT";
2396
- MiniAppStatusType2["connected"] = "CONNECTED";
2397
- return MiniAppStatusType2;
2398
- })(MiniAppStatusType || {});
2477
+ const MinVersion = {
2478
+ PRE_TRANSACTION_AUTO_CHARGE: "3.43.0",
2479
+ FALLBACK_PAYMENT_METHOD: "3.61.0",
2480
+ OS_HOME_SCREEN_ICON: "3.71.0",
2481
+ START_MULTIFACTOR_AUTH_ANDROID_FIX: "3.67.0",
2482
+ KYC_PASSPORT: "3.72.0",
2483
+ LOG_APP_FLYER_EVENT: "3.78.0",
2484
+ PERFORMANCE_MEASUREMENT: "4.47.0"
2485
+ };
2399
2486
  const IFRAME_NAME = "ppmna-iframe";
2400
2487
  const IFRAME_CONTAINER_NAME = "ppsdk-container";
2401
2488
  let iframeContainer;
@@ -2516,8 +2603,8 @@ const commonMessageHandler = (e) => {
2516
2603
  saveRefreshToken(refreshToken, domain, isSecure);
2517
2604
  }
2518
2605
  if (e.data.name === PPUtilFunctionName.saveCodeVerifier) {
2519
- const { codeVerifier, domain, isSecure } = e.data.data;
2520
- saveCodeVerifier(codeVerifier, domain, isSecure);
2606
+ const { codeVerifier, domain, isSecure, expires } = e.data.data;
2607
+ saveCodeVerifier(codeVerifier, domain, isSecure, expires);
2521
2608
  }
2522
2609
  if (e.data.name === PPUtilFunctionName.consoleDebugInfo) {
2523
2610
  const { params } = e.data.data;
@@ -2540,7 +2627,7 @@ function init(params) {
2540
2627
  const ott = url2.searchParams.get("one_time_token");
2541
2628
  const refreshToken = getRefreshToken();
2542
2629
  const codeVerifier = getCodeVerifier();
2543
- const clientVersion = "2.25.0";
2630
+ const clientVersion = "2.30.0";
2544
2631
  useAllFunctions = !!params.useAllFunctions;
2545
2632
  if (token || ott) {
2546
2633
  removeTokenFromUrl(url2);
@@ -2936,6 +3023,16 @@ function renderButton(data, params) {
2936
3023
  }
2937
3024
  }
2938
3025
  }
3026
+ const markAsReady = promiseToCallback(
3027
+ "markAsReady",
3028
+ () => __async(void 0, null, function* () {
3029
+ if (checkVersion(MinVersion.PERFORMANCE_MEASUREMENT)) {
3030
+ window.location.href = "paypay://miniappPerformance/ready";
3031
+ }
3032
+ yield core.markAsReady();
3033
+ }),
3034
+ getCore
3035
+ );
2939
3036
  const clientJsBridge = {
2940
3037
  _handleMessageFromNative: (json) => {
2941
3038
  void getCoreIframe().then((iframe) => {
@@ -2973,7 +3070,8 @@ const clientFunctions = {
2973
3070
  getKycPassportInfo,
2974
3071
  logout,
2975
3072
  getPaymentSettings,
2976
- getLoginUrl
3073
+ getLoginUrl,
3074
+ markAsReady
2977
3075
  };
2978
3076
  const initExemptedFunctions = [
2979
3077
  "init",
@@ -3030,7 +3128,7 @@ function executePendingFunctionCalls() {
3030
3128
  }
3031
3129
  }
3032
3130
  executePendingFunctionCalls();
3033
- proxy.revision = "e26ec27";
3131
+ proxy.revision = "2c48cd5";
3034
3132
  const client = proxy;
3035
3133
  window._pp = client;
3036
3134
  const miniAppSdk = client;
@@ -1,2 +1,2 @@
1
1
  import { GetTransactionInfoParams } from '../../types/getTransactionInfo';
2
- export declare function getTransactionInfo(params: GetTransactionInfoParams): Promise<void | undefined>;
2
+ export declare function getTransactionInfo(params: GetTransactionInfoParams): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import { GetTransactionsParams } from '../../types/getTransactions';
2
- export declare function getTransactions(params: GetTransactionsParams): Promise<void | undefined>;
2
+ export declare function getTransactions(params: GetTransactionsParams): Promise<void>;
@@ -65,7 +65,8 @@ export declare enum MiniAppErrorType {
65
65
  messageSendingFailed = "MESSAGE_SENDING_FAILED",
66
66
  transactionNotFound = "TRANSACTION_NOT_FOUND",
67
67
  unexpectedOperation = "UNEXPECTED_OP",
68
- merchantTimeout = "MERCHANT_TIMEOUT"
68
+ merchantTimeout = "MERCHANT_TIMEOUT",
69
+ rateLimitExceeded = "RATE_LIMIT_EXCEEDED"
69
70
  }
70
71
  export declare class MiniAppError extends Error {
71
72
  constructor(type: MiniAppErrorType);
@@ -67,8 +67,8 @@ declare const _default: import("vue").DefineComponent<{
67
67
  }>> & {
68
68
  "onCreate-lottie"?: ((_p: AnimationItem) => any) | undefined;
69
69
  }, {
70
- type: TRenderType;
71
70
  path: string;
71
+ type: TRenderType;
72
72
  loop: boolean;
73
73
  autoplay: boolean;
74
74
  styles: Record<string, any>;
package/dist/types.d.ts CHANGED
@@ -481,6 +481,7 @@ export declare type SaveCodeVerifierOption = {
481
481
  codeVerifier: string;
482
482
  domain: string;
483
483
  isSecure: boolean;
484
+ expires?: number | Date | undefined;
484
485
  };
485
486
  export declare type ClientJsBridge = {
486
487
  _handleMessageFromNative: (json: NativeResponse) => void;
@@ -20,7 +20,7 @@ export declare function getEventCategory(params?: {
20
20
  featureName?: string;
21
21
  }): string;
22
22
  export declare function logSDKEvent(eventName: string, eventParams: Omit<EventParams, 'env'>, { env, sendImmediately }?: Options): void;
23
- export declare function handleLogSDKEvent(name: PPFunctionNameType, eventActionSuffix: string, errorValue?: string, params?: unknown): void;
23
+ export declare function handleLogSDKEvent(name: PPFunctionNameType, eventActionSuffix: string, errorValue?: string, params?: unknown, eventParams?: Partial<EventParams>): void;
24
24
  export declare function test_initClientState(params: {
25
25
  clientId: string;
26
26
  clientOrigin: string;
@@ -95,7 +95,7 @@ export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentP
95
95
  statusCode: number;
96
96
  body?: null | undefined;
97
97
  } | {
98
- ppFetchResult: "apiError";
98
+ ppFetchResult: "apiError" | "rateLimitExceeded";
99
99
  errorCode: MiniAppErrorType;
100
100
  statusCode: number;
101
101
  body: ({
@@ -106,6 +106,7 @@ export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentP
106
106
  resultInfo: {
107
107
  code: string;
108
108
  codeId?: string | undefined;
109
+ message?: string | undefined;
109
110
  };
110
111
  data?: {
111
112
  header?: {
@@ -122,6 +123,8 @@ export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentP
122
123
  unsigned?: undefined;
123
124
  resultInfo: {
124
125
  code: string;
126
+ codeId?: string | undefined;
127
+ message?: string | undefined;
125
128
  };
126
129
  uiComponents?: {
127
130
  displayErrorResponse: UIComponentsError;
@@ -26,6 +26,7 @@ declare type APIBaseResponse = {
26
26
  resultInfo: {
27
27
  code: string;
28
28
  codeId?: string;
29
+ message?: string;
29
30
  };
30
31
  data?: {
31
32
  header?: {
@@ -42,6 +43,8 @@ declare type APIBaseResponse = {
42
43
  unsigned?: undefined;
43
44
  resultInfo: {
44
45
  code: string;
46
+ codeId?: string;
47
+ message?: string;
45
48
  };
46
49
  uiComponents?: {
47
50
  displayErrorResponse: UIComponentsError;
@@ -52,7 +55,7 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
52
55
  statusCode: number;
53
56
  body: T;
54
57
  } | {
55
- ppFetchResult: 'apiError';
58
+ ppFetchResult: 'apiError' | 'rateLimitExceeded';
56
59
  errorCode: MiniAppErrorType;
57
60
  statusCode: number;
58
61
  body: APIBaseResponse & E;
@@ -55,7 +55,7 @@ export declare function updateLocalisedString(data: string, target: string, valu
55
55
  export declare function handleHeightResize(el: HTMLElement, windowHeight: number, isScrollable: boolean, offsetHeight: number): boolean;
56
56
  export declare function getPaymentMethodStatus(isExpired: boolean, paymentMethodInfo?: BankInfo | CreditCardInfo | SbidBankInfo | PayLaterCCInfo): string;
57
57
  export declare function filterErrorButtonList(buttonList: UIComponentsErrorButton[] | null): UIComponentsErrorButton[] | undefined;
58
- export declare function getFailErrorCode(ppFetchResult: string): MiniAppErrorType.timeOut | MiniAppErrorType.serverError | MiniAppErrorType.tokenExpired | MiniAppErrorType.notAuthorized;
58
+ export declare function getFailErrorCode(ppFetchResult: string): MiniAppErrorType.timeOut | MiniAppErrorType.serverError | MiniAppErrorType.tokenExpired | MiniAppErrorType.notAuthorized | MiniAppErrorType.rateLimitExceeded;
59
59
  export declare function getStoreUrl(): "https://play.google.com/store/apps/details?id=jp.ne.paypay.android.app" | "https://itunes.apple.com/app/id1435783608";
60
60
  export declare function generateCodeVerifier(length?: number): string;
61
61
  export declare function generateCodeChallenge(codeVerifier: string): Promise<string>;
@@ -5,4 +5,5 @@ export declare const MinVersion: {
5
5
  START_MULTIFACTOR_AUTH_ANDROID_FIX: string;
6
6
  KYC_PASSPORT: string;
7
7
  LOG_APP_FLYER_EVENT: string;
8
+ PERFORMANCE_MEASUREMENT: string;
8
9
  };
@@ -37,3 +37,4 @@ export declare function getClientVersion(): string;
37
37
  export declare function saveDebugMode(isDebugMode: boolean): void;
38
38
  export declare function getDebugMode(): boolean;
39
39
  export declare function removeLogInData(): void;
40
+ export declare function clearStorageValues(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypay/mini-app-js-sdk",
3
- "version": "2.25.0",
3
+ "version": "2.30.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "yarn build:client && yarn build:core && yarn build:init",
@@ -25,7 +25,8 @@
25
25
  "e2e:sp:update": "yarn e2e:sp --update-snapshots",
26
26
  "e2e:ma": "SDK=MA playwright test",
27
27
  "e2e:ma:update": "yarn e2e:sp --update-snapshots",
28
- "preview": "yarn dev:client & vite preview --config vite.config.core.ts --port 3100"
28
+ "preview": "yarn dev:client & vite preview --config vite.config.core.ts --port 3100",
29
+ "generate-init-test-pages": "node .github/scripts/generate-init-test-pages.js"
29
30
  },
30
31
  "license": "MIT",
31
32
  "author": "paypay",