@paypay/mini-app-js-sdk 2.11.0 → 2.12.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.
@@ -2,3 +2,4 @@ export declare const JS_SDK_VERSION: string;
2
2
  export declare const CORE_IFRAME_ORIGIN: string;
3
3
  export declare const CORE_IFRAME_URL: string;
4
4
  export declare const COUPON_IFRAME_URL: string;
5
+ export declare const REMOTE_STRINGS_URL: string;
@@ -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;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{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";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,a){if("undefined"!=typeof document){"number"==typeof(a=e({},o,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in a)a[s]&&(i+="; "+s,!0!==a[s]&&(i+="="+a[s].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var a=t[r].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(o[s]=n.read(i,s),e===s)break}catch(c){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({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:"/"}),n=(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))(n||{});const o={success:"success",fail:"fail",complete:"complete"},r={init:"init",getBankInfo:"getBankInfo",showAlert:"showAlert",render:"render",makePayment:"makePayment",getUAID:"getUAID",logout:"logout",startMultiFactorAuth:"startMultiFactorAuth",verifyMultiFactorAuthResult:"verifyMultiFactorAuthResult",getPermissionStatus:"getPermissionStatus",registerKyc:"registerKyc",getKycInformation:"getKycInformation",getUserAddress:"getUserAddress",getUserLocation:"getUserLocation",getUserProfile:"getUserProfile",registerEmail:"registerEmail",showUpdateWarning:"showUpdateWarning",showErrorSheet:"showErrorSheet",getPlatformInformation:"getPlatformInformation",share:"share",setTitle:"setTitle",getTopBarHeight:"getTopBarHeight",openWebview:"openWebview",openMap:"openMap",closeApp:"closeApp",openApp:"openApp",checkPaymentMethod:"checkPaymentMethod",getBalance:"getBalance",topup:"topup",registerPaymentFeatures:"registerPaymentFeatures",registerUserInfo:"registerUserInfo",requestInternal:"requestInternal",scanCode:"scanCode",getAuthStatus:"getAuthStatus",openMiniApp:"openMiniApp",inputAddress:"inputAddress",checkAccessToken:"checkAccessToken",getCashbackInformation:"getCashbackInformation",request:"request",getDeviceInformation:"getDeviceInformation",debug:"debug",copyToClipboard:"copyToClipboard",createOrder:"createOrder",handleMessageFromNative:"handleMessageFromNative",initKycPassport:"initKycPassport",smsAuth:"smsAuth",getKycPassportInfo:"getKycPassportInfo",renderCoupons:"renderCoupons"},a="reload",i="link",s="saveRefreshToken",c="saveCodeVerifier",l="makeVisible",d="consoleDebugInfo",u="_PayPayJsBridge",p=["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"];function m(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const g=m("icon-paypay-rec.svg"),f=m("icon-paypay-rec-white.svg");!function(){try{return localStorage.getItem("ppjssdk.canWriteToLocalStorage"),!0}catch(e){return console.log(e),!1}}();var h=(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))(h||{});const v=["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 I(e,t){return e?function(e){const t=e.split(".");if(function(e){return/(^\s*(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))\s*$)/.test(e)}(n=e)||function(e){return/(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$)/.test(e)}(n)||t.length<=2)return e;var n;const o=t.slice(t.length-2).join(".");return v.includes(o)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}function E(){return Math.random().toString(36).substring(7)}const A="2.11.0",y=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),w=y.origin,k=new URL(`./iframe.html?v=${A}`,y).href,T=new URL(`./coupon/iframe.html?v=${A}`,y).href;function b(e){return e===w}function _(e){return e?String(e):""}function S(e,n){t.remove(e),t.remove(e,{domain:n})}let C=[];function N(e){C=C.filter((t=>t!==e))}function D(){const e=E();return C.push(e),e}class P extends Error{constructor(e,t){super(e),this.payload=t}}function O(e,t,n,o){return function(r={}){const a=n(),i=null==o?void 0:o(r);a.logEvent({event_action:`pp_${e}_called`,...i}),t(r).then((t=>{var n;a.logEvent({event_action:`pp_${e}_success`,...i}),null==(n=r.success)||n.call(r,t)})).catch((t=>{var n;console.error(t.message),a.logEvent({event_action:`pp_${e}_fail`,error_value:t.payload.errorCode,...i}),null==(n=r.fail)||n.call(r,t.payload)})).finally((()=>{var e;null==(e=r.complete)||e.call(r)}))}}class R{constructor(e,t){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",(e=>{var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,"originNotAllowed",`${e.origin} is not allowed to make requests`):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}))}async handleRequest(e){const t=this.functions[e.data.functionName];t||this.sendErrorResponse(e,"functionNotFound");try{this.sendSuccessResponse(e,await t(...e.data.params))}catch(n){this.sendErrorResponse(e,"runTimeError",n.message)}}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({code:e.data.code,message:e.data.message})}sendErrorResponse(e,t,n){this.sendResponse(e,{status:"failure",code:t,message:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage({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 twice");return this._instance=new this(e,t),this._instance}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 R.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get:(n,o)=>(...r)=>new Promise((async(a,i)=>{const s=o.toString(),c=`${s}--${E()}`;try{const o=await e();if(!o)throw new Error("Target window is undefined");o.postMessage({forWindowBridge:!0,type:"request",functionName:s,key:c,params:r},t),n.deferredCallbacks[c]=[a,i]}catch(l){i({code:"messageSendingFailed",message:l.message})}}))})}}var U=(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))(U||{});const L="ppmna-iframe",F="ppsdk-container";let M,j;function B(){return M||(M=function(){const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",F),e.setAttribute("class",F),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}()),M}function x(e){B().style.display=e?"initial":"none"}function V(){return j||(j=new Promise(((e,t)=>{const n=document.createElement("iframe");n.setAttribute("src",k),n.setAttribute("name",L),n.setAttribute("id",L),n.setAttribute("class",L),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n)},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=B();o.innerHTML="",o.append(n)}))),j}const W=R.init({});let $,K=!1;"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{V()})):V();const q=W.getTargetWindowFunctionProxy((function(){return V().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),w);function z(){return q}function H(e){const o=new URL(window.location.href),a=o.searchParams.get("token"),i=o.searchParams.get("one_time_token"),s=t.get(n.refreshToken)||"",c=t.get(n.codeVerifier)||"";K=!!e.useAllFunctions,(a||i)&&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)}(o);const l={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:a,ott:i,refreshToken:s,clientVersion:"2.11.0",codeVerifier:c};let d;$=new Promise((e=>d=e));const u=()=>{var t;d(!0),null==(t=e.complete)||t.call(e)};V().then((()=>{Z(r.init,!1,{...e,complete:u},l)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:h.sdkNotInitialized}),u()}))}addEventListener("message",(e=>{var o;if(!(null==(o=e.data)?void 0:o.forWindowBridge)&&b(e.origin))if(e.data.name===a&&window.location.reload(),e.data.name!==l){if(e.data.name===i){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===s){const{refreshToken:o,domain:r,isSecure:a}=e.data.data;!function(e,o,r){S(n.refreshToken,o),t.set(n.refreshToken,e,{domain:o,expires:90,secure:r})}(o,r,a)}if(e.data.name===c){const{codeVerifier:o,domain:r,isSecure:a}=e.data.data;!function(e,o,r){S(n.codeVerifier,o),t.set(n.codeVerifier,e,{domain:o,secure:r})}(o,r,a)}if(e.data.name===d){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else x(!0)}));const Y=O("renderCoupons",(async e=>{const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:a,locale:i}=e,s=document.getElementById(o);if(!s)throw new P("Invalid coupon container Id",{errorCode:h.badRequestInsufficientParameter});const c=await q.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:a}).catch((()=>{throw new P(`An error occurred while fetching coupons, merchantId=${t} and couponId=${n}`,{errorCode:h.unknown})}));if(0===c.length)throw new P(`No coupon found for merchantId=${t} and couponId=${n}`,{errorCode:h.notAvailable});const l=c[0],d=(new Date).getTime();if(new Date(l.liveStartDate).getTime()>d)throw new P("Coupon is not live yet",{errorCode:h.invalidData});if(new Date(l.liveEndDate).getTime()<d)throw new P("Coupon has expired",{errorCode:h.invalidData});if("SCHEDULED"!==l.status)throw new P(`Coupon status is ${l.status} that is not valid`,{errorCode:h.invalidData});try{const e=document.createElement("iframe");e.src=T,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",await new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(!1),s.innerHTML="",s.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=W.getTargetWindowFunctionProxy((()=>e.contentWindow),w);await n.renderCoupons({coupons:c,merchantId:t,locale:i})}catch(u){throw new P(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${u}`,{errorCode:h.unknown})}}),z,(e=>({event_label_suffix:e.merchant,event_label2:e.couponId})));const J=O("logout",(async()=>{try{const e=I(await q.logout(),window.location.hostname);return S(n.refreshToken,e),S(n.codeVerifier,e),{statusCode:U.loggedOut}}catch(e){throw new P(`An error ocurred while trying to logout the user, error=${e}`,{errorCode:h.unknown})}}),z);function G(e,t,n){var r,a,i;e.result===o.fail&&(null==(r=null==t?void 0:t.fail)||r.call(t,e.data)),e.result===o.success&&(null==(a=null==t?void 0:t.success)||a.call(t,null==e?void 0:e.data)),e.result===o.complete&&(null==(i=null==t?void 0:t.complete)||i.call(t),removeEventListener("message",n),N(e.messageId),C.length>0||x(!1))}async function Q(e){var t;const n=await V().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),w)}function Z(e,t,n,o){const r=D();t&&x(!0);const a=t=>{b(t.origin)&&t.data.name===e&&t.data.messageId===r&&G(t.data,n,a)};addEventListener("message",a),Q({name:e,params:o,messageId:r})}!function(e){const t=window;(!t.hasOwnProperty(u)||t[u]!==e)&&(t[u]=e)}({_handleMessageFromNative:e=>{V().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:r.handleMessageFromNative,params:{json:e}})),w)}))}});const X=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData"],ee=["renderCoupons"],te=new Proxy({init:H,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);Z(r.verifyMultiFactorAuthResult,!1,e,{...e,sessionId:t.searchParams.get("ppSessionId")})},share:function(e){if(!(null==navigator?void 0:navigator.share))return void Z(r.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:h.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:h.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=D(),a=t=>{var i,s;if(!b(t.origin)||t.data.name!==r.render||t.data.messageId!==n)return;const c=null==(i=t.data)?void 0:i.data,l=null==(s=t.data)?void 0:s.data;t.data.result===o.success&&(!function(e,t){var n,o,a,i,s;const c=document.getElementById(t.containerId),l=document.createElement("button");l.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const d=function(e){return"red"===e?f:g}(null==t?void 0:t.theme),u=(null==(o=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:o.length)?"pp-cashback":"",p=t.isShortText?"pp-shortText":"",m=(null==t?void 0:t.buttonSize)??"lg",h=(null==t?void 0:t.theme)??"light",v=document.createElement("a");v.className=`pp-smartBtn pp-${h} pp-${m} pp-${_(t.type)} pp-${e.preferredLanguage} ${u} ${p}`,v.href=_(e.data.loginUrl);const I=document.createElement("span");I.className="pp-leftSection";const E=document.createElement("img");E.className="pp-img",E.src=d,E.alt="",I.appendChild(E);const A=document.createElement("span");A.className="pp-btnContent";const y=document.createElement("span");y.className="pp-title",y.innerText=null==(a=null==e?void 0:e.data)?void 0:a.title,A.appendChild(y),I.appendChild(A),v.append(I);const w=document.createElement("span");(null==(i=null==e?void 0:e.data)?void 0:i.cashbackInfo)&&(w.className="pp-cashbackInfo",w.innerText=null==(s=null==e?void 0:e.data)?void 0:s.cashbackInfo,A.append(w));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)}l.append(v),c&&(c.innerHTML="",c.appendChild(l),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&l.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&&Z(r.makePayment,!0,t,{...t.orderInfo})})))}(l,e),"pay"===c.type&&(null==l?void 0:l.isJustLoggedIn)&&e.autoInvoke&&(null==l?void 0:l.isLoggedIn)&&Z(r.makePayment,!0,e,{...e.orderInfo})),t.data.result===o.complete&&(N(t.data.messageId),removeEventListener("message",a))};addEventListener("message",a),Q({name:r.render,params:{...e,redirectUrl:e.redirectUrl||window.location.href},messageId:n})},renderCoupons:Y,scanCode:function(e){const t={...e,redirectUrlOnCancel:(null==e?void 0:e.redirectUrlOnCancel)??window.location.href};Z(r.scanCode,!1,e,t)},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const a=document.execCommand("copy");document.body.removeChild(r),a?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:h.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:o??""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n;sessionStorage.setItem(null==e?void 0:e.key,(null==e?void 0:e.value)??""),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:o??""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n;localStorage.setItem(null==e?void 0:e.key,(null==e?void 0:e.value)??""),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.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=new URL(window.location.href);Z(r.getKycPassportInfo,!1,e,{...e,url:t})},getAuthStatus:function(e){const t=window.location.href;Z(r.getAuthStatus,!1,e,{...e,url:t})},logout:J},{get(e,t){const n=t;if(!K&&!function(e){return p.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return async o=>{var r,a;if(!X.includes(n)&&!(await $)){if(!ee.includes(n)||!o.clientId)return null==(r=o.fail)||r.call(o,{errorCode:h.sdkNotInitialized}),void(null==(a=o.complete)||a.call(o));H({clientId:o.clientId,env:o.env}),await $}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](o);Z(t,!1,o,o)}}});return function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)te[t](n)}}(),te}();
2
+ var pp=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,a){if("undefined"!=typeof document){"number"==typeof(a=e({},o,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in a)a[s]&&(i+="; "+s,!0!==a[s]&&(i+="="+a[s].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var a=t[r].split("="),i=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(o[s]=n.read(i,s),e===s)break}catch(c){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({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:"/"}),n=(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))(n||{});const o={success:"success",fail:"fail",complete:"complete"},r={init:"init",getBankInfo:"getBankInfo",showAlert:"showAlert",render:"render",makePayment:"makePayment",getUAID:"getUAID",logout:"logout",startMultiFactorAuth:"startMultiFactorAuth",verifyMultiFactorAuthResult:"verifyMultiFactorAuthResult",getPermissionStatus:"getPermissionStatus",registerKyc:"registerKyc",getKycInformation:"getKycInformation",getUserAddress:"getUserAddress",getUserLocation:"getUserLocation",getUserProfile:"getUserProfile",registerEmail:"registerEmail",showUpdateWarning:"showUpdateWarning",showErrorSheet:"showErrorSheet",getPlatformInformation:"getPlatformInformation",share:"share",setTitle:"setTitle",getTopBarHeight:"getTopBarHeight",openWebview:"openWebview",openMap:"openMap",closeApp:"closeApp",openApp:"openApp",checkPaymentMethod:"checkPaymentMethod",getBalance:"getBalance",topup:"topup",registerPaymentFeatures:"registerPaymentFeatures",registerUserInfo:"registerUserInfo",requestInternal:"requestInternal",scanCode:"scanCode",getAuthStatus:"getAuthStatus",openMiniApp:"openMiniApp",inputAddress:"inputAddress",checkAccessToken:"checkAccessToken",getCashbackInformation:"getCashbackInformation",request:"request",getDeviceInformation:"getDeviceInformation",debug:"debug",copyToClipboard:"copyToClipboard",createOrder:"createOrder",handleMessageFromNative:"handleMessageFromNative",initKycPassport:"initKycPassport",smsAuth:"smsAuth",getKycPassportInfo:"getKycPassportInfo",renderCoupons:"renderCoupons"},a="reload",i="link",s="saveRefreshToken",c="saveCodeVerifier",l="makeVisible",d="consoleDebugInfo",u="_PayPayJsBridge",p=["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"];function m(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const g=m("icon-paypay-rec.svg"),f=m("icon-paypay-rec-white.svg");!function(){try{return localStorage.getItem("ppjssdk.canWriteToLocalStorage"),!0}catch(e){return console.log(e),!1}}();var h=(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))(h||{});const v=["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 I(e,t){return e?function(e){const t=e.split(".");if(function(e){return/(^\s*(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))\s*$)/.test(e)}(n=e)||function(e){return/(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$)/.test(e)}(n)||t.length<=2)return e;var n;const o=t.slice(t.length-2).join(".");return v.includes(o)&&t.length>=3?t.slice(t.length-3).join("."):t.slice(t.length-2).join(".")}(t):t}function E(){return Math.random().toString(36).substring(7)}const A="2.12.0",y=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),w=y.origin,k=new URL(`./iframe.html?v=${A}&rev=12c80ef`,y).href,T=new URL(`./coupon/iframe.html?v=${A}`,y).href;function b(e){return e===w}function _(e){return e?String(e):""}function S(e,n){t.remove(e),t.remove(e,{domain:n})}let C=[];function N(e){C=C.filter((t=>t!==e))}function P(){const e=E();return C.push(e),e}class D extends Error{constructor(e,t){super(e),this.payload=t}}function O(e,t,n,o){return function(r={}){const a=n(),i=null==o?void 0:o(r);a.logEvent({event_action:`pp_${e}_called`,...i}),t(r).then((t=>{var n;a.logEvent({event_action:`pp_${e}_success`,...i}),null==(n=r.success)||n.call(r,t)})).catch((t=>{var n;console.error(t.message),a.logEvent({event_action:`pp_${e}_fail`,error_value:t.payload.errorCode,...i}),null==(n=r.fail)||n.call(r,t.payload)})).finally((()=>{var e;null==(e=r.complete)||e.call(r)}))}}class R{constructor(e,t){this.deferredCallbacks={},this.functions=e,this.allowedOrigins=t,this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",(e=>{var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,"originNotAllowed",`${e.origin} is not allowed to make requests`):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type&&this.handleResponse(e))}))}async handleRequest(e){const t=this.functions[e.data.functionName];t||this.sendErrorResponse(e,"functionNotFound");try{this.sendSuccessResponse(e,await t(...e.data.params))}catch(n){this.sendErrorResponse(e,"runTimeError",n.message)}}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({code:e.data.code,message:e.data.message})}sendErrorResponse(e,t,n){this.sendResponse(e,{status:"failure",code:t,message:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){var n;null==(n=e.source)||n.postMessage({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 twice");return this._instance=new this(e,t),this._instance}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 R.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get:(n,o)=>(...r)=>new Promise((async(a,i)=>{const s=o.toString(),c=`${s}--${E()}`;try{const o=await e();if(!o)throw new Error("Target window is undefined");o.postMessage({forWindowBridge:!0,type:"request",functionName:s,key:c,params:r},t),n.deferredCallbacks[c]=[a,i]}catch(l){i({code:"messageSendingFailed",message:l.message})}}))})}}var U=(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))(U||{});const L="ppmna-iframe",F="ppsdk-container";let M,j;function B(){return M||(M=function(){const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",F),e.setAttribute("class",F),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}()),M}function x(e){B().style.display=e?"initial":"none"}function V(){return j||(j=new Promise(((e,t)=>{const n=document.createElement("iframe");n.setAttribute("src",k),n.setAttribute("name",L),n.setAttribute("id",L),n.setAttribute("class",L),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n)},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=B();o.innerHTML="",o.append(n)}))),j}const W=R.init({});let $,K=!1;"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{V()})):V();const q=W.getTargetWindowFunctionProxy((function(){return V().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),w);function z(){return q}function H(e){const o=new URL(window.location.href),a=o.searchParams.get("token"),i=o.searchParams.get("one_time_token"),s=t.get(n.refreshToken)||"",c=t.get(n.codeVerifier)||"";K=!!e.useAllFunctions,(a||i)&&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)}(o);const l={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:a,ott:i,refreshToken:s,clientVersion:"2.12.0",codeVerifier:c};let d;$=new Promise((e=>d=e));const u=()=>{var t;d(!0),null==(t=e.complete)||t.call(e)};V().then((()=>{Z(r.init,!1,{...e,complete:u},l)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:h.sdkNotInitialized}),u()}))}addEventListener("message",(e=>{var o;if(!(null==(o=e.data)?void 0:o.forWindowBridge)&&b(e.origin))if(e.data.name===a&&window.location.reload(),e.data.name!==l){if(e.data.name===i){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===s){const{refreshToken:o,domain:r,isSecure:a}=e.data.data;!function(e,o,r){S(n.refreshToken,o),t.set(n.refreshToken,e,{domain:o,expires:90,secure:r})}(o,r,a)}if(e.data.name===c){const{codeVerifier:o,domain:r,isSecure:a}=e.data.data;!function(e,o,r){S(n.codeVerifier,o),t.set(n.codeVerifier,e,{domain:o,secure:r})}(o,r,a)}if(e.data.name===d){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else x(!0)}));const Y=O("renderCoupons",(async e=>{const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:a,locale:i}=e,s=document.getElementById(o);if(!s)throw new D("Invalid coupon container Id",{errorCode:h.badRequestInsufficientParameter});const c=await q.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:a}).catch((()=>{throw new D(`An error occurred while fetching coupons, merchantId=${t} and couponId=${n}`,{errorCode:h.unknown})}));if(0===c.length)throw new D(`No coupon found for merchantId=${t} and couponId=${n}`,{errorCode:h.notAvailable});const l=c[0],d=(new Date).getTime();if(new Date(l.liveEndDate).getTime()<d)throw new D("Coupon has expired",{errorCode:h.invalidData});if("SCHEDULED"!==l.status)throw new D(`Coupon status is ${l.status} that is not valid`,{errorCode:h.invalidData});try{const e=document.createElement("iframe");e.src=T,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",await new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(!1),s.innerHTML="",s.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=W.getTargetWindowFunctionProxy((()=>e.contentWindow),w);await n.renderCoupons({coupons:c,merchantId:t,locale:i})}catch(u){throw new D(`An error ocurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${u}`,{errorCode:h.unknown})}}),z,(e=>({event_label_suffix:e.merchant,event_label2:e.couponId})));const J=O("logout",(async()=>{try{const e=I(await q.logout(),window.location.hostname);return S(n.refreshToken,e),S(n.codeVerifier,e),{statusCode:U.loggedOut}}catch(e){throw new D(`An error ocurred while trying to logout the user, error=${e}`,{errorCode:h.unknown})}}),z);function G(e,t,n){var r,a,i;e.result===o.fail&&(null==(r=null==t?void 0:t.fail)||r.call(t,e.data)),e.result===o.success&&(null==(a=null==t?void 0:t.success)||a.call(t,null==e?void 0:e.data)),e.result===o.complete&&(null==(i=null==t?void 0:t.complete)||i.call(t),removeEventListener("message",n),N(e.messageId),C.length>0||x(!1))}async function Q(e){var t;const n=await V().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),w)}function Z(e,t,n,o){const r=P();t&&x(!0);const a=t=>{b(t.origin)&&t.data.name===e&&t.data.messageId===r&&G(t.data,n,a)};addEventListener("message",a),Q({name:e,params:o,messageId:r})}!function(e){const t=window;(!t.hasOwnProperty(u)||t[u]!==e)&&(t[u]=e)}({_handleMessageFromNative:e=>{V().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:r.handleMessageFromNative,params:{json:e}})),w)}))}});const X=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData"],ee=["renderCoupons"],te=new Proxy({init:H,verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);Z(r.verifyMultiFactorAuthResult,!1,e,{...e,sessionId:t.searchParams.get("ppSessionId")})},share:function(e){if(!(null==navigator?void 0:navigator.share))return void Z(r.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:h.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:h.badRequestInsufficientParameter}),console.error("Invalid container Id");const n=P(),a=t=>{var i,s;if(!b(t.origin)||t.data.name!==r.render||t.data.messageId!==n)return;const c=null==(i=t.data)?void 0:i.data,l=null==(s=t.data)?void 0:s.data;t.data.result===o.success&&(!function(e,t){var n,o,a,i,s;const c=document.getElementById(t.containerId),l=document.createElement("button");l.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const d=function(e){return"red"===e?f:g}(null==t?void 0:t.theme),u=(null==(o=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:o.length)?"pp-cashback":"",p=t.isShortText?"pp-shortText":"",m=(null==t?void 0:t.buttonSize)??"lg",h=(null==t?void 0:t.theme)??"light",v=document.createElement("a");v.className=`pp-smartBtn pp-${h} pp-${m} pp-${_(t.type)} pp-${e.preferredLanguage} ${u} ${p}`,v.href=_(e.data.loginUrl);const I=document.createElement("span");I.className="pp-leftSection";const E=document.createElement("img");E.className="pp-img",E.src=d,E.alt="",I.appendChild(E);const A=document.createElement("span");A.className="pp-btnContent";const y=document.createElement("span");y.className="pp-title",y.innerText=null==(a=null==e?void 0:e.data)?void 0:a.title,A.appendChild(y),I.appendChild(A),v.append(I);const w=document.createElement("span");(null==(i=null==e?void 0:e.data)?void 0:i.cashbackInfo)&&(w.className="pp-cashbackInfo",w.innerText=null==(s=null==e?void 0:e.data)?void 0:s.cashbackInfo,A.append(w));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)}l.append(v),c&&(c.innerHTML="",c.appendChild(l),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&l.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&&Z(r.makePayment,!0,t,{...t.orderInfo})})))}(l,e),"pay"===c.type&&(null==l?void 0:l.isJustLoggedIn)&&e.autoInvoke&&(null==l?void 0:l.isLoggedIn)&&Z(r.makePayment,!0,e,{...e.orderInfo})),t.data.result===o.complete&&(N(t.data.messageId),removeEventListener("message",a))};addEventListener("message",a),Q({name:r.render,params:{...e,redirectUrl:e.redirectUrl||window.location.href},messageId:n})},renderCoupons:Y,scanCode:function(e){const t={...e,redirectUrlOnCancel:(null==e?void 0:e.redirectUrlOnCancel)??window.location.href};Z(r.scanCode,!1,e,t)},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const a=document.execCommand("copy");document.body.removeChild(r),a?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:h.other}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:o??""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n;sessionStorage.setItem(null==e?void 0:e.key,(null==e?void 0:e.value)??""),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:o??""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n;localStorage.setItem(null==e?void 0:e.key,(null==e?void 0:e.value)??""),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.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=new URL(window.location.href);Z(r.getKycPassportInfo,!1,e,{...e,url:t})},getAuthStatus:function(e){const t=window.location.href;Z(r.getAuthStatus,!1,e,{...e,url:t})},logout:J},{get(e,t){const n=t;if(!K&&!function(e){return p.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return async o=>{var r,a;if(!X.includes(n)&&!(await $)){if(!ee.includes(n)||!o.clientId)return null==(r=o.fail)||r.call(o,{errorCode:h.sdkNotInitialized}),void(null==(a=o.complete)||a.call(o));H({clientId:o.clientId,env:o.env}),await $}if(Object.prototype.hasOwnProperty.call(e,n))return e[n](o);Z(t,!1,o,o)}}});return function(){const e=window._ppcs;if(e){window._ppcs=void 0;for(const[t,n]of e)te[t](n)}}(),te.revision="12c80ef",te}();
@@ -670,11 +670,12 @@ function getDomain(subdomainCookieSharing, hostname) {
670
670
  function getRandomString() {
671
671
  return Math.random().toString(36).substring(7);
672
672
  }
673
- const JS_SDK_VERSION = "2.11.0";
673
+ const JS_SDK_VERSION = "2.12.0";
674
+ const REVISION = "12c80ef";
674
675
  const coreBaseUrl = new URL("https://mini-app-sdk-core.paypay.ne.jp/");
675
676
  const CORE_IFRAME_ORIGIN = coreBaseUrl.origin;
676
677
  const CORE_IFRAME_URL = new URL(
677
- `./iframe.html?v=${JS_SDK_VERSION}`,
678
+ `./iframe.html?v=${JS_SDK_VERSION}&rev=${REVISION}`,
678
679
  coreBaseUrl
679
680
  ).href;
680
681
  const COUPON_IFRAME_URL = new URL(
@@ -1107,7 +1108,7 @@ function init(params) {
1107
1108
  const ott = url2.searchParams.get("one_time_token");
1108
1109
  const refreshToken = getRefreshToken();
1109
1110
  const codeVerifier = getCodeVerifier();
1110
- const clientVersion = "2.11.0";
1111
+ const clientVersion = "2.12.0";
1111
1112
  useAllFunctions = !!params.useAllFunctions;
1112
1113
  if (token || ott) {
1113
1114
  removeTokenFromUrl(url2);
@@ -1276,11 +1277,6 @@ const renderCoupons = promiseToCallback(
1276
1277
  }
1277
1278
  const firstCoupon = coupons[0];
1278
1279
  const currentTimeStamp = (/* @__PURE__ */ new Date()).getTime();
1279
- if (new Date(firstCoupon.liveStartDate).getTime() > currentTimeStamp) {
1280
- throw new ClientError("Coupon is not live yet", {
1281
- errorCode: MiniAppErrorType.invalidData
1282
- });
1283
- }
1284
1280
  if (new Date(firstCoupon.liveEndDate).getTime() < currentTimeStamp) {
1285
1281
  throw new ClientError("Coupon has expired", {
1286
1282
  errorCode: MiniAppErrorType.invalidData
@@ -1625,6 +1621,7 @@ function executePendingFunctionCalls() {
1625
1621
  }
1626
1622
  }
1627
1623
  executePendingFunctionCalls();
1624
+ proxy.revision = "12c80ef";
1628
1625
  export {
1629
1626
  proxy as default
1630
1627
  };
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'link' | 'outLined';
3
3
  export declare type ButtonSize = 'large' | 'normal' | 'small';
4
- export declare const Button: import("vue").DefineComponent<{
4
+ export declare const PButton: import("vue").DefineComponent<{
5
5
  disabled: BooleanConstructor;
6
6
  loading: BooleanConstructor;
7
7
  block: BooleanConstructor;
@@ -1,4 +1,4 @@
1
- export declare type ClaimStatus = 'CLAIMED_DELETABLE' | 'CLAIMED_NOT_DELETABLE' | 'NOT_CLAIMED_ELIGIBLE' | 'NOT_CLAIMED_NOT_ELIGIBLE' | 'FULLY_USED' | 'NOT_LOGGED_IN' | 'CLAIMING' | 'CLAIM_FAILED' | 'LOG_IN_FAILED';
1
+ export declare type ClaimStatus = 'CLAIMED_DELETABLE' | 'CLAIMED_NOT_DELETABLE' | 'NOT_CLAIMED_ELIGIBLE' | 'NOT_CLAIMED_NOT_ELIGIBLE' | 'FULLY_USED' | 'NOT_LOGGED_IN' | 'CLAIMING' | 'CLAIM_FAILED' | 'LOG_IN_FAILED' | 'COMING_SOON';
2
2
  export interface Coupon {
3
3
  merchantLogoUrl?: string;
4
4
  merchantName?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypay/mini-app-js-sdk",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "yarn build:client && yarn build:core && yarn build:init && yarn build:client:nightly",