@alipay/ams-checkout 0.0.1777017092-dev.1 → 0.0.1777017092-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ams-checkout.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * ams-checkout.js v0.0.1777017092-dev.1
3
- * Build Time: 2026-06-24T03:35:54.175Z
2
+ * ams-checkout.js v0.0.1777017092-dev.2
3
+ * Build Time: 2026-07-10T09:24:09.586Z
4
4
  * (c) Antom Team
5
5
  */
6
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={4989:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث استثناء غير معروف، يرجى التحقق من حالة الدفع والتواصل مع التاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى."}},8143:function(e){e.exports={"page.wrong.error.message":"Error del sistema"}},1286:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Unbekannte Fehlermeldung. Bitte überprüfen Sie den Zahlungsstatus und wenden Sie sich an den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut."}},9715:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος"}},3282:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please check your payment status and contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again."}},6233:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Por favor, revise la situación del pago y contacte con el comerciante.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo."}},1269:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s'est produite. Veuillez vérifier l'état de votre paiement et contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer."}},6543:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"अज्ञात त्रुटि। कृपया अपनी भुगतान स्थिति जाँचें और व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।"}},7801:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui, silakan periksa status pembayaran dan hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi."}},817:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(3282),r["pt-BR"]=r["pt-br"]=n(9747),r["es-ES"]=r["es-es"]=n(6233),r["ko-KR"]=r["ko-kr"]=n(6367),r["zh-CN"]=r["zh-cn"]=n(6377),r["zh-HK"]=r["zh-hk"]=n(910),r["ms-MY"]=r["ms-my"]=n(6444),r["in-ID"]=r["in-id"]=n(7801),r["th-TH"]=r["th-th"]=n(4744),r["vi-VN"]=r["vi-vn"]=n(9443),r["tl-PH"]=r["tl-ph"]=n(1153),r["it-IT"]=r["it-it"]=n(6858),r["de-DE"]=r["de-de"]=n(1286),r["fr-FR"]=r["fr-fr"]=n(1269),r["nl-NL"]=r["nl-nl"]=n(7465),r["ja-JP"]=r["ja-jp"]=n(7312),r.ro=r.ro=n(4803),r["pl-PL"]=r["pl-pl"]=n(7846),r["ar-SA"]=r["ar-sa"]=n(4989),r["tr-TR"]=r["tr-tr"]=n(9499),r["hi-IN"]=r["hi-in"]=n(6543),r["pt-PT"]=r["pt-pt"]=n(7021),r.ca=r.ca=n(8143),r.el=r.el=n(9715),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},6858:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Errore sconosciuto. Si prega di verificare lo stato del pagamento e di contattare il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova."}},7312:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"未知のエラーが発生しました。お支払い状況をご確認のうえ、加盟店へお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。"}},6367:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 결제 상황을 확인하고 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요."}},6444:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat tidak diketahui. Sila semak butiran pembayaran anda dan hubungi peniaga.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi."}},7465:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Onbekende uitzondering. Controleer de betalingsstatus en neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw."}},7846:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Sprawdź status płatności i skontaktuj się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie."}},9747:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Erro desconhecido. Verifique o status do pagamento e entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente."}},7021:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu uma exceção desconhecida. Verifique a situação do pagamento e entre em contacto com o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente."}},4803:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"Eroare necunoscută. Vă rugăm să verificați statutul plății și să luați legătura cu comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou."}},4744:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ กรุณาตรวจสอบสถานะการชำระเงินและติดต่อผู้ขาย。","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。"}},1153:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Hindi kilalang error. Pakisuri ang mga detalye ng iyong pagbabayad at makipag-ugnayan sa merchant.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli."}},9499:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu, lütfen ödeme durumunu kontrol edin ve satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin."}},9443:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Lỗi không xác định. Vui lòng kiểm tra lại thông tin thanh toán và liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại."}},6377:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"未知异常,请检查付款情况并联系商户。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。"}},910:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"未知異常,請檢查付款情況並聯絡商家。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。"}},8306:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=void 0,t.createSingletonInstance=l,t.createInstance=c,t.createLoader=function(e){var t=this,n=e.sdkURL,s=e.globalName,u=e.timeout,d=void 0===u?2e4:u,p=e.onLoadComplete,h=e.onError,f=e.onLoadStart,m=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,u,v=this;return o(this,(function(_){var b,E;return null==f||f(),t=Date.now(),i.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),b=function(){return(0,a.loadScriptClass)(n,s)},E=d,u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new a.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(E)))}),E)})),b.apply(void 0,e)])},[2,u().then((function(n){return r(v,[n],void 0,(function(n){var r,u,d,h=n.variable,f=n.cache;return o(this,(function(n){switch(n.label){case 0:if(r=Date.now(),f||i.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new a.LoaderError("NO_REMOTE_CLASS","No variables ".concat(s," were found. Cannot be initialized the Class ").concat(s));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?l:c)(h,e,void 0)];case 2:return u=n.sent(),i.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:u.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==m||m(u,window.location.href),[2,u];case 3:throw d=n.sent(),new a.LoaderError("INIT_ERROR","Initialize Class ".concat(s," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=a.LoaderError.unificationError(e);return i.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var i=n(2611),a=n(7880);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});var s=null;function l(e,t,n){return s||(s=c(e,t,n))}function c(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&i.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new a.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&i.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}},2611:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var i=n(7880),a=function(){function e(e){var t=this;Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e,this.loadTacker().then((function(e){t.tracker=e}))}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,i.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.1/dist/tracker.umd.js","intlSdkTracker").then((function(t){var n;return null===(n=null==t?void 0:t.variable)||void 0===n?void 0:n.getTrackerInstance(e.initOptions)}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=a;var s=(null==="DEV"?void 0:"DEV".toUpperCase())||"PROD",l=["DEV","SIT","PRE","PROD","LOCAL"].includes(s)?s:"PROD";t.tracker=new a({appId:"180020050100012557",env:l,server:"sg",performance:!1,error:!1})},7880:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},7861:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=l(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;s<l;s+=a)i.push(c(e,s,s+a>l?l:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6207:function(e,t,n){"use strict";var r=n(7861),o=n(9090),i=n(8736);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n);e=s(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function _(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return j(F(t,e.length-n),e,n,r)}function E(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return E(e,t,n,r)}function A(e,t,n,r){return j(Y(t),e,n,r)}function k(e,t,n,r){return j(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=void 0!==n.g.TYPED_ARRAY_SUPPORT?n.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return c(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return u(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){i=c[d],a=u[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=H(e[i]);return o}function N(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=l.isBuffer(e)?e:F(new l(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Y(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}},8736:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9090:function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=f,a/=256,c-=8);e[n+h-f]|=128*m}},8098:function(e,t,n){var r=n(4944).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(E,t),u?g(e):a}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function E(){var e=m();if(b(e))return S(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?f(n,i-(e-c)):n}(e))}function S(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function A(){var e=m(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(E,t),g(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},A.flush=function(){return void 0===s?a:S(m())},A}},9414:function(e,t,n){var r=n(4944).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,f="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=h||f||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,b=m["__core-js_shared__"],E=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=y.toString,A=_.hasOwnProperty,k=_.toString,T=RegExp("^"+S.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=m.Symbol,P=g.splice,I=K(m,"Map"),C=K(Object,"create"),R=w?w.prototype:void 0,N=R?R.toString:void 0;function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||G(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:H(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[F(t[o++])];return o&&o==i?e:void 0}function U(e){if(!z(e)||(t=e,E&&E in t))return!1;var t,n=function(e){var t=z(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}O.prototype.clear=function(){this.__data__=C?C(null):{}},O.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},O.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===o?void 0:n}return A.call(t,e)?t[e]:void 0},O.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:A.call(t,e)},O.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?o:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():P.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return M(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new O,map:new(I||L),string:new O}},D.prototype.delete=function(e){return B(this,e).delete(e)},D.prototype.get=function(e){return B(this,e).get(e)},D.prototype.has=function(e){return B(this,e).has(e)},D.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(G(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function F(e){if("string"==typeof e||G(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(Y.Cache||D),n}Y.Cache=D;var j=Array.isArray;function z(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function G(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},8994:function(e,t,n){e=n.nmd(e);var r=n(4944).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=p||h||Function("return this")(),m="object"==r(t)&&t&&!t.nodeType&&t,v=m&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===m,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function E(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S,A,k,T=Array.prototype,w=Function.prototype,P=Object.prototype,I=f["__core-js_shared__"],C=w.toString,R=P.hasOwnProperty,N=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=P.toString,L=C.call(Object),D=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=g?f.Buffer:void 0,x=f.Symbol,U=f.Uint8Array,B=M?M.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,k=Object,function(e){return A(k(e))}),H=Object.create,F=P.propertyIsEnumerable,Y=T.splice,j=x?x.toStringTag:void 0,z=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),G=M?M.isBuffer:void 0,V=Math.max,W=Date.now,q=ve(f,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ie(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Ae(e),r=!n&&Se(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Re(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!Ee(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];R.call(e,t)&&Ee(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return R.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:R.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():Y.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return me(this,e).get(e)},$.prototype.has=function(e){return me(this,e).has(e)},$.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=O.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return O.call(e)}(e)}function ce(e){return Ce(e)&&le(e)==a}function ue(e){return!(!Ie(e)||function(e){return!!N&&N in e}(e))&&(we(e)?D:c).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ie(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&R.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ie(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Ae(c),f=!h&&Te(c),m=!h&&!f&&Re(c);d=c,h||f||m?Ae(s)?d=s:Ce(b=s)&&ke(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=B?B(n):new e.constructor(n);return e.copy(r),r}(c,!0)):m?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!Ce(e)||le(e)!=l)return!1;var t=K(e);if(null===t)return!0;var n=R.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==L}(c)||Se(c)?(d=s,Se(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Ne(e))}(s):Ie(s)&&!we(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(K(e))}(c))):p=!1}var v,g,y,_;var b;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Ne)}function he(e,t){return be(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),E(e,this,s)}}(e,t,De),e+"")}var fe=z?function(e,t){return z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:De;function me(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function Ee(e,t){return e===t||e!=e&&t!=t}var Se=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&R.call(e,"callee")&&!F.call(e,"callee")},Ae=Array.isArray;function ke(e){return null!=e&&Pe(e.length)&&!we(e)}var Te=G||function(){return!1};function we(e){if(!Ie(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ie(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==r(e)}var Re=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&Pe(e.length)&&!!d[le(e)]};function Ne(e){return ke(e)?te(e,!0):de(e)}var Oe,Le=(Oe=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=Oe.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ie(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&Ee(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&Oe(e,s,n,i)}return e})));function De(e){return e}e.exports=Le},3089:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8319:function(e,t,n){var r=n(7652);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7652:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},3317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},4180:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},4786:function(e,t,n){var r=n(3317);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7374:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4331:function(e,t,n){var r=n(7652);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},8193:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},1404:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},8946:function(e,t,n){var r=n(7652);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},5486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},1486:function(e,t,n){var r=n(9687),o=n(2424);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(5281);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},9746:function(e,t,n){var r=n(5508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},3400:function(e,t,n){var r=n(2242),o=n(2424),i=n(1983);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4143:function(e,t,n){var r=n(5281);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},5225:function(e,t,n){var r=n(3155);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2242:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5821:function(e,t,n){var r=n(9687);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2185:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},2424:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},4682:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7249:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},20:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},114:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},5118:function(e,t,n){var r=n(4143);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},4005:function(e,t,n){var r=n(5166);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},5166:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},1983:function(e,t,n){var r=n(4944).default,o=n(7374);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7662:function(e,t,n){var r=n(4944).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new O(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var m="suspendedStart",v="executing",g="completed",y={};function _(){}function b(){}function E(){}var S={};p(S,c,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(L([])));k&&k!==i&&a.call(k,c)&&(S=k);var T=E.prototype=_.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(o,i,s,l){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function I(e,n,r){var o=m;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=E,s(T,"constructor",{value:E,configurable:!0}),s(E,"constructor",{value:b,configurable:!0}),b.displayName=p(E,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},w(P.prototype),p(P.prototype,u,(function(){return this})),n.AsyncIterator=P,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new P(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=L,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9687:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7925:function(e,t,n){var r=n(4180),o=n(7249),i=n(5508),a=n(20);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3155:function(e,t,n){var r=n(2242);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},4044:function(e,t,n){var r=n(4786),o=n(4682),i=n(5508),a=n(114);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(4944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5281:function(e,t,n){var r=n(4944).default,o=n(224);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},4944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5508:function(e,t,n){var r=n(3317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3697:function(e,t,n){var r=n(8319);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){var r=n(2242),o=n(9687),i=n(2185),a=n(1486);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return Zc},AMSAutoDebitPay:function(){return zc},AMSCashierPayment:function(){return Gc},AMSCheckout:function(){return jc},AMSCheckoutPage:function(){return Fc},AMSEasyPay:function(){return Qc},AMSElement:function(){return Jc},AMSVaulting:function(){return Vc},AddressElement:function(){return qc},AntomElement:function(){return Wc},AntomSDK:function(){return jm},ComponentSignEnum:function(){return z},ComponentSignEnumV2:function(){return j},ConnectErrorCode:function(){return pe},DisplayTypeEnum:function(){return Y},ElementType:function(){return O},EnvironmentEnum:function(){return $},EventLoggingEventId:function(){return fe},InterActionTypeEnum:function(){return de},MessageName:function(){return re},PaymentAmountEnum:function(){return q},PaymentElementLayout:function(){return x},PaymentMethodCategoryTypeEnum:function(){return V},PaypalMethodEnum:function(){return ce},PlatformEnum:function(){return ne},ProductSceneEnum:function(){return G},ProductSceneVersion:function(){return ue},RedirectType:function(){return le},RiskSdkInfoEnum:function(){return he},TargetEnum:function(){return oe},ThemeType:function(){return M},checkoutDisplayEnum:function(){return Q},default:function(){return qm},errorEnum:function(){return ie},eventCodeEnum:function(){return se},loadAntom:function(){return Wm},localeEnum:function(){return J},modeEnum:function(){return Z},networkModeEnum:function(){return X},osTypeEnum:function(){return ee},payPalConfigurationIntentEnum:function(){return W},redirectTypeEnum:function(){return ae},terminalTypeEnum:function(){return te}});var e={};n.r(e),n.d(e,{hasBrowserEnv:function(){return co},hasStandardBrowserEnv:function(){return po},hasStandardBrowserWebWorkerEnv:function(){return ho},navigator:function(){return uo},origin:function(){return fo}});var t,o=n(7662),i=n.n(o),a=n(1404),s=n.n(a),l=n(4143),c=n.n(l),u=n(9746),d=n.n(u),p=n(5118),h=n.n(p),f=n(702),m=n.n(f),v=n(5486),g=n.n(v),y=n(5821),_=n.n(y),b=n(3400),E=n.n(b),S=JSON.parse('{"name":"@alipay/ams-checkout","version":"2.0.19","description":"","repository":"git@code.alipay.com:antom-sdk/antom-web-sdk.git","author":"","exports":{".":{"types":"./esm/index.d.ts","import":"./esm/index.js","require":"./ams-checkout.js"},"./types":"./types.d.ts","./antom":"./antom.d.ts","./react-js":{"types":"./react-js.d.ts","import":"./react-js.js","require":"./react-js.cjs"},"./interface":"./types.untrimmed.d.ts"},"main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","antom.d.ts","types.d.ts","types.untrimmed.d.ts","ams-checkout.js","react-js.cjs","react-js.js","react-js.d.ts","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"opensdk update && npm run build:father:pre && npm run extract && npm run build:father && npm run build:father:umd && npm run build:react","build:analyze":"ANALYZE=1 father build","build:father":"FATHER_TSCONFIG_NAME=tsconfig.build.json father build","build:father:local":"STAGE_NAME=LOCAL FATHER_TSCONFIG_NAME=tsconfig.build.json father build","build:father:pre":"FATHER_BUILD_TYPE=prebuild father build","build:father:umd":"FATHER_BUILD_TYPE=only-umd father build","build:father:umd:local":"STAGE_NAME=LOCAL FATHER_BUILD_TYPE=only-umd father build","build:local":"opensdk update && npm run build:father:pre && npm run extract && npm run build:father:local && npm run build:father:umd:local && npm run build:react","build:react":"tsc --project tsconfig.cjs.json && mv react-js.js react-js.cjs && tsc --project tsconfig.esm.json","build:type":"dts-bundle-generator -o ./types/antom-web-sdk.d.ts ./src/index.ts --no-banner --silent --no-check","build:w":"FATHER_BUILD_TYPE=only-umd STAGE_NAME=LOCAL father dev","ci":"tnpm run cov","cov":"jest --coverage --silent","dev":"father dev","e2e":"nyc playwright test","e2e:create":"node scripts/e2e-create.js","e2e:ui":"playwright test --ui","extract":"opensdk extract -p esm/modern/sdk","format":"prettier --write --no-error-on-unmatched-pattern \\"**/*.{js,jsx,ts,tsx,md,json,css,less}\\"","generateApi":"intl-oneapi generate && prettier --write src/modern/sdk/oneapi","lint":"eslint ./src","test":"jest --coverage --silent","tsc":"tsc --noEmit","code-review-biz":"node .agents/skills/code-review-biz/scripts/code-review-cli.js","code-review-biz:mr":"node .agents/skills/code-review-biz/scripts/code-review-cli.js --url=","code-review-biz:push":"node .agents/skills/code-review-biz/scripts/code-review-cli.js --mode=pre-push","code-review-biz:init":"node .agents/skills/code-review-biz/scripts/lib/init.js init","code-review-biz:update":"node .agents/skills/code-review-biz/scripts/lib/init.js update","prepare":"husky install || true"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{js,jsx}":["eslint --fix","prettier --write"],"*.{ts,tsx}":["eslint --fix","prettier --parser=typescript --write"],"*.{md,json}":["prettier --write"]},"dependencies":{"@antglobal/create-sdk-loader":"^1.0.5","axios":"^1.3.4","proxy-polyfill":"^0.3.2","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@commitlint/cli":"^17.3.0","@commitlint/config-conventional":"^17.3.0","@microsoft/api-extractor":"^7.55.2","@playwright/test":"1.58.0","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/lodash.get":"^4.4.9","@types/react":"^19.2.14","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","dotenv":"^16.3.1","dts-bundle-generator":"^6.13.0","eslint":"^8.56.0","eslint-plugin-prettier":"^4.x","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","nyc":"^17.1.0","prettier":"^2.8.8","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","serve":"^14.2.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^5.x"},"engines":{"install-node":"20"},"publishConfig":{"access":"public"},"ci":{"resourceClass":"L","type":"aci"},"marmotId":"180020050100010657","tnpm":{"mode":"npm"}}'),A={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},k={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},T={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},w=S.version,P="1.47.2",I=n(907),C=n.n(I),R=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),N=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),O=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),L=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),D=c()(c()(c()(c()(c()(c()({},O.auth,N.AUTH_ELEMENT),O.address,N.ADDRESS_ELEMENT),O.payment,N.PAYMENT_ELEMENT),N.AUTH_ELEMENT,O.auth),N.ADDRESS_ELEMENT,O.address),N.PAYMENT_ELEMENT,O.payment),M=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),x=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),U=(c()(c()({},M.Default,"LIGHT"),M.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),B=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),K=function(e){_()(n,e);var t=E()(n);function n(e){var r;g()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return m()(n)}(C()(Error)),H=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),F=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),Y=function(e){return e.popup="popup",e.inline="inline",e}({}),j=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),z=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),G=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),V=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),W=function(e){return e.intent="intent",e.capture="capture",e}({}),q=function(e){return e.USD="USD",e}({}),J=function(e){return e["en-US"]="en-US",e}({}),Q=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),Z=function(e){return e.dropin="dropin",e.component="component",e}({}),X=function(e){return e.proxy="proxy",e.session="session",e}({}),$=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),ee=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),te=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),ne=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),re=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),oe=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),ie=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),ae=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),se=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),le=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),ce=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),ue=function(e){return e.V1="1.0",e.V2="2.0",e}({}),de=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),pe=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),he=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),fe=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),me={DOMAIN_NOT_IN_WHITE_LIST:{code:se.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:se.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:se.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:se.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:se.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:se.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:se.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:se.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:se.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},ve="COMPONENT",ge={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},ye={name:"validateFields"},_e="ams-component-container",be="ams-component-section",Ee="ams-checkout-component",Se="asm-component-close-block",Ae="ams-component-mask-close-block",ke="ams-component-retention",Te="ams-component-mockup",we="ams-component-loading",Pe="ams-component-popup-loading",Ie="_ams_sdk_component_listener",Ce="ams-inline-component-style",Re="inline-loading",Ne="ams-popup",Oe="light dark",Le=15e3,De=300,Me="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",xe={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},Ue={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Be=new Uint8Array(16);function Ke(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Be)}for(var He=[],Fe=0;Fe<256;++Fe)He.push((Fe+256).toString(16).slice(1));function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]}var je=function(e,t,n){if(Ue.randomUUID&&!t&&!e)return Ue.randomUUID();var r=(e=e||{}).random||(e.rng||Ke)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ye(r)},ze=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ge=function(){function e(t,n){g()(this,e),c()(this,"action",void 0),c()(this,"data",void 0),c()(this,"jsonData",null),this.action=t,this.data=n}return m()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),Ve=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),We=m()((function e(){g()(this,e)})),qe=function(){function e(){g()(this,e)}return m()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(ze.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(ze.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(ze.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new Ve((function(r){e.traceLog(ze.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(ze.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=d()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(ze.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=d()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var p=c.value;null==p||p.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var h,f=!1,m=d()(e.interceptors);try{for(m.s();!(h=m.n()).done;){var v=h.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),f=f||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){m.e(e)}finally{m.f()}f?e.publish(t,n):e.traceError(ze.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(ze.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(ze.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(ze.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=d()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(ze.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();c()(qe,"TAG","BusManager"),c()(qe,"_logSplit"," , "),c()(qe,"interceptors",[]),c()(qe,"subscribersMap",new Map),c()(qe,"isDebug",!0),c()(qe,"logger",void 0);var Je=n(4944),Qe=n.n(Je),Ze=n(7374),Xe=n.n(Ze),$e=n(4044),et=n.n($e),tt=n(7925),nt=n.n(tt),rt=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t},ot=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),it=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),at=function(e){return e.SDK="SDK",e.API="API",e}({}),st=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},lt=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return m()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),ct=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},ut=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},dt=window.navigator,pt=dt.userAgent,ht=/iPhone|iPad|iPod/i.test(pt)||"MacIntel"===dt.platform&&dt.maxTouchPoints>1,ft=/Android/i.test(pt),mt=(/\bMacintosh\b/.test(pt),/Windows NT/.test(pt),function(){var e=/OpenHarmony/i.test(dt.userAgent),t=/Phone/i.test(dt.userAgent),n=/Tablet/i.test(dt.userAgent);return e&&(t||n)}),vt=ht,gt=ft,yt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(pt)&&!mt()),_t=(mt(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),bt=function(){var e=dt.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},Et=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},St=function(){var e=document.documentElement.clientWidth,t=bt()?130:100*e/390;return Math.min(t,130)},At=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(St(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},kt=function(){window.removeEventListener("resize",At),window.removeEventListener("pageShow",At),window.removeEventListener("DOMContentLoaded",At),window.addEventListener("resize",At),window.addEventListener("pageShow",At),window.addEventListener("DOMContentLoaded",At)},Tt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},wt=function(e){return"function"==typeof e};function Pt(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function It(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var Ct=function(e){return!(!e||"object"!==Qe()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},Rt=function(){var e=(Et()||{}).environment;return!!e&&"dev"===e};function Nt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Ot(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Nt(e,n)>=0&&Nt(r,e)>=0}function Lt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=nt()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var Dt=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=Ut(t,n,r,o,i,l),u=Et(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,f=void 0===h?"":h,m=u.groupId,v=void 0===m?"":m,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var b in a)_[b]=""+a[b];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),f&&(_.requestHost=f),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var E=ct(_);return Rt()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,E)),{path:c,locationSearch:E}},Mt=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?zt(n,o):Gt(n,o),a=Dt(h()(h()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Yt(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},xt=function(e){var t=Dt(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},Ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=Et()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Ht(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===z.AUTO_DEBIT_APM?"".concat(T[e]).concat(ot.TRUSTLY):n===G.EASY_PAY?null!=i?i:Gt(n,e):"".concat(A[e],"/").concat(c,"/").concat(l,"/index.html")},Bt=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Kt=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Ht=function(e,t,n){var r,o=(r={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(r,z.NONE,[""]),z.AUTO_DEBIT_WALLET,["1.0"]),z.AUTO_DEBIT_PAY_WALLET,[""]),z.CASHIER_PAYMENT_BANK,["1.0"]),z.CASHIER_PAYMENT_CARD,["1.0"]),z.CASHIER_PAYMENT_APM,["1.0"]),z.EASY_PAY_WALLET,["1.0","2.0"]),z.EASY_PAY_APM,["2.0"]),z.VAULTING_CARD,["1.0"]),z.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(r,z.ELEMENT_ADDRESS,["1.0"]),z.CHECKOUT_PAYMENT,["1.0"]),z.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},Ft="web_url_",Yt=function(e,t){var n=Ft+e;localStorage.setItem(n,t)},jt=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=Vt(a,i),l=function(){var e=n.sort((function(e,t){return Nt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Nt(w,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Nt(w,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===it.SDK_PORTAL?(null==l?void 0:l.url)||s:a===it.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},zt=function(e,t){var n=Ft+e,r=localStorage.getItem(n);return null!=r?r:Gt(e,t)},Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===G.EASY_PAY?Vt(it.SDK_PORTAL,t):""},Vt=function(e,t){return"".concat(T[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},Wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Kt(r),i=jt({configs:o,mid:n,env:t,pageName:it.DOUBLE_FA});return i},qt="antom_checkout_previous_ProductInfo_",Jt=function(){function e(){g()(this,e)}return m()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=qt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=qt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Qt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},Zt=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function Xt(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var $t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Qt(e,"");if(t)return t;var n=je();e&&n&&Zt(e,n)}}catch(e){return""}};function en(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$t();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function tn(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var nn=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Ot(t.sdkVersion,e.v)&&Xt(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=tn(e,null!==(a=t.greyscale)&&void 0!==a?a:en());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},rn=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Qt(t,"")}catch(e){return""}},on=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return Zt(n,t)}catch(e){return!1}};function an(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(Pt(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=ln(e,t,n);return r||((r=Qt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},ln=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Ot(e.sdkVersion,n.v)&&Xt(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=tn(n,null!==(a=e.greyscaleId)&&void 0!==a?a:en());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},cn={production:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},un=new Set(Object.values(cn).map((function(e){return e.url}))),dn="APDID",pn=function(){function e(){g()(this,e),c()(this,"state","idle"),c()(this,"loadingPromise",null),c()(this,"apdidModule",null),c()(this,"retryCount",0),c()(this,"config",null)}var t,n;return m()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=cn[t.environment]){e.next=11;break}return a=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),e.abrupt("return",Promise.reject(a));case 11:if(s=n.url,un.has(s)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(s)),this.state="failed",null===(l=t.callbacks)||void 0===l||null===(c=l.onLoadFailed)||void 0===c||c.call(l,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(s,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0;case 1:if(!(s<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),a=e.t0,s<1&&(this.retryCount++,this.state="idle");case 13:s++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),a;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now(),o=import(e).then((function(e){var o=e.default||e;if(o)n._onLoadSuccess(o,r,t);else{var i=window[dn];if(!i)throw new Error("[ApdidLoader] Module loaded but no export and window.".concat(dn," not found"));n._onLoadSuccess(i,r,t)}})),i=new Promise((function(r,o){setTimeout((function(){var r,i;"loading"===n.state&&(null===(r=t.callbacks)||void 0===r||null===(i=r.onLoadTimeout)||void 0===i||i.call(r),o(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4)}));return Promise.race([o,i])}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();c()(pn,"instance",null);var hn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},fn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),mn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},vn=c()(c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.AUTO_DEBIT_PAY,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),gn=function(e){return mn[e]||mn[fn.SG]},yn=function(e){return console.log("getSecurityScene",e),vn[e]||""},_n=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},bn=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||mn[fn.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=pn.getInstance(),n=_n(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return pn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(console.log(this.scene,"preloadSecuritySDK"),!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(vn).includes(this.scene)||!Object.values(mn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o),console.log("initToken result tokenResult",JSON.stringify(r),o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),En=function(){function e(){g()(this,e),c()(this,"registry",new Map)}var t;return m()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),Sn=new En,An=function(){function e(){g()(this,e)}var t;return m()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=rt(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=s()(i()().mark((function t(n){var r,o,a,s,l,c,u,d,p,h=this,f=arguments;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:"SG",o=f.length>2?f[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(a=e.getSecurityConfigStorage(n),s=a.scene||yn(n),console.log("getSecurityScene",s),l=a.h5gateway||gn(r),console.log("preloadSecuritySDK",s),!Sn.isReady(s)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!Sn.isLoading(s)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=Sn.get(s))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=_n(o),pn.getInstance().scheduleLoad({environment:u}),d=new bn({scene:s,h5gateway:l,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){Sn.setReady(s,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){Sn.setFailed(s,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),Sn.setLoading(s,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return Sn.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===G.EASY_PAY?"2.0":"1.0",i=Jt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:w,webAppVersion:""};s.webAppVersion=sn(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Mt(l):xt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(hn(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();c()(An,"isWebAppPreloaded",!1),c()(An,"isSecuritySDKPreloaded",!1);var kn=function(e){return e.optional_init="plugin_optional_init",e}({}),Tn=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),wn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),Pn=function(e){return e.onEventCallback="onEventCallback",e}({}),In=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Cn=function(e){return e.reportAnalytics="reportAnalytics",e}({}),Rn=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(Rn||{}),Nn=function(){function e(t){var n=this;g()(this,e),c()(this,"merchantIdentifier",void 0),c()(this,"merchantName",void 0),c()(this,"session",void 0),c()(this,"paymentState",void 0),c()(this,"getMerchantSession",void 0),c()(this,"completePaymentAuthorized",void 0),c()(this,"completeApplePay",void 0),c()(this,"logError",void 0),c()(this,"isRecurring",!1),c()(this,"logger",void 0),c()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(se.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(se.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=Rn.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=Rn.success,o=!0})).catch((function(e){i(e),n.paymentState=Rn.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(se.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===Rn.pending?n.logError(se.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(se.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(se.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(se.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return m()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=Rn.notStarted}},{key:"hasActiveCard",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),On=Nn;function Ln(e,t){return function(){return e.apply(t,arguments)}}var Dn,Mn,xn=n(3089),Un=Object.prototype.toString,Bn=Object.getPrototypeOf,Kn=Symbol.iterator,Hn=Symbol.toStringTag,Fn=(Dn=Object.prototype.hasOwnProperty,function(e,t){return Dn.call(e,t)}),Yn=function(e,t){for(var n=e,r=[];null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),Fn(n,t))return!0;n=Bn(n)}return!1},jn=(Mn=Object.create(null),function(e){var t=Un.call(e);return Mn[t]||(Mn[t]=t.slice(8,-1).toLowerCase())}),zn=function(e){return e=e.toLowerCase(),function(t){return jn(t)===e}},Gn=function(e){return function(t){return Je(t)===e}},Vn=Array.isArray,Wn=Gn("undefined");function qn(e){return null!==e&&!Wn(e)&&null!==e.constructor&&!Wn(e.constructor)&&Zn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Jn=zn("ArrayBuffer");var Qn=Gn("string"),Zn=Gn("function"),Xn=Gn("number"),$n=function(e){return null!==e&&"object"===Je(e)},er=function(e){if(!$n(e))return!1;var t=Bn(e);return!(null!==t&&t!==Object.prototype&&null!==Bn(t)||Yn(e,Hn)||Yn(e,Kn))},tr=zn("Date"),nr=zn("File"),rr=zn("Blob"),or=zn("FileList");var ir="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ar=void 0!==ir.FormData?ir.FormData:void 0,sr=zn("URLSearchParams"),lr=["ReadableStream","Request","Response","Headers"].map(zn),cr=tt(lr,4),ur=cr[0],dr=cr[1],pr=cr[2],hr=cr[3];function fr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==Je(e)&&(e=[e]),Vn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(qn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function mr(e,t){if(qn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var vr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,gr=function(e){return!Wn(e)&&e!==vr};var yr,_r=(yr="undefined"!=typeof Uint8Array&&Bn(Uint8Array),function(e){return yr&&e instanceof yr}),br=zn("HTMLFormElement"),Er=Object.prototype.propertyIsEnumerable,Sr=zn("RegExp"),Ar=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};fr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var kr,Tr,wr,Pr,Ir=zn("AsyncFunction"),Cr=(kr="function"==typeof setImmediate,Tr=Zn(vr.postMessage),kr?setImmediate:Tr?(wr="axios@".concat(Math.random()),Pr=[],vr.addEventListener("message",(function(e){var t=e.source,n=e.data;t===vr&&n===wr&&Pr.length&&Pr.shift()()}),!1),function(e){Pr.push(e),vr.postMessage(wr,"*")}):function(e){return setTimeout(e)}),Rr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(vr):void 0!==xn&&xn.nextTick||Cr,Nr=function(e){return null!=e&&Zn(e[Kn])},Or={isArray:Vn,isArrayBuffer:Jn,isBuffer:qn,isFormData:function(e){if(!e)return!1;if(ar&&e instanceof ar)return!0;var t=Bn(e);if(!t||t===Object.prototype)return!1;if(!Zn(e.append))return!1;var n=jn(e);return"formdata"===n||"object"===n&&Zn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Jn(e.buffer)},isString:Qn,isNumber:Xn,isBoolean:function(e){return!0===e||!1===e},isObject:$n,isPlainObject:er,isEmptyObject:function(e){if(!$n(e)||qn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ur,isRequest:dr,isResponse:pr,isHeaders:hr,isUndefined:Wn,isDate:tr,isFile:nr,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:rr,isRegExp:Sr,isFunction:Zn,isStream:function(e){return $n(e)&&Zn(e.pipe)},isURLSearchParams:sr,isTypedArray:_r,isFileList:or,forEach:fr,merge:function e(){for(var t=gr(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&mr(o,i)||i,s=Fn(o,a)?o[a]:void 0;er(s)&&er(t)?o[a]=e(s,t):er(t)?o[a]=e({},t):Vn(t)?o[a]=t.slice():r&&Wn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!qn(l)&&(fr(l,i),"object"===Je(l)&&!Vn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];Er.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return fr(t,(function(t,r){n&&Zn(t)?Object.defineProperty(e,r,{__proto__:null,value:Ln(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Bn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:jn,kindOfTest:zn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(Vn(e))return e;var t=e.length;if(!Xn(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Kn]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:br,hasOwnProperty:Fn,hasOwnProp:Fn,hasOwnInPrototypeChain:Yn,getSafeProp:function(e,t){return null!=e&&Yn(e,t)?e[t]:void 0},reduceDescriptors:Ar,freezeMethods:function(e){Ar(e,(function(t,n){if(Zn(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Zn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return Vn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:mr,global:vr,isContextDefined:gr,isSpecCompliantForm:function(e){return!!(e&&Zn(e.append)&&"FormData"===e[Hn]&&e[Kn])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if($n(n)){if(t.has(n))return;if(qn(n))return n;if(!("toJSON"in n)){t.add(n);var r=Vn(n)?[]:{};return fr(n,(function(t,n){var o=e(t);!Wn(o)&&(r[n]=o)})),t.delete(n),r}}return n}(e)},isAsyncFn:Ir,isThenable:function(e){return e&&($n(e)||Zn(e))&&Zn(e.then)&&Zn(e.catch)},setImmediate:Cr,asap:Rr,isIterable:Nr,isSafeIterable:function(e){return null!=e&&Yn(e,Kn)&&Nr(e)}},Lr=Or.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Dr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Mr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function xr(e,t){return Or.isArray(e)?e.map((function(e){return xr(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Ur(e){var t=Object.create(null);return Or.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return xr(e,Mr)}(e)})),t}var Br=Symbol("internals");function Kr(e){return e&&String(e).trim().toLowerCase()}function Hr(e){return!1===e||null==e?e:Or.isArray(e)?e.map(Hr):function(e){return xr(e,Dr)}(String(e))}function Fr(e,t,n,r,o){return Or.isFunction(r)?r.call(this,t,n):(o&&(t=n),Or.isString(t)?Or.isString(r)?-1!==t.indexOf(r):Or.isRegExp(r)?r.test(t):void 0:void 0)}var Yr=function(e,t){function n(e){v(this,n),e&&this.set(e)}return f(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Kr(t);if(o){var i=Or.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Hr(e))}}var i=function(e,t){return Or.forEach(e,(function(e,n){return o(e,n,t)}))};if(Or.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Or.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Lr[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)})),o}(e),t);else if(Or.isObject(e)&&Or.isSafeIterable(e)){var a,s,l,c=Object.create(null),d=u(e);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(!Or.isArray(p))throw new TypeError("Object iterator must return a key-value pair");s=p[0],Or.hasOwnProp(c,s)?(a=c[s],c[s]=Or.isArray(a)?[].concat($e(a),[p[1]]):[a,p[1]]):c[s]=p[1]}}catch(e){d.e(e)}finally{d.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Kr(e)){var n=Or.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Or.isFunction(t))return t.call(this,r,n);if(Or.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Kr(e)){var n=Or.findKey(this,e);return!(!n||void 0===this[n]||t&&!Fr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Kr(e)){var o=Or.findKey(n,e);!o||t&&!Fr(0,n[o],o,t)||(delete n[o],r=!0)}}return Or.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Fr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Or.forEach(this,(function(r,o){var i=Or.findKey(n,o);if(i)return t[i]=Hr(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Hr(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Or.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&Or.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=tt(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[Br]=this[Br]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Kr(e);t[r]||(!function(e,t){var n=Or.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Or.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);Yr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Or.reduceDescriptors(Yr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),Or.freezeMethods(Yr);var jr=Yr;function zr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==Je(t))return t;if(Or.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof jr&&(t=t.toJSON()),r.push(t),Or.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);Or.isUndefined(r)||(o[n]=r)}));else{if(!Or.isPlainObject(t)&&function(e){if(Or.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Or.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=tt(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?"[REDACTED ****]":e(c);Or.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}var Gr=function(e){y(n,e);var t=b(n);function n(e,r,o,i,a){var s;return v(this,n),s=t.call(this,e),Object.defineProperty(Ze(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return f(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&Or.hasOwnProp(e,"redact")?e.redact:void 0,n=Or.isArray(t)&&t.length>0?zr(e,t):Or.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=new n(e.message,t||e.code,r,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}}]),n}(I(Error));Gr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Gr.ERR_BAD_OPTION="ERR_BAD_OPTION",Gr.ECONNABORTED="ECONNABORTED",Gr.ETIMEDOUT="ETIMEDOUT",Gr.ECONNREFUSED="ECONNREFUSED",Gr.ERR_NETWORK="ERR_NETWORK",Gr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Gr.ERR_DEPRECATED="ERR_DEPRECATED",Gr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Gr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Gr.ERR_CANCELED="ERR_CANCELED",Gr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Gr.ERR_INVALID_URL="ERR_INVALID_URL",Gr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Vr=Gr,Wr=n(6207).lW;function qr(e){return Or.isPlainObject(e)||Or.isArray(e)}function Jr(e){return Or.endsWith(e,"[]")?e.slice(0,-2):e}function Qr(e,t,n){return e?e.concat(t).map((function(e,t){return e=Jr(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Zr=Or.toFlatObject(Or,{},null,(function(e){return/^is[A-Z]/.test(e)}));var Xr=function(e,t,n){if(!Or.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Or.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Or.isUndefined(t[e])}))).metaTokens,o=n.visitor||h,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&Or.isSpecCompliantForm(t),u=[];if(!Or.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Or.isDate(e))return e.toISOString();if(Or.isBoolean(e))return e.toString();if(!c&&Or.isBlob(e))throw new Vr("Blob is not supported. Use a Buffer instead.");if(Or.isArrayBuffer(e)||Or.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if(void 0!==Wr)return Wr.from(e);throw new Vr("Blob is not supported. Use a Buffer instead.",Vr.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new Vr("Object is too deeply nested ("+e+" levels). Max depth: "+l,Vr.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,n,o){var s=e;if(Or.isReactNative(t)&&Or.isReactNativeBlob(e))return t.append(Qr(o,n,i),d(e)),!1;if(e&&!o&&"object"===Je(e))if(Or.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!Or.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r}))}(e,1);else if(Or.isArray(e)&&function(e){return Or.isArray(e)&&!e.some(qr)}(e)||(Or.isFileList(e)||Or.endsWith(n,"[]"))&&(s=Or.toArray(e)))return n=Jr(n),s.forEach((function(e,r){!Or.isUndefined(e)&&null!==e&&t.append(!0===a?Qr([n],r,i):null===a?n:n+"[]",d(e))})),!1;return!!qr(e)||(t.append(Qr(o,n,i),d(e)),!1)}var f=Object.assign(Zr,{defaultVisitor:h,convertValue:d,isVisitable:qr});if(!Or.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Or.isUndefined(n)){if(p(i),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),Or.forEach(n,(function(n,a){!0===(!(Or.isUndefined(n)||null===n)&&o.call(t,n,Or.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],i+1)})),u.pop()}}(e),t};function $r(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function eo(e,t){this._pairs=[],e&&Xr(e,this,t)}var to=eo.prototype;to.append=function(e,t){this._pairs.push([e,t])},to.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,$r)}:$r;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var no=eo;function ro(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oo(e,t,n){if(!t)return e;e=e||"";var r,o=Or.isFunction(n)?{serialize:n}:n,i=Or.getSafeProp(o,"encode")||ro,a=Or.getSafeProp(o,"serialize");if(r=a?a(t,o):Or.isURLSearchParams(t)?t.toString():new no(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var io=function(){function e(){v(this,e),this.handlers=[]}return f(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Or.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),ao=io,so={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},lo={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:no,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},co="undefined"!=typeof window&&"undefined"!=typeof document,uo="object"===("undefined"==typeof navigator?"undefined":Je(navigator))&&navigator||void 0,po=co&&(!uo||["ReactNative","NativeScript","NS"].indexOf(uo.product)<0),ho="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fo=co&&window.location.href||"http://localhost",mo=p(p({},e),lo);function vo(e){if(e>100)throw new Vr("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Vr.ERR_FORM_DATA_DEPTH_EXCEEDED)}var go=function(e){function t(e,n,r,o){vo(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Or.isArray(r)?r.length:i,s?(Or.hasOwnProp(r,i)?r[i]=Or.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(Or.hasOwnProp(r,i)&&Or.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Or.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Or.isFormData(e)&&Or.isFunction(e.entries)){var n={};return Or.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/\w+|\[(\w*)]/g;null!==(t=r.exec(e));)vo(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},yo=function(e,t){return null!=e&&Or.hasOwnProp(e,t)?e[t]:void 0};var _o={transitional:so,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Or.isObject(e);if(i&&Or.isHTMLForm(e)&&(e=new FormData(e)),Or.isFormData(e))return o?JSON.stringify(go(e)):e;if(Or.isArrayBuffer(e)||Or.isBuffer(e)||Or.isStream(e)||Or.isFile(e)||Or.isBlob(e)||Or.isReadableStream(e))return e;if(Or.isArrayBufferView(e))return e.buffer;if(Or.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=yo(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xr(e,new mo.classes.URLSearchParams,p({visitor:function(e,t,n,r){return mo.isNode&&Or.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=Or.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=yo(this,"env"),l=s&&s.FormData;return Xr(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Or.isString(e))try{return(t||JSON.parse)(e),Or.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=yo(this,"transitional")||_o.transitional,n=t&&t.forcedJSONParsing,r=yo(this,"responseType"),o="json"===r;if(Or.isResponse(e)||Or.isReadableStream(e))return e;if(e&&Or.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,yo(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw Vr.from(e,Vr.ERR_BAD_RESPONSE,this,null,yo(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mo.classes.FormData,Blob:mo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Or.forEach(["delete","get","head","post","put","patch","query"],(function(e){_o.headers[e]={}}));var bo=_o;function Eo(e,t){var n=this||bo,r=t||n,o=jr.from(r.headers),i=r.data;return Or.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function So(e){return!(!e||!e.__CANCEL__)}var Ao=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this,null==e?"canceled":e,Vr.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return f(n)}(Vr),ko=Ao;function To(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Vr("Request failed with status code "+n.status,n.status>=400&&n.status<500?Vr.ERR_BAD_REQUEST:Vr.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var wo=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var Po=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,$e(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)}]},Io=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=wo(50,250);return Po((function(n){if(n&&"number"==typeof n.loaded){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);var d=l({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(d)}}),n)},Co=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Ro=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Or.asap((function(){return e.apply(void 0,n)}))}},No=mo.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,mo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(mo.origin),mo.navigator&&/(msie|trident)/i.test(mo.navigator.userAgent)):function(){return!0},Oo=mo.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Or.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Or.isString(r)&&s.push("path=".concat(r)),Or.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),Or.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Lo=/^https?:(?!\/\/)/i,Do=/[\t\n\r]/g;function Mo(e,t){if("string"==typeof e&&Lo.test(function(e){return function(e){for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Do,"")}(e)))throw new Vr('Invalid URL: missing "//" after protocol',Vr.ERR_INVALID_URL,t)}function xo(e,t,n,r){Mo(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Mo(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}var Uo=function(e){return e instanceof jr?p({},e):e};function Bo(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Or.isPlainObject(e)&&Or.isPlainObject(t)?Or.merge.call({caseless:r},e,t):Or.isPlainObject(t)?Or.merge({},t):Or.isArray(t)?t.slice():t}function o(e,t,n,o){return Or.isUndefined(t)?Or.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Or.isUndefined(t))return r(void 0,t)}function a(e,t){return Or.isUndefined(t)?Or.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Or.hasOwnProp(t,i)?r(n,o):Or.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Uo(e),Uo(t),0,!0)}};return Or.forEach(Object.keys(p(p({},e),t)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Or.hasOwnProp(l,r)?l[r]:o,a=i(Or.hasOwnProp(e,r)?e[r]:void 0,Or.hasOwnProp(t,r)?t[r]:void 0,r);Or.isUndefined(a)&&i!==s||(n[r]=a)}})),Or.hasOwnProp(t,"validateStatus")&&Or.isUndefined(t.validateStatus)&&!1===function(n){var r=Or.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Or.isUndefined(r)){if(!Or.isPlainObject(r))return;if(Or.hasOwnProp(r,n))return r[n]}var o=Or.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Or.isPlainObject(o)&&Or.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Or.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Ko=["content-type","content-length"];var Ho=function(e){var t=Bo({},e),n=function(e){return Or.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=jr.from(s),t.url=oo(xo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=Or.getSafeProp(l,"username")||"",h=Or.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw Vr.from(t,Vr.ERR_BAD_OPTION_VALUE,e)}}if(Or.isFormData(r)&&(mo.hasStandardBrowserEnv||mo.hasStandardBrowserWebWorkerEnv||Or.isReactNative(r)?s.setContentType(void 0):Or.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=tt(t,2),r=n[0],o=n[1];Ko.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),mo.hasStandardBrowserEnv&&(Or.isFunction(o)&&(o=o(t)),!0===o||null==o&&No(t.url))){var f=i&&a&&Oo.read(a);f&&s.set(i,f)}return t},Fo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l=Ho(e),c=l.data,u=jr.from(l.headers).normalize(),d=l.responseType,p=l.onUploadProgress,h=l.onDownloadProgress;function f(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(r),l.signal&&l.signal.removeEventListener("abort",r)}var m=new XMLHttpRequest;function v(){if(m){var r=jr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());To((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}}if(m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Vr("Request aborted",Vr.ECONNABORTED,e,m)),f(),m=null)},m.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Vr(r,Vr.ERR_NETWORK,e,m);o.event=t||null,n(o),f(),m=null},m.ontimeout=function(){var t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",r=l.transitional||so;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new Vr(t,r.clarifyTimeoutError?Vr.ETIMEDOUT:Vr.ECONNABORTED,e,m)),f(),m=null},void 0===c&&u.setContentType(null),"setRequestHeader"in m&&Or.forEach(Ur(u),(function(e,t){m.setRequestHeader(t,e)})),Or.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),h){var g=Io(h,!0),y=tt(g,2);i=y[0],s=y[1],m.addEventListener("progress",i)}if(p&&m.upload){var _=Io(p),b=tt(_,2);o=b[0],a=b[1],m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)}(l.cancelToken||l.signal)&&(r=function(t){m&&(n(!t||t.type?new ko(null,e,m):t),m.abort(),f(),m=null)},l.cancelToken&&l.cancelToken.subscribe(r),l.signal&&(l.signal.aborted?r():l.signal.addEventListener("abort",r)));var E,S,A=(E=l.url,(S=/^([-+\w]{1,25}):(?:\/\/)?/.exec(E))&&S[1]||"");if(A&&!mo.protocols.includes(A))return n(new Vr("Unsupported protocol "+A+":",Vr.ERR_BAD_REQUEST,e)),void f();m.send(c||null)}))},Yo=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Vr?t:new ko(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new Vr("timeout of ".concat(t,"ms exceeded"),Vr.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){return e.addEventListener("abort",o,{once:!0})}));var s=n.signal;return s.unsubscribe=function(){return Or.asap(a)},s}},jo=n(3697),zo=n(8946),Go=n(4331),Vo=n(8193),Wo=o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:i=0;case 6:if(!(i<r)){e.next=13;break}return a=i+n,e.next=10,t.slice(i,a);case 10:i=a,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),qo=function(){var e=jo(o().mark((function e(t,n){var r,i,a,s,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,s=Vo(Jo(t));case 4:return e.next=6,zo(s.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(Go(Vo(Wo(c,n)),zo),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),i=!0,a=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==s.return){e.next=23;break}return e.next=23,zo(s.return());case 23:if(e.prev=23,!i){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),Jo=function(){var e=jo(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(Go(Vo(t),zo),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,zo(n.read());case 7:if(r=e.sent,i=r.done,a=r.value,!i){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,a;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,zo(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),Qo=function(e,t,n,r){var i,s=qo(e,t),l=0,c=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(o().mark((function t(){var r,i,a,u,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.next();case 3:if(r=t.sent,i=r.done,a=r.value,!i){t.next=10;break}return c(),e.close(),t.abrupt("return");case 10:u=a.byteLength,n&&(d=l+=u,n(d)),e.enqueue(new Uint8Array(a)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),c(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},Zo=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},Xo=function(e,t,n){return t+2<n&&Zo(e.charCodeAt(t+1))&&Zo(e.charCodeAt(t+2))};function $o(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var t=e.indexOf(",");if(t<0)return 0;var n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){for(var o=r.length,i=r.length,a=0;a<i;a++)if(37===r.charCodeAt(a)&&a+2<i){var s=r.charCodeAt(a+1),l=r.charCodeAt(a+2);Zo(s)&&Zo(l)&&(o-=2,a+=2)}var c=0,u=i-1,d=function(e){return e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e))};u>=0&&(61===r.charCodeAt(u)?(c++,u--):d(u)&&(c++,u-=3)),1===c&&u>=0&&(61===r.charCodeAt(u)||d(u))&&c++;var p=3*Math.floor(o/4)-(c||0);return p>0?p:0}for(var h=0,f=0,m=r.length;f<m;f++){var v=r.charCodeAt(f);if(37===v&&Xo(r,f,m))h+=1,f+=2;else if(v<128)h+=1;else if(v<2048)h+=2;else if(v>=55296&&v<=56319&&f+1<m){var g=r.charCodeAt(f+1);g>=56320&&g<=57343?(h+=4,f++):h+=3}else h+=3}return h}var ei="1.18.1",ti=Or.isFunction,ni=function(e){if(!Or.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ri=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},oi=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},ii=function(e){var t=void 0!==Or.global&&null!==Or.global?Or.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Or.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=i.fetch,l=i.Request,c=i.Response,u=s?ti(s):"function"==typeof fetch,d=ti(l),h=ti(c);if(!u)return!1;var f,m=u&&ti(n),v=u&&("function"==typeof r?(f=new r,function(e){return f.encode(e)}):function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new l(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),g=d&&m&&ri((function(){var e=!1,t=new l(mo.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),y=h&&m&&ri((function(){return Or.isReadableStream(new c("").body)})),_={stream:y&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!_[e]&&(_[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Vr("Response type '".concat(e,"' is not supported"),Vr.ERR_NOT_SUPPORT,n)})}));var b=function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!Or.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!Or.isSpecCompliantForm(t)){e.next=9;break}return n=new l(mo.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!Or.isArrayBufferView(t)&&!Or.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(Or.isURLSearchParams(t)&&(t+=""),!Or.isString(t)){e.next=16;break}return e.next=15,v(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Or.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?b(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(o().mark((function e(t){var n,i,a,u,h,f,v,S,A,k,T,w,P,I,C,R,N,O,L,D,M,x,U,B,K,H,F,Y,j,z,G,V,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,fe,me,ve,ge,ye,_e,be;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ho(t),i=n.url,a=n.method,u=n.data,h=n.signal,f=n.cancelToken,v=n.timeout,S=n.onDownloadProgress,A=n.onUploadProgress,k=n.responseType,T=n.headers,w=n.withCredentials,P=void 0===w?"same-origin":w,I=n.fetchOptions,C=n.maxContentLength,R=n.maxBodyLength,N=Or.isNumber(C)&&C>-1,O=Or.isNumber(R)&&R>-1,L=function(e){return Or.hasOwnProp(t,e)?t[e]:void 0},D=s||fetch,k=k?(k+"").toLowerCase():"text",M=Yo([h,f&&f.toAbortSignal()],v),x=null,U=M&&M.unsubscribe&&function(){M.unsubscribe()},K=null,H=function(){return new Vr("Request body larger than maxBodyLength limit",Vr.ERR_BAD_REQUEST,t,x)},e.prev=11,F=void 0,(Y=L("auth"))&&(j=Or.getSafeProp(Y,"username")||"",z=Or.getSafeProp(Y,"password")||"",F={username:j,password:z}),oi(i)&&(G=new URL(i,mo.origin),F||!G.username&&!G.password||(V=ni(G.username),W=ni(G.password),F={username:V,password:W}),(G.username||G.password)&&(G.username="",G.password="",i=G.href)),F&&(T.delete("authorization"),T.set("Authorization","Basic "+btoa((o=(F.username||"")+":"+(F.password||""),encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!N||"string"!=typeof i||!i.startsWith("data:")){e.next=21;break}if(!($o(i)>C)){e.next=21;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 21:if(!O||"get"===a||"head"===a){e.next=29;break}return e.next=24,b(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(B=q,!(q>R)){e.next=29;break}throw H();case 29:if(J=O&&(Or.isReadableStream(u)||Or.isStream(u)),Q=function(e,t,n){return Qo(e,65536,(function(e){if(O&&e>R)throw K=H();t&&t(e)}),n)},!g||"get"===a||"head"===a||!A&&!J){e.next=43;break}if(null!=B){e.next=38;break}return e.next=35,E(T,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=B;case 39:(0!==(B=e.t0)||J)&&(Z=new l(i,{method:"POST",body:u,duplex:"half"}),Or.isFormData(u)&&(X=Z.headers.get("content-type"))&&T.setContentType(X),Z.body&&($=A&&Co(B,Io(Ro(A)))||[],ee=tt($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===a||"head"===a){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||g||"get"===a||"head"===a){e.next=49;break}throw new Vr("Stream request bodies are not supported by the current fetch implementation",Vr.ERR_NOT_SUPPORT,t,x);case 49:return Or.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in l.prototype,Or.isFormData(u)&&(oe=T.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&T.delete("content-type"),T.set("User-Agent","axios/"+ei,!1),ie=p(p({},I),{},{signal:M,method:a.toUpperCase(),headers:Ur(T.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),x=d&&new l(i,ie),e.next=57,d?D(x,I):D(i,ie);case 57:if(ae=e.sent,se=jr.from(ae.headers),!N){e.next=63;break}if(!(null!=(le=Or.toFiniteNumber(se.getContentLength()))&&le>C)){e.next=63;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 63:return ce=y&&("stream"===k||"response"===k),y&&ae.body&&(S||N||ce&&U)&&(ue={},["status","statusText","headers"].forEach((function(e){ue[e]=ae[e]})),de=Or.toFiniteNumber(se.getContentLength()),pe=S&&Co(de,Io(Ro(S),!0))||[],he=tt(pe,2),fe=he[0],me=he[1],0,ve=function(e){if(N&&e>C)throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},ae=new c(Qo(ae.body,65536,ve,(function(){me&&me(),U&&U()})),ue)),k=k||"text",e.next=68,_[Or.findKey(_,k)||"text"](ae,t);case 68:if(ge=e.sent,!N||y||ce){e.next=73;break}if(null!=ge&&("number"==typeof ge.byteLength?ye=ge.byteLength:"number"==typeof ge.size?ye=ge.size:"string"==typeof ge&&(ye="function"==typeof r?(new r).encode(ge).byteLength:ge.length)),!("number"==typeof ye&&ye>C)){e.next=73;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 73:return!ce&&U&&U(),e.next=76,new Promise((function(e,n){To(e,n,{data:ge,headers:jr.from(ae.headers),status:ae.status,statusText:ae.statusText,config:t,request:x})}));case 76:return e.abrupt("return",e.sent);case 79:if(e.prev=79,e.t1=e.catch(11),U&&U(),!(M&&M.aborted&&M.reason instanceof Vr)){e.next=88;break}throw(_e=M.reason).config=t,x&&(_e.request=x),e.t1!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),_e;case 88:if(!K){e.next=91;break}throw x&&!K.request&&(K.request=x),K;case 91:if(!(e.t1 instanceof Vr)){e.next=94;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 94:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=98;break}throw be=new Vr("Network Error",Vr.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(be,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 98:throw Vr.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 99:case"end":return e.stop()}var o}),e,null,[[11,79]])})));return function(t){return e.apply(this,arguments)}}()},ai=new Map,si=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=ai;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:ii(r)),s=n;return n},li=(si(),{http:null,xhr:Fo,fetch:{get:si}});Or.forEach(li,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var ci=function(e){return"- ".concat(e)},ui=function(e){return Or.isFunction(e)||null===e||!1===e};var di={getAdapter:function(e,t){for(var n,r,o=(e=Or.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!ui(n)&&void 0===(r=li[(s=String(n)).toLowerCase()]))throw new Vr("Unknown adapter '".concat(s,"'"));if(r&&(Or.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(ci).join("\n"):" "+ci(l[0]):"as no adapter specified";throw new Vr("There is no suitable adapter to dispatch the request "+c,Vr.ERR_NOT_SUPPORT)}return r},adapters:li};function pi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ko(null,e)}function hi(e){return pi(e),e.headers=jr.from(e.headers),e.data=Eo.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),di.getAdapter(e.adapter||bo.adapter,e)(e).then((function(t){pi(e),e.response=t;try{t.data=Eo.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=jr.from(t.headers),t}),(function(t){if(!So(t)&&(pi(e),t&&t.response)){e.response=t.response;try{t.response.data=Eo.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=jr.from(t.response.headers)}return Promise.reject(t)}))}var fi={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){fi[e]=function(n){return Je(n)===e||"a"+(t<1?"n ":" ")+e}}));var mi={};fi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ei+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Vr(r(o," has been removed"+(t?" in "+t:"")),Vr.ERR_DEPRECATED);return t&&!mi[o]&&(mi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},fi.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var vi={assertOptions:function(e,t,n){if("object"!==Je(e)||null===e)throw new Vr("options must be an object",Vr.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new Vr("option "+i+" must be "+l,Vr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Vr("Unknown option "+i,Vr.ERR_BAD_OPTION)}},validators:fi},gi=vi.validators,yi=function(){function e(t){v(this,e),this.defaults=t||{},this.interceptors={request:new ao,response:new ao}}var t;return f(e,[{key:"request",value:(t=a(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=function(){if(!r.stack)return"";var e=r.stack.indexOf("\n");return-1===e?"":r.stack.slice(e+1)}();try{e.t0.stack?i&&(a=i.indexOf("\n"),s=-1===a?-1:i.indexOf("\n",a+1),l=-1===s?"":i.slice(s+1),String(e.t0.stack).endsWith(l)||(e.t0.stack+="\n"+i)):e.t0.stack=i}catch(e){}}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Bo(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&vi.assertOptions(r,{silentJSONParsing:gi.transitional(gi.boolean),forcedJSONParsing:gi.transitional(gi.boolean),clarifyTimeoutError:gi.transitional(gi.boolean),legacyInterceptorReqResOrdering:gi.transitional(gi.boolean),advertiseZstdAcceptEncoding:gi.transitional(gi.boolean),validateStatusUndefinedResolves:gi.transitional(gi.boolean)},!1),null!=o&&(Or.isFunction(o)?t.paramsSerializer={serialize:o}:vi.assertOptions(o,{encode:gi.function,serialize:gi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),vi.assertOptions(t,{baseUrl:gi.spelling("baseURL"),withXsrfToken:gi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Or.merge(i.common,i[t.method]);i&&Or.forEach(["delete","get","head","post","put","patch","query","common"],(function(e){delete i[e]})),t.headers=jr.concat(a,i);var s=[],l=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){l=l&&e.synchronous;var n=t.transitional||so;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)}}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,p=0;if(!l){var h=[hi.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,u),d=h.length,c=Promise.resolve(t);p<d;)c=c.then(h[p++],h[p++]);return c}d=s.length;for(var f=t;p<d;){var m=s[p++],v=s[p++];try{f=m(f)}catch(e){v.call(this,e);break}}try{c=hi.call(this,f)}catch(e){return Promise.reject(e)}for(p=0,d=u.length;p<d;)c=c.then(u[p++],u[p++]);return c}},{key:"getUri",value:function(e){return oo(xo((e=Bo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();Or.forEach(["delete","get","head","options"],(function(e){yi.prototype[e]=function(t,n){return this.request(Bo(n||{},{method:e,url:t,data:n&&Or.hasOwnProp(n,"data")?n.data:void 0}))}})),Or.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request(Bo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}yi.prototype[e]=t(),"query"!==e&&(yi.prototype[e+"Form"]=t(!0))}));var _i=yi,bi=function(){function e(t){if(v(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new ko(e,t,o),n(r.reason))}))}return f(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),Ei=bi;var Si={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Si).forEach((function(e){var t=tt(e,2),n=t[0],r=t[1];Si[r]=n}));var Ai=Si;var ki=function e(t){var n=new _i(t),r=Ln(_i.prototype.request,n);return Or.extend(r,_i.prototype,n,{allOwnKeys:!0}),Or.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Bo(t,n))},r}(bo);ki.Axios=_i,ki.CanceledError=ko,ki.CancelToken=Ei,ki.isCancel=So,ki.VERSION=ei,ki.toFormData=Xr,ki.AxiosError=Vr,ki.Cancel=ki.CanceledError,ki.all=function(e){return Promise.all(e)},ki.spread=function(e){return function(t){return e.apply(null,t)}},ki.isAxiosError=function(e){return Or.isObject(e)&&!0===e.isAxiosError},ki.mergeConfig=Bo,ki.AxiosHeaders=jr,ki.formToJSON=function(e){return go(Or.isHTMLForm(e)?new FormData(e):e)},ki.getAdapter=di.getAdapter,ki.HttpStatusCode=Ai,ki.default=ki;var Ti=ki,wi=Et(),Pi=wi._light_sandbox,Ii=wi.groupId,Ci=wi.requestHost,Ri={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:Ci||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:Ci||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Ni="ALIPW3SG",Oi="ANTOM_PAYMENT_WEB",Li=Ii||"GROUP_20240627151021",Di=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},Mi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:Ci||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:Ci||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=Ii||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===Pi?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},xi=".".charCodeAt(0),Ui=/\\(\\)?/g,Bi=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),Ki=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hi=/^\w*$/;function Fi(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function Yi(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Qe()(e);return"number"===n||"boolean"===n||null===e||Hi.test(e)||!Ki.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===xi&&r.push(""),n.replace(Bi,(function(e,t,n,o){var i=e;return n?i=o.replace(Ui,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function ji(e,t,n){var r=null===e?void 0:function(e,t){for(var n=Yi(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[Fi(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var zi=function(e,t){var n=ji(e,"Result-Status")||ji(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:ie.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:ie.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=ji(e,"Tips")||ji(e,"tips",""),o=ji(e,"Memo")||ji(e,"memo","");return{success:!1,traceId:t,errorCode:ie.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},Gi=Et()._sandbox;function Vi(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Mi(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Di(null==e?void 0:e.hostSign,i)||Ri[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Oi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Oi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Li),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ni),"sdk-version",w||""),e.headers);return"true"!==Gi&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Ti.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function Wi(e,t,n){return qi.apply(this,arguments)}function qi(){return qi=s()(i()().mark((function e(t,n,r){var o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=h()(h()({terminalType:yt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{a.browserInfo.browserJavaEnabled=(null===(s=navigator)||void 0===s?void 0:s.javaEnabled())||!1}catch(e){}return"WAP"===a.terminalType&&(a.osType=vt?"IOS":"ANDROID"),l=[h()(h()({},t),{},{envInfo:a,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=Vi(n),e.next=9,u({data:l});case 9:if(d=e.sent,p=d.data,f=d.headers,m=p||{},v=ji(f,"Mgw-TraceId")||ji(f,"mgw-traceid",""),m.traceId=v||"",null==(g=zi(f,v))||!g.errorCode){e.next=21;break}throw y=(null==m?void 0:m.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:v}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:v}).send(),e.abrupt("return",m);case 25:return e.prev=25,e.t0=e.catch(5),E=_t(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:ie.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),S=null!==e.t0&&void 0!==e.t0&&null!==(b=e.t0.message)&&void 0!==b&&b.includes("timeout")?ie.TIMEOUT:"",A=(null==E?void 0:E.errorCode)||S,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:A,msg:JSON.stringify((null==E?void 0:E.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:A,errorMessage:null==E?void 0:E.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),qi.apply(this,arguments)}function Ji(e,t,n){return Qi.apply(this,arguments)}function Qi(){return Qi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Wi(t,h()(h()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function Zi(){return Zi=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(k[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),Zi.apply(this,arguments)}function Xi(e,t,n){return $i.apply(this,arguments)}function $i(){return $i=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Wi(t,h()(h()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),$i.apply(this,arguments)}function ea(e,t,n,r){return ta.apply(this,arguments)}function ta(){return ta=s()(i()().mark((function e(t,n,r,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",a),e.abrupt("return",Wi(n,h()(h()({},r),{},{hostSign:a,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),ta.apply(this,arguments)}var na=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ra=function(){function e(t,n){g()(this,e),c()(this,"_applePayService",void 0),c()(this,"_parseData",void 0),c()(this,"_sessionData",void 0),c()(this,"_isFinish",!1),c()(this,"_options",void 0),c()(this,"logger",void 0),c()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:$.prod},t,{product:G.CARD_APPLE_PAY}),this._applePayService=new On(n)}return m()(e,[{key:"canMakePayments",value:function(e){return On.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:se.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var a=function(){var e=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe.publishForResult(new Ge(In.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=ea,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,a();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=Xi,e.t1=r,e.t2=o._options.environment,e.next=7,a();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(l,c,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:se.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),u);try{this._applePayService.startPay(this._parseData)}catch(e){u(se.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),oa=ra,ia=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"applePay",void 0),c()(Xe()(r),"logger",void 0),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Tn).concat(Object.values(kn))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=On.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new oa(h()(h()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&qe.publish(new Ge(Pn.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case kn.optional_init:this.onOptionalInit(e,t);break;case Tn.canMakePayments:this.onCanMakePayments(e,t);break;case Tn.createComponent:this.onCreateComponent(e,t);break;case Tn.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(We),aa=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function sa(e,t){for(var n,r=e||window.navigator.userAgent||"",o=aa,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(la(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(la(t,r,n.iosScheme),n.iosScheme):void 0;la(t,r,"")}function la(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var ca=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var ua=function(e){var t,n,r,o,i;switch(e){case G.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case G.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},da=m()((function e(){g()(this,e)}));c()(da,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var pa={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},ha={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},fa=function(){function e(){g()(this,e)}return m()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{va.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in da.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:pa.spmId},{eventAlias:pa.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:ha.spmId},{eventAlias:ha.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();c()(fa,"abnormalEventNameSet",new Set),c()(fa,"nonComplianceEventKeys",{});var ma=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;g()(this,e),c()(this,"timeoutId",void 0),c()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return m()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),va=new ma,ga={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},ya=h()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},ga),_a=function(){function e(t,n){g()(this,e),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return m()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=h()({},e),l=null==e?void 0:e.title;return ya[l]&&(s.title=ya[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:h()(h()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ya[s]&&(a.title=ya[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ya[s]&&(a.title=ya[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();c()(_a,"instance",void 0);var ba={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:null==S?void 0:S.version}},Ea=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=nn(e,{sdkVersion:w,productScene:t,mid:n});if(r)null===(o=_a.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&on(w+t,i),i):i=rn(w+t)}catch(e){return""}},Sa=function(e,t){var n,r=(n={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(n,z.NONE,[""]),z.AUTO_DEBIT_WALLET,["1.0"]),z.AUTO_DEBIT_PAY_WALLET,[""]),z.CASHIER_PAYMENT_BANK,["1.0"]),z.CASHIER_PAYMENT_CARD,["1.0"]),z.CASHIER_PAYMENT_APM,["1.0"]),z.EASY_PAY_WALLET,["1.0","2.0"]),z.EASY_PAY_APM,["2.0"]),z.VAULTING_CARD,["1.0"]),z.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(n,z.ELEMENT_ADDRESS,["1.0"]),z.CHECKOUT_PAYMENT,["1.0.0"]),z.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},Aa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=Et()||{},d=u.host,p=Ea(a,o,s,l),h=p||n;p&&(null===(e=_a.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));Rt()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var f=Sa(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===z.ELEMENT_ADDRESS)return"".concat(T[t],"/element-address/pages/address/index.html");if(et()(Object.values(j)).includes(r)){var m=!1;try{m=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return m?"".concat(T[t],"/elements/pages/express_checkout/index.html"):"".concat(T[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(A[t],"/").concat(r,"/").concat(f,"/index.html")},ka=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,f=e.hostSign,m=void 0===f?"":f,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=Aa(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),b=nn(l,{sdkVersion:w,productScene:o,mid:g})?"true":"false",E=Et(),S=E._sandbox,A=E._light_sandbox,k=E.requestHost,T=void 0===k?"":k,P=E.groupId,I=void 0===P?"":P,C=E.LOCAL_MOCK,R=E._displayType,N=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:b,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:w,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(ua(o)),isPreload:h||"",hostSign:m||""});C&&(N.LOCAL_MOCK=C),T&&(N.requestHost=T),I&&(N.groupId=I),"light_sandbox"!==a&&"true"!==A||(N.sandbox="true"),"sandbox"!==a&&"true"!==S||(N.shadow="true"),R&&(N.displayType=R);var O=ct(N);return Rt()&&(console.log("appUpgrade#getIframeUrl#appMatched",b),console.log("appUpgrade#getIframeUrl#url",_,O)),{path:_,locationSearch:O}},Ta=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},wa=15e3;function Pa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=s()(i()().mark((function e(t){var n,r,o,a,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:wa,o=new Promise((function(e,t){r=setTimeout((function(){return t(new Error("timed out"))}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return a=e.sent,e.abrupt("return",{result:a,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),!(e.t0 instanceof Error&&"timed out"===e.t0.message)){e.next=14;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 14:throw e.t0;case 15:return e.prev=15,clearTimeout(r),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,9,15,18]])}))),Ia.apply(this,arguments)}var Ca=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}(Ca||{}),Ra=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(Ra||{});function Na(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Wt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(at.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"&notRedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var Oa=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},La=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?$.prod:i,s=t.shipping,l=t.merchantAmount,u=void 0===l?null:l,d=t.merchantCurrency,p=void 0===d?null:d;g()(this,e),c()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),c()(this,"session",null),c()(this,"paymentSessionData",void 0),c()(this,"parseData",void 0),c()(this,"paymentStatus",void 0),c()(this,"cancelReason",null),c()(this,"logger",void 0),c()(this,"env",void 0),c()(this,"shipping",void 0),c()(this,"merchantAmount",void 0),c()(this,"merchantCurrency",void 0),c()(this,"onBeforeConfirm",void 0),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=u,this.merchantCurrency=p}var t,n,r,o;return m()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=Ra.PENDING,e.session.onvalidatemerchant=function(){var t=s()(i()().mark((function t(r){var o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=ea,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(a=t.sent)&&a.success&&a.merchantSessionObject?(s=JSON.parse(a.merchantSessionObject),e.session.completeMerchantValidation(s)):(null===(l=e.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=s()(i()().mark((function r(o){var a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N;return i()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:Ca.APPLE_PAY_TOKEN_ERROR})},s=null==o?void 0:o.payment,l=s.token,c=s.billingContact,u=s.shippingContact,!l){r.next=46;break}if(p={instPaymentToken:JSON.stringify(l)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,f=h.requiredBillingContactFields,m=h.requiredShippingContactFields,!Ct(f)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!Ct(m)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return e.cancelReason="USER_CANCEL",null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=13,_=Date.now(),r.next=17,Pa((function(){return e.onBeforeConfirm()}));case 17:if(b=r.sent,E=b.result,S=b.timedOut,A=E,(S||Date.now()-_>=wa)&&(null===(k=e.logger)||void 0===k||k.logError({title:"sdk_before_confirm_timeout"}),A=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:A}),A){r.next=29;break}return e.cancelReason="MERCHANT_ABORT",null===(T=e.session)||void 0===T||null===(w=T.completePayment)||void 0===w||w.call(T,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:"MERCHANT_CONFIRM_ABORT"}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(13),null===(P=e.logger)||void 0===P||P.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(I=e.session)||void 0===I||null===(C=I.completePayment)||void 0===C||C.call(I,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:"MERCHANT_CONFIRM_ABORT"}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:R=r.sent,e.setPayStatus(R),t(R),r.next=48;break;case 46:null===(N=e.logger)||void 0===N||N.logError({title:"a3753.b103030.c386485.d507486"}),a();case 48:case"end":return r.stop()}}),r,null,[[13,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===Ra.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});n({errorCode:"MERCHANT_ABORT"===e.cancelReason?"MERCHANT_CONFIRM_ABORT":Ca.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=Xi,e.t1=h()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=Ra.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==Ra.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=Ra.NORMAL,e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},a=o.recurringInfo,s=a?14:2,this.isCanMakePayments(s)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(s,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(l=this.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=Ra.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(Ct(n)||Ct(o)||Ct(null==r?void 0:r.supportedNetworks)||Ct(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return gt?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe.publishForResult(new Ge(In.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Da="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(_e,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(we,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Re,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Re,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Re,"-desktop{}\n"),Ma=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=Da,document.head.appendChild(e)},xa=function(e,t,n){var r=document.createElement("div");r.id=we,n.componentSign===z.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Re,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Re,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===ne.desktop?r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===ne.mobile&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(we);At(0,o)},Ua=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(Te,"-hidden{\nanimation: ").concat(Te,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(Te,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),Ba=function(e,t){if(!document.getElementById(_e)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Ua,document.head.appendChild(n),kt();var r=document.createElement("div");r.className="".concat(_e,"-hidden-").concat(e),r.id=_e,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=be,r.appendChild(o),r.classList.remove("".concat(_e,"-hidden-").concat(e)),r.classList.add("".concat(_e,"-").concat(e)),Ka(e,t),r}},Ka=function(e,t){var n=e===ne.mobile?"touchend":"click",r=document.getElementById(_e),o="<img class='".concat(Se,"-btn-").concat(e,"' src=\"").concat(Me,'"/>'),i=document.createElement("div");i.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),i.id=Se,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Ha=function(e){var t=(null==e?void 0:e.platform)===ne.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=Te,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===ne.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Fa="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(De,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(De,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Ya=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(Pe),n.id=Pe,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(St(),"px"),e.appendChild(n)},ja=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Pe))||void 0===e||e.remove()},za="desktop",Ga=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{za=t;var i=document.createElement("div");i.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);Ya(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var Va,Wa,qa,Ja=function(){function e(t){g()(this,e),c()(this,"app",void 0),c()(this,"AMSSDK",void 0),c()(this,"platform",void 0),c()(this,"_performanceData",[]),c()(this,"_loadAppPromiseResolve",null),c()(this,"_isInitComponent",void 0),c()(this,"_globalData",void 0),c()(this,"popupApp",void 0),c()(this,"appDomain",void 0),c()(this,"createIframeNode",void 0),c()(this,"createPreloadIframeNode",void 0),c()(this,"_selector",void 0),c()(this,"_appVersion",void 0),c()(this,"_isRetention",void 0),c()(this,"_allowSubmitPayCallAhead",void 0),c()(this,"_actionQueryPromise",null),c()(this,"_actionSubmitPromise",null),c()(this,"_renderParams",null),c()(this,"_componentSign",z.NONE),c()(this,"_appLocationSearch",void 0),c()(this,"_renderDisplayType",Y.popup),c()(this,"_multipleCallbackEvents",void 0),c()(this,"_isAppWebview",void 0),c()(this,"_isNativeAppWebview",void 0),c()(this,"_merchantAppointParam",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(be),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=yt?ne.mobile:ne.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,a;return m()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===ne.desktop?"PC":"WAP",sdkVersion:w,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;z.CASHIER_PAYMENT_APM!==this._componentSign&&(z.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(s()(i()().mark((function o(){var a,s,l,c,u;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a||null===(a=a.paymentSessionConfig)||void 0===a?void 0:a.productScene,l=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||s});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,l);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,f=this;if(this._isInitComponent)return this.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var m=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(m):"",g="".concat(_e).concat(v),y=(null==this?void 0:this._renderDisplayType)===Y.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},b=_.productSceneVersion,E=void 0===b?"":b,S=_.productScene,A=void 0===S?"":S,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,w=T.autoDebitWithToken,P=void 0!==w&&w,I=T.requireFastSdk,C=void 0!==I&&I,R=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,N=void 0===R?{}:R;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),z.EASY_PAY_WALLET!==this._componentSign||A!==G.EASY_PAY||"1.0"!==E||P||!C){if(z.AUTO_DEBIT_WALLET===this._componentSign){var O,L,D,M=(null===(O=this._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},x=bt()?null==M||null===(L=M.web)||void 0===L?void 0:L.signType:null==M||null===(D=M.wap)||void 0===D?void 0:D.signType,U=(null==M?void 0:M.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(N)}if(z.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===C&&"1.0"===E?void this.handleAuthUrlInfo(N):Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_START_OF_LOADING}),this._renderDisplayType===Y.inline){var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ce)||Ma(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,_e,g);B&&this.renderInlineLoading(t,B),(K=document.createElement("style")).innerHTML=Fa,document.head.appendChild(K)}var K;if(this._renderDisplayType===Y.popup){var H,F;Ba(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===ne.mobile?"touchend":"click",o=document.createElement("div");o.id=ke,o.classList.add("".concat(ke,"-").concat(e)),o.innerHTML='\n <span id="'.concat(ke,'-title" class="').concat(ke,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(ke,'-sub-title"\n class="').concat(ke,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(ke,"-btn-block-").concat(e,'">\n <div id="').concat(ke,'-remain" class="').concat(ke,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(ke,'-leave" class="').concat(ke,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(ke,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var j=Na(null===(H=this._renderParams)||void 0===H?void 0:H.paymentSessionMetaData,!0===(null===(F=this._renderParams)||void 0===F?void 0:F.notRedirectAfterComplete)),V=function(){};null!=j&&j.allowClickOutsideClose&&(V=this.closeBtnFunc.bind(this));var W=this.closeBtnFunc.bind(this);Ha({platform:this.platform,onClickOutside:V,closeBtnFunc:W}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return f.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),f._isInitComponent=!1,f.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(N)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===z.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&xa(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(Te);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(we),e.id=we,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(St(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:Le)})).catch((function(e){return t.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(ge.eventCallback.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=s()(i()().mark((function t(n,r){var o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,O,L,D,M,x;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},f={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a?void 0:a.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(s=e._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},m=(null===(l=e._renderParams)||void 0===l?void 0:l.paymentSessionMetaData)||{},v=m.extendInfo,g=void 0===v?"":v,y=m.action,_=!1,b=!1,E=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},S=E.skipSdkQuery,A=E.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,b=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!ca()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(z.ELEMENT_PAYMENT===e._componentSign&&(f.paymentSessionConfig={productScene:null==(i=f.paymentSessionConfig)?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion}),z.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(z.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(z.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!A){t.next=23;break}if(!Lt(A,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!S){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=Na(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(z.CASHIER_PAYMENT_CARD!==e._componentSign&&z.VAULTING_CARD!==e._componentSign){t.next=35;break}return f.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(z.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(P=f.paymentSessionConfig||{},I=P.productSceneVersion,C=void 0===I?"":I,R=P.productScene,N=void 0===R?"":R,null===(w=e._renderParams)||void 0===w||null===(w=w.paymentSessionMetaData)||void 0===w||null===(w=w.action)||void 0===w||!w.skipSdkQuery||!b){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(N!==G.EASY_PAY||"2.0"!==C){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(z.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(M=(null===(O=e._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},"SMS"!==(x=bt()?null==M||null===(L=M.web)||void 0===L?void 0:L.signType:null==M||null===(D=M.wap)||void 0===D?void 0:D.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),Ji(f,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),z.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:me.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(ge.error.name,i),e.dispatchToSDK(ge.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(z.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(ge.eventCallback.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[z.CASHIER_PAYMENT_CARD,z.VAULTING_CARD,z.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(ge.error.name,{code:me.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var i}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var a={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},l=Na(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=s()(i()().mark((function e(t){var n,r,s,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,O;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==G.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=l?!l.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||z.EASY_PAY_WALLET!==o._componentSign,z.EASY_PAY_WALLET===o._componentSign&&(h=a.paymentSessionConfig||{},f=h.productSceneVersion,m=void 0===f?"":f,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,E=(b=void 0===_?{}:_).enableSignAgreement,S=void 0!==E&&E,A=b.autoDebitWithToken,k=void 0!==A&&A,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},w=T.paymentMethodInfoView,P=(void 0===w?{}:w).paymentMethodType,I=void 0===P?"":P,g!==G.EASY_PAY||"2.0"!==m||k||(C=o._isAppWebview||!1,R=o._isNativeAppWebview||!1,a.signAgreement=S,"ALIPAY_CN"!==I||C&&R||(N=sa(void 0,o.AMSSDK.logger))&&"https"!==N&&(a.h5FromApp=encodeURIComponent(N)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),O=(null==l||null===(n=l.buildSubmitPayExtParams)||void 0===n?void 0:n.call(l,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},a.extParams=O,e.t0=Xi,e.t1=a,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===st(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(_e);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(_e,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(Te);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=Ta(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=ka({renderDisplayType:Y.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(Aa(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=ka({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),f=h.path,m=h.locationSearch;this._appLocationSearch=m,-1!==f.indexOf("?")?this.app.src="".concat(f,"&").concat(m):this.app.src="".concat(f,"?").concat(m),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(ge.error.name,Object.assign({},me.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(ge.error.name,me.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ut(e.data)){var n=JSON.parse(e.data);if(n.name!==re.APP_TO_SDK&&n.name!==re.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(me.NOT_JSON_FORMAT),this.dispatchToSDK(ge.error.name,me.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(_e).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,Ga({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,a=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),Le),s=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,ja(),clearTimeout(a),clearTimeout(s)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return a.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===ge.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===N.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===N.CONTAINER_ELEMENT&&this.dispatchToSDK(ge.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(ge).map((function(e){return ge[e].name})).includes(e.context.event))if(e.context.event!==ge.getDeviceId.name)if(e.context.event!==ge.getUserAgentFromSdk.name){if(e.context.event===ge.popWindow.name)return o=document.querySelector(".".concat(Ne,"overlay")),i="desktop"===za?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile")),o.classList.remove("".concat(Ne,"fadeIn")),o.classList.add("".concat(Ne,"fadeOut")),"desktop"===za?(i.classList.remove("".concat(Ne,"fadeIn")),i.classList.add("".concat(Ne,"fadeOut"))):(i.classList.remove("".concat(Ne,"-drawer-enter")),i.classList.add("".concat(Ne,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),De);var o,i,a,s;if(e.context.event!==ge.getGlobalData.name)if(e.context.event!==ge.setGlobalData.name)if(e.context.event!==ge.popupWindow.name){if(e.context.event===ge.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===ge.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(ge.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===ge.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===ge.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===ge.close.name)return this.closeBtnFunc();if(e.context.event===ge.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==ge.submitForm.name)if(e.context.event!==ge.hideCloseButton.name)if(e.context.event!==ge.showCloseButton.name)if(e.context.event!==ge.setMaskCloseButton.name){if(e.context.event===ge.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==ge.declareCheckoutInfo.name)if(e.context.event!==ge.declareEventCallbackInfo.name)if(e.context.event!==ge.appHeartBeat.name)if(e.context.event!==ge.beforeSubmit.name){var c,u,d;if(e.context.event===ge.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==ge.getGooglePayToken.name)if(e.context.event===ge.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===ge.closePaymentPolling.name&&this.dispatchToApp({context:{event:ge.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==ge.getApplePayToken.name)if(e.context.event!==ge.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(ge.validateFieldsResult.forwardName,e.context);else new La({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else Oa(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:h()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(ge.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(ge.beforeSubmit.name,e.context.data);var f=je();this.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:f,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var m;this.createDialog(null===(m=e.context)||void 0===m?void 0:m.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===ge.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(_e,"-").concat(c):_e,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===Y.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(_e,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(_e,"-").concat(this.platform,"-animation"));var p="".concat(_e,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var f=(v=_e,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),m=document.createElement("style");m.id=p,m.type="text/css",m.innerHTML=f,document.getElementsByTagName("head")[0].appendChild(m),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===Y.inline)null===(y=document.getElementById(we))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===oe.BLANK)return c.normalUrl?(d(le.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(le.NormalUrl,"");if(!(c.target!==oe.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(le.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(le.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var f=new Date,m="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:m}).then((function(){var e=((new Date).getTime()-f.getTime())/1e3;d(le.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-f.getTime())/1e3;p(le.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(le.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(le.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(le.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(le.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(le.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(le.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(ke,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(ke,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,f,m,v,g,y=document.getElementById("".concat(ke,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.corner,"px"),"stroke"===(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,b,E,S,A,k,T,w=document.getElementById("".concat(ke,"-leave"));w&&(w.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,w.style.fontSize="".concat(null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontSize,"px"),w.style.color=null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontColor,w.style.borderRadius="".concat(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.corner,"px"),"stroke"===(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.type)?w.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):w.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(ge.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(Se);e?null==t||t.classList.remove("".concat(Se,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Se,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:re.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:ve,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(me.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(ve,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===G.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return b=e.sent,e.next=9,this._actionSubmitPromise;case 9:E=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:b,submitResult:E,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(a=this._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(s=this._renderParams)||void 0===s?void 0:s.configParams,prefillValue:null===(l=this._renderParams)||void 0===l?void 0:l.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(f=this._renderParams)||void 0===f?void 0:f.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(m=this._renderParams)||void 0===m||null===(m=m.paymentSessionMetaData)||void 0===m?void 0:m.clientId,instanceId:null===(v=this.AMSSDK)||void 0===v?void 0:v._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(we))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(Te);null==o||o.classList.add("".concat(Te,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(_e).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(ge.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(ge.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===ne.mobile?"touchend":"click",i=document.getElementById("".concat(ke,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(ke))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(null==t||t.classList.add("".concat(_e,"-opacity")),e.classList.remove("".concat(ke,"-hidden")),e.classList.add("".concat(ke,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(ke),t=document.getElementById(_e),e&&(e.classList.remove("".concat(ke,"-show")),e.classList.add("".concat(ke,"-hidden")),setTimeout((function(){e.classList.remove("".concat(ke,"-hidden")),null==t||t.classList.remove("".concat(_e,"-opacity"))}),De))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),Qa=[{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ue.V1,paymentMethodCategoryType:V.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:Tn.canMakePayments,optional_init:kn.optional_init,createComponent:Tn.createComponent,destroyComponent:Tn.destroyComponent}},{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ue.V1,paymentMethodCategoryType:V.APM,paymentMethodTypes:[ce.PAYPAL_CHECKOUT,ce.PAYPAL_PAYLATER,ce.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:wn.mountComponent,destroyComponent:wn.destroyComponent}}],Za=function(e){return"boolean"!=typeof e||e},Xa=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"logger",void 0),c()(Xe()(r),"onEventCallback",(function(e){qe.publish(new Ge(Pn.onEventCallback,JSON.stringify(e)))})),c()(Xe()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),c()(Xe()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),c()(Xe()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&ce.PAYPAL_VAULT===i&&r.onEventCallback({code:se.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),c()(Xe()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;Za(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),c()(Xe()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,f=u.enableMessages,m=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),f?y.append("components","messages,buttons"):y.append("components","buttons"),W.intent===m&&ce.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),ce.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),c()(Xe()(r),"onShippingChange",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"createOrder",function(){var e=s()(i()().mark((function e(t,n,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ji({paymentSessionData:o,paymentSessionConfig:s},{env:a,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(l=c.extendInfo)&&void 0!==l&&l.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),c()(Xe()(r),"onApprove",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&wt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"onCancel",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&wt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"destroyComponent",function(){var e=s()(i()().mark((function e(t,n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(wn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:h()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;Za(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case wn.mountComponent:this.renderPaypalButton(e,t);break;case wn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(We),$a=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===st(t)&&(i=document.querySelector(t)),null===i){var a={code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:re.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:ge.error.name,data:a}})}n===Y.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},es=function(e){var t=document.body||null;t&&t.appendChild(e)},ts=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Pn)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===Pn.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(We),ns=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(In)}},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===In.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(We),rs=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"logger",void 0),t.logger=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Cn)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Cn.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(We),os=window.navigator.userAgent||"",is=function(){var e=os.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},as=/android/i.test(os),ss=/iphone|ipad|ipod/i.test(os),ls=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(os)&&as&&os.indexOf("Version")<0,cs=/qqbrowser/i.test(os),us=/firefox/i.test(os);/baidubrowser/i.test(os);function ds(e){window.location.href=e}function ps(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function hs(){Va||((Va=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),Va.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(Va))}function fs(e){Va.src=e}function ms(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function vs(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var gs,ys,_s,bs=5e3;function Es(e,t){gs=+new Date,ys=setTimeout((function(){!(!!Wa&&document[Wa])&&e&&e()}),t||5e3)}function Ss(e){void 0!==qa?document.addEventListener(qa,(function(){return As(e)})):window.addEventListener("pagehide",(function(){return As(e)}))}function As(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||bs;o-(gs||+new Date)<i&&n(t)}}(e),ys&&clearTimeout(ys))}function ks(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function Ts(e){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ts(e)}function ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(n),!0).forEach((function(t){Is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Is(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rs(r.key),r)}}function Rs(e){var t=function(e,t){if("object"!==Ts(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ts(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(Wa="hidden",qa="visibilitychange"):void 0!==e.mozHidden?(Wa="mozHidden",qa="mozvisibilitychange"):void 0!==e.msHidden?(Wa="msHidden",qa="msvisibilitychange"):void 0!==e.webkitHidden&&(Wa="webkitHidden",qa="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(_s||(_s={}));var Ns=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=ms(r,i),n.options.scheme=ms(t,i),ss&&is()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=ms(r,i),n.evokeLink()):t?(n.options.scheme=ms(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=Ps(Ps({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:_s.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&ks(n))throw new Error("请填写正确格式的scheme");if(o&&!ks(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&ks(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=_s.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=_s.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;ss?is()>9||cs?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!ks(l)&&(this.evokeAppBy.type=_s.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(vs(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Os=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"originOptions",void 0),c()(this,"logger",void 0),c()(this,"_eventCenter",void 0),c()(this,"_instanceId",void 0),c()(this,"_storageId",void 0),c()(this,"_appendParams",void 0),c()(this,"_componentApp",void 0),c()(this,"securitySdkMap",void 0),c()(this,"plugins",void 0),this._instanceId=je(),this.originOptions=t,this.options={},this._eventCenter=new lt,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=Tt(n);r||(Tt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new _a(ba,![$.prod,$.sandbox].includes(null==t?void 0:t.environment)),_a.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return m()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=_t(Tt(n),{});if([$.prod,$.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return Zi.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){Tt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||G.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Nt(w,i)>=0&&Nt(a,w)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&qe.isSubscribed(n)&&qe.publish(new Ge(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=d()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?G.EASY_PAY:n,o=e.scene,i=void 0===o?G.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||yn(a),l=Sn.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:fn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||yn(e.product),n=Sn.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=An.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||yn(t.product),e.next=4,Sn.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||yn(e.product),a=o.h5gateway||gn(e.region),s=Sn.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=_n(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);pn.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new bn({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){Sn.setReady(i,d),t&&t(),e(d)}),(function(e){Sn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));Sn.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){Sn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(hn(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=Et()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in $)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:yt?te.WAP:te.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===te.WAP&&(this.options.env.osType=vt?ee.IOS:gt?ee.ANDROID:ee.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||Z.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=Z.component),this.options.networkMode=(null==e?void 0:e.networkMode)||X.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in X)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=X.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==st(e.onError))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.error.name,e.onError,ge.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==st(e.onPaymentMethodSelected))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.paymentMethodSelected.name,e.onPaymentMethodSelected,ge.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==st(e.onSizeChanged))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.sizeChanged.name,e.onSizeChanged,ge.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==st(e.onLog))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.log.name,e.onLog,ge.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==st(e.onEventCallback))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.eventCallback.name,e.onEventCallback,ge.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==st(e.onClose))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.close.name,e.onClose,ge.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.beforeSubmit.name,function(){var n=s()(i()().mark((function n(r){var o,a;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=je(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:a=n.sent,t._componentApp.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:o,data:a}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),ge.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==st(e.onChange))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.onChange.name,e.onChange,ge.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===st(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===te.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new Ns(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===G.ELEMENT_ADDRESS&&(n=this._getPlugin(G.ELEMENT_ADDRESS)),n}}]),e}();function Ls(e,t){return Ds.apply(this,arguments)}function Ds(){return Ds=s()(i()().mark((function e(t,n){var r,o,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,a=void 0===o?[]:o,l=r.paymentRequestId,Array.isArray(a)){e.next=3;break}return e.abrupt("return");case 3:if(0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(a),requestId:l}),a.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,a=null;t===r.AIRWALLEX?a=It({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":l},timeOut:3},n):a=It({src:i,timeOut:3},n);o.push(a)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),Ds.apply(this,arguments)}var Ms=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):z.NONE},xs=function(e){try{return[JSON.parse(Pt(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},Us=function(e){var t=xs(e),n=nt()(t,2),r=n[0],o=n[1];return function(e){var t;bt()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===G.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},Bs=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:Y.popup},e),r=Us(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=nt()(r,2),i=o[0],a=o[1],s=Ms(i);if(et()(Object.values(j)).includes(s)&&n.renderDisplayType===Y.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===G.ELEMENT_ADDRESS&&(s=z.ELEMENT_ADDRESS),s===z.NONE)return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;Tt(hn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},Ks=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;g()(this,r),t=n.call(this,e),c()(Xe()(t),"channelType",void 0),c()(Xe()(t),"productSceneVersion",void 0),c()(Xe()(t),"timer",void 0),c()(Xe()(t),"_validateResolveMap",new Map);var o=new Ja({appVersion:e.appVersion});return o.setRender($a),o.setPreloadRender(es),t._registerPlugin(ve,o),t._componentApp=t._getPlugin(ve),t.registerBusAbility(),t}return m()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=Z.component,this.options.networkMode=this.options.networkMode||X.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===G.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===X.proxy?(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(me.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,Ls(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===z.VAULTING_CARD?z.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;qe.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==$.prod,this.logger),qe.clear(),qe.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(n)}))}}),qe.subscribe(new ts((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(ge.eventCallback.name,e)}))),qe.subscribe(new ns((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),qe.subscribe(new rs(this.logger)),qe.subscribe(new ia(this.logger)),qe.subscribe(new Xa(this.logger)),Qa.forEach((function(e){var n;null!=e&&e.busSubscriber&&qe.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&qe.publish(new Ge(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&qe.isSubscribed(i)?qe.publishForResult(new Ge(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.popup}).then((function(e){return Bs(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(ge.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&qe.isSubscribed(n))return qe.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(An.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:Y.inline,selector:t}).then((function(e){return Bs(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(ge.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&qe.isSubscribed(n))return qe.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==G.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=je();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&qe.isSubscribed(a)?qe.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=je();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:ye.name,data:{},eventCallbackId:n});var r=function(){var t=s()(i()().mark((function t(n){var r,o,a;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),a={isValid:!1},i=null==n?void 0:n.data,"object"===Qe()(i)&&null!==i&&"boolean"==typeof i.isValid&&(a=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:a.isValid?"true":"false"}),o&&(o(a),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(ge.validateFieldsResult.forwardName,r,ge.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}(Os),Hs=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=je();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&qe.isSubscribed(a)?qe.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(Ks),Fs=n(4005),Ys=n.n(Fs),js=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),zs=[{eventName:js.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:js.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],Gs=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(Te,"-hidden{\nanimation: ").concat(Te,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(Te,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),Vs=function(e,t){if(!document.getElementById(_e)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Gs,document.head.appendChild(n),kt();var r=document.createElement("div");r.className="".concat(_e,"-hidden-").concat(e),r.id=_e,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=be,r.appendChild(o),r.classList.remove("".concat(_e,"-hidden-").concat(e)),r.classList.add("".concat(_e,"-").concat(e)),Ws(e,t),o}},Ws=function(e,t){var n=e===ne.mobile?"touchend":"click",r=document.getElementById(_e),o="<img class='".concat(Se,"-btn-").concat(e,"' src=\"").concat(Me,'"/>'),i=document.createElement("div");i.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),i.id=Se,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},qs=function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(e.classList.remove("".concat(ke,"-show")),e.classList.add("".concat(ke,"-hidden")),setTimeout((function(){e.classList.remove("".concat(ke,"-hidden")),null==t||t.classList.remove("".concat(_e,"-opacity"))}),De))},Js=function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(null==t||t.classList.add("".concat(_e,"-opacity")),e.classList.remove("".concat(ke,"-hidden")),e.classList.add("".concat(ke,"-show")))},Qs=function(){var e;null===(e=document.getElementById(ke))||void 0===e||e.remove()},Zs=function(e){var t=(null==e?void 0:e.platform)===ne.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=Te,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===ne.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Xs=function(){var e=document.getElementById(Te);null==e||e.classList.add("".concat(Te,"-hidden"))},$s=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(Te);null==e||e.remove()},el="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(De,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(De,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),tl=function(){var e=document.createElement("style");e.innerHTML=el,document.head.appendChild(e)};var nl="desktop",rl=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{nl=t;var c=document.createElement("div");c.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Oe,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var f=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(f),d.addEventListener("load",(function(){u.removeChild(f)}))}u.appendChild(d);var m=document.getElementsByTagName("body")[0];m.appendChild(c),m.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},ol=function(){var e=document.querySelector(".".concat(Ne,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===nl?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile"));e.classList.remove("".concat(Ne,"fadeIn")),e.classList.add("".concat(Ne,"fadeOut")),"desktop"===nl?(t.classList.remove("".concat(Ne,"fadeIn")),t.classList.add("".concat(Ne,"fadeOut"))):(t.classList.remove("".concat(Ne,"-drawer-enter")),t.classList.add("".concat(Ne,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),De)}},il=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e}({}),al=m()((function e(){g()(this,e),c()(this,"type",void 0),c()(this,"platform",void 0),c()(this,"isRetention",void 0),c()(this,"selector",void 0),c()(this,"appearance",void 0),c()(this,"appendAliasContainerId",void 0),c()(this,"merchantAppointParam",void 0),c()(this,"iframeStyle",void 0),c()(this,"notRedirectAfterComplete",void 0),this.platform=bt()?ne.desktop:ne.mobile,this.isRetention=!0,this.type=Y.popup,this.selector=""})),sl=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function ll(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==sl.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=xs(a),l=nt()(s,1)[0],c=xs(i),u=nt()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function cl(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,u=e.locale,d=e.pageUrl,p=e.link,h=Ms(r),f=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",m=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",v=(null==r?void 0:r.extendInfo)||"",g=null==r?void 0:r.clientId,y=(o||"").split("&&")[1]||"",_=c()(c()(c()(c()(c()(c()({},B.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),B.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),B.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),B.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),B.SANDBOX,"https://checkout.antom.com"),B.PROD,"https://checkout.antom.com"),b=(null==a?void 0:a.toLocaleUpperCase())||B.DEV;p||(p="".concat(_[b]).concat(d));var E=ka({renderDisplayType:Y.inline,componentSign:h,analytics:l,productScene:m,productSceneVersion:f,environment:a,appVersion:s,extendInfo:v,locale:u,instanceId:i,hostSign:y,mid:g,elementLink:p}),S=E.path,A=E.locationSearch;return console.log("[debug] generateIframeSrc",S,A),"".concat(S,"?").concat(A)}function ul(e){return new Promise((function(t,n){var r=(yt?te.WAP:te.WEB)===te.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var dl=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},pl=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},hl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},fl=function(){function e(t){g()(this,e),c()(this,"elementContainer",void 0),c()(this,"instanceId",void 0),c()(this,"options",void 0),c()(this,"obtainDataRes",void 0),c()(this,"elementUrl",void 0),c()(this,"eventCenter",void 0),c()(this,"eventListener",{}),this._setOptions(t)}return m()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||Z.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=Z.component),n.options.networkMode=(null==e?void 0:e.networkMode)||X.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in X)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=X.proxy),t=Et()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in $)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:yt?te.WAP:te.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===te.WAP&&(n.options.env.osType=vt?ee.IOS:gt?ee.ANDROID:ee.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),ml=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===G.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:h()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return cl({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:il.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}(fl),vl=ml,gl=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return cl({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:il.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}(fl),yl=gl,_l="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(_e,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(we,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Re,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Re,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Re,"-desktop{}\n"),bl=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=_l,document.head.appendChild(e)},El=function(e,t,n){var r=document.createElement("div");r.id=we,(null==n?void 0:n.componentSign)===z.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Re,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Re,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===ne.desktop&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===ne.mobile&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(we);At(0,o)},Sl=function(){function e(){g()(this,e),c()(this,"popupUrlQuery",void 0),c()(this,"popupApp",void 0)}var t;return m()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),a=!1,e.next=11,rl({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,s=setTimeout((function(){if(!a)throw{title:"sdk_error_create_pop_up"}}),Le),l=setTimeout((function(){if(!a)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){a=!0,clearTimeout(s),clearTimeout(l)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){ol()}}]),e}(),Al=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"initMessageEvent",void 0),c()(this,"clearTimerIdMapping",{}),c()(this,"popupManager",void 0),c()(this,"eventCenter",void 0),c()(this,"logService",void 0),c()(this,"displayInfo",void 0),c()(this,"webApp",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"clientHeight",void 0),c()(this,"boundFocusResizeChange",void 0),c()(this,"customizedLoadingListener",void 0)}return m()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=Ql.getInstance(t).getService("EventCenter"),this.logService=Ql.getInstance(t).getService("Log"),this.popupManager=new Sl,Boolean(Object.keys(e).length)&&n.productScene===G.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));Ct(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===Y.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;if(document.getElementById(Ce)||bl(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(_e,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):Vs(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===Y.inline?e.selector:_e,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(_e);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(_e,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===Y.inline)El(e,t.platform);else{var n=document.getElementById(Te);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(we),e.id=we,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(St(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(_e);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(_e,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(_e,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(_e,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(ge.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(ge.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(ge.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(ge.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(ge.sizeChanged.name,(function(t){e.handleSizeChanged(h()({},t))})),this.eventCenter.listen(ge.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(ge.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(ge.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(ge.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(ge.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(ge.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(_e,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):_e;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===Y.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(_e,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(_e,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===Y.inline)null===(l=document.getElementById(we))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(_e,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):_e;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(Se);e?null==t||t.classList.remove("".concat(Se,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Se,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(Se),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Ae);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(Se,"-light")),null==r||r.classList.add("".concat(Ae,"-light"))):(null==n||n.setAttribute("src",Me),null==t||t.classList.remove("".concat(Se,"-light")),null==r||r.classList.remove("".concat(Ae,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(tl(),this.popupManager.popup(h()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:ge.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),kl=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=Tl,this.debug=![$.prod,$.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Qt("AMSSDK_STORAGE_ID");r||Zt("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:bt()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?fa.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=h()({},t),c=null==t?void 0:t.title;return ya[c]&&(l.title=ya[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:h()(h()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),Tl={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},wl=function(e){return new URL(e.src).origin},Pl=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"iframes",void 0),c()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return m()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(ge.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(ge.beforeSubmit.name,(function(e){if(r.isExist(ge.beforeSubmit.name))r.emit(ge.beforeSubmit.name,e);else{var t=je();r.dispatchToApp({event:ge.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(ge.sendBroadcast.name,(function(e){r.dispatchToApp({event:ge.receiveBroadcast.name,data:e})})),r.listen(ge.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:ge.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(ge.submitForm.name),e.unlisten(ge.beforeSubmit.name),e.unlisten(ge.sendBroadcast.name),e.unlisten(ge.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:wl(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===wl(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ut(e.data)){var n=JSON.parse(e.data);if(n.context.event&&n.context.event,!this.checkEventCompliant(n))return;this._handleAppMessage(n)}else console.error(me.NOT_JSON_FORMAT)}},{key:"checkEventCompliant",value:function(e){if(e.name!==re.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=je()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:re.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(h()(h()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),Il=function(){function e(){g()(this,e),c()(this,"sandboxFlag",void 0),c()(this,"instanceId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){var r=Et()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[h()(h()({},t),{},{envInfo:r,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],a=Date.now(),s="",e.prev=4,l=this.createRequestInstance(n),e.next=8,l({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},s=ji(d,"Mgw-TraceId")||ji(d,"mgw-traceid",""),p.traceId=s||"",null==(f=zi(d,s))||!f.errorCode){e.next=20;break}throw m=(null==p?void 0:p.errorMessage)||(null==f?void 0:f.errorMessage),v=null==f?void 0:f.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:v,errorMessage:m,traceId:s}),new Error(JSON.stringify({errorMessage:m,errorCode:v,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!0,code:"SUCCESS",errorMessage:"",traceId:s}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=_t(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:ie.SYSTEM,traceId:s,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?ie.TIMEOUT:"",b=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:b,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:b,traceId:s,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=h()(h()({terminalType:yt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=vt?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){Ql.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Mi(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Di(null==e?void 0:e.hostSign,i)||Ri[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Oi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Oi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Li),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ni),"sdk-version",w||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Ti.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),Cl=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),Rl={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},Nl=c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),Ol=function(e){return Nl[e]||""},Ll=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},Dl=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||Rl[Cl.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=pn.getInstance(),n=Ll(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return pn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(Nl).includes(this.scene)||!Object.values(Rl).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o),console.log("initToken result tokenResult",JSON.stringify(r),o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Ml=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"productScene",G.EASY_PAY),c()(this,"environment",void 0)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.logger=Ql.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(a=s()(i()().mark((function e(){var t,n,r=this,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(s()(i()().mark((function o(){var a,s,l,c;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=Date.now(),s=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:s});case 4:if(l=o.sent,c="",!l){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,l.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,l.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,a);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"preInitSecurity",value:(o=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l=this,c=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!Sn.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!Sn.isLoading(o)){e.next=19;break}if(!(a=Sn.get(o))||"loading"!==a.status){e.next=19;break}return e.prev=9,e.next=12,a.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),s=Ll(this.environment),pn.getInstance().scheduleLoad({environment:s,callbacks:{onLoad:function(e){l.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){l.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:l.productScene}).send()},onLoadTimeout:function(){l.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:l.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){l.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:l.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),l._newSecuritySDKByScene({product:l.productScene,region:t?Cl.SG:void 0},(function(){l.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:l.productScene}:void 0).send(),e()}),(function(e){l.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:l.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||Ol(e)}},{key:"_getSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",Sn.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||Ol(e.product),a=o.h5gateway||(r=e.region,Rl[r]||Rl[Cl.SG]),s=Sn.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new Dl({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){Sn.setReady(i,l),t&&t(),e(l)}),(function(e){Sn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));Sn.setLoading(i,c)}catch(e){Sn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),xl=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ul=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Bl=m()((function e(){g()(this,e)})),Kl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g()(this,e),c()(this,"isDebug",!0),c()(this,"instanceId",void 0),c()(this,"logger",void 0),this.instanceId=t,this.logger=Ql.getInstance(this.instanceId).getService("Log")}return m()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(xl.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(xl.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(xl.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new Ul((function(e){r.traceLog(xl.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(xl.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=d()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(xl.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,p=d()(e.interceptors);try{for(p.s();!(u=p.n()).done;){var h=u.value;null==h||h.onPublishException(t,n)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var f,m=!1,v=d()(e.interceptors);try{for(v.s();!(f=v.n()).done;){var g=f.value;m=m||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}m?this.publish(t,n):this.traceError(xl.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(xl.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(xl.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(xl.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=d()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(xl.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();c()(Kl,"interceptors",[]),c()(Kl,"subscribersMap",new Map),c()(Kl,"TAG","BusManager"),c()(Kl,"_logSplit"," , ");var Hl=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),Fl=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),Yl=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),jl=function(e){return e.reportAnalytics="reportAnalytics",e}({});Hl=function(e){return e.onDestory="httpRequest",e}(Hl||{});var zl=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"instanceId",void 0),c()(Xe()(t),"logger",void 0),t.instanceId=e,t.logger=Ql.getInstance(t.instanceId).getService("Log"),t}return m()(r,[{key:"actionNames",value:function(){return Object.values(jl)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===jl.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Bl),Gl=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t;return g()(this,a),t=o.call(this),c()(Xe()(t),"instanceId",void 0),t.instanceId=e,t}return m()(a,[{key:"actionNames",value:function(){return Object.values(Yl)}},{key:"preInitSecurity",value:(r=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Ql.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Ql.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Ql.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Yl.preInitSecurity:this.preInitSecurity(e,t);case Yl.initSecurity:this.initSecurity(e,t);case Yl.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),a}(Bl),Vl=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"instanceId",void 0),r.instanceId=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Fl)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=Ql.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){Ql.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),Ql.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Fl.getGlobalData:this.getGlobalData(e,t);break;case Fl.setGlobalData:this.setGlobalData(e,t);break;case Fl.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Bl),Wl=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"instanceId",void 0),t.instanceId=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Hl)}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Ql.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Ql.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Hl.request:this.request(e,t);break;case Hl.getEnvInfo:this.getEnvInfo(e,t);break;case Hl.getUserAgent:this.getUserAgent(e,t)}}}]),r}(Bl),ql=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"instanceId",void 0),c()(this,"busManager",void 0)}return m()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=Ql.getInstance(this.instanceId).getService("Log"),this.busManager=new Kl(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==$.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new Gl(this.instanceId)),this.busManager.subscribe(new zl(this.instanceId)),this.busManager.subscribe(new Vl(this.instanceId)),this.busManager.subscribe(new Wl(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),Jl=function(){function e(){g()(this,e),c()(this,"globalData",new Map)}return m()(e,[{key:"init",value:function(e,t){var n=this,r=Ql.getInstance(t).getService("EventCenter");r.listen(ge.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(ge.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),Ql=function(){function e(t){g()(this,e),c()(this,"instanceId",void 0),c()(this,"services",{Log:new kl,ApiBusManager:new ql,Requester:new Il,Container:new Al,Security:new Ml,EventCenter:new Pl,GlobalData:new Jl}),c()(this,"extendServices",{}),this.instanceId=t}return m()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();c()(Ql,"ProvidersMapping",{});var Zl,Xl={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!0,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"https://www.baidu.com",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},$l={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},ec={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},tc={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]},nc=new _a(ba,!0),rc=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},oc=function(e){_()(o,e);var t,n,r=E()(o);function o(){var e;g()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),c()(Xe()(e),"ApplePayService",void 0),c()(Xe()(e),"_onBeforeConfirm",null),c()(Xe()(e),"_merchantAmount",null),c()(Xe()(e),"_merchantCurrency",null),e}return m()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a=this.elementContainer.getPaymentContext();this.getLogger().logInfo({title:"sdk_event_renderComponent"}),this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==a?void 0:a.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(n=this.elementContainer)||void 0===n?void 0:n.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionId,merchantId:null===(o=this.elementContainer)||void 0===o||null===(o=o.getPaymentContext())||void 0===o||null===(o=o.paymentSessionObj)||void 0===o?void 0:o.clientId,paymentMethodType:null===(i=this.elementContainer)||void 0===i||null===(i=i.getPaymentContext())||void 0===i||null===(i=i.paymentSessionObj)||void 0===i||null===(i=i.paymentMethodInfoView)||void 0===i?void 0:i.paymentMethodType},appearance:null==a?void 0:a.displayInfo.appearance,sessionResult:null==a?void 0:a.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return Ql.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(ge.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(ge.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:ge.closePaymentPolling.name,data:t})})),this.eventCenter.listen(ge.getGooglePayToken.name,(function(t,n){Oa(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:h()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(ge.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new La({paymentSessionData:i,parseData:o,logger:nc,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(ge.beforeConfirm.name,s()(i()().mark((function t(){var n,r,o,a,s,l;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return nc.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return nc.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,Pa((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,a=o.result,s=o.timedOut,l=a,(s||Date.now()-r>=wa)&&(nc.logError({title:"sdk_before_confirm_timeout"}),l=!1),nc.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:l}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!0,result:!!l}}),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(6),nc.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!1,result:!1}});case 23:case"end":return t.stop()}}),t,null,[[6,19]])}))))}},{key:"initApplePaySdk",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new La({paymentSessionData:o,parseData:r,logger:nc,env:this.options.env.environment}),e.prev=3,nc.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:nc.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),nc.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options,l=s.env.environment,c=s.analytics,u=s.locale,d=(i||{}).extendInfo,p=cl({paymentSession:o,paymentSessionObj:i,environment:l,analytics:c,locale:u,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:rc(d)?il.EXPRESS_CHECKOUT:il.ELEMENT_PAYMENT,instanceId:n});return this.setElementUrl(p),p}},{key:"obtainData",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ql.getInstance(this.instanceId).getService("Requester"),r=this.elementContainer.getPaymentContext(),o=r.paymentSession,a=r.paymentSessionObj,s=r.displayInfo,l=s.debugProps,c=this.options,u=c.env.environment,d=c.locale,p=(a||{}).paymentSessionConfig,h=o.split("&&")[1]||"",f=null==a||null===(t=a.connectFactor)||void 0===t?void 0:t.enableConnect,m=(null==l?void 0:l.isDebug)&&(null==l?void 0:l.local_mock),v=Et(this.getElementUrl()),g=v.appType,y=dl()?"WEB":g?"APP":pl()?"WEB":"WAP",_=function(){return new Promise((function(e,t){var r;if(m)setTimeout((function(){e(Xl)}),100);else{T.getLogger().logInfo({title:"sdk_action_query_start"},{config:hl(p)});var i={paymentSessionConfig:p,paymentSessionData:o,extParams:{isUserPreferredLocale:!0}};null!=s&&null!==(r=s.merchantAppointParam)&&void 0!==r&&r.storedCard&&(i.merchantAppointParam=s.merchantAppointParam),Object.prototype.hasOwnProperty.call(s,"notRedirectAfterComplete")&&(i.notRedirectAfterComplete=s.notRedirectAfterComplete),n.request(i,{env:u,envInfo:{locale:d,terminalType:y},hostSign:h,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?T.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:hl(p),rpcTraceId:null==t?void 0:t.traceId}):T.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:hl(p),errorMessage:hl((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),T.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:hl(p),errorMessage:hl(e)})}))}}))},b=function(){return new Promise((function(e,t){m?setTimeout((function(){e($l)}),100):n.request({paymentSessionConfig:p,paymentSessionData:o,accountInfo:{email:""}},{env:u,envInfo:{locale:d,terminalType:y},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=15,Promise.all(f?[_(),b()]:[_()]);case 15:return E=e.sent,S=nt()(E,2),A=S[0],k=S[1],this.obtainDataRes={originActionQueryResult:A,originOneAccountQueryResult:k},e.abrupt("return",{originActionQueryResult:A,originOneAccountQueryResult:k});case 21:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}(fl),ic=oc;function sc(){try{var e=Qt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=je(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return Zt("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function lc(e){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lc(e)}function cc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cc(Object(n),!0).forEach((function(t){dc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dc(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hc(r.key),r)}}function hc(e){var t=function(e,t){if("object"!==lc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==lc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===lc(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(Zl||(Zl={}));var fc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=uc(uc({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:Zl.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&ks(o)?(this.options.link=ms(o,i),this.handleLink()):n&&!ks(n)?(this.options.scheme=ms(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=Zl.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;ss?is()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=Zl.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(vs(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=Zl.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(ss?this.handleIOSScheme():ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;is()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(vs(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&pc(t.prototype,n),r&&pc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),mc=fc,vc=function(e,t){var n=Ql.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},h()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new mc({successCb:function(){gc(e,le.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){yc(e,le.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===oe.BLANK)return e.url?(gc(e,le.NormalUrl,e.url,n),void window.open(e.url)):yc(e,le.NormalUrl,"",n);if(!(e.browserLinkTarget!==oe.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?(gc(e,le.NormalUrl,e.url,n),void window.location.replace(e.url)):yc(e,le.NormalUrl,"",n);if(bt())return e.url?(gc(e,le.NormalUrl,e.url,n),void(window.location.href=e.url)):yc(e,le.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?(gc(e,le.NormalUrl,e.url,n),void(window.location.href=e.url)):yc(e,le.NormalUrl,"",n);var o=new mc({successCb:function(t){var r="Scheme"==t.type?le.SchemeUrl:le.ApplinkUrl;gc(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(yc(e,le.SchemeUrl,e.schemeUrl,n),!e.url)return yc(e,le.NormalUrl,"",n);gc(e,le.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(yc(e,le.SchemeUrl,e.schemeUrl,n),!e.url)return yc(e,le.NormalUrl,"",n);gc(e,le.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){yc(e,le.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){yc(e,le.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},gc=function(e,t,n,r){r.getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},yc=function(e,t,n,r){r.getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},_c=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function bc(e,t){for(var n,r=e||window.navigator.userAgent||"",o=_c,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(Ec(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(Ec(t,r,n.iosScheme),n.iosScheme):void 0;Ec(t,r,"")}function Ec(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var Sc=function(){function e(){g()(this,e),c()(this,"bizFlowStartBehavior",void 0),c()(this,"initOptions",void 0),c()(this,"paymentContext",void 0),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"productProcessors",{}),c()(this,"enablePopWindowEventCallback",!1),c()(this,"eventLogging",void 0),c()(this,"status",sl.UNINIT),c()(this,"logger",void 0),this.status=sl.INITING}var t;return m()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=an(e),n=t.id,r=t.data;this.paymentContext=h()(h()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=je(),this.sdkMetaData={webAppVersion:"",greyscaleId:sc(),productScene:t,sdkVersion:w},this.sdkMetaData.webAppVersion=sn(this.sdkMetaData),Ql.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=Ql.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=Ql.getInstance(this.instanceId).getService("EventCenter");r.listen(ge.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};vc(a,n.instanceId),i&&n.cleanRender()}})),r.listen(ge.initSecuritySDK.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=Ql.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,s.initSecurity();case 4:l=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),l=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{success:l}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.getDeviceId.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=Ql.getInstance(n.instanceId).getService("Security"),e.next=3,s.getDeviceId(t);case 3:l=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{deviceId:l}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.getSdkVersion.name,function(){var e=s()(i()().mark((function e(n,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.destroy.name,(function(e){n.setStatus(sl.READY),n.destroy()})),r.listen(ge.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(ge.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(ge.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(ge.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(ge.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(sl.IN_BIZ_FLOW),a=t.paymentSession,s=t.displayInfo,l=an(a),c=l.id,u=l.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:a,paymentSessionId:c,paymentSessionObj:u,displayInfo:h()(h()({},new al),s),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Bt(this.paymentContext.paymentSessionObj.extendInfo),f=sn(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=f,Ql.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),i=this.sdkMetaData,Zt("Antom_".concat(i.sdkVersion+i.productScene,"_LastAppVersion"),""),m=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,v=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(m,"|").concat(v)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(m,"|").concat(v)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(m)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(m)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=Ql.getInstance(this.instanceId).getService("EventCenter"),b={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(ge.eventCallback.name,{code:se.SDK_REDIRECT,result:{redirectUrls:b}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((E=new URL(y.url)).searchParams.set("source","embedded"),y.url=E.toString()),vc(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var i}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return Ql.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=Ql.getInstance(this.instanceId).getService("EventCenter"),n=Ql.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==Y.inline&&(e.paymentContext.displayInfo.isRetention?Js():e.handleClose(t,"behavior"))};t.listen(ge.close.name,(function(){a(!0)})),t.listen(ge.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(ge.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(ke,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(ke,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,f,m,v=document.getElementById("".concat(ke,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg):v.style.backgroundColor=null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg);var g,y,_,b,E,S,A,k=document.getElementById("".concat(ke,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.corner,"px"),"stroke"===(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.type)?k.style.border="1px solid ".concat(null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg):k.style.backgroundColor=null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===Y.inline?(n.showLoading(s,this.paymentContext.displayInfo),void tl()):r==Y.popup?(function(e,t,n){var r=e===ne.mobile?"touchend":"click",o=document.createElement("div");o.id=ke,o.classList.add("".concat(ke,"-").concat(e)),o.innerHTML='\n <span id="'.concat(ke,'-title" class="').concat(ke,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(ke,'-sub-title"\n class="').concat(ke,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(ke,"-btn-block-").concat(e,'">\n <div id="').concat(ke,'-remain" class="').concat(ke,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(ke,'-leave" class="').concat(ke,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(ke,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){qs(),e.handleRemain()}),(function(){qs(),e.handleClose(!1,"retention")})),Zs({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:fe.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=Ql.getInstance(this.instanceId).getService("EventCenter");if(n.emit(ge.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?fe.OnlyClose:fe.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(ge.eventCallback.name,{code:se.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=Ql.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),$s(),Qs()};null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(we))||void 0===t||t.remove(),o.startHideAnim(),Xs(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),Ac=function(){function e(){g()(this,e)}return m()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),kc=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),Tc=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;g()(this,e),c()(this,"containerStatus",void 0),c()(this,"instanceId",void 0),c()(this,"containerService",void 0),c()(this,"eventService",void 0),c()(this,"containerElement",void 0),c()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(kc.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=Ql.getInstance(this.instanceId).getService("Container"),Ql.getInstance(this.instanceId).init({},{productScene:G.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var u=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:Y.inline,platform:dl()||pl()?ne.desktop:ne.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Oe}},s.generateIframeSrc({link:u,instanceId:this.instanceId})),this.eventService=Ql.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return m()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(ge.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(ge.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),wc=function(){function e(t){var n=t.instanceId;g()(this,e),c()(this,"containerServices",void 0),c()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return m()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new Tc({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),Pc=function(){function e(t){var n=t.logger;g()(this,e),c()(this,"activeEvents",new Map),c()(this,"heartbeatIntervalId",null),c()(this,"HEARTBEAT_INTERVAL",5e3),c()(this,"uniqueId",0),c()(this,"logger",void 0),this.logger=n}return m()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==st(t)&&this.sendLog("data_error",{msg:hl(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=nt()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:hl(e)})}},{key:"sendLog",value:function(e,t){var n=c()(c()(c()(c()(c()(c()(c()(c()(c()(c()({},"".concat(H.MOUNT,"_start"),"sdk_event_mount"),"".concat(H.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(H.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(H.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(H.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(H.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(H.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(H.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},h()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),Ic=["type"],Cc=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"elementContainer",void 0),c()(this,"serviceMap",void 0),c()(this,"loading",void 0),c()(this,"elementProcessors",void 0),c()(this,"initTimeout",void 0),c()(this,"elementContainerService",void 0),c()(this,"onStatusChangeCallback",void 0),c()(this,"submitPayPromise",void 0),c()(this,"elementEventCenter",void 0),c()(this,"currentPaymentMethodType",""),c()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:R.VALIDATE,data:{params:{},target:t,source:N.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),c()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:R.SUBMIT_PAY,data:{params:h()(h()({},n),{},{doMain:window.location.hostname}),target:t,source:N.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new Sc,this.elementContainer.registerProcessor(G.ELEMENT_PAYMENT,"",new Ac),this.elementContainer.init(this.options,G.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new wc({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(sl.READY),this.elementEventCenter=new Pc({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return m()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new yl(this.options),address:new vl(this.options),payment:new ic(this.options)};this.elementProcessors=h()(h()({},this.elementProcessors),{},c()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:hl(r||""),eventMessage:hl(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(sl.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:U.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:me.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var r=this.elementContainerService.getContainerService(e).getInstanceId(),o=this.elementContainer.getPaymentContext();Ql.getInstance(r).update(o),this.serviceMap.Log=Ql.getInstance(r).getService("Log"),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:h()(h()({},me.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:U.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=an(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(H.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===sl.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:me.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===sl.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:me.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:me.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:hl(e)}),r(h()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:h()(h()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(sl.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=s()(i()().mark((function e(){var t,n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(H.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[O.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT);case 7:return a=e.sent,n=null!==(o=a.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b,E=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(H.SUBMITPAYMENT),this.elementContainer.getStatus()===sl.IN_BIZ_FLOW){e.next=6;break}return r={error:h()(h()({},me.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:L.FAIL},o={eventCode:L.FAIL,errorName:me.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:hl(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),a="APPLEPAY"===this.currentPaymentMethodType,l=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||a){e.next=34;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.prev=11,c=Date.now(),e.next=15,Pa((function(){return t.onBeforeConfirm()}));case 15:if(u=e.sent,d=u.result,!((p=u.timedOut)||!d||Date.now()-c>=wa)){e.next=23;break}return p?this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:l,path:"nonApplePay_sync"}):this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:L.FAIL,errorName:"MERCHANT_CONFIRM_ABORT"}),e.abrupt("return",{status:L.FAIL,error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 23:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.next=32;break;case 26:return e.prev=26,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:l,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:L.FAIL,errorName:"MERCHANT_CONFIRM_ABORT"}),e.abrupt("return",{status:L.FAIL,error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 32:e.next=35;break;case 34:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:l,path:a?"applePay_eventBridge":"nonApplePay_sync"});case 35:return f=null,e.prev=36,e.next=39,new Promise(function(){var e=s()(i()().mark((function e(n){var r,o,l,c,u,d,p,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[O.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(f=e)},r=E,e.prev=2,E.submitPayPromise=o,l={},c=function(){var e=s()(i()().mark((function e(t,n){var r,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,E.onValidateAndSubmitPay(E.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,a=r.data,l.shipping=null==a?void 0:a.data,null!=a&&a.success){e.next=11;break}return o(f=a),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,c(O.auth,N.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,c(O.address,N.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!E.elementProcessors[O.payment]){e.next=28;break}return u=a&&!(null==t||!t.onBeforeConfirm),E.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:hl({hasBeforeConfirmForApplePay:u,isApplePay:a})}),E.elementProcessors[O.payment].setOnBeforeConfirm(u?t.onBeforeConfirm:null),d=!(null==t||!t.amount),p=!(null==t||!t.currency),!d&&!p||d&&p||E.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:hl({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),E.elementProcessors[O.payment].setMerchantAmountOverride(d&&p?t.amount:null,d&&p?t.currency:null),e.next=24,E.onValidateAndSubmitPay(E.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT,(_=void 0,h()(h()(h()({},l),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&p?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:u})));case 24:m=e.sent,v=m.data,o(f=v);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:h()(h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:L.FAIL},E.serviceMap.Log.logError({title:ga.sdk_element_missKeyData},{msg:JSON.stringify(y)}),f=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 39:return e.abrupt("return",e.sent);case 40:return e.prev=40,b={eventCode:null===(m=f)||void 0===m?void 0:m.status,errorName:null===(v=f)||void 0===v||null===(v=v.error)||void 0===v?void 0:v.code,errormessage:null===(g=f)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.message,needChangeSessionForRetry:null===(y=f)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.needChangeSessionForRetry,rpcTraceId:null===(_=f)||void 0===_||null===(_=_.error)||void 0===_?void 0:_.traceId,msg:hl(f)},this.elementEventCenter.endEvent(n,b),this.changeLoading(!1),e.finish(40);case 45:case"end":return e.stop()}}),e,this,[[11,26],[36,,40,45]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(R.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(ge.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(kc.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ge.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===oe.BLANK)return a.normalUrl?(s(le.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(le.NormalUrl,"");if(!(a.target!==oe.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(le.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(le.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;ul({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(le.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(le.SchemeUrl,a.schemeUrl,e)}))}else ul({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(le.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(le.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(ge.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(sl.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(ge.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(kc.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ge.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=h()(h()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(ge.messageForward.name,(function(e){var n=D[e.source],r=D[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(ge.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(F.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=Ys()(t,Ic),e.prev=1,a=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:me.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([a.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:s=e.sent,(l=nt()(s,2))[0],c=l[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==a||a.switchContainerStatus(kc.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:h()(h()({},me.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,f=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&f&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||me.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED)),xe[o])a={code:xe[o].code,message:(null===(t=xe[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:ga.sdk_element_missKeyData},{rpcTraceId:r});return{error:h()(h()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,f;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return et()(e.values()).every((function(e){return e.getContainerStatus()===kc.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[O.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===G.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:U.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=h()(h()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(r){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ll({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(O.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[O.payment].obtainData();case 6:a=e.sent,s=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:s?ec:a.originActionQueryResult,originOneAccountQueryResult:s?tc:a.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(ge.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),$s(),Qs();try{ol()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(H.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(sl.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=an(this.options.sessionData).data,r="true"===(null===(t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}}(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout),o=r?js.EXPRESS_CHECKOUT:js.ELEMENT_PAYMENT,i=zs.find((function(e){return e.eventName===o}));return void 0!==i&&i.supportedEvents.includes(e)}}]),e}(),Rc=Cc,Nc=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:U.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new K(n.errors);this.options=function(e){var t=e.environment;return h()(h()({},e),{},{environment:(t||B.PROD).toLocaleLowerCase()})}(t),this.controller=new Rc(t)}var t;return m()(e,[{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(h()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),Oc={message:"sdk no need to make query request",success:!0},Lc=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"eventCenter",void 0),c()(this,"securityService",void 0),c()(this,"instanceId",void 0),c()(this,"componentSign",void 0),c()(this,"hostSign",void 0),c()(this,"_performanceData",[]),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Ql.getInstance(this.instanceId).getService("Log"),this.eventCenter=Ql.getInstance(this.instanceId).getService("EventCenter"),this.securityService=Ql.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=Ms(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,a=r.authUrlInfo,s=void 0===a?{}:a,this.componentSign!==z.AUTO_DEBIT_WALLET){e.next=9;break}if(u=bt()?null==o||null===(l=o.web)||void 0===l?void 0:l.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(s));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===z.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Ql.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,a=this.initConfig,s=a.environment,l=a.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==z.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(f=bt()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(Oc));case 9:if(f&&"REDIRECT"===f){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!ca()){e.next=13;break}return e.abrupt("return",Promise.resolve(Oc));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),m={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=m,e.t2=s,e.t3=l,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:ge.error.name,data:me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),Le);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=nt()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(ge.destroy.name,{}),e.eventCenter.emit(ge.eventCallback.name,{code:se.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Mt({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===ne.desktop&&(null===(t=document.getElementById(be))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(_e))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===z.AUTO_DEBIT_APM}}]),e}();function Dc(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Wt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(at.SDK)+"&"+"&notRedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var Mc=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"securityService",void 0),c()(this,"eventCenter",void 0),c()(this,"instanceId",void 0),c()(this,"hostSign",void 0),c()(this,"allowQueryCall",void 0),c()(this,"allowSubmitPayCallAhead",void 0),c()(this,"channelBehavior",void 0),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),c()(this,"SDK_REQUEST_TIMEOUT",15e3),c()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Ql.getInstance(this.instanceId).getService("Log"),this.securityService=Ql.getInstance(this.instanceId).getService("Security"),this.eventCenter=Ql.getInstance(this.instanceId).getService("EventCenter"),An.preloadWebApp(G.EASY_PAY,V.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(bt()&&"BANKTRANSFER_QUICKPAY"!==(null===(a=t.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",s=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,l=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=Dc(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},Jt.savePreviousProductInfo(G.EASY_PAY,{paymentMethodCategoryType:l,hostSign:this.hostSign,productSceneVersion:s}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Mt({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:Y.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=nt()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),f={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:Wt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(f.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:f}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(ge.destroy.name,{}),e.eventCenter.emit(ge.eventCallback.name,{code:se.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(a=this.paymentContext)||void 0===a?void 0:a.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(s=this.paymentContext)&&void 0!==s&&null!==(s=s.paymentSessionObj.action)&&void 0!==s&&s.autoDebitWithToken),p=!0;try{f=JSON.parse(c),p=Ct(f.needQueryRender)||!0===f.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return m=je(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m}),v=Ql.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=v,e.t1=h()(h()({},l),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(l.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:m,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,f=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},m=f.action,g=(v=void 0===m?{}:m).enableSignAgreement,y=void 0!==g&&g,_=v.autoDebitWithToken,b=void 0!==_&&_,"2.0"!==p||b||(c.signAgreement=y,S=null===(E=this.paymentContext.paymentSessionObj)||void 0===E||null===(E=E.paymentMethodInfoView)||void 0===E?void 0:E.paymentMethodType,A=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==S||A&&k||(T=bc(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return w=je(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w}),P=(null===(o=this.channelBehavior)||void 0===o||null===(a=o.buildSubmitPayExtParams)||void 0===a?void 0:a.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(s=this.paymentContext.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(l=this.paymentContext)||void 0===l||null===(l=l.startBizFlowOptions)||void 0===l||null===(l=l.submitPayRequestExtra)||void 0===l?void 0:l.notRedirectAfterComplete)}))||{},b||(P.complianceSDK=!0),c.extParams=P,I=Ql.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=I,e.t1=h()(h()({},c),{},{integrationType:"SDK",sdkVersion:null!==(C=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==C?C:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return R=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w,rpcTraceId:R.traceId}),e.abrupt("return",R);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:w,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ql.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(a=null===(s=this.paymentContext.paymentSessionObj.action)||void 0===s?void 0:s.userSignAgreement)&&void 0!==a&&a,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===l?h=!1:"2.0"===l&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?he.NEED:he.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var xc="https://dev.page.alipay.net",Uc="https://test.page.alipay.net",Bc="https://pre.ac.alipay.com",Kc="https://checkout.antom.com",Hc="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",Fc=function(){function e(t){var n=this;g()(this,e),c()(this,"logger",void 0),c()(this,"_instanceId",void 0),c()(this,"iframe",void 0),c()(this,"originOptions",void 0),c()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),c()(this,"eventListener",void 0),c()(this,"generateIframeSrc",(function(e){var t=n.originOptions.environment||"prod",r=e||"",o=n.originOptions.locale||"en_US",i=function(e){switch(e){case"dev":return"".concat(xc).concat(Hc);case"sit":return"".concat(Uc).concat(Hc);case"pre":return"".concat(Bc).concat(Hc);case"prod":case"sandbox":case"light_sandbox":return"".concat(Kc).concat("/checkout-page/pages/payment/index.html");default:return e}}(t);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,t,r,o,i);var a=i.split("?")[0],s=Et(i);return s.sessionData=r,s.lang=o,s.mode="embed","sandbox"===t&&(s.shadow="true"),Object.keys(s).forEach((function(e){a+="".concat(a.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(s[e]))})),a})),c()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,f=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:f}).send();var m=h()(h()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(m)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(yt?te.WAP:te.WEB)===te.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=h()(h()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),c()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),c()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),c()(this,"dispatchToApp",(function(e){var t,r={name:re.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||$.prod,this._instanceId=je(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new _a(ba,![$.prod,$.sandbox].includes(null==t?void 0:t.environment)),_a.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return m()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),Yc=new _a(ba,!0),jc=function(e){_()(n,e);var t=E()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return g()(this,n),(o=t.call(this,h()({appVersion:P},e))).preloadComponent(r,i),o}return m()(n)}(Ks),zc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.AUTO_DEBIT_PAY});return t.call(this,r,[z.AUTO_DEBIT_PAY_WALLET])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.AUTO_DEBIT_PAY,V.WALLET,e.environment),An.preloadSecuritySDK(G.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}(jc),Gc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r,o=Object.assign({},e,{product:G.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[z.CASHIER_PAYMENT_CARD,z.CASHIER_PAYMENT_APM,z.CASHIER_PAYMENT_BANK].includes(s)?[s]:[z.CASHIER_PAYMENT_CARD,z.CASHIER_PAYMENT_APM]}catch(e){Yc.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return m()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=z.CASHIER_PAYMENT_CARD===a?[V.CARD]:z.CASHIER_PAYMENT_APM===a?[V.APM]:z.CASHIER_PAYMENT_BANK===a?[V.BANK]:[V.CARD,V.APM];var s,l=d()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;An.preloadWebApp(G.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}An.preloadSecuritySDK(G.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}(jc),Vc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[z.CASHIER_PAYMENT_CARD])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.CASHIER_PAYMENT,V.CARD,e.environment),An.preloadSecuritySDK(G.VAULTING,e.securityRegion,e.environment)}}]),n}(jc),Wc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[z.ELEMENT_PAYMENT])}return m()(n)}(jc),qc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return m()(n)}(Hs),Jc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return m()(n)}(Nc),Qc=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Sc,this.core.registerProcessor(G.EASY_PAY,"",new Mc),this.core.init(t,G.EASY_PAY)}return m()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.EASY_PAY,V.WALLET,e.environment,!0)}}]),e}(),Zc=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new Sc,this.core.registerProcessor(G.AUTO_DEBIT,"",new Lc),this.core.init(t,G.AUTO_DEBIT)}var t;return m()(e,[{key:"createComponent",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:Y.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.AUTO_DEBIT,V.WALLET,e.environment),An.preloadSecuritySDK(G.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),Xc=new _a(ba,!0);var $c=n(8306),eu=n(5225),tu=n.n(eu),nu=n(2242),ru=n.n(nu),ou={i18nPrefix:"OPENSDK"},iu=function(e){y(n,e);var t=b(n);function n(e,r,o,i){var a,s,c,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];v(this,n);var d,p=i,h=void 0;return e&&"object"===Je(e)?(d=e.message,h=e.params):d=e,c=t.call(this,!ou.i18n||u&&"SERVER_API"===o?d:ou.i18n.get({id:"".concat(ou.i18nPrefix,".").concat(r),dm:(null===(a=(s=ou).getDefaultMessage)||void 0===a?void 0:a.call(s))||d},h)),l(Ze(c),"code",void 0),l(Ze(c),"name","OpenSDKError"),l(Ze(c),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),l(Ze(c),"source","SDK_INTERNAL"),l(Ze(c),"traceId",void 0),l(Ze(c),"reason",void 0),c.reason=d,c.code=r,c.source=o,c.traceId=p,c}return f(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new au(e instanceof Error?e.message:(null===(t=(r=ou).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){ou=p(p({},ou),e)}}]),n}(I(Error)),au=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","SDKBridgeError"),e}return f(n)}(iu),su=function(e){return $e(new Set(e))},lu=function(e,t){return e.filter((function(e){return!t.includes(e)}))},cu=function(e,t){return e.filter((function(e){return t.includes(e)}))},uu=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},du=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function pu(e,t){if(0===t.length)return e;for(var n,r=$e(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var hu=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(_u("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},fu=/^\+?\d+$/,mu=function(e){if(!fu.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(_u("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},vu=function(e){return new RegExp(e.map((function(e){return yu(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},gu=function(e){return new RegExp("^[".concat(e.map((function(e){return yu(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},yu=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},_u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},bu=3.5,Eu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(v(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(Je(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(Je(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(Je(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=su(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=lu(l,s);var c,u,d,p=cu(s,l);(this.seps=pu(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>bu)&&((c=Math.ceil(this.alphabet.length/bu))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,$e(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=pu(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=vu(this.guards),this.sepsRegExp=vu(this.seps),this.allowedCharsRegExp=gu([].concat($e(this.alphabet),$e(this.guards),$e(this.seps)))}return f(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat($e(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(uu)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:mu(String(e))}))),i.every(du)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(Je(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(Je(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=$e(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=pu(n,c));if((l=o).push.apply(l,$e(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=pu(n,n),(d=o).unshift.apply(d,$e(n.slice(u))),(p=o).push.apply(p,$e(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var f=h/2;o=o.slice(f,f+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=u(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=pu(a,[o].concat($e(this.salt),$e(a)).slice(0,a.length));s.push(hu(Array.from(c),d)),a=d}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),Su=new Eu("intl-open-sdk",6);function Au(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var ku,Tu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+Su.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))},wu=function(){function e(t,n){var r=this;v(this,e),l(this,"targetPort",void 0),l(this,"handlers",new Map),l(this,"debugCallback",void 0),l(this,"name",void 0),l(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(p(p({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t}return f(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var i=a(o().mark((function i(a){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(a.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),i,null,[[1,7]])})));return function(e){return i.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"send",value:function(e,t){var n={id:Tu("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(p(p({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),Pu=function(){function e(t){v(this,e),l(this,"targetPorts",[]),l(this,"name",void 0),this.name=t}var t;return f(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,$e(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=Au((function(){return Promise.all(i.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(i.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=tt(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(l({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return p(p({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),Iu=function(){function e(t,n){v(this,e),l(this,"targetPort",void 0),l(this,"name",void 0),this.targetPort=n,this.name=t}return f(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:i=r.type.split(":"),a=tt(i,2),a[0],"START_COLLECT_VALUE"===a[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),Cu="OPENSDK@HANDSHAKE",Ru="OPENSDK@READY_HANDSHAKE",Nu="OPENSDK@UPDATE_CONFIG",Ou="OPENSDK@SUBMIT",Lu="OPENSDK@SUBMIT_REPLY",Du="OPENSDK@REDIRECT",Mu="OPENSDK@OPEN_MODAL",xu="OPENSDK@OPEN_MODAL_ERROR",Uu="OPENSDK@CLOSE_MODAL",Bu="OPENSDK@ERROR",Ku="OPENSDK@HANDSHAKE_ACK",Hu="OPENSDK@TRANSFER_RECEIVE_PORT",Fu="OPENSDK@MESSAGE",Yu="OPENSDK@TRANSFER_SEND_PORT",ju="OPENSDK@TRANSFER_APP_PORT",zu="OPENSDK@TRANSFER_MODAL_PORT",Gu="OPENSDK@TRANSFER_MODAL_APPEARANCE",Vu="OPENSDK@HEIGHT_UPDATE",Wu=n(8098),qu=[Hu,Yu,zu,Gu,xu,ju,Uu,Mu,Du,Fu],Ju="@@global",Qu="@@native",Zu=function(){function e(t,n,r){var o,i,a=this;(v(this,e),l(this,"targetWindow",void 0),l(this,"currentWindow",void 0),l(this,"targetOrigin","*"),l(this,"scope",void 0),l(this,"handlers",new Map),l(this,"mode",void 0),l(this,"resizeObserver",void 0),l(this,"debugCallback",void 0),l(this,"receivePort",void 0),l(this,"handleMessage",(function(e){var t=e.data;if(t&&t.type){var n=t.type.split(":"),r=tt(n,2),o=r[0],i=r[1];if(a.scope!==Qu){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==Qu&&(s||t.type.endsWith(Bu)||t.type.endsWith(Fu))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){return n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return f(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Hu,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Hu,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort(Yu,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:Tu("bridge"),type:"SYSTEM_".concat(Bu),payload:{message:"Target window not set"}},"OUT"));var o={id:Tu("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Bu,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(Lu,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send(Fu,{type:e,message:t})}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new au("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new au("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(Du,{url:e,mode:t})}}},{key:"openModal",value:function(e){var t=this;return this.send(Mu,p(p({},e),{},{scope:this.scope})),new Promise((function(e,n){t.once(xu,(function(e){n(new iu(e.message,e.code,e.source))})),t.once(ju,(function(t,n){if(null==n||!n[0])throw new au("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL");e(new wu(t,n[0]))}))}))}},{key:"closeModal",value:function(){this.send(Uu)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this;this.on(e,(function r(o,i){try{t(o,i)}finally{n.off(e,r)}}))}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new au("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(Cu,function(){var r=a(o().mark((function r(i){var a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==i?void 0:i.elementMode)?i.isMainElement?n.getReceivePort().then((function(e){t(i,e)})):n.getSendPort().then((function(e){t(i,e)})).catch((function(){t(i)})):t(i),a=0,s=Wu((function(e){(Math.abs(e-a)>10||Math.abs((e-a)/a)>.01)&&(a=e,n.send(Vu,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&s(n.height)})),n.resizeObserver.observe(document.body),n.send(Ku,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(Ru),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Bu),this.scope===Qu)return e;var t=qu.includes(e)?Ju:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Bu),this.scope===Qu)return e;var t=qu.includes(e)?Ju:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:Tu(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Hu,(function(n,r){e.receivePort||(e.receivePort=new Pu(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on(Yu,(function(e,r){if(r){var o=new Iu(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,Ju)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",Qu,t)}},{key:"getBridge",value:function(t,n){if(n===Qu||n===Ju)throw new Error("Scope cannot be ".concat(Qu," or ").concat(Ju));return new e(t,n)}}]),e}(),Xu=function(){function e(t){v(this,e),l(this,"options",void 0),l(this,"tracker",void 0),l(this,"trackId",void 0),this.initialOptions(t)}var t;return f(e,[{key:"initialOptions",value:function(e){var t,n,r;return this.options=p(p(p({env:"DEV"},this.options),e),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),"trackId"in this.options&&(this.trackId=this.options.trackId),this.options}},{key:"loadTacker",value:function(e){var t=this,n=(0,$c.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.1/dist/tracker.umd.js","intlSdkTracker");return n?n.then((function(n){var r;return null===(r=n.variable)||void 0===r?void 0:r.getTrackerInstance(t.initialOptions(e))})):Promise.resolve(void 0)}},{key:"initTracker",value:(t=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:return e.next=4,this.loadTacker(t);case 4:return(n=e.sent)&&(this.tracker=n),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({trackId:e})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),e}(),$u=new Xu;!function(e){e["ar-SA"]="ar-SA",e.kn="kn",e.as="as",e.bho="bho",e["pl-PL"]="pl-PL",e["ko-KR"]="ko-KR",e["da-DK"]="da-DK",e["de-DE"]="de-DE",e["ru-RU"]="ru-RU",e["fr-FR"]="fr-FR",e.gu="gu",e["nl-BE"]="nl-BE",e["nl-NL"]="nl-NL",e["cs-CZ"]="cs-CZ",e.ro="ro",e["lo-LA"]="lo-LA",e["my-MM"]="my-MM",e["bn-BD"]="bn-BD",e["bn-IN"]="bn-IN",e.mr="mr",e["ms-MY"]="ms-MY",e.ml="ml",e.mni="mni",e["ne-NP"]="ne-NP",e.or="or",e["pt-BR"]="pt-BR",e["pt-PT"]="pt-PT",e.pa="pa",e["sv-SE"]="sv-SE",e["ja-JP"]="ja-JP",e.sr="sr",e["si-LK"]="si-LK",e["sk-SK"]="sk-SK",e["tr-TR"]="tr-TR",e["tl-PH"]="tl-PH",e.te="te",e.ta="ta",e["th-TH"]="th-TH",e["ur-PK"]="ur-PK",e["ur-IN"]="ur-IN",e["uk-UA"]="uk-UA",e["iw-IL"]="iw-IL",e["es-ES"]="es-ES",e["es-MX"]="es-MX",e.hu="hu",e["it-IT"]="it-IT",e["in-ID"]="in-ID",e["hi-IN"]="hi-IN",e["vi-VN"]="vi-VN",e["en-PK"]="en-PK",e["en-PL"]="en-PL",e["en-FR"]="en-FR",e["en-PH"]="en-PH",e["en-CZ"]="en-CZ",e["en-CA"]="en-CA",e["en-MM"]="en-MM",e["en-US"]="en-US",e["en-BD"]="en-BD",e["en-MY"]="en-MY",e["en-NP"]="en-NP",e["en-LK"]="en-LK",e["en-TH"]="en-TH",e["en-ES"]="en-ES",e["en-SG"]="en-SG",e["en-HU"]="en-HU",e["en-ID"]="en-ID",e["en-GB"]="en-GB",e["en-VN"]="en-VN",e["en-HK"]="en-HK",e["en-KR"]="en-KR",e["zh-TW"]="zh-TW",e["zh-HK"]="zh-HK",e["zh-SG"]="zh-SG",e["zh-CN"]="zh-CN",e["ar-IQ"]="ar-IQ",e["ckb-IQ"]="ckb-IQ",e.ku="ku",e["kk-KZ"]="kk-KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(ku||(ku={}));var ed={};ed[ku["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",ed[ku.kn]="埃纳德语",ed[ku.as]="阿萨姆语",ed[ku.bho]="博杰普尔语",ed[ku["pl-PL"]]="波兰语 (波兰)",ed[ku["ko-KR"]]="朝鲜语 (韩国)",ed[ku["da-DK"]]="丹麦语 (丹麦)",ed[ku["de-DE"]]="德语 (德国)",ed[ku["ru-RU"]]="俄语 (俄罗斯)",ed[ku["fr-FR"]]="法语 (法国)",ed[ku.gu]="古加拉提语",ed[ku["nl-BE"]]="荷兰语 (比利时)",ed[ku["nl-NL"]]="荷兰语 (荷兰)",ed[ku["cs-CZ"]]="捷克语 (捷克共和国)",ed[ku.ro]="罗马尼亚语",ed[ku["lo-LA"]]="老挝语 (老挝)",ed[ku["my-MM"]]="缅甸语 (缅甸)",ed[ku["bn-BD"]]="孟加拉语 (孟加拉)",ed[ku["bn-IN"]]="孟加拉语 (印度)",ed[ku.mr]="马拉地语",ed[ku["ms-MY"]]="马来语 (马来西亚)",ed[ku.ml]="马来亚拉姆语",ed[ku.mni]="曼尼普里语",ed[ku["ne-NP"]]="尼泊尔语 (尼泊尔)",ed[ku.or]="欧里亚语",ed[ku["pt-BR"]]="葡萄牙语 (巴西)",ed[ku["pt-PT"]]="葡萄牙语 (葡萄牙)",ed[ku.pa]="旁遮普语",ed[ku["sv-SE"]]="瑞典语 (瑞典)",ed[ku["ja-JP"]]="日语 (日本)",ed[ku.sr]="塞尔维亚语",ed[ku["si-LK"]]="僧伽罗语 (斯里兰卡)",ed[ku["sk-SK"]]="斯洛伐克语 (斯洛伐克)",ed[ku["tr-TR"]]="土耳其语 (土耳其)",ed[ku["tl-PH"]]="塔加路族语 (菲律宾)",ed[ku.te]="泰卢固语",ed[ku.ta]="泰米尔语",ed[ku["th-TH"]]="泰语 (泰国)",ed[ku["ur-PK"]]="乌尔都语 (巴基斯坦)",ed[ku["ur-IN"]]="乌尔都语 (印度)",ed[ku["uk-UA"]]="乌克兰语 (乌克兰)",ed[ku["iw-IL"]]="希伯来语 (以色列)",ed[ku["es-ES"]]="西班牙语 (西班牙)",ed[ku["es-MX"]]="西班牙语 (墨西哥)",ed[ku.hu]="匈牙利语",ed[ku["it-IT"]]="意大利语 (意大利)",ed[ku["in-ID"]]="印度尼西亚语 (印度尼西亚)",ed[ku["hi-IN"]]="印地语 (印度)",ed[ku["vi-VN"]]="越南语 (越南)",ed[ku["en-PK"]]="英语 (巴基斯坦)",ed[ku["en-PL"]]="英语 (波兰)",ed[ku["en-FR"]]="英语 (法国)",ed[ku["en-PH"]]="英语 (菲律宾)",ed[ku["en-CZ"]]="英语 (捷克共和国)",ed[ku["en-CA"]]="英语 (加拿大)",ed[ku["en-MM"]]="英语 (缅甸)",ed[ku["en-US"]]="英语 (美国)",ed[ku["en-BD"]]="英语 (孟加拉)",ed[ku["en-MY"]]="英语 (马来西亚)",ed[ku["en-NP"]]="英语 (尼泊尔)",ed[ku["en-LK"]]="英语 (斯里兰卡)",ed[ku["en-TH"]]="英语 (泰国)",ed[ku["en-ES"]]="英语 (西班牙)",ed[ku["en-SG"]]="英语 (新加坡)",ed[ku["en-HU"]]="英语 (匈牙利)",ed[ku["en-ID"]]="英语 (印度尼西亚)",ed[ku["en-GB"]]="英语 (英国)",ed[ku["en-VN"]]="英语 (越南)",ed[ku["en-HK"]]="英语 (中国香港)",ed[ku["en-KR"]]="英语 (韩国)",ed[ku["zh-TW"]]="繁体中文 (中国台湾)",ed[ku["zh-HK"]]="繁体中文 (中国香港)",ed[ku["zh-SG"]]="简体中文 (新加坡)",ed[ku["zh-CN"]]="简体中文 (中国)",ed[ku["ar-IQ"]]="阿拉伯语 (伊拉克)",ed[ku["ckb-IQ"]]="中库尔德语 (伊拉克)",ed[ku.ku]="库尔德语",ed[ku["kk-KZ"]]="哈萨克语",ed[ku.af]="南非语",ed[ku.am]="阿姆哈拉语",ed[ku.az]="阿塞拜疆语",ed[ku.be]="白俄罗斯语",ed[ku.bg]="保加利亚语",ed[ku.bs]="波斯尼亚语",ed[ku.ca]="加泰罗尼亚语",ed[ku.cy]="威尔士语",ed[ku.el]="现代希腊语",ed[ku.eo]="世界语",ed[ku.et]="爱沙尼亚语",ed[ku.eu]="巴斯克语",ed[ku.fa]="波斯语",ed[ku.fi]="芬兰语",ed[ku.gd]="爱尔兰语",ed[ku.gl]="加利西亚语",ed[ku.ha]="豪萨语",ed[ku.haw]="夏威夷语",ed[ku.hr]="克罗地亚语",ed[ku.ig]="伊博语",ed[ku.is]="冰岛语",ed[ku.ka]="格鲁吉亚语",ed[ku.km]="高棉语",ed[ku.ky]="吉尔吉斯语",ed[ku.lb]="卢森堡语",ed[ku.ln]="林格拉语",ed[ku.lt]="立陶宛语",ed[ku.lv]="拉脱维亚语",ed[ku.mg]="马尔加什语",ed[ku.mk]="马其顿语",ed[ku.mn]="蒙古文",ed[ku.mt]="马耳他语",ed[ku.om]="奥罗莫语",ed[ku.ps]="普什图语",ed[ku.qu]="克丘亚语",ed[ku.rw]="卢旺达语",ed[ku.sl]="斯洛文尼亚语",ed[ku.so]="索马里语",ed[ku.sq]="阿尔巴尼亚语",ed[ku.sw]="斯瓦希里语",ed[ku.tg]="塔吉克语",ed[ku.ti]="蒂格尼亚语",ed[ku.ug]="维吾尔语",ed[ku.uz]="乌兹别克语",ed[ku.yo]="约鲁巴语",ed[ku.zu]="祖鲁语";var td,nd={};nd[ku["ar-SA"]]="Arabic (Saudi Arabia)",nd[ku.kn]="Kannada",nd[ku.as]="Assamese",nd[ku.bho]="Bhojpuri",nd[ku["pl-PL"]]="Polish (Poland)",nd[ku["ko-KR"]]="Korean (Korean)",nd[ku["da-DK"]]="Danish (Denmark)",nd[ku["de-DE"]]="German (Germany)",nd[ku["ru-RU"]]="Russian (Russia)",nd[ku["fr-FR"]]="French (France)",nd[ku.gu]="Gujarati",nd[ku["nl-BE"]]="Dutch (Belgium)",nd[ku["nl-NL"]]="Dutch (Netherlands)",nd[ku["cs-CZ"]]="Czech (Czech Republic)",nd[ku.ro]="Romanian",nd[ku["lo-LA"]]="Lao (Laos)",nd[ku["my-MM"]]="Burmese (Myanmar)",nd[ku["bn-BD"]]="Bengali (Bangladesh)",nd[ku["bn-IN"]]="Bengali (India)",nd[ku.mr]="Marathi",nd[ku["ms-MY"]]="Malay (Malaysia)",nd[ku.ml]="Malayalam",nd[ku.mni]="Manipuri",nd[ku["ne-NP"]]="Nepalese (Nepal)",nd[ku.or]="Odia (Oriya)",nd[ku["pt-BR"]]="Portuguese (Brazil)",nd[ku["pt-PT"]]="Portuguese (Portugal)",nd[ku.pa]="Punjabi",nd[ku["sv-SE"]]="Swedish (Sweden)",nd[ku["ja-JP"]]="Japanese (Japanese)",nd[ku.sr]="Serbian",nd[ku["si-LK"]]="Sinhala (Sri Lanka)",nd[ku["sk-SK"]]="Slovak (Slovakia)",nd[ku["tr-TR"]]="Turkish (Turkish)",nd[ku["tl-PH"]]="Tagalog (Philippines)",nd[ku.te]="Telugu",nd[ku.ta]="Tamil",nd[ku["th-TH"]]="Thai (Thailand)",nd[ku["ur-PK"]]="Ulduwen (Pakistan)",nd[ku["ur-IN"]]="Urduwen (India)",nd[ku["uk-UA"]]="Ukrainian (Ukraine)",nd[ku["iw-IL"]]="Hebrew (Israel)",nd[ku["es-ES"]]="Spanish (Spain)",nd[ku["es-MX"]]="Spanish (Mexico)",nd[ku.hu]="Hungarian",nd[ku["it-IT"]]="Italian (Italian)",nd[ku["in-ID"]]="Indonesian (Indonesia)",nd[ku["hi-IN"]]="Hindi (India)",nd[ku["vi-VN"]]="Vietnamese (Vietnam)",nd[ku["en-PK"]]="English (Pakistan)",nd[ku["en-PL"]]="English (Poland)",nd[ku["en-FR"]]="English (France)",nd[ku["en-PH"]]="English (Philippines)",nd[ku["en-CZ"]]="English (Czech Republic)",nd[ku["en-CA"]]="English (Canada)",nd[ku["en-MM"]]="English (Myanmar)",nd[ku["en-US"]]="English (US)",nd[ku["en-BD"]]="English (Bangladesh)",nd[ku["en-MY"]]="English (Malaysia)",nd[ku["en-NP"]]="English (Nepal)",nd[ku["en-LK"]]="English (Sri Lanka)",nd[ku["en-TH"]]="English (Thailand)",nd[ku["en-ES"]]="English (Spain)",nd[ku["en-SG"]]="English (Singapore)",nd[ku["en-HU"]]="English (Hungary)",nd[ku["en-ID"]]="English (Indonesia)",nd[ku["en-GB"]]="English (UK)",nd[ku["en-VN"]]="English (Vietnam)",nd[ku["en-HK"]]="English (Hong Kong)",nd[ku["en-KR"]]="English (Korean)",nd[ku["zh-TW"]]="Chinese Traditional (Taiwan)",nd[ku["zh-HK"]]="Chinese Traditional (Hong Kong)",nd[ku["zh-SG"]]="Chinese Simplified (Singapore)",nd[ku["zh-CN"]]="Chinese Simplified (China)",nd[ku["ar-IQ"]]="Arabic (Iraq)",nd[ku["ckb-IQ"]]="Central Kurdish (Iraq)",nd[ku.ku]="Kurdish",nd[ku["kk-KZ"]]="Kazakh",nd[ku.af]="Afrikaans",nd[ku.am]="Amharic",nd[ku.az]="Azerbaijani",nd[ku.be]="Belarusian",nd[ku.bg]="Bulgarian",nd[ku.bs]="Bosnian",nd[ku.ca]="Catalan",nd[ku.cy]="Welsh",nd[ku.el]="Greek",nd[ku.eo]="Esperanto",nd[ku.et]="Estonian",nd[ku.eu]="Basque",nd[ku.fa]="Persian",nd[ku.fi]="Finnish",nd[ku.gd]="Scots Gaelic",nd[ku.gl]="Galician",nd[ku.ha]="Hausa",nd[ku.haw]="Hawaiian",nd[ku.hr]="Croatian",nd[ku.ig]="Igbo",nd[ku.is]="Icelandic",nd[ku.ka]="Georgian",nd[ku.km]="Khmer",nd[ku.ky]="Kyrgyz",nd[ku.lb]="Luxembourgish",nd[ku.ln]="Lingala",nd[ku.lt]="Lithuanian",nd[ku.lv]="Latvian",nd[ku.mg]="Malagasy",nd[ku.mk]="Macedonian",nd[ku.mn]="Mongolian",nd[ku.mt]="Maltese",nd[ku.om]="Oromo",nd[ku.ps]="Pashto",nd[ku.qu]="Quechua",nd[ku.rw]="Kinyarwanda",nd[ku.sl]="Slovenian",nd[ku.so]="Somali",nd[ku.sq]="Albanian",nd[ku.sw]="Swahili",nd[ku.tg]="Tajik",nd[ku.ti]="Tigrinya",nd[ku.ug]="Uyghur",nd[ku.uz]="Uzbek",nd[ku.yo]="Yoruba",nd[ku.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(td||(td={}));var rd,od,id,ad={"zh-hans":ku["zh-CN"],"zh-hant":ku["zh-TW"],ar:ku["ar-SA"],bn:ku["bn-BD"],cs:ku["cs-CZ"],da:ku["da-DK"],de:ku["de-DE"],en:ku["en-US"],es:ku["es-ES"],fr:ku["fr-FR"],hi:ku["hi-IN"],in:ku["in-ID"],it:ku["it-IT"],iw:ku["iw-IL"],ja:ku["ja-JP"],ko:ku["ko-KR"],lo:ku["lo-LA"],ms:ku["ms-MY"],my:ku["my-MM"],ne:ku["ne-NP"],nl:ku["nl-NL"],pl:ku["pl-PL"],pt:ku["pt-PT"],ru:ku["ru-RU"],si:ku["si-LK"],sk:ku["sk-SK"],sv:ku["sv-SE"],th:ku["th-TH"],tl:ku["tl-PH"],tr:ku["tr-TR"],uk:ku["uk-UA"],ur:ku["ur-PK"],vi:ku["vi-VN"],zh:ku["zh-CN"],kk:ku["kk-KZ"]},sd={"zh-hant":ku["zh-TW"],"zh-hans":ku["zh-CN"]},ld=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},cd=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}(rd||(rd={})),ld(rd),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(od||(od={})),ld(od),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}(id||(id={})),ld(id);var ud,dd,pd,hd,fd,md,vd,gd,yd,_d,bd,Ed,Sd,Ad,kd,Td;ku["ar-IQ"],rd.ar_EG,id.ar,od.ar,ku["ar-SA"],rd.ar_EG,id["ar-sa"],od["ar-sa"],ku["bn-BD"],rd.bn_BD,id["bn-bd"],od["bn-bd"],ku["bn-IN"],rd.bn_BD,id.bn,od.bn,ku["cs-CZ"],rd.cs_CZ,id.cs,od.cs,ku["da-DK"],rd.da_DK,id.da,od.da,ku["de-DE"],rd.de_DE,id.de,od.de,ku["en-BD"],rd.en_US,id["en-gb"],od.en,ku["en-CA"],rd.en_US,id["en-ca"],od["en-ca"],ku["en-CZ"],rd.en_US,id["en-gb"],od.en,ku["en-ES"],rd.en_US,id["en-gb"],od.en,ku["en-FR"],rd.en_US,id["en-gb"],od.en,ku["en-GB"],rd.en_GB,id["en-gb"],od["en-gb"],ku["en-HU"],rd.en_US,id["en-gb"],od.en,ku["en-ID"],rd.en_US,id["en-gb"],od.en,ku["en-LK"],rd.en_US,id["en-gb"],od.en,ku["en-MM"],rd.en_US,id["en-gb"],od.en,ku["en-MY"],rd.en_US,id["en-gb"],od.en,ku["en-NP"],rd.en_US,id["en-gb"],od.en,ku["en-PH"],rd.en_US,id["en-gb"],od.en,ku["en-PK"],rd.en_US,id["en-gb"],od.en,ku["en-PL"],rd.en_US,id["en-gb"],od.en,ku["en-SG"],rd.en_US,id["en-sg"],od.en,ku["en-TH"],rd.en_US,id["en-gb"],od.en,ku["en-US"],rd.en_US,id["en-gb"],od.en,ku["en-VN"],rd.en_US,id["en-gb"],od.en,ku["en-HK"],rd.en_US,id["en-gb"],od.en,ku["en-KR"],rd.en_US,id["en-gb"],od.en,ku["es-ES"],rd.es_ES,id.es,od.es,ku["es-MX"],rd.es_ES,id.es,od.es,ku["fr-FR"],rd.fr_FR,id.fr,od.fr,ku["hi-IN"],rd.hi_IN,id.hi,od.hi,ku.hu,rd.hu_HU,id.hu,od.hu,ku["in-ID"],rd.id_ID,id.id,od.id,ku["it-IT"],rd.it_IT,id.it,od.it,ku["ja-JP"],rd.ja_JP,id.ja,od.ja,ku.kn,rd.kn_IN,id.kn,od.kn,ku["ko-KR"],rd.ko_KR,id.ko,od.ko,ku.ml,rd.ml_IN,id.ml,od.ml,ku["ms-MY"],rd.ms_MY,id["ms-my"],od["ms-my"],ku["ne-NP"],rd.ne_NP,id.ne,od.ne,ku["nl-BE"],rd.nl_BE,id["nl-be"],od["nl-be"],ku["nl-NL"],rd.nl_NL,id.nl,od.nl,ku["pl-PL"],rd.pl_PL,id.pl,od.pl,ku["pt-BR"],rd.pt_BR,id["pt-br"],od["pt-br"],ku["pt-PT"],rd.pt_PT,id.pt,od.pt,ku.ro,rd.ro_RO,id.ro,od.ro,ku["ru-RU"],rd.ru_RU,id.ru,od.ru,ku["si-LK"],rd.si_LK,id.si,od.si,ku["sk-SK"],rd.sk_SK,id.sk,od.sk,ku.sr,rd.sr_RS,id.sr,od.sr,ku["sv-SE"],rd.sv_SE,id.sv,od.sv,ku.ta,rd.ta_IN,id.ta,od.ta,ku["th-TH"],rd.th_TH,id.th,od.th,ku["tr-TR"],rd.tr_TR,id.tr,od.tr,ku["uk-UA"],rd.uk_UA,id.uk,od.uk,ku["ur-PK"],rd.ur_PK,id.ur,od.ur,ku["vi-VN"],rd.vi_VN,id.vi,od.vi,ku["zh-CN"],rd.zh_CN,id["zh-cn"],od["zh-cn"],ku["zh-HK"],rd.zh_HK,id["zh-hk"],od["zh-hk"],ku["zh-SG"],rd.zh_HK,id["zh-hk"],od["zh-hk"],ku["zh-TW"],rd.zh_TW,id["zh-tw"],od["zh-tw"],ku["kk-KZ"],rd.kk_KZ,id.kk,od.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(Td||(Td={}));var wd,Pd,Id=ld(Td),Cd={};Cd[Td.kn]="AiNaDeYu",Cd[Td.ar_SA]="ALaBoYu (ShaTeALaBo)",Cd[Td.ar_IQ]="ALaBoYu (YiLaKe)",Cd[Td.as]="ASaMuYu",Cd[Td.bho]="BoJiePuErYu",Cd[Td.pl_PL]="BoLanYu (BoLan)",Cd[Td.ko_KR]="ChaoXianYu (HanGuo)",Cd[Td.da_DK]="DanMaiYu (DanMai)",Cd[Td.de_DE]="DeYu (DeGuo)",Cd[Td.ru_RU]="EYu (ELuoSi)",Cd[Td.fr_FR]="FaYu (FaGuo)",Cd[Td.gu]="GuJiaLaTiYu",Cd[Td.nl_BE]="HeLanYu (BiLiShi)",Cd[Td.nl_NL]="HeLanYu (HeLan)",Cd[Td.cs_CZ]="JieKeYu (JieKeGongHeGuo)",Cd[Td.ku]="KuErDeYu",Cd[Td.lo_LA]="LaoWoYu (LaoWo)",Cd[Td.ro]="LuoMaNiYaYu",Cd[Td.mr]="MaLaDiYu",Cd[Td.ms_MY]="MaLaiYu (MaLaiXiYa)",Cd[Td.ml]="MaLaiYaLaMuYu",Cd[Td.mni]="ManNiPuLiYu",Cd[Td.bn_BD]="MengJiaLaYu (MengJiaLa)",Cd[Td.bn_IN]="MengJiaLaYu (YinDu)",Cd[Td.my_MM]="MianDianYu (MianDian)",Cd[Td.ne_NP]="NiBoErYu (NiBoEr)",Cd[Td.or]="OuLiYaYu",Cd[Td.pa]="PangZhePuYu",Cd[Td.pt_BR]="PuTaoYaYu (BaXi)",Cd[Td.pt_PT]="PuTaoYaYu (PuTaoYa)",Cd[Td.ja_JP]="RiYu (RiBen)",Cd[Td.sv_SE]="RuiDianYu (RuiDian)",Cd[Td.sr]="SaiErWeiYaYu",Cd[Td.si_LK]="SengJiaLuoYu (SiLiLanKa)",Cd[Td.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",Cd[Td.te]="TaiLuGuYu",Cd[Td.ta]="TaiMiErYu",Cd[Td.th_TH]="TaiYu (TaiGuo)",Cd[Td.tl_PH]="TaJiaLuZuYu (FeiLvBin)",Cd[Td.tr_TR]="TuErQiYu (TuErQi)",Cd[Td.ur_PK]="WuErDuYu (BaJiSiTan)",Cd[Td.ur_IN]="WuErDuYu (YinDu)",Cd[Td.uk_UA]="WuKeLanYu (WuKeLan)",Cd[Td.es_ES]="XiBanYaYu (XiBanYa)",Cd[Td.es_MX]="XiBanYaYu (MoXiGe)",Cd[Td.iw_IL]="XiBoLaiYu (YiSeLie)",Cd[Td.hu]="XiongYaLiYu",Cd[Td.it_IT]="YiDaLiYu (YiDaLi)",Cd[Td.hi_IN]="YinDiYu (YinDu)",Cd[Td.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",Cd[Td.en_PK]="YingYu (BaJiSiTan)",Cd[Td.en_PL]="YingYu (BoLan)",Cd[Td.en_FR]="YingYu (FaGuo)",Cd[Td.en_PH]="YingYu (FeiLvBin)",Cd[Td.en_CA]="YingYu (JiaNaDa)",Cd[Td.en_CZ]="YingYu (JieKeGongHeGuo)",Cd[Td.en_MY]="YingYu (MaLaiXiYa)",Cd[Td.en_US]="YingYu (MeiGuo)",Cd[Td.en_BD]="YingYu (MengJiaLa)",Cd[Td.en_MM]="YingYu (MianDian)",Cd[Td.en_NP]="YingYu (NiBoEr)",Cd[Td.en_LK]="YingYu (SiLiLanKa)",Cd[Td.en_TH]="YingYu (TaiGuo)",Cd[Td.en_ES]="YingYu (XiBanYa)",Cd[Td.en_SG]="YingYu (XinJiaPo)",Cd[Td.en_HU]="YingYu (XiongYaLi)",Cd[Td.en_ID]="YingYu (YinDuNiXiYa)",Cd[Td.en_GB]="YingYu (YingGuo)",Cd[Td.en_VN]="YingYu (YueNan)",Cd[Td.en_HK]="YingYu (XiangGang)",Cd[Td.en_KR]="YingYu (HanGuo)",Cd[Td.vi_VN]="YueNanYu (YueNan)",Cd[Td.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",Cd[Td.zh_TW]="ZhongWen (TaiWanDiQu)",Cd[Td.zh_HK]="ZhongWen (XiangGang)",Cd[Td.zh_SG]="ZhongWen (XinJiaPo)",Cd[Td.zh_CN]="ZhongWen (ZhongGuo)",Cd[Td.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",Cd[Td.af]="NanFeiYu",Cd[Td.am]="AMuHaLaYu",Cd[Td.az]="ASaiBaiJiangYu",Cd[Td.be]="BaiErLuoSiYu",Cd[Td.bg]="BaoJiaLiYaYu",Cd[Td.bs]="BoSiNiYaYu",Cd[Td.ca]="JiaTaiLuoNiYaYu",Cd[Td.cy]="WeiErShiYu",Cd[Td.el]="XianDaiXiLaYu",Cd[Td.eo]="ShiJieYu",Cd[Td.et]="AiShaNiYaYu",Cd[Td.eu]="BaSiKeYu",Cd[Td.fa]="BoSiYu",Cd[Td.fi]="FenLanYu",Cd[Td.gd]="AiErLanYu",Cd[Td.gl]="JiaLiXiYaYu",Cd[Td.ha]="HaoSaYu",Cd[Td.haw]="XiaWeiYiYu",Cd[Td.hr]="KeLuoDiYaYu",Cd[Td.ig]="YiBoYu",Cd[Td.is]="BingDaoYu",Cd[Td.ka]="GeLuJiYaYu",Cd[Td.km]="GaoMianYu",Cd[Td.ky]="JiErJiSiYu",Cd[Td.lb]="LuSenBaoYu",Cd[Td.ln]="LinGeLaYu",Cd[Td.lt]="LiTaoWanYu",Cd[Td.lv]="LaTuoWeiYaYu",Cd[Td.mg]="MaErJiaShiYu",Cd[Td.mk]="MaQiDunYu",Cd[Td.mn]="MengGuWen",Cd[Td.mt]="MaErTaYu",Cd[Td.om]="AoLuoMoYu",Cd[Td.ps]="PuShiTuYu",Cd[Td.qu]="KeQiuYaYu",Cd[Td.rw]="LuWangDaYu",Cd[Td.sl]="SiLuoWeiNiYaYu",Cd[Td.so]="SuoMaLiYu",Cd[Td.sq]="AErBaNiYaYu",Cd[Td.sw]="SiWaXiLiYu",Cd[Td.tg]="TaJiKeYu",Cd[Td.ti]="DiGeNiYaYu",Cd[Td.ug]="WeiWuErYu",Cd[Td.uz]="WuZiBieKeYu",Cd[Td.yo]="YueLuBaYu",Cd[Td.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(wd||(wd={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Pd||(Pd={})),ld(Pd);var Rd=Object.assign(Object.assign({},Pd),{TranslationMemory:"TranslationMemory"}),Nd=(ld(Rd),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===Td.zh_HK||e===Td.zh_TW||e===Td.zh_SG)return"zh-tw";if(e===Td.in_ID)return"id";if(e===Td.iw_IL)return"he";var t=e.split("_")[0];return cd(Nd.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===Td.zh_HK||e===Td.zh_TW||e===Td.zh_SG)return"zh-TW";if(e===Td.in_ID)return"id";if(e===Td.mni)return"mni-Mtei";var t=e.split("_")[0];return cd(Nd.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===Td.zh_CN)return"zh-CN";if(e===Td.zh_HK||e===Td.zh_TW||e===Td.zh_SG)return"zh-TW";var t=e.split("_")[0];return cd(Nd.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===Td.in_ID)return"ID";var n=t.split("_")[0];return cd(Nd.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===Td.zh_CN||e===Td.zh_SG)return"ZH";if(e===Td.zh_HK||e===Td.zh_TW)return null;if(e===Td.en_GB||e===Td.en_US||e===Td.pt_BR||e===Td.pt_PT)return t.replace("_","-");if(e===Td.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":cd(Nd.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===Td.pt_PT)return"pt-pt";if(e===Td.pt_BR)return"pt";if([Td.zh_CN,Td.zh_SG].includes(e))return"zh-Hans";if([Td.zh_HK,Td.zh_TW].includes(e))return"zh-Hant";if(e===Td.iw_IL)return"he";if(e===Td.in_ID)return"id";if(e===Td.ckb_IQ)return"ku";var t=e.split("_")[0];return cd(Nd.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===Td.pt_PT)return"pt-PT";if(e===Td.pt_BR)return"pt";if(e===Td.es_MX)return"es-MX";if(e===Td.in_ID)return"id";if(e===Td.zh_CN||e===Td.zh_SG)return"zh";if(e===Td.zh_HK||e===Td.zh_TW)return"zh-TW";var t=e.split("_")[0];return cd(Nd.amazonSupportedLanguages,t)?t:null}}),Od={};Od[Pd.AiSelected]=Id,Od[Pd.Aliyun]=Id.filter((function(e){return Boolean(Nd.mapAliyunLanguage(e))})),Od[Pd["ChatGPT3.5"]]=Id,Od[Pd.Google]=Id.filter((function(e){return Boolean(Nd.mapGoogleLanguage(e))})),Od[Pd.Papago]=Id.filter((function(e){return Boolean(Nd.mapPapagoLanguage(e))})),Od[Pd.DeepL]=Id.filter((function(e){return Boolean(Nd.mapDeepLLanguage(e))})),Od[Pd.Microsoft]=Id.filter((function(e){return Boolean(Nd.mapMicrosoftLanguage(e))})),Od[Pd.Amazon]=Id.filter((function(e){return Boolean(Nd.mapAmazonLanguage(e))}));var Ld={};Ld[Pd.AiSelected]=Id,Ld[Pd.Aliyun]=Id.filter((function(e){return Boolean(Nd.mapAliyunLanguage(e))})),Ld[Pd["ChatGPT3.5"]]=Id,Ld[Pd.Google]=Id.filter((function(e){return Boolean(Nd.mapGoogleLanguage(e))})),Ld[Pd.Papago]=Id.filter((function(e){return Boolean(Nd.mapPapagoLanguage(e))})),Ld[Pd.DeepL]=Id.filter((function(e){return Boolean(Nd.mapDeepLSourceLanguage(e))})),Ld[Pd.Microsoft]=Id.filter((function(e){return Boolean(Nd.mapMicrosoftLanguage(e))})),Ld[Pd.Amazon]=Id.filter((function(e){return Boolean(Nd.mapAmazonLanguage(e))})),Dd=Id.map((function(e){return[e,ld(Pd).filter((function(t){return cd(Od[t],e)}))]})),Md={},Object.keys(Dd||{}).forEach((function(e){var t=Dd[e],n=t[0],r=t[1];Md[n]=r}));var Dd,Md,xd={};xd[Td.ar_SA]="العربية)السعودية)",xd[Td.kn]="ಕನ್ನಡ",xd[Td.as]="অসমীয়া",xd[Td.bho]="भोजपुरी",xd[Td.pl_PL]="Polski (Polska)",xd[Td.ko_KR]="한국어 (대한민국)",xd[Td.da_DK]="Dansk (Danmark)",xd[Td.de_DE]="Deutsch (Deutschland)",xd[Td.ru_RU]="Русский (Россия)",xd[Td.fr_FR]="Français (France)",xd[Td.gu]="ગુજરાતી",xd[Td.nl_BE]="Nederlands (Belgium)",xd[Td.nl_NL]="Nederlands (Nederland)",xd[Td.cs_CZ]="Čeština (Česká republika)",xd[Td.ro]="Română",xd[Td.lo_LA]="ລາວ (ລາວ)",xd[Td.my_MM]="မြန်မာဘာသာ (မြန်မာ)",xd[Td.bn_BD]="বাংলা (বাংলাদেশ)",xd[Td.bn_IN]="বাংলা (ভারত)",xd[Td.mr]="मराठी",xd[Td.ms_MY]="Bahasa Melayu (Malaysia)",xd[Td.ml]="മലയാളം",xd[Td.mni]="ꯃꯩꯇꯩꯂꯣꯟ",xd[Td.ne_NP]="नेपाली (नेपाल)\t",xd[Td.or]="ଓଡ଼ିଆ",xd[Td.pt_BR]="Português (Brasil)",xd[Td.pt_PT]="Português (Portugal)",xd[Td.pa]="پنجابی",xd[Td.sv_SE]="Svenska (Sverige)",xd[Td.ja_JP]="日本語",xd[Td.sr]="Српски",xd[Td.si_LK]="සිංහල (ශ්රී ලංකාව)",xd[Td.sk_SK]="Slovenčina (Slovensko)",xd[Td.tr_TR]="Türkçe (Türkiye)",xd[Td.tl_PH]="Wikang Tagalog (Philippines)",xd[Td.te]="తెలుగు",xd[Td.ta]="தமிழ்",xd[Td.th_TH]="ไทย (ประเทศไทย)",xd[Td.ur_PK]="اردو)پاکستان)",xd[Td.ur_IN]="اردو)بھارت)",xd[Td.uk_UA]="Українська (Україна)",xd[Td.iw_IL]="עִבְרִית (ישראל)",xd[Td.es_ES]="Español (España)",xd[Td.es_MX]="Español (México)",xd[Td.hu]="Magyar",xd[Td.it_IT]="Italiano (Italia)",xd[Td.in_ID]="Bahasa Indonesia (Indonesia)",xd[Td.hi_IN]="हिन्दी (भारत)",xd[Td.vi_VN]="Tiếng Việt (Việt Nam)",xd[Td.en_PK]="English (Pakistan)",xd[Td.en_PL]="English (Poland)",xd[Td.en_FR]="English (France)",xd[Td.en_PH]="English (Philippines)",xd[Td.en_CZ]="English (Czech Republic)",xd[Td.en_CA]="English (Canada)",xd[Td.en_MM]="English (Myanmar)",xd[Td.en_US]="English (United States)",xd[Td.en_BD]="English (Bangladesh)",xd[Td.en_MY]="English (Malaysia)",xd[Td.en_NP]="English (Nepal)",xd[Td.en_LK]="English (Sri Lanka)",xd[Td.en_TH]="English (Thailand)",xd[Td.en_ES]="English (Spain)",xd[Td.en_SG]="English (Singapore)",xd[Td.en_HU]="English (Hungary)",xd[Td.en_ID]="English (Indonesia)",xd[Td.en_GB]="English (Great Britain)",xd[Td.en_VN]="English (Vietnam)",xd[Td.en_HK]="English (Hong Kong)",xd[Td.en_KR]="English (Korea)",xd[Td.zh_TW]="繁体中文 (中國台灣)",xd[Td.zh_HK]="繁体中文 (中國香港)",xd[Td.zh_SG]="简体中文 (新加坡)",xd[Td.zh_CN]="简体中文",xd[Td.ar_IQ]="العربية (العراق)",xd[Td.ckb_IQ]="کوردیی ناوەندی (عێراق)",xd[Td.ku]="کورمانجی",xd[Td.kk_KZ]="قازاقشا ",xd[Td.af]="Afrikaans",xd[Td.am]="አማርኛ",xd[Td.az]="Azərbaycan",xd[Td.be]="беларуская мова",xd[Td.bg]="Български",xd[Td.bs]="босански",xd[Td.ca]="Català",xd[Td.cy]="Cymraeg",xd[Td.el]="Ελληνικά",xd[Td.eo]="Esperanto",xd[Td.et]="eesti keel",xd[Td.eu]="Euskara",xd[Td.fa]="فارسی",xd[Td.fi]="Suomi",xd[Td.gd]="Gaeilge",xd[Td.gl]="Galego",xd[Td.ha]="هَوُسَ",xd[Td.haw]="ʻŌlelo Hawaiʻi",xd[Td.hr]="Hrvatski",xd[Td.ig]="Asụsụ Igbo",xd[Td.is]="Íslenska",xd[Td.ka]="ქართული",xd[Td.km]="ភាសាខ្មែរ",xd[Td.ky]="кыргыз тили",xd[Td.lb]="Lëtzebuergesch",xd[Td.ln]="Lingála",xd[Td.lt]="lietuvių kalba",xd[Td.lv]="Latviešu valoda",xd[Td.mg]="malagasy",xd[Td.mk]="македонски",xd[Td.mn]="монгол хэл",xd[Td.mt]="Malti",xd[Td.om]="Oromoo",xd[Td.ps]="پښتو",xd[Td.qu]="Quechua",xd[Td.rw]="Ikinyarwanda",xd[Td.sl]="slovenščina",xd[Td.so]="Af-Soomaali",xd[Td.sq]="Gjuha shqipe",xd[Td.sw]="Kiswahili",xd[Td.tg]="тоҷикӣ",xd[Td.ti]="ትግርኛ",xd[Td.ug]="ئۇيغۇر تىلى",xd[Td.uz]="Ўзбек тили",xd[Td.yo]="Èdè Yorùbá",xd[Td.zu]="isiZulu",Pd.AiSelected,(ud={})[Td.en_US]="AI Selected",ud[Td.zh_CN]="AI 精选",(dd={})[Td.en_US]="AI selection of translations",dd[Td.zh_CN]="多渠道翻译的 AI 精选",Ld.AiSelected,Od.AiSelected,(pd={})[Td.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",pd[Td.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(hd={})[Td.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",hd[Td.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Pd["ChatGPT3.5"],(fd={})[Td.en_US]="GPT-3.5",fd[Td.zh_CN]="GPT-3.5",(md={})[Td.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",md[Td.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(vd={})[Td.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",vd[Td.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",Ld["ChatGPT3.5"],Od["ChatGPT3.5"],Pd.Aliyun,(gd={})[Td.en_US]="Alibaba",gd[Td.zh_CN]="阿里云",Ld.Aliyun,Od.Aliyun,Pd.Google,(yd={})[Td.en_US]="Google",yd[Td.zh_CN]="Google",Ld.Google,Od.Google,Pd.DeepL,(_d={})[Td.en_US]="DeepL",_d[Td.zh_CN]="DeepL",Ld.DeepL,Od.DeepL,Pd.Microsoft,(bd={})[Td.en_US]="Azure AI",bd[Td.zh_CN]="Azure AI",Ld.Microsoft,Od.Microsoft,Pd.Amazon,(Ed={})[Td.en_US]="Amazon",Ed[Td.zh_CN]="Amazon",Ld.Amazon,Od.Amazon,Pd.Papago,(Sd={})[Td.en_US]="Papago",Sd[Td.zh_CN]="Papago",(Ad={})[Td.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",Ad[Td.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(kd={})[Td.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",kd[Td.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",Ld.Papago,Od.Papago;var Ud=Object.keys(ku).map((function(e){return ku[e]})),Bd=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,Kd=function(e,t){return(Kd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Hd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Kd(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Fd,Yd,jd,zd=function(){return(zd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Gd(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Vd(e){return e.type===Yd.literal}function Wd(e){return e.type===Yd.argument}function qd(e){return e.type===Yd.number}function Jd(e){return e.type===Yd.date}function Qd(e){return e.type===Yd.time}function Zd(e){return e.type===Yd.select}function Xd(e){return e.type===Yd.plural}function $d(e){return e.type===Yd.pound}function ep(e){return e.type===Yd.tag}function tp(e){return!(!e||"object"!=Qe()(e)||e.type!==jd.number)}function np(e){return!(!e||"object"!=Qe()(e)||e.type!==jd.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(Fd||(Fd={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Yd||(Yd={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(jd||(jd={}));var rp=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,op=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function ip(e){var t={};return e.replace(op,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var ap=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,sp=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,lp=/^(@+)?(\+|#+)?[rs]?$/g,cp=/(\*)(0+)|(#+)(0+)|(0+)/g,up=/^(0+)$/;function dp(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(lp,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function pp(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function hp(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!up.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function fp(e){return pp(e)||{}}function mp(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=zd(zd(zd({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return zd(zd({},e),fp(t))}),{}));continue;case"engineering":t=zd(zd(zd({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return zd(zd({},e),fp(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(cp,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(up.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(sp.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(sp,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=zd(zd({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=zd(zd({},t),dp(i)))}else if(lp.test(o.stem))t=zd(zd({},t),dp(o.stem));else{var a=pp(o.stem);a&&(t=zd(zd({},t),a));var s=hp(o.stem);s&&(t=zd(zd({},t),s))}}return t}var vp,gp={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function yp(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(gp[n||""]||gp[r||""]||gp["".concat(r,"-001")]||gp["001"])[0]}var _p=new RegExp("^".concat(rp.source,"*")),bp=new RegExp("".concat(rp.source,"*$"));function Ep(e,t){return{start:e,end:t}}var Sp=!!String.prototype.startsWith&&"_a".startsWith("a",1),Ap=!!String.fromCodePoint,kp=!!Object.fromEntries,Tp=!!String.prototype.codePointAt,wp=!!String.prototype.trimStart,Pp=!!String.prototype.trimEnd,Ip=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Cp=!0;try{Cp="a"===(null===(vp=Up("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===vp?void 0:vp[0])}catch(ku){Cp=!1}var Rp,Np=Sp?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Op=Ap?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},Lp=kp?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},Dp=Tp?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Mp=wp?function(e){return e.trimStart()}:function(e){return e.replace(_p,"")},xp=Pp?function(e){return e.trimEnd()}:function(e){return e.replace(bp,"")};function Up(e,t){return new RegExp(e,t)}if(Cp){var Bp=Up("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Rp=function(e,t){var n;return Bp.lastIndex=t,null!==(n=Bp.exec(e)[1])&&void 0!==n?n:""}}else Rp=function(e,t){for(var n=[];;){var r=Dp(e,t);if(void 0===r||Fp(r)||Yp(r))break;n.push(r),t+=r>=65536?2:1}return Op.apply(void 0,n)};var Kp=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(Fd.UNMATCHED_CLOSING_TAG,Ep(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Hp(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:Yd.pound,location:Ep(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Yd.literal,value:"<".concat(r,"/>"),location:Ep(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Hp(this.char()))return this.error(Fd.INVALID_TAG,Ep(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(Fd.UNMATCHED_CLOSING_TAG,Ep(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Yd.tag,value:r,children:i,location:Ep(n,this.clonePosition())},err:null}:this.error(Fd.INVALID_TAG,Ep(a,this.clonePosition())))}return this.error(Fd.UNCLOSED_TAG,Ep(n,this.clonePosition()))}return this.error(Fd.INVALID_TAG,Ep(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=Ep(n,this.clonePosition());return{val:{type:Yd.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Hp(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Op.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Op(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Fd.EXPECT_ARGUMENT_CLOSING_BRACE,Ep(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Fd.EMPTY_ARGUMENT,Ep(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Fd.MALFORMED_ARGUMENT,Ep(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Fd.EXPECT_ARGUMENT_CLOSING_BRACE,Ep(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Yd.argument,value:r,location:Ep(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Fd.EXPECT_ARGUMENT_CLOSING_BRACE,Ep(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Fd.MALFORMED_ARGUMENT,Ep(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Rp(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Ep(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(Fd.EXPECT_ARGUMENT_TYPE,Ep(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=xp(g.val)).length)return this.error(Fd.EXPECT_ARGUMENT_STYLE,Ep(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:Ep(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=Ep(r,this.clonePosition());if(l&&Np(null==l?void 0:l.style,"::",0)){var d=Mp(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:Yd.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(Fd.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=yp(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:jd.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?ip(p):{}};return{val:{type:"date"===a?Yd.date:Yd.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?Yd.number:"date"===a?Yd.date:Yd.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Fd.EXPECT_SELECT_ARGUMENT_OPTIONS,Ep(f,zd({},f)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(Fd.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ep(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(Fd.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Fd.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),m=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,m);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var b=Ep(r,this.clonePosition());return"select"===a?{val:{type:Yd.select,value:n,options:Lp(_.val),location:b},err:null}:{val:{type:Yd.plural,value:n,options:Lp(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(Fd.INVALID_ARGUMENT_TYPE,Ep(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(Fd.EXPECT_ARGUMENT_CLOSING_BRACE,Ep(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Fd.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ep(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(ap).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(Fd.INVALID_NUMBER_SKELETON,t)}return{val:{type:jd.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?mp(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(Fd.EXPECT_PLURAL_ARGUMENT_SELECTOR,Fd.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=Ep(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?Fd.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Fd.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Fd.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Fd.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ep(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([l,{value:h.val,location:Ep(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?Fd.EXPECT_SELECT_ARGUMENT_SELECTOR:Fd.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ep(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(Fd.MISSING_OTHER_CLAUSE,Ep(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=Ep(r,this.clonePosition());return o?Ip(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Dp(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Np(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Fp(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Hp(e){return e>=97&&e<=122||e>=65&&e<=90}function Fp(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Yp(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function jp(e,t){void 0===t&&(t={}),t=zd({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Kp(e,t).parse();if(n.err){var r=SyntaxError(Fd[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,Zd(t)||Xd(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else qd(t)&&tp(t.style)||(Jd(t)||Qd(t))&&np(t.style)?delete t.style.location:ep(t)&&e(t.children)}))}(n.val),n.val}function zp(e,t){var n=t&&t.cache?t.cache:Xp,r=t&&t.serializer?t.serializer:Jp;return(t&&t.strategy?t.strategy:qp)(e,{cache:n,serializer:r})}function Gp(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function Vp(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function Wp(e,t,n,r,o){return n.bind(t,e,r,o)}function qp(e,t){return Wp(e,this,1===e.length?Gp:Vp,t.cache.create(),t.serializer)}var Jp=function(){return JSON.stringify(arguments)};function Qp(){this.cache=Object.create(null)}Qp.prototype.get=function(e){return this.cache[e]},Qp.prototype.set=function(e,t){this.cache[e]=t};var Zp,Xp={create:function(){return new Qp}},$p={variadic:function(e,t){return Wp(e,this,Vp,t.cache.create(),t.serializer)},monadic:function(e,t){return Wp(e,this,Gp,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Zp||(Zp={}));var eh,th=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return Hd(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),nh=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Zp.INVALID_VALUE,o)||this}return Hd(t,e),t}(th),rh=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Zp.INVALID_VALUE,r)||this}return Hd(t,e),t}(th),oh=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Zp.MISSING_VALUE,n)||this}return Hd(t,e),t}(th);function ih(e){return"function"==typeof e}function ah(e,t,n,r,o,i,a){if(1===e.length&&Vd(e[0]))return[{type:eh.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(Vd(u))s.push({type:eh.literal,value:u.value});else if($d(u))"number"==typeof i&&s.push({type:eh.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new oh(d,a);var p=o[d];if(Wd(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?eh.literal:eh.object,value:p});else if(Jd(u)){var h="string"==typeof u.style?r.date[u.style]:np(u.style)?u.style.parsedOptions:void 0;s.push({type:eh.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(Qd(u))h="string"==typeof u.style?r.time[u.style]:np(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:eh.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(qd(u))(h="string"==typeof u.style?r.number[u.style]:tp(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:eh.literal,value:n.getNumberFormat(t,h).format(p)});else{if(ep(u)){var f=u.children,m=u.value,v=o[m];if(!ih(v))throw new rh(m,"function",a);var g=v(ah(f,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?eh.literal:eh.object,value:e}})))}if(Zd(u)){if(!(y=u.options[p]||u.options.other))throw new nh(u.value,p,Object.keys(u.options),a);s.push.apply(s,ah(y.value,t,n,r,o))}else if(Xd(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new th('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Zp.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new nh(u.value,p,Object.keys(u.options),a);s.push.apply(s,ah(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===eh.literal&&t.type===eh.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function sh(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(eh||(eh={}));var lh=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===eh.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return ah(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,zd(zd({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?zd(zd(zd({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=zd(zd({},o[t]),i[t]||{}),e}),{})):o),n}),zd({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:zp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,Gd([void 0],n,!1)))}),{cache:sh(i.number),strategy:$p.variadic}),getDateTimeFormat:zp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Gd([void 0],n,!1)))}),{cache:sh(i.dateTime),strategy:$p.variadic}),getPluralRules:zp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,Gd([void 0],n,!1)))}),{cache:sh(i.pluralRules),strategy:$p.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=jp,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function ch(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var uh=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=ch({},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 i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",ch({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,ch({},this.attributes,t))},withConverter:function(t){return e(ch({},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:"/"}),dh=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},ph=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},hh=function(){return"object"==("undefined"==typeof ac?"undefined":Qe()(ac))&&"function"==typeof ac.call},fh=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!hh()},mh=function(){return"object"==("undefined"==typeof window?"undefined":Qe()(window))},vh=function(){return function(){var e;return!!mh()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||mh()&&"undefined"!=typeof AlipayJSBridge},gh=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},yh=function(){return!(void 0===n.g||mh()||fh()||gh()||hh())},_h="bailingualLocaleChange",bh="bailingualDataChange",Eh="bailingualError";function Sh(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Qe()(document)))try{return uh.get(e)||uh.get("_CHIPS-"+e)}catch(e){return dh("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var Ah,kh=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),vh()||fh()||hh()){var t=sd[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),ad[e.toLowerCase()]&&(e=ad[e.toLowerCase()]),Kh(Ud,e)?e:""};function Th(e){return void 0===e&&(e=!0),kh(function(e){return void 0===e&&(e=!0),fh()||hh()?my.env&&my.env.language||my.getSystemInfoSync().language:gh()?wx.getSystemInfoSync().language:yh()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=Sh("x-hng")||Sh("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Qe()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(mh()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(mh()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function wh(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Qe()(document))&&uh.set(e,t,n)}catch(e){dh("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Ph(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Qe()(document))&&uh.remove(e,t)}catch(e){dh("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Ih(){"object"==("undefined"==typeof document?"undefined":Qe()(document))&&"object"==("undefined"==typeof location?"undefined":Qe()(location))&&(Ph("x-hng",{path:"/",domain:location.hostname}),Ph("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Ph("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Ph("x-hng",{path:"/"}),Ph("x-hng",{path:"/",SameSite:"None",Secure:!0}),Ph("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(Ah||(Ah={}));var Ch,Rh,Nh,Oh,Lh,Dh,Mh,xh,Uh=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},Bh=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},Kh=function(e,t){return e.indexOf(t)>-1};function Hh(e){var t,n;try{return Rh?(null===(t=Rh.getItem)||void 0===t?void 0:t.call(Rh,e))||"":fh()||hh()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":gh()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Qe()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function Fh(e,t){var n;try{if(t=(t||"").toString(),Rh)return void(null===(n=Rh.setItem)||void 0===n||n.call(Rh,e,t));if(fh()||hh())return void my.setStorage({key:e,data:t});if(gh())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Qe()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function Yh(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return Ch?Ch(e):hh()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):fh()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):gh()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(Mh||(Mh={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(xh||(xh={}));var jh={ANTINTL:(Nh={},Nh[Mh.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",Nh[Mh.PROD]="https://bailingual.marmot-cloud.com/manifest/",Nh),ALIPAY:(Oh={},Oh[Mh.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Oh[Mh.PROD]="https://bailingual-assets.alipay.com/manifest/",Oh)},zh={};zh[xh.INTERNET]=((Lh={})[Mh.DAILY]=function(e,t,n){var r;return""+(n?null===(r=jh[n])||void 0===r?void 0:r[Mh.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Lh[Mh.PROD]=function(e,t,n){var r;return""+(n?null===(r=jh[n])||void 0===r?void 0:r[Mh.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Lh),zh[xh.INTRANET]=((Dh={})[Mh.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Dh[Mh.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Dh);var Gh;function Vh(){return"true"===Hh("__BAILINGUAL_IN_CONTEXT__")}function Wh(){if(!(fh()||gh()||hh())){var e=Hh("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){dh("[bailingual-sdk-glue] JSON.parse data fail: "+e)}Gh=Vh()&&t}}function qh(){return void 0===Gh&&Wh(),Gh}function Jh(){Fh("__BAILINGUAL_IN_CONTEXT__","true"),Wh(),new Promise((function(e,t){if(fh()||gh()||hh())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return Yh("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function Qh(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function Zh(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function Xh(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(hh())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(fh())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(gh())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(mh()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(fh()||gh()||hh()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(Vh()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void Jh();if("undefined"==typeof document)return;if(vh()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!qh()){if(7==++n)return Jh(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){Fh("__BAILINGUAL_IN_CONTEXT__","false"),Wh()}))}catch(e){dh("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var $h=function(e){return e<10?"0"+e:""+e};function ef(){var e=new Date;return e.getFullYear()+"-"+$h(e.getMonth()+1)+"-"+$h(e.getDate())+" "+$h(e.getHours())+":"+$h(e.getMinutes())+":"+$h(e.getSeconds())+":"+e.getMilliseconds()}function tf(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function nf(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",ef(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",tf({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Zh(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",ef(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",tf({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Zh(t.keyCounts)})];break;case"US":i=["D-VM",ef(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",tf({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:Zh(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var rf=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};rf.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),mh()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},rf.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=nf(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});Xh(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},rf.prototype.getRegion=function(){return this.region},rf.prototype.setRegion=function(e){this.region=e,this.startTimer()},rf.prototype.report=function(e){this.region&&this.queue.push(e)};var of=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},af={usageReportRegion:{configurable:!0}};of.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},of.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},of.customizeStorage=function(e){return function(e){Rh=e}(e)},of.getDataFromStorage=function(e){return Hh(e)},of.setDataToStorage=function(e,t){return Fh(e,t)},of.customizeFetch=function(e){Ch=e},af.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},af.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new rf({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},of.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||Th(this.canReadLocaleFromCookie))},of.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},of.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||Th(this.canReadLocaleFromCookie))},of.prototype.getServerSideFallbackData=function(){if(yh()){var e=n.g.BAILINGUAL_FALLBACK;return e||(dh("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},of.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new rf({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Qe()(e[n])){var r=kh(n);if(!r)return void ph("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=Bh({},e[n]),t.i18nText[r]=Bh({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&dh("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||ph("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},of.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Hh("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return ph("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Hh("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return ph("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){Kh(Ud,e)&&(t.i18nText[e]||dh("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},Bh(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=kh(e),Kh(Ud,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=kh(e),Kh(Ud,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{Fh("BAILINGUAL_PATCH_I18N-"+e,""),Fh("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){ph("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},of.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Qe()(document))||"object"!=("undefined"==typeof location?"undefined":Qe()(location))||vh()||fh()||hh()||gh()||(Ih(),wh("x-hng","lang="+e,{path:"/",expires:180}),wh("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(_h,e))},of.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r=t.id;this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var o=this.intlPDKVMessages[e][r];if(!o){var i=n[r];i.match(Bd)||(i=Qh(this.appName,r,i)),o=this.createIntlMessageFormat(i,e),this.intlPDKVMessages[e][r]=o}return o},of.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r=t.id,o=(null==n?void 0:n[r])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[r]){this.intlMessages[e]=this.intlMessages[e]||{};var i=this.intlMessages[e][r];return i||(i=this.createIntlMessageFormat(o,e),this.intlMessages[e][r]=i),i}return this.createIntlMessageFormat(o,e)},of.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=qh()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return dh(s),dh("[bailingual-sdk-glue] error detail:",t),this.emit(Eh,new Uh({code:Ah.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){Kh(l,t)||o.emit(Eh,new Uh({code:Ah.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return dh(u),dh("[bailingual-sdk-glue] error detail:",n),this.emit(Eh,new Uh({code:Ah.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},of.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=kh(r))||ph("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||ph("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},of.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},of.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=kh(e),Kh(this.availableLocales,e))return e},of.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):ph("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},of.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},of.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&qh()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},of.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(Bd)||(o=Qh(t.appName,r,o)),n[r]=o})),n},of.prototype.getDataWithLocale=function(e,t){e||dh("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[kh(e||this.defaultLocale)];return n&&t&&qh()?this.buildPDKVLocaleText(n):n},of.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);ph("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},of.prototype.getCurrentLocale=function(){return this.currentLocale||""},of.prototype.getDefaultLocale=function(){return this.defaultLocale},of.prototype.formatLocaleCode=function(e){return kh(e)},of.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return ph('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(Eh,new Uh({code:Ah.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return ph("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(ph("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return Yh(function(e,t,n,r,o){var i,a;return null===(a=null===(i=zh[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?Mh.DAILY:Mh.PROD,t.isIntranet?xh.INTRANET:xh.INTERNET,e.appName,e.tag,o)).then((function(e){return e?Yh(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Qe()(e[t])){var r=kh(t);r&&(n[r]=n[r]||{},Bh(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&dh("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!Kh(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=Bh({},o,r)})),o.forEach((function(t){if(!Kh(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],Kh(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(Fh("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),Fh("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(ph("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},of.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return Kh(Ud,e)}));return this.defaultLocale&&!Kh(t,this.defaultLocale)?(ph("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(bh,e),this.currentLocale&&!Kh(t,this.currentLocale)&&(dh("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},of.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},of.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},of.prototype.onDataChange=function(e){this.on(bh,e)},of.prototype.offDataChange=function(e){this.off(bh,e)},of.prototype.onLocaleChange=function(e){this.on(_h,e)},of.prototype.offLocaleChange=function(e){this.off(_h,e)},of.prototype.onError=function(e){this.on(Eh,e)},of.prototype.offError=function(e){this.off(Eh,e)},of.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},of.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},of.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},of.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},of.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},of.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},of.prototype.changeBizEnv=function(e){this.bizEnv=e},of.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},of.prototype.removeBailingualCookie=function(){Ih()},Object.defineProperties(of.prototype,af),of.customizedGetSystemLocale=void 0;var sf=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){Kh([Yd.argument,Yd.number,Yd.date,Yd.time,Yd.select,Yd.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t){return new lh(e,t,{},{ignoreTag:!0})},t}(of),lf=(new sf,"antom-language-storage-key"),cf="antom_language_change_event",uf="en_US",df=new sf;function pf(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ff(e);n&&(df.getAllLocales().map(ff).includes(n)||(n=uf),df.changeLocale(n),mf(n),t?window.location.reload():window.dispatchEvent(new Event(cf)))}function hf(e){if(e)return ff(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(lf)||window.localStorage.getItem(lf);if(t)return ff(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=df.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):ff(e)===ff(navigator.language)}))||uf;if(r)return r=ff(r)}return uf}function ff(e){var t=e;t||(t=uf);var n=t.split(/[-,_]/),r=tt(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function mf(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(lf,e),window.sessionStorage.setItem(lf,e),!0}catch(e){return!1}}"true"==={NODE_ENV:"production",PUBLIC_PATH:"/"}.ANTOM_CORE_UNIT_TEST&&df.initData(window.bailingual_ckp||{});var vf={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},gf=p(p({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),vf);iu.initConfig({i18n:df,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var yf=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","AntomError"),l(Ze(e),"response",void 0),e}return f(n,null,[{key:"isError",value:function(e){return iu.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return iu.unificationError(e,t)}}]),n}(iu),_f=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","AntomCoreError"),e}return f(n)}(yf),bf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0})}}:{success:function(){},error:function(){}}},Ef=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},Sf=(window||{}).navigator,Af=Sf.userAgent,kf=function(){var e=/OpenHarmony/i.test(Sf.userAgent),t=/Phone/i.test(Sf.userAgent),n=/Tablet/i.test(Sf.userAgent);return e&&(t||n)},Tf=/iPhone|iPad|iPod/i.test(Af)||"MacIntel"===Sf.platform&&Sf.maxTouchPoints>1,wf=(/Android/i.test(Af),/\bMacintosh\b/.test(Af),/Windows NT/.test(Af),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(Af)||kf()}),Pf=Tf,If=!!wf(),Cf=!wf();kf();var Rf=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},Nf=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return Rf(n)}},Of=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},Lf=n(9414),Df=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},Mf={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},xf="ANTOM_PAYMENT_WEB",Uf=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function Bf(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var Kf=function(){function e(t){v(this,e),l(this,"baseUrl",void 0),l(this,"headers",void 0),l(this,"method",void 0),l(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return f(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:p(p({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===Je(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){Bf().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",p({instanceId:Uf},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:Rf(t.data),headers:Hf(t.headers)};n(o)}))}))}}]),e}();function Hf(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var Ff=function(e){var t=Lf(e,"Result-Status")||Lf(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:vf.API_NOT_LOGIN,errorMessage:df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:vf.API_GATEWAY_TIMEOUT,errorMessage:df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=Lf(e,"Tips")||Lf(e,"tips","");return{success:!1,errorCode:vf.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},Yf={};function jf(e,t,n){return zf.apply(this,arguments)}function zf(){return(zf=a(o().mark((function e(t,n,r){var i,a,s,l,c,u,d,h,f,m,v,g,y,_,b,E,S,A,k,T,w;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p(p(p({},Yf),r),{},{envInfo:p(p({},Yf.envInfo),null==r?void 0:r.envInfo),headers:p(p({},Yf.headers),null==r?void 0:r.headers)}),s=bf(a.tracker,a.scope),l=Ef(a.tracker,a.scope),a.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:a.hostSign="SG";case 10:return"WAP"===(c=p(p({terminalType:If?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:Df(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==a?void 0:a.envInfo),{},{locale:hf((null==a?void 0:a.locale)||(null==a||null===(i=a.envInfo)||void 0===i?void 0:i.locale))})).terminalType&&(c.osType=Pf?"IOS":"ANDROID"),u=[p(p({},n),{},{envInfo:c,extParams:p(p({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,h=Gf(t,a),e.next=18,h({data:u});case 18:if(f=e.sent,m=f.data,v=f.headers,g=m||{},y=Lf(v,"Mgw-TraceId")||Lf(v,"mgw-traceid",""),g.traceId=y,!(_=Ff(v))){e.next=29;break}throw b=_.errorMessage,E=_.errorCode,new _f(b,E,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(m.success){e.next=34;break}throw"true"!==(null===(S=m.extendInfo)||void 0===S?void 0:S.mulityLanguageMapping)&&(m.errorMessage=df.get({id:"server.".concat(m.errorCode),defaultMessage:df.get({id:"event.callback.code.${data.errorCode}",defaultMessage:df.get({id:"ckp.paymentError.${data.errorCode}",defaultMessage:df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(k=new yf(m.errorMessage||m.resultMessage||df.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),m.errorCode||(null===(A=m.errorContext)||void 0===A||null===(A=A.errorStack)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.errorName)||"API_SYSTEM_ERROR","SERVER_API","".concat(y," (").concat(t,")"))).response=g,k;case 34:return s.success(t,performance.now()-d,y),e.abrupt("return",g);case 38:if(e.prev=38,e.t0=e.catch(14),!_f.isError(e.t0)){e.next=43;break}return s.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 43:return w=e.t0,l(w),e.abrupt("return",Promise.reject(new _f(w.message,null!==(T=w.message)&&void 0!==T&&T.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 46:case"end":return e.stop()}}),e,null,[[14,38]])})))).apply(this,arguments)}function Gf(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||Mf[i],c=p(l(l(l(l(l(l(l(l({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||xf,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(xf.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"0.0.1777017092-dev.1"),null==t?void 0:t.headers);"dev"!==i&&delete c["sofa-group-name"],"sandbox"===i&&(c["load-test"]=!0,c.sofaPenAttrs="instMock=O&loadMode=2");var u,d=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,h=Object.entries(c).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==Je(e[1])})).reduce((function(e,t){var n=tt(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),f={baseURL:s,timeout:d,headers:c},m=null;"app"===Yf.appType?m=new Kf({baseURL:s,method:"POST",timeout:d,headers:h}):m=Ti.create(p(p({},f),{},{withCredentials:null===(u=null==t?void 0:t.withCredentials)||void 0===u||u,method:(null==t?void 0:t.method)||"POST"}));return m.request}jf.setGlobalOptions=function(e){Object.assign(Yf,e)};"".concat(window.location.origin,"/elements/src/pages");var Vf=n(8994);function Wf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Vf.apply(void 0,[{},e].concat(n))}var qf=new Xu({appId:"180020050100012557",performance:!1,error:!1}),Jf="7981",Qf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){qf.log(p({code:"".concat(Jf).concat(e)},t))}},Zf=Qf(),Xf=Qf("event"),$f=Qf("iframe"),em=Qf("handshake"),tm=Qf("merchant"),nm=Qf("element"),rm=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);var e="1.0.8".replace(/-dev\.[0-9]+/,""),t="https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js";return t="https://marmot-local-dev.oss-accelerate.aliyuncs.com/tnpm-package/@antintl-opensdk-debugger/".concat(e,"/dist/main.umd.js"),(0,$c.loadScript)(t,"sdkDebugger").then((function(e){return e.variable}))},om=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};Zf({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=tt(a,3),l=s[0],c=s[1],u=s[2];Xf({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},im=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=tt(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(iu.isError(e)?e.toJSON():e);om("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},am=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","SDKInternalError"),e}return f(n)}(iu),sm=function(e){y(n,e);var t=b(n);function n(e){return v(this,n),t.call(this,"HOST",e)}return f(n,[{key:"_transferReceivePort",value:function(e){eu(nu(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){eu(nu(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){eu(nu(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){eu(nu(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=eu(nu(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return Zu.getGlobalBridge("HOST")}}]),n}(Zu),lm=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),l(Ze(i),"name","MountError"),i}return f(n)}(am),cm=function(){function e(t,n){v(this,e),l(this,"name",void 0),l(this,"_elementMode",void 0),l(this,"_isMainElement",void 0),l(this,"config",void 0),l(this,"bridge",void 0),l(this,"hooks",{}),l(this,"iframe",null),l(this,"status",void 0),l(this,"cachedSend",[]),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new sm(t),this.bridge.setOrigin(n.targetOrigin),this.config.debug&&this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Nu)||e.type.endsWith(Vu)||(e.type.endsWith(Fu)?om(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Bu)&&"IN"===t?im(e.payload):om("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))})),this.status="initialized"}var t,n,r,i;return f(e,[{key:"submit",value:function(e){throw new am("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(i=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"mount",value:(r=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new lm({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),im(n),n;case 4:return r=Au((function(){return Promise.all([i.setup(),i._mount(t)])}),15e3,new lm("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),e.abrupt("return",r().then((function(e){var t=tt(e,1)[0];tm({msg:i.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),i.bridge.send(Cu,Wf(i.config.appConfig,t||{}))})).catch((function(e){i.unmount();var t=am.unificationError(e);throw im(t),t})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(o().mark((function e(r,i){var a,s,l,c,u,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",i(new lm({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",i(new lm("container missing","MOUNT_MISSING_CONTAINER")));case 5:a=n.config.appUrl,s=new URL(n.config.appUrl);try{s.searchParams.set("origin",window.location.origin),s.searchParams.set("locale",n.config.locale),a=s.toString()}catch(e){l=a.includes("?")?"&":"?",a="".concat(a).concat(l,"origin=").concat(encodeURIComponent(window.location.origin)).concat(l,"locale=").concat(encodeURIComponent(n.config.locale))}n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=a,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.maxHeight="100vh",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.bridge.on(Vu,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),c=Date.now(),u="*";try{"null"===(u=new URL(n.iframe.src).origin)&&(u="*")}catch(e){u="*"}n.bridge.setOrigin(u),d=function(e){var t;if(console.log("handShakeHandler",e,n.status),"mounted"!==n.status&&"ready"!==n.status){if(null===(t=n.iframe)||void 0===t||!t.contentWindow)return r();om("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",$f({msg:n.name,d1:"是",m1:Math.round(Date.now()-c),m2:1}),n.bridge.setTarget(n.iframe.contentWindow);var o=Date.now(),i=setTimeout((function(){em({msg:n.name,d1:"handshake timeout",m1:Math.round(Date.now()-o),m2:0,m3:Math.round(Date.now()-c)})}),15e3);n.bridge.once(Ku,(function(e){clearTimeout(i),n.status="ready",em({msg:n.name,d1:"handshake ack",m1:Math.round(Date.now()-o),m2:1,m3:Math.round(Date.now()-c)}),n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),console.log((null==e?void 0:e.version)||"异常的版本")})),r()}},n.bridge.once(Ru,(function(){d("readyHandshake")})),n.iframe.onload=function(){setTimeout((function(){d("onload")}),200)},n.iframe.onerror=function(e){$f({msg:n.name,d1:"否",m1:Math.round(Date.now()-c),m2:0}),i(new lm("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(2),i(new lm("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 22:case"end":return e.stop()}}),e,null,[[2,19]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:function(e){try{if("destroyed"===this.status)throw new am("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");this.config.appConfig=Wf(this.config.appConfig,e),om("INFO","SDK_USAGE","Updating configuration via API",e),this.bridge.send(Nu,{merged:this.config.appConfig,updated:e})}catch(e){im(am.unificationError(e))}}},{key:"unmount",value:function(){"mounted"!==this.status&&"ready"!==this.status||(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe)))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):im(new am("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:(t=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("HOST"===this.bridge.mode){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("submit method only available in HOST mode")));case 2:return this.send(Ou,t),e.abrupt("return",new Promise((function(e){n.bridge.once(Lu,(function(t){e(t)}))})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e;null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e()})),this.hooks={},this.bridge.destroy(),this.unmount(),this.status="destroyed"}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();l(cm,"elementType",void 0);var um=function(e){y(n,e);var t=b(n);function n(e,r,o,i){return v(this,n),t.call(this,e,p(p({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return f(n,[{key:"_submit",value:function(e){return eu(nu(n.prototype),"_submit",this).call(this,e)}}]),n}(cm),dm=function(){function e(t){var n,r=this;v(this,e),l(this,"config",void 0),l(this,"isInit",!1),l(this,"version",void 0),l(this,"elementMode","SINGLE"),l(this,"_elements",new Map),l(this,"globalBridgeForWebApp",void 0),l(this,"globalBridgeForModal",void 0),l(this,"openModalHandle",void 0),l(this,"elementClasses",{}),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,Jf=n);var i=this.globalBridgeForWebApp=sm.getGlobalBridge();this.globalBridgeForWebApp.on(Mu,function(){var e=a(o().mark((function e(t){var n,a,s,l,c,u,d,h,f,m;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(a=r.globalBridgeForModal=sm.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&om("INFO","SDK_INTERNAL",e.type,e.payload)})),(s=r._elements.get(t.scope))&&null!==(n=s.iframe)&&void 0!==n&&n.contentWindow?i.setTarget(s.iframe.contentWindow):om("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available, confirm close may not work"),e.prev=4,l=new URL(t.url),t.closeConfirm&&(l.searchParams.append("confirm","true"),l.searchParams.has("closeConfirm")&&(t.closeConfirm=!0)),t.url=l.toString(),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(4),c=new am("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),i.send(xu,c),e.abrupt("return");case 15:return u=new MessageChannel,d=Tu("modal_"),e.next=19,r.openModal(p(p({},t),{},{onClose:function(){if(t.closeConfirm)return new wu(d,u.port2).close(!0)}}));case 19:h=r.openModalHandle=e.sent,t.appearance&&(f=function(){a.setTarget(h.getContentWindow()),a.send(Gu,t.appearance)},h.onLoadedSuccess(f)),t.closeConfirm&&(i.send(ju,d,[u.port1]),m=function(){a.setTarget(h.getContentWindow()),a.send(zu,d,[u.port2])},h.onLoadedSuccess(m)),i.on(Uu,(function(){h.destroy(),a.destroy()}));case 23:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}()),i.on(Du,function(){var e=a(o().mark((function e(t){var n,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.url,i=t.mode,a=void 0===i?"redirect":i,s=t.destory,(void 0===s||s)&&r.destroy(),"replace"===a?window.location.replace(n):"redirect"===a&&(window.location.href=n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Fu)?om(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Bu)&&"IN"===t?im(e.payload):e.type.endsWith(xu)?om("ERROR","APP_RUNTIME","Open modal error",e.payload):om("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new am("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new am('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return f(e,[{key:"openModal",value:(n=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return om("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"init",value:(t=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,rm().then((function(e){null==e||e.mount()})).catch((function(){var e=new am("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");im(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy()}},{key:"_generateElementKey",value:function(e,t){try{return this.generateElementKey(e,t)}catch(r){var n=new am({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw im(n),n}}},{key:"_createElement",value:function(e,t){var n,r=this;nm({msg:e});var o,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],nm({msg:e,m1:n?1:0}),!n){var a=new am({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw im(a),a}try{o=new n(i,p(p({},this.config),{},{elementMode:this.elementMode,appConfig:p({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=am.isError(a)?a:new am({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw im(s),s}return o._addHook("ondestroy",(function(){r._removeElement(e,t),r._getElementSize()||om("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,o,t),o}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new am({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw im(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),pm=function(e){y(r,e);var t,n=b(r);function r(e){var t;return v(this,r),t=n.call(this,e),l(Ze(t),"waitSendPort",[]),l(Ze(t),"mainElement",void 0),t.elementMode="GROUP",t}return f(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=eu(nu(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new am("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw im(i),i}this.mainElement=o;var a=new Pu(e);o.on(Ku,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort($e(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new Iu(e,s.port1);o.on(Ku,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=a(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new am("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),im(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(dm),hm=function(e){y(n,e);var t=b(n);function n(){return v(this,n),t.apply(this,arguments)}return f(n)}(dm);function fm(e,t){return mm.apply(this,arguments)}function mm(){return(mm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",jf("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vm(e,t){return gm.apply(this,arguments)}function gm(){return(gm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",jf("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ym(e){return function(){var e=location.origin,t=localStorage.getItem("APP_PUBLIC_PATH");return t&&(e=t),"".concat(e,"/elements/").concat(localStorage.getItem("ANTOM_LOCAL")?"src/pages":"pages")}()+(e.startsWith("/")?e:"/".concat(e))}var _m=Nf,bm=(h()(h()(h()({},gf),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR"}),function(e){_()(n,e);var t=E()(n);function n(){var e;g()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),c()(Xe()(e),"name","AntomSDKError"),e}return m()(n)}(yf)),Em=["paypal"],Sm=["createOrder","onShippingAddressChange","onShippingOptionsChange"],Am=["local","dev","sit","pre","prod","sandbox"];function km(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod";try{var n=window.location.search,r=window.location.hash,o=r.replace(/^#\??/,"");e=new URLSearchParams(o+(n?(o?"&":"")+n.slice(1):""))}catch(t){e=new URLSearchParams}var i="true"===e.get("_moreEnv");if(!i)return{env:t,hostSign:"",baseURL:""};var a=e.get("environment")||t,s=Am.includes(a)?a:t;return{env:s,hostSign:e.get("hostSign")||"",baseURL:e.get("requestHost")||""}}function Tm(e,t,n){var r=new bm(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function wm(e){var t=["paypal","applePay","googlePay","alipay"],n=null==e?void 0:e.paymentMethods;if(!Array.isArray(n)||0===n.length)return Tm("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var r,o=d()(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(!t.includes(i))return Tm("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(i),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){o.e(e)}finally{o.f()}return!n.includes("paypal")||null!=e&&e.paypal?null:Tm("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}var Pm=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o;g()(this,r);var i=t.appConfig||{},a=i.paypal,s=Ys()(i,Em),l=a||{},u=l.createOrder,d=l.onShippingAddressChange,p=l.onShippingOptionsChange,f=Ys()(l,Sm),m=h()(h()({},s),Object.keys(f).length>0&&{paypal:f}),v=t.locale||"en_US";return o=n.call(this,e,ym("/express_element/index.html"),h()(h()({},t),{},{appConfig:m},v?{locale:v}:{}),Wf({appearance:{displaySetting:{showCardBrandIcon:!0}}},m)),c()(Xe()(o),"_callbacks",{}),c()(Xe()(o),"_overlay",null),o._callbacks={paypalCreateOrder:u,paypalOnShippingAddressChange:d,paypalOnShippingOptionsChange:p},o}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.config.appConfig,r=null==n?void 0:n.sessionData,o=(null==n?void 0:n.locale)||"en_US",this.registerInternalListeners(),!(a=wm(n))){e.next=7;break}return e.abrupt("return",{sessionData:r,locale:o,setupError:a});case 7:if(!(Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("paypal")){e.next=43;break}return c=null==n?void 0:n.paypal,u=(null==c?void 0:c.channelMerchantAccountId)||"",d=(null==n?void 0:n.businessDivision)||"",p=(null==n||null===(s=n.amount)||void 0===s?void 0:s.currency)||"",f=(null==n||null===(l=n.amount)||void 0===l?void 0:l.value)||"",m=this.config.env||"prod",v=km(m),g=v.env,y=v.hostSign,_=v.baseURL,b=y||("US"===d?"US":"DE"===d?"DE":"SG"),e.prev=18,om("INFO","SDK_USAGE","ExpressElement: querying PayPal channelClientId...",{channelMerchantAccountId:u,env:g,locale:o}),e.next=22,vm({clientId:u,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:d,amount:{currency:p,value:f}},{env:g,hostSign:b,baseURL:_,locale:o,timeout:1e5});case 22:if(!0!==(null==(S=e.sent)?void 0:S.success)||!S.channelClientId){e.next=26;break}return om("INFO","SDK_USAGE","ExpressElement: channelClientId resolved:",S.channelClientId),e.abrupt("return",{sessionData:r,locale:o,paypal:h()(h()({},c),{},{channelMerchantAccountId:S.channelClientId})});case 26:if(!0!==(null==S?void 0:S.success)){e.next=29;break}return om("ERROR","SDK_USAGE","ExpressElement: channelClientId missing in success response:",S),e.abrupt("return",{sessionData:r,locale:o,setupError:new bm("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON()});case 29:return om("ERROR","SDK_USAGE","ExpressElement: channelClientId query returned non-success:",S),A=new bm((null==S?void 0:S.errorMessage)||"channelClientId query failed",(null==S?void 0:S.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),"true"===(null==S||null===(E=S.extendInfo)||void 0===E?void 0:E.mulityLanguageMapping)&&(A.mulityLanguageMapping=!0),e.abrupt("return",{sessionData:r,locale:o,setupError:A});case 35:return e.prev=35,e.t0=e.catch(18),om("ERROR","SDK_USAGE","ExpressElement: channelClientId query exception:",e.t0),i=void 0,i="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),T={code:i?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:i?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},w=new bm(T.message,T.code,"SDK_USAGE").toJSON(),"true"===(null===e.t0||void 0===e.t0||null===(k=e.t0.response)||void 0===k||null===(k=k.extendInfo)||void 0===k?void 0:k.mulityLanguageMapping)&&(w.mulityLanguageMapping=!0),e.abrupt("return",{sessionData:r,locale:o,setupError:w});case 43:if(r){e.next=45;break}return e.abrupt("return",{sessionData:void 0});case 45:if(om("INFO","SDK_USAGE","ExpressElement setup called with sessionData:",{sessionData:r}),P=_m(r)){e.next=49;break}return e.abrupt("return",{sessionData:r,setupError:bm.unificationError(new Error("Failed to parse sessionData, please check the sessionData")).toJSON()});case 49:if("ELEMENT_PAYMENT"===(I=null===(t=P.paymentSessionConfig)||void 0===t?void 0:t.productScene)){e.next=52;break}return e.abrupt("return",{sessionData:r,setupError:bm.unificationError(new Error("Invalid productScene in sessionData, expected ELEMENT_PAYMENT, but get ".concat(I,", please check the sessionData is correct?"))).toJSON()});case 52:return e.abrupt("return",{sessionData:r});case 53:case"end":return e.stop()}var i}),e,this,[[18,35]])}))),function(){return t.apply(this,arguments)})},{key:"_showOverlay",value:function(){var e=this;if(!this._overlay){var t=document.createElement("div");t.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){t.style.opacity="1"}));var n=document.createElement("button");n.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",n.innerHTML="&#x2715;",n.addEventListener("click",(function(){e._hideOverlay()}));var r=document.createElement("div");r.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var o=document.createElement("div");o.setAttribute("role","img"),o.setAttribute("aria-label","PayPal"),o.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var i=document.createElement("p");i.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",i.textContent="Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods.",r.appendChild(o),r.appendChild(i),t.appendChild(n),t.appendChild(r),document.body.appendChild(t),this._overlay=t}}},{key:"_hideOverlay",value:function(){this._overlay&&(this._overlay.remove(),this._overlay=null)}},{key:"registerInternalListeners",value:function(){var e=this,t=this.iframe;t&&(t.style.opacity="0",t.style.transition="height 0.35s, opacity 0.4s 0.1s",t.style.height="0px",t.style.width="100%",t.style.display="block");var n=!1;this.on("contentHeightChanged",(function(t){var r=e.iframe;r&&(null==t?void 0:t.height)>0&&(r.style.height="".concat(t.height,"px"),n||(n=!0,requestAnimationFrame((function(){r.style.opacity="1"}))))})),this.on("click",(function(t){e._showOverlay(),om("INFO","SDK_USAGE","ExpressElement click:",t)})),this.on("ready",(function(e){om("INFO","SDK_USAGE","ExpressElement ready:",e)})),this.on("confirm",(function(t){e._hideOverlay(),om("INFO","SDK_USAGE","ExpressElement confirm:",t)})),this.on("error",(function(t){e._hideOverlay(),om("ERROR","SDK_USAGE","ExpressElement payment error:",t)})),this.on("cancel",(function(t){e._hideOverlay(),om("INFO","SDK_USAGE","ExpressElement cancel:",t)})),this.on("paypal:createOrder",function(){var t=s()(i()().mark((function t(n){var r,o;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.requestId,t.prev=1,e._callbacks.paypalCreateOrder){t.next=4;break}throw new Error("paypal.createOrder is not provided");case 4:return t.next=6,e._callbacks.paypalCreateOrder();case 6:o=t.sent,e.send("paypal:createOrder:reply",{requestId:r,sessionData:o}),om("INFO","SDK_USAGE","PayPal createOrder success:",{requestId:r,sessionData:o}),t.next=16;break;case 11:t.prev=11,t.t0=t.catch(1),e.send("paypal:createOrder:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"createOrder failed"}),e._hideOverlay(),om("ERROR","SDK_USAGE","PayPal createOrder failed:",t.t0);case 16:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}()),this.on("paypal:onShippingAddressChange",function(){var t=s()(i()().mark((function t(n){var r,o,a,s;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.requestId,o=n.shippingData,t.prev=1,t.next=4,null===(a=(s=e._callbacks).paypalOnShippingAddressChange)||void 0===a?void 0:a.call(s,o,{});case 4:e.send("paypal:onShippingAddressChange:reply",{requestId:r}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),e.send("paypal:onShippingAddressChange:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"onShippingAddressChange failed"});case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()),this.on("paypal:onShippingOptionsChange",function(){var t=s()(i()().mark((function t(n){var r,o,a,s;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.requestId,o=n.shippingData,t.prev=1,t.next=4,null===(a=(s=e._callbacks).paypalOnShippingOptionsChange)||void 0===a?void 0:a.call(s,o,{});case 4:e.send("paypal:onShippingOptionsChange:reply",{requestId:r}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),e.send("paypal:onShippingOptionsChange:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"onShippingOptionsChange failed"});case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(um);c()(Pm,"elementType","express");function Im(){var e=window.localStorage.getItem("ANTOM_ENV")||"dev",t=window.localStorage.getItem("ANTOM_BASE_URL")||void 0,n=window.localStorage.getItem("ANTOM_GROUP_ID")||void 0,r=JSON.parse(JSON.stringify({baseURL:t,group:n,env:e}));return console.log("[getDevReqConfig] dev request config:",r),r}function Cm(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=d()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var Rm=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a,s,l;($u.setTrackId(Of(t.appConfig.sessionData)),a=Of(t.appConfig.sessionData),qf.setTrackId(a),i=n.call(this,e,ym("/vaulting/index.html"),t,Wf({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default"}},t.appConfig)),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&jf.setGlobalOptions({hostSign:(l=null===(s=t.appConfig)||void 0===s?void 0:s.sessionData,l.split("&&")[1]||"SG")});return i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData){e.next=3;break}throw new bm("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");case 3:if(om("INFO","SDK_USAGE","VaultingElement setup called with sessionData:",{sessionData:s}),l=_m(s)){e.next=7;break}throw new bm("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");case 7:if("ELEMENT_VAULT"===(c=null===(n=l.paymentSessionConfig)||void 0===n?void 0:n.productScene)){e.next=10;break}throw new bm("Invalid productScene in sessionData, expected ELEMENT_VAULT, but get ".concat(c,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");case 10:return e.next=12,fm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:l.paymentSessionConfig,paymentSessionData:s}).then((function(e){return{data:e,error:void 0}})).catch((function(e){return{error:bm.unificationError(e),data:void 0}}));case 12:return u=e.sent,d=Cm(u.data),pf(p=d||(null===(r=this.config.appConfig)||void 0===r?void 0:r.locale)||this.config.locale),e.abrupt("return",{sessionData:s,renderData:u.data,renderDataError:null===(o=u.error)||void 0===o?void 0:o.toJSON(),sdkVersion:"0.0.1777017092-dev.1",paymentSessionConfig:l.paymentSessionConfig,locale:p,merchantId:(null===(a=u.data)||void 0===a?void 0:a.merchantId)||"未请求到,请求失败了",_requestConfig:h()({env:this.config.env},Im())});case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(um);c()(Rm,"elementType","vaulting");var Nm=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"canUseElements",value:function(){return[Rm,Pm]}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}}]),n}(pm),Om=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o;g()(this,r);return(o=n.call(this,e,ym("/element_payment_modern/index.html"),t,Wf({appearance:{theme:"default"}},t.appConfig))).on("destroy",(function(){o.destroy()})),o}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"0.0.1777017092-dev.1",_requestConfig:h()({env:this.config.env},Im())}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(um);c()(Om,"elementType","CVV");var Lm="ams-popup",Dm=300,Mm="ams-component-popup-loading",xm="\n .".concat(Lm,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Lm,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Lm,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Lm,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Dm,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Lm,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Dm,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Lm,"-drawer-enter {\n animation: slideIn ").concat(Dm,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Lm,"-drawer-exit {\n animation: slideOut ").concat(Dm,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),Um=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(Mm),n.id=Mm,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Cf?t:100*n/e;return Math.min(r,t)}(),"px"),n};var Bm=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,a=void 0===o||o,l=e.hideCloseWhenLoaded,c=void 0===l||l,u=e.onClose,d=e.textDirection,p=void 0===d?"ltr":d,h=e.showLoading,f=void 0===h||h,m=document.createElement("div");m.classList.add("".concat(Lm,"overlay"),"".concat(Lm,"fadeIn"));var v=document.createElement("div");"desktop"===t?(v.classList.add("".concat(Lm,"modal"),"".concat(Lm,"fadeIn")),v.style.width="656px",v.style.height="620px",v.style.borderRadius="12px"):(v.classList.add("".concat(Lm,"modal-mobile"),"".concat(Lm,"-drawer-enter")),v.style.width="100%",v.style.height="80vh",v.style.borderRadius="12px 12px 0 0"),v.setAttribute("dir",p);var g=function(e,t,n){return function(){t&&(t.classList.remove("".concat(Lm,"fadeIn")),t.classList.add("".concat(Lm,"fadeOut")),"desktop"===e?(n.classList.remove("".concat(Lm,"fadeIn")),n.classList.add("".concat(Lm,"fadeOut"))):(n.classList.remove("".concat(Lm,"-drawer-enter")),n.classList.add("".concat(Lm,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),Dm))}}(t,m,v),y=document.createElement("iframe");y.src=n,y.style.border="none",y.style.width="100%",y.style.height="100%";var _,b=r||{},E=b.theme,S=void 0===E?"light":E,A=b.backgroundColor,k=void 0===A?"#ffffff":A,T=Um(S);if(y.addEventListener("load",(function e(){v.removeChild(T),y.removeEventListener("load",e)})),a){var w=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(_=!1,s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=2;break}return e.abrupt("return");case 2:return null===(t=T.parentNode)||void 0===t||t.removeChild(T),v.removeChild(y),n=Um(S,df.get({defaultMessage:"closing",id:"antom.common.closing"})),v.appendChild(n),_=!0,e.prev=7,e.next=10,null==u?void 0:u();case 10:return e.prev=10,_=!1,e.finish(10);case 13:g();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:p});c&&y.addEventListener("load",(function e(){v.removeChild(w),y.removeEventListener("load",e)})),v.appendChild(w)}if(f){v.style.backgroundColor=k,y.style.backgroundColor=k;y.addEventListener("load",(function e(){var t;null===(t=T.parentNode)||void 0===t||t.removeChild(T),y.removeEventListener("load",e)})),v.appendChild(T)}v.appendChild(y);var P,I=document.getElementsByTagName("body")[0];return(P=document.createElement("style")).innerHTML=xm,document.head.appendChild(P),I.appendChild(m),I.appendChild(v),{iframe:y,destroy:g}};var Km=n(817),Hm=n.n(Km),Fm={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#141935"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#070b29"},cherryBlossomPink:{theme:"light",backgroundColor:"#FFFCFD"}},Ym={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"0.0.1777017092-dev.1",trackerCode:"7982"},jm=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t,n,r;return g()(this,a),t=o.call(this,Wf(Ym,e)),$u.initTracker(),jf.setGlobalOptions(h()(h()({env:t.config.env},Im()),{},{sdkVersion:t.config.version,tracker:$u,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=Hm(),r=null==e?void 0:e.locale,df.initData(n),r&&pf(r),t}return m()(a,[{key:"canUseElements",value:function(){return[Rm,Om,Pm]}},{key:"updateConfig",value:function(e){e.env&&jf.setGlobalOptions({env:e.env}),e.locale&&(jf.setGlobalOptions({envInfo:{locale:e.locale}}),pf(e.locale)),tu()(ru()(a.prototype),"updateConfig",this).call(this,e)}},{key:"openModal",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",s=null!==(r=Fm[a])&&void 0!==r?r:Fm.default,l=Bm(h()(h()({},t),{},{loadingConfig:h()(h()({},t.loadingConfig),{},{theme:s.theme,backgroundColor:(null==t||null===(o=t.appearance)||void 0===o||null===(o=o.variables)||void 0===o?void 0:o["background-primary"])||s.backgroundColor})})),c=l.iframe,u=l.destroy,d=function e(){om("ERROR","SDK_INTERNAL","modal load error"+t.url),c.removeEventListener("error",e),u()},c.addEventListener("error",d),e.abrupt("return",{destroy:u,onLoadedSuccess:function(e){c.addEventListener("load",(function(){e()}))},getContentWindow:function(){return c.contentWindow}});case 6:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"elements",value:function(){return new Nm(this.config)}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}},{key:"extractMainElement",value:function(e){if(e instanceof pm){var t=e._mainElement;if(!t)throw new bm("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof um)return e;throw new bm("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=bm.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmPayment",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=10;break}return e.prev=1,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({sessionData:t.sessionData,redirect:t.redirect||"always"}));case 6:return e.prev=6,e.t0=e.catch(1),r=bm.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,userCanceled3D:!1,status:"FAIL",error:{code:r.code,message:r.message}});case 10:return(o=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance})).mount(document.body),e.prev=12,e.next=15,new Promise((function(e,t){var n=setTimeout((function(){t(new bm("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);o.on(Ku,(function(){clearTimeout(n),e()}))}));case 15:e.next=23;break;case 17:return e.prev=17,e.t1=e.catch(12),o.unmount(),a=bm.unificationError(e.t1),s=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:a.code,message:a.message,status:s.includes(a.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:a.code,message:a.message}});case 23:return e.abrupt("return",o.submit({sessionData:t.sessionData,redirect:t.redirect||"always"}));case 24:case"end":return e.stop()}}),e,this,[[1,6],[12,17]])}))),function(e){return t.apply(this,arguments)})}]),a}(hm);c()(jm,"version","0.0.1777017092-dev.1");var zm,Gm,Vm=["env","environment"],Wm=function(){var e=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).env,o=n.environment,a=Ys()(n,Vm),s=r||o||"prod",e.abrupt("return",(0,$c.createSingletonInstance)(jm,h()(h()({},a),{},{env:s}),"AntomSDK"));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(Gm=["CDN","NPM"]).includes(zm="CDN")&&"undefined"!=typeof window&&(Gm.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=zm,Xc.setMedta({integrationType:zm})));var qm=jc}(),r}()}));
6
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={4989:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث استثناء غير معروف، يرجى التحقق من حالة الدفع والتواصل مع التاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى."}},8143:function(e){e.exports={"page.wrong.error.message":"Error del sistema"}},1286:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Unbekannte Fehlermeldung. Bitte überprüfen Sie den Zahlungsstatus und wenden Sie sich an den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut."}},9715:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος"}},3282:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please check your payment status and contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again."}},6233:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Por favor, revise la situación del pago y contacte con el comerciante.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo."}},1269:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s'est produite. Veuillez vérifier l'état de votre paiement et contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer."}},6543:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"अज्ञात त्रुटि। कृपया अपनी भुगतान स्थिति जाँचें और व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।"}},7801:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui, silakan periksa status pembayaran dan hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi."}},817:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(3282),r["pt-BR"]=r["pt-br"]=n(9747),r["es-ES"]=r["es-es"]=n(6233),r["ko-KR"]=r["ko-kr"]=n(6367),r["zh-CN"]=r["zh-cn"]=n(6377),r["zh-HK"]=r["zh-hk"]=n(910),r["ms-MY"]=r["ms-my"]=n(6444),r["in-ID"]=r["in-id"]=n(7801),r["th-TH"]=r["th-th"]=n(4744),r["vi-VN"]=r["vi-vn"]=n(9443),r["tl-PH"]=r["tl-ph"]=n(1153),r["it-IT"]=r["it-it"]=n(6858),r["de-DE"]=r["de-de"]=n(1286),r["fr-FR"]=r["fr-fr"]=n(1269),r["nl-NL"]=r["nl-nl"]=n(7465),r["ja-JP"]=r["ja-jp"]=n(7312),r.ro=r.ro=n(4803),r["pl-PL"]=r["pl-pl"]=n(7846),r["ar-SA"]=r["ar-sa"]=n(4989),r["tr-TR"]=r["tr-tr"]=n(9499),r["hi-IN"]=r["hi-in"]=n(6543),r["pt-PT"]=r["pt-pt"]=n(7021),r.ca=r.ca=n(8143),r.el=r.el=n(9715),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},6858:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Errore sconosciuto. Si prega di verificare lo stato del pagamento e di contattare il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova."}},7312:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"未知のエラーが発生しました。お支払い状況をご確認のうえ、加盟店へお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。"}},6367:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 결제 상황을 확인하고 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요."}},6444:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat tidak diketahui. Sila semak butiran pembayaran anda dan hubungi peniaga.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi."}},7465:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Onbekende uitzondering. Controleer de betalingsstatus en neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw."}},7846:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Sprawdź status płatności i skontaktuj się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie."}},9747:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Erro desconhecido. Verifique o status do pagamento e entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente."}},7021:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu uma exceção desconhecida. Verifique a situação do pagamento e entre em contacto com o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente."}},4803:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"Eroare necunoscută. Vă rugăm să verificați statutul plății și să luați legătura cu comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou."}},4744:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ กรุณาตรวจสอบสถานะการชำระเงินและติดต่อผู้ขาย。","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。"}},1153:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Hindi kilalang error. Pakisuri ang mga detalye ng iyong pagbabayad at makipag-ugnayan sa merchant.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli."}},9499:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu, lütfen ödeme durumunu kontrol edin ve satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin."}},9443:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Lỗi không xác định. Vui lòng kiểm tra lại thông tin thanh toán và liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại."}},6377:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"未知异常,请检查付款情况并联系商户。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。"}},910:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"未知異常,請檢查付款情況並聯絡商家。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。"}},8306:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=void 0,t.createSingletonInstance=l,t.createInstance=c,t.createLoader=function(e){var t=this,n=e.sdkURL,s=e.globalName,u=e.timeout,d=void 0===u?2e4:u,p=e.onLoadComplete,h=e.onError,f=e.onLoadStart,m=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,u,v=this;return o(this,(function(_){var b,E;return null==f||f(),t=Date.now(),i.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),b=function(){return(0,a.loadScriptClass)(n,s)},E=d,u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new a.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(E)))}),E)})),b.apply(void 0,e)])},[2,u().then((function(n){return r(v,[n],void 0,(function(n){var r,u,d,h=n.variable,f=n.cache;return o(this,(function(n){switch(n.label){case 0:if(r=Date.now(),f||i.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new a.LoaderError("NO_REMOTE_CLASS","No variables ".concat(s," were found. Cannot be initialized the Class ").concat(s));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?l:c)(h,e,void 0)];case 2:return u=n.sent(),i.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:u.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==m||m(u,window.location.href),[2,u];case 3:throw d=n.sent(),new a.LoaderError("INIT_ERROR","Initialize Class ".concat(s," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=a.LoaderError.unificationError(e);return i.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var i=n(2611),a=n(7880);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});var s=null;function l(e,t,n){return s||(s=c(e,t,n))}function c(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&i.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new a.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&i.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}},2611:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var i=n(7880),a=function(){function e(e){var t=this;Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e,this.loadTacker().then((function(e){t.tracker=e}))}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,i.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.1/dist/tracker.umd.js","intlSdkTracker").then((function(t){var n;return null===(n=null==t?void 0:t.variable)||void 0===n?void 0:n.getTrackerInstance(e.initOptions)}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=a;var s=(null==="DEV"?void 0:"DEV".toUpperCase())||"PROD",l=["DEV","SIT","PRE","PROD","LOCAL"].includes(s)?s:"PROD";t.tracker=new a({appId:"180020050100012557",env:l,server:"sg",performance:!1,error:!1})},7880:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},7861:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=l(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,l=r-o;s<l;s+=a)i.push(c(e,s,s+a>l?l:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a<s;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},6207:function(e,t,n){"use strict";var r=n(7861),o=n(9090),i=n(8736);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n);e=s(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function _(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return j(Y(t,e.length-n),e,n,r)}function E(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return E(e,t,n,r)}function A(e,t,n,r){return j(F(t),e,n,r)}function k(e,t,n,r){return j(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=P));return n}(r)}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=void 0!==n.g.TYPED_ARRAY_SUPPORT?n.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return c(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return u(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){i=c[d],a=u[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=H(e[i]);return o}function N(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function x(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||x(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||x(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||L(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=l.isBuffer(e)?e:Y(new l(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var K=/[^+\/0-9A-Za-z-_]/g;function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}},8736:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9090:function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=f,a/=256,c-=8);e[n+h-f]|=128*m}},8098:function(e,t,n){var r=n(4944).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(E,t),u?g(e):a}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function E(){var e=m();if(b(e))return S(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?f(n,i-(e-c)):n}(e))}function S(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function A(){var e=m(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(E,t),g(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},A.flush=function(){return void 0===s?a:S(m())},A}},9414:function(e,t,n){var r=n(4944).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,f="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=h||f||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,b=m["__core-js_shared__"],E=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=y.toString,A=_.hasOwnProperty,k=_.toString,T=RegExp("^"+S.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=m.Symbol,P=g.splice,I=K(m,"Map"),C=K(Object,"create"),R=w?w.prototype:void 0,N=R?R.toString:void 0;function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||G(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:H(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[Y(t[o++])];return o&&o==i?e:void 0}function U(e){if(!z(e)||(t=e,E&&E in t))return!1;var t,n=function(e){var t=z(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}O.prototype.clear=function(){this.__data__=C?C(null):{}},O.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},O.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===o?void 0:n}return A.call(t,e)?t[e]:void 0},O.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:A.call(t,e)},O.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?o:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():P.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return M(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new O,map:new(I||L),string:new O}},D.prototype.delete=function(e){return B(this,e).delete(e)},D.prototype.get=function(e){return B(this,e).get(e)},D.prototype.has=function(e){return B(this,e).has(e)},D.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=F((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(G(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function Y(e){if("string"==typeof e||G(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(F.Cache||D),n}F.Cache=D;var j=Array.isArray;function z(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function G(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},8994:function(e,t,n){e=n.nmd(e);var r=n(4944).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=p||h||Function("return this")(),m="object"==r(t)&&t&&!t.nodeType&&t,v=m&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===m,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function E(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S,A,k,T=Array.prototype,w=Function.prototype,P=Object.prototype,I=f["__core-js_shared__"],C=w.toString,R=P.hasOwnProperty,N=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=P.toString,L=C.call(Object),D=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=g?f.Buffer:void 0,x=f.Symbol,U=f.Uint8Array,B=M?M.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,k=Object,function(e){return A(k(e))}),H=Object.create,Y=P.propertyIsEnumerable,F=T.splice,j=x?x.toStringTag:void 0,z=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),G=M?M.isBuffer:void 0,V=Math.max,W=Date.now,q=ve(f,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ie(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Ae(e),r=!n&&Se(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Re(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!Ee(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];R.call(e,t)&&Ee(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return R.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:R.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():F.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=me(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return me(this,e).get(e)},$.prototype.has=function(e){return me(this,e).has(e)},$.prototype.set=function(e,t){var n=me(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=O.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return O.call(e)}(e)}function ce(e){return Ce(e)&&le(e)==a}function ue(e){return!(!Ie(e)||function(e){return!!N&&N in e}(e))&&(we(e)?D:c).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ie(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&R.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ie(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Ae(c),f=!h&&Te(c),m=!h&&!f&&Re(c);d=c,h||f||m?Ae(s)?d=s:Ce(b=s)&&ke(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=B?B(n):new e.constructor(n);return e.copy(r),r}(c,!0)):m?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!Ce(e)||le(e)!=l)return!1;var t=K(e);if(null===t)return!0;var n=R.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==L}(c)||Se(c)?(d=s,Se(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Ne(e))}(s):Ie(s)&&!we(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(K(e))}(c))):p=!1}var v,g,y,_;var b;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Ne)}function he(e,t){return be(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),E(e,this,s)}}(e,t,De),e+"")}var fe=z?function(e,t){return z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:De;function me(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||P)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function Ee(e,t){return e===t||e!=e&&t!=t}var Se=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&R.call(e,"callee")&&!Y.call(e,"callee")},Ae=Array.isArray;function ke(e){return null!=e&&Pe(e.length)&&!we(e)}var Te=G||function(){return!1};function we(e){if(!Ie(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Pe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ie(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==r(e)}var Re=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&Pe(e.length)&&!!d[le(e)]};function Ne(e){return ke(e)?te(e,!0):de(e)}var Oe,Le=(Oe=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=Oe.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ie(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&Ee(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&Oe(e,s,n,i)}return e})));function De(e){return e}e.exports=Le},3089:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8319:function(e,t,n){var r=n(7652);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7652:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},3317:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},4180:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},4786:function(e,t,n){var r=n(3317);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7374:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4331:function(e,t,n){var r=n(7652);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},8193:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},1404:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},8946:function(e,t,n){var r=n(7652);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},5486:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},1486:function(e,t,n){var r=n(9687),o=n(2424);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},702:function(e,t,n){var r=n(5281);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},9746:function(e,t,n){var r=n(5508);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},3400:function(e,t,n){var r=n(2242),o=n(2424),i=n(1983);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4143:function(e,t,n){var r=n(5281);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},5225:function(e,t,n){var r=n(3155);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2242:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5821:function(e,t,n){var r=n(9687);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},2185:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},2424:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},4682:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7249:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},20:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},114:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},5118:function(e,t,n){var r=n(4143);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},4005:function(e,t,n){var r=n(5166);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},5166:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},1983:function(e,t,n){var r=n(4944).default,o=n(7374);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7662:function(e,t,n){var r=n(4944).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new O(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var m="suspendedStart",v="executing",g="completed",y={};function _(){}function b(){}function E(){}var S={};p(S,c,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(L([])));k&&k!==i&&a.call(k,c)&&(S=k);var T=E.prototype=_.prototype=Object.create(S);function w(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(o,i,s,l){var c=f(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function I(e,n,r){var o=m;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=E,s(T,"constructor",{value:E,configurable:!0}),s(E,"constructor",{value:b,configurable:!0}),b.displayName=p(E,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},w(P.prototype),p(P.prototype,u,(function(){return this})),n.AsyncIterator=P,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new P(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=L,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9687:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7925:function(e,t,n){var r=n(4180),o=n(7249),i=n(5508),a=n(20);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3155:function(e,t,n){var r=n(2242);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},4044:function(e,t,n){var r=n(4786),o=n(4682),i=n(5508),a=n(114);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},224:function(e,t,n){var r=n(4944).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5281:function(e,t,n){var r=n(4944).default,o=n(224);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},4944:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5508:function(e,t,n){var r=n(3317);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3697:function(e,t,n){var r=n(8319);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){var r=n(2242),o=n(9687),i=n(2185),a=n(1486);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return $c},AMSAutoDebitPay:function(){return Vc},AMSCashierPayment:function(){return Wc},AMSCheckout:function(){return Gc},AMSCheckoutPage:function(){return jc},AMSEasyPay:function(){return Xc},AMSElement:function(){return Zc},AMSVaulting:function(){return qc},AddressElement:function(){return Qc},AntomElement:function(){return Jc},AntomSDK:function(){return Gm},ComponentSignEnum:function(){return z},ComponentSignEnumV2:function(){return j},ConnectErrorCode:function(){return pe},DisplayTypeEnum:function(){return F},ElementType:function(){return O},EnvironmentEnum:function(){return $},EventLoggingEventId:function(){return fe},InterActionTypeEnum:function(){return de},MessageName:function(){return re},PaymentAmountEnum:function(){return q},PaymentElementLayout:function(){return x},PaymentMethodCategoryTypeEnum:function(){return V},PaypalMethodEnum:function(){return ce},PlatformEnum:function(){return ne},ProductSceneEnum:function(){return G},ProductSceneVersion:function(){return ue},RedirectType:function(){return le},RiskSdkInfoEnum:function(){return he},TargetEnum:function(){return oe},ThemeType:function(){return M},checkoutDisplayEnum:function(){return Q},default:function(){return Qm},errorEnum:function(){return ie},eventCodeEnum:function(){return se},loadAntom:function(){return Jm},localeEnum:function(){return J},modeEnum:function(){return Z},networkModeEnum:function(){return X},osTypeEnum:function(){return ee},payPalConfigurationIntentEnum:function(){return W},redirectTypeEnum:function(){return ae},terminalTypeEnum:function(){return te}});var e={};n.r(e),n.d(e,{hasBrowserEnv:function(){return co},hasStandardBrowserEnv:function(){return po},hasStandardBrowserWebWorkerEnv:function(){return ho},navigator:function(){return uo},origin:function(){return fo}});var t,o=n(7662),i=n.n(o),a=n(1404),s=n.n(a),l=n(4143),c=n.n(l),u=n(9746),d=n.n(u),p=n(5118),h=n.n(p),f=n(702),m=n.n(f),v=n(5486),g=n.n(v),y=n(5821),_=n.n(y),b=n(3400),E=n.n(b),S=JSON.parse('{"name":"@alipay/ams-checkout","version":"2.0.20","description":"","repository":"git@code.alipay.com:antom-sdk/antom-web-sdk.git","author":"","exports":{".":{"types":"./esm/index.d.ts","import":"./esm/index.js","require":"./ams-checkout.js"},"./types":"./types.d.ts","./antom":"./antom.d.ts","./react-js":{"types":"./react-js.d.ts","import":"./react-js.js","require":"./react-js.cjs"},"./interface":"./types.untrimmed.d.ts"},"main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","antom.d.ts","types.d.ts","types.untrimmed.d.ts","ams-checkout.js","react-js.cjs","react-js.js","react-js.d.ts","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"opensdk update && npm run build:father:pre && npm run extract && npm run build:father && npm run build:father:umd && npm run build:react","build:analyze":"ANALYZE=1 father build","build:father":"FATHER_TSCONFIG_NAME=tsconfig.build.json father build","build:father:local":"STAGE_NAME=LOCAL FATHER_TSCONFIG_NAME=tsconfig.build.json father build","build:father:pre":"FATHER_BUILD_TYPE=prebuild father build","build:father:umd":"FATHER_BUILD_TYPE=only-umd father build","build:father:umd:local":"STAGE_NAME=LOCAL FATHER_BUILD_TYPE=only-umd father build","build:local":"opensdk update && npm run build:father:pre && npm run extract && npm run build:father:local && npm run build:father:umd:local && npm run build:react","build:react":"tsc --project tsconfig.cjs.json && mv react-js.js react-js.cjs && tsc --project tsconfig.esm.json","build:type":"dts-bundle-generator -o ./types/antom-web-sdk.d.ts ./src/index.ts --no-banner --silent --no-check","build:w":"FATHER_BUILD_TYPE=only-umd STAGE_NAME=LOCAL father dev","ci":"tnpm run cov","cov":"jest --coverage --silent","dev":"father dev","e2e":"nyc playwright test","e2e:create":"node scripts/e2e-create.js","e2e:ui":"playwright test --ui","extract":"opensdk extract -p esm/modern/sdk","format":"prettier --write --no-error-on-unmatched-pattern \\"**/*.{js,jsx,ts,tsx,md,json,css,less}\\"","generateApi":"intl-oneapi generate && prettier --write src/modern/sdk/oneapi","lint":"eslint ./src","test":"jest --coverage --silent","tsc":"tsc --noEmit","code-review-biz":"node .agents/skills/code-review-biz/scripts/code-review-cli.js","code-review-biz:mr":"node .agents/skills/code-review-biz/scripts/code-review-cli.js --url=","code-review-biz:push":"node .agents/skills/code-review-biz/scripts/code-review-cli.js --mode=pre-push","code-review-biz:init":"node .agents/skills/code-review-biz/scripts/lib/init.js init","code-review-biz:update":"node .agents/skills/code-review-biz/scripts/lib/init.js update","prepare":"husky install || true"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{js,jsx}":["eslint --fix","prettier --write"],"*.{ts,tsx}":["eslint --fix","prettier --parser=typescript --write"],"*.{md,json}":["prettier --write"]},"dependencies":{"@antglobal/create-sdk-loader":"^1.0.5","axios":"^1.3.4","proxy-polyfill":"^0.3.2","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@commitlint/cli":"^17.3.0","@commitlint/config-conventional":"^17.3.0","@microsoft/api-extractor":"^7.55.2","@playwright/test":"1.58.0","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/lodash.get":"^4.4.9","@types/react":"^19.2.14","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","dotenv":"^16.3.1","dts-bundle-generator":"^6.13.0","eslint":"^8.56.0","eslint-plugin-prettier":"^4.x","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","nyc":"^17.1.0","prettier":"^2.8.8","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","serve":"^14.2.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^5.x"},"engines":{"install-node":"20"},"publishConfig":{"access":"public"},"ci":{"resourceClass":"L","type":"aci"},"marmotId":"180020050100010657","tnpm":{"mode":"npm"}}'),A={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},k={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},T={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},w=S.version,P="1.47.2",I=n(907),C=n.n(I),R=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),N=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),O=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),L=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),D=c()(c()(c()(c()(c()(c()({},O.auth,N.AUTH_ELEMENT),O.address,N.ADDRESS_ELEMENT),O.payment,N.PAYMENT_ELEMENT),N.AUTH_ELEMENT,O.auth),N.ADDRESS_ELEMENT,O.address),N.PAYMENT_ELEMENT,O.payment),M=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),x=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),U=(c()(c()({},M.Default,"LIGHT"),M.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),B=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),K=function(e){_()(n,e);var t=E()(n);function n(e){var r;g()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return m()(n)}(C()(Error)),H=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),Y=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),F=function(e){return e.popup="popup",e.inline="inline",e}({}),j=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),z=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),G=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),V=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),W=function(e){return e.intent="intent",e.capture="capture",e}({}),q=function(e){return e.USD="USD",e}({}),J=function(e){return e["en-US"]="en-US",e}({}),Q=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),Z=function(e){return e.dropin="dropin",e.component="component",e}({}),X=function(e){return e.proxy="proxy",e.session="session",e}({}),$=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),ee=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),te=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),ne=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),re=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),oe=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),ie=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),ae=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),se=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),le=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),ce=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),ue=function(e){return e.V1="1.0",e.V2="2.0",e}({}),de=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),pe=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),he=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),fe=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),me={DOMAIN_NOT_IN_WHITE_LIST:{code:se.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:se.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:se.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:se.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:se.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:se.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:se.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:se.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:se.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:se.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:se.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:se.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},ve="COMPONENT",ge={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},ye={name:"validateFields"},_e="ams-component-container",be="ams-component-section",Ee="ams-checkout-component",Se="asm-component-close-block",Ae="ams-component-mask-close-block",ke="ams-component-retention",Te="ams-component-mockup",we="ams-component-loading",Pe="ams-component-popup-loading",Ie="_ams_sdk_component_listener",Ce="ams-inline-component-style",Re="inline-loading",Ne="ams-popup",Oe="light dark",Le=15e3,De=300,Me="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",xe={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},Ue={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Be=new Uint8Array(16);function Ke(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Be)}for(var He=[],Ye=0;Ye<256;++Ye)He.push((Ye+256).toString(16).slice(1));function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]}var je=function(e,t,n){if(Ue.randomUUID&&!t&&!e)return Ue.randomUUID();var r=(e=e||{}).random||(e.rng||Ke)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Fe(r)},ze=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ge=function(){function e(t,n){g()(this,e),c()(this,"action",void 0),c()(this,"data",void 0),c()(this,"jsonData",null),this.action=t,this.data=n}return m()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),Ve=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),We=m()((function e(){g()(this,e)})),qe=function(){function e(){g()(this,e)}return m()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(ze.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(ze.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(ze.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new Ve((function(r){e.traceLog(ze.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(ze.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=d()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(ze.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=d()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var p=c.value;null==p||p.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var h,f=!1,m=d()(e.interceptors);try{for(m.s();!(h=m.n()).done;){var v=h.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),f=f||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){m.e(e)}finally{m.f()}f?e.publish(t,n):e.traceError(ze.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(ze.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(ze.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(ze.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=d()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(ze.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();c()(qe,"TAG","BusManager"),c()(qe,"_logSplit"," , "),c()(qe,"interceptors",[]),c()(qe,"subscribersMap",new Map),c()(qe,"isDebug",!0),c()(qe,"logger",void 0);var Je=n(4944),Qe=n.n(Je),Ze=n(7374),Xe=n.n(Ze),$e=n(4044),et=n.n($e),tt=n(7925),nt=n.n(tt),rt=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t},ot=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),it=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),at=function(e){return e.SDK="SDK",e.API="API",e}({}),st=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},lt=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return m()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),ct=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},ut=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},dt=window.navigator,pt=dt.userAgent,ht=/iPhone|iPad|iPod/i.test(pt)||"MacIntel"===dt.platform&&dt.maxTouchPoints>1,ft=/Android/i.test(pt),mt=(/\bMacintosh\b/.test(pt),/Windows NT/.test(pt),function(){var e=/OpenHarmony/i.test(dt.userAgent),t=/Phone/i.test(dt.userAgent),n=/Tablet/i.test(dt.userAgent);return e&&(t||n)}),vt=ht,gt=ft,yt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(pt)&&!mt()),_t=(mt(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),bt=function(){var e=dt.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},Et=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},St=function(){var e=document.documentElement.clientWidth,t=bt()?130:100*e/390;return Math.min(t,130)},At=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(St(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},kt=function(){window.removeEventListener("resize",At),window.removeEventListener("pageShow",At),window.removeEventListener("DOMContentLoaded",At),window.addEventListener("resize",At),window.addEventListener("pageShow",At),window.addEventListener("DOMContentLoaded",At)},Tt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},wt=function(e){return"function"==typeof e};function Pt(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function It(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var Ct=function(e){return!(!e||"object"!==Qe()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},Rt=function(){var e=(Et()||{}).environment;return!!e&&"dev"===e};function Nt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Ot(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Nt(e,n)>=0&&Nt(r,e)>=0}function Lt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=nt()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var Dt=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=Ut(t,n,r,o,i,l),u=Et(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,f=void 0===h?"":h,m=u.groupId,v=void 0===m?"":m,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var b in a)_[b]=""+a[b];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),f&&(_.requestHost=f),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var E=ct(_);return Rt()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,E)),{path:c,locationSearch:E}},Mt=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?zt(n,o):Gt(n,o),a=Dt(h()(h()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Ft(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},xt=function(e){var t=Dt(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},Ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=Et()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Ht(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===z.AUTO_DEBIT_APM?"".concat(T[e]).concat(ot.TRUSTLY):n===G.EASY_PAY?null!=i?i:Gt(n,e):"".concat(A[e],"/").concat(c,"/").concat(l,"/index.html")},Bt=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Kt=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Ht=function(e,t,n){var r,o=(r={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(r,z.NONE,[""]),z.AUTO_DEBIT_WALLET,["1.0"]),z.AUTO_DEBIT_PAY_WALLET,[""]),z.CASHIER_PAYMENT_BANK,["1.0"]),z.CASHIER_PAYMENT_CARD,["1.0"]),z.CASHIER_PAYMENT_APM,["1.0"]),z.EASY_PAY_WALLET,["1.0","2.0"]),z.EASY_PAY_APM,["2.0"]),z.VAULTING_CARD,["1.0"]),z.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(r,z.ELEMENT_ADDRESS,["1.0"]),z.CHECKOUT_PAYMENT,["1.0"]),z.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},Yt="web_url_",Ft=function(e,t){var n=Yt+e;localStorage.setItem(n,t)},jt=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=Vt(a,i),l=function(){var e=n.sort((function(e,t){return Nt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Nt(w,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Nt(w,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===it.SDK_PORTAL?(null==l?void 0:l.url)||s:a===it.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},zt=function(e,t){var n=Yt+e,r=localStorage.getItem(n);return null!=r?r:Gt(e,t)},Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===G.EASY_PAY?Vt(it.SDK_PORTAL,t):""},Vt=function(e,t){return"".concat(T[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},Wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Kt(r),i=jt({configs:o,mid:n,env:t,pageName:it.DOUBLE_FA});return i},qt="antom_checkout_previous_ProductInfo_",Jt=function(){function e(){g()(this,e)}return m()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=qt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=qt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Qt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},Zt=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function Xt(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var $t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Qt(e,"");if(t)return t;var n=je();e&&n&&Zt(e,n)}}catch(e){return""}};function en(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$t();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function tn(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var nn=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Ot(t.sdkVersion,e.v)&&Xt(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=tn(e,null!==(a=t.greyscale)&&void 0!==a?a:en());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},rn=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Qt(t,"")}catch(e){return""}},on=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return Zt(n,t)}catch(e){return!1}};function an(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(Pt(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=ln(e,t,n);return r||((r=Qt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},ln=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Ot(e.sdkVersion,n.v)&&Xt(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=tn(n,null!==(a=e.greyscaleId)&&void 0!==a?a:en());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},cn={production:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},un=new Set(Object.values(cn).map((function(e){return e.url}))),dn="APDID",pn=function(){function e(){g()(this,e),c()(this,"state","idle"),c()(this,"loadingPromise",null),c()(this,"apdidModule",null),c()(this,"retryCount",0),c()(this,"config",null)}var t,n;return m()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=cn[t.environment]){e.next=11;break}return a=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),e.abrupt("return",Promise.reject(a));case 11:if(s=n.url,un.has(s)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(s)),this.state="failed",null===(l=t.callbacks)||void 0===l||null===(c=l.onLoadFailed)||void 0===c||c.call(l,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(s,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0;case 1:if(!(s<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),a=e.t0,s<1&&(this.retryCount++,this.state="idle");case 13:s++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),a;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now(),o=import(e).then((function(e){var o=e.default||e;if(o)n._onLoadSuccess(o,r,t);else{var i=window[dn];if(!i)throw new Error("[ApdidLoader] Module loaded but no export and window.".concat(dn," not found"));n._onLoadSuccess(i,r,t)}})),i=new Promise((function(r,o){setTimeout((function(){var r,i;"loading"===n.state&&(null===(r=t.callbacks)||void 0===r||null===(i=r.onLoadTimeout)||void 0===i||i.call(r),o(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4)}));return Promise.race([o,i])}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();c()(pn,"instance",null);var hn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},fn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),mn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},vn=c()(c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.AUTO_DEBIT_PAY,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),gn=function(e){return mn[e]||mn[fn.SG]},yn=function(e){return console.log("getSecurityScene",e),vn[e]||""},_n=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},bn=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||mn[fn.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=pn.getInstance(),n=_n(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return pn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(console.log(this.scene,"preloadSecuritySDK"),!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(vn).includes(this.scene)||!Object.values(mn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o),console.log("initToken result tokenResult",JSON.stringify(r),o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),En=function(){function e(){g()(this,e),c()(this,"registry",new Map)}var t;return m()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),Sn=new En,An=function(){function e(){g()(this,e)}var t;return m()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=rt(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=s()(i()().mark((function t(n){var r,o,a,s,l,c,u,d,p,h=this,f=arguments;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:"SG",o=f.length>2?f[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(a=e.getSecurityConfigStorage(n),s=a.scene||yn(n),console.log("getSecurityScene",s),l=a.h5gateway||gn(r),console.log("preloadSecuritySDK",s),!Sn.isReady(s)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!Sn.isLoading(s)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=Sn.get(s))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=_n(o),pn.getInstance().scheduleLoad({environment:u}),d=new bn({scene:s,h5gateway:l,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){Sn.setReady(s,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){Sn.setFailed(s,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),Sn.setLoading(s,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return Sn.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===G.EASY_PAY?"2.0":"1.0",i=Jt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:w,webAppVersion:""};s.webAppVersion=sn(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Mt(l):xt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(hn(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();c()(An,"isWebAppPreloaded",!1),c()(An,"isSecuritySDKPreloaded",!1);var kn=function(e){return e.optional_init="plugin_optional_init",e}({}),Tn=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),wn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),Pn=function(e){return e.onEventCallback="onEventCallback",e}({}),In=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Cn=function(e){return e.reportAnalytics="reportAnalytics",e}({}),Rn=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(Rn||{}),Nn=function(){function e(t){var n=this;g()(this,e),c()(this,"merchantIdentifier",void 0),c()(this,"merchantName",void 0),c()(this,"session",void 0),c()(this,"paymentState",void 0),c()(this,"getMerchantSession",void 0),c()(this,"completePaymentAuthorized",void 0),c()(this,"completeApplePay",void 0),c()(this,"logError",void 0),c()(this,"isRecurring",!1),c()(this,"logger",void 0),c()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(se.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(se.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=Rn.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=Rn.success,o=!0})).catch((function(e){i(e),n.paymentState=Rn.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(se.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===Rn.pending?n.logError(se.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(se.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(se.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(se.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return m()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=Rn.notStarted}},{key:"hasActiveCard",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),On=Nn;function Ln(e,t){return function(){return e.apply(t,arguments)}}var Dn,Mn,xn=n(3089),Un=Object.prototype.toString,Bn=Object.getPrototypeOf,Kn=Symbol.iterator,Hn=Symbol.toStringTag,Yn=(Dn=Object.prototype.hasOwnProperty,function(e,t){return Dn.call(e,t)}),Fn=function(e,t){for(var n=e,r=[];null!=n&&n!==Object.prototype;){if(-1!==r.indexOf(n))return!1;if(r.push(n),Yn(n,t))return!0;n=Bn(n)}return!1},jn=(Mn=Object.create(null),function(e){var t=Un.call(e);return Mn[t]||(Mn[t]=t.slice(8,-1).toLowerCase())}),zn=function(e){return e=e.toLowerCase(),function(t){return jn(t)===e}},Gn=function(e){return function(t){return Je(t)===e}},Vn=Array.isArray,Wn=Gn("undefined");function qn(e){return null!==e&&!Wn(e)&&null!==e.constructor&&!Wn(e.constructor)&&Zn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Jn=zn("ArrayBuffer");var Qn=Gn("string"),Zn=Gn("function"),Xn=Gn("number"),$n=function(e){return null!==e&&"object"===Je(e)},er=function(e){if(!$n(e))return!1;var t=Bn(e);return!(null!==t&&t!==Object.prototype&&null!==Bn(t)||Fn(e,Hn)||Fn(e,Kn))},tr=zn("Date"),nr=zn("File"),rr=zn("Blob"),or=zn("FileList");var ir="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ar=void 0!==ir.FormData?ir.FormData:void 0,sr=zn("URLSearchParams"),lr=["ReadableStream","Request","Response","Headers"].map(zn),cr=tt(lr,4),ur=cr[0],dr=cr[1],pr=cr[2],hr=cr[3];function fr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==Je(e)&&(e=[e]),Vn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(qn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function mr(e,t){if(qn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var vr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,gr=function(e){return!Wn(e)&&e!==vr};var yr,_r=(yr="undefined"!=typeof Uint8Array&&Bn(Uint8Array),function(e){return yr&&e instanceof yr}),br=zn("HTMLFormElement"),Er=Object.prototype.propertyIsEnumerable,Sr=zn("RegExp"),Ar=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};fr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var kr,Tr,wr,Pr,Ir=zn("AsyncFunction"),Cr=(kr="function"==typeof setImmediate,Tr=Zn(vr.postMessage),kr?setImmediate:Tr?(wr="axios@".concat(Math.random()),Pr=[],vr.addEventListener("message",(function(e){var t=e.source,n=e.data;t===vr&&n===wr&&Pr.length&&Pr.shift()()}),!1),function(e){Pr.push(e),vr.postMessage(wr,"*")}):function(e){return setTimeout(e)}),Rr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(vr):void 0!==xn&&xn.nextTick||Cr,Nr=function(e){return null!=e&&Zn(e[Kn])},Or={isArray:Vn,isArrayBuffer:Jn,isBuffer:qn,isFormData:function(e){if(!e)return!1;if(ar&&e instanceof ar)return!0;var t=Bn(e);if(!t||t===Object.prototype)return!1;if(!Zn(e.append))return!1;var n=jn(e);return"formdata"===n||"object"===n&&Zn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Jn(e.buffer)},isString:Qn,isNumber:Xn,isBoolean:function(e){return!0===e||!1===e},isObject:$n,isPlainObject:er,isEmptyObject:function(e){if(!$n(e)||qn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ur,isRequest:dr,isResponse:pr,isHeaders:hr,isUndefined:Wn,isDate:tr,isFile:nr,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:rr,isRegExp:Sr,isFunction:Zn,isStream:function(e){return $n(e)&&Zn(e.pipe)},isURLSearchParams:sr,isTypedArray:_r,isFileList:or,forEach:fr,merge:function e(){for(var t=gr(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&mr(o,i)||i,s=Yn(o,a)?o[a]:void 0;er(s)&&er(t)?o[a]=e(s,t):er(t)?o[a]=e({},t):Vn(t)?o[a]=t.slice():r&&Wn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!qn(l)&&(fr(l,i),"object"===Je(l)&&!Vn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];Er.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return fr(t,(function(t,r){n&&Zn(t)?Object.defineProperty(e,r,{__proto__:null,value:Ln(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Bn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:jn,kindOfTest:zn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(Vn(e))return e;var t=e.length;if(!Xn(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Kn]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:br,hasOwnProperty:Yn,hasOwnProp:Yn,hasOwnInPrototypeChain:Fn,getSafeProp:function(e,t){return null!=e&&Fn(e,t)?e[t]:void 0},reduceDescriptors:Ar,freezeMethods:function(e){Ar(e,(function(t,n){if(Zn(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Zn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return Vn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:mr,global:vr,isContextDefined:gr,isSpecCompliantForm:function(e){return!!(e&&Zn(e.append)&&"FormData"===e[Hn]&&e[Kn])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if($n(n)){if(t.has(n))return;if(qn(n))return n;if(!("toJSON"in n)){t.add(n);var r=Vn(n)?[]:{};return fr(n,(function(t,n){var o=e(t);!Wn(o)&&(r[n]=o)})),t.delete(n),r}}return n}(e)},isAsyncFn:Ir,isThenable:function(e){return e&&($n(e)||Zn(e))&&Zn(e.then)&&Zn(e.catch)},setImmediate:Cr,asap:Rr,isIterable:Nr,isSafeIterable:function(e){return null!=e&&Fn(e,Kn)&&Nr(e)}},Lr=Or.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Dr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Mr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function xr(e,t){return Or.isArray(e)?e.map((function(e){return xr(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Ur(e){var t=Object.create(null);return Or.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return xr(e,Mr)}(e)})),t}var Br=Symbol("internals");function Kr(e){return e&&String(e).trim().toLowerCase()}function Hr(e){return!1===e||null==e?e:Or.isArray(e)?e.map(Hr):function(e){return xr(e,Dr)}(String(e))}function Yr(e,t,n,r,o){return Or.isFunction(r)?r.call(this,t,n):(o&&(t=n),Or.isString(t)?Or.isString(r)?-1!==t.indexOf(r):Or.isRegExp(r)?r.test(t):void 0:void 0)}var Fr=function(e,t){function n(e){v(this,n),e&&this.set(e)}return f(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Kr(t);if(o){var i=Or.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Hr(e))}}var i=function(e,t){return Or.forEach(e,(function(e,n){return o(e,n,t)}))};if(Or.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Or.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!t||o[t]&&Lr[t]||("set-cookie"===t?o[t]?o[t].push(n):o[t]=[n]:o[t]=o[t]?o[t]+", "+n:n)})),o}(e),t);else if(Or.isObject(e)&&Or.isSafeIterable(e)){var a,s,l,c=Object.create(null),d=u(e);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(!Or.isArray(p))throw new TypeError("Object iterator must return a key-value pair");s=p[0],Or.hasOwnProp(c,s)?(a=c[s],c[s]=Or.isArray(a)?[].concat($e(a),[p[1]]):[a,p[1]]):c[s]=p[1]}}catch(e){d.e(e)}finally{d.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Kr(e)){var n=Or.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Or.isFunction(t))return t.call(this,r,n);if(Or.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Kr(e)){var n=Or.findKey(this,e);return!(!n||void 0===this[n]||t&&!Yr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Kr(e)){var o=Or.findKey(n,e);!o||t&&!Yr(0,n[o],o,t)||(delete n[o],r=!0)}}return Or.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Yr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Or.forEach(this,(function(r,o){var i=Or.findKey(n,o);if(i)return t[i]=Hr(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Hr(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Or.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&Or.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=tt(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){return this.get("set-cookie")||[]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[Br]=this[Br]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Kr(e);t[r]||(!function(e,t){var n=Or.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Or.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);Fr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Or.reduceDescriptors(Fr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),Or.freezeMethods(Fr);var jr=Fr;function zr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==Je(t))return t;if(Or.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof jr&&(t=t.toJSON()),r.push(t),Or.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);Or.isUndefined(r)||(o[n]=r)}));else{if(!Or.isPlainObject(t)&&function(e){if(Or.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Or.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=tt(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?"[REDACTED ****]":e(c);Or.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}var Gr=function(e){y(n,e);var t=b(n);function n(e,r,o,i,a){var s;return v(this,n),s=t.call(this,e),Object.defineProperty(Ze(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return f(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&Or.hasOwnProp(e,"redact")?e.redact:void 0,n=Or.isArray(t)&&t.length>0?zr(e,t):Or.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=new n(e.message,t||e.code,r,o,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),a&&Object.assign(s,a),s}}]),n}(I(Error));Gr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Gr.ERR_BAD_OPTION="ERR_BAD_OPTION",Gr.ECONNABORTED="ECONNABORTED",Gr.ETIMEDOUT="ETIMEDOUT",Gr.ECONNREFUSED="ECONNREFUSED",Gr.ERR_NETWORK="ERR_NETWORK",Gr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Gr.ERR_DEPRECATED="ERR_DEPRECATED",Gr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Gr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Gr.ERR_CANCELED="ERR_CANCELED",Gr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Gr.ERR_INVALID_URL="ERR_INVALID_URL",Gr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Vr=Gr,Wr=n(6207).lW;function qr(e){return Or.isPlainObject(e)||Or.isArray(e)}function Jr(e){return Or.endsWith(e,"[]")?e.slice(0,-2):e}function Qr(e,t,n){return e?e.concat(t).map((function(e,t){return e=Jr(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var Zr=Or.toFlatObject(Or,{},null,(function(e){return/^is[A-Z]/.test(e)}));var Xr=function(e,t,n){if(!Or.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=(n=Or.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Or.isUndefined(t[e])}))).metaTokens,o=n.visitor||h,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,l=void 0===n.maxDepth?100:n.maxDepth,c=s&&Or.isSpecCompliantForm(t),u=[];if(!Or.isFunction(o))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Or.isDate(e))return e.toISOString();if(Or.isBoolean(e))return e.toString();if(!c&&Or.isBlob(e))throw new Vr("Blob is not supported. Use a Buffer instead.");if(Or.isArrayBuffer(e)||Or.isTypedArray(e)){if(c&&"function"==typeof s)return new s([e]);if(void 0!==Wr)return Wr.from(e);throw new Vr("Blob is not supported. Use a Buffer instead.",Vr.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new Vr("Object is too deeply nested ("+e+" levels). Max depth: "+l,Vr.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,n,o){var s=e;if(Or.isReactNative(t)&&Or.isReactNativeBlob(e))return t.append(Qr(o,n,i),d(e)),!1;if(e&&!o&&"object"===Je(e))if(Or.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!Or.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r}))}(e,1);else if(Or.isArray(e)&&function(e){return Or.isArray(e)&&!e.some(qr)}(e)||(Or.isFileList(e)||Or.endsWith(n,"[]"))&&(s=Or.toArray(e)))return n=Jr(n),s.forEach((function(e,r){!Or.isUndefined(e)&&null!==e&&t.append(!0===a?Qr([n],r,i):null===a?n:n+"[]",d(e))})),!1;return!!qr(e)||(t.append(Qr(o,n,i),d(e)),!1)}var f=Object.assign(Zr,{defaultVisitor:h,convertValue:d,isVisitable:qr});if(!Or.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Or.isUndefined(n)){if(p(i),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));u.push(n),Or.forEach(n,(function(n,a){!0===(!(Or.isUndefined(n)||null===n)&&o.call(t,n,Or.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],i+1)})),u.pop()}}(e),t};function $r(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function eo(e,t){this._pairs=[],e&&Xr(e,this,t)}var to=eo.prototype;to.append=function(e,t){this._pairs.push([e,t])},to.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,$r)}:$r;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var no=eo;function ro(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oo(e,t,n){if(!t)return e;e=e||"";var r,o=Or.isFunction(n)?{serialize:n}:n,i=Or.getSafeProp(o,"encode")||ro,a=Or.getSafeProp(o,"serialize");if(r=a?a(t,o):Or.isURLSearchParams(t)?t.toString():new no(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var io=function(){function e(){v(this,e),this.handlers=[]}return f(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){Or.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),ao=io,so={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},lo={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:no,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},co="undefined"!=typeof window&&"undefined"!=typeof document,uo="object"===("undefined"==typeof navigator?"undefined":Je(navigator))&&navigator||void 0,po=co&&(!uo||["ReactNative","NativeScript","NS"].indexOf(uo.product)<0),ho="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fo=co&&window.location.href||"http://localhost",mo=p(p({},e),lo);function vo(e){if(e>100)throw new Vr("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Vr.ERR_FORM_DATA_DEPTH_EXCEEDED)}var go=function(e){function t(e,n,r,o){vo(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Or.isArray(r)?r.length:i,s?(Or.hasOwnProp(r,i)?r[i]=Or.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(Or.hasOwnProp(r,i)&&Or.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Or.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Or.isFormData(e)&&Or.isFunction(e.entries)){var n={};return Or.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/\w+|\[(\w*)]/g;null!==(t=r.exec(e));)vo(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},yo=function(e,t){return null!=e&&Or.hasOwnProp(e,t)?e[t]:void 0};var _o={transitional:so,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Or.isObject(e);if(i&&Or.isHTMLForm(e)&&(e=new FormData(e)),Or.isFormData(e))return o?JSON.stringify(go(e)):e;if(Or.isArrayBuffer(e)||Or.isBuffer(e)||Or.isStream(e)||Or.isFile(e)||Or.isBlob(e)||Or.isReadableStream(e))return e;if(Or.isArrayBufferView(e))return e.buffer;if(Or.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=yo(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xr(e,new mo.classes.URLSearchParams,p({visitor:function(e,t,n,r){return mo.isNode&&Or.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=Or.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=yo(this,"env"),l=s&&s.FormData;return Xr(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Or.isString(e))try{return(t||JSON.parse)(e),Or.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=yo(this,"transitional")||_o.transitional,n=t&&t.forcedJSONParsing,r=yo(this,"responseType"),o="json"===r;if(Or.isResponse(e)||Or.isReadableStream(e))return e;if(e&&Or.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,yo(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw Vr.from(e,Vr.ERR_BAD_RESPONSE,this,null,yo(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mo.classes.FormData,Blob:mo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Or.forEach(["delete","get","head","post","put","patch","query"],(function(e){_o.headers[e]={}}));var bo=_o;function Eo(e,t){var n=this||bo,r=t||n,o=jr.from(r.headers),i=r.data;return Or.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function So(e){return!(!e||!e.__CANCEL__)}var Ao=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this,null==e?"canceled":e,Vr.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return f(n)}(Vr),ko=Ao;function To(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Vr("Request failed with status code "+n.status,n.status>=400&&n.status<500?Vr.ERR_BAD_REQUEST:Vr.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var wo=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var Po=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,$e(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)}]},Io=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=wo(50,250);return Po((function(n){if(n&&"number"==typeof n.loaded){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);var d=l({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(d)}}),n)},Co=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Ro=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Or.asap((function(){return e.apply(void 0,n)}))}},No=mo.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,mo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(mo.origin),mo.navigator&&/(msie|trident)/i.test(mo.navigator.userAgent)):function(){return!0},Oo=mo.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Or.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Or.isString(r)&&s.push("path=".concat(r)),Or.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),Or.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Lo=/^https?:(?!\/\/)/i,Do=/[\t\n\r]/g;function Mo(e,t){if("string"==typeof e&&Lo.test(function(e){return function(e){for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Do,"")}(e)))throw new Vr('Invalid URL: missing "//" after protocol',Vr.ERR_INVALID_URL,t)}function xo(e,t,n,r){Mo(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Mo(e,r),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}var Uo=function(e){return e instanceof jr?p({},e):e};function Bo(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Or.isPlainObject(e)&&Or.isPlainObject(t)?Or.merge.call({caseless:r},e,t):Or.isPlainObject(t)?Or.merge({},t):Or.isArray(t)?t.slice():t}function o(e,t,n,o){return Or.isUndefined(t)?Or.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Or.isUndefined(t))return r(void 0,t)}function a(e,t){return Or.isUndefined(t)?Or.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Or.hasOwnProp(t,i)?r(n,o):Or.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Uo(e),Uo(t),0,!0)}};return Or.forEach(Object.keys(p(p({},e),t)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Or.hasOwnProp(l,r)?l[r]:o,a=i(Or.hasOwnProp(e,r)?e[r]:void 0,Or.hasOwnProp(t,r)?t[r]:void 0,r);Or.isUndefined(a)&&i!==s||(n[r]=a)}})),Or.hasOwnProp(t,"validateStatus")&&Or.isUndefined(t.validateStatus)&&!1===function(n){var r=Or.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Or.isUndefined(r)){if(!Or.isPlainObject(r))return;if(Or.hasOwnProp(r,n))return r[n]}var o=Or.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Or.isPlainObject(o)&&Or.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Or.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Ko=["content-type","content-length"];var Ho=function(e){var t=Bo({},e),n=function(e){return Or.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=jr.from(s),t.url=oo(xo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=Or.getSafeProp(l,"username")||"",h=Or.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw Vr.from(t,Vr.ERR_BAD_OPTION_VALUE,e)}}if(Or.isFormData(r)&&(mo.hasStandardBrowserEnv||mo.hasStandardBrowserWebWorkerEnv||Or.isReactNative(r)?s.setContentType(void 0):Or.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=tt(t,2),r=n[0],o=n[1];Ko.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),mo.hasStandardBrowserEnv&&(Or.isFunction(o)&&(o=o(t)),!0===o||null==o&&No(t.url))){var f=i&&a&&Oo.read(a);f&&s.set(i,f)}return t},Yo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l=Ho(e),c=l.data,u=jr.from(l.headers).normalize(),d=l.responseType,p=l.onUploadProgress,h=l.onDownloadProgress;function f(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(r),l.signal&&l.signal.removeEventListener("abort",r)}var m=new XMLHttpRequest;function v(){if(m){var r=jr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());To((function(e){t(e),f()}),(function(e){n(e),f()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}}if(m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Vr("Request aborted",Vr.ECONNABORTED,e,m)),f(),m=null)},m.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Vr(r,Vr.ERR_NETWORK,e,m);o.event=t||null,n(o),f(),m=null},m.ontimeout=function(){var t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",r=l.transitional||so;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),n(new Vr(t,r.clarifyTimeoutError?Vr.ETIMEDOUT:Vr.ECONNABORTED,e,m)),f(),m=null},void 0===c&&u.setContentType(null),"setRequestHeader"in m&&Or.forEach(Ur(u),(function(e,t){m.setRequestHeader(t,e)})),Or.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),h){var g=Io(h,!0),y=tt(g,2);i=y[0],s=y[1],m.addEventListener("progress",i)}if(p&&m.upload){var _=Io(p),b=tt(_,2);o=b[0],a=b[1],m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)}(l.cancelToken||l.signal)&&(r=function(t){m&&(n(!t||t.type?new ko(null,e,m):t),m.abort(),f(),m=null)},l.cancelToken&&l.cancelToken.subscribe(r),l.signal&&(l.signal.aborted?r():l.signal.addEventListener("abort",r)));var E,S,A=(E=l.url,(S=/^([-+\w]{1,25}):(?:\/\/)?/.exec(E))&&S[1]||"");if(A&&!mo.protocols.includes(A))return n(new Vr("Unsupported protocol "+A+":",Vr.ERR_BAD_REQUEST,e)),void f();m.send(c||null)}))},Fo=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Vr?t:new ko(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new Vr("timeout of ".concat(t,"ms exceeded"),Vr.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){return e.addEventListener("abort",o,{once:!0})}));var s=n.signal;return s.unsubscribe=function(){return Or.asap(a)},s}},jo=n(3697),zo=n(8946),Go=n(4331),Vo=n(8193),Wo=o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:i=0;case 6:if(!(i<r)){e.next=13;break}return a=i+n,e.next=10,t.slice(i,a);case 10:i=a,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),qo=function(){var e=jo(o().mark((function e(t,n){var r,i,a,s,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,s=Vo(Jo(t));case 4:return e.next=6,zo(s.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(Go(Vo(Wo(c,n)),zo),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),i=!0,a=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==s.return){e.next=23;break}return e.next=23,zo(s.return());case 23:if(e.prev=23,!i){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),Jo=function(){var e=jo(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(Go(Vo(t),zo),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,zo(n.read());case 7:if(r=e.sent,i=r.done,a=r.value,!i){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,a;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,zo(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),Qo=function(e,t,n,r){var i,s=qo(e,t),l=0,c=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(o().mark((function t(){var r,i,a,u,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.next();case 3:if(r=t.sent,i=r.done,a=r.value,!i){t.next=10;break}return c(),e.close(),t.abrupt("return");case 10:u=a.byteLength,n&&(d=l+=u,n(d)),e.enqueue(new Uint8Array(a)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),c(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},Zo=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},Xo=function(e,t,n){return t+2<n&&Zo(e.charCodeAt(t+1))&&Zo(e.charCodeAt(t+2))};function $o(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var t=e.indexOf(",");if(t<0)return 0;var n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){for(var o=r.length,i=r.length,a=0;a<i;a++)if(37===r.charCodeAt(a)&&a+2<i){var s=r.charCodeAt(a+1),l=r.charCodeAt(a+2);Zo(s)&&Zo(l)&&(o-=2,a+=2)}var c=0,u=i-1,d=function(e){return e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e))};u>=0&&(61===r.charCodeAt(u)?(c++,u--):d(u)&&(c++,u-=3)),1===c&&u>=0&&(61===r.charCodeAt(u)||d(u))&&c++;var p=3*Math.floor(o/4)-(c||0);return p>0?p:0}for(var h=0,f=0,m=r.length;f<m;f++){var v=r.charCodeAt(f);if(37===v&&Xo(r,f,m))h+=1,f+=2;else if(v<128)h+=1;else if(v<2048)h+=2;else if(v>=55296&&v<=56319&&f+1<m){var g=r.charCodeAt(f+1);g>=56320&&g<=57343?(h+=4,f++):h+=3}else h+=3}return h}var ei="1.18.1",ti=Or.isFunction,ni=function(e){if(!Or.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ri=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},oi=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},ii=function(e){var t=void 0!==Or.global&&null!==Or.global?Or.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Or.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=i.fetch,l=i.Request,c=i.Response,u=s?ti(s):"function"==typeof fetch,d=ti(l),h=ti(c);if(!u)return!1;var f,m=u&&ti(n),v=u&&("function"==typeof r?(f=new r,function(e){return f.encode(e)}):function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new l(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),g=d&&m&&ri((function(){var e=!1,t=new l(mo.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),y=h&&m&&ri((function(){return Or.isReadableStream(new c("").body)})),_={stream:y&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!_[e]&&(_[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Vr("Response type '".concat(e,"' is not supported"),Vr.ERR_NOT_SUPPORT,n)})}));var b=function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!Or.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!Or.isSpecCompliantForm(t)){e.next=9;break}return n=new l(mo.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!Or.isArrayBufferView(t)&&!Or.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(Or.isURLSearchParams(t)&&(t+=""),!Or.isString(t)){e.next=16;break}return e.next=15,v(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Or.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?b(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(o().mark((function e(t){var n,i,a,u,h,f,v,S,A,k,T,w,P,I,C,R,N,O,L,D,M,x,U,B,K,H,Y,F,j,z,G,V,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,fe,me,ve,ge,ye,_e,be;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ho(t),i=n.url,a=n.method,u=n.data,h=n.signal,f=n.cancelToken,v=n.timeout,S=n.onDownloadProgress,A=n.onUploadProgress,k=n.responseType,T=n.headers,w=n.withCredentials,P=void 0===w?"same-origin":w,I=n.fetchOptions,C=n.maxContentLength,R=n.maxBodyLength,N=Or.isNumber(C)&&C>-1,O=Or.isNumber(R)&&R>-1,L=function(e){return Or.hasOwnProp(t,e)?t[e]:void 0},D=s||fetch,k=k?(k+"").toLowerCase():"text",M=Fo([h,f&&f.toAbortSignal()],v),x=null,U=M&&M.unsubscribe&&function(){M.unsubscribe()},K=null,H=function(){return new Vr("Request body larger than maxBodyLength limit",Vr.ERR_BAD_REQUEST,t,x)},e.prev=11,Y=void 0,(F=L("auth"))&&(j=Or.getSafeProp(F,"username")||"",z=Or.getSafeProp(F,"password")||"",Y={username:j,password:z}),oi(i)&&(G=new URL(i,mo.origin),Y||!G.username&&!G.password||(V=ni(G.username),W=ni(G.password),Y={username:V,password:W}),(G.username||G.password)&&(G.username="",G.password="",i=G.href)),Y&&(T.delete("authorization"),T.set("Authorization","Basic "+btoa((o=(Y.username||"")+":"+(Y.password||""),encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!N||"string"!=typeof i||!i.startsWith("data:")){e.next=21;break}if(!($o(i)>C)){e.next=21;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 21:if(!O||"get"===a||"head"===a){e.next=29;break}return e.next=24,b(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(B=q,!(q>R)){e.next=29;break}throw H();case 29:if(J=O&&(Or.isReadableStream(u)||Or.isStream(u)),Q=function(e,t,n){return Qo(e,65536,(function(e){if(O&&e>R)throw K=H();t&&t(e)}),n)},!g||"get"===a||"head"===a||!A&&!J){e.next=43;break}if(null!=B){e.next=38;break}return e.next=35,E(T,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=B;case 39:(0!==(B=e.t0)||J)&&(Z=new l(i,{method:"POST",body:u,duplex:"half"}),Or.isFormData(u)&&(X=Z.headers.get("content-type"))&&T.setContentType(X),Z.body&&($=A&&Co(B,Io(Ro(A)))||[],ee=tt($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===a||"head"===a){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||g||"get"===a||"head"===a){e.next=49;break}throw new Vr("Stream request bodies are not supported by the current fetch implementation",Vr.ERR_NOT_SUPPORT,t,x);case 49:return Or.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in l.prototype,Or.isFormData(u)&&(oe=T.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&T.delete("content-type"),T.set("User-Agent","axios/"+ei,!1),ie=p(p({},I),{},{signal:M,method:a.toUpperCase(),headers:Ur(T.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),x=d&&new l(i,ie),e.next=57,d?D(x,I):D(i,ie);case 57:if(ae=e.sent,se=jr.from(ae.headers),!N){e.next=63;break}if(!(null!=(le=Or.toFiniteNumber(se.getContentLength()))&&le>C)){e.next=63;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 63:return ce=y&&("stream"===k||"response"===k),y&&ae.body&&(S||N||ce&&U)&&(ue={},["status","statusText","headers"].forEach((function(e){ue[e]=ae[e]})),de=Or.toFiniteNumber(se.getContentLength()),pe=S&&Co(de,Io(Ro(S),!0))||[],he=tt(pe,2),fe=he[0],me=he[1],0,ve=function(e){if(N&&e>C)throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},ae=new c(Qo(ae.body,65536,ve,(function(){me&&me(),U&&U()})),ue)),k=k||"text",e.next=68,_[Or.findKey(_,k)||"text"](ae,t);case 68:if(ge=e.sent,!N||y||ce){e.next=73;break}if(null!=ge&&("number"==typeof ge.byteLength?ye=ge.byteLength:"number"==typeof ge.size?ye=ge.size:"string"==typeof ge&&(ye="function"==typeof r?(new r).encode(ge).byteLength:ge.length)),!("number"==typeof ye&&ye>C)){e.next=73;break}throw new Vr("maxContentLength size of "+C+" exceeded",Vr.ERR_BAD_RESPONSE,t,x);case 73:return!ce&&U&&U(),e.next=76,new Promise((function(e,n){To(e,n,{data:ge,headers:jr.from(ae.headers),status:ae.status,statusText:ae.statusText,config:t,request:x})}));case 76:return e.abrupt("return",e.sent);case 79:if(e.prev=79,e.t1=e.catch(11),U&&U(),!(M&&M.aborted&&M.reason instanceof Vr)){e.next=88;break}throw(_e=M.reason).config=t,x&&(_e.request=x),e.t1!==_e&&Object.defineProperty(_e,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),_e;case 88:if(!K){e.next=91;break}throw x&&!K.request&&(K.request=x),K;case 91:if(!(e.t1 instanceof Vr)){e.next=94;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 94:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=98;break}throw be=new Vr("Network Error",Vr.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(be,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 98:throw Vr.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 99:case"end":return e.stop()}var o}),e,null,[[11,79]])})));return function(t){return e.apply(this,arguments)}}()},ai=new Map,si=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=ai;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:ii(r)),s=n;return n},li=(si(),{http:null,xhr:Yo,fetch:{get:si}});Or.forEach(li,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var ci=function(e){return"- ".concat(e)},ui=function(e){return Or.isFunction(e)||null===e||!1===e};var di={getAdapter:function(e,t){for(var n,r,o=(e=Or.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!ui(n)&&void 0===(r=li[(s=String(n)).toLowerCase()]))throw new Vr("Unknown adapter '".concat(s,"'"));if(r&&(Or.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=tt(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(ci).join("\n"):" "+ci(l[0]):"as no adapter specified";throw new Vr("There is no suitable adapter to dispatch the request "+c,Vr.ERR_NOT_SUPPORT)}return r},adapters:li};function pi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ko(null,e)}function hi(e){return pi(e),e.headers=jr.from(e.headers),e.data=Eo.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),di.getAdapter(e.adapter||bo.adapter,e)(e).then((function(t){pi(e),e.response=t;try{t.data=Eo.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=jr.from(t.headers),t}),(function(t){if(!So(t)&&(pi(e),t&&t.response)){e.response=t.response;try{t.response.data=Eo.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=jr.from(t.response.headers)}return Promise.reject(t)}))}var fi={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){fi[e]=function(n){return Je(n)===e||"a"+(t<1?"n ":" ")+e}}));var mi={};fi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ei+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Vr(r(o," has been removed"+(t?" in "+t:"")),Vr.ERR_DEPRECATED);return t&&!mi[o]&&(mi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},fi.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var vi={assertOptions:function(e,t,n){if("object"!==Je(e)||null===e)throw new Vr("options must be an object",Vr.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new Vr("option "+i+" must be "+l,Vr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Vr("Unknown option "+i,Vr.ERR_BAD_OPTION)}},validators:fi},gi=vi.validators,yi=function(){function e(t){v(this,e),this.defaults=t||{},this.interceptors={request:new ao,response:new ao}}var t;return f(e,[{key:"request",value:(t=a(o().mark((function e(t,n){var r,i,a,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=function(){if(!r.stack)return"";var e=r.stack.indexOf("\n");return-1===e?"":r.stack.slice(e+1)}();try{e.t0.stack?i&&(a=i.indexOf("\n"),s=-1===a?-1:i.indexOf("\n",a+1),l=-1===s?"":i.slice(s+1),String(e.t0.stack).endsWith(l)||(e.t0.stack+="\n"+i)):e.t0.stack=i}catch(e){}}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n=t=Bo(this.defaults,t),r=n.transitional,o=n.paramsSerializer,i=n.headers;void 0!==r&&vi.assertOptions(r,{silentJSONParsing:gi.transitional(gi.boolean),forcedJSONParsing:gi.transitional(gi.boolean),clarifyTimeoutError:gi.transitional(gi.boolean),legacyInterceptorReqResOrdering:gi.transitional(gi.boolean),advertiseZstdAcceptEncoding:gi.transitional(gi.boolean),validateStatusUndefinedResolves:gi.transitional(gi.boolean)},!1),null!=o&&(Or.isFunction(o)?t.paramsSerializer={serialize:o}:vi.assertOptions(o,{encode:gi.function,serialize:gi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),vi.assertOptions(t,{baseUrl:gi.spelling("baseURL"),withXsrfToken:gi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&Or.merge(i.common,i[t.method]);i&&Or.forEach(["delete","get","head","post","put","patch","query","common"],(function(e){delete i[e]})),t.headers=jr.concat(a,i);var s=[],l=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){l=l&&e.synchronous;var n=t.transitional||so;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)}}));var c,u=[];this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));var d,p=0;if(!l){var h=[hi.bind(this),void 0];for(h.unshift.apply(h,s),h.push.apply(h,u),d=h.length,c=Promise.resolve(t);p<d;)c=c.then(h[p++],h[p++]);return c}d=s.length;for(var f=t;p<d;){var m=s[p++],v=s[p++];try{f=m(f)}catch(e){v.call(this,e);break}}try{c=hi.call(this,f)}catch(e){return Promise.reject(e)}for(p=0,d=u.length;p<d;)c=c.then(u[p++],u[p++]);return c}},{key:"getUri",value:function(e){return oo(xo((e=Bo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();Or.forEach(["delete","get","head","options"],(function(e){yi.prototype[e]=function(t,n){return this.request(Bo(n||{},{method:e,url:t,data:n&&Or.hasOwnProp(n,"data")?n.data:void 0}))}})),Or.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request(Bo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}yi.prototype[e]=t(),"query"!==e&&(yi.prototype[e+"Form"]=t(!0))}));var _i=yi,bi=function(){function e(t){if(v(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new ko(e,t,o),n(r.reason))}))}return f(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),Ei=bi;var Si={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Si).forEach((function(e){var t=tt(e,2),n=t[0],r=t[1];Si[r]=n}));var Ai=Si;var ki=function e(t){var n=new _i(t),r=Ln(_i.prototype.request,n);return Or.extend(r,_i.prototype,n,{allOwnKeys:!0}),Or.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Bo(t,n))},r}(bo);ki.Axios=_i,ki.CanceledError=ko,ki.CancelToken=Ei,ki.isCancel=So,ki.VERSION=ei,ki.toFormData=Xr,ki.AxiosError=Vr,ki.Cancel=ki.CanceledError,ki.all=function(e){return Promise.all(e)},ki.spread=function(e){return function(t){return e.apply(null,t)}},ki.isAxiosError=function(e){return Or.isObject(e)&&!0===e.isAxiosError},ki.mergeConfig=Bo,ki.AxiosHeaders=jr,ki.formToJSON=function(e){return go(Or.isHTMLForm(e)?new FormData(e):e)},ki.getAdapter=di.getAdapter,ki.HttpStatusCode=Ai,ki.default=ki;var Ti=ki,wi=Et(),Pi=wi._light_sandbox,Ii=wi.groupId,Ci=wi.requestHost,Ri={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:Ci||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:Ci||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Ni="ALIPW3SG",Oi="ANTOM_PAYMENT_WEB",Li=Ii||"GROUP_20240627151021",Di=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},Mi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:Ci||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:Ci||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=Ii||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===Pi?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},xi=".".charCodeAt(0),Ui=/\\(\\)?/g,Bi=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),Ki=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hi=/^\w*$/;function Yi(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function Fi(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Qe()(e);return"number"===n||"boolean"===n||null===e||Hi.test(e)||!Ki.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===xi&&r.push(""),n.replace(Bi,(function(e,t,n,o){var i=e;return n?i=o.replace(Ui,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function ji(e,t,n){var r=null===e?void 0:function(e,t){for(var n=Fi(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[Yi(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var zi=function(e,t){var n=ji(e,"Result-Status")||ji(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:ie.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:ie.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=ji(e,"Tips")||ji(e,"tips",""),o=ji(e,"Memo")||ji(e,"memo","");return{success:!1,traceId:t,errorCode:ie.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},Gi=Et()._sandbox;function Vi(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Mi(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Di(null==e?void 0:e.hostSign,i)||Ri[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Oi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Oi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Li),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ni),"sdk-version",w||""),e.headers);return"true"!==Gi&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Ti.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function Wi(e,t,n){return qi.apply(this,arguments)}function qi(){return qi=s()(i()().mark((function e(t,n,r){var o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=h()(h()({terminalType:yt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{a.browserInfo.browserJavaEnabled=(null===(s=navigator)||void 0===s?void 0:s.javaEnabled())||!1}catch(e){}return"WAP"===a.terminalType&&(a.osType=vt?"IOS":"ANDROID"),l=[h()(h()({},t),{},{envInfo:a,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=Vi(n),e.next=9,u({data:l});case 9:if(d=e.sent,p=d.data,f=d.headers,m=p||{},v=ji(f,"Mgw-TraceId")||ji(f,"mgw-traceid",""),m.traceId=v||"",null==(g=zi(f,v))||!g.errorCode){e.next=21;break}throw y=(null==m?void 0:m.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:v}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:v}).send(),e.abrupt("return",m);case 25:return e.prev=25,e.t0=e.catch(5),E=_t(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:ie.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),S=null!==e.t0&&void 0!==e.t0&&null!==(b=e.t0.message)&&void 0!==b&&b.includes("timeout")?ie.TIMEOUT:"",A=(null==E?void 0:E.errorCode)||S,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:A,msg:JSON.stringify((null==E?void 0:E.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:A,errorMessage:null==E?void 0:E.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),qi.apply(this,arguments)}function Ji(e,t,n){return Qi.apply(this,arguments)}function Qi(){return Qi=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Wi(t,h()(h()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function Zi(){return Zi=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(k[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),Zi.apply(this,arguments)}function Xi(e,t,n){return $i.apply(this,arguments)}function $i(){return $i=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",Wi(t,h()(h()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),$i.apply(this,arguments)}function ea(e,t,n,r){return ta.apply(this,arguments)}function ta(){return ta=s()(i()().mark((function e(t,n,r,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",a),e.abrupt("return",Wi(n,h()(h()({},r),{},{hostSign:a,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),ta.apply(this,arguments)}var na=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ra=function(){function e(t,n){g()(this,e),c()(this,"_applePayService",void 0),c()(this,"_parseData",void 0),c()(this,"_sessionData",void 0),c()(this,"_isFinish",!1),c()(this,"_options",void 0),c()(this,"logger",void 0),c()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:$.prod},t,{product:G.CARD_APPLE_PAY}),this._applePayService=new On(n)}return m()(e,[{key:"canMakePayments",value:function(e){return On.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:se.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var a=function(){var e=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe.publishForResult(new Ge(In.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=ea,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,a();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=Xi,e.t1=r,e.t2=o._options.environment,e.next=7,a();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(l,c,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:se.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),u);try{this._applePayService.startPay(this._parseData)}catch(e){u(se.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),oa=ra,ia=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"applePay",void 0),c()(Xe()(r),"logger",void 0),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Tn).concat(Object.values(kn))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=On.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new oa(h()(h()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&qe.publish(new Ge(Pn.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:na.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case kn.optional_init:this.onOptionalInit(e,t);break;case Tn.canMakePayments:this.onCanMakePayments(e,t);break;case Tn.createComponent:this.onCreateComponent(e,t);break;case Tn.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(We),aa=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function sa(e,t){for(var n,r=e||window.navigator.userAgent||"",o=aa,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(la(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(la(t,r,n.iosScheme),n.iosScheme):void 0;la(t,r,"")}function la(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var ca=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var ua=function(e){var t,n,r,o,i;switch(e){case G.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case G.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},da=m()((function e(){g()(this,e)}));c()(da,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var pa={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},ha={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},fa=function(){function e(){g()(this,e)}return m()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{va.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in da.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:pa.spmId},{eventAlias:pa.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:ha.spmId},{eventAlias:ha.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();c()(fa,"abnormalEventNameSet",new Set),c()(fa,"nonComplianceEventKeys",{});var ma=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;g()(this,e),c()(this,"timeoutId",void 0),c()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return m()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),va=new ma,ga={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},ya=h()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},ga),_a=function(){function e(t,n){g()(this,e),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return m()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=h()({},e),l=null==e?void 0:e.title;return ya[l]&&(s.title=ya[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:h()(h()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ya[s]&&(a.title=ya[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=fa.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return ya[s]&&(a.title=ya[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();c()(_a,"instance",void 0);var ba={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:null==S?void 0:S.version}},Ea=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=nn(e,{sdkVersion:w,productScene:t,mid:n});if(r)null===(o=_a.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&on(w+t,i),i):i=rn(w+t)}catch(e){return""}},Sa=function(e,t){var n,r=(n={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(n,z.NONE,[""]),z.AUTO_DEBIT_WALLET,["1.0"]),z.AUTO_DEBIT_PAY_WALLET,[""]),z.CASHIER_PAYMENT_BANK,["1.0"]),z.CASHIER_PAYMENT_CARD,["1.0"]),z.CASHIER_PAYMENT_APM,["1.0"]),z.EASY_PAY_WALLET,["1.0","2.0"]),z.EASY_PAY_APM,["2.0"]),z.VAULTING_CARD,["1.0"]),z.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(n,z.ELEMENT_ADDRESS,["1.0"]),z.CHECKOUT_PAYMENT,["1.0.0"]),z.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},Aa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=Et()||{},d=u.host,p=Ea(a,o,s,l),h=p||n;p&&(null===(e=_a.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));Rt()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var f=Sa(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===z.ELEMENT_ADDRESS)return"".concat(T[t],"/element-address/pages/address/index.html");if(et()(Object.values(j)).includes(r)){var m=!1;try{m=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return m?"".concat(T[t],"/elements/pages/express_checkout/index.html"):"".concat(T[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(A[t],"/").concat(r,"/").concat(f,"/index.html")},ka=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,f=e.hostSign,m=void 0===f?"":f,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=Aa(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),b=nn(l,{sdkVersion:w,productScene:o,mid:g})?"true":"false",E=Et(),S=E._sandbox,A=E._light_sandbox,k=E.requestHost,T=void 0===k?"":k,P=E.groupId,I=void 0===P?"":P,C=E.LOCAL_MOCK,R=E._displayType,N=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:b,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:w,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(ua(o)),isPreload:h||"",hostSign:m||""});C&&(N.LOCAL_MOCK=C),T&&(N.requestHost=T),I&&(N.groupId=I),"light_sandbox"!==a&&"true"!==A||(N.sandbox="true"),"sandbox"!==a&&"true"!==S||(N.shadow="true"),R&&(N.displayType=R);var O=ct(N);return Rt()&&(console.log("appUpgrade#getIframeUrl#appMatched",b),console.log("appUpgrade#getIframeUrl#url",_,O)),{path:_,locationSearch:O}},Ta=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},wa=15e3;function Pa(e){return Ia.apply(this,arguments)}function Ia(){return Ia=s()(i()().mark((function e(t){var n,r,o,a,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:wa,o=new Promise((function(e,t){r=setTimeout((function(){return t(new Error("timed out"))}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return a=e.sent,e.abrupt("return",{result:a,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),!(e.t0 instanceof Error&&"timed out"===e.t0.message)){e.next=14;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 14:throw e.t0;case 15:return e.prev=15,clearTimeout(r),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,9,15,18]])}))),Ia.apply(this,arguments)}var Ca=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}(Ca||{}),Ra=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(Ra||{});function Na(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Wt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(at.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"&notRedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var Oa=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},La=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?$.prod:i,s=t.shipping,l=t.merchantAmount,u=void 0===l?null:l,d=t.merchantCurrency,p=void 0===d?null:d;g()(this,e),c()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),c()(this,"session",null),c()(this,"paymentSessionData",void 0),c()(this,"parseData",void 0),c()(this,"paymentStatus",void 0),c()(this,"cancelReason",null),c()(this,"logger",void 0),c()(this,"env",void 0),c()(this,"shipping",void 0),c()(this,"merchantAmount",void 0),c()(this,"merchantCurrency",void 0),c()(this,"onBeforeConfirm",void 0),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=u,this.merchantCurrency=p}var t,n,r,o;return m()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=Ra.PENDING,e.session.onvalidatemerchant=function(){var t=s()(i()().mark((function t(r){var o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=ea,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(a=t.sent)&&a.success&&a.merchantSessionObject?(s=JSON.parse(a.merchantSessionObject),e.session.completeMerchantValidation(s)):(null===(l=e.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Ca.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=s()(i()().mark((function r(o){var a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N;return i()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:Ca.APPLE_PAY_TOKEN_ERROR})},s=null==o?void 0:o.payment,l=s.token,c=s.billingContact,u=s.shippingContact,!l){r.next=46;break}if(p={instPaymentToken:JSON.stringify(l)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,f=h.requiredBillingContactFields,m=h.requiredShippingContactFields,!Ct(f)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!Ct(m)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return e.cancelReason="USER_CANCEL",null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=13,_=Date.now(),r.next=17,Pa((function(){return e.onBeforeConfirm()}));case 17:if(b=r.sent,E=b.result,S=b.timedOut,A=E,(S||Date.now()-_>=wa)&&(null===(k=e.logger)||void 0===k||k.logError({title:"sdk_before_confirm_timeout"}),A=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:A}),A){r.next=29;break}return e.cancelReason="MERCHANT_ABORT",null===(T=e.session)||void 0===T||null===(w=T.completePayment)||void 0===w||w.call(T,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:"MERCHANT_CONFIRM_ABORT"}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(13),null===(P=e.logger)||void 0===P||P.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(I=e.session)||void 0===I||null===(C=I.completePayment)||void 0===C||C.call(I,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:"MERCHANT_CONFIRM_ABORT"}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:R=r.sent,e.setPayStatus(R),t(R),r.next=48;break;case 46:null===(N=e.logger)||void 0===N||N.logError({title:"a3753.b103030.c386485.d507486"}),a();case 48:case"end":return r.stop()}}),r,null,[[13,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===Ra.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});n({errorCode:"MERCHANT_ABORT"===e.cancelReason?"MERCHANT_CONFIRM_ABORT":Ca.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=Xi,e.t1=h()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=Ra.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==Ra.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=Ra.NORMAL,e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},a=o.recurringInfo,s=a?14:2,this.isCanMakePayments(s)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(s,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(l=this.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:Ca.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=Ra.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(Ct(n)||Ct(o)||Ct(null==r?void 0:r.supportedNetworks)||Ct(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return gt?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qe.publishForResult(new Ge(In.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Da="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(_e,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(we,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Re,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Re,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Re,"-desktop{}\n"),Ma=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=Da,document.head.appendChild(e)},xa=function(e,t,n){var r=document.createElement("div");r.id=we,n.componentSign===z.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Re,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Re,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===ne.desktop?r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===ne.mobile&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(we);At(0,o)},Ua=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(Te,"-hidden{\nanimation: ").concat(Te,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(Te,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),Ba=function(e,t){if(!document.getElementById(_e)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Ua,document.head.appendChild(n),kt();var r=document.createElement("div");r.className="".concat(_e,"-hidden-").concat(e),r.id=_e,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=be,r.appendChild(o),r.classList.remove("".concat(_e,"-hidden-").concat(e)),r.classList.add("".concat(_e,"-").concat(e)),Ka(e,t),r}},Ka=function(e,t){var n=e===ne.mobile?"touchend":"click",r=document.getElementById(_e),o="<img class='".concat(Se,"-btn-").concat(e,"' src=\"").concat(Me,'"/>'),i=document.createElement("div");i.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),i.id=Se,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Ha=function(e){var t=(null==e?void 0:e.platform)===ne.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=Te,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===ne.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Ya="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(De,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(De,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Fa=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(Pe),n.id=Pe,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(St(),"px"),e.appendChild(n)},ja=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Pe))||void 0===e||e.remove()},za="desktop",Ga=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{za=t;var i=document.createElement("div");i.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);Fa(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var Va,Wa,qa,Ja=function(){function e(t){g()(this,e),c()(this,"app",void 0),c()(this,"AMSSDK",void 0),c()(this,"platform",void 0),c()(this,"_performanceData",[]),c()(this,"_loadAppPromiseResolve",null),c()(this,"_isInitComponent",void 0),c()(this,"_globalData",void 0),c()(this,"popupApp",void 0),c()(this,"appDomain",void 0),c()(this,"createIframeNode",void 0),c()(this,"createPreloadIframeNode",void 0),c()(this,"_selector",void 0),c()(this,"_appVersion",void 0),c()(this,"_isRetention",void 0),c()(this,"_allowSubmitPayCallAhead",void 0),c()(this,"_actionQueryPromise",null),c()(this,"_actionSubmitPromise",null),c()(this,"_renderParams",null),c()(this,"_componentSign",z.NONE),c()(this,"_appLocationSearch",void 0),c()(this,"_renderDisplayType",F.popup),c()(this,"_multipleCallbackEvents",void 0),c()(this,"_isAppWebview",void 0),c()(this,"_isNativeAppWebview",void 0),c()(this,"_merchantAppointParam",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(be),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=yt?ne.mobile:ne.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,a;return m()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===ne.desktop?"PC":"WAP",sdkVersion:w,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;z.CASHIER_PAYMENT_APM!==this._componentSign&&(z.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(s()(i()().mark((function o(){var a,s,l,c,u;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a||null===(a=a.paymentSessionConfig)||void 0===a?void 0:a.productScene,l=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||s});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,l);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,f=this;if(this._isInitComponent)return this.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var m=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(m):"",g="".concat(_e).concat(v),y=(null==this?void 0:this._renderDisplayType)===F.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},b=_.productSceneVersion,E=void 0===b?"":b,S=_.productScene,A=void 0===S?"":S,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,w=T.autoDebitWithToken,P=void 0!==w&&w,I=T.requireFastSdk,C=void 0!==I&&I,R=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,N=void 0===R?{}:R;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),z.EASY_PAY_WALLET!==this._componentSign||A!==G.EASY_PAY||"1.0"!==E||P||!C){if(z.AUTO_DEBIT_WALLET===this._componentSign){var O,L,D,M=(null===(O=this._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},x=bt()?null==M||null===(L=M.web)||void 0===L?void 0:L.signType:null==M||null===(D=M.wap)||void 0===D?void 0:D.signType,U=(null==M?void 0:M.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(N)}if(z.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===C&&"1.0"===E?void this.handleAuthUrlInfo(N):Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_START_OF_LOADING}),this._renderDisplayType===F.inline){var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ce)||Ma(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,_e,g);B&&this.renderInlineLoading(t,B),(K=document.createElement("style")).innerHTML=Ya,document.head.appendChild(K)}var K;if(this._renderDisplayType===F.popup){var H,Y;Ba(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===ne.mobile?"touchend":"click",o=document.createElement("div");o.id=ke,o.classList.add("".concat(ke,"-").concat(e)),o.innerHTML='\n <span id="'.concat(ke,'-title" class="').concat(ke,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(ke,'-sub-title"\n class="').concat(ke,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(ke,"-btn-block-").concat(e,'">\n <div id="').concat(ke,'-remain" class="').concat(ke,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(ke,'-leave" class="').concat(ke,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(ke,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var j=Na(null===(H=this._renderParams)||void 0===H?void 0:H.paymentSessionMetaData,!0===(null===(Y=this._renderParams)||void 0===Y?void 0:Y.notRedirectAfterComplete)),V=function(){};null!=j&&j.allowClickOutsideClose&&(V=this.closeBtnFunc.bind(this));var W=this.closeBtnFunc.bind(this);Ha({platform:this.platform,onClickOutside:V,closeBtnFunc:W}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return f.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),f._isInitComponent=!1,f.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(N)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===z.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&xa(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(Te);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(we),e.id=we,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(St(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:Le)})).catch((function(e){return t.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(ge.eventCallback.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=s()(i()().mark((function t(n,r){var o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,O,L,D,M,x;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},f={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a?void 0:a.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(s=e._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},m=(null===(l=e._renderParams)||void 0===l?void 0:l.paymentSessionMetaData)||{},v=m.extendInfo,g=void 0===v?"":v,y=m.action,_=!1,b=!1,E=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},S=E.skipSdkQuery,A=E.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,b=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!ca()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(z.ELEMENT_PAYMENT===e._componentSign&&(f.paymentSessionConfig={productScene:null==(i=f.paymentSessionConfig)?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion}),z.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(z.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(z.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!A){t.next=23;break}if(!Lt(A,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!S){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=Na(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(z.CASHIER_PAYMENT_CARD!==e._componentSign&&z.VAULTING_CARD!==e._componentSign){t.next=35;break}return f.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(z.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(P=f.paymentSessionConfig||{},I=P.productSceneVersion,C=void 0===I?"":I,R=P.productScene,N=void 0===R?"":R,null===(w=e._renderParams)||void 0===w||null===(w=w.paymentSessionMetaData)||void 0===w||null===(w=w.action)||void 0===w||!w.skipSdkQuery||!b){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(N!==G.EASY_PAY||"2.0"!==C){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(z.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(M=(null===(O=e._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},"SMS"!==(x=bt()?null==M||null===(L=M.web)||void 0===L?void 0:L.signType:null==M||null===(D=M.wap)||void 0===D?void 0:D.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),Ji(f,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig)}).send(),z.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:me.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(ge.error.name,i),e.dispatchToSDK(ge.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(z.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(ge.eventCallback.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[z.CASHIER_PAYMENT_CARD,z.VAULTING_CARD,z.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(ge.error.name,{code:me.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(f.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var i}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var a={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},l=Na(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=s()(i()().mark((function e(t){var n,r,s,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R,N,O;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==G.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=l?!l.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||z.EASY_PAY_WALLET!==o._componentSign,z.EASY_PAY_WALLET===o._componentSign&&(h=a.paymentSessionConfig||{},f=h.productSceneVersion,m=void 0===f?"":f,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,E=(b=void 0===_?{}:_).enableSignAgreement,S=void 0!==E&&E,A=b.autoDebitWithToken,k=void 0!==A&&A,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},w=T.paymentMethodInfoView,P=(void 0===w?{}:w).paymentMethodType,I=void 0===P?"":P,g!==G.EASY_PAY||"2.0"!==m||k||(C=o._isAppWebview||!1,R=o._isNativeAppWebview||!1,a.signAgreement=S,"ALIPAY_CN"!==I||C&&R||(N=sa(void 0,o.AMSSDK.logger))&&"https"!==N&&(a.h5FromApp=encodeURIComponent(N)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),O=(null==l||null===(n=l.buildSubmitPayExtParams)||void 0===n?void 0:n.call(l,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},a.extParams=O,e.t0=Xi,e.t1=a,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===st(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(_e);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(_e,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(Te);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=Ta(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=ka({renderDisplayType:F.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(Aa(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=ka({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),f=h.path,m=h.locationSearch;this._appLocationSearch=m,-1!==f.indexOf("?")?this.app.src="".concat(f,"&").concat(m):this.app.src="".concat(f,"?").concat(m),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(ge.error.name,Object.assign({},me.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(ge.error.name,me.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ut(e.data)){var n=JSON.parse(e.data);if(n.name!==re.APP_TO_SDK&&n.name!==re.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(me.NOT_JSON_FORMAT),this.dispatchToSDK(ge.error.name,me.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(_e).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,Ga({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,a=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),Le),s=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,ja(),clearTimeout(a),clearTimeout(s)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return a.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===ge.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===N.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===N.CONTAINER_ELEMENT&&this.dispatchToSDK(ge.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(ge).map((function(e){return ge[e].name})).includes(e.context.event))if(e.context.event!==ge.getDeviceId.name)if(e.context.event!==ge.getUserAgentFromSdk.name){if(e.context.event===ge.popWindow.name)return o=document.querySelector(".".concat(Ne,"overlay")),i="desktop"===za?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile")),o.classList.remove("".concat(Ne,"fadeIn")),o.classList.add("".concat(Ne,"fadeOut")),"desktop"===za?(i.classList.remove("".concat(Ne,"fadeIn")),i.classList.add("".concat(Ne,"fadeOut"))):(i.classList.remove("".concat(Ne,"-drawer-enter")),i.classList.add("".concat(Ne,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),De);var o,i,a,s;if(e.context.event!==ge.getGlobalData.name)if(e.context.event!==ge.setGlobalData.name)if(e.context.event!==ge.popupWindow.name){if(e.context.event===ge.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===ge.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(ge.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===ge.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===ge.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===ge.close.name)return this.closeBtnFunc();if(e.context.event===ge.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==ge.submitForm.name)if(e.context.event!==ge.hideCloseButton.name)if(e.context.event!==ge.showCloseButton.name)if(e.context.event!==ge.setMaskCloseButton.name){if(e.context.event===ge.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==ge.declareCheckoutInfo.name)if(e.context.event!==ge.declareEventCallbackInfo.name)if(e.context.event!==ge.appHeartBeat.name)if(e.context.event!==ge.beforeSubmit.name){var c,u,d;if(e.context.event===ge.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==ge.getGooglePayToken.name)if(e.context.event===ge.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===ge.closePaymentPolling.name&&this.dispatchToApp({context:{event:ge.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==ge.getApplePayToken.name)if(e.context.event!==ge.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(ge.validateFieldsResult.forwardName,e.context);else new La({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else Oa(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:h()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(ge.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(ge.beforeSubmit.name,e.context.data);var f=je();this.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:f,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var m;this.createDialog(null===(m=e.context)||void 0===m?void 0:m.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===ge.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(_e,"-").concat(c):_e,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===F.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(_e,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(_e,"-").concat(this.platform,"-animation"));var p="".concat(_e,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var f=(v=_e,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),m=document.createElement("style");m.id=p,m.type="text/css",m.innerHTML=f,document.getElementsByTagName("head")[0].appendChild(m),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===F.inline)null===(y=document.getElementById(we))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(ge.eventCallback.name,{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===oe.BLANK)return c.normalUrl?(d(le.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(le.NormalUrl,"");if(!(c.target!==oe.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(le.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(le.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var f=new Date,m="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:m}).then((function(){var e=((new Date).getTime()-f.getTime())/1e3;d(le.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-f.getTime())/1e3;p(le.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(le.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(le.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(le.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(le.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(le.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(le.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(ke,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(ke,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,f,m,v,g,y=document.getElementById("".concat(ke,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.corner,"px"),"stroke"===(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,b,E,S,A,k,T,w=document.getElementById("".concat(ke,"-leave"));w&&(w.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,w.style.fontSize="".concat(null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontSize,"px"),w.style.color=null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontColor,w.style.borderRadius="".concat(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.corner,"px"),"stroke"===(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.type)?w.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):w.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(ge.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(Se);e?null==t||t.classList.remove("".concat(Se,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Se,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:re.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:ve,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(me.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(ve,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===G.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return b=e.sent,e.next=9,this._actionSubmitPromise;case 9:E=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:b,submitResult:E,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(a=this._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(s=this._renderParams)||void 0===s?void 0:s.configParams,prefillValue:null===(l=this._renderParams)||void 0===l?void 0:l.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(f=this._renderParams)||void 0===f?void 0:f.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(m=this._renderParams)||void 0===m||null===(m=m.paymentSessionMetaData)||void 0===m?void 0:m.clientId,instanceId:null===(v=this.AMSSDK)||void 0===v?void 0:v._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(we))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(Te);null==o||o.classList.add("".concat(Te,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(_e).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(ge.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(ge.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===ne.mobile?"touchend":"click",i=document.getElementById("".concat(ke,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(ke))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(null==t||t.classList.add("".concat(_e,"-opacity")),e.classList.remove("".concat(ke,"-hidden")),e.classList.add("".concat(ke,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(ke),t=document.getElementById(_e),e&&(e.classList.remove("".concat(ke,"-show")),e.classList.add("".concat(ke,"-hidden")),setTimeout((function(){e.classList.remove("".concat(ke,"-hidden")),null==t||t.classList.remove("".concat(_e,"-opacity"))}),De))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),Qa=[{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ue.V1,paymentMethodCategoryType:V.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:Tn.canMakePayments,optional_init:kn.optional_init,createComponent:Tn.createComponent,destroyComponent:Tn.destroyComponent}},{sessionMatcher:{productScene:G.CASHIER_PAYMENT,productSceneVersion:ue.V1,paymentMethodCategoryType:V.APM,paymentMethodTypes:[ce.PAYPAL_CHECKOUT,ce.PAYPAL_PAYLATER,ce.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:wn.mountComponent,destroyComponent:wn.destroyComponent}}],Za=function(e){return"boolean"!=typeof e||e},Xa=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"logger",void 0),c()(Xe()(r),"onEventCallback",(function(e){qe.publish(new Ge(Pn.onEventCallback,JSON.stringify(e)))})),c()(Xe()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),c()(Xe()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),c()(Xe()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&ce.PAYPAL_VAULT===i&&r.onEventCallback({code:se.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),c()(Xe()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;Za(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),c()(Xe()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,f=u.enableMessages,m=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),f?y.append("components","messages,buttons"):y.append("components","buttons"),W.intent===m&&ce.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),ce.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),c()(Xe()(r),"onShippingChange",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"createOrder",function(){var e=s()(i()().mark((function e(t,n,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ji({paymentSessionData:o,paymentSessionConfig:s},{env:a,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(l=c.extendInfo)&&void 0!==l&&l.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),c()(Xe()(r),"onApprove",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&wt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"onCancel",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:se.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&wt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Xe()(r),"destroyComponent",function(){var e=s()(i()().mark((function e(t,n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(wn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:h()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:se.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;Za(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case wn.mountComponent:this.renderPaypalButton(e,t);break;case wn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(We),$a=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===st(t)&&(i=document.querySelector(t)),null===i){var a={code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:re.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:ge.error.name,data:a}})}n===F.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},es=function(e){var t=document.body||null;t&&t.appendChild(e)},ts=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Pn)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===Pn.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(We),ns=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(In)}},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===In.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(We),rs=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"logger",void 0),t.logger=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Cn)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Cn.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(We),os=window.navigator.userAgent||"",is=function(){var e=os.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},as=/android/i.test(os),ss=/iphone|ipad|ipod/i.test(os),ls=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(os)&&as&&os.indexOf("Version")<0,cs=/qqbrowser/i.test(os),us=/firefox/i.test(os);/baidubrowser/i.test(os);function ds(e){window.location.href=e}function ps(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function hs(){Va||((Va=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),Va.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(Va))}function fs(e){Va.src=e}function ms(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function vs(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var gs,ys,_s,bs=5e3;function Es(e,t){gs=+new Date,ys=setTimeout((function(){!(!!Wa&&document[Wa])&&e&&e()}),t||5e3)}function Ss(e){void 0!==qa?document.addEventListener(qa,(function(){return As(e)})):window.addEventListener("pagehide",(function(){return As(e)}))}function As(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||bs;o-(gs||+new Date)<i&&n(t)}}(e),ys&&clearTimeout(ys))}function ks(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function Ts(e){return Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ts(e)}function ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(n),!0).forEach((function(t){Is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Is(e,t,n){return(t=Rs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rs(r.key),r)}}function Rs(e){var t=function(e,t){if("object"!==Ts(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ts(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(Wa="hidden",qa="visibilitychange"):void 0!==e.mozHidden?(Wa="mozHidden",qa="mozvisibilitychange"):void 0!==e.msHidden?(Wa="msHidden",qa="msvisibilitychange"):void 0!==e.webkitHidden&&(Wa="webkitHidden",qa="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(_s||(_s={}));var Ns=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=ms(r,i),n.options.scheme=ms(t,i),ss&&is()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=ms(r,i),n.evokeLink()):t?(n.options.scheme=ms(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=Ps(Ps({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:_s.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&ks(n))throw new Error("请填写正确格式的scheme");if(o&&!ks(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&ks(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=_s.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=_s.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;ss?is()>9||cs?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!ks(l)&&(this.evokeAppBy.type=_s.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(vs(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Cs(t.prototype,n),r&&Cs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Os=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"originOptions",void 0),c()(this,"logger",void 0),c()(this,"_eventCenter",void 0),c()(this,"_instanceId",void 0),c()(this,"_storageId",void 0),c()(this,"_appendParams",void 0),c()(this,"_componentApp",void 0),c()(this,"securitySdkMap",void 0),c()(this,"plugins",void 0),this._instanceId=je(),this.originOptions=t,this.options={},this._eventCenter=new lt,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=Tt(n);r||(Tt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new _a(ba,![$.prod,$.sandbox].includes(null==t?void 0:t.environment)),_a.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return m()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=_t(Tt(n),{});if([$.prod,$.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return Zi.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){Tt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||G.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Nt(w,i)>=0&&Nt(a,w)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&qe.isSubscribed(n)&&qe.publish(new Ge(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=d()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?G.EASY_PAY:n,o=e.scene,i=void 0===o?G.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||yn(a),l=Sn.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:fn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||yn(e.product),n=Sn.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=An.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||yn(t.product),e.next=4,Sn.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||yn(e.product),a=o.h5gateway||gn(e.region),s=Sn.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=_n(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);pn.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new bn({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){Sn.setReady(i,d),t&&t(),e(d)}),(function(e){Sn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));Sn.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){Sn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(hn(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=Et()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in $)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:yt?te.WAP:te.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===te.WAP&&(this.options.env.osType=vt?ee.IOS:gt?ee.ANDROID:ee.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||Z.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=Z.component),this.options.networkMode=(null==e?void 0:e.networkMode)||X.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in X)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=X.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==st(e.onError))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.error.name,e.onError,ge.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==st(e.onPaymentMethodSelected))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.paymentMethodSelected.name,e.onPaymentMethodSelected,ge.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==st(e.onSizeChanged))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.sizeChanged.name,e.onSizeChanged,ge.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==st(e.onLog))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.log.name,e.onLog,ge.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==st(e.onEventCallback))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.eventCallback.name,e.onEventCallback,ge.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==st(e.onClose))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.close.name,e.onClose,ge.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.beforeSubmit.name,function(){var n=s()(i()().mark((function n(r){var o,a;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=je(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:a=n.sent,t._componentApp.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:o,data:a}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:ge.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),ge.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==st(e.onChange))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ge.onChange.name,e.onChange,ge.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===st(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===te.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new Ns(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===G.ELEMENT_ADDRESS&&(n=this._getPlugin(G.ELEMENT_ADDRESS)),n}}]),e}();function Ls(e,t){return Ds.apply(this,arguments)}function Ds(){return Ds=s()(i()().mark((function e(t,n){var r,o,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,a=void 0===o?[]:o,l=r.paymentRequestId,Array.isArray(a)){e.next=3;break}return e.abrupt("return");case 3:if(0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(a),requestId:l}),a.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,a=null;t===r.AIRWALLEX?a=It({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":l},timeOut:3},n):a=It({src:i,timeOut:3},n);o.push(a)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),Ds.apply(this,arguments)}var Ms=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):z.NONE},xs=function(e){try{return[JSON.parse(Pt(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},Us=function(e){var t=xs(e),n=nt()(t,2),r=n[0],o=n[1];return function(e){var t;bt()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===G.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},Bs=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:F.popup},e),r=Us(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=nt()(r,2),i=o[0],a=o[1],s=Ms(i);if(et()(Object.values(j)).includes(s)&&n.renderDisplayType===F.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===G.ELEMENT_ADDRESS&&(s=z.ELEMENT_ADDRESS),s===z.NONE)return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;Tt(hn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},Ks=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;g()(this,r),t=n.call(this,e),c()(Xe()(t),"channelType",void 0),c()(Xe()(t),"productSceneVersion",void 0),c()(Xe()(t),"timer",void 0),c()(Xe()(t),"_validateResolveMap",new Map);var o=new Ja({appVersion:e.appVersion});return o.setRender($a),o.setPreloadRender(es),t._registerPlugin(ve,o),t._componentApp=t._getPlugin(ve),t.registerBusAbility(),t}return m()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=Z.component,this.options.networkMode=this.options.networkMode||X.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===G.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===X.proxy?(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(me.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,Ls(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===z.VAULTING_CARD?z.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;qe.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==$.prod,this.logger),qe.clear(),qe.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(n)}))}}),qe.subscribe(new ts((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(ge.eventCallback.name,e)}))),qe.subscribe(new ns((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),qe.subscribe(new rs(this.logger)),qe.subscribe(new ia(this.logger)),qe.subscribe(new Xa(this.logger)),Qa.forEach((function(e){var n;null!=e&&e.busSubscriber&&qe.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&qe.publish(new Ge(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&qe.isSubscribed(i)?qe.publishForResult(new Ge(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:F.popup}).then((function(e){return Bs(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(ge.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&qe.isSubscribed(n))return qe.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(An.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:F.inline,selector:t}).then((function(e){return Bs(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(ge.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&qe.isSubscribed(n))return qe.publish(new Ge(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==G.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=je();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&qe.isSubscribed(a)?qe.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=je();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:ye.name,data:{},eventCallbackId:n});var r=function(){var t=s()(i()().mark((function t(n){var r,o,a;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),a={isValid:!1},i=null==n?void 0:n.data,"object"===Qe()(i)&&null!==i&&"boolean"==typeof i.isValid&&(a=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:a.isValid?"true":"false"}),o&&(o(a),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(ge.validateFieldsResult.forwardName,r,ge.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}(Os),Hs=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=je();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&qe.isSubscribed(a)?qe.publishForResult(new Ge(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(Ks),Ys=n(4005),Fs=n.n(Ys),js=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),zs=[{eventName:js.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:js.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],Gs=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(Te,"-hidden{\nanimation: ").concat(Te,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(Te,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),Vs=function(e,t){if(!document.getElementById(_e)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=Gs,document.head.appendChild(n),kt();var r=document.createElement("div");r.className="".concat(_e,"-hidden-").concat(e),r.id=_e,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=be,r.appendChild(o),r.classList.remove("".concat(_e,"-hidden-").concat(e)),r.classList.add("".concat(_e,"-").concat(e)),Ws(e,t),o}},Ws=function(e,t){var n=e===ne.mobile?"touchend":"click",r=document.getElementById(_e),o="<img class='".concat(Se,"-btn-").concat(e,"' src=\"").concat(Me,'"/>'),i=document.createElement("div");i.classList.add("".concat(Se,"-").concat(e),"".concat(Se,"-hidden")),i.id=Se,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},qs=function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(e.classList.remove("".concat(ke,"-show")),e.classList.add("".concat(ke,"-hidden")),setTimeout((function(){e.classList.remove("".concat(ke,"-hidden")),null==t||t.classList.remove("".concat(_e,"-opacity"))}),De))},Js=function(){var e=document.getElementById(ke),t=document.getElementById(_e);e&&(null==t||t.classList.add("".concat(_e,"-opacity")),e.classList.remove("".concat(ke,"-hidden")),e.classList.add("".concat(ke,"-show")))},Qs=function(){var e;null===(e=document.getElementById(ke))||void 0===e||e.remove()},Zs=function(e){var t=(null==e?void 0:e.platform)===ne.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=Te,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===ne.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Xs=function(){var e=document.getElementById(Te);null==e||e.classList.add("".concat(Te,"-hidden"))},$s=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(Te);null==e||e.remove()},el="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(De,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(De,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(De,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),tl=function(){var e=document.createElement("style");e.innerHTML=el,document.head.appendChild(e)};var nl="desktop",rl=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{nl=t;var c=document.createElement("div");c.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Oe,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var f=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(f),d.addEventListener("load",(function(){u.removeChild(f)}))}u.appendChild(d);var m=document.getElementsByTagName("body")[0];m.appendChild(c),m.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},ol=function(){var e=document.querySelector(".".concat(Ne,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===nl?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile"));e.classList.remove("".concat(Ne,"fadeIn")),e.classList.add("".concat(Ne,"fadeOut")),"desktop"===nl?(t.classList.remove("".concat(Ne,"fadeIn")),t.classList.add("".concat(Ne,"fadeOut"))):(t.classList.remove("".concat(Ne,"-drawer-enter")),t.classList.add("".concat(Ne,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),De)}},il=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e}({}),al=m()((function e(){g()(this,e),c()(this,"type",void 0),c()(this,"platform",void 0),c()(this,"isRetention",void 0),c()(this,"selector",void 0),c()(this,"appearance",void 0),c()(this,"appendAliasContainerId",void 0),c()(this,"merchantAppointParam",void 0),c()(this,"iframeStyle",void 0),c()(this,"notRedirectAfterComplete",void 0),this.platform=bt()?ne.desktop:ne.mobile,this.isRetention=!0,this.type=F.popup,this.selector=""})),sl=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function ll(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==sl.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=xs(a),l=nt()(s,1)[0],c=xs(i),u=nt()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function cl(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,u=e.locale,d=e.pageUrl,p=e.link,h=e.renderDisplayType,f=Ms(r),m=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",v=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",g=(null==r?void 0:r.extendInfo)||"",y=null==r?void 0:r.clientId,_=(o||"").split("&&")[1]||"",b=c()(c()(c()(c()(c()(c()({},B.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),B.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),B.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),B.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),B.SANDBOX,"https://checkout.antom.com"),B.PROD,"https://checkout.antom.com"),E=(null==a?void 0:a.toLocaleUpperCase())||B.DEV;p||(p="".concat(b[E]).concat(d));var S=ka({renderDisplayType:null!=h?h:F.inline,componentSign:f,analytics:l,productScene:v,productSceneVersion:m,environment:a,appVersion:s,extendInfo:g,locale:u,instanceId:i,hostSign:_,mid:y,elementLink:p}),A=S.path,k=S.locationSearch;return console.log("[debug] generateIframeSrc",A,k),"".concat(A,"?").concat(k)}function ul(e){return new Promise((function(t,n){var r=(yt?te.WAP:te.WEB)===te.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var dl=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},pl=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},hl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},fl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}},ml=function(){function e(t){g()(this,e),c()(this,"elementContainer",void 0),c()(this,"instanceId",void 0),c()(this,"options",void 0),c()(this,"obtainDataRes",void 0),c()(this,"elementUrl",void 0),c()(this,"eventCenter",void 0),c()(this,"eventListener",{}),this._setOptions(t)}return m()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||Z.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=Z.component),n.options.networkMode=(null==e?void 0:e.networkMode)||X.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in X)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=X.proxy),t=Et()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in $)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:yt?te.WAP:te.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===te.WAP&&(n.options.env.osType=vt?ee.IOS:gt?ee.ANDROID:ee.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product,this.options.preview=null==e?void 0:e.preview}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),vl=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===G.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:h()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return cl({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:il.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}(ml),gl=vl,yl=function(e){_()(n,e);var t=E()(n);function n(){return g()(this,n),t.apply(this,arguments)}return m()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return cl({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:il.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}(ml),_l=yl,bl="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(_e,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(we,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Re,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Re,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Re,"-desktop{}\n"),El=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=bl,document.head.appendChild(e)},Sl=function(e,t,n){var r=document.createElement("div");r.id=we,(null==n?void 0:n.componentSign)===z.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Re,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Re,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===ne.desktop&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===ne.mobile&&(r.innerHTML='<svg class="'.concat(Re," ").concat(Re,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(we);At(0,o)},Al=function(){function e(){g()(this,e),c()(this,"popupUrlQuery",void 0),c()(this,"popupApp",void 0)}var t;return m()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),a=!1,e.next=11,rl({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,s=setTimeout((function(){if(!a)throw{title:"sdk_error_create_pop_up"}}),Le),l=setTimeout((function(){if(!a)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){a=!0,clearTimeout(s),clearTimeout(l)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){ol()}}]),e}(),kl=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"initMessageEvent",void 0),c()(this,"clearTimerIdMapping",{}),c()(this,"popupManager",void 0),c()(this,"eventCenter",void 0),c()(this,"logService",void 0),c()(this,"displayInfo",void 0),c()(this,"webApp",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"clientHeight",void 0),c()(this,"boundFocusResizeChange",void 0),c()(this,"customizedLoadingListener",void 0)}return m()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=Zl.getInstance(t).getService("EventCenter"),this.logService=Zl.getInstance(t).getService("Log"),this.popupManager=new Al,Boolean(Object.keys(e).length)&&n.productScene===G.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));Ct(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===F.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e;if(document.getElementById(Ce)||El(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(_e,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):Vs(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===F.inline?e.selector:_e,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(_e);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(_e,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===F.inline)Sl(e,t.platform);else{var n=document.getElementById(Te);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(we),e.id=we,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(St(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(Te);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(we))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(_e);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(_e,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(_e,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(_e,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(ge.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(ge.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(ge.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(ge.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(ge.sizeChanged.name,(function(t){e.handleSizeChanged(h()({},t))})),this.eventCenter.listen(ge.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(ge.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(ge.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(ge.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(ge.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(ge.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(_e,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):_e;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===F.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(_e,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(_e,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===F.inline)null===(l=document.getElementById(we))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(_e,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):_e;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(Se);e?null==t||t.classList.remove("".concat(Se,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(Se,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(Se),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Ae);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(Se,"-light")),null==r||r.classList.add("".concat(Ae,"-light"))):(null==n||n.setAttribute("src",Me),null==t||t.classList.remove("".concat(Se,"-light")),null==r||r.classList.remove("".concat(Ae,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(tl(),this.popupManager.popup(h()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(ge.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:ge.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),Tl=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=wl,this.debug=![$.prod,$.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Qt("AMSSDK_STORAGE_ID");r||Zt("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:bt()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?fa.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=h()({},t),c=null==t?void 0:t.title;return ya[c]&&(l.title=ya[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:h()(h()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),wl={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},Pl=function(e){return new URL(e.src).origin},Il=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"iframes",void 0),c()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return m()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(ge.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(ge.beforeSubmit.name,(function(e){if(r.isExist(ge.beforeSubmit.name))r.emit(ge.beforeSubmit.name,e);else{var t=je();r.dispatchToApp({event:ge.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(ge.sendBroadcast.name,(function(e){r.dispatchToApp({event:ge.receiveBroadcast.name,data:e})})),r.listen(ge.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:ge.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(ge.submitForm.name),e.unlisten(ge.beforeSubmit.name),e.unlisten(ge.sendBroadcast.name),e.unlisten(ge.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:Pl(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===Pl(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ut(e.data)){var n=JSON.parse(e.data);if(n.context.event&&n.context.event,!this.checkEventCompliant(n))return;this._handleAppMessage(n)}else console.error(me.NOT_JSON_FORMAT)}},{key:"checkEventCompliant",value:function(e){if(e.name!==re.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=je()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:re.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(h()(h()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),Cl=function(){function e(){g()(this,e),c()(this,"sandboxFlag",void 0),c()(this,"instanceId",void 0)}return m()(e,[{key:"init",value:function(e,t,n){var r=Et()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[h()(h()({},t),{},{envInfo:r,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],a=Date.now(),s="",e.prev=4,l=this.createRequestInstance(n),e.next=8,l({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},s=ji(d,"Mgw-TraceId")||ji(d,"mgw-traceid",""),p.traceId=s||"",null==(f=zi(d,s))||!f.errorCode){e.next=20;break}throw m=(null==p?void 0:p.errorMessage)||(null==f?void 0:f.errorMessage),v=null==f?void 0:f.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:v,errorMessage:m,traceId:s}),new Error(JSON.stringify({errorMessage:m,errorCode:v,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!0,code:"SUCCESS",errorMessage:"",traceId:s}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=_t(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:ie.SYSTEM,traceId:s,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?ie.TIMEOUT:"",b=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:b,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:b,traceId:s,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=h()(h()({terminalType:yt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=vt?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){Zl.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=Mi(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Di(null==e?void 0:e.hostSign,i)||Ri[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Oi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Oi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Li),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ni),"sdk-version",w||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Ti.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),Rl=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),Nl={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},Ol=c()(c()(c()(c()(c()(c()(c()(c()({},G.CASHIER_PAYMENT,"Acquirer"),G.AUTO_DEBIT,"Acquirer"),G.VAULTING,"Acquirer"),G.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),G.EASY_PAY,"EasyPay"),G.FLASH_BUY,"OneAccount"),G.ELEMENT_PAYMENT,"Acquirer"),Ll=function(e){return Ol[e]||""},Dl=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},Ml=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||Nl[Rl.SG],this.environment=t.environment}var t,n,r;return m()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=pn.getInstance(),n=Dl(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return pn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(Ol).includes(this.scene)||!Object.values(Nl).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o),console.log("initToken result tokenResult",JSON.stringify(r),o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),xl=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"productScene",G.EASY_PAY),c()(this,"environment",void 0)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.logger=Zl.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(a=s()(i()().mark((function e(){var t,n,r=this,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(s()(i()().mark((function o(){var a,s,l,c;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=Date.now(),s=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:s});case 4:if(l=o.sent,c="",!l){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,l.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,l.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,a);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"preInitSecurity",value:(o=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l=this,c=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!Sn.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!Sn.isLoading(o)){e.next=19;break}if(!(a=Sn.get(o))||"loading"!==a.status){e.next=19;break}return e.prev=9,e.next=12,a.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),s=Dl(this.environment),pn.getInstance().scheduleLoad({environment:s,callbacks:{onLoad:function(e){l.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){l.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:l.productScene}).send()},onLoadTimeout:function(){l.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:l.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){l.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:l.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),l._newSecuritySDKByScene({product:l.productScene,region:t?Rl.SG:void 0},(function(){l.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:l.productScene}:void 0).send(),e()}),(function(e){l.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:l.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||Ll(e)}},{key:"_getSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",Sn.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||Ll(e.product),a=o.h5gateway||(r=e.region,Nl[r]||Nl[Rl.SG]),s=Sn.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new Ml({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){Sn.setReady(i,l),t&&t(),e(l)}),(function(e){Sn.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));Sn.setLoading(i,c)}catch(e){Sn.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=Tt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=_t(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),Ul=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Bl=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return m()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Kl=m()((function e(){g()(this,e)})),Hl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g()(this,e),c()(this,"isDebug",!0),c()(this,"instanceId",void 0),c()(this,"logger",void 0),this.instanceId=t,this.logger=Zl.getInstance(this.instanceId).getService("Log")}return m()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(Ul.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(Ul.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(Ul.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new Bl((function(e){r.traceLog(Ul.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(Ul.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=d()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(Ul.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,p=d()(e.interceptors);try{for(p.s();!(u=p.n()).done;){var h=u.value;null==h||h.onPublishException(t,n)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var f,m=!1,v=d()(e.interceptors);try{for(v.s();!(f=v.n()).done;){var g=f.value;m=m||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}m?this.publish(t,n):this.traceError(Ul.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(Ul.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(Ul.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(Ul.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=d()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(Ul.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();c()(Hl,"interceptors",[]),c()(Hl,"subscribersMap",new Map),c()(Hl,"TAG","BusManager"),c()(Hl,"_logSplit"," , ");var Yl=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),Fl=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),jl=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),zl=function(e){return e.reportAnalytics="reportAnalytics",e}({});Yl=function(e){return e.onDestory="httpRequest",e}(Yl||{});var Gl=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"instanceId",void 0),c()(Xe()(t),"logger",void 0),t.instanceId=e,t.logger=Zl.getInstance(t.instanceId).getService("Log"),t}return m()(r,[{key:"actionNames",value:function(){return Object.values(zl)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===zl.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Kl),Vl=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t;return g()(this,a),t=o.call(this),c()(Xe()(t),"instanceId",void 0),t.instanceId=e,t}return m()(a,[{key:"actionNames",value:function(){return Object.values(jl)}},{key:"preInitSecurity",value:(r=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Zl.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Zl.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Zl.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case jl.preInitSecurity:this.preInitSecurity(e,t);case jl.initSecurity:this.initSecurity(e,t);case jl.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),a}(Kl),Wl=function(e){_()(n,e);var t=E()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Xe()(r),"instanceId",void 0),r.instanceId=e,r}return m()(n,[{key:"actionNames",value:function(){return Object.values(Fl)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=Zl.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){Zl.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),Zl.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Fl.getGlobalData:this.getGlobalData(e,t);break;case Fl.setGlobalData:this.setGlobalData(e,t);break;case Fl.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Kl),ql=function(e){_()(r,e);var t,n=E()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Xe()(t),"instanceId",void 0),t.instanceId=e,t}return m()(r,[{key:"actionNames",value:function(){return Object.values(Yl)}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Zl.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Zl.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Yl.request:this.request(e,t);break;case Yl.getEnvInfo:this.getEnvInfo(e,t);break;case Yl.getUserAgent:this.getUserAgent(e,t)}}}]),r}(Kl),Jl=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"instanceId",void 0),c()(this,"busManager",void 0)}return m()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=Zl.getInstance(this.instanceId).getService("Log"),this.busManager=new Hl(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==$.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new Vl(this.instanceId)),this.busManager.subscribe(new Gl(this.instanceId)),this.busManager.subscribe(new Wl(this.instanceId)),this.busManager.subscribe(new ql(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),Ql=function(){function e(){g()(this,e),c()(this,"globalData",new Map)}return m()(e,[{key:"init",value:function(e,t){var n=this,r=Zl.getInstance(t).getService("EventCenter");r.listen(ge.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(ge.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),Zl=function(){function e(t){g()(this,e),c()(this,"instanceId",void 0),c()(this,"services",{Log:new Tl,ApiBusManager:new Jl,Requester:new Cl,Container:new kl,Security:new xl,EventCenter:new Il,GlobalData:new Ql}),c()(this,"extendServices",{}),this.instanceId=t}return m()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();c()(Zl,"ProvidersMapping",{});var Xl={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"https://www.baidu.com",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},$l={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},ec={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},tc={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]};function nc(e){"GOOGLEPAY"===e.paymentMethodType&&(e.paymentMethodDetail=h()(h()({},e.paymentMethodDetail),{},{googlePayProps:{environment:"TEST",existingPaymentMethodRequired:!0,paymentRequest:{allowedPaymentMethods:[{parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","JCB"]},tokenizationSpecification:{parameters:{protocolVersion:"ECv2",publicKey:"BDM6GVTLZmxSmTQzm04QKI2av54kFpkqjhbkejtdDUx+VMvUtJ6vc+ZlDp8TygNTf+QeihxpD869sCVWaa0KMJc="},type:"DIRECT"},type:"CARD"}],apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION"],merchantInfo:{merchantId:"123",merchantName:"merchantName"},shippingAddressRequired:!0,transactionInfo:{countryCode:"US",currencyCode:"EUR",totalPrice:"10",totalPriceStatus:"FINAL"}}}}))}var rc,oc=new _a(ba,!0),ic=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},sc=function(e){_()(o,e);var t,n,r=E()(o);function o(){var e;g()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),c()(Xe()(e),"ApplePayService",void 0),c()(Xe()(e),"_onBeforeConfirm",null),c()(Xe()(e),"_merchantAmount",null),c()(Xe()(e),"_merchantCurrency",null),e}return m()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a,s,l=this.elementContainer.getPaymentContext();if(this.getLogger().logInfo({title:"sdk_event_renderComponent"}),"mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)){var c,u,d,p,h=(null==e||null===(c=e.originActionQueryResult)||void 0===c?void 0:c.paymentMethods)||[],f=(null==e||null===(u=e.originActionQueryResult)||void 0===u?void 0:u.savedPaymentMethods)||[];if(!(1!==h.length||0!==f.length||null!==(d=h[0])&&void 0!==d&&null!==(d=d.paymentElements)&&void 0!==d&&d.length||["APPLEPAY","GOOGLEPAY"].includes(null===(p=h[0])||void 0===p?void 0:p.paymentMethodType)))return}var m,v=null==l||null===(n=l.displayInfo)||void 0===n?void 0:n.appearance;if("string"==typeof(null==v?void 0:v.theme)&&v.theme.startsWith("APR_")){var g,y,_=null==e||null===(g=e.originActionQueryResult)||void 0===g||null===(g=g.pageStyle)||void 0===g?void 0:g.elementSettings;m="string"==typeof _?null===(y=fl(_))||void 0===y?void 0:y.appearance:null==_?void 0:_.appearance}else m=v;this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==l?void 0:l.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(o=this.elementContainer)||void 0===o?void 0:o.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(i=this.elementContainer)||void 0===i?void 0:i.getPaymentContext().paymentSessionId,merchantId:null===(a=this.elementContainer)||void 0===a||null===(a=a.getPaymentContext())||void 0===a||null===(a=a.paymentSessionObj)||void 0===a?void 0:a.clientId,paymentMethodType:null===(s=this.elementContainer)||void 0===s||null===(s=s.getPaymentContext())||void 0===s||null===(s=s.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType},appearance:m,sessionResult:null==l?void 0:l.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return Zl.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(ge.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(ge.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:ge.closePaymentPolling.name,data:t})})),this.eventCenter.listen(ge.getGooglePayToken.name,(function(t,n){Oa(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:h()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(ge.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new La({paymentSessionData:i,parseData:o,logger:oc,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(ge.beforeConfirm.name,s()(i()().mark((function t(){var n,r,o,a,s,l;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return oc.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return oc.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,Pa((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,a=o.result,s=o.timedOut,l=a,(s||Date.now()-r>=wa)&&(oc.logError({title:"sdk_before_confirm_timeout"}),l=!1),oc.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:l}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!0,result:!!l}}),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(6),oc.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ge.beforeConfirm.name,data:{success:!1,result:!1}});case 23:case"end":return t.stop()}}),t,null,[[6,19]])}))))}},{key:"initApplePaySdk",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new La({paymentSessionData:o,parseData:r,logger:oc,env:this.options.env.environment}),e.prev=3,oc.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:oc.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),oc.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t,n=e.link,r=e.instanceId;this.instanceId=r;var o=this.elementContainer.getPaymentContext()||{},i=o.paymentSession,a=o.paymentSessionObj,s=o.sdkMetaData,l=this.options,c=l.env.environment,u=l.analytics,d=l.locale,p=(a||{}).extendInfo,h="mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)?F.popup:F.inline,f=cl({paymentSession:i,paymentSessionObj:a,environment:c,analytics:u,locale:d,link:n,appVersion:null==s?void 0:s.webAppVersion,pageUrl:ic(p)?il.EXPRESS_CHECKOUT:il.ELEMENT_PAYMENT,instanceId:r,renderDisplayType:h});return this.setElementUrl(f),f}},{key:"obtainData",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Zl.getInstance(this.instanceId).getService("Requester"),o=this.elementContainer.getPaymentContext(),a=o.paymentSession,s=o.paymentSessionObj,l=o.displayInfo,c=l.debugProps,u=this.options,d=u.env.environment,p=u.locale,h=(s||{}).paymentSessionConfig,f=a.split("&&")[1]||"",m=null==s||null===(t=s.connectFactor)||void 0===t?void 0:t.enableConnect,v=(null==c?void 0:c.isDebug)&&(null==c?void 0:c.local_mock),g=null===(n=this.options)||void 0===n?void 0:n.preview,y=!0===g||"web"===g||"mobile"===g,_=v||y,b=Et(this.getElementUrl()),E=b.appType,S=dl()?"WEB":E?"APP":pl()?"WEB":"WAP",A=function(){return new Promise((function(e,t){var n;if(_)setTimeout((function(){if(y){var t=C.buildPreviewMockData(Xl);e(t)}else e(Xl)}),100);else{C.getLogger().logInfo({title:"sdk_action_query_start"},{config:hl(h)});var o={paymentSessionConfig:h,paymentSessionData:a,extParams:{isUserPreferredLocale:!0}},i=null==l?void 0:l.appearance;"string"==typeof(null==i?void 0:i.theme)&&i.theme.startsWith("APR_")&&(o.appearanceId=i.theme),null!=l&&null!==(n=l.merchantAppointParam)&&void 0!==n&&n.storedCard&&(o.merchantAppointParam=l.merchantAppointParam),Object.prototype.hasOwnProperty.call(l,"notRedirectAfterComplete")&&(o.notRedirectAfterComplete=l.notRedirectAfterComplete),r.request(o,{env:d,envInfo:{locale:p,terminalType:S},hostSign:f,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?C.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:hl(h),rpcTraceId:null==t?void 0:t.traceId}):C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:hl(h),errorMessage:hl((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),C.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:hl(h),errorMessage:hl(e)})}))}}))},k=function(){return new Promise((function(e,t){_?setTimeout((function(){e($l)}),100):r.request({paymentSessionConfig:h,paymentSessionData:a,accountInfo:{email:""}},{env:d,envInfo:{locale:p,terminalType:S},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=18,Promise.all(m?[A(),k()]:[A()]);case 18:return T=e.sent,w=nt()(T,2),P=w[0],I=w[1],this.obtainDataRes={originActionQueryResult:P,originOneAccountQueryResult:I},e.abrupt("return",{originActionQueryResult:P,originOneAccountQueryResult:I});case 24:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"buildPreviewMockData",value:function(e){var t=this.elementContainer.getPaymentContext().displayInfo,n=null==t?void 0:t.previewPaymentMethods,r=JSON.parse(JSON.stringify(e)),o=function(e){if(!e)return[];var t=e.expressCheckout,n=e.supportedMethods,r=e.topping,o=((null==t?void 0:t.methods)||[]).map((function(e){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,expressCheckout:!0};return nc(t),t})),i=[];(n||[]).forEach((function(e){if("CARD"!==e.paymentMethodName){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,icon:e.logoUrl,recommend:!1};t.paymentMethodType===r&&(t.recommend=!0),nc(t),function(e){"ONLINEBANKING_YAPILY"===e.paymentMethodType&&(e.paymentElements=[])}(t),i.push(t)}}));var a=function(){var e=-1,t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n,r){"CARD"===n.paymentMethodName&&(t.push({cardBrand:n.paymentMethodType,logoUrl:n.logoUrl||""}),-1===e&&(e=r))})),t.length?{firstCardIndex:e,cardPaymentMethod:{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,logoList:t,paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"}}:null}(n);return a&&i.splice(a.firstCardIndex,0,a.cardPaymentMethod),[].concat(et()(o),i)}(n);return r.paymentMethods=o,r}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=xs(n),o=nt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}(ml),lc=sc;function cc(){try{var e=Qt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=je(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return Zt("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function uc(e){return uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uc(e)}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){hc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hc(e,t,n){return(t=mc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mc(r.key),r)}}function mc(e){var t=function(e,t){if("object"!==uc(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==uc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===uc(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(rc||(rc={}));var vc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=pc(pc({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:rc.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){hs(),Ss({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&ks(o)?(this.options.link=ms(o,i),this.handleLink()):n&&!ks(n)?(this.options.scheme=ms(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=rc.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;ss?is()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=rc.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(vs(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=rc.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(ss?this.handleIOSScheme():ls||us?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;is()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(vs(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ds(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return ps(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return fs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Es(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&fc(t.prototype,n),r&&fc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),gc=vc,yc=function(e,t){var n=Zl.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},h()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new gc({successCb:function(){_c(e,le.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){bc(e,le.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===oe.BLANK)return e.url?(_c(e,le.NormalUrl,e.url,n),void window.open(e.url)):bc(e,le.NormalUrl,"",n);if(!(e.browserLinkTarget!==oe.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?(_c(e,le.NormalUrl,e.url,n),void window.location.replace(e.url)):bc(e,le.NormalUrl,"",n);if(bt())return e.url?(_c(e,le.NormalUrl,e.url,n),void(window.location.href=e.url)):bc(e,le.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?(_c(e,le.NormalUrl,e.url,n),void(window.location.href=e.url)):bc(e,le.NormalUrl,"",n);var o=new gc({successCb:function(t){var r="Scheme"==t.type?le.SchemeUrl:le.ApplinkUrl;_c(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(bc(e,le.SchemeUrl,e.schemeUrl,n),!e.url)return bc(e,le.NormalUrl,"",n);_c(e,le.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(bc(e,le.SchemeUrl,e.schemeUrl,n),!e.url)return bc(e,le.NormalUrl,"",n);_c(e,le.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){bc(e,le.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){bc(e,le.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},_c=function(e,t,n,r){r.getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},bc=function(e,t,n,r){r.getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},Ec=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function Sc(e,t){for(var n,r=e||window.navigator.userAgent||"",o=Ec,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(Ac(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(Ac(t,r,n.iosScheme),n.iosScheme):void 0;Ac(t,r,"")}function Ac(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var kc=function(){function e(){g()(this,e),c()(this,"bizFlowStartBehavior",void 0),c()(this,"initOptions",void 0),c()(this,"paymentContext",void 0),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"productProcessors",{}),c()(this,"enablePopWindowEventCallback",!1),c()(this,"eventLogging",void 0),c()(this,"status",sl.UNINIT),c()(this,"logger",void 0),this.status=sl.INITING}var t;return m()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=an(e),n=t.id,r=t.data;this.paymentContext=h()(h()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=je(),this.sdkMetaData={webAppVersion:"",greyscaleId:cc(),productScene:t,sdkVersion:w},this.sdkMetaData.webAppVersion=sn(this.sdkMetaData),Zl.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=Zl.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=Zl.getInstance(this.instanceId).getService("EventCenter");r.listen(ge.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};yc(a,n.instanceId),i&&n.cleanRender()}})),r.listen(ge.initSecuritySDK.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=Zl.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,s.initSecurity();case 4:l=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),l=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{success:l}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.getDeviceId.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=Zl.getInstance(n.instanceId).getService("Security"),e.next=3,s.getDeviceId(t);case 3:l=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{deviceId:l}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.getSdkVersion.name,function(){var e=s()(i()().mark((function e(n,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ge.destroy.name,(function(e){n.setStatus(sl.READY),n.destroy()})),r.listen(ge.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(ge.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(ge.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(ge.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(ge.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(sl.IN_BIZ_FLOW),a=t.paymentSession,s=t.displayInfo,l=an(a),c=l.id,u=l.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:a,paymentSessionId:c,paymentSessionObj:u,displayInfo:h()(h()({},new al),s),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Bt(this.paymentContext.paymentSessionObj.extendInfo),f=sn(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=f,Zl.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),i=this.sdkMetaData,Zt("Antom_".concat(i.sdkVersion+i.productScene,"_LastAppVersion"),""),m=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,v=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(m,"|").concat(v)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(m,"|").concat(v)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(m)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(m)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=Zl.getInstance(this.instanceId).getService("EventCenter"),b={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(ge.eventCallback.name,{code:se.SDK_REDIRECT,result:{redirectUrls:b}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((E=new URL(y.url)).searchParams.set("source","embedded"),y.url=E.toString()),yc(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var i}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return Zl.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=Zl.getInstance(this.instanceId).getService("EventCenter"),n=Zl.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==F.inline&&(e.paymentContext.displayInfo.isRetention?Js():e.handleClose(t,"behavior"))};t.listen(ge.close.name,(function(){a(!0)})),t.listen(ge.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(ge.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(ke,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(ke,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,f,m,v=document.getElementById("".concat(ke,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg):v.style.backgroundColor=null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg);var g,y,_,b,E,S,A,k=document.getElementById("".concat(ke,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.corner,"px"),"stroke"===(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.type)?k.style.border="1px solid ".concat(null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg):k.style.backgroundColor=null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===F.inline?(n.showLoading(s,this.paymentContext.displayInfo),void tl()):r==F.popup?(function(e,t,n){var r=e===ne.mobile?"touchend":"click",o=document.createElement("div");o.id=ke,o.classList.add("".concat(ke,"-").concat(e)),o.innerHTML='\n <span id="'.concat(ke,'-title" class="').concat(ke,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(ke,'-sub-title"\n class="').concat(ke,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(ke,"-btn-block-").concat(e,'">\n <div id="').concat(ke,'-remain" class="').concat(ke,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(ke,'-leave" class="').concat(ke,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(ke,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(ke,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){qs(),e.handleRemain()}),(function(){qs(),e.handleClose(!1,"retention")})),Zs({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:fe.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=Zl.getInstance(this.instanceId).getService("EventCenter");if(n.emit(ge.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?fe.OnlyClose:fe.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(ge.eventCallback.name,{code:se.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=Zl.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),$s(),Qs()};null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(we))||void 0===t||t.remove(),o.startHideAnim(),Xs(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),Tc=function(){function e(){g()(this,e)}return m()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),wc=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),Pc=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;g()(this,e),c()(this,"containerStatus",void 0),c()(this,"instanceId",void 0),c()(this,"containerService",void 0),c()(this,"eventService",void 0),c()(this,"containerElement",void 0),c()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(wc.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=Zl.getInstance(this.instanceId).getService("Container"),Zl.getInstance(this.instanceId).init({},{productScene:G.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var u=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:F.inline,platform:dl()||pl()?ne.desktop:ne.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Oe}},s.generateIframeSrc({link:u,instanceId:this.instanceId})),this.eventService=Zl.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return m()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(ge.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(ge.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),Ic=function(){function e(t){var n=t.instanceId;g()(this,e),c()(this,"containerServices",void 0),c()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return m()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new Pc({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),Cc=function(){function e(t){var n=t.logger;g()(this,e),c()(this,"activeEvents",new Map),c()(this,"heartbeatIntervalId",null),c()(this,"HEARTBEAT_INTERVAL",5e3),c()(this,"uniqueId",0),c()(this,"logger",void 0),this.logger=n}return m()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==st(t)&&this.sendLog("data_error",{msg:hl(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=nt()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:hl(e)})}},{key:"sendLog",value:function(e,t){var n=c()(c()(c()(c()(c()(c()(c()(c()(c()(c()({},"".concat(H.MOUNT,"_start"),"sdk_event_mount"),"".concat(H.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(H.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(H.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(H.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(H.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(H.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(H.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},h()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),Rc=["type"],Nc=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"elementContainer",void 0),c()(this,"serviceMap",void 0),c()(this,"loading",void 0),c()(this,"elementProcessors",void 0),c()(this,"initTimeout",void 0),c()(this,"elementContainerService",void 0),c()(this,"onStatusChangeCallback",void 0),c()(this,"submitPayPromise",void 0),c()(this,"elementEventCenter",void 0),c()(this,"currentPaymentMethodType",""),c()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:R.VALIDATE,data:{params:{},target:t,source:N.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),c()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:R.SUBMIT_PAY,data:{params:h()(h()({},n),{},{doMain:window.location.hostname}),target:t,source:N.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new kc,this.elementContainer.registerProcessor(G.ELEMENT_PAYMENT,"",new Tc),this.elementContainer.init(this.options,G.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new Ic({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(sl.READY),this.elementEventCenter=new Cc({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return m()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new _l(this.options),address:new gl(this.options),payment:new lc(this.options)};this.elementProcessors=h()(h()({},this.elementProcessors),{},c()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:hl(r||""),eventMessage:hl(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(sl.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:U.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:me.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var r=this.elementContainerService.getContainerService(e).getInstanceId(),o=this.elementContainer.getPaymentContext();Zl.getInstance(r).update(o),this.serviceMap.Log=Zl.getInstance(r).getService("Log"),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:h()(h()({},me.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:U.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=an(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(H.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===sl.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:me.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===sl.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:me.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:me.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:hl(e)}),r(h()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:h()(h()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(sl.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=s()(i()().mark((function e(){var t,n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(H.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[O.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT);case 7:return a=e.sent,n=null!==(o=a.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,f,m,v,g,y,_,b,E=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(H.SUBMITPAYMENT),this.elementContainer.getStatus()===sl.IN_BIZ_FLOW){e.next=6;break}return r={error:h()(h()({},me.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:L.FAIL},o={eventCode:L.FAIL,errorName:me.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:hl(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),a="APPLEPAY"===this.currentPaymentMethodType,l=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||a){e.next=34;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.prev=11,c=Date.now(),e.next=15,Pa((function(){return t.onBeforeConfirm()}));case 15:if(u=e.sent,d=u.result,!((p=u.timedOut)||!d||Date.now()-c>=wa)){e.next=23;break}return p?this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:l,path:"nonApplePay_sync"}):this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:L.FAIL,errorName:"MERCHANT_CONFIRM_ABORT"}),e.abrupt("return",{status:L.FAIL,error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 23:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.next=32;break;case 26:return e.prev=26,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:l,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:L.FAIL,errorName:"MERCHANT_CONFIRM_ABORT"}),e.abrupt("return",{status:L.FAIL,error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 32:e.next=35;break;case 34:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:l,path:a?"applePay_eventBridge":"nonApplePay_sync"});case 35:return f=null,e.prev=36,e.next=39,new Promise(function(){var e=s()(i()().mark((function e(n){var r,o,l,c,u,d,p,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[O.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(f=e)},r=E,e.prev=2,E.submitPayPromise=o,l={},c=function(){var e=s()(i()().mark((function e(t,n){var r,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,E.onValidateAndSubmitPay(E.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,a=r.data,l.shipping=null==a?void 0:a.data,null!=a&&a.success){e.next=11;break}return o(f=a),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,c(O.auth,N.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,c(O.address,N.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!E.elementProcessors[O.payment]){e.next=28;break}return u=a&&!(null==t||!t.onBeforeConfirm),E.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:hl({hasBeforeConfirmForApplePay:u,isApplePay:a})}),E.elementProcessors[O.payment].setOnBeforeConfirm(u?t.onBeforeConfirm:null),d=!(null==t||!t.amount),p=!(null==t||!t.currency),!d&&!p||d&&p||E.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:hl({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),E.elementProcessors[O.payment].setMerchantAmountOverride(d&&p?t.amount:null,d&&p?t.currency:null),e.next=24,E.onValidateAndSubmitPay(E.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT,(_=void 0,h()(h()(h()({},l),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&p?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:u})));case 24:m=e.sent,v=m.data,o(f=v);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:h()(h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:L.FAIL},E.serviceMap.Log.logError({title:ga.sdk_element_missKeyData},{msg:JSON.stringify(y)}),f=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 39:return e.abrupt("return",e.sent);case 40:return e.prev=40,b={eventCode:null===(m=f)||void 0===m?void 0:m.status,errorName:null===(v=f)||void 0===v||null===(v=v.error)||void 0===v?void 0:v.code,errormessage:null===(g=f)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.message,needChangeSessionForRetry:null===(y=f)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.needChangeSessionForRetry,rpcTraceId:null===(_=f)||void 0===_||null===(_=_.error)||void 0===_?void 0:_.traceId,msg:hl(f)},this.elementEventCenter.endEvent(n,b),this.changeLoading(!1),e.finish(40);case 45:case"end":return e.stop()}}),e,this,[[11,26],[36,,40,45]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(R.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(ge.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(wc.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ge.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:se.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:se.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===oe.BLANK)return a.normalUrl?(s(le.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(le.NormalUrl,"");if(!(a.target!==oe.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(le.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(le.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;ul({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(le.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(le.SchemeUrl,a.schemeUrl,e)}))}else ul({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(le.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(le.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(ge.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(sl.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(ge.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(wc.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ge.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=h()(h()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(ge.messageForward.name,(function(e){var n=D[e.source],r=D[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(ge.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(Y.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=Fs()(t,Rc),e.prev=1,a=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:me.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([a.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:s=e.sent,(l=nt()(s,2))[0],c=l[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==a||a.switchContainerStatus(wc.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:h()(h()({},me.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,f=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&f&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||me.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED)),xe[o])a={code:xe[o].code,message:(null===(t=xe[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:ga.sdk_element_missKeyData},{rpcTraceId:r});return{error:h()(h()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,f;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return et()(e.values()).every((function(e){return e.getContainerStatus()===wc.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[O.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===G.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:U.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=h()(h()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(r){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ll({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(O.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[O.payment].obtainData();case 6:a=e.sent,s=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:s?ec:a.originActionQueryResult,originOneAccountQueryResult:s?tc:a.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(ge.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),$s(),Qs();try{ol()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(H.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(sl.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=an(this.options.sessionData).data,r="true"===(null===(t=fl(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout)?js.EXPRESS_CHECKOUT:js.ELEMENT_PAYMENT,o=zs.find((function(e){return e.eventName===r}));return void 0!==o&&o.supportedEvents.includes(e)}}]),e}(),Oc=Nc,Lc=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:U.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new K(n.errors);this.options=function(e){var t=e.environment;return h()(h()({},e),{},{environment:(t||B.PROD).toLocaleLowerCase()})}(t),this.controller=new Oc(t)}var t;return m()(e,[{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(h()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),Dc={message:"sdk no need to make query request",success:!0},Mc=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"eventCenter",void 0),c()(this,"securityService",void 0),c()(this,"instanceId",void 0),c()(this,"componentSign",void 0),c()(this,"hostSign",void 0),c()(this,"_performanceData",[]),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Zl.getInstance(this.instanceId).getService("Log"),this.eventCenter=Zl.getInstance(this.instanceId).getService("EventCenter"),this.securityService=Zl.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=Ms(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,a=r.authUrlInfo,s=void 0===a?{}:a,this.componentSign!==z.AUTO_DEBIT_WALLET){e.next=9;break}if(u=bt()?null==o||null===(l=o.web)||void 0===l?void 0:l.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(s));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===z.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,f,m,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zl.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,a=this.initConfig,s=a.environment,l=a.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==z.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(f=bt()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(Dc));case 9:if(f&&"REDIRECT"===f){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!ca()){e.next=13;break}return e.abrupt("return",Promise.resolve(Dc));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),m={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=m,e.t2=s,e.t3=l,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:ge.error.name,data:me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),Le);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=nt()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(ge.destroy.name,{}),e.eventCenter.emit(ge.eventCallback.name,{code:se.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Mt({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===ne.desktop&&(null===(t=document.getElementById(be))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(_e))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===z.AUTO_DEBIT_APM}}]),e}();function xc(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Wt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(at.SDK)+"&"+"&notRedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var Uc=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"securityService",void 0),c()(this,"eventCenter",void 0),c()(this,"instanceId",void 0),c()(this,"hostSign",void 0),c()(this,"allowQueryCall",void 0),c()(this,"allowSubmitPayCallAhead",void 0),c()(this,"channelBehavior",void 0),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),c()(this,"SDK_REQUEST_TIMEOUT",15e3),c()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,a;return m()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Zl.getInstance(this.instanceId).getService("Log"),this.securityService=Zl.getInstance(this.instanceId).getService("Security"),this.eventCenter=Zl.getInstance(this.instanceId).getService("EventCenter"),An.preloadWebApp(G.EASY_PAY,V.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(bt()&&"BANKTRANSFER_QUICKPAY"!==(null===(a=t.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",s=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,l=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=xc(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},Jt.savePreviousProductInfo(G.EASY_PAY,{paymentMethodCategoryType:l,hostSign:this.hostSign,productSceneVersion:s}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Mt({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:F.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=nt()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),f={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:Wt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(f.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:f}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(ge.destroy.name,{}),e.eventCenter.emit(ge.eventCallback.name,{code:se.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(a=this.paymentContext)||void 0===a?void 0:a.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(s=this.paymentContext)&&void 0!==s&&null!==(s=s.paymentSessionObj.action)&&void 0!==s&&s.autoDebitWithToken),p=!0;try{f=JSON.parse(c),p=Ct(f.needQueryRender)||!0===f.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return m=je(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m}),v=Zl.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=v,e.t1=h()(h()({},l),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(l.paymentSessionConfig),requestId:m,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(l.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:m,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I,C,R;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,f=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},m=f.action,g=(v=void 0===m?{}:m).enableSignAgreement,y=void 0!==g&&g,_=v.autoDebitWithToken,b=void 0!==_&&_,"2.0"!==p||b||(c.signAgreement=y,S=null===(E=this.paymentContext.paymentSessionObj)||void 0===E||null===(E=E.paymentMethodInfoView)||void 0===E?void 0:E.paymentMethodType,A=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==S||A&&k||(T=Sc(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return w=je(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w}),P=(null===(o=this.channelBehavior)||void 0===o||null===(a=o.buildSubmitPayExtParams)||void 0===a?void 0:a.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(s=this.paymentContext.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(l=this.paymentContext)||void 0===l||null===(l=l.startBizFlowOptions)||void 0===l||null===(l=l.submitPayRequestExtra)||void 0===l?void 0:l.notRedirectAfterComplete)}))||{},b||(P.complianceSDK=!0),c.extParams=P,I=Zl.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=I,e.t1=h()(h()({},c),{},{integrationType:"SDK",sdkVersion:null!==(C=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==C?C:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return R=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:w,rpcTraceId:R.traceId}),e.abrupt("return",R);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:w,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Zl.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(a=null===(s=this.paymentContext.paymentSessionObj.action)||void 0===s?void 0:s.userSignAgreement)&&void 0!==a&&a,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===l?h=!1:"2.0"===l&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?he.NEED:he.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var Bc="https://dev.page.alipay.net",Kc="https://test.page.alipay.net",Hc="https://pre.ac.alipay.com",Yc="https://checkout.antom.com",Fc="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",jc=function(){function e(t){var n=this;g()(this,e),c()(this,"logger",void 0),c()(this,"_instanceId",void 0),c()(this,"iframe",void 0),c()(this,"originOptions",void 0),c()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),c()(this,"eventListener",void 0),c()(this,"generateIframeSrc",(function(e,t){var r=n.originOptions.environment||"prod",o=e||"",i=n.originOptions.locale||"en_US",a=function(e){switch(e){case"dev":return"".concat(Bc).concat(Fc);case"sit":return"".concat(Kc).concat(Fc);case"pre":return"".concat(Hc).concat(Fc);case"prod":case"sandbox":case"light_sandbox":return"".concat(Yc).concat("/checkout-page/pages/payment/index.html");default:return e}}(r);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,r,o,i,a);var s=a.split("?")[0],l=Et(a);return l.sessionData=o,l.lang=i,l.mode="embed","sandbox"===r&&(l.shadow="true"),t&&(l.demoMode="true"),Object.keys(l).forEach((function(e){s+="".concat(s.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(l[e]))})),s})),c()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,f=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:f}).send();var m=h()(h()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(m)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(yt?te.WAP:te.WEB)===te.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Ns(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=h()(h()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),c()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),c()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),c()(this,"dispatchToApp",(function(e){var t,r={name:re.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||$.prod,this._instanceId=je(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new _a(ba,![$.prod,$.sandbox].includes(null==t?void 0:t.environment)),_a.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return m()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData,e.isDemoMode),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),zc=new _a(ba,!0),Gc=function(e){_()(n,e);var t=E()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return g()(this,n),(o=t.call(this,h()({appVersion:P},e))).preloadComponent(r,i),o}return m()(n)}(Ks),Vc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.AUTO_DEBIT_PAY});return t.call(this,r,[z.AUTO_DEBIT_PAY_WALLET])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.AUTO_DEBIT_PAY,V.WALLET,e.environment),An.preloadSecuritySDK(G.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}(Gc),Wc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r,o=Object.assign({},e,{product:G.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[z.CASHIER_PAYMENT_CARD,z.CASHIER_PAYMENT_APM,z.CASHIER_PAYMENT_BANK].includes(s)?[s]:[z.CASHIER_PAYMENT_CARD,z.CASHIER_PAYMENT_APM]}catch(e){zc.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return m()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=z.CASHIER_PAYMENT_CARD===a?[V.CARD]:z.CASHIER_PAYMENT_APM===a?[V.APM]:z.CASHIER_PAYMENT_BANK===a?[V.BANK]:[V.CARD,V.APM];var s,l=d()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;An.preloadWebApp(G.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}An.preloadSecuritySDK(G.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}(Gc),qc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[z.CASHIER_PAYMENT_CARD])}return m()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.CASHIER_PAYMENT,V.CARD,e.environment),An.preloadSecuritySDK(G.VAULTING,e.securityRegion,e.environment)}}]),n}(Gc),Jc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[z.ELEMENT_PAYMENT])}return m()(n)}(Gc),Qc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return m()(n)}(Hs),Zc=function(e){_()(n,e);var t=E()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:G.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return m()(n)}(Lc),Xc=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new kc,this.core.registerProcessor(G.EASY_PAY,"",new Uc),this.core.init(t,G.EASY_PAY)}return m()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:F.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.EASY_PAY,V.WALLET,e.environment,!0)}}]),e}(),$c=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new kc,this.core.registerProcessor(G.AUTO_DEBIT,"",new Mc),this.core.init(t,G.AUTO_DEBIT)}var t;return m()(e,[{key:"createComponent",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:F.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(ge.eventCallback.name,{code:se.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};An.preloadWebApp(G.AUTO_DEBIT,V.WALLET,e.environment),An.preloadSecuritySDK(G.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),eu=new _a(ba,!0);var tu=n(8306),nu=n(5225),ru=n.n(nu),ou=n(2242),iu=n.n(ou),au={i18nPrefix:"OPENSDK"},su=function(e){y(n,e);var t=b(n);function n(e,r,o,i){var a,s,c,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];v(this,n);var d,p=i,h=void 0;return e&&"object"===Je(e)?(d=e.message,h=e.params):d=e,c=t.call(this,!au.i18n||u&&"SERVER_API"===o?d:au.i18n.get({id:"".concat(au.i18nPrefix,".").concat(r),dm:(null===(a=(s=au).getDefaultMessage)||void 0===a?void 0:a.call(s))||d},h)),l(Ze(c),"code",void 0),l(Ze(c),"name","OpenSDKError"),l(Ze(c),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),l(Ze(c),"source","SDK_INTERNAL"),l(Ze(c),"traceId",void 0),l(Ze(c),"reason",void 0),c.reason=d,c.code=r,c.source=o,c.traceId=p,c}return f(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new lu(e instanceof Error?e.message:(null===(t=(r=au).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){au=p(p({},au),e)}}]),n}(I(Error)),lu=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","SDKBridgeError"),e}return f(n)}(su),cu=function(e){return $e(new Set(e))},uu=function(e,t){return e.filter((function(e){return!t.includes(e)}))},du=function(e,t){return e.filter((function(e){return t.includes(e)}))},pu=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},hu=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function fu(e,t){if(0===t.length)return e;for(var n,r=$e(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var mu=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(Eu("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},vu=/^\+?\d+$/,gu=function(e){if(!vu.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(Eu("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},yu=function(e){return new RegExp(e.map((function(e){return bu(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},_u=function(e){return new RegExp("^[".concat(e.map((function(e){return bu(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},bu=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},Eu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},Su=3.5,Au=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(v(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(Je(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(Je(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(Je(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=cu(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=uu(l,s);var c,u,d,p=du(s,l);(this.seps=fu(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>Su)&&((c=Math.ceil(this.alphabet.length/Su))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,$e(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=fu(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=yu(this.guards),this.sepsRegExp=yu(this.seps),this.allowedCharsRegExp=_u([].concat($e(this.alphabet),$e(this.guards),$e(this.seps)))}return f(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat($e(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(pu)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:gu(String(e))}))),i.every(hu)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(Je(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(Je(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=$e(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=fu(n,c));if((l=o).push.apply(l,$e(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=fu(n,n),(d=o).unshift.apply(d,$e(n.slice(u))),(p=o).push.apply(p,$e(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var f=h/2;o=o.slice(f,f+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=u(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=fu(a,[o].concat($e(this.salt),$e(a)).slice(0,a.length));s.push(mu(Array.from(c),d)),a=d}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),ku=new Au("intl-open-sdk",6);function Tu(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var wu,Pu=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+ku.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))},Iu=function(){function e(t,n){var r=this;v(this,e),l(this,"targetPort",void 0),l(this,"handlers",new Map),l(this,"debugCallback",void 0),l(this,"name",void 0),l(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(p(p({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t}return f(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var i=a(o().mark((function i(a){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(a.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),i,null,[[1,7]])})));return function(e){return i.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"send",value:function(e,t){var n={id:Pu("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(p(p({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),Cu=function(){function e(t){v(this,e),l(this,"targetPorts",[]),l(this,"name",void 0),this.name=t}var t;return f(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,$e(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=Tu((function(){return Promise.all(i.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(i.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=tt(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(l({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return p(p({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),Ru=function(){function e(t,n){v(this,e),l(this,"targetPort",void 0),l(this,"name",void 0),this.targetPort=n,this.name=t}return f(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:i=r.type.split(":"),a=tt(i,2),a[0],"START_COLLECT_VALUE"===a[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),Nu="OPENSDK@HANDSHAKE",Ou="OPENSDK@READY_HANDSHAKE",Lu="OPENSDK@UPDATE_CONFIG",Du="OPENSDK@SUBMIT",Mu="OPENSDK@SUBMIT_REPLY",xu="OPENSDK@REDIRECT",Uu="OPENSDK@OPEN_MODAL",Bu="OPENSDK@OPEN_MODAL_ERROR",Ku="OPENSDK@CLOSE_MODAL",Hu="OPENSDK@ERROR",Yu="OPENSDK@HANDSHAKE_ACK",Fu="OPENSDK@TRANSFER_RECEIVE_PORT",ju="OPENSDK@MESSAGE",zu="OPENSDK@TRANSFER_SEND_PORT",Gu="OPENSDK@TRANSFER_APP_PORT",Vu="OPENSDK@TRANSFER_MODAL_PORT",Wu="OPENSDK@TRANSFER_MODAL_APPEARANCE",qu="OPENSDK@HEIGHT_UPDATE",Ju=n(8098),Qu=[Fu,zu,Vu,Wu,Bu,Gu,Ku,Uu,xu,ju],Zu="@@global",Xu="@@native",$u=function(){function e(t,n,r){var o,i,a=this;(v(this,e),l(this,"targetWindow",void 0),l(this,"currentWindow",void 0),l(this,"targetOrigin","*"),l(this,"scope",void 0),l(this,"handlers",new Map),l(this,"mode",void 0),l(this,"resizeObserver",void 0),l(this,"debugCallback",void 0),l(this,"receivePort",void 0),l(this,"handleMessage",(function(e){var t=e.data;if(t&&t.type){var n=t.type.split(":"),r=tt(n,2),o=r[0],i=r[1];if(a.scope!==Xu){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==Xu&&(s||t.type.endsWith(Hu)||t.type.endsWith(ju))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){return n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return f(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Fu,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Fu,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort(zu,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:Pu("bridge"),type:"SYSTEM_".concat(Hu),payload:{message:"Target window not set"}},"OUT"));var o={id:Pu("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Hu,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(Mu,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send(ju,{type:e,message:t})}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new lu("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new lu("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(xu,{url:e,mode:t})}}},{key:"openModal",value:function(e){var t=this;return this.send(Uu,p(p({},e),{},{scope:this.scope})),new Promise((function(e,n){t.once(Bu,(function(e){n(new su(e.message,e.code,e.source))})),t.once(Gu,(function(t,n){if(null==n||!n[0])throw new lu("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL");e(new Iu(t,n[0]))}))}))}},{key:"closeModal",value:function(){this.send(Ku)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this;this.on(e,(function r(o,i){try{t(o,i)}finally{n.off(e,r)}}))}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new lu("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(Nu,function(){var r=a(o().mark((function r(i){var a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==i?void 0:i.elementMode)?i.isMainElement?n.getReceivePort().then((function(e){t(i,e)})):n.getSendPort().then((function(e){t(i,e)})).catch((function(){t(i)})):t(i),a=0,s=Ju((function(e){(Math.abs(e-a)>10||Math.abs((e-a)/a)>.01)&&(a=e,n.send(qu,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&s(n.height)})),n.resizeObserver.observe(document.body),n.send(Yu,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(Ou),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Hu),this.scope===Xu)return e;var t=Qu.includes(e)?Zu:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Hu),this.scope===Xu)return e;var t=Qu.includes(e)?Zu:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:Pu(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Fu,(function(n,r){e.receivePort||(e.receivePort=new Cu(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on(zu,(function(e,r){if(r){var o=new Ru(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,Zu)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",Xu,t)}},{key:"getBridge",value:function(t,n){if(n===Xu||n===Zu)throw new Error("Scope cannot be ".concat(Xu," or ").concat(Zu));return new e(t,n)}}]),e}(),ed=function(){function e(t){v(this,e),l(this,"options",void 0),l(this,"tracker",void 0),l(this,"trackId",void 0),this.initialOptions(t)}var t;return f(e,[{key:"initialOptions",value:function(e){var t,n,r;return this.options=p(p(p({env:"DEV"},this.options),e),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),"trackId"in this.options&&(this.trackId=this.options.trackId),this.options}},{key:"loadTacker",value:function(e){var t=this,n=(0,tu.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.1/dist/tracker.umd.js","intlSdkTracker");return n?n.then((function(n){var r;return null===(r=n.variable)||void 0===r?void 0:r.getTrackerInstance(t.initialOptions(e))})):Promise.resolve(void 0)}},{key:"initTracker",value:(t=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:return e.next=4,this.loadTacker(t);case 4:return(n=e.sent)&&(this.tracker=n),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({trackId:e})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),e}(),td=new ed;!function(e){e["ar-SA"]="ar-SA",e.kn="kn",e.as="as",e.bho="bho",e["pl-PL"]="pl-PL",e["ko-KR"]="ko-KR",e["da-DK"]="da-DK",e["de-DE"]="de-DE",e["ru-RU"]="ru-RU",e["fr-FR"]="fr-FR",e.gu="gu",e["nl-BE"]="nl-BE",e["nl-NL"]="nl-NL",e["cs-CZ"]="cs-CZ",e.ro="ro",e["lo-LA"]="lo-LA",e["my-MM"]="my-MM",e["bn-BD"]="bn-BD",e["bn-IN"]="bn-IN",e.mr="mr",e["ms-MY"]="ms-MY",e.ml="ml",e.mni="mni",e["ne-NP"]="ne-NP",e.or="or",e["pt-BR"]="pt-BR",e["pt-PT"]="pt-PT",e.pa="pa",e["sv-SE"]="sv-SE",e["ja-JP"]="ja-JP",e.sr="sr",e["si-LK"]="si-LK",e["sk-SK"]="sk-SK",e["tr-TR"]="tr-TR",e["tl-PH"]="tl-PH",e.te="te",e.ta="ta",e["th-TH"]="th-TH",e["ur-PK"]="ur-PK",e["ur-IN"]="ur-IN",e["uk-UA"]="uk-UA",e["iw-IL"]="iw-IL",e["es-ES"]="es-ES",e["es-MX"]="es-MX",e.hu="hu",e["it-IT"]="it-IT",e["in-ID"]="in-ID",e["hi-IN"]="hi-IN",e["vi-VN"]="vi-VN",e["en-PK"]="en-PK",e["en-PL"]="en-PL",e["en-FR"]="en-FR",e["en-PH"]="en-PH",e["en-CZ"]="en-CZ",e["en-CA"]="en-CA",e["en-MM"]="en-MM",e["en-US"]="en-US",e["en-BD"]="en-BD",e["en-MY"]="en-MY",e["en-NP"]="en-NP",e["en-LK"]="en-LK",e["en-TH"]="en-TH",e["en-ES"]="en-ES",e["en-SG"]="en-SG",e["en-HU"]="en-HU",e["en-ID"]="en-ID",e["en-GB"]="en-GB",e["en-VN"]="en-VN",e["en-HK"]="en-HK",e["en-KR"]="en-KR",e["zh-TW"]="zh-TW",e["zh-HK"]="zh-HK",e["zh-SG"]="zh-SG",e["zh-CN"]="zh-CN",e["ar-IQ"]="ar-IQ",e["ckb-IQ"]="ckb-IQ",e.ku="ku",e["kk-KZ"]="kk-KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(wu||(wu={}));var nd={};nd[wu["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",nd[wu.kn]="埃纳德语",nd[wu.as]="阿萨姆语",nd[wu.bho]="博杰普尔语",nd[wu["pl-PL"]]="波兰语 (波兰)",nd[wu["ko-KR"]]="朝鲜语 (韩国)",nd[wu["da-DK"]]="丹麦语 (丹麦)",nd[wu["de-DE"]]="德语 (德国)",nd[wu["ru-RU"]]="俄语 (俄罗斯)",nd[wu["fr-FR"]]="法语 (法国)",nd[wu.gu]="古加拉提语",nd[wu["nl-BE"]]="荷兰语 (比利时)",nd[wu["nl-NL"]]="荷兰语 (荷兰)",nd[wu["cs-CZ"]]="捷克语 (捷克共和国)",nd[wu.ro]="罗马尼亚语",nd[wu["lo-LA"]]="老挝语 (老挝)",nd[wu["my-MM"]]="缅甸语 (缅甸)",nd[wu["bn-BD"]]="孟加拉语 (孟加拉)",nd[wu["bn-IN"]]="孟加拉语 (印度)",nd[wu.mr]="马拉地语",nd[wu["ms-MY"]]="马来语 (马来西亚)",nd[wu.ml]="马来亚拉姆语",nd[wu.mni]="曼尼普里语",nd[wu["ne-NP"]]="尼泊尔语 (尼泊尔)",nd[wu.or]="欧里亚语",nd[wu["pt-BR"]]="葡萄牙语 (巴西)",nd[wu["pt-PT"]]="葡萄牙语 (葡萄牙)",nd[wu.pa]="旁遮普语",nd[wu["sv-SE"]]="瑞典语 (瑞典)",nd[wu["ja-JP"]]="日语 (日本)",nd[wu.sr]="塞尔维亚语",nd[wu["si-LK"]]="僧伽罗语 (斯里兰卡)",nd[wu["sk-SK"]]="斯洛伐克语 (斯洛伐克)",nd[wu["tr-TR"]]="土耳其语 (土耳其)",nd[wu["tl-PH"]]="塔加路族语 (菲律宾)",nd[wu.te]="泰卢固语",nd[wu.ta]="泰米尔语",nd[wu["th-TH"]]="泰语 (泰国)",nd[wu["ur-PK"]]="乌尔都语 (巴基斯坦)",nd[wu["ur-IN"]]="乌尔都语 (印度)",nd[wu["uk-UA"]]="乌克兰语 (乌克兰)",nd[wu["iw-IL"]]="希伯来语 (以色列)",nd[wu["es-ES"]]="西班牙语 (西班牙)",nd[wu["es-MX"]]="西班牙语 (墨西哥)",nd[wu.hu]="匈牙利语",nd[wu["it-IT"]]="意大利语 (意大利)",nd[wu["in-ID"]]="印度尼西亚语 (印度尼西亚)",nd[wu["hi-IN"]]="印地语 (印度)",nd[wu["vi-VN"]]="越南语 (越南)",nd[wu["en-PK"]]="英语 (巴基斯坦)",nd[wu["en-PL"]]="英语 (波兰)",nd[wu["en-FR"]]="英语 (法国)",nd[wu["en-PH"]]="英语 (菲律宾)",nd[wu["en-CZ"]]="英语 (捷克共和国)",nd[wu["en-CA"]]="英语 (加拿大)",nd[wu["en-MM"]]="英语 (缅甸)",nd[wu["en-US"]]="英语 (美国)",nd[wu["en-BD"]]="英语 (孟加拉)",nd[wu["en-MY"]]="英语 (马来西亚)",nd[wu["en-NP"]]="英语 (尼泊尔)",nd[wu["en-LK"]]="英语 (斯里兰卡)",nd[wu["en-TH"]]="英语 (泰国)",nd[wu["en-ES"]]="英语 (西班牙)",nd[wu["en-SG"]]="英语 (新加坡)",nd[wu["en-HU"]]="英语 (匈牙利)",nd[wu["en-ID"]]="英语 (印度尼西亚)",nd[wu["en-GB"]]="英语 (英国)",nd[wu["en-VN"]]="英语 (越南)",nd[wu["en-HK"]]="英语 (中国香港)",nd[wu["en-KR"]]="英语 (韩国)",nd[wu["zh-TW"]]="繁体中文 (中国台湾)",nd[wu["zh-HK"]]="繁体中文 (中国香港)",nd[wu["zh-SG"]]="简体中文 (新加坡)",nd[wu["zh-CN"]]="简体中文 (中国)",nd[wu["ar-IQ"]]="阿拉伯语 (伊拉克)",nd[wu["ckb-IQ"]]="中库尔德语 (伊拉克)",nd[wu.ku]="库尔德语",nd[wu["kk-KZ"]]="哈萨克语",nd[wu.af]="南非语",nd[wu.am]="阿姆哈拉语",nd[wu.az]="阿塞拜疆语",nd[wu.be]="白俄罗斯语",nd[wu.bg]="保加利亚语",nd[wu.bs]="波斯尼亚语",nd[wu.ca]="加泰罗尼亚语",nd[wu.cy]="威尔士语",nd[wu.el]="现代希腊语",nd[wu.eo]="世界语",nd[wu.et]="爱沙尼亚语",nd[wu.eu]="巴斯克语",nd[wu.fa]="波斯语",nd[wu.fi]="芬兰语",nd[wu.gd]="爱尔兰语",nd[wu.gl]="加利西亚语",nd[wu.ha]="豪萨语",nd[wu.haw]="夏威夷语",nd[wu.hr]="克罗地亚语",nd[wu.ig]="伊博语",nd[wu.is]="冰岛语",nd[wu.ka]="格鲁吉亚语",nd[wu.km]="高棉语",nd[wu.ky]="吉尔吉斯语",nd[wu.lb]="卢森堡语",nd[wu.ln]="林格拉语",nd[wu.lt]="立陶宛语",nd[wu.lv]="拉脱维亚语",nd[wu.mg]="马尔加什语",nd[wu.mk]="马其顿语",nd[wu.mn]="蒙古文",nd[wu.mt]="马耳他语",nd[wu.om]="奥罗莫语",nd[wu.ps]="普什图语",nd[wu.qu]="克丘亚语",nd[wu.rw]="卢旺达语",nd[wu.sl]="斯洛文尼亚语",nd[wu.so]="索马里语",nd[wu.sq]="阿尔巴尼亚语",nd[wu.sw]="斯瓦希里语",nd[wu.tg]="塔吉克语",nd[wu.ti]="蒂格尼亚语",nd[wu.ug]="维吾尔语",nd[wu.uz]="乌兹别克语",nd[wu.yo]="约鲁巴语",nd[wu.zu]="祖鲁语";var rd,od={};od[wu["ar-SA"]]="Arabic (Saudi Arabia)",od[wu.kn]="Kannada",od[wu.as]="Assamese",od[wu.bho]="Bhojpuri",od[wu["pl-PL"]]="Polish (Poland)",od[wu["ko-KR"]]="Korean (Korean)",od[wu["da-DK"]]="Danish (Denmark)",od[wu["de-DE"]]="German (Germany)",od[wu["ru-RU"]]="Russian (Russia)",od[wu["fr-FR"]]="French (France)",od[wu.gu]="Gujarati",od[wu["nl-BE"]]="Dutch (Belgium)",od[wu["nl-NL"]]="Dutch (Netherlands)",od[wu["cs-CZ"]]="Czech (Czech Republic)",od[wu.ro]="Romanian",od[wu["lo-LA"]]="Lao (Laos)",od[wu["my-MM"]]="Burmese (Myanmar)",od[wu["bn-BD"]]="Bengali (Bangladesh)",od[wu["bn-IN"]]="Bengali (India)",od[wu.mr]="Marathi",od[wu["ms-MY"]]="Malay (Malaysia)",od[wu.ml]="Malayalam",od[wu.mni]="Manipuri",od[wu["ne-NP"]]="Nepalese (Nepal)",od[wu.or]="Odia (Oriya)",od[wu["pt-BR"]]="Portuguese (Brazil)",od[wu["pt-PT"]]="Portuguese (Portugal)",od[wu.pa]="Punjabi",od[wu["sv-SE"]]="Swedish (Sweden)",od[wu["ja-JP"]]="Japanese (Japanese)",od[wu.sr]="Serbian",od[wu["si-LK"]]="Sinhala (Sri Lanka)",od[wu["sk-SK"]]="Slovak (Slovakia)",od[wu["tr-TR"]]="Turkish (Turkish)",od[wu["tl-PH"]]="Tagalog (Philippines)",od[wu.te]="Telugu",od[wu.ta]="Tamil",od[wu["th-TH"]]="Thai (Thailand)",od[wu["ur-PK"]]="Ulduwen (Pakistan)",od[wu["ur-IN"]]="Urduwen (India)",od[wu["uk-UA"]]="Ukrainian (Ukraine)",od[wu["iw-IL"]]="Hebrew (Israel)",od[wu["es-ES"]]="Spanish (Spain)",od[wu["es-MX"]]="Spanish (Mexico)",od[wu.hu]="Hungarian",od[wu["it-IT"]]="Italian (Italian)",od[wu["in-ID"]]="Indonesian (Indonesia)",od[wu["hi-IN"]]="Hindi (India)",od[wu["vi-VN"]]="Vietnamese (Vietnam)",od[wu["en-PK"]]="English (Pakistan)",od[wu["en-PL"]]="English (Poland)",od[wu["en-FR"]]="English (France)",od[wu["en-PH"]]="English (Philippines)",od[wu["en-CZ"]]="English (Czech Republic)",od[wu["en-CA"]]="English (Canada)",od[wu["en-MM"]]="English (Myanmar)",od[wu["en-US"]]="English (US)",od[wu["en-BD"]]="English (Bangladesh)",od[wu["en-MY"]]="English (Malaysia)",od[wu["en-NP"]]="English (Nepal)",od[wu["en-LK"]]="English (Sri Lanka)",od[wu["en-TH"]]="English (Thailand)",od[wu["en-ES"]]="English (Spain)",od[wu["en-SG"]]="English (Singapore)",od[wu["en-HU"]]="English (Hungary)",od[wu["en-ID"]]="English (Indonesia)",od[wu["en-GB"]]="English (UK)",od[wu["en-VN"]]="English (Vietnam)",od[wu["en-HK"]]="English (Hong Kong)",od[wu["en-KR"]]="English (Korean)",od[wu["zh-TW"]]="Chinese Traditional (Taiwan)",od[wu["zh-HK"]]="Chinese Traditional (Hong Kong)",od[wu["zh-SG"]]="Chinese Simplified (Singapore)",od[wu["zh-CN"]]="Chinese Simplified (China)",od[wu["ar-IQ"]]="Arabic (Iraq)",od[wu["ckb-IQ"]]="Central Kurdish (Iraq)",od[wu.ku]="Kurdish",od[wu["kk-KZ"]]="Kazakh",od[wu.af]="Afrikaans",od[wu.am]="Amharic",od[wu.az]="Azerbaijani",od[wu.be]="Belarusian",od[wu.bg]="Bulgarian",od[wu.bs]="Bosnian",od[wu.ca]="Catalan",od[wu.cy]="Welsh",od[wu.el]="Greek",od[wu.eo]="Esperanto",od[wu.et]="Estonian",od[wu.eu]="Basque",od[wu.fa]="Persian",od[wu.fi]="Finnish",od[wu.gd]="Scots Gaelic",od[wu.gl]="Galician",od[wu.ha]="Hausa",od[wu.haw]="Hawaiian",od[wu.hr]="Croatian",od[wu.ig]="Igbo",od[wu.is]="Icelandic",od[wu.ka]="Georgian",od[wu.km]="Khmer",od[wu.ky]="Kyrgyz",od[wu.lb]="Luxembourgish",od[wu.ln]="Lingala",od[wu.lt]="Lithuanian",od[wu.lv]="Latvian",od[wu.mg]="Malagasy",od[wu.mk]="Macedonian",od[wu.mn]="Mongolian",od[wu.mt]="Maltese",od[wu.om]="Oromo",od[wu.ps]="Pashto",od[wu.qu]="Quechua",od[wu.rw]="Kinyarwanda",od[wu.sl]="Slovenian",od[wu.so]="Somali",od[wu.sq]="Albanian",od[wu.sw]="Swahili",od[wu.tg]="Tajik",od[wu.ti]="Tigrinya",od[wu.ug]="Uyghur",od[wu.uz]="Uzbek",od[wu.yo]="Yoruba",od[wu.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(rd||(rd={}));var id,ad,sd,ld={"zh-hans":wu["zh-CN"],"zh-hant":wu["zh-TW"],ar:wu["ar-SA"],bn:wu["bn-BD"],cs:wu["cs-CZ"],da:wu["da-DK"],de:wu["de-DE"],en:wu["en-US"],es:wu["es-ES"],fr:wu["fr-FR"],hi:wu["hi-IN"],in:wu["in-ID"],it:wu["it-IT"],iw:wu["iw-IL"],ja:wu["ja-JP"],ko:wu["ko-KR"],lo:wu["lo-LA"],ms:wu["ms-MY"],my:wu["my-MM"],ne:wu["ne-NP"],nl:wu["nl-NL"],pl:wu["pl-PL"],pt:wu["pt-PT"],ru:wu["ru-RU"],si:wu["si-LK"],sk:wu["sk-SK"],sv:wu["sv-SE"],th:wu["th-TH"],tl:wu["tl-PH"],tr:wu["tr-TR"],uk:wu["uk-UA"],ur:wu["ur-PK"],vi:wu["vi-VN"],zh:wu["zh-CN"],kk:wu["kk-KZ"]},cd={"zh-hant":wu["zh-TW"],"zh-hans":wu["zh-CN"]},ud=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},dd=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}(id||(id={})),ud(id),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(ad||(ad={})),ud(ad),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}(sd||(sd={})),ud(sd);var pd,hd,fd,md,vd,gd,yd,_d,bd,Ed,Sd,Ad,kd,Td,wd,Pd;wu["ar-IQ"],id.ar_EG,sd.ar,ad.ar,wu["ar-SA"],id.ar_EG,sd["ar-sa"],ad["ar-sa"],wu["bn-BD"],id.bn_BD,sd["bn-bd"],ad["bn-bd"],wu["bn-IN"],id.bn_BD,sd.bn,ad.bn,wu["cs-CZ"],id.cs_CZ,sd.cs,ad.cs,wu["da-DK"],id.da_DK,sd.da,ad.da,wu["de-DE"],id.de_DE,sd.de,ad.de,wu["en-BD"],id.en_US,sd["en-gb"],ad.en,wu["en-CA"],id.en_US,sd["en-ca"],ad["en-ca"],wu["en-CZ"],id.en_US,sd["en-gb"],ad.en,wu["en-ES"],id.en_US,sd["en-gb"],ad.en,wu["en-FR"],id.en_US,sd["en-gb"],ad.en,wu["en-GB"],id.en_GB,sd["en-gb"],ad["en-gb"],wu["en-HU"],id.en_US,sd["en-gb"],ad.en,wu["en-ID"],id.en_US,sd["en-gb"],ad.en,wu["en-LK"],id.en_US,sd["en-gb"],ad.en,wu["en-MM"],id.en_US,sd["en-gb"],ad.en,wu["en-MY"],id.en_US,sd["en-gb"],ad.en,wu["en-NP"],id.en_US,sd["en-gb"],ad.en,wu["en-PH"],id.en_US,sd["en-gb"],ad.en,wu["en-PK"],id.en_US,sd["en-gb"],ad.en,wu["en-PL"],id.en_US,sd["en-gb"],ad.en,wu["en-SG"],id.en_US,sd["en-sg"],ad.en,wu["en-TH"],id.en_US,sd["en-gb"],ad.en,wu["en-US"],id.en_US,sd["en-gb"],ad.en,wu["en-VN"],id.en_US,sd["en-gb"],ad.en,wu["en-HK"],id.en_US,sd["en-gb"],ad.en,wu["en-KR"],id.en_US,sd["en-gb"],ad.en,wu["es-ES"],id.es_ES,sd.es,ad.es,wu["es-MX"],id.es_ES,sd.es,ad.es,wu["fr-FR"],id.fr_FR,sd.fr,ad.fr,wu["hi-IN"],id.hi_IN,sd.hi,ad.hi,wu.hu,id.hu_HU,sd.hu,ad.hu,wu["in-ID"],id.id_ID,sd.id,ad.id,wu["it-IT"],id.it_IT,sd.it,ad.it,wu["ja-JP"],id.ja_JP,sd.ja,ad.ja,wu.kn,id.kn_IN,sd.kn,ad.kn,wu["ko-KR"],id.ko_KR,sd.ko,ad.ko,wu.ml,id.ml_IN,sd.ml,ad.ml,wu["ms-MY"],id.ms_MY,sd["ms-my"],ad["ms-my"],wu["ne-NP"],id.ne_NP,sd.ne,ad.ne,wu["nl-BE"],id.nl_BE,sd["nl-be"],ad["nl-be"],wu["nl-NL"],id.nl_NL,sd.nl,ad.nl,wu["pl-PL"],id.pl_PL,sd.pl,ad.pl,wu["pt-BR"],id.pt_BR,sd["pt-br"],ad["pt-br"],wu["pt-PT"],id.pt_PT,sd.pt,ad.pt,wu.ro,id.ro_RO,sd.ro,ad.ro,wu["ru-RU"],id.ru_RU,sd.ru,ad.ru,wu["si-LK"],id.si_LK,sd.si,ad.si,wu["sk-SK"],id.sk_SK,sd.sk,ad.sk,wu.sr,id.sr_RS,sd.sr,ad.sr,wu["sv-SE"],id.sv_SE,sd.sv,ad.sv,wu.ta,id.ta_IN,sd.ta,ad.ta,wu["th-TH"],id.th_TH,sd.th,ad.th,wu["tr-TR"],id.tr_TR,sd.tr,ad.tr,wu["uk-UA"],id.uk_UA,sd.uk,ad.uk,wu["ur-PK"],id.ur_PK,sd.ur,ad.ur,wu["vi-VN"],id.vi_VN,sd.vi,ad.vi,wu["zh-CN"],id.zh_CN,sd["zh-cn"],ad["zh-cn"],wu["zh-HK"],id.zh_HK,sd["zh-hk"],ad["zh-hk"],wu["zh-SG"],id.zh_HK,sd["zh-hk"],ad["zh-hk"],wu["zh-TW"],id.zh_TW,sd["zh-tw"],ad["zh-tw"],wu["kk-KZ"],id.kk_KZ,sd.kk,ad.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(Pd||(Pd={}));var Id,Cd,Rd=ud(Pd),Nd={};Nd[Pd.kn]="AiNaDeYu",Nd[Pd.ar_SA]="ALaBoYu (ShaTeALaBo)",Nd[Pd.ar_IQ]="ALaBoYu (YiLaKe)",Nd[Pd.as]="ASaMuYu",Nd[Pd.bho]="BoJiePuErYu",Nd[Pd.pl_PL]="BoLanYu (BoLan)",Nd[Pd.ko_KR]="ChaoXianYu (HanGuo)",Nd[Pd.da_DK]="DanMaiYu (DanMai)",Nd[Pd.de_DE]="DeYu (DeGuo)",Nd[Pd.ru_RU]="EYu (ELuoSi)",Nd[Pd.fr_FR]="FaYu (FaGuo)",Nd[Pd.gu]="GuJiaLaTiYu",Nd[Pd.nl_BE]="HeLanYu (BiLiShi)",Nd[Pd.nl_NL]="HeLanYu (HeLan)",Nd[Pd.cs_CZ]="JieKeYu (JieKeGongHeGuo)",Nd[Pd.ku]="KuErDeYu",Nd[Pd.lo_LA]="LaoWoYu (LaoWo)",Nd[Pd.ro]="LuoMaNiYaYu",Nd[Pd.mr]="MaLaDiYu",Nd[Pd.ms_MY]="MaLaiYu (MaLaiXiYa)",Nd[Pd.ml]="MaLaiYaLaMuYu",Nd[Pd.mni]="ManNiPuLiYu",Nd[Pd.bn_BD]="MengJiaLaYu (MengJiaLa)",Nd[Pd.bn_IN]="MengJiaLaYu (YinDu)",Nd[Pd.my_MM]="MianDianYu (MianDian)",Nd[Pd.ne_NP]="NiBoErYu (NiBoEr)",Nd[Pd.or]="OuLiYaYu",Nd[Pd.pa]="PangZhePuYu",Nd[Pd.pt_BR]="PuTaoYaYu (BaXi)",Nd[Pd.pt_PT]="PuTaoYaYu (PuTaoYa)",Nd[Pd.ja_JP]="RiYu (RiBen)",Nd[Pd.sv_SE]="RuiDianYu (RuiDian)",Nd[Pd.sr]="SaiErWeiYaYu",Nd[Pd.si_LK]="SengJiaLuoYu (SiLiLanKa)",Nd[Pd.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",Nd[Pd.te]="TaiLuGuYu",Nd[Pd.ta]="TaiMiErYu",Nd[Pd.th_TH]="TaiYu (TaiGuo)",Nd[Pd.tl_PH]="TaJiaLuZuYu (FeiLvBin)",Nd[Pd.tr_TR]="TuErQiYu (TuErQi)",Nd[Pd.ur_PK]="WuErDuYu (BaJiSiTan)",Nd[Pd.ur_IN]="WuErDuYu (YinDu)",Nd[Pd.uk_UA]="WuKeLanYu (WuKeLan)",Nd[Pd.es_ES]="XiBanYaYu (XiBanYa)",Nd[Pd.es_MX]="XiBanYaYu (MoXiGe)",Nd[Pd.iw_IL]="XiBoLaiYu (YiSeLie)",Nd[Pd.hu]="XiongYaLiYu",Nd[Pd.it_IT]="YiDaLiYu (YiDaLi)",Nd[Pd.hi_IN]="YinDiYu (YinDu)",Nd[Pd.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",Nd[Pd.en_PK]="YingYu (BaJiSiTan)",Nd[Pd.en_PL]="YingYu (BoLan)",Nd[Pd.en_FR]="YingYu (FaGuo)",Nd[Pd.en_PH]="YingYu (FeiLvBin)",Nd[Pd.en_CA]="YingYu (JiaNaDa)",Nd[Pd.en_CZ]="YingYu (JieKeGongHeGuo)",Nd[Pd.en_MY]="YingYu (MaLaiXiYa)",Nd[Pd.en_US]="YingYu (MeiGuo)",Nd[Pd.en_BD]="YingYu (MengJiaLa)",Nd[Pd.en_MM]="YingYu (MianDian)",Nd[Pd.en_NP]="YingYu (NiBoEr)",Nd[Pd.en_LK]="YingYu (SiLiLanKa)",Nd[Pd.en_TH]="YingYu (TaiGuo)",Nd[Pd.en_ES]="YingYu (XiBanYa)",Nd[Pd.en_SG]="YingYu (XinJiaPo)",Nd[Pd.en_HU]="YingYu (XiongYaLi)",Nd[Pd.en_ID]="YingYu (YinDuNiXiYa)",Nd[Pd.en_GB]="YingYu (YingGuo)",Nd[Pd.en_VN]="YingYu (YueNan)",Nd[Pd.en_HK]="YingYu (XiangGang)",Nd[Pd.en_KR]="YingYu (HanGuo)",Nd[Pd.vi_VN]="YueNanYu (YueNan)",Nd[Pd.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",Nd[Pd.zh_TW]="ZhongWen (TaiWanDiQu)",Nd[Pd.zh_HK]="ZhongWen (XiangGang)",Nd[Pd.zh_SG]="ZhongWen (XinJiaPo)",Nd[Pd.zh_CN]="ZhongWen (ZhongGuo)",Nd[Pd.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",Nd[Pd.af]="NanFeiYu",Nd[Pd.am]="AMuHaLaYu",Nd[Pd.az]="ASaiBaiJiangYu",Nd[Pd.be]="BaiErLuoSiYu",Nd[Pd.bg]="BaoJiaLiYaYu",Nd[Pd.bs]="BoSiNiYaYu",Nd[Pd.ca]="JiaTaiLuoNiYaYu",Nd[Pd.cy]="WeiErShiYu",Nd[Pd.el]="XianDaiXiLaYu",Nd[Pd.eo]="ShiJieYu",Nd[Pd.et]="AiShaNiYaYu",Nd[Pd.eu]="BaSiKeYu",Nd[Pd.fa]="BoSiYu",Nd[Pd.fi]="FenLanYu",Nd[Pd.gd]="AiErLanYu",Nd[Pd.gl]="JiaLiXiYaYu",Nd[Pd.ha]="HaoSaYu",Nd[Pd.haw]="XiaWeiYiYu",Nd[Pd.hr]="KeLuoDiYaYu",Nd[Pd.ig]="YiBoYu",Nd[Pd.is]="BingDaoYu",Nd[Pd.ka]="GeLuJiYaYu",Nd[Pd.km]="GaoMianYu",Nd[Pd.ky]="JiErJiSiYu",Nd[Pd.lb]="LuSenBaoYu",Nd[Pd.ln]="LinGeLaYu",Nd[Pd.lt]="LiTaoWanYu",Nd[Pd.lv]="LaTuoWeiYaYu",Nd[Pd.mg]="MaErJiaShiYu",Nd[Pd.mk]="MaQiDunYu",Nd[Pd.mn]="MengGuWen",Nd[Pd.mt]="MaErTaYu",Nd[Pd.om]="AoLuoMoYu",Nd[Pd.ps]="PuShiTuYu",Nd[Pd.qu]="KeQiuYaYu",Nd[Pd.rw]="LuWangDaYu",Nd[Pd.sl]="SiLuoWeiNiYaYu",Nd[Pd.so]="SuoMaLiYu",Nd[Pd.sq]="AErBaNiYaYu",Nd[Pd.sw]="SiWaXiLiYu",Nd[Pd.tg]="TaJiKeYu",Nd[Pd.ti]="DiGeNiYaYu",Nd[Pd.ug]="WeiWuErYu",Nd[Pd.uz]="WuZiBieKeYu",Nd[Pd.yo]="YueLuBaYu",Nd[Pd.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Id||(Id={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Cd||(Cd={})),ud(Cd);var Od=Object.assign(Object.assign({},Cd),{TranslationMemory:"TranslationMemory"}),Ld=(ud(Od),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===Pd.zh_HK||e===Pd.zh_TW||e===Pd.zh_SG)return"zh-tw";if(e===Pd.in_ID)return"id";if(e===Pd.iw_IL)return"he";var t=e.split("_")[0];return dd(Ld.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===Pd.zh_HK||e===Pd.zh_TW||e===Pd.zh_SG)return"zh-TW";if(e===Pd.in_ID)return"id";if(e===Pd.mni)return"mni-Mtei";var t=e.split("_")[0];return dd(Ld.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===Pd.zh_CN)return"zh-CN";if(e===Pd.zh_HK||e===Pd.zh_TW||e===Pd.zh_SG)return"zh-TW";var t=e.split("_")[0];return dd(Ld.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===Pd.in_ID)return"ID";var n=t.split("_")[0];return dd(Ld.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===Pd.zh_CN||e===Pd.zh_SG)return"ZH";if(e===Pd.zh_HK||e===Pd.zh_TW)return null;if(e===Pd.en_GB||e===Pd.en_US||e===Pd.pt_BR||e===Pd.pt_PT)return t.replace("_","-");if(e===Pd.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":dd(Ld.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===Pd.pt_PT)return"pt-pt";if(e===Pd.pt_BR)return"pt";if([Pd.zh_CN,Pd.zh_SG].includes(e))return"zh-Hans";if([Pd.zh_HK,Pd.zh_TW].includes(e))return"zh-Hant";if(e===Pd.iw_IL)return"he";if(e===Pd.in_ID)return"id";if(e===Pd.ckb_IQ)return"ku";var t=e.split("_")[0];return dd(Ld.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===Pd.pt_PT)return"pt-PT";if(e===Pd.pt_BR)return"pt";if(e===Pd.es_MX)return"es-MX";if(e===Pd.in_ID)return"id";if(e===Pd.zh_CN||e===Pd.zh_SG)return"zh";if(e===Pd.zh_HK||e===Pd.zh_TW)return"zh-TW";var t=e.split("_")[0];return dd(Ld.amazonSupportedLanguages,t)?t:null}}),Dd={};Dd[Cd.AiSelected]=Rd,Dd[Cd.Aliyun]=Rd.filter((function(e){return Boolean(Ld.mapAliyunLanguage(e))})),Dd[Cd["ChatGPT3.5"]]=Rd,Dd[Cd.Google]=Rd.filter((function(e){return Boolean(Ld.mapGoogleLanguage(e))})),Dd[Cd.Papago]=Rd.filter((function(e){return Boolean(Ld.mapPapagoLanguage(e))})),Dd[Cd.DeepL]=Rd.filter((function(e){return Boolean(Ld.mapDeepLLanguage(e))})),Dd[Cd.Microsoft]=Rd.filter((function(e){return Boolean(Ld.mapMicrosoftLanguage(e))})),Dd[Cd.Amazon]=Rd.filter((function(e){return Boolean(Ld.mapAmazonLanguage(e))}));var Md={};Md[Cd.AiSelected]=Rd,Md[Cd.Aliyun]=Rd.filter((function(e){return Boolean(Ld.mapAliyunLanguage(e))})),Md[Cd["ChatGPT3.5"]]=Rd,Md[Cd.Google]=Rd.filter((function(e){return Boolean(Ld.mapGoogleLanguage(e))})),Md[Cd.Papago]=Rd.filter((function(e){return Boolean(Ld.mapPapagoLanguage(e))})),Md[Cd.DeepL]=Rd.filter((function(e){return Boolean(Ld.mapDeepLSourceLanguage(e))})),Md[Cd.Microsoft]=Rd.filter((function(e){return Boolean(Ld.mapMicrosoftLanguage(e))})),Md[Cd.Amazon]=Rd.filter((function(e){return Boolean(Ld.mapAmazonLanguage(e))})),xd=Rd.map((function(e){return[e,ud(Cd).filter((function(t){return dd(Dd[t],e)}))]})),Ud={},Object.keys(xd||{}).forEach((function(e){var t=xd[e],n=t[0],r=t[1];Ud[n]=r}));var xd,Ud,Bd={};Bd[Pd.ar_SA]="العربية)السعودية)",Bd[Pd.kn]="ಕನ್ನಡ",Bd[Pd.as]="অসমীয়া",Bd[Pd.bho]="भोजपुरी",Bd[Pd.pl_PL]="Polski (Polska)",Bd[Pd.ko_KR]="한국어 (대한민국)",Bd[Pd.da_DK]="Dansk (Danmark)",Bd[Pd.de_DE]="Deutsch (Deutschland)",Bd[Pd.ru_RU]="Русский (Россия)",Bd[Pd.fr_FR]="Français (France)",Bd[Pd.gu]="ગુજરાતી",Bd[Pd.nl_BE]="Nederlands (Belgium)",Bd[Pd.nl_NL]="Nederlands (Nederland)",Bd[Pd.cs_CZ]="Čeština (Česká republika)",Bd[Pd.ro]="Română",Bd[Pd.lo_LA]="ລາວ (ລາວ)",Bd[Pd.my_MM]="မြန်မာဘာသာ (မြန်မာ)",Bd[Pd.bn_BD]="বাংলা (বাংলাদেশ)",Bd[Pd.bn_IN]="বাংলা (ভারত)",Bd[Pd.mr]="मराठी",Bd[Pd.ms_MY]="Bahasa Melayu (Malaysia)",Bd[Pd.ml]="മലയാളം",Bd[Pd.mni]="ꯃꯩꯇꯩꯂꯣꯟ",Bd[Pd.ne_NP]="नेपाली (नेपाल)\t",Bd[Pd.or]="ଓଡ଼ିଆ",Bd[Pd.pt_BR]="Português (Brasil)",Bd[Pd.pt_PT]="Português (Portugal)",Bd[Pd.pa]="پنجابی",Bd[Pd.sv_SE]="Svenska (Sverige)",Bd[Pd.ja_JP]="日本語",Bd[Pd.sr]="Српски",Bd[Pd.si_LK]="සිංහල (ශ්රී ලංකාව)",Bd[Pd.sk_SK]="Slovenčina (Slovensko)",Bd[Pd.tr_TR]="Türkçe (Türkiye)",Bd[Pd.tl_PH]="Wikang Tagalog (Philippines)",Bd[Pd.te]="తెలుగు",Bd[Pd.ta]="தமிழ்",Bd[Pd.th_TH]="ไทย (ประเทศไทย)",Bd[Pd.ur_PK]="اردو)پاکستان)",Bd[Pd.ur_IN]="اردو)بھارت)",Bd[Pd.uk_UA]="Українська (Україна)",Bd[Pd.iw_IL]="עִבְרִית (ישראל)",Bd[Pd.es_ES]="Español (España)",Bd[Pd.es_MX]="Español (México)",Bd[Pd.hu]="Magyar",Bd[Pd.it_IT]="Italiano (Italia)",Bd[Pd.in_ID]="Bahasa Indonesia (Indonesia)",Bd[Pd.hi_IN]="हिन्दी (भारत)",Bd[Pd.vi_VN]="Tiếng Việt (Việt Nam)",Bd[Pd.en_PK]="English (Pakistan)",Bd[Pd.en_PL]="English (Poland)",Bd[Pd.en_FR]="English (France)",Bd[Pd.en_PH]="English (Philippines)",Bd[Pd.en_CZ]="English (Czech Republic)",Bd[Pd.en_CA]="English (Canada)",Bd[Pd.en_MM]="English (Myanmar)",Bd[Pd.en_US]="English (United States)",Bd[Pd.en_BD]="English (Bangladesh)",Bd[Pd.en_MY]="English (Malaysia)",Bd[Pd.en_NP]="English (Nepal)",Bd[Pd.en_LK]="English (Sri Lanka)",Bd[Pd.en_TH]="English (Thailand)",Bd[Pd.en_ES]="English (Spain)",Bd[Pd.en_SG]="English (Singapore)",Bd[Pd.en_HU]="English (Hungary)",Bd[Pd.en_ID]="English (Indonesia)",Bd[Pd.en_GB]="English (Great Britain)",Bd[Pd.en_VN]="English (Vietnam)",Bd[Pd.en_HK]="English (Hong Kong)",Bd[Pd.en_KR]="English (Korea)",Bd[Pd.zh_TW]="繁体中文 (中國台灣)",Bd[Pd.zh_HK]="繁体中文 (中國香港)",Bd[Pd.zh_SG]="简体中文 (新加坡)",Bd[Pd.zh_CN]="简体中文",Bd[Pd.ar_IQ]="العربية (العراق)",Bd[Pd.ckb_IQ]="کوردیی ناوەندی (عێراق)",Bd[Pd.ku]="کورمانجی",Bd[Pd.kk_KZ]="قازاقشا ",Bd[Pd.af]="Afrikaans",Bd[Pd.am]="አማርኛ",Bd[Pd.az]="Azərbaycan",Bd[Pd.be]="беларуская мова",Bd[Pd.bg]="Български",Bd[Pd.bs]="босански",Bd[Pd.ca]="Català",Bd[Pd.cy]="Cymraeg",Bd[Pd.el]="Ελληνικά",Bd[Pd.eo]="Esperanto",Bd[Pd.et]="eesti keel",Bd[Pd.eu]="Euskara",Bd[Pd.fa]="فارسی",Bd[Pd.fi]="Suomi",Bd[Pd.gd]="Gaeilge",Bd[Pd.gl]="Galego",Bd[Pd.ha]="هَوُسَ",Bd[Pd.haw]="ʻŌlelo Hawaiʻi",Bd[Pd.hr]="Hrvatski",Bd[Pd.ig]="Asụsụ Igbo",Bd[Pd.is]="Íslenska",Bd[Pd.ka]="ქართული",Bd[Pd.km]="ភាសាខ្មែរ",Bd[Pd.ky]="кыргыз тили",Bd[Pd.lb]="Lëtzebuergesch",Bd[Pd.ln]="Lingála",Bd[Pd.lt]="lietuvių kalba",Bd[Pd.lv]="Latviešu valoda",Bd[Pd.mg]="malagasy",Bd[Pd.mk]="македонски",Bd[Pd.mn]="монгол хэл",Bd[Pd.mt]="Malti",Bd[Pd.om]="Oromoo",Bd[Pd.ps]="پښتو",Bd[Pd.qu]="Quechua",Bd[Pd.rw]="Ikinyarwanda",Bd[Pd.sl]="slovenščina",Bd[Pd.so]="Af-Soomaali",Bd[Pd.sq]="Gjuha shqipe",Bd[Pd.sw]="Kiswahili",Bd[Pd.tg]="тоҷикӣ",Bd[Pd.ti]="ትግርኛ",Bd[Pd.ug]="ئۇيغۇر تىلى",Bd[Pd.uz]="Ўзбек тили",Bd[Pd.yo]="Èdè Yorùbá",Bd[Pd.zu]="isiZulu",Cd.AiSelected,(pd={})[Pd.en_US]="AI Selected",pd[Pd.zh_CN]="AI 精选",(hd={})[Pd.en_US]="AI selection of translations",hd[Pd.zh_CN]="多渠道翻译的 AI 精选",Md.AiSelected,Dd.AiSelected,(fd={})[Pd.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",fd[Pd.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(md={})[Pd.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",md[Pd.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Cd["ChatGPT3.5"],(vd={})[Pd.en_US]="GPT-3.5",vd[Pd.zh_CN]="GPT-3.5",(gd={})[Pd.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",gd[Pd.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(yd={})[Pd.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",yd[Pd.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",Md["ChatGPT3.5"],Dd["ChatGPT3.5"],Cd.Aliyun,(_d={})[Pd.en_US]="Alibaba",_d[Pd.zh_CN]="阿里云",Md.Aliyun,Dd.Aliyun,Cd.Google,(bd={})[Pd.en_US]="Google",bd[Pd.zh_CN]="Google",Md.Google,Dd.Google,Cd.DeepL,(Ed={})[Pd.en_US]="DeepL",Ed[Pd.zh_CN]="DeepL",Md.DeepL,Dd.DeepL,Cd.Microsoft,(Sd={})[Pd.en_US]="Azure AI",Sd[Pd.zh_CN]="Azure AI",Md.Microsoft,Dd.Microsoft,Cd.Amazon,(Ad={})[Pd.en_US]="Amazon",Ad[Pd.zh_CN]="Amazon",Md.Amazon,Dd.Amazon,Cd.Papago,(kd={})[Pd.en_US]="Papago",kd[Pd.zh_CN]="Papago",(Td={})[Pd.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",Td[Pd.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(wd={})[Pd.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",wd[Pd.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",Md.Papago,Dd.Papago;var Kd=Object.keys(wu).map((function(e){return wu[e]})),Hd=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,Yd=function(e,t){return(Yd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Fd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Yd(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var jd,zd,Gd,Vd=function(){return(Vd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Wd(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function qd(e){return e.type===zd.literal}function Jd(e){return e.type===zd.argument}function Qd(e){return e.type===zd.number}function Zd(e){return e.type===zd.date}function Xd(e){return e.type===zd.time}function $d(e){return e.type===zd.select}function ep(e){return e.type===zd.plural}function tp(e){return e.type===zd.pound}function np(e){return e.type===zd.tag}function rp(e){return!(!e||"object"!=Qe()(e)||e.type!==Gd.number)}function op(e){return!(!e||"object"!=Qe()(e)||e.type!==Gd.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(jd||(jd={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(zd||(zd={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(Gd||(Gd={}));var ip=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,ap=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function sp(e){var t={};return e.replace(ap,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var lp=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,cp=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,up=/^(@+)?(\+|#+)?[rs]?$/g,dp=/(\*)(0+)|(#+)(0+)|(0+)/g,pp=/^(0+)$/;function hp(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(up,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function fp(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function mp(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!pp.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function vp(e){return fp(e)||{}}function gp(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=Vd(Vd(Vd({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return Vd(Vd({},e),vp(t))}),{}));continue;case"engineering":t=Vd(Vd(Vd({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return Vd(Vd({},e),vp(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(dp,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(pp.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(cp.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(cp,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=Vd(Vd({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=Vd(Vd({},t),hp(i)))}else if(up.test(o.stem))t=Vd(Vd({},t),hp(o.stem));else{var a=fp(o.stem);a&&(t=Vd(Vd({},t),a));var s=mp(o.stem);s&&(t=Vd(Vd({},t),s))}}return t}var yp,_p={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function bp(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(_p[n||""]||_p[r||""]||_p["".concat(r,"-001")]||_p["001"])[0]}var Ep=new RegExp("^".concat(ip.source,"*")),Sp=new RegExp("".concat(ip.source,"*$"));function Ap(e,t){return{start:e,end:t}}var kp=!!String.prototype.startsWith&&"_a".startsWith("a",1),Tp=!!String.fromCodePoint,wp=!!Object.fromEntries,Pp=!!String.prototype.codePointAt,Ip=!!String.prototype.trimStart,Cp=!!String.prototype.trimEnd,Rp=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Np=!0;try{Np="a"===(null===(yp=Kp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===yp?void 0:yp[0])}catch(wu){Np=!1}var Op,Lp=kp?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Dp=Tp?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},Mp=wp?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},xp=Pp?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Up=Ip?function(e){return e.trimStart()}:function(e){return e.replace(Ep,"")},Bp=Cp?function(e){return e.trimEnd()}:function(e){return e.replace(Sp,"")};function Kp(e,t){return new RegExp(e,t)}if(Np){var Hp=Kp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Op=function(e,t){var n;return Hp.lastIndex=t,null!==(n=Hp.exec(e)[1])&&void 0!==n?n:""}}else Op=function(e,t){for(var n=[];;){var r=xp(e,t);if(void 0===r||jp(r)||zp(r))break;n.push(r),t+=r>=65536?2:1}return Dp.apply(void 0,n)};var Yp=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(jd.UNMATCHED_CLOSING_TAG,Ap(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Fp(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:zd.pound,location:Ap(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:zd.literal,value:"<".concat(r,"/>"),location:Ap(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Fp(this.char()))return this.error(jd.INVALID_TAG,Ap(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(jd.UNMATCHED_CLOSING_TAG,Ap(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:zd.tag,value:r,children:i,location:Ap(n,this.clonePosition())},err:null}:this.error(jd.INVALID_TAG,Ap(a,this.clonePosition())))}return this.error(jd.UNCLOSED_TAG,Ap(n,this.clonePosition()))}return this.error(jd.INVALID_TAG,Ap(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=Ap(n,this.clonePosition());return{val:{type:zd.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Fp(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Dp.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Dp(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(jd.EXPECT_ARGUMENT_CLOSING_BRACE,Ap(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(jd.EMPTY_ARGUMENT,Ap(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(jd.MALFORMED_ARGUMENT,Ap(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(jd.EXPECT_ARGUMENT_CLOSING_BRACE,Ap(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:zd.argument,value:r,location:Ap(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(jd.EXPECT_ARGUMENT_CLOSING_BRACE,Ap(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(jd.MALFORMED_ARGUMENT,Ap(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Op(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Ap(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(jd.EXPECT_ARGUMENT_TYPE,Ap(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=Bp(g.val)).length)return this.error(jd.EXPECT_ARGUMENT_STYLE,Ap(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:Ap(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=Ap(r,this.clonePosition());if(l&&Lp(null==l?void 0:l.style,"::",0)){var d=Up(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:zd.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(jd.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=bp(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:Gd.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?sp(p):{}};return{val:{type:"date"===a?zd.date:zd.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?zd.number:"date"===a?zd.date:zd.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var f=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(jd.EXPECT_SELECT_ARGUMENT_OPTIONS,Ap(f,Vd({},f)));this.bumpSpace();var m=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===m.value){if(!this.bumpIf(":"))return this.error(jd.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ap(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(jd.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,jd.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),m=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,m);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var b=Ap(r,this.clonePosition());return"select"===a?{val:{type:zd.select,value:n,options:Mp(_.val),location:b},err:null}:{val:{type:zd.plural,value:n,options:Mp(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(jd.INVALID_ARGUMENT_TYPE,Ap(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(jd.EXPECT_ARGUMENT_CLOSING_BRACE,Ap(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(jd.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Ap(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(lp).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(jd.INVALID_NUMBER_SKELETON,t)}return{val:{type:Gd.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?gp(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(jd.EXPECT_PLURAL_ARGUMENT_SELECTOR,jd.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=Ap(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?jd.DUPLICATE_SELECT_ARGUMENT_SELECTOR:jd.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?jd.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:jd.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Ap(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var f=this.tryParseArgumentClose(p);if(f.err)return f;a.push([l,{value:h.val,location:Ap(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?jd.EXPECT_SELECT_ARGUMENT_SELECTOR:jd.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ap(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(jd.MISSING_OTHER_CLAUSE,Ap(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=Ap(r,this.clonePosition());return o?Rp(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=xp(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Lp(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&jp(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Fp(e){return e>=97&&e<=122||e>=65&&e<=90}function jp(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function zp(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Gp(e,t){void 0===t&&(t={}),t=Vd({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Yp(e,t).parse();if(n.err){var r=SyntaxError(jd[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,$d(t)||ep(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else Qd(t)&&rp(t.style)||(Zd(t)||Xd(t))&&op(t.style)?delete t.style.location:np(t)&&e(t.children)}))}(n.val),n.val}function Vp(e,t){var n=t&&t.cache?t.cache:eh,r=t&&t.serializer?t.serializer:Zp;return(t&&t.strategy?t.strategy:Qp)(e,{cache:n,serializer:r})}function Wp(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function qp(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function Jp(e,t,n,r,o){return n.bind(t,e,r,o)}function Qp(e,t){return Jp(e,this,1===e.length?Wp:qp,t.cache.create(),t.serializer)}var Zp=function(){return JSON.stringify(arguments)};function Xp(){this.cache=Object.create(null)}Xp.prototype.get=function(e){return this.cache[e]},Xp.prototype.set=function(e,t){this.cache[e]=t};var $p,eh={create:function(){return new Xp}},th={variadic:function(e,t){return Jp(e,this,qp,t.cache.create(),t.serializer)},monadic:function(e,t){return Jp(e,this,Wp,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}($p||($p={}));var nh,rh=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return Fd(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),oh=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),$p.INVALID_VALUE,o)||this}return Fd(t,e),t}(rh),ih=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),$p.INVALID_VALUE,r)||this}return Fd(t,e),t}(rh),ah=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),$p.MISSING_VALUE,n)||this}return Fd(t,e),t}(rh);function sh(e){return"function"==typeof e}function lh(e,t,n,r,o,i,a){if(1===e.length&&qd(e[0]))return[{type:nh.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(qd(u))s.push({type:nh.literal,value:u.value});else if(tp(u))"number"==typeof i&&s.push({type:nh.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new ah(d,a);var p=o[d];if(Jd(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?nh.literal:nh.object,value:p});else if(Zd(u)){var h="string"==typeof u.style?r.date[u.style]:op(u.style)?u.style.parsedOptions:void 0;s.push({type:nh.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(Xd(u))h="string"==typeof u.style?r.time[u.style]:op(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:nh.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(Qd(u))(h="string"==typeof u.style?r.number[u.style]:rp(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:nh.literal,value:n.getNumberFormat(t,h).format(p)});else{if(np(u)){var f=u.children,m=u.value,v=o[m];if(!sh(v))throw new ih(m,"function",a);var g=v(lh(f,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?nh.literal:nh.object,value:e}})))}if($d(u)){if(!(y=u.options[p]||u.options.other))throw new oh(u.value,p,Object.keys(u.options),a);s.push.apply(s,lh(y.value,t,n,r,o))}else if(ep(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new rh('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',$p.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new oh(u.value,p,Object.keys(u.options),a);s.push.apply(s,lh(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===nh.literal&&t.type===nh.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function ch(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(nh||(nh={}));var uh=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===nh.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return lh(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,Vd(Vd({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?Vd(Vd(Vd({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=Vd(Vd({},o[t]),i[t]||{}),e}),{})):o),n}),Vd({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Vp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,Wd([void 0],n,!1)))}),{cache:ch(i.number),strategy:th.variadic}),getDateTimeFormat:Vp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Wd([void 0],n,!1)))}),{cache:ch(i.dateTime),strategy:th.variadic}),getPluralRules:Vp((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,Wd([void 0],n,!1)))}),{cache:ch(i.pluralRules),strategy:th.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Gp,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function dh(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var ph=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=dh({},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 i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",dh({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,dh({},this.attributes,t))},withConverter:function(t){return e(dh({},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:"/"}),hh=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},fh=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},mh=function(){return"object"==("undefined"==typeof ac?"undefined":Qe()(ac))&&"function"==typeof ac.call},vh=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!mh()},gh=function(){return"object"==("undefined"==typeof window?"undefined":Qe()(window))},yh=function(){return function(){var e;return!!gh()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||gh()&&"undefined"!=typeof AlipayJSBridge},_h=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},bh=function(){return!(void 0===n.g||gh()||vh()||_h()||mh())},Eh="bailingualLocaleChange",Sh="bailingualDataChange",Ah="bailingualError";function kh(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Qe()(document)))try{return ph.get(e)||ph.get("_CHIPS-"+e)}catch(e){return hh("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var Th,wh=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),yh()||vh()||mh()){var t=cd[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),ld[e.toLowerCase()]&&(e=ld[e.toLowerCase()]),Yh(Kd,e)?e:""};function Ph(e){return void 0===e&&(e=!0),wh(function(e){return void 0===e&&(e=!0),vh()||mh()?my.env&&my.env.language||my.getSystemInfoSync().language:_h()?wx.getSystemInfoSync().language:bh()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=kh("x-hng")||kh("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Qe()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(gh()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(gh()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function Ih(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Qe()(document))&&ph.set(e,t,n)}catch(e){hh("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Ch(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Qe()(document))&&ph.remove(e,t)}catch(e){hh("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Rh(){"object"==("undefined"==typeof document?"undefined":Qe()(document))&&"object"==("undefined"==typeof location?"undefined":Qe()(location))&&(Ch("x-hng",{path:"/",domain:location.hostname}),Ch("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Ch("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Ch("x-hng",{path:"/"}),Ch("x-hng",{path:"/",SameSite:"None",Secure:!0}),Ch("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(Th||(Th={}));var Nh,Oh,Lh,Dh,Mh,xh,Uh,Bh,Kh=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},Hh=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},Yh=function(e,t){return e.indexOf(t)>-1};function Fh(e){var t,n;try{return Oh?(null===(t=Oh.getItem)||void 0===t?void 0:t.call(Oh,e))||"":vh()||mh()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":_h()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Qe()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function jh(e,t){var n;try{if(t=(t||"").toString(),Oh)return void(null===(n=Oh.setItem)||void 0===n||n.call(Oh,e,t));if(vh()||mh())return void my.setStorage({key:e,data:t});if(_h())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Qe()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function zh(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return Nh?Nh(e):mh()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):vh()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):_h()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(Uh||(Uh={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(Bh||(Bh={}));var Gh={ANTINTL:(Lh={},Lh[Uh.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",Lh[Uh.PROD]="https://bailingual.marmot-cloud.com/manifest/",Lh),ALIPAY:(Dh={},Dh[Uh.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Dh[Uh.PROD]="https://bailingual-assets.alipay.com/manifest/",Dh)},Vh={};Vh[Bh.INTERNET]=((Mh={})[Uh.DAILY]=function(e,t,n){var r;return""+(n?null===(r=Gh[n])||void 0===r?void 0:r[Uh.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Mh[Uh.PROD]=function(e,t,n){var r;return""+(n?null===(r=Gh[n])||void 0===r?void 0:r[Uh.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},Mh),Vh[Bh.INTRANET]=((xh={})[Uh.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},xh[Uh.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},xh);var Wh;function qh(){return"true"===Fh("__BAILINGUAL_IN_CONTEXT__")}function Jh(){if(!(vh()||_h()||mh())){var e=Fh("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){hh("[bailingual-sdk-glue] JSON.parse data fail: "+e)}Wh=qh()&&t}}function Qh(){return void 0===Wh&&Jh(),Wh}function Zh(){jh("__BAILINGUAL_IN_CONTEXT__","true"),Jh(),new Promise((function(e,t){if(vh()||_h()||mh())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return zh("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function Xh(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function $h(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function ef(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(mh())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(vh())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(_h())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(gh()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(vh()||_h()||mh()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(qh()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void Zh();if("undefined"==typeof document)return;if(yh()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!Qh()){if(7==++n)return Zh(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){jh("__BAILINGUAL_IN_CONTEXT__","false"),Jh()}))}catch(e){hh("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var tf=function(e){return e<10?"0"+e:""+e};function nf(){var e=new Date;return e.getFullYear()+"-"+tf(e.getMonth()+1)+"-"+tf(e.getDate())+" "+tf(e.getHours())+":"+tf(e.getMinutes())+":"+tf(e.getSeconds())+":"+e.getMilliseconds()}function rf(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function of(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",nf(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",rf({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:$h(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",nf(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",rf({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:$h(t.keyCounts)})];break;case"US":i=["D-VM",nf(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",rf({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:$h(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var af=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};af.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),gh()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},af.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=of(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});ef(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},af.prototype.getRegion=function(){return this.region},af.prototype.setRegion=function(e){this.region=e,this.startTimer()},af.prototype.report=function(e){this.region&&this.queue.push(e)};var sf=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},lf={usageReportRegion:{configurable:!0}};sf.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},sf.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},sf.customizeStorage=function(e){return function(e){Oh=e}(e)},sf.getDataFromStorage=function(e){return Fh(e)},sf.setDataToStorage=function(e,t){return jh(e,t)},sf.customizeFetch=function(e){Nh=e},lf.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},lf.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new af({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},sf.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||Ph(this.canReadLocaleFromCookie))},sf.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},sf.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||Ph(this.canReadLocaleFromCookie))},sf.prototype.getServerSideFallbackData=function(){if(bh()){var e=n.g.BAILINGUAL_FALLBACK;return e||(hh("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},sf.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new af({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Qe()(e[n])){var r=wh(n);if(!r)return void fh("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=Hh({},e[n]),t.i18nText[r]=Hh({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&hh("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||fh("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},sf.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Fh("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return fh("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=Fh("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return fh("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){Yh(Kd,e)&&(t.i18nText[e]||hh("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},Hh(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=wh(e),Yh(Kd,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=wh(e),Yh(Kd,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{jh("BAILINGUAL_PATCH_I18N-"+e,""),jh("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){fh("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},sf.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Qe()(document))||"object"!=("undefined"==typeof location?"undefined":Qe()(location))||yh()||vh()||mh()||_h()||(Rh(),Ih("x-hng","lang="+e,{path:"/",expires:180}),Ih("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(Eh,e))},sf.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r=t.id;this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var o=this.intlPDKVMessages[e][r];if(!o){var i=n[r];i.match(Hd)||(i=Xh(this.appName,r,i)),o=this.createIntlMessageFormat(i,e),this.intlPDKVMessages[e][r]=o}return o},sf.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r=t.id,o=(null==n?void 0:n[r])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[r]){this.intlMessages[e]=this.intlMessages[e]||{};var i=this.intlMessages[e][r];return i||(i=this.createIntlMessageFormat(o,e),this.intlMessages[e][r]=i),i}return this.createIntlMessageFormat(o,e)},sf.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=Qh()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return hh(s),hh("[bailingual-sdk-glue] error detail:",t),this.emit(Ah,new Kh({code:Th.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){Yh(l,t)||o.emit(Ah,new Kh({code:Th.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return hh(u),hh("[bailingual-sdk-glue] error detail:",n),this.emit(Ah,new Kh({code:Th.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},sf.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=wh(r))||fh("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||fh("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},sf.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},sf.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=wh(e),Yh(this.availableLocales,e))return e},sf.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):fh("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},sf.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},sf.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&Qh()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},sf.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(Hd)||(o=Xh(t.appName,r,o)),n[r]=o})),n},sf.prototype.getDataWithLocale=function(e,t){e||hh("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[wh(e||this.defaultLocale)];return n&&t&&Qh()?this.buildPDKVLocaleText(n):n},sf.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);fh("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},sf.prototype.getCurrentLocale=function(){return this.currentLocale||""},sf.prototype.getDefaultLocale=function(){return this.defaultLocale},sf.prototype.formatLocaleCode=function(e){return wh(e)},sf.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return fh('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(Ah,new Kh({code:Th.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return fh("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(fh("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return zh(function(e,t,n,r,o){var i,a;return null===(a=null===(i=Vh[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?Uh.DAILY:Uh.PROD,t.isIntranet?Bh.INTRANET:Bh.INTERNET,e.appName,e.tag,o)).then((function(e){return e?zh(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Qe()(e[t])){var r=wh(t);r&&(n[r]=n[r]||{},Hh(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&hh("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!Yh(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=Hh({},o,r)})),o.forEach((function(t){if(!Yh(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],Yh(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(jh("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),jh("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(fh("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},sf.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return Yh(Kd,e)}));return this.defaultLocale&&!Yh(t,this.defaultLocale)?(fh("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(Sh,e),this.currentLocale&&!Yh(t,this.currentLocale)&&(hh("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},sf.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},sf.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},sf.prototype.onDataChange=function(e){this.on(Sh,e)},sf.prototype.offDataChange=function(e){this.off(Sh,e)},sf.prototype.onLocaleChange=function(e){this.on(Eh,e)},sf.prototype.offLocaleChange=function(e){this.off(Eh,e)},sf.prototype.onError=function(e){this.on(Ah,e)},sf.prototype.offError=function(e){this.off(Ah,e)},sf.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},sf.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},sf.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},sf.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},sf.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},sf.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},sf.prototype.changeBizEnv=function(e){this.bizEnv=e},sf.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},sf.prototype.removeBailingualCookie=function(){Rh()},Object.defineProperties(sf.prototype,lf),sf.customizedGetSystemLocale=void 0;var cf=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){Yh([zd.argument,zd.number,zd.date,zd.time,zd.select,zd.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t){return new uh(e,t,{},{ignoreTag:!0})},t}(sf),uf=(new cf,"antom-language-storage-key"),df="antom_language_change_event",pf="en_US",hf=new cf;function ff(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=vf(e);n&&(hf.getAllLocales().map(vf).includes(n)||(n=pf),hf.changeLocale(n),gf(n),t?window.location.reload():window.dispatchEvent(new Event(df)))}function mf(e){if(e)return vf(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(uf)||window.localStorage.getItem(uf);if(t)return vf(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=hf.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):vf(e)===vf(navigator.language)}))||pf;if(r)return r=vf(r)}return pf}function vf(e){var t=e;t||(t=pf);var n=t.split(/[-,_]/),r=tt(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function gf(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(uf,e),window.sessionStorage.setItem(uf,e),!0}catch(e){return!1}}"true"==={NODE_ENV:"production",PUBLIC_PATH:"/"}.ANTOM_CORE_UNIT_TEST&&hf.initData(window.bailingual_ckp||{});var yf={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},_f=p(p({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),yf);su.initConfig({i18n:hf,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var bf=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","AntomError"),l(Ze(e),"response",void 0),e}return f(n,null,[{key:"isError",value:function(e){return su.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return su.unificationError(e,t)}}]),n}(su),Ef=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","AntomCoreError"),e}return f(n)}(bf),Sf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0})}}:{success:function(){},error:function(){}}},Af=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},kf=(window||{}).navigator,Tf=kf.userAgent,wf=function(){var e=/OpenHarmony/i.test(kf.userAgent),t=/Phone/i.test(kf.userAgent),n=/Tablet/i.test(kf.userAgent);return e&&(t||n)},Pf=/iPhone|iPad|iPod/i.test(Tf)||"MacIntel"===kf.platform&&kf.maxTouchPoints>1,If=(/Android/i.test(Tf),/\bMacintosh\b/.test(Tf),/Windows NT/.test(Tf),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(Tf)||wf()}),Cf=Pf,Rf=!!If(),Nf=!If();wf();var Of=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},Lf=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return Of(n)}},Df=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},Mf=n(9414),xf=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},Uf={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Bf="ANTOM_PAYMENT_WEB",Kf=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function Hf(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var Yf=function(){function e(t){v(this,e),l(this,"baseUrl",void 0),l(this,"headers",void 0),l(this,"method",void 0),l(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return f(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:p(p({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===Je(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){Hf().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",p({instanceId:Kf},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:Of(t.data),headers:Ff(t.headers)};n(o)}))}))}}]),e}();function Ff(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var jf=function(e){var t=Mf(e,"Result-Status")||Mf(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:yf.API_NOT_LOGIN,errorMessage:hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:yf.API_GATEWAY_TIMEOUT,errorMessage:hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=Mf(e,"Tips")||Mf(e,"tips","");return{success:!1,errorCode:yf.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},zf={};function Gf(e,t,n){return Vf.apply(this,arguments)}function Vf(){return(Vf=a(o().mark((function e(t,n,r){var i,a,s,l,c,u,d,h,f,m,v,g,y,_,b,E,S,A,k,T,w;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p(p(p({},zf),r),{},{envInfo:p(p({},zf.envInfo),null==r?void 0:r.envInfo),headers:p(p({},zf.headers),null==r?void 0:r.headers)}),s=Sf(a.tracker,a.scope),l=Af(a.tracker,a.scope),a.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:a.hostSign="SG";case 10:return"WAP"===(c=p(p({terminalType:Rf?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:xf(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==a?void 0:a.envInfo),{},{locale:mf((null==a?void 0:a.locale)||(null==a||null===(i=a.envInfo)||void 0===i?void 0:i.locale))})).terminalType&&(c.osType=Cf?"IOS":"ANDROID"),u=[p(p({},n),{},{envInfo:c,extParams:p(p({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,h=Wf(t,a),e.next=18,h({data:u});case 18:if(f=e.sent,m=f.data,v=f.headers,g=m||{},y=Mf(v,"Mgw-TraceId")||Mf(v,"mgw-traceid",""),g.traceId=y,!(_=jf(v))){e.next=29;break}throw b=_.errorMessage,E=_.errorCode,new Ef(b,E,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(m.success){e.next=34;break}throw"true"!==(null===(S=m.extendInfo)||void 0===S?void 0:S.mulityLanguageMapping)&&(m.errorMessage=hf.get({id:"server.".concat(m.errorCode),defaultMessage:hf.get({id:"event.callback.code.${data.errorCode}",defaultMessage:hf.get({id:"ckp.paymentError.${data.errorCode}",defaultMessage:hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(k=new bf(m.errorMessage||m.resultMessage||hf.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),m.errorCode||(null===(A=m.errorContext)||void 0===A||null===(A=A.errorStack)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.errorName)||"API_SYSTEM_ERROR","SERVER_API","".concat(y," (").concat(t,")"))).response=g,k;case 34:return s.success(t,performance.now()-d,y),e.abrupt("return",g);case 38:if(e.prev=38,e.t0=e.catch(14),!Ef.isError(e.t0)){e.next=43;break}return s.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 43:return w=e.t0,l(w),e.abrupt("return",Promise.reject(new Ef(w.message,null!==(T=w.message)&&void 0!==T&&T.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 46:case"end":return e.stop()}}),e,null,[[14,38]])})))).apply(this,arguments)}function Wf(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||Uf[i],c=p(l(l(l(l(l(l(l(l({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||Bf,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(Bf.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"0.0.1777017092-dev.2"),null==t?void 0:t.headers);"dev"!==i&&delete c["sofa-group-name"],"sandbox"===i&&(c["load-test"]=!0,c.sofaPenAttrs="instMock=O&loadMode=2");var u,d=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,h=Object.entries(c).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==Je(e[1])})).reduce((function(e,t){var n=tt(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),f={baseURL:s,timeout:d,headers:c},m=null;"app"===zf.appType?m=new Yf({baseURL:s,method:"POST",timeout:d,headers:h}):m=Ti.create(p(p({},f),{},{withCredentials:null===(u=null==t?void 0:t.withCredentials)||void 0===u||u,method:(null==t?void 0:t.method)||"POST"}));return m.request}Gf.setGlobalOptions=function(e){Object.assign(zf,e)};"".concat(window.location.origin,"/elements/src/pages");var qf=n(8994);function Jf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return qf.apply(void 0,[{},e].concat(n))}var Qf=new ed({appId:"180020050100012557",performance:!1,error:!1}),Zf="7981",Xf=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){Qf.log(p({code:"".concat(Zf).concat(e)},t))}},$f=Xf(),em=Xf("event"),tm=Xf("iframe"),nm=Xf("handshake"),rm=Xf("merchant"),om=Xf("element"),im=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);var e="1.0.8".replace(/-dev\.[0-9]+/,""),t="https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js";return t="https://marmot-local-dev.oss-accelerate.aliyuncs.com/tnpm-package/@antintl-opensdk-debugger/".concat(e,"/dist/main.umd.js"),(0,tu.loadScript)(t,"sdkDebugger").then((function(e){return e.variable}))},am=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};$f({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=tt(a,3),l=s[0],c=s[1],u=s[2];em({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},sm=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=tt(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(su.isError(e)?e.toJSON():e);am("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},lm=function(e){y(n,e);var t=b(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Ze(e),"name","SDKInternalError"),e}return f(n)}(su),cm=function(e){y(n,e);var t=b(n);function n(e){return v(this,n),t.call(this,"HOST",e)}return f(n,[{key:"_transferReceivePort",value:function(e){nu(ou(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){nu(ou(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){nu(ou(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){nu(ou(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=nu(ou(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return $u.getGlobalBridge("HOST")}}]),n}($u),um=function(e){y(n,e);var t=b(n);function n(e,r,o){var i;return v(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),l(Ze(i),"name","MountError"),i}return f(n)}(lm),dm=function(){function e(t,n){v(this,e),l(this,"name",void 0),l(this,"_elementMode",void 0),l(this,"_isMainElement",void 0),l(this,"config",void 0),l(this,"bridge",void 0),l(this,"hooks",{}),l(this,"iframe",null),l(this,"status",void 0),l(this,"cachedSend",[]),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new cm(t),this.bridge.setOrigin(n.targetOrigin),this.config.debug&&this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Lu)||e.type.endsWith(qu)||(e.type.endsWith(ju)?am(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Hu)&&"IN"===t?sm(e.payload):am("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))})),this.status="initialized"}var t,n,r,i;return f(e,[{key:"submit",value:function(e){throw new lm("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(i=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"mount",value:(r=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new um({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),sm(n),n;case 4:return r=Tu((function(){return Promise.all([i.setup(),i._mount(t)])}),15e3,new um("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),e.abrupt("return",r().then((function(e){var t=tt(e,1)[0];rm({msg:i.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),i.bridge.send(Nu,Jf(i.config.appConfig,t||{}))})).catch((function(e){i.unmount();var t=lm.unificationError(e);throw sm(t),t})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(o().mark((function e(r,i){var a,s,l,c,u,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",i(new um({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",i(new um("container missing","MOUNT_MISSING_CONTAINER")));case 5:a=n.config.appUrl,s=new URL(n.config.appUrl);try{s.searchParams.set("origin",window.location.origin),s.searchParams.set("locale",n.config.locale),a=s.toString()}catch(e){l=a.includes("?")?"&":"?",a="".concat(a).concat(l,"origin=").concat(encodeURIComponent(window.location.origin)).concat(l,"locale=").concat(encodeURIComponent(n.config.locale))}n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=a,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.maxHeight="100vh",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.bridge.on(qu,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),c=Date.now(),u="*";try{"null"===(u=new URL(n.iframe.src).origin)&&(u="*")}catch(e){u="*"}n.bridge.setOrigin(u),d=function(e){var t;if(console.log("handShakeHandler",e,n.status),"mounted"!==n.status&&"ready"!==n.status){if(null===(t=n.iframe)||void 0===t||!t.contentWindow)return r();am("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",tm({msg:n.name,d1:"是",m1:Math.round(Date.now()-c),m2:1}),n.bridge.setTarget(n.iframe.contentWindow);var o=Date.now(),i=setTimeout((function(){nm({msg:n.name,d1:"handshake timeout",m1:Math.round(Date.now()-o),m2:0,m3:Math.round(Date.now()-c)})}),15e3);n.bridge.once(Yu,(function(e){clearTimeout(i),n.status="ready",nm({msg:n.name,d1:"handshake ack",m1:Math.round(Date.now()-o),m2:1,m3:Math.round(Date.now()-c)}),n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),console.log((null==e?void 0:e.version)||"异常的版本")})),r()}},n.bridge.once(Ou,(function(){d("readyHandshake")})),n.iframe.onload=function(){setTimeout((function(){d("onload")}),200)},n.iframe.onerror=function(e){tm({msg:n.name,d1:"否",m1:Math.round(Date.now()-c),m2:0}),i(new um("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(2),i(new um("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 22:case"end":return e.stop()}}),e,null,[[2,19]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:function(e){try{if("destroyed"===this.status)throw new lm("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");this.config.appConfig=Jf(this.config.appConfig,e),am("INFO","SDK_USAGE","Updating configuration via API",e),this.bridge.send(Lu,{merged:this.config.appConfig,updated:e})}catch(e){sm(lm.unificationError(e))}}},{key:"unmount",value:function(){"mounted"!==this.status&&"ready"!==this.status||(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe)))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):sm(new lm("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:(t=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("HOST"===this.bridge.mode){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("submit method only available in HOST mode")));case 2:return this.send(Du,t),e.abrupt("return",new Promise((function(e){n.bridge.once(Mu,(function(t){e(t)}))})));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e;null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e()})),this.hooks={},this.bridge.destroy(),this.unmount(),this.status="destroyed"}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();l(dm,"elementType",void 0);var pm=function(e){y(n,e);var t=b(n);function n(e,r,o,i){return v(this,n),t.call(this,e,p(p({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return f(n,[{key:"_submit",value:function(e){return nu(ou(n.prototype),"_submit",this).call(this,e)}}]),n}(dm),hm=function(){function e(t){var n,r=this;v(this,e),l(this,"config",void 0),l(this,"isInit",!1),l(this,"version",void 0),l(this,"elementMode","SINGLE"),l(this,"_elements",new Map),l(this,"globalBridgeForWebApp",void 0),l(this,"globalBridgeForModal",void 0),l(this,"openModalHandle",void 0),l(this,"elementClasses",{}),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,Zf=n);var i=this.globalBridgeForWebApp=cm.getGlobalBridge();this.globalBridgeForWebApp.on(Uu,function(){var e=a(o().mark((function e(t){var n,a,s,l,c,u,d,h,f,m;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(a=r.globalBridgeForModal=cm.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&am("INFO","SDK_INTERNAL",e.type,e.payload)})),(s=r._elements.get(t.scope))&&null!==(n=s.iframe)&&void 0!==n&&n.contentWindow?i.setTarget(s.iframe.contentWindow):am("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available, confirm close may not work"),e.prev=4,l=new URL(t.url),t.closeConfirm&&(l.searchParams.append("confirm","true"),l.searchParams.has("closeConfirm")&&(t.closeConfirm=!0)),t.url=l.toString(),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(4),c=new lm("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),i.send(Bu,c),e.abrupt("return");case 15:return u=new MessageChannel,d=Pu("modal_"),e.next=19,r.openModal(p(p({},t),{},{onClose:function(){if(t.closeConfirm)return new Iu(d,u.port2).close(!0)}}));case 19:h=r.openModalHandle=e.sent,t.appearance&&(f=function(){a.setTarget(h.getContentWindow()),a.send(Wu,t.appearance)},h.onLoadedSuccess(f)),t.closeConfirm&&(i.send(Gu,d,[u.port1]),m=function(){a.setTarget(h.getContentWindow()),a.send(Vu,d,[u.port2])},h.onLoadedSuccess(m)),i.on(Ku,(function(){h.destroy(),a.destroy()}));case 23:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t){return e.apply(this,arguments)}}()),i.on(xu,function(){var e=a(o().mark((function e(t){var n,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.url,i=t.mode,a=void 0===i?"redirect":i,s=t.destory,(void 0===s||s)&&r.destroy(),"replace"===a?window.location.replace(n):"redirect"===a&&(window.location.href=n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.setDebugCallback((function(e,t){var n,r;e.type.endsWith(ju)?am(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Hu)&&"IN"===t?sm(e.payload):e.type.endsWith(Bu)?am("ERROR","APP_RUNTIME","Open modal error",e.payload):am("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new lm("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new lm('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return f(e,[{key:"openModal",value:(n=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return am("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"init",value:(t=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,im().then((function(e){null==e||e.mount()})).catch((function(){var e=new lm("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");sm(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy()}},{key:"_generateElementKey",value:function(e,t){try{return this.generateElementKey(e,t)}catch(r){var n=new lm({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw sm(n),n}}},{key:"_createElement",value:function(e,t){var n,r=this;om({msg:e});var o,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],om({msg:e,m1:n?1:0}),!n){var a=new lm({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw sm(a),a}try{o=new n(i,p(p({},this.config),{},{elementMode:this.elementMode,appConfig:p({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=lm.isError(a)?a:new lm({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw sm(s),s}return o._addHook("ondestroy",(function(){r._removeElement(e,t),r._getElementSize()||am("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,o,t),o}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new lm({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw sm(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),fm=function(e){y(r,e);var t,n=b(r);function r(e){var t;return v(this,r),t=n.call(this,e),l(Ze(t),"waitSendPort",[]),l(Ze(t),"mainElement",void 0),t.elementMode="GROUP",t}return f(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=nu(ou(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new lm("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw sm(i),i}this.mainElement=o;var a=new Cu(e);o.on(Yu,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort($e(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new Ru(e,s.port1);o.on(Yu,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=a(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new lm("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),sm(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(hm),mm=function(e){y(n,e);var t=b(n);function n(){return v(this,n),t.apply(this,arguments)}return f(n)}(hm);function vm(e,t){return gm.apply(this,arguments)}function gm(){return(gm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Gf("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ym(e,t){return _m.apply(this,arguments)}function _m(){return(_m=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Gf("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bm(e){return function(){var e=location.origin,t=localStorage.getItem("APP_PUBLIC_PATH");return t&&(e=t),"".concat(e,"/elements/").concat(localStorage.getItem("ANTOM_LOCAL")?"src/pages":"pages")}()+(e.startsWith("/")?e:"/".concat(e))}var Em=Lf,Sm=(h()(h()(h()({},_f),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR"}),function(e){_()(n,e);var t=E()(n);function n(){var e;g()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),c()(Xe()(e),"name","AntomSDKError"),e}return m()(n)}(bf)),Am=["paypal"],km=["createOrder","onShippingAddressChange","onShippingOptionsChange"],Tm=["local","dev","sit","pre","prod","sandbox"];function wm(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod";try{var n=window.location.search,r=window.location.hash,o=r.replace(/^#\??/,"");e=new URLSearchParams(o+(n?(o?"&":"")+n.slice(1):""))}catch(t){e=new URLSearchParams}var i="true"===e.get("_moreEnv");if(!i)return{env:t,hostSign:"",baseURL:""};var a=e.get("environment")||t,s=Tm.includes(a)?a:t;return{env:s,hostSign:e.get("hostSign")||"",baseURL:e.get("requestHost")||""}}function Pm(e,t,n){var r=new Sm(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function Im(e){var t=["paypal","applePay","googlePay","alipay"],n=null==e?void 0:e.paymentMethods;if(!Array.isArray(n)||0===n.length)return Pm("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var r,o=d()(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(!t.includes(i))return Pm("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(i),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){o.e(e)}finally{o.f()}return!n.includes("paypal")||null!=e&&e.paypal?null:Pm("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}var Cm=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o;g()(this,r);var i=t.appConfig||{},a=i.paypal,s=Fs()(i,Am),l=a||{},u=l.createOrder,d=l.onShippingAddressChange,p=l.onShippingOptionsChange,f=Fs()(l,km),m=h()(h()({},s),Object.keys(f).length>0&&{paypal:f}),v=t.locale||"en_US";return o=n.call(this,e,bm("/express_element/index.html"),h()(h()({},t),{},{appConfig:m},v?{locale:v}:{}),Jf({appearance:{displaySetting:{showCardBrandIcon:!0}}},m)),c()(Xe()(o),"_callbacks",{}),c()(Xe()(o),"_overlay",null),o._callbacks={paypalCreateOrder:u,paypalOnShippingAddressChange:d,paypalOnShippingOptionsChange:p},o}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,f,m,v,g,y,_,b,E,S,A,k,T,w,P,I;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.config.appConfig,r=null==n?void 0:n.sessionData,o=(null==n?void 0:n.locale)||"en_US",this.registerInternalListeners(),!(a=Im(n))){e.next=7;break}return e.abrupt("return",{sessionData:r,locale:o,setupError:a});case 7:if(!(Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("paypal")){e.next=43;break}return c=null==n?void 0:n.paypal,u=(null==c?void 0:c.channelMerchantAccountId)||"",d=(null==n?void 0:n.businessDivision)||"",p=(null==n||null===(s=n.amount)||void 0===s?void 0:s.currency)||"",f=(null==n||null===(l=n.amount)||void 0===l?void 0:l.value)||"",m=this.config.env||"prod",v=wm(m),g=v.env,y=v.hostSign,_=v.baseURL,b=y||("US"===d?"US":"DE"===d?"DE":"SG"),e.prev=18,am("INFO","SDK_USAGE","ExpressElement: querying PayPal channelClientId...",{channelMerchantAccountId:u,env:g,locale:o}),e.next=22,ym({clientId:u,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:d,amount:{currency:p,value:f}},{env:g,hostSign:b,baseURL:_,locale:o,timeout:1e5});case 22:if(!0!==(null==(S=e.sent)?void 0:S.success)||!S.channelClientId){e.next=26;break}return am("INFO","SDK_USAGE","ExpressElement: channelClientId resolved:",S.channelClientId),e.abrupt("return",{sessionData:r,locale:o,paypal:h()(h()({},c),{},{channelMerchantAccountId:S.channelClientId})});case 26:if(!0!==(null==S?void 0:S.success)){e.next=29;break}return am("ERROR","SDK_USAGE","ExpressElement: channelClientId missing in success response:",S),e.abrupt("return",{sessionData:r,locale:o,setupError:new Sm("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON()});case 29:return am("ERROR","SDK_USAGE","ExpressElement: channelClientId query returned non-success:",S),A=new Sm((null==S?void 0:S.errorMessage)||"channelClientId query failed",(null==S?void 0:S.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),"true"===(null==S||null===(E=S.extendInfo)||void 0===E?void 0:E.mulityLanguageMapping)&&(A.mulityLanguageMapping=!0),e.abrupt("return",{sessionData:r,locale:o,setupError:A});case 35:return e.prev=35,e.t0=e.catch(18),am("ERROR","SDK_USAGE","ExpressElement: channelClientId query exception:",e.t0),i=void 0,i="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),T={code:i?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:i?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},w=new Sm(T.message,T.code,"SDK_USAGE").toJSON(),"true"===(null===e.t0||void 0===e.t0||null===(k=e.t0.response)||void 0===k||null===(k=k.extendInfo)||void 0===k?void 0:k.mulityLanguageMapping)&&(w.mulityLanguageMapping=!0),e.abrupt("return",{sessionData:r,locale:o,setupError:w});case 43:if(r){e.next=45;break}return e.abrupt("return",{sessionData:void 0});case 45:if(am("INFO","SDK_USAGE","ExpressElement setup called with sessionData:",{sessionData:r}),P=Em(r)){e.next=49;break}return e.abrupt("return",{sessionData:r,setupError:Sm.unificationError(new Error("Failed to parse sessionData, please check the sessionData")).toJSON()});case 49:if("ELEMENT_PAYMENT"===(I=null===(t=P.paymentSessionConfig)||void 0===t?void 0:t.productScene)){e.next=52;break}return e.abrupt("return",{sessionData:r,setupError:Sm.unificationError(new Error("Invalid productScene in sessionData, expected ELEMENT_PAYMENT, but get ".concat(I,", please check the sessionData is correct?"))).toJSON()});case 52:return e.abrupt("return",{sessionData:r});case 53:case"end":return e.stop()}var i}),e,this,[[18,35]])}))),function(){return t.apply(this,arguments)})},{key:"_showOverlay",value:function(){var e=this;if(!this._overlay){var t=document.createElement("div");t.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){t.style.opacity="1"}));var n=document.createElement("button");n.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",n.innerHTML="&#x2715;",n.addEventListener("click",(function(){e._hideOverlay()}));var r=document.createElement("div");r.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var o=document.createElement("div");o.setAttribute("role","img"),o.setAttribute("aria-label","PayPal"),o.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var i=document.createElement("p");i.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",i.textContent="Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods.",r.appendChild(o),r.appendChild(i),t.appendChild(n),t.appendChild(r),document.body.appendChild(t),this._overlay=t}}},{key:"_hideOverlay",value:function(){this._overlay&&(this._overlay.remove(),this._overlay=null)}},{key:"registerInternalListeners",value:function(){var e=this,t=this.iframe;t&&(t.style.opacity="0",t.style.transition="height 0.35s, opacity 0.4s 0.1s",t.style.height="0px",t.style.width="100%",t.style.display="block");var n=!1;this.on("contentHeightChanged",(function(t){var r=e.iframe;r&&(null==t?void 0:t.height)>0&&(r.style.height="".concat(t.height,"px"),n||(n=!0,requestAnimationFrame((function(){r.style.opacity="1"}))))})),this.on("click",(function(t){e._showOverlay(),am("INFO","SDK_USAGE","ExpressElement click:",t)})),this.on("ready",(function(e){am("INFO","SDK_USAGE","ExpressElement ready:",e)})),this.on("confirm",(function(t){e._hideOverlay(),am("INFO","SDK_USAGE","ExpressElement confirm:",t)})),this.on("error",(function(t){e._hideOverlay(),am("ERROR","SDK_USAGE","ExpressElement payment error:",t)})),this.on("cancel",(function(t){e._hideOverlay(),am("INFO","SDK_USAGE","ExpressElement cancel:",t)})),this.on("paypal:createOrder",function(){var t=s()(i()().mark((function t(n){var r,o;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.requestId,t.prev=1,e._callbacks.paypalCreateOrder){t.next=4;break}throw new Error("paypal.createOrder is not provided");case 4:return t.next=6,e._callbacks.paypalCreateOrder();case 6:o=t.sent,e.send("paypal:createOrder:reply",{requestId:r,sessionData:o}),am("INFO","SDK_USAGE","PayPal createOrder success:",{requestId:r,sessionData:o}),t.next=16;break;case 11:t.prev=11,t.t0=t.catch(1),e.send("paypal:createOrder:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"createOrder failed"}),e._hideOverlay(),am("ERROR","SDK_USAGE","PayPal createOrder failed:",t.t0);case 16:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}()),this.on("paypal:onShippingAddressChange",function(){var t=s()(i()().mark((function t(n){var r,o,a,s;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.requestId,o=n.shippingData,t.prev=1,t.next=4,null===(a=(s=e._callbacks).paypalOnShippingAddressChange)||void 0===a?void 0:a.call(s,o,{});case 4:e.send("paypal:onShippingAddressChange:reply",{requestId:r}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),e.send("paypal:onShippingAddressChange:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"onShippingAddressChange failed"});case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}()),this.on("paypal:onShippingOptionsChange",function(){var t=s()(i()().mark((function t(n){var r,o,a,s;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.requestId,o=n.shippingData,t.prev=1,t.next=4,null===(a=(s=e._callbacks).paypalOnShippingOptionsChange)||void 0===a?void 0:a.call(s,o,{});case 4:e.send("paypal:onShippingOptionsChange:reply",{requestId:r}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),e.send("paypal:onShippingOptionsChange:reply",{requestId:r,error:(null===t.t0||void 0===t.t0?void 0:t.t0.message)||"onShippingOptionsChange failed"});case 10:case"end":return t.stop()}}),t,null,[[1,7]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(pm);c()(Cm,"elementType","express");function Rm(){var e=window.localStorage.getItem("ANTOM_ENV")||"dev",t=window.localStorage.getItem("ANTOM_BASE_URL")||void 0,n=window.localStorage.getItem("ANTOM_GROUP_ID")||void 0,r=JSON.parse(JSON.stringify({baseURL:t,group:n,env:e}));return console.log("[getDevReqConfig] dev request config:",r),r}function Nm(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=d()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var Om=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o,i;g()(this,r);var a,s,l;(td.setTrackId(Df(t.appConfig.sessionData)),a=Df(t.appConfig.sessionData),Qf.setTrackId(a),i=n.call(this,e,bm("/vaulting/index.html"),t,Jf({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default"}},t.appConfig)),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&Gf.setGlobalOptions({hostSign:(l=null===(s=t.appConfig)||void 0===s?void 0:s.sessionData,l.split("&&")[1]||"SG")});return i}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData){e.next=3;break}throw new Sm("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");case 3:if(am("INFO","SDK_USAGE","VaultingElement setup called with sessionData:",{sessionData:s}),l=Em(s)){e.next=7;break}throw new Sm("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");case 7:if("ELEMENT_VAULT"===(c=null===(n=l.paymentSessionConfig)||void 0===n?void 0:n.productScene)){e.next=10;break}throw new Sm("Invalid productScene in sessionData, expected ELEMENT_VAULT, but get ".concat(c,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");case 10:return e.next=12,vm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:l.paymentSessionConfig,paymentSessionData:s}).then((function(e){return{data:e,error:void 0}})).catch((function(e){return{error:Sm.unificationError(e),data:void 0}}));case 12:return u=e.sent,d=Nm(u.data),ff(p=d||(null===(r=this.config.appConfig)||void 0===r?void 0:r.locale)||this.config.locale),e.abrupt("return",{sessionData:s,renderData:u.data,renderDataError:null===(o=u.error)||void 0===o?void 0:o.toJSON(),sdkVersion:"0.0.1777017092-dev.2",paymentSessionConfig:l.paymentSessionConfig,locale:p,merchantId:(null===(a=u.data)||void 0===a?void 0:a.merchantId)||"未请求到,请求失败了",_requestConfig:h()({env:this.config.env},Rm())});case 17:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(pm);c()(Om,"elementType","vaulting");var Lm=function(e){_()(n,e);var t=E()(n);function n(e){return g()(this,n),t.call(this,e)}return m()(n,[{key:"canUseElements",value:function(){return[Om,Cm]}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}}]),n}(fm),Dm=function(e){_()(r,e);var t,n=E()(r);function r(e,t){var o;g()(this,r);return(o=n.call(this,e,bm("/element_payment_modern/index.html"),t,Jf({appearance:{theme:"default"}},t.appConfig))).on("destroy",(function(){o.destroy()})),o}return m()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"0.0.1777017092-dev.2",_requestConfig:h()({env:this.config.env},Rm())}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(pm);c()(Dm,"elementType","CVV");var Mm="ams-popup",xm=300,Um="ams-component-popup-loading",Bm="\n .".concat(Mm,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Mm,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Mm,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Mm,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(xm,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Mm,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(xm,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Mm,"-drawer-enter {\n animation: slideIn ").concat(xm,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Mm,"-drawer-exit {\n animation: slideOut ").concat(xm,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),Km=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(Um),n.id=Um,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Nf?t:100*n/e;return Math.min(r,t)}(),"px"),n};var Hm=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,a=void 0===o||o,l=e.hideCloseWhenLoaded,c=void 0===l||l,u=e.onClose,d=e.textDirection,p=void 0===d?"ltr":d,h=e.showLoading,f=void 0===h||h,m=document.createElement("div");m.classList.add("".concat(Mm,"overlay"),"".concat(Mm,"fadeIn"));var v=document.createElement("div");"desktop"===t?(v.classList.add("".concat(Mm,"modal"),"".concat(Mm,"fadeIn")),v.style.width="656px",v.style.height="620px",v.style.borderRadius="12px"):(v.classList.add("".concat(Mm,"modal-mobile"),"".concat(Mm,"-drawer-enter")),v.style.width="100%",v.style.height="80vh",v.style.borderRadius="12px 12px 0 0"),v.setAttribute("dir",p);var g=function(e,t,n){return function(){t&&(t.classList.remove("".concat(Mm,"fadeIn")),t.classList.add("".concat(Mm,"fadeOut")),"desktop"===e?(n.classList.remove("".concat(Mm,"fadeIn")),n.classList.add("".concat(Mm,"fadeOut"))):(n.classList.remove("".concat(Mm,"-drawer-enter")),n.classList.add("".concat(Mm,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),xm))}}(t,m,v),y=document.createElement("iframe");y.src=n,y.style.border="none",y.style.width="100%",y.style.height="100%";var _,b=r||{},E=b.theme,S=void 0===E?"light":E,A=b.backgroundColor,k=void 0===A?"#ffffff":A,T=Km(S);if(y.addEventListener("load",(function e(){v.removeChild(T),y.removeEventListener("load",e)})),a){var w=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(_=!1,s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_){e.next=2;break}return e.abrupt("return");case 2:return null===(t=T.parentNode)||void 0===t||t.removeChild(T),v.removeChild(y),n=Km(S,hf.get({defaultMessage:"closing",id:"antom.common.closing"})),v.appendChild(n),_=!0,e.prev=7,e.next=10,null==u?void 0:u();case 10:return e.prev=10,_=!1,e.finish(10);case 13:g();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:p});c&&y.addEventListener("load",(function e(){v.removeChild(w),y.removeEventListener("load",e)})),v.appendChild(w)}if(f){v.style.backgroundColor=k,y.style.backgroundColor=k;y.addEventListener("load",(function e(){var t;null===(t=T.parentNode)||void 0===t||t.removeChild(T),y.removeEventListener("load",e)})),v.appendChild(T)}v.appendChild(y);var P,I=document.getElementsByTagName("body")[0];return(P=document.createElement("style")).innerHTML=Bm,document.head.appendChild(P),I.appendChild(m),I.appendChild(v),{iframe:y,destroy:g}};var Ym=n(817),Fm=n.n(Ym),jm={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#141935"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#070b29"},cherryBlossomPink:{theme:"light",backgroundColor:"#FFFCFD"}},zm={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"0.0.1777017092-dev.2",trackerCode:"7982"},Gm=function(e){_()(a,e);var t,n,r,o=E()(a);function a(e){var t,n,r;return g()(this,a),t=o.call(this,Jf(zm,e)),td.initTracker(),Gf.setGlobalOptions(h()(h()({env:t.config.env},Rm()),{},{sdkVersion:t.config.version,tracker:td,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=Fm(),r=null==e?void 0:e.locale,hf.initData(n),r&&ff(r),t}return m()(a,[{key:"canUseElements",value:function(){return[Om,Dm,Cm]}},{key:"updateConfig",value:function(e){e.env&&Gf.setGlobalOptions({env:e.env}),e.locale&&(Gf.setGlobalOptions({envInfo:{locale:e.locale}}),ff(e.locale)),ru()(iu()(a.prototype),"updateConfig",this).call(this,e)}},{key:"openModal",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",s=null!==(r=jm[a])&&void 0!==r?r:jm.default,l=Hm(h()(h()({},t),{},{loadingConfig:h()(h()({},t.loadingConfig),{},{theme:s.theme,backgroundColor:(null==t||null===(o=t.appearance)||void 0===o||null===(o=o.variables)||void 0===o?void 0:o["background-primary"])||s.backgroundColor})})),c=l.iframe,u=l.destroy,d=function e(){am("ERROR","SDK_INTERNAL","modal load error"+t.url),c.removeEventListener("error",e),u()},c.addEventListener("error",d),e.abrupt("return",{destroy:u,onLoadedSuccess:function(e){c.addEventListener("load",(function(){e()}))},getContentWindow:function(){return c.contentWindow}});case 6:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"elements",value:function(){return new Lm(this.config)}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}},{key:"extractMainElement",value:function(e){if(e instanceof fm){var t=e._mainElement;if(!t)throw new Sm("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof pm)return e;throw new Sm("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=Sm.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmPayment",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=10;break}return e.prev=1,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({sessionData:t.sessionData,redirect:t.redirect||"always"}));case 6:return e.prev=6,e.t0=e.catch(1),r=Sm.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,userCanceled3D:!1,status:"FAIL",error:{code:r.code,message:r.message}});case 10:return(o=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance})).mount(document.body),e.prev=12,e.next=15,new Promise((function(e,t){var n=setTimeout((function(){t(new Sm("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);o.on(Yu,(function(){clearTimeout(n),e()}))}));case 15:e.next=23;break;case 17:return e.prev=17,e.t1=e.catch(12),o.unmount(),a=Sm.unificationError(e.t1),s=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:a.code,message:a.message,status:s.includes(a.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:a.code,message:a.message}});case 23:return e.abrupt("return",o.submit({sessionData:t.sessionData,redirect:t.redirect||"always"}));case 24:case"end":return e.stop()}}),e,this,[[1,6],[12,17]])}))),function(e){return t.apply(this,arguments)})}]),a}(mm);c()(Gm,"version","0.0.1777017092-dev.2");var Vm,Wm,qm=["env","environment"],Jm=function(){var e=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).env,o=n.environment,a=Fs()(n,qm),s=r||o||"prod",e.abrupt("return",(0,tu.createSingletonInstance)(Gm,h()(h()({},a),{},{env:s}),"AntomSDK"));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(Wm=["CDN","NPM"]).includes(Vm="CDN")&&"undefined"!=typeof window&&(Wm.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=Vm,eu.setMedta({integrationType:Vm})));var Qm=Gc}(),r}()}));