@zonos/elements 1.3.278 → 1.3.280
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-e8bc11a3.js → cart-0fa312a5.js} +1 -1
- package/dist/cjs/{collect-e6485168.js → collect-f9c4ca7c.js} +2 -2
- package/dist/cjs/formatStringWithLinks-c25b4018.js +24 -0
- package/dist/cjs/{hasInclusivePrice-798ce42d.js → hasInclusivePrice-95431bca.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-dff7ec81.js → invoice-ce757565.js} +2 -2
- package/dist/cjs/isSameHostCheckoutLink-6148cabb.js +28 -0
- package/dist/cjs/{localization-90650d7d.js → localization-7fded969.js} +40 -40
- package/dist/cjs/{paypal-77bd640c.js → paypal-57ab3ab6.js} +2 -2
- package/dist/cjs/{placeTestOrder-7767d119.js → placeTestOrder-35e0d3bd.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-66377cf5.js → renderCheckoutCurrency-41d48407.js} +2 -2
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +19 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +189 -13
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +13 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +36 -2
- package/dist/collection/components/store/translationStore/strings.arabic.js +2 -2
- package/dist/collection/components/store/translationStore/strings.base.js +2 -2
- package/dist/collection/components/store/translationStore/strings.chinese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.danish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.dutch.js +2 -2
- package/dist/collection/components/store/translationStore/strings.french.js +2 -2
- package/dist/collection/components/store/translationStore/strings.german.js +2 -2
- package/dist/collection/components/store/translationStore/strings.hebrew.js +2 -2
- package/dist/collection/components/store/translationStore/strings.indonesian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.italian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.japanese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.korean.js +2 -2
- package/dist/collection/components/store/translationStore/strings.norwegian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.polish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.portuguese.js +2 -2
- package/dist/collection/components/store/translationStore/strings.russian.js +2 -2
- package/dist/collection/components/store/translationStore/strings.spanish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.swedish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.turkish.js +2 -2
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +2 -2
- package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +6 -1
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +144 -7
- package/dist/collection/components/utils/formatStringWithLinks.js +12 -6
- package/dist/collection/components/utils/isSameHostCheckoutLink.js +24 -0
- package/dist/collection/types/generated/graphql.internal.types.js +84 -0
- package/dist/esm/{cart-8b8dc79f.js → cart-4699e6ab.js} +2 -2
- package/dist/esm/{collect-f4965586.js → collect-24cc2e12.js} +2 -2
- package/dist/esm/formatStringWithLinks-0d48f183.js +22 -0
- package/dist/esm/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-b7a1fb14.js → invoice-575dc93d.js} +2 -2
- package/dist/esm/isSameHostCheckoutLink-c1b88ab7.js +26 -0
- package/dist/esm/{localization-d49867ed.js → localization-da2f407f.js} +40 -40
- package/dist/esm/{paypal-da551105.js → paypal-d4436abd.js} +2 -2
- package/dist/esm/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +2 -2
- package/dist/esm/zonos-address-display_8.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +2 -2
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +19 -7
- package/dist/esm/zonos-checkout.entry.js +189 -13
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +3 -2
- package/dist/esm/zonos-hello-dialog.entry.js +4 -3
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
- package/dist/esm-es5/{cart-8b8dc79f.js → cart-4699e6ab.js} +1 -1
- package/dist/esm-es5/{collect-f4965586.js → collect-24cc2e12.js} +1 -1
- package/dist/esm-es5/formatStringWithLinks-0d48f183.js +1 -0
- package/dist/esm-es5/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-b7a1fb14.js → invoice-575dc93d.js} +1 -1
- package/dist/esm-es5/isSameHostCheckoutLink-c1b88ab7.js +1 -0
- package/dist/esm-es5/localization-da2f407f.js +1 -0
- package/dist/esm-es5/{paypal-da551105.js → paypal-d4436abd.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.base.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.danish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.french.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.german.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.italian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.korean.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.polish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.russian.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +1 -1
- package/dist/types/components/utils/isSameHostCheckoutLink.d.ts +14 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +84 -0
- package/dist/types/types/generated/graphql.internal.types.ts +85 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-02065a08.system.js → p-016b5bde.system.js} +1 -1
- package/dist/zonos-elements/{p-6fae9835.system.entry.js → p-0adab1d5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0d2f81ce.system.js +1 -0
- package/dist/zonos-elements/p-11206fe2.js +1 -0
- package/dist/zonos-elements/{p-0402af0d.entry.js → p-12452213.entry.js} +1 -1
- package/dist/zonos-elements/{p-5827c868.entry.js → p-19f4e77a.entry.js} +1 -1
- package/dist/zonos-elements/{p-2aecc055.entry.js → p-1bb85ff1.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c76ef2a.js → p-275fa2da.js} +1 -1
- package/dist/zonos-elements/{p-8b42245d.entry.js → p-28b1c189.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/p-2b97f7ed.js +1 -0
- package/dist/zonos-elements/{p-647438d6.system.js → p-2dbdf883.system.js} +1 -1
- package/dist/zonos-elements/{p-5afea02c.system.entry.js → p-3068247c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7614ea6f.system.entry.js → p-362215b6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-39e2642f.js +1 -0
- package/dist/zonos-elements/p-3f8f4c78.js +1 -0
- package/dist/zonos-elements/{p-d5945ddc.entry.js → p-3f90cb36.entry.js} +1 -1
- package/dist/zonos-elements/{p-bf0148ae.system.js → p-40a0c1d3.system.js} +1 -1
- package/dist/zonos-elements/{p-abf61f6f.system.entry.js → p-43a14674.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d7cb9ef6.system.entry.js → p-46f88c11.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-998f9df5.system.entry.js → p-564c7bb5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5b54f10c.entry.js +1 -0
- package/dist/zonos-elements/p-6197aa73.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b36205f4.entry.js → p-6451537c.entry.js} +1 -1
- package/dist/zonos-elements/p-65fe75e1.entry.js +1 -0
- package/dist/zonos-elements/{p-5bc43687.system.entry.js → p-66223935.system.entry.js} +1 -1
- package/dist/zonos-elements/p-67426156.system.js +1 -0
- package/dist/zonos-elements/{p-2654556b.js → p-67b2e46c.js} +1 -1
- package/dist/zonos-elements/p-6bea1787.entry.js +1 -0
- package/dist/zonos-elements/{p-cd41b16b.system.entry.js → p-7237ec6f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0745e440.entry.js → p-72c1bd64.entry.js} +1 -1
- package/dist/zonos-elements/p-75da4ba0.entry.js +1 -0
- package/dist/zonos-elements/{p-3f380c8f.system.js → p-788a16bb.system.js} +1 -1
- package/dist/zonos-elements/p-79b6070a.js +1 -0
- package/dist/zonos-elements/{p-77fa437c.entry.js → p-807e7ebc.entry.js} +1 -1
- package/dist/zonos-elements/{p-43815edd.system.entry.js → p-81c4f04a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8bd37d3b.entry.js → p-85796e67.entry.js} +1 -1
- package/dist/zonos-elements/p-94329e56.js +1 -0
- package/dist/zonos-elements/{p-ed676ad1.system.entry.js → p-944148db.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a8c79850.js → p-96e7b465.js} +1 -1
- package/dist/zonos-elements/{p-32278945.system.js → p-a30f03d6.system.js} +1 -1
- package/dist/zonos-elements/{p-ac59f5c1.system.entry.js → p-a5afcea1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-293183c1.system.entry.js → p-a7f0e824.system.entry.js} +1 -1
- package/dist/zonos-elements/p-aff7112b.entry.js +1 -0
- package/dist/zonos-elements/p-b05da593.system.entry.js +1 -0
- package/dist/zonos-elements/p-b330e451.system.js +1 -0
- package/dist/zonos-elements/{p-12a08423.system.entry.js → p-b6049eef.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b6cd6e62.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7365e22c.system.js → p-b8c019b9.system.js} +1 -1
- package/dist/zonos-elements/p-c2014d57.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ee434a71.entry.js → p-c4a479ad.entry.js} +1 -1
- package/dist/zonos-elements/{p-4e6e9a3c.system.entry.js → p-cf0c8c77.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f44a3338.entry.js → p-db9cb522.entry.js} +1 -1
- package/dist/zonos-elements/{p-9beb2624.entry.js → p-dbd5be5d.entry.js} +1 -1
- package/dist/zonos-elements/p-dff1d3be.entry.js +1 -0
- package/dist/zonos-elements/{p-7e8aba66.system.entry.js → p-ec53c436.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-74ebd766.js → p-f3759c70.js} +1 -1
- package/dist/zonos-elements/{p-5e09c22d.system.js → p-f55a2352.system.js} +1 -1
- package/dist/zonos-elements/{p-8d87e748.entry.js → p-fc2d5dd9.entry.js} +1 -1
- package/dist/zonos-elements/p-fd2d4d04.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/formatStringWithLinks-52341fc7.js +0 -17
- package/dist/esm/formatStringWithLinks-9e819405.js +0 -15
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +0 -1
- package/dist/esm-es5/localization-d49867ed.js +0 -1
- package/dist/zonos-elements/p-21d925d7.entry.js +0 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +0 -1
- package/dist/zonos-elements/p-32704baa.js +0 -1
- package/dist/zonos-elements/p-3cf22558.entry.js +0 -1
- package/dist/zonos-elements/p-45e1c33b.entry.js +0 -1
- package/dist/zonos-elements/p-5d3ea491.system.entry.js +0 -1
- package/dist/zonos-elements/p-6b4ef7e0.entry.js +0 -1
- package/dist/zonos-elements/p-73d3fa61.entry.js +0 -1
- package/dist/zonos-elements/p-7522ec43.js +0 -1
- package/dist/zonos-elements/p-9fab45aa.system.js +0 -1
- package/dist/zonos-elements/p-a87561b8.js +0 -1
- package/dist/zonos-elements/p-c209e36d.js +0 -1
- package/dist/zonos-elements/p-d7bda14d.js +0 -1
- package/dist/zonos-elements/p-d93991c3.system.entry.js +0 -1
- package/dist/zonos-elements/p-e6165cc2.system.js +0 -1
- package/dist/zonos-elements/p-eb9369b9.system.entry.js +0 -1
- package/dist/zonos-elements/p-f3a73132.entry.js +0 -1
- package/dist/zonos-elements/p-ffbf87c8.system.entry.js +0 -1
|
@@ -77,6 +77,7 @@ export const accountingFeeType = {
|
|
|
77
77
|
Adjustment: 'ADJUSTMENT',
|
|
78
78
|
Advancement: 'ADVANCEMENT',
|
|
79
79
|
AirlineRecoveryFee: 'AIRLINE_RECOVERY_FEE',
|
|
80
|
+
AirwallexTransferFee: 'AIRWALLEX_TRANSFER_FEE',
|
|
80
81
|
AnnualPlatformFee: 'ANNUAL_PLATFORM_FEE',
|
|
81
82
|
ApiCrossDocking: 'API_CROSS_DOCKING',
|
|
82
83
|
ApiGuaranteeOrder: 'API_GUARANTEE_ORDER',
|
|
@@ -167,6 +168,9 @@ export const accountingFeeType = {
|
|
|
167
168
|
CyprusPrepayFee: 'CYPRUS_PREPAY_FEE',
|
|
168
169
|
CyprusPrepayPercent: 'CYPRUS_PREPAY_PERCENT',
|
|
169
170
|
CyprusPrepayPhotoDiscount: 'CYPRUS_PREPAY_PHOTO_DISCOUNT',
|
|
171
|
+
CzechDisbursementFee: 'CZECH_DISBURSEMENT_FEE',
|
|
172
|
+
CzechGuaranteeOrder: 'CZECH_GUARANTEE_ORDER',
|
|
173
|
+
CzechRemittanceFee: 'CZECH_REMITTANCE_FEE',
|
|
170
174
|
DashboardLite: 'DASHBOARD_LITE',
|
|
171
175
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
172
176
|
DdpServiceFeeBuffer: 'DDP_SERVICE_FEE_BUFFER',
|
|
@@ -179,7 +183,43 @@ export const accountingFeeType = {
|
|
|
179
183
|
DutyBrokerageUs: 'DUTY_BROKERAGE_US',
|
|
180
184
|
DutyFx: 'DUTY_FX',
|
|
181
185
|
DutyRemittance: 'DUTY_REMITTANCE',
|
|
186
|
+
DutyRemittanceAt: 'DUTY_REMITTANCE_AT',
|
|
187
|
+
DutyRemittanceAx: 'DUTY_REMITTANCE_AX',
|
|
188
|
+
DutyRemittanceBe: 'DUTY_REMITTANCE_BE',
|
|
189
|
+
DutyRemittanceBg: 'DUTY_REMITTANCE_BG',
|
|
190
|
+
DutyRemittanceCy: 'DUTY_REMITTANCE_CY',
|
|
191
|
+
DutyRemittanceCz: 'DUTY_REMITTANCE_CZ',
|
|
192
|
+
DutyRemittanceDe: 'DUTY_REMITTANCE_DE',
|
|
193
|
+
DutyRemittanceDk: 'DUTY_REMITTANCE_DK',
|
|
194
|
+
DutyRemittanceEe: 'DUTY_REMITTANCE_EE',
|
|
195
|
+
DutyRemittanceEs: 'DUTY_REMITTANCE_ES',
|
|
196
|
+
DutyRemittanceFi: 'DUTY_REMITTANCE_FI',
|
|
197
|
+
DutyRemittanceFr: 'DUTY_REMITTANCE_FR',
|
|
198
|
+
DutyRemittanceGb: 'DUTY_REMITTANCE_GB',
|
|
199
|
+
DutyRemittanceGf: 'DUTY_REMITTANCE_GF',
|
|
200
|
+
DutyRemittanceGp: 'DUTY_REMITTANCE_GP',
|
|
201
|
+
DutyRemittanceGr: 'DUTY_REMITTANCE_GR',
|
|
202
|
+
DutyRemittanceHr: 'DUTY_REMITTANCE_HR',
|
|
203
|
+
DutyRemittanceHu: 'DUTY_REMITTANCE_HU',
|
|
204
|
+
DutyRemittanceIc: 'DUTY_REMITTANCE_IC',
|
|
205
|
+
DutyRemittanceIe: 'DUTY_REMITTANCE_IE',
|
|
206
|
+
DutyRemittanceIt: 'DUTY_REMITTANCE_IT',
|
|
207
|
+
DutyRemittanceLt: 'DUTY_REMITTANCE_LT',
|
|
208
|
+
DutyRemittanceLu: 'DUTY_REMITTANCE_LU',
|
|
209
|
+
DutyRemittanceLv: 'DUTY_REMITTANCE_LV',
|
|
210
|
+
DutyRemittanceMc: 'DUTY_REMITTANCE_MC',
|
|
211
|
+
DutyRemittanceMq: 'DUTY_REMITTANCE_MQ',
|
|
212
|
+
DutyRemittanceMt: 'DUTY_REMITTANCE_MT',
|
|
213
|
+
DutyRemittanceNl: 'DUTY_REMITTANCE_NL',
|
|
214
|
+
DutyRemittancePl: 'DUTY_REMITTANCE_PL',
|
|
215
|
+
DutyRemittancePt: 'DUTY_REMITTANCE_PT',
|
|
216
|
+
DutyRemittanceRe: 'DUTY_REMITTANCE_RE',
|
|
217
|
+
DutyRemittanceRo: 'DUTY_REMITTANCE_RO',
|
|
218
|
+
DutyRemittanceSe: 'DUTY_REMITTANCE_SE',
|
|
219
|
+
DutyRemittanceSi: 'DUTY_REMITTANCE_SI',
|
|
220
|
+
DutyRemittanceSk: 'DUTY_REMITTANCE_SK',
|
|
182
221
|
DutyRemittanceUs: 'DUTY_REMITTANCE_US',
|
|
222
|
+
DutyRemittanceYt: 'DUTY_REMITTANCE_YT',
|
|
183
223
|
DutyTax: 'DUTY_TAX',
|
|
184
224
|
DutyTaxBuffer: 'DUTY_TAX_BUFFER',
|
|
185
225
|
DutyTaxFee: 'DUTY_TAX_FEE',
|
|
@@ -212,9 +252,11 @@ export const accountingFeeType = {
|
|
|
212
252
|
IsraelRemittanceFee: 'ISRAEL_REMITTANCE_FEE',
|
|
213
253
|
ItalianeRemittanceFee: 'ITALIANE_REMITTANCE_FEE',
|
|
214
254
|
Item: 'ITEM',
|
|
255
|
+
JapanDisbursementFee: 'JAPAN_DISBURSEMENT_FEE',
|
|
215
256
|
JapanPrepayFee: 'JAPAN_PREPAY_FEE',
|
|
216
257
|
JapanPrepayPercent: 'JAPAN_PREPAY_PERCENT',
|
|
217
258
|
JapanPrepayPhotoDiscount: 'JAPAN_PREPAY_PHOTO_DISCOUNT',
|
|
259
|
+
JapanRemittanceFee: 'JAPAN_REMITTANCE_FEE',
|
|
218
260
|
KazpostDisbursementFee: 'KAZPOST_DISBURSEMENT_FEE',
|
|
219
261
|
KazpostPrepayFee: 'KAZPOST_PREPAY_FEE',
|
|
220
262
|
KazpostPrepayPercent: 'KAZPOST_PREPAY_PERCENT',
|
|
@@ -3204,6 +3246,7 @@ export const epaDisclaimCode = {
|
|
|
3204
3246
|
|
|
3205
3247
|
export type EpaDisclaimCode =
|
|
3206
3248
|
(typeof epaDisclaimCode)[keyof typeof epaDisclaimCode];
|
|
3249
|
+
|
|
3207
3250
|
export const epaProgram = {
|
|
3208
3251
|
Hfc: 'HFC',
|
|
3209
3252
|
Ods: 'ODS',
|
|
@@ -3811,6 +3854,7 @@ export const invoiceDetailCategoryInputType = {
|
|
|
3811
3854
|
Adjustment: 'ADJUSTMENT',
|
|
3812
3855
|
Advancement: 'ADVANCEMENT',
|
|
3813
3856
|
AirlineRecoveryFee: 'AIRLINE_RECOVERY_FEE',
|
|
3857
|
+
AirwallexTransferFee: 'AIRWALLEX_TRANSFER_FEE',
|
|
3814
3858
|
AnnualPlatformFee: 'ANNUAL_PLATFORM_FEE',
|
|
3815
3859
|
ApiAnnualFlat: 'API_ANNUAL_FLAT',
|
|
3816
3860
|
ApiAnnualMonthlyFlat: 'API_ANNUAL_MONTHLY_FLAT',
|
|
@@ -3915,6 +3959,9 @@ export const invoiceDetailCategoryInputType = {
|
|
|
3915
3959
|
CyprusPrepayPercent: 'CYPRUS_PREPAY_PERCENT',
|
|
3916
3960
|
CyprusPrepayPhotoDiscount: 'CYPRUS_PREPAY_PHOTO_DISCOUNT',
|
|
3917
3961
|
CyprusRemittanceFee: 'CYPRUS_REMITTANCE_FEE',
|
|
3962
|
+
CzechDisbursementFee: 'CZECH_DISBURSEMENT_FEE',
|
|
3963
|
+
CzechGuaranteeOrder: 'CZECH_GUARANTEE_ORDER',
|
|
3964
|
+
CzechRemittanceFee: 'CZECH_REMITTANCE_FEE',
|
|
3918
3965
|
DashboardLite: 'DASHBOARD_LITE',
|
|
3919
3966
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
3920
3967
|
DdpServiceFeeBuffer: 'DDP_SERVICE_FEE_BUFFER',
|
|
@@ -3927,7 +3974,43 @@ export const invoiceDetailCategoryInputType = {
|
|
|
3927
3974
|
DutyBrokerageUs: 'DUTY_BROKERAGE_US',
|
|
3928
3975
|
DutyFx: 'DUTY_FX',
|
|
3929
3976
|
DutyRemittance: 'DUTY_REMITTANCE',
|
|
3977
|
+
DutyRemittanceAt: 'DUTY_REMITTANCE_AT',
|
|
3978
|
+
DutyRemittanceAx: 'DUTY_REMITTANCE_AX',
|
|
3979
|
+
DutyRemittanceBe: 'DUTY_REMITTANCE_BE',
|
|
3980
|
+
DutyRemittanceBg: 'DUTY_REMITTANCE_BG',
|
|
3981
|
+
DutyRemittanceCy: 'DUTY_REMITTANCE_CY',
|
|
3982
|
+
DutyRemittanceCz: 'DUTY_REMITTANCE_CZ',
|
|
3983
|
+
DutyRemittanceDe: 'DUTY_REMITTANCE_DE',
|
|
3984
|
+
DutyRemittanceDk: 'DUTY_REMITTANCE_DK',
|
|
3985
|
+
DutyRemittanceEe: 'DUTY_REMITTANCE_EE',
|
|
3986
|
+
DutyRemittanceEs: 'DUTY_REMITTANCE_ES',
|
|
3987
|
+
DutyRemittanceFi: 'DUTY_REMITTANCE_FI',
|
|
3988
|
+
DutyRemittanceFr: 'DUTY_REMITTANCE_FR',
|
|
3989
|
+
DutyRemittanceGb: 'DUTY_REMITTANCE_GB',
|
|
3990
|
+
DutyRemittanceGf: 'DUTY_REMITTANCE_GF',
|
|
3991
|
+
DutyRemittanceGp: 'DUTY_REMITTANCE_GP',
|
|
3992
|
+
DutyRemittanceGr: 'DUTY_REMITTANCE_GR',
|
|
3993
|
+
DutyRemittanceHr: 'DUTY_REMITTANCE_HR',
|
|
3994
|
+
DutyRemittanceHu: 'DUTY_REMITTANCE_HU',
|
|
3995
|
+
DutyRemittanceIc: 'DUTY_REMITTANCE_IC',
|
|
3996
|
+
DutyRemittanceIe: 'DUTY_REMITTANCE_IE',
|
|
3997
|
+
DutyRemittanceIt: 'DUTY_REMITTANCE_IT',
|
|
3998
|
+
DutyRemittanceLt: 'DUTY_REMITTANCE_LT',
|
|
3999
|
+
DutyRemittanceLu: 'DUTY_REMITTANCE_LU',
|
|
4000
|
+
DutyRemittanceLv: 'DUTY_REMITTANCE_LV',
|
|
4001
|
+
DutyRemittanceMc: 'DUTY_REMITTANCE_MC',
|
|
4002
|
+
DutyRemittanceMq: 'DUTY_REMITTANCE_MQ',
|
|
4003
|
+
DutyRemittanceMt: 'DUTY_REMITTANCE_MT',
|
|
4004
|
+
DutyRemittanceNl: 'DUTY_REMITTANCE_NL',
|
|
4005
|
+
DutyRemittancePl: 'DUTY_REMITTANCE_PL',
|
|
4006
|
+
DutyRemittancePt: 'DUTY_REMITTANCE_PT',
|
|
4007
|
+
DutyRemittanceRe: 'DUTY_REMITTANCE_RE',
|
|
4008
|
+
DutyRemittanceRo: 'DUTY_REMITTANCE_RO',
|
|
4009
|
+
DutyRemittanceSe: 'DUTY_REMITTANCE_SE',
|
|
4010
|
+
DutyRemittanceSi: 'DUTY_REMITTANCE_SI',
|
|
4011
|
+
DutyRemittanceSk: 'DUTY_REMITTANCE_SK',
|
|
3930
4012
|
DutyRemittanceUs: 'DUTY_REMITTANCE_US',
|
|
4013
|
+
DutyRemittanceYt: 'DUTY_REMITTANCE_YT',
|
|
3931
4014
|
DutyTaxBuffer: 'DUTY_TAX_BUFFER',
|
|
3932
4015
|
DutyTaxFee: 'DUTY_TAX_FEE',
|
|
3933
4016
|
EmiratesDisbursementFee: 'EMIRATES_DISBURSEMENT_FEE',
|
|
@@ -3956,9 +4039,11 @@ export const invoiceDetailCategoryInputType = {
|
|
|
3956
4039
|
IsraelRemittanceFee: 'ISRAEL_REMITTANCE_FEE',
|
|
3957
4040
|
ItalianeRemittanceFee: 'ITALIANE_REMITTANCE_FEE',
|
|
3958
4041
|
Item: 'ITEM',
|
|
4042
|
+
JapanDisbursementFee: 'JAPAN_DISBURSEMENT_FEE',
|
|
3959
4043
|
JapanPrepayFee: 'JAPAN_PREPAY_FEE',
|
|
3960
4044
|
JapanPrepayPercent: 'JAPAN_PREPAY_PERCENT',
|
|
3961
4045
|
JapanPrepayPhotoDiscount: 'JAPAN_PREPAY_PHOTO_DISCOUNT',
|
|
4046
|
+
JapanRemittanceFee: 'JAPAN_REMITTANCE_FEE',
|
|
3962
4047
|
KazpostDisbursementFee: 'KAZPOST_DISBURSEMENT_FEE',
|
|
3963
4048
|
KazpostPrepayFee: 'KAZPOST_PREPAY_FEE',
|
|
3964
4049
|
KazpostPrepayPercent: 'KAZPOST_PREPAY_PERCENT',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as v}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],h="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.278.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=e=>(null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b),I=Promise.resolve().then((()=>(()=>{var e,n;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(n=window.Zonos)||void 0===n?void 0:n.buildCartDetail))})()?N(null):null));let k=!1;I.catch((e=>{k||console.warn(e)}));const R=async({cartId:e,retries:n})=>{const t=i(),s=o(),d=p()||void 0,c=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&c.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${c.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:d,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),R({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const $=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),Z=Date.now(),A="https://v1.3.278.js.zonos.com",L=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.278",U="https://fonts.googleapis.com",C=/^https:\/\/fonts\.googleapis\.com/;class E{}T=E,E.doneInit=!1,E.cartSettings=null,E.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),E.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),E._paypalMockResponse=null,E.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,E.isBigCommerce=!1,E.releaseDate="1783025257357",E.isLegacyCheckout=!1,E.googleAnalyticId=null,E.googleAnalyticReady=!1,E.facebookPixelId=null,E.facebookPixelReady=!1,E.startLoadTime=Z,E.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",E.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),E.overrideUseCustomAddressForm=!1,E.isCollect=!1,E.isInvoice=!1,E.isNpm=!0,E.zonosQaUrl=null,E.zonosQaUrlApi=null,E.trackEventLogs=[],E.version="v1.3.278",E.modeAlerted=!1,E.cartData=null,E.paypal=null,E.zonosMode=null,E.IframeService=t,E.getCurrentTimestamp=()=>(new Date).getTime(),E.zonosController=null,E.loadTimeApiInfoList=[],E.logIntervalId=null,E.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.createCartId=null==o?void 0:o.createCartId,T.buildCartDetail=null==o?void 0:o.buildCartDetail,T.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,"undefined"!=typeof window&&window.parent===window&&(T.googleAnalyticReady=!0,T.facebookPixelReady=!0),T.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.zonosMode=T.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await R({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||v){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c}}),T.doneInit=!0},E.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${v}`)){const e=document.createElement("button");e.id=v,e.style.display="none",document.body.appendChild(e)}},E.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},E.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},E.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${v}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},E.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},E.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},E.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},E.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},E.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},E.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{var n;k=!0;const o=Date.now();return((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(null!==(n=await I)&&void 0!==n?n:await N(null),e,o)})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,r("Zonos controller injected!")},E.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},E.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return L;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.278";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.278";case"vercel":return A}};return T.isNpm&&S()||n()},E.injectZonosCdn=()=>{T.injectScript({cdnType:h,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:h,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},E.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},E.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:h,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},E.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!C.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},E.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},E.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const P=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],F=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],D=[...P,...F];export{E as Zonos,D as checkoutSessionAttributeKeys,F as checkoutSessionImmutableAttributeKeys,P as checkoutSessionMutableAttributeKeys}
|
|
1
|
+
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as v}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],h="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.280.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=e=>(null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b),I=Promise.resolve().then((()=>(()=>{var e,n;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(n=window.Zonos)||void 0===n?void 0:n.buildCartDetail))})()?N(null):null));let k=!1;I.catch((e=>{k||console.warn(e)}));const R=async({cartId:e,retries:n})=>{const t=i(),s=o(),d=p()||void 0,c=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&c.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${c.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:d,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),R({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const $=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),Z=Date.now(),A="https://v1.3.280.js.zonos.com",L=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.280",U="https://fonts.googleapis.com",C=/^https:\/\/fonts\.googleapis\.com/;class E{}T=E,E.doneInit=!1,E.cartSettings=null,E.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),E.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),E._paypalMockResponse=null,E.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,E.isBigCommerce=!1,E.releaseDate="1783609436334",E.isLegacyCheckout=!1,E.googleAnalyticId=null,E.googleAnalyticReady=!1,E.facebookPixelId=null,E.facebookPixelReady=!1,E.startLoadTime=Z,E.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",E.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),E.overrideUseCustomAddressForm=!1,E.isCollect=!1,E.isInvoice=!1,E.isNpm=!0,E.zonosQaUrl=null,E.zonosQaUrlApi=null,E.trackEventLogs=[],E.version="v1.3.280",E.modeAlerted=!1,E.cartData=null,E.paypal=null,E.zonosMode=null,E.IframeService=t,E.getCurrentTimestamp=()=>(new Date).getTime(),E.zonosController=null,E.loadTimeApiInfoList=[],E.logIntervalId=null,E.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.createCartId=null==o?void 0:o.createCartId,T.buildCartDetail=null==o?void 0:o.buildCartDetail,T.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,"undefined"!=typeof window&&window.parent===window&&(T.googleAnalyticReady=!0,T.facebookPixelReady=!0),T.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.zonosMode=T.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await R({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||v){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c}}),T.doneInit=!0},E.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${v}`)){const e=document.createElement("button");e.id=v,e.style.display="none",document.body.appendChild(e)}},E.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},E.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},E.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${v}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},E.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},E.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},E.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},E.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},E.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},E.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{var n;k=!0;const o=Date.now();return((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(null!==(n=await I)&&void 0!==n?n:await N(null),e,o)})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,r("Zonos controller injected!")},E.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},E.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return L;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.280";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.280";case"vercel":return A}};return T.isNpm&&S()||n()},E.injectZonosCdn=()=>{T.injectScript({cdnType:h,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:h,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},E.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},E.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:h,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},E.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!C.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},E.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},E.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const P=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],F=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],D=[...P,...F];export{E as Zonos,D as checkoutSessionAttributeKeys,F as checkoutSessionImmutableAttributeKeys,P as checkoutSessionMutableAttributeKeys}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-47a1d469.system.js","./p-9fab45aa.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-5e09c22d.system.js"],(function(e){"use strict";var n,t,r,i,o,a,u,s,c,f,l,d,v,p;return{setters:[function(e){n=e.c;t=e.z},function(e){r=e.t;i=e.l;o=e.s},function(e){a=e.l;u=e.h;s=e.s},function(e){c=e.l;f=e.b},function(e){l=e.b;d=e.K;v=e.d;p=e.L}],execute:function(){var m=this;function h(e,n){if(n==null||n>e.length)n=e.length;for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function y(e){if(Array.isArray(e))return e}function w(e){if(Array.isArray(e))return h(e)}function g(e,n,t,r,i,o,a){try{var u=e[o](a);var s=u.value}catch(e){t(e);return}if(u.done){n(s)}else{Promise.resolve(s).then(r,i)}}function b(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){g(o,r,i,a,u,"next",e)}function u(e){g(o,r,i,a,u,"throw",e)}a(undefined)}))}}function k(e,n){if(!(e instanceof n)){throw new TypeError("Cannot call a class as a function")}}function x(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function E(e,n,t){if(n)x(e.prototype,n);if(t)x(e,t);return e}function I(e,n,t){if(n in e){Object.defineProperty(e,n,{value:t,enumerable:true,configurable:true,writable:true})}else{e[n]=t}return e}function S(e,n){if(n!=null&&typeof Symbol!=="undefined"&&n[Symbol.hasInstance]){return!!n[Symbol.hasInstance](e)}else{return e instanceof n}}function C(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(e,n){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var r=[];var i=true;var o=false;var a,u;try{for(t=t.call(e);!(i=(a=t.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(e){o=true;u=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(o)throw u}}return r}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};var r=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))}r.forEach((function(n){I(e,n,t[n])}))}return e}function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(n){r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))}t.push.apply(t,r)}return t}function R(e,n){n=n!=null?n:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(n))}else{P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,n){return y(e)||N(e,n)||L(e,n)||T()}function _(e){return w(e)||C(e)||L(e)||D()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function L(e,n){if(!e)return;if(typeof e==="string")return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}function U(e,n){var t,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(n){return s([e,n])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e];r=0}finally{t=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var M=function(e){e["production"]="prod";e["demo"]="demo";e["staging"]="staging";return e}(M||{});var F="airTracker_unknown";var K={appName:F,appVersion:F,env:"staging",isWebappContainer:false,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:false,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:false,enableRecordPageRetention:false,hideSearchParams:false,useSessionStorageForSessionId:false,assetSpeedMonitoringWhiteListByMFE:{}};var q={appName:F,env:"staging",sessionId:F,deviceId:F};var H=function(e){if(!e){return false}if(/^\s*$/.test(e))return false;e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)};var z=function(){var e=new WeakSet;return function(n,t){if(S(t,Error)){return"Error.message: ".concat(t.message," \n Error.stack: ").concat(t.stack)}if((typeof t==="undefined"?"undefined":A(t))==="object"&&t!==null){if(e.has(t)){return"[Circular ".concat(n||"root","]")}e.add(t)}if(typeof t==="function"){return"function"}if((typeof t==="undefined"?"undefined":A(t))==="symbol"){return"symbol"}if(typeof t==="undefined"){return null}return t}};var B=function(e){if(typeof e==="string"){return e}try{if(S(e,Error)){return(JSON.stringify(e,z())||"undefined").replace(/"/gim,"")}return JSON.stringify(e,z())}catch(e){return'{"error":"error happen when airTracker stringify"}'}};var W=function(e){var n=e.method,t=n===void 0?"post":n,r=e.url,i=e.data,o=e.success,a=e.fail;if(!H(i)){return}var u=new XMLHttpRequest;u.addEventListener("readystatechange",(function(){if(u.readyState===4){if(u.status>=400||u.status===0){a===null||a===void 0?void 0:a(u.response)}else{o===null||o===void 0?void 0:o(u.response)}}}));u.open(t,r);u.setRequestHeader("Content-Type","application/json");u.send(i)};var X={onInit:"onInit",onConfigInit:"onConfigInit",onConfigUpdated:"onConfigUpdated",onCommonDataInit:"onCommonDataInit",onCommonUpdated:"onCommonUpdated",onPageChange:"onPageChange",onDestroy:"onDestroy,"};var G="AIR_ANALYTICS_DEVICE_ID";var V="AIR_ANALYTICS_SESSION_ID";var $="AWX_RISK_ID";var J=function(e){if(e=="prod"){return"https://o11y.airwallex.com/airtracker/logs"}if(e=="demo"){return"https://o11y-demo.airwallex.com/airtracker/logs"}return"https://o11y-staging.airwallex.com/airtracker/logs"};var Q=function(e){if(e=="prod"){return"https://o11y.airwallex.com/airtracker/metrics"}if(e=="demo"){return"https://o11y-demo.airwallex.com/airtracker/metrics"}return"https://o11y-staging.airwallex.com/airtracker/metrics"};var Y=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=Math.random()*16|0;var t=e==="x"?n:n&3|8;return t.toString(16)}));return e};var Z=function(e){var n,t,r;if(e.config.getMFEName){return e.config.getMFEName()}return((r=location)===null||r===void 0?void 0:(t=r.pathname)===null||t===void 0?void 0:(n=t.split("/"))===null||n===void 0?void 0:n[2])||"unknown"};var ee=function(){try{var e=window.sessionStorage.getItem(V);if(!e){e=Y();window.sessionStorage.setItem(V,e)}return e}catch(e){return Y()}};var ne=function(){try{var e=window.localStorage.getItem(G);if(!e){e=Y();window.localStorage.setItem(G,e)}return e}catch(e){}};var te=function(){try{var e=window.localStorage.getItem($);return e||void 0}catch(e){}};var re=function(){var e;var n="";var t=navigator.userAgent.match(/NetType\/(\w+)/);if(t){var r;r=O(t,2),n=r[1]}else if((e=navigator)===null||e===void 0?void 0:e.connection){var i,o,a,u;n=((o=navigator)===null||o===void 0?void 0:(i=o.connection)===null||i===void 0?void 0:i.effectiveType)||((u=navigator)===null||u===void 0?void 0:(a=u.connection)===null||a===void 0?void 0:a.type)}if(!n){n="unknown"}return ie(n)};var ie=function(e){e=String(e).toLowerCase();if(e.indexOf("4g")>=0)return"net4g";if(e.indexOf("wifi")>=0)return"wifi";if(e.indexOf("5g")>=0)return"net5g";if(e.indexOf("3g")>=0)return"net3g";if(e.indexOf("2g")>=0)return"net2g";return"unknown"};var oe=function e(){return typeof window.performance!=="undefined"&&typeof window.performance.clearResourceTimings==="function"&&typeof window.performance.getEntriesByType==="function"&&typeof window.performance.now==="function"};var ae=function(e){if(typeof e==="string"){var n=e.split("?")[0]||"";return n.slice(0,200)}return e};var ue=function(e){if(typeof e==="string"){return e.split("?")[1]||""}return e};var se=function(e){var n=typeof e==="string"&&e.startsWith("//");return n?typeof location!=="undefined"&&location.protocol==="https:":/^https/.test(e)};var ce=function(e,n){if(typeof e==="number"){return e}if(typeof e==="string"){return e}return n?"":-1};var fe=function(e,n){var t;var r=false;if(!n.config.isWebappContainer){r=le(e,n.config.assetSpeedMonitoringWhiteList);return r}var i=Z(n);return r||le(e,(t=n.config.assetSpeedMonitoringWhiteListByMFE)===null||t===void 0?void 0:t[i])};var le=function(e,n){if(!(n===null||n===void 0?void 0:n.length)){return false}for(var t=0;t<n.length;t++){var r=n[t];if(S(r,RegExp)&&r.test(e)){return true}if(typeof r=="string"&&e.includes(r)){return true}}return false};var de=function(e,n){var t=100;return Math.round((e-n)*t)/t};var ve=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?j({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a=Array.isArray(n)?n:[n];if(a.length===0){return}var u={commonData:o,data:a};var s=B(u);var c={method:"post",url:J(e.commonData.env),data:s};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var f=navigator.sendBeacon(c.url,s);if(!f){W(c)}}else{W(c)}}};var pe=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?j({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a={commonData:o,data:Array.isArray(n)?n:[n]};var u=B(a);var s={method:"post",url:Q(e.commonData.env),data:u};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var c=navigator.sendBeacon(s.url,u);if(!c){W(s)}}else{W(s)}}};var me=function(e,n){var t;var r=[];var i=e.config;window.addEventListener("beforeunload",(function(){if(r.length>0){e.immediateSendPipe(r.splice(0,r.length));t&&clearTimeout(t)}}));return function(o,a){r.push(o);e.lifeCycle.on(X.onCommonUpdated,(function(){if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(X.onCommonUpdated);t&&clearTimeout(t)}}));if(n&&r.length>=n){a===null||a===void 0?void 0:a(r.splice(0,r.length));t&&clearTimeout(t);return}t&&clearTimeout(t);t=setTimeout((function(){t=null;if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(X.onCommonUpdated)}}),i.delay)}};var he=function(e){var n={};return function(t,r){var i=typeof e.config.errorRepeatTime==="number"?e.config.errorRepeatTime:5;if(i===0){return r===null||r===void 0?void 0:r(t)}r===null||r===void 0?void 0:r(t.filter((function(e){if(e.severity=="autoDetectError"){n[e.error]=n[e.error]||0;n[e.error]+=1;if(n[e.error]>i){return false}return true}return true})))}};var ye=function(){};var we=function(e){if(!e||!e.reduce||!e.length){throw new TypeError("createPipeline need at least one function param")}if(e.length===1){return function(n,t){e[0](n,t||ye)}}return e.reduce((function(e,n){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye;return e(t,(function(e){return n===null||n===void 0?void 0:n(e,r)}))}}))};var ge=function(){function e(){var n=this;k(this,e);this.emit=function(e,t){if(!n)return;var r=n.eventsList[e];var i;if(r===null||r===void 0?void 0:r.length){r=r.slice();for(var o=0;o<r.length;o++){i=r[o];try{var a=i.callback.apply(n,[t]);if(1===i.type){n.remove(e,i.callback)}if(false===a){break}}catch(e){throw e}}}return n};this.eventsList={}}E(e,[{key:"indexOf",value:function e(n,t){for(var r=0;r<n.length;r++){if(n[r].callback===t){return r}}return-1}},{key:"on",value:function e(n,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(!this)return;var i=this.eventsList[n];if(!i){this.eventsList[n]=[];i=this.eventsList[n]}if(this.indexOf(i,t)===-1){var o={name:n,type:r||0,callback:t};i.push(o);return this}return this}},{key:"one",value:function e(n,t){this.on(n,t,1)}},{key:"remove",value:function e(n,t){if(!this)return;var r=this.eventsList[n];if(!r){return null}if(!t){try{delete this.eventsList[n]}catch(e){}return null}if(r.length){var i=this.indexOf(r,t);r.splice(i,1)}return this}},{key:"clear",value:function e(){this.eventsList={}}}]);return e}();var be=function(){function e(n){k(this,e);this.name="";this.isInit=false;this.name=n.name;this.option=n}E(e,[{key:"patch",value:function e(n){if(!this.isInit){var t,r;this.isInit=true;(r=this.option)===null||r===void 0?void 0:(t=r.setUp)===null||t===void 0?void 0:t.call(this.option,n)}}},{key:"uninstall",value:function e(){var n,t;(t=this.option)===null||t===void 0?void 0:(n=t.destroy)===null||n===void 0?void 0:n.apply(this);this.isInit=false}}]);return e}();var ke;var xe=function(e){var n="".concat(B(e.message)||""," @ (").concat(B(e.filename)||"",":").concat(e.lineno||0,":").concat(e.colno||0,")\n").concat(B(e.error||""));ke.normalLogPipeLine({severity:"autoDetectError",eventName:"windowOnError",extraInfo:{error:n}})};var Ee=function(e){var n=e&&B(e.reason);ke.normalLogPipeLine({severity:"autoDetectError",eventName:"promiseError",extraInfo:{error:n}})};var Ie=function(e){var n=(e===null||e===void 0?void 0:e.target)||(e===null||e===void 0?void 0:e.srcElement);if(!n){return}var t=(n===null||n===void 0?void 0:n.src)||(n===null||n===void 0?void 0:n.href);var r=n.tagName;var i="unknown";if(typeof t==="string"&&r){if(window.location.href.indexOf(t)>-1){return}if(/\.js$/.test(t)){i="script"}else if(/\.css$/.test(t)){i="css"}else{switch(r.toLowerCase()){case"script":i="script";break;case"link":i="css";break;case"img":i="image";break;case"audio":case"video":i="media";break;default:return}}ke.normalLogPipeLine({severity:"autoDetectError",eventName:"staticFileLoadError",extraInfo:{staticFileType:i,error:"".concat(r," load fail: ").concat(t)}})}};var Se=new be({name:"errorDetectionPlugin",setUp:function(e){ke=e;window.addEventListener("error",xe);window.addEventListener("unhandledrejection",Ee);window.document.addEventListener("error",Ie,true)},destroy:function(){window.removeEventListener("unhandledrejection",Ee);window.document.removeEventListener("error",Ie,true);window.removeEventListener("error",xe)}});var Ce=["img","css","script","link","audio","video","iframe"];var Ne="resource";var Te=function(e){var n=e.name;return{url:ae(n),method:"get",duration:Number(e.duration.toFixed(2)),type:"static",isHttps:se(n),urlQuery:ue(n),domainLookup:ce(e.domainLookupEnd-e.domainLookupStart),connectTime:ce(e.connectEnd-e.connectStart)}};var De=function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(Ce.indexOf(i.initiatorType)!==-1&&fe(i.name,n)){n.normalLogPipeLine({severity:"performance",eventName:"assets_speed",extraInfo:{log:Te(i)}})}}};var je;var Pe;var Re=new be({name:"assetsSpeedPlugin",setUp:function(e){if(!oe())return;var n=0;window.performance.onresourcetimingbufferfull=function(){n=0;window.performance.clearResourceTimings()};if(typeof window.PerformanceObserver==="function"){De(window.performance.getEntriesByType(Ne),e);Pe=new window.PerformanceObserver((function(n){De(n.getEntries(),e)}));Pe.observe({entryTypes:[Ne]})}else{je=setInterval((function(){var t=window.performance.getEntriesByType(Ne);var r=t.slice(n);n=t.length;De(r,e)}),3e3)}},destroy:function(){Pe===null||Pe===void 0?void 0:Pe.disconnect();je&&clearInterval(je)}});var Oe;var _e=new be({name:"onPageChangePlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o;return U(this,(function(a){t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");i=function(n){var t=n.prevHref;var r,i,o,a,u;e.normalLogPipeLine({severity:"autoDetectEvent",eventName:"onPageChange",extraInfo:{prevHref:t,href:((r=location)===null||r===void 0?void 0:r.href)||"",hostname:(i=location)===null||i===void 0?void 0:i.hostname,pathName:(o=location)===null||o===void 0?void 0:o.pathname,protocol:(a=location)===null||a===void 0?void 0:a.protocol,search:(u=location)===null||u===void 0?void 0:u.search}})};i({prevHref:""});Oe=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;i({prevHref:e})}}));o={subtree:true,childList:true};Oe.observe(r||document,o);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){Oe===null||Oe===void 0?void 0:Oe.disconnect()}});var Ae;var Le=new be({name:"onPageRetentionPlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o,a,u;return U(this,(function(s){if(typeof document.visibilityState==="undefined"){return[2]}t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");o=function(){i=Date.now()};o();document.addEventListener("visibilitychange",(function(){if(document.visibilityState==="hidden"){a({href:location.href,leftReason:"visibilityChange"})}else if(document.visibilityState==="visible"){o()}}));window.addEventListener("beforeunload",(function(){a({href:location.href,sendImmediate:true,leftReason:"pageClose"})}));a=function(n){var t=n.href,r=n.sendImmediate,o=n.leftReason;if(!i){return}var a=Date.now()-i;if(a===0){return}i=void 0;var u={severity:"autoDetectEvent",eventName:"onPageRetention",extraInfo:{href:t,duration:a,leftReason:o}};if(r){e.ImmediatePipeline(u);return}e.normalLogPipeLine(u)};Ae=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;a({href:e,leftReason:"nextPage"});o()}}));u={subtree:true,childList:true};Ae.observe(r||document,u);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){Ae===null||Ae===void 0?void 0:Ae.disconnect()}});var Ue=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)};var Me=function(e,n){var t=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/];var r=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];if(r.some((function(n){return n.test(e)}))){return false}return le(e,n||t)};var Fe=function(e){var n=e.startTime,t=e.endTime,r=e.entries;if(r.length===0){return void 0}if(r.length===1){return r[0]}var i=r.filter((function(e){return e.startTime>=n&&t&&e.responseEnd<=t})).sort((function(e,n){return e.startTime-n.startTime}));return i===null||i===void 0?void 0:i[0]};var Ke=function(e){return Math.round(e*100)/100};var qe=function(e){var n=e.startTime,t=e.duration,r=e.responseStart,i=e.connectEnd,o=e.connectStart,a=e.domainLookupEnd,u=e.domainLookupStart,s=e.requestStart,c=e.secureConnectionStart,f=e.redirectEnd,l=e.redirectStart,d=e.responseStatus,v=e.responseEnd,p=e.encodedBodySize,m=e.decodedBodySize,h=e.transferSize,y=e.deliveryType,w=e.initiatorType;return{startTime:Ke(n),totalDuration:Ke(t),timeToFirstByte:de(r,n),tcpDuration:de(i,o),dnsDuration:de(a,u),tlsDuration:de(s,c),redirectDuration:de(f,l),responseDuration:de(v,r),encodeResponseSize:p,decodeResponseSize:m,transferSize:h,deliveryType:y,statusCode:d,initiatorType:w}};var He=function(e,n){var t=e.url,r=e.method,i=e.errorType,o=e.errorDetail;var a=Fe(e);var u=new URL(t,window.location.href),s=u.href,c=u.protocol;var f=a?qe(a):{};var l={severity:"autoDetectEvent",eventName:"httpClientMetrics",extraInfo:j(R(j({httpUrl:s,method:r,scheme:c},i&&{errorType:i},o&&{errorDetail:o},f),{statusCode:(f===null||f===void 0?void 0:f.statusCode)||(e===null||e===void 0?void 0:e.responseStatus),startTime:(f===null||f===void 0?void 0:f.startTime)||(e===null||e===void 0?void 0:e.startTime),initiatorType:(f===null||f===void 0?void 0:f.initiatorType)||(e===null||e===void 0?void 0:e.initiatorType)}),n)};return l};var ze=function(e){return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"errors"in e&&Array.isArray(e.errors)&&e.errors.every((function(e){return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"message"in e}))};var Be="awx_airtracker_api_performance_queue";var We="awx_airtracker_api_performance_plugin_loaded";var Xe=300;var Ge=1e4;var Ve=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};Ve[Be]=Ve[Be]||[];var $e=function(e,n,t){setTimeout((function(){var r=He(e,t);n.observerPipeline(r);Ve[Be]=Ve[Be].filter((function(n){return n.id!==e.id}))}),Xe)};var Je=function(e,n){setTimeout((function(){var t=Ve[Be].find((function(n){return n.id===e}));if(!t){return}var r=He(t,{exceptionType:"timeout-without-response"});n.observerPipeline(r);Ve[Be]=Ve[Be].filter((function(n){return n.id!==e}))}),Ge)};var Qe=function(e){var n=XMLHttpRequest.prototype.open;var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function t(r,i,o,a,u){try{var s;var c=Ue();this.__requestId=c;var f=S(i,URL)?i.href:new URL(i,window.location.href).href;if(!Me(f,(s=e.config)===null||s===void 0?void 0:s.enableRecordAPIPerformanceWhitelist)){return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}var l={id:c,startTime:performance.now(),method:r,url:f,entries:[],initiatorType:"xmlhttprequest"};Ve[Be].push(l);Je(c,e);return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}catch(t){e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:t}});return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}};XMLHttpRequest.prototype.send=function n(){var r=this;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}try{var u=Ve[Be].find((function(e){return e.id===r.__requestId}));if(!u){return t.apply(this,o)}var s=this;this.addEventListener("loadend",b((function(){var n,t,r,i,o,a,c;return U(this,(function(f){switch(f.label){case 0:n=performance.now();t=n-u.startTime;r=s.status;if(r===0){return[2]}u.endTime=n;u.duration=t;u.responseStatus=r;f.label=1;case 1:f.trys.push([1,6,,7]);if(!(s.responseType===""||s.responseType==="text"))return[3,2];i=s.responseText;return[3,5];case 2:if(!(s.responseType==="json"))return[3,3];i=s.response;return[3,5];case 3:if(!(s.responseType==="blob"))return[3,5];o=s.response;if(!((o===null||o===void 0?void 0:o.type)==="application/json"))return[3,5];return[4,o.text()];case 4:i=f.sent();f.label=5;case 5:a=i&&typeof i==="string"?JSON.parse(i):i;if(a&&ze(a)){u.errorType="graphqlError";u.errorDetail=a.errors}return[3,7];case 6:c=f.sent();e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:u===null||u===void 0?void 0:u.url,error:c}});return[3,7];case 7:$e(u,e);return[2]}}))})));this.addEventListener("error",(function(){$e(u,e,{exceptionType:"network-error"})}));this.addEventListener("abort",(function(){$e(u,e,{exceptionType:"abort-error"})}));this.addEventListener("timeout",(function(){$e(u,e,{exceptionType:"timeout-error"})}));return t.apply(this,o)}catch(n){e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:n}});throw n}}};var Ye=function(e){var n=window.fetch;window.fetch=b((function(){var t,r,i,o,a,u,s,c,f,l,d,v,p,m,h,y;var w=arguments;return U(this,(function(g){switch(g.label){case 0:for(t=w.length,r=new Array(t),i=0;i<t;i++){r[i]=w[i]}u=new URL(S(r[0],Request)?r[0].url:String(r[0]),window.location.href).href;if(!!Me(u,(o=e.config)===null||o===void 0?void 0:o.enableRecordAPIPerformanceWhitelist))return[3,2];return[4,n.apply(this,r)];case 1:return[2,g.sent()];case 2:g.trys.push([2,9,,10]);c=performance.now();f=Ue();a={id:f,startTime:c,method:((s=S(r[0],Request)?r[0]:r[1])===null||s===void 0?void 0:s.method)||"GET",url:u,entries:[],initiatorType:"fetch"};Ve[Be].push(a);Je(f,e);return[4,n.apply(this,r)];case 3:l=g.sent();d=performance.now();a.endTime=d;a.duration=d-c;a.responseStatus=l.status;v=l.clone();g.label=4;case 4:g.trys.push([4,7,,8]);if(!v.ok)return[3,6];return[4,v.json()];case 5:p=g.sent();if(p&&ze(p)){a.errorType="graphqlError";a.errorDetail=p.errors}g.label=6;case 6:return[3,8];case 7:m=g.sent();e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a===null||a===void 0?void 0:a.url,error:m}});return[3,8];case 8:$e(a,e);return[2,l];case 9:h=g.sent();if(a&&a.id&&Ve[Be].find((function(e){return e.id===(a===null||a===void 0?void 0:a.id)}))){y="fetch-error";if(S(h,TypeError)){y="network-error"}else if(S(h,DOMException)&&h.name==="AbortError"){y="abort-error"}$e(a,e,{exceptionType:y})}else{e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:h}})}throw h;case 10:return[2]}}))}))};var Ze=function(e){var n;Qe(e);Ye(e);if((n=window)===null||n===void 0?void 0:n.PerformanceObserver){var t=new window.PerformanceObserver((function(e){var n=e.getEntries();n.forEach((function(e){var n=e;if(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest"){var t=Ve[Be].filter((function(e){return e.url===n.name}));t.forEach((function(e){e.entries.push(n)}))}}))}));t.observe({entryTypes:["resource"],buffered:true})}else{e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})}};var en=new be({name:"apiPerformancePlugin",setUp:function(){var e=b((function(e){var n,t;return U(this,(function(r){if(Ve[We]){return[2]}if(((n=e.config)===null||n===void 0?void 0:n.enableRecordAPIPerformance)&&Math.random()<(((t=e.config)===null||t===void 0?void 0:t.enableRecordAPIPerformancePercentage)||0)){Ve[We]=true;Ze(e)}return[2]}))}));return function(n){return e.apply(this,arguments)}}()});var nn="3.1.0";var tn=function(){function e(n){var t=this;var r=n.config,i=n.plugins,o=i===void 0?[]:i;k(this,e);this.config=K;this.lifeCycle=new ge;this.plugins=[];this._commonData=q;this._MFECommonDataMap={};this.timeMap={};this.packedDataConvert=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o,a;var u=j({severity:n,eventName:r,currentHref:t.config.hideSearchParams?(((o=location)===null||o===void 0?void 0:o.href)||"").split("?")[0]||"":((a=location)===null||a===void 0?void 0:a.href)||""},i);if(t.config.isWebappContainer){u.MFEName=Z(t)}return u};this.normalPipelineObj=we([me(this,8),he(this),ve(this)]);this.observerPipelineObj=we([me(this,8),pe(this)]);this.immediateSendPipe=ve(this);this.observerPipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.observerPipelineObj(o)};this.normalLogPipeLine=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});if(t.config.disableThrottle){return t.immediateSendPipe(o)}else{return t.normalPipelineObj(o)}};this.ImmediatePipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.immediateSendPipe(o)};this.plugins=_(o);this.setConfig(r);this.initCommonData(r);this.lifeCycle.emit(X.onInit);if(r.enableErrorMonitoring){this.plugins.push(Se)}if((r===null||r===void 0?void 0:r.assetSpeedMonitoringWhiteList)&&r.assetSpeedMonitoringWhiteList.length>0||r.isWebappContainer){this.plugins.push(Re)}if(r===null||r===void 0?void 0:r.enableDetectPageChange){this.plugins.push(_e)}if(r===null||r===void 0?void 0:r.enableRecordPageRetention){this.plugins.push(Le)}if((r===null||r===void 0?void 0:r.enableRecordAPIPerformance)&&(r===null||r===void 0?void 0:r.enableRecordAPIPerformancePercentage)&&r.enableRecordAPIPerformancePercentage>0&&r.enableRecordAPIPerformancePercentage<=1){this.plugins.push(en)}this.installPlugins()}E(e,[{key:"installPlugins",value:function e(){var n=this;this.plugins.forEach((function(e){e.patch(n)}))}},{key:"commonData",get:function e(){return this._commonData}},{key:"MFECommonDataMap",get:function e(){return this._MFECommonDataMap}},{key:"initCommonData",value:function e(n){this._commonData.sessionId=n.useSessionStorageForSessionId?ee():Y();this._commonData.deviceId=ne()||F;this._commonData.riskDeviceId=te();this._commonData.networkType=re()||"unknown";this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||F;this._commonData.appVersion=n.appVersion;this._commonData.appName=n.appName;this._commonData.sdkVersion=nn;this.lifeCycle.emit(X.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function e(n){this.lifeCycle.emit(X.onCommonUpdated,this._commonData);this._commonData.env=n.env||this._commonData.env;this._commonData.appName=n.appName||this._commonData.appName;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||this._commonData.accountId;this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{key:"updateCommonData",value:function e(n){this.lifeCycle.emit(X.onCommonUpdated,this._commonData);this._commonData=j({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function e(n){var t=this;this.lifeCycle.emit(X.onCommonUpdated,this._commonData);setTimeout((function(){n.forEach((function(e){delete t._commonData[e]}))}),1e3)}},{key:"addToMFECommonData",value:function e(n){var t=n.MFEName,r=n.MFECommonData;var i;if(!this.config.isWebappContainer){return}if(!t||!r){return}this._MFECommonDataMap=R(j({},this._MFECommonDataMap||{}),I({},t,j({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[t])||{},r)))}},{key:"setConfig",value:function e(n){var t=this;if(this.config.isWebappContainer){return}var r=function(e,n){t.config[e]=n};Object.entries(n).forEach((function(e){var n=O(e,2),t=n[0],i=n[1];if((typeof i==="undefined"?"undefined":A(i))!==void 0){r(t,i)}}));this.lifeCycle.emit(X.onConfigInit,this.config);this.updateCommonDataBasedOnConfig(n)}},{key:"verbose",value:function e(n,t){this.normalLogPipeLine({severity:"verbose",eventName:n,extraInfo:t})}},{key:"httpLog",value:function e(n,t){this.normalLogPipeLine({severity:"http",eventName:n,extraInfo:t})}},{key:"info",value:function e(n,t){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:t})}},{key:"warn",value:function e(n,t){this.normalLogPipeLine({severity:"warn",eventName:n,extraInfo:t})}},{key:"error",value:function e(n,t){console.error("error",n);this.normalLogPipeLine({severity:"error",eventName:n,extraInfo:t})}},{key:"businessLog",value:function e(n,t){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:R(j({},t),{isBusinessLog:true})})}},{key:"reportDuration",value:function e(n,t,r){if(typeof n!=="string"){console.warn("reportDuration: eventName (first param) must be a string");return}if(typeof t!=="number"){console.warn("reportDuration: duration (second param) must be number");return}if(t<0||t>6e4){console.warn("reportDuration: duration (second param) must between 0 and 60000");return}this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:j({duration:t},r)})}},{key:"getTimerKey",value:function e(n){var t=Z(this);return this.config.isWebappContainer?"".concat(t,"_").concat(n):n}},{key:"timeStart",value:function e(n){if(typeof n!=="string"){console.warn("time: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){console.warn("Timer ".concat(n," already exists"))}this.timeMap[this.getTimerKey(n)]=Date.now()}},{key:"timeEnd",value:function e(n,t){if(typeof n!=="string"){console.warn("timeEnd: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){var r=Date.now()-this.timeMap[this.getTimerKey(n)]+(t||0);this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:{duration:r}});delete this.timeMap[this.getTimerKey(n)]}else{console.warn("Timer key :".concat(n," does not exist"))}}},{key:"addToAssetSpeedWhiteListByMFE",value:function e(n){var t=n.MFEName,r=n.whiteList;var i;if(!this.config.isWebappContainer){return}if(!t||!(r===null||r===void 0?void 0:r.length)){return}if(!this.config.assetSpeedMonitoringWhiteListByMFE){this.config.assetSpeedMonitoringWhiteListByMFE={}}if(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0?void 0:i[t])){this.config.assetSpeedMonitoringWhiteListByMFE=R(j({},this.config.assetSpeedMonitoringWhiteListByMFE),I({},t,r))}else{var o;var a,u;(u=this.config.assetSpeedMonitoringWhiteListByMFE)===null||u===void 0?void 0:(a=u[t])===null||a===void 0?void 0:(o=a).push.apply(o,_(r))}}},{key:"destroy",value:function e(){if(this.config.isWebappContainer){return}this.plugins.forEach((function(e){e.uninstall()}))}}]);return e}();var rn=tn;var on=function(e,n){on=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return on(e,n)};function an(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");on(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var un=function(){un=Object.assign||function e(n){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))n[o]=t[o]}return n};return un.apply(this,arguments)};function sn(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))}function cn(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}function fn(e,n,t){if(t||arguments.length===2)for(var r=0,i=n.length,o;r<i;r++){if(o||!(r in n)){if(!o)o=Array.prototype.slice.call(n,0,r);o[r]=n[r]}}return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError==="function"?SuppressedError:function(e,n,t){var r=new Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};var ln="@airwallex/components-sdk";var dn="1.30.2";var vn="./lib/index.js";var pn="./lib/index.mjs";var mn="./lib/index.d.ts";var hn=["lib/**"];var yn="MIT";var wn={"load-types":"node ./load-types.js && yarn prettier -w src/types/*d.ts",prebuild:"yarn clean",build:"yarn rollup --config",postbuild:"yarn bundle-types","bundle-types":"dts-bundle-generator -o ./lib/index.d.ts ./src/index.ts",clean:"rm -rf dist lib",lint:'eslint "src/**/*.ts*"',test:"jest",sonar:"sonar-scanner",release:"semantic-release","lint-stage":"lint-staged",prepare:"husky"};var gn={semi:true,singleQuote:true,printWidth:80,trailingComma:"all"};var bn={access:"public"};var kn={"@babel/preset-typescript":"^7.18.6","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.6","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/gitlab":"^6.1.0","@semantic-release/release-notes-generator":"^9.0.0","@swc/core":"^1.3.46","@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","dts-bundle-generator":"^9.0.0",eslint:"^7.23.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^5.1.3",husky:"^9.0.11",jest:"^29.5.0","jest-environment-jsdom":"^29.5.0","lint-staged":"^15.2.7",prettier:"^3.3.2",rollup:"^4.9.6","semantic-release":"^17.3.8","sonarqube-scanner":"^3.0.1","ts-jest":"^29.0.5","ts-loader":"^9.5.1",tslib:"^2.6.2",typescript:"^4.5.2"};var xn={"@airwallex/airtracker":"^3.0.0"};var En={name:ln,version:dn,main:vn,module:pn,types:mn,files:hn,license:yn,scripts:wn,prettier:gn,"lint-staged":{"src/**/*.{ts,tsx}":["yarn lint"],"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}":"prettier --write"},publishConfig:bn,devDependencies:kn,dependencies:xn};var In={dev:M.staging,staging:M.staging,demo:M.demo,prod:M.production};var Sn=function(e,n){if(e===void 0){e=M.production}if(!window._AirwallexSDKs.airTracker){window._AirwallexSDKs.airTracker=new rn({config:{appName:"components-sdk",appVersion:En.version,env:In[e]||M.production}});window._AirwallexSDKs.airTracker.updateCommonData({clientId:n})}return window._AirwallexSDKs.airTracker};var Cn=function(e){if(typeof e!=="object"){return e}try{var n=JSON.parse(JSON.stringify(e));Object.keys(n).forEach((function(e){if(typeof e==="string"&&["auth","code"].some((function(n){return e.includes(n)}))){n[e]="***"}}));return n}catch(n){return e}};var Nn=function(e,n){var t,r;(r=(t=window._AirwallexSDKs)===null||t===void 0?void 0:t.airTracker)===null||r===void 0?void 0:r.error(e,un(un({},n),{context:"components-sdk"}))};var Tn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.warn(e,un(un({},n),{context:"components-sdk"}))};var Dn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.info(e,un(un({},n),{context:"components-sdk"}))};var jn=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="LOAD_SCRIPT_ERROR";return t}return n}(Error);var Pn,Rn;var On;(function(e){e["dev"]="dev";e["staging"]="staging";e["demo"]="demo";e["prod"]="prod";e["sandbox"]="sandbox"})(On||(On={}));var _n=(Pn={},Pn[On.dev]="https://checkout-staging.airwallex.com",Pn[On.staging]="https://checkout-staging.airwallex.com",Pn[On.demo]="https://checkout-demo.airwallex.com",Pn[On.prod]="https://checkout.airwallex.com",Pn[On.sandbox]="https://checkout.sandbox.airwallex.com",Pn);var An=(Rn={},Rn[On.dev]="https://static-staging.airwallex.com",Rn[On.staging]="https://static-staging.airwallex.com",Rn[On.demo]="https://static-demo.airwallex.com",Rn[On.prod]="https://static.airwallex.com",Rn[On.sandbox]="https://static.sandbox.airwallex.com",Rn);var Ln="sdkController";var Un="payments";var Mn={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"};var Fn={kyc:"kyc",paymentsKyb:"paymentsKyb",kycRfi:"rfi",transactionRfi:"rfi",paymentEnablementRfi:"rfi",lendingRfi:"rfi",mrmRfi:"rfi",payoutForm:"payouts",beneficiaryForm:"payouts",hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments",cardNumber:"payments",applePayButton:"payments",googlePayButton:"payments",krCardNumber:"payments",krCardIdentifier:"payments",krCardExpiry:"payments",krCardPswFirstTwo:"payments",scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",embeddedCheckout:"billing"};var Kn={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]};var qn={billing:["payments"]};var Hn=["payments","sca"];var zn=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INVALID_STATIC_RESOURCE_ERROR";return t}return n}(Error);var Bn=Date.now();var Wn=function(e){return Object.keys(Kn).includes(e)};var Xn=function(e){if(e===void 0){e=500}return new Promise((function(n){return window.setTimeout(n,e)}))};var Gn=function(e){return Fn[e]};var Vn=function(e,n){var t=e===Un?_n:An;return t[n]||t.prod};var $n=function(e){var n=e.reduce((function(e,n){return e.concat(Wn(n)?Kn[n]:n)}),[]);return Array.from(new Set(n)).map((function(e){return{elementName:e,sdkName:Gn(e)}}))};var Jn=function(e){return Array.from(new Set($n(e).map((function(e){var n=e.sdkName;return n})).filter((function(e){return Hn.includes(e)}))))};var Qn=function(e){return e==="payments"?"payment":e};var Yn=function(e){var n=e.name,t=e.env,r=t===void 0?On.prod:t;var i=Vn(n,r);var o=Mn[n];if(!o){Nn("[components-sdk] Element static resource not found",{sdkName:n});throw new zn("Element ".concat(n," static resource URL is invalid."))}return"".concat(i).concat(o,"?ts=").concat(Bn)};var Zn=function(){return Hn.reduce((function(e,n){var t;return un(un({},e),(t={},t[n]=window._AirwallexSDKs.__controller__.internalSDKs[n],t))}),{})};var et=function(e){return qn[e]||[]};var nt=function(){return Math.floor(performance.now())};var tt=function(e){var n=document.createElement("script");n.src=e;n.type="module";var t=document.head||document.body;t.appendChild(n);return n};var rt=3;var it=function(e){return sn(void 0,void 0,void 0,(function(){var n,t;return cn(this,(function(r){switch(r.label){case 0:if(typeof window==="undefined"){throw new Error("Please load script in browser environment")}n=0;t=function(){return sn(void 0,void 0,void 0,(function(){var t,r,i;return cn(this,(function(o){t=nt();if(n>0&&e.includes("?ts=")){r=new URL(e,window.location.href);r.searchParams.set("ts","".concat(Date.now()));e=r.toString()}i=tt(e);return[2,new Promise((function(r,o){i.addEventListener("load",(function(){var i=nt();Dn("[components-sdk] SDK script loaded",{scriptUrl:e,start:t,latency:i-t,end:i,retryCount:n});r(true)}));i.addEventListener("error",(function(r){i.remove();console.error(r);var a=nt();Nn("[components-sdk] Failed to load script",{scriptUrl:e,error:r,start:t,latency:a-t,end:a,retryCount:n});o(new jn("Failed to load Airwallex SDK scripts: ".concat(e)))}))}))]}))}))};r.label=1;case 1:if(!(n<rt))return[3,7];r.label=2;case 2:r.trys.push([2,4,,6]);return[4,t()];case 3:return[2,r.sent()];case 4:r.sent();n++;return[4,Xn()];case 5:r.sent();return[3,6];case 6:return[3,1];case 7:Nn("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:n});throw new jn("Failed to load Airwallex SDK scripts: ".concat(e))}}))}))};var ot=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INSTANCE_NOT_FOUND_ERROR";return t}return n}(Error);var at;var ut=new Map;var st=function(e){var n=e.env,t=e.scriptName;var r=Yn({name:t,env:n});var i=ut.get(t);if(i){return i}var o=it(r);ut.set(t,o);return o};var ct=function(e){var n=e.env,t=e.scriptName;return sn(void 0,void 0,void 0,(function(){var e;return cn(this,(function(r){switch(r.label){case 0:e=et(t);if(!(e.length>0))return[3,2];return[4,Promise.all(e.map((function(e){return st({env:n,scriptName:e})})))];case 1:r.sent();r.label=2;case 2:return[2,st({env:n,scriptName:t})]}}))}))};var ft=function(e){return sn(void 0,void 0,void 0,(function(){return cn(this,(function(n){if(typeof window==="undefined"){throw new Error("Please call the `init()` function in a browser environment.")}Sn(e.env,e.clientId);Dn("[components-sdk] SDK init start",{options:Cn(e),start:nt()});at=new Promise((function(n,t){var r;var i=un(un({},e),{env:e.env&&On[e.env]?e.env:On.prod});window.AirwallexComponentsSDK.__env__=i.env;var o=st({env:i.env,scriptName:Ln}).then((function(){return window._AirwallexSDKs.__controller__.init(i)}));var a=(r=e.enabledElements)!==null&&r!==void 0?r:[];var u=Jn(a);var s=u.map((function(e){return st({env:i.env,scriptName:e}).then((function(){return o})).then((function(){var n=window._AirwallexSDKs[Qn(e)];if(!n){Nn("[components-sdk] SDK instance not found",{functionsNamespace:e,windowSDKInstanceName:Qn(e)});throw new ot("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerFunctions({functionsNamespace:e,instance:n})}))}));var c=$n(a);var f=c.map((function(e){var n=e.sdkName,t=e.elementName;return ct({scriptName:n,env:i.env}).then((function(){return o})).then((function(){var e=window._AirwallexSDKs[Qn(n)];if(!e){Nn("[components-sdk] SDK instance not found",{sdkName:n,windowSDKInstanceName:Qn(n)});throw new ot("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:t,instance:e})}))}));Promise.all(fn(fn([o],s,true),f,true)).then((function(){Dn("[components-sdk] SDK initialized",{options:Cn(e),start:nt()});n(Zn())}))["catch"]((function(e){if(!e.code){Nn("[components-sdk] Unexpected errors when init",{error:e})}t(e)}))}));return[2,at]}))}))};var lt=e("l",(function(e,n){return sn(void 0,void 0,void 0,(function(){var t,r,i,o,a;return cn(this,(function(u){switch(u.label){case 0:if(!e){throw new Error("Element type is missing. Please specify a valid element.")}Dn("[components-sdk] SDK createElement start",{elementName:e,options:Cn(n),timestamp:nt()});if(!at){Tn("[components-sdk] Did not call init before createElement");throw new Error("Please initialize the Element before creating it.")}return[4,at];case 1:u.sent();t=Gn(e);if(!t){throw new Error("`createElement()` with type `".concat(e,"` is not supported. Please specify a valid Element type."))}r=nt();u.label=2;case 2:u.trys.push([2,6,,7]);return[4,ct({scriptName:t,env:window.AirwallexComponentsSDK.__env__||On.prod})];case 3:u.sent();return[4,window._AirwallexSDKs.__controller__.registerElement({sdkName:t,elementName:e,instance:window._AirwallexSDKs[Qn(t)]})];case 4:u.sent();return[4,window._AirwallexSDKs.__controller__.createElement(e,n)];case 5:i=u.sent();o=nt();Dn("[components-sdk] SDK createElement being called",{elementName:e,options:Cn(n),start:r,latency:o-r,end:o});return[3,7];case 6:a=u.sent();if(!a.code){Nn("[components-sdk] Unexpected errors when createElement",{error:a})}else{throw a}return[3,7];case 7:return[2,i]}}))}))}));var dt=[Ln,Un];var vt=function(){dt.forEach((function(e){var n=Yn({name:e,env:On.prod});var t=document.createElement("link");t.href=n;t.rel="modulepreload";t.as="script";var r=document.head||document.body;r.appendChild(t)}))};var pt=typeof document==="undefined"||typeof window==="undefined";if(!pt){if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",vt)}else{vt()}}if(typeof window!=="undefined"){if(!window.AirwallexComponentsSDK){Object.defineProperties(window,{AirwallexComponentsSDK:{value:{},writable:false},_AirwallexSDKs:{value:{},writable:false}})}window.AirwallexComponentsSDK.init=ft;window.AirwallexComponentsSDK.createElement=lt}var mt=n((function(){return{clientSecret:null,currency:null,hasPaymentError:false,isReady:false,paymentConfirmed:false,paymentIntentId:null}})),ht=mt.onChange,yt=mt.reset,wt=mt.state;e({n:ht,k:yt,b:wt});var gt=e("a",(function(e){if(e.paymentProcessor!=="AIRWALLEX"){return false}if(e.clientSecret){wt.clientSecret=e.clientSecret}if(e.paymentIntentId){wt.paymentIntentId=e.paymentIntentId}if(!wt.clientSecret){a("Airwallex checkout session is missing the client secret");return false}return true}));var bt={ar:"ar",da:"da",de:"de",en:"en",es:"es",fr:"fr",id:"id",it:"it",ja:"ja",ko:"ko",nl:"nl",pl:"pl",pt:"pt",ru:"ru",sv:"sv",zh:"zh"};var kt=e("m",(function(e){return bt[e]||"en"}));var xt=null;var Et=e("f",(function(){return sn(m,void 0,void 0,(function(){var e;return cn(this,(function(n){if(wt.isReady){return[2,true]}if(!xt){e=(!t.zonosMode||t.zonosMode==="production")&&t.checkoutSettings.mode==="LIVE";xt=ft({enabledElements:["payments"],env:e?"prod":"demo",locale:kt(i.selectedLocale)}).then((function(){wt.isReady=true;c("Airwallex SDK initialized");return true})).catch((function(e){a(e);xt=null;return false}))}return[2,xt]}))}))}));var It=["SUCCEEDED","REQUIRES_CAPTURE","PENDING_REVIEW","PENDING"];var St=e("e",(function(e){return!!e&&It.includes(e)}));var Ct=e("j",(function(e){switch(e){case"SUCCEEDED":{return{isError:false,messages:[r("Thank you for submitting your payment. We appreciate your prompt attention."),"",r("A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.")]}}case"PENDING":case"PENDING_REVIEW":case"REQUIRES_CAPTURE":{return{isError:false,messages:[r("Payment processing. We'll update you when payment is received.")]}}case"REQUIRES_CUSTOMER_ACTION":{return{isError:false,messages:[r("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.")]}}case"CANCELLED":case"REQUIRES_PAYMENT_METHOD":{return{isError:true,messages:[r("Payment failed. Please reload the page and try another payment method.")]}}default:{return{isError:true,messages:[r("Something went wrong.")]}}}}));var Nt=e("d",(function(e){return sn(m,void 0,void 0,(function(){var n,t,r;return cn(this,(function(i){switch(i.label){case 0:return[4,u("/api/zonos-elements/collect/airwallex-payment-intent",{body:{paymentIntentId:e},method:"POST"})];case 1:n=i.sent(),t=n.errors,r=n.json;if(t.length||!r){a("Failed to retrieve Airwallex payment intent",t);return[2,{status:null}]}return[2,{status:r.airwallexPaymentIntent.status}]}}))}))}));var Tt=n((function(){return{amountDutyTaxFeeTotal:null,amountTotalPaid:null,collectLogoUrl:null,isFetchingShippingInfo:true,landedCostShortId:null,originCompanyName:null,partyBillingId:null,paymentProcessor:null,shippingAddress:null}})),Dt=Tt.reset,jt=Tt.state;e("c",jt);var Pt=e("h",(function(e){return sn(m,[e],void 0,(function(e){var n,r,i,o,a,c,f,l,d,p,m,h,y,w;var g=e.landedCostId,b=e.retries,k=b===void 0?5:b;return cn(this,(function(e){switch(e.label){case 0:jt.isFetchingShippingInfo=true;return[4,u("/api/zonos-elements/collect/get-shipping-info-by-lc-id",{body:{landedCostId:g},method:"POST"})];case 1:m=e.sent();if(!m.errors.length)return[3,4];if(!(k>0))return[3,3];return[4,new Promise((function(e){return setTimeout(e,1e3)}))];case 2:e.sent();return[2,Pt({landedCostId:g,retries:k-1})];case 3:return[2,null];case 4:jt.landedCostShortId=((n=m.json)===null||n===void 0?void 0:n.landedCostShortId)||null;jt.isFetchingShippingInfo=false;jt.shippingAddress=((r=m.json)===null||r===void 0?void 0:r.shipping)||null;h=(i=v.checkoutSession)===null||i===void 0?void 0:i.landedCost;y=(o=v.checkoutSession)===null||o===void 0?void 0:o.subtotals;w=(((a=h===null||h===void 0?void 0:h.amountSubtotals)===null||a===void 0?void 0:a.shipping)||0)+(((c=h===null||h===void 0?void 0:h.amountSubtotals)===null||c===void 0?void 0:c.items)||0);jt.amountTotalPaid=w*(((f=y===null||y===void 0?void 0:y.exchangeRate)===null||f===void 0?void 0:f.rate)||1);jt.amountDutyTaxFeeTotal=((y===null||y===void 0?void 0:y.duties)||0)+((y===null||y===void 0?void 0:y.taxes)||0)+((y===null||y===void 0?void 0:y.fees)||0);jt.originCompanyName=((d=(l=m.json)===null||l===void 0?void 0:l.origin)===null||d===void 0?void 0:d.companyName)||null;jt.collectLogoUrl=((p=m.json)===null||p===void 0?void 0:p.collectLogoUrl)||null;if(jt.amountTotalPaid===0){void s({endpoint:"COLLECT_NO_TOTAL_PAID",errors:[],metadata:{landedCostId:g,organizationId:t.organizationId}})}return[2]}}))}))}));var Rt=e("i",(function(){return sn(m,void 0,void 0,(function(){var e,n,t,r,i,c,p,m,h,y;return cn(this,(function(w){switch(w.label){case 0:if(!((e=l.stripeBillingAddressEventData)===null||e===void 0?void 0:e.complete)){return[2,{partiesCreated:false}]}i=(t=(n=v.checkoutSession)===null||n===void 0?void 0:n.landedCost)===null||t===void 0?void 0:t.rootId;if(!i){void s({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:f,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId}});return[2,{partiesCreated:false}]}if(!o.checkoutSessionId){void s({endpoint:"COLLECT_NO_CHECKOUT_SESSION_ID",errors:["No checkout session id"],metadata:{allLogs:f,cartId:window.Zonos.cartId,landedCostRootId:i}});return[2,{partiesCreated:false}]}c=d({address:l.stripeBillingAddressEventData.value.address,firstName:l.stripeBillingAddressEventData.value.firstName,lastName:l.stripeBillingAddressEventData.value.lastName,name:l.stripeBillingAddressEventData.value.name,phone:l.stripeBillingAddressEventData.value.phone});p=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";return[4,u("/api/zonos-elements/create-billing-party",{body:{billingAddress:c,checkoutSessionId:o.checkoutSessionId,companyName:l.companyName,email:((r=l.stripeLinkEventData)===null||r===void 0?void 0:r.value.email)||"",isTest:p,rootId:i},method:"POST"})];case 1:m=w.sent(),h=m.errors,y=m.json;if(h.length||!y){a("Error occurs when creating billing party",JSON.stringify(h,null,2));void s({endpoint:"COLLECT_BILLING_PARTY_CREATE_FAILED",errors:["[COLLECT] Failed to create billing party"],metadata:{allLogs:f,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,errors:h,json:y}});return[2,{partiesCreated:false}]}jt.partyBillingId=y.billToPartyId;return[2,{partiesCreated:true}]}}))}))}));var Ot=e("g",(function(e){return sn(m,void 0,void 0,(function(){var n;return cn(this,(function(t){n=e.landedCost;if(!n){return[2,false]}v.landedCostData=[Object.assign(Object.assign({},e),{landedCost:Object.assign({},n),landedCostId:n.id})];return[2,p({applySubtotalsOnly:true,landedCostId:n.id,selectedShippingOption:n.shipmentRating})]}))}))}))}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-47a1d469.system.js","./p-fd2d4d04.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-f55a2352.system.js"],(function(e){"use strict";var n,t,r,i,o,a,u,s,c,f,l,d,v,p;return{setters:[function(e){n=e.c;t=e.z},function(e){r=e.t;i=e.l;o=e.s},function(e){a=e.l;u=e.h;s=e.s},function(e){c=e.l;f=e.b},function(e){l=e.b;d=e.K;v=e.d;p=e.L}],execute:function(){var m=this;function h(e,n){if(n==null||n>e.length)n=e.length;for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function y(e){if(Array.isArray(e))return e}function w(e){if(Array.isArray(e))return h(e)}function g(e,n,t,r,i,o,a){try{var u=e[o](a);var s=u.value}catch(e){t(e);return}if(u.done){n(s)}else{Promise.resolve(s).then(r,i)}}function b(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){g(o,r,i,a,u,"next",e)}function u(e){g(o,r,i,a,u,"throw",e)}a(undefined)}))}}function k(e,n){if(!(e instanceof n)){throw new TypeError("Cannot call a class as a function")}}function x(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function E(e,n,t){if(n)x(e.prototype,n);if(t)x(e,t);return e}function I(e,n,t){if(n in e){Object.defineProperty(e,n,{value:t,enumerable:true,configurable:true,writable:true})}else{e[n]=t}return e}function S(e,n){if(n!=null&&typeof Symbol!=="undefined"&&n[Symbol.hasInstance]){return!!n[Symbol.hasInstance](e)}else{return e instanceof n}}function C(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N(e,n){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var r=[];var i=true;var o=false;var a,u;try{for(t=t.call(e);!(i=(a=t.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(e){o=true;u=e}finally{try{if(!i&&t["return"]!=null)t["return"]()}finally{if(o)throw u}}return r}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};var r=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))}r.forEach((function(n){I(e,n,t[n])}))}return e}function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(n){r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))}t.push.apply(t,r)}return t}function R(e,n){n=n!=null?n:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(n))}else{P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,n){return y(e)||N(e,n)||L(e,n)||T()}function _(e){return w(e)||C(e)||L(e)||D()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function L(e,n){if(!e)return;if(typeof e==="string")return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}function U(e,n){var t,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(n){return s([e,n])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=n.call(e,a)}catch(e){o=[6,e];r=0}finally{t=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var M=function(e){e["production"]="prod";e["demo"]="demo";e["staging"]="staging";return e}(M||{});var F="airTracker_unknown";var K={appName:F,appVersion:F,env:"staging",isWebappContainer:false,delay:2e3,errorRepeatTime:3,enableErrorMonitoring:false,assetSpeedMonitoringWhiteList:[],enableDetectPageChange:false,enableRecordPageRetention:false,hideSearchParams:false,useSessionStorageForSessionId:false,assetSpeedMonitoringWhiteListByMFE:{}};var q={appName:F,env:"staging",sessionId:F,deviceId:F};var H=function(e){if(!e){return false}if(/^\s*$/.test(e))return false;e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");e=e.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");e=e.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(e)};var z=function(){var e=new WeakSet;return function(n,t){if(S(t,Error)){return"Error.message: ".concat(t.message," \n Error.stack: ").concat(t.stack)}if((typeof t==="undefined"?"undefined":A(t))==="object"&&t!==null){if(e.has(t)){return"[Circular ".concat(n||"root","]")}e.add(t)}if(typeof t==="function"){return"function"}if((typeof t==="undefined"?"undefined":A(t))==="symbol"){return"symbol"}if(typeof t==="undefined"){return null}return t}};var B=function(e){if(typeof e==="string"){return e}try{if(S(e,Error)){return(JSON.stringify(e,z())||"undefined").replace(/"/gim,"")}return JSON.stringify(e,z())}catch(e){return'{"error":"error happen when airTracker stringify"}'}};var W=function(e){var n=e.method,t=n===void 0?"post":n,r=e.url,i=e.data,o=e.success,a=e.fail;if(!H(i)){return}var u=new XMLHttpRequest;u.addEventListener("readystatechange",(function(){if(u.readyState===4){if(u.status>=400||u.status===0){a===null||a===void 0?void 0:a(u.response)}else{o===null||o===void 0?void 0:o(u.response)}}}));u.open(t,r);u.setRequestHeader("Content-Type","application/json");u.send(i)};var X={onInit:"onInit",onConfigInit:"onConfigInit",onConfigUpdated:"onConfigUpdated",onCommonDataInit:"onCommonDataInit",onCommonUpdated:"onCommonUpdated",onPageChange:"onPageChange",onDestroy:"onDestroy,"};var G="AIR_ANALYTICS_DEVICE_ID";var V="AIR_ANALYTICS_SESSION_ID";var $="AWX_RISK_ID";var J=function(e){if(e=="prod"){return"https://o11y.airwallex.com/airtracker/logs"}if(e=="demo"){return"https://o11y-demo.airwallex.com/airtracker/logs"}return"https://o11y-staging.airwallex.com/airtracker/logs"};var Q=function(e){if(e=="prod"){return"https://o11y.airwallex.com/airtracker/metrics"}if(e=="demo"){return"https://o11y-demo.airwallex.com/airtracker/metrics"}return"https://o11y-staging.airwallex.com/airtracker/metrics"};var Y=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=Math.random()*16|0;var t=e==="x"?n:n&3|8;return t.toString(16)}));return e};var Z=function(e){var n,t,r;if(e.config.getMFEName){return e.config.getMFEName()}return((r=location)===null||r===void 0?void 0:(t=r.pathname)===null||t===void 0?void 0:(n=t.split("/"))===null||n===void 0?void 0:n[2])||"unknown"};var ee=function(){try{var e=window.sessionStorage.getItem(V);if(!e){e=Y();window.sessionStorage.setItem(V,e)}return e}catch(e){return Y()}};var ne=function(){try{var e=window.localStorage.getItem(G);if(!e){e=Y();window.localStorage.setItem(G,e)}return e}catch(e){}};var te=function(){try{var e=window.localStorage.getItem($);return e||void 0}catch(e){}};var re=function(){var e;var n="";var t=navigator.userAgent.match(/NetType\/(\w+)/);if(t){var r;r=O(t,2),n=r[1]}else if((e=navigator)===null||e===void 0?void 0:e.connection){var i,o,a,u;n=((o=navigator)===null||o===void 0?void 0:(i=o.connection)===null||i===void 0?void 0:i.effectiveType)||((u=navigator)===null||u===void 0?void 0:(a=u.connection)===null||a===void 0?void 0:a.type)}if(!n){n="unknown"}return ie(n)};var ie=function(e){e=String(e).toLowerCase();if(e.indexOf("4g")>=0)return"net4g";if(e.indexOf("wifi")>=0)return"wifi";if(e.indexOf("5g")>=0)return"net5g";if(e.indexOf("3g")>=0)return"net3g";if(e.indexOf("2g")>=0)return"net2g";return"unknown"};var oe=function e(){return typeof window.performance!=="undefined"&&typeof window.performance.clearResourceTimings==="function"&&typeof window.performance.getEntriesByType==="function"&&typeof window.performance.now==="function"};var ae=function(e){if(typeof e==="string"){var n=e.split("?")[0]||"";return n.slice(0,200)}return e};var ue=function(e){if(typeof e==="string"){return e.split("?")[1]||""}return e};var se=function(e){var n=typeof e==="string"&&e.startsWith("//");return n?typeof location!=="undefined"&&location.protocol==="https:":/^https/.test(e)};var ce=function(e,n){if(typeof e==="number"){return e}if(typeof e==="string"){return e}return n?"":-1};var fe=function(e,n){var t;var r=false;if(!n.config.isWebappContainer){r=le(e,n.config.assetSpeedMonitoringWhiteList);return r}var i=Z(n);return r||le(e,(t=n.config.assetSpeedMonitoringWhiteListByMFE)===null||t===void 0?void 0:t[i])};var le=function(e,n){if(!(n===null||n===void 0?void 0:n.length)){return false}for(var t=0;t<n.length;t++){var r=n[t];if(S(r,RegExp)&&r.test(e)){return true}if(typeof r=="string"&&e.includes(r)){return true}}return false};var de=function(e,n){var t=100;return Math.round((e-n)*t)/t};var ve=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?j({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a=Array.isArray(n)?n:[n];if(a.length===0){return}var u={commonData:o,data:a};var s=B(u);var c={method:"post",url:J(e.commonData.env),data:s};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var f=navigator.sendBeacon(c.url,s);if(!f){W(c)}}else{W(c)}}};var pe=function(e){return function(n){var t,r;var i=Z(e);var o=e.config.isWebappContainer?j({},e.commonData||{},((t=e.MFECommonDataMap)===null||t===void 0?void 0:t[i])||{}):e.commonData;var a={commonData:o,data:Array.isArray(n)?n:[n]};var u=B(a);var s={method:"post",url:Q(e.commonData.env),data:u};if(typeof((r=navigator)===null||r===void 0?void 0:r.sendBeacon)==="function"){var c=navigator.sendBeacon(s.url,u);if(!c){W(s)}}else{W(s)}}};var me=function(e,n){var t;var r=[];var i=e.config;window.addEventListener("beforeunload",(function(){if(r.length>0){e.immediateSendPipe(r.splice(0,r.length));t&&clearTimeout(t)}}));return function(o,a){r.push(o);e.lifeCycle.on(X.onCommonUpdated,(function(){if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(X.onCommonUpdated);t&&clearTimeout(t)}}));if(n&&r.length>=n){a===null||a===void 0?void 0:a(r.splice(0,r.length));t&&clearTimeout(t);return}t&&clearTimeout(t);t=setTimeout((function(){t=null;if(r.length>0){a===null||a===void 0?void 0:a(r.splice(0,r.length));e.lifeCycle.remove(X.onCommonUpdated)}}),i.delay)}};var he=function(e){var n={};return function(t,r){var i=typeof e.config.errorRepeatTime==="number"?e.config.errorRepeatTime:5;if(i===0){return r===null||r===void 0?void 0:r(t)}r===null||r===void 0?void 0:r(t.filter((function(e){if(e.severity=="autoDetectError"){n[e.error]=n[e.error]||0;n[e.error]+=1;if(n[e.error]>i){return false}return true}return true})))}};var ye=function(){};var we=function(e){if(!e||!e.reduce||!e.length){throw new TypeError("createPipeline need at least one function param")}if(e.length===1){return function(n,t){e[0](n,t||ye)}}return e.reduce((function(e,n){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ye;return e(t,(function(e){return n===null||n===void 0?void 0:n(e,r)}))}}))};var ge=function(){function e(){var n=this;k(this,e);this.emit=function(e,t){if(!n)return;var r=n.eventsList[e];var i;if(r===null||r===void 0?void 0:r.length){r=r.slice();for(var o=0;o<r.length;o++){i=r[o];try{var a=i.callback.apply(n,[t]);if(1===i.type){n.remove(e,i.callback)}if(false===a){break}}catch(e){throw e}}}return n};this.eventsList={}}E(e,[{key:"indexOf",value:function e(n,t){for(var r=0;r<n.length;r++){if(n[r].callback===t){return r}}return-1}},{key:"on",value:function e(n,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(!this)return;var i=this.eventsList[n];if(!i){this.eventsList[n]=[];i=this.eventsList[n]}if(this.indexOf(i,t)===-1){var o={name:n,type:r||0,callback:t};i.push(o);return this}return this}},{key:"one",value:function e(n,t){this.on(n,t,1)}},{key:"remove",value:function e(n,t){if(!this)return;var r=this.eventsList[n];if(!r){return null}if(!t){try{delete this.eventsList[n]}catch(e){}return null}if(r.length){var i=this.indexOf(r,t);r.splice(i,1)}return this}},{key:"clear",value:function e(){this.eventsList={}}}]);return e}();var be=function(){function e(n){k(this,e);this.name="";this.isInit=false;this.name=n.name;this.option=n}E(e,[{key:"patch",value:function e(n){if(!this.isInit){var t,r;this.isInit=true;(r=this.option)===null||r===void 0?void 0:(t=r.setUp)===null||t===void 0?void 0:t.call(this.option,n)}}},{key:"uninstall",value:function e(){var n,t;(t=this.option)===null||t===void 0?void 0:(n=t.destroy)===null||n===void 0?void 0:n.apply(this);this.isInit=false}}]);return e}();var ke;var xe=function(e){var n="".concat(B(e.message)||""," @ (").concat(B(e.filename)||"",":").concat(e.lineno||0,":").concat(e.colno||0,")\n").concat(B(e.error||""));ke.normalLogPipeLine({severity:"autoDetectError",eventName:"windowOnError",extraInfo:{error:n}})};var Ee=function(e){var n=e&&B(e.reason);ke.normalLogPipeLine({severity:"autoDetectError",eventName:"promiseError",extraInfo:{error:n}})};var Ie=function(e){var n=(e===null||e===void 0?void 0:e.target)||(e===null||e===void 0?void 0:e.srcElement);if(!n){return}var t=(n===null||n===void 0?void 0:n.src)||(n===null||n===void 0?void 0:n.href);var r=n.tagName;var i="unknown";if(typeof t==="string"&&r){if(window.location.href.indexOf(t)>-1){return}if(/\.js$/.test(t)){i="script"}else if(/\.css$/.test(t)){i="css"}else{switch(r.toLowerCase()){case"script":i="script";break;case"link":i="css";break;case"img":i="image";break;case"audio":case"video":i="media";break;default:return}}ke.normalLogPipeLine({severity:"autoDetectError",eventName:"staticFileLoadError",extraInfo:{staticFileType:i,error:"".concat(r," load fail: ").concat(t)}})}};var Se=new be({name:"errorDetectionPlugin",setUp:function(e){ke=e;window.addEventListener("error",xe);window.addEventListener("unhandledrejection",Ee);window.document.addEventListener("error",Ie,true)},destroy:function(){window.removeEventListener("unhandledrejection",Ee);window.document.removeEventListener("error",Ie,true);window.removeEventListener("error",xe)}});var Ce=["img","css","script","link","audio","video","iframe"];var Ne="resource";var Te=function(e){var n=e.name;return{url:ae(n),method:"get",duration:Number(e.duration.toFixed(2)),type:"static",isHttps:se(n),urlQuery:ue(n),domainLookup:ce(e.domainLookupEnd-e.domainLookupStart),connectTime:ce(e.connectEnd-e.connectStart)}};var De=function(e,n){for(var t=0,r=e.length;t<r;t++){var i=e[t];if(Ce.indexOf(i.initiatorType)!==-1&&fe(i.name,n)){n.normalLogPipeLine({severity:"performance",eventName:"assets_speed",extraInfo:{log:Te(i)}})}}};var je;var Pe;var Re=new be({name:"assetsSpeedPlugin",setUp:function(e){if(!oe())return;var n=0;window.performance.onresourcetimingbufferfull=function(){n=0;window.performance.clearResourceTimings()};if(typeof window.PerformanceObserver==="function"){De(window.performance.getEntriesByType(Ne),e);Pe=new window.PerformanceObserver((function(n){De(n.getEntries(),e)}));Pe.observe({entryTypes:[Ne]})}else{je=setInterval((function(){var t=window.performance.getEntriesByType(Ne);var r=t.slice(n);n=t.length;De(r,e)}),3e3)}},destroy:function(){Pe===null||Pe===void 0?void 0:Pe.disconnect();je&&clearInterval(je)}});var Oe;var _e=new be({name:"onPageChangePlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o;return U(this,(function(a){t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");i=function(n){var t=n.prevHref;var r,i,o,a,u;e.normalLogPipeLine({severity:"autoDetectEvent",eventName:"onPageChange",extraInfo:{prevHref:t,href:((r=location)===null||r===void 0?void 0:r.href)||"",hostname:(i=location)===null||i===void 0?void 0:i.hostname,pathName:(o=location)===null||o===void 0?void 0:o.pathname,protocol:(a=location)===null||a===void 0?void 0:a.protocol,search:(u=location)===null||u===void 0?void 0:u.search}})};i({prevHref:""});Oe=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;i({prevHref:e})}}));o={subtree:true,childList:true};Oe.observe(r||document,o);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){Oe===null||Oe===void 0?void 0:Oe.disconnect()}});var Ae;var Le=new be({name:"onPageRetentionPlugin",setUp:function(){var e=b((function(e){var n,t,r,i,o,a,u;return U(this,(function(s){if(typeof document.visibilityState==="undefined"){return[2]}t=(n=location)===null||n===void 0?void 0:n.href;r=document.querySelector("body");o=function(){i=Date.now()};o();document.addEventListener("visibilitychange",(function(){if(document.visibilityState==="hidden"){a({href:location.href,leftReason:"visibilityChange"})}else if(document.visibilityState==="visible"){o()}}));window.addEventListener("beforeunload",(function(){a({href:location.href,sendImmediate:true,leftReason:"pageClose"})}));a=function(n){var t=n.href,r=n.sendImmediate,o=n.leftReason;if(!i){return}var a=Date.now()-i;if(a===0){return}i=void 0;var u={severity:"autoDetectEvent",eventName:"onPageRetention",extraInfo:{href:t,duration:a,leftReason:o}};if(r){e.ImmediatePipeline(u);return}e.normalLogPipeLine(u)};Ae=new MutationObserver((function(){if(location.href!==t){var e=t;t=location.href;a({href:e,leftReason:"nextPage"});o()}}));u={subtree:true,childList:true};Ae.observe(r||document,u);return[2]}))}));return function(n){return e.apply(this,arguments)}}(),destroy:function(){Ae===null||Ae===void 0?void 0:Ae.disconnect()}});var Ue=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2,15)};var Me=function(e,n){var t=[/^https?:\/\/[^\/]*\.airwallex\.com($|\/)/];var r=[/authenticate\/heartbeat/,/papluginlogs\/.*/,/airtracker\/.*/,/o11y(-staging|-demo)?\.airwallex\.com/,/\.(png|jpe?g|gif|svg|ico|webp|avif|css|js|json|woff2?|ttf|eot|map|txt|csv|xml)(\?.*)?(#.*)?$/i];if(r.some((function(n){return n.test(e)}))){return false}return le(e,n||t)};var Fe=function(e){var n=e.startTime,t=e.endTime,r=e.entries;if(r.length===0){return void 0}if(r.length===1){return r[0]}var i=r.filter((function(e){return e.startTime>=n&&t&&e.responseEnd<=t})).sort((function(e,n){return e.startTime-n.startTime}));return i===null||i===void 0?void 0:i[0]};var Ke=function(e){return Math.round(e*100)/100};var qe=function(e){var n=e.startTime,t=e.duration,r=e.responseStart,i=e.connectEnd,o=e.connectStart,a=e.domainLookupEnd,u=e.domainLookupStart,s=e.requestStart,c=e.secureConnectionStart,f=e.redirectEnd,l=e.redirectStart,d=e.responseStatus,v=e.responseEnd,p=e.encodedBodySize,m=e.decodedBodySize,h=e.transferSize,y=e.deliveryType,w=e.initiatorType;return{startTime:Ke(n),totalDuration:Ke(t),timeToFirstByte:de(r,n),tcpDuration:de(i,o),dnsDuration:de(a,u),tlsDuration:de(s,c),redirectDuration:de(f,l),responseDuration:de(v,r),encodeResponseSize:p,decodeResponseSize:m,transferSize:h,deliveryType:y,statusCode:d,initiatorType:w}};var He=function(e,n){var t=e.url,r=e.method,i=e.errorType,o=e.errorDetail;var a=Fe(e);var u=new URL(t,window.location.href),s=u.href,c=u.protocol;var f=a?qe(a):{};var l={severity:"autoDetectEvent",eventName:"httpClientMetrics",extraInfo:j(R(j({httpUrl:s,method:r,scheme:c},i&&{errorType:i},o&&{errorDetail:o},f),{statusCode:(f===null||f===void 0?void 0:f.statusCode)||(e===null||e===void 0?void 0:e.responseStatus),startTime:(f===null||f===void 0?void 0:f.startTime)||(e===null||e===void 0?void 0:e.startTime),initiatorType:(f===null||f===void 0?void 0:f.initiatorType)||(e===null||e===void 0?void 0:e.initiatorType)}),n)};return l};var ze=function(e){return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"errors"in e&&Array.isArray(e.errors)&&e.errors.every((function(e){return e&&(typeof e==="undefined"?"undefined":A(e))==="object"&&"message"in e}))};var Be="awx_airtracker_api_performance_queue";var We="awx_airtracker_api_performance_plugin_loaded";var Xe=300;var Ge=1e4;var Ve=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};Ve[Be]=Ve[Be]||[];var $e=function(e,n,t){setTimeout((function(){var r=He(e,t);n.observerPipeline(r);Ve[Be]=Ve[Be].filter((function(n){return n.id!==e.id}))}),Xe)};var Je=function(e,n){setTimeout((function(){var t=Ve[Be].find((function(n){return n.id===e}));if(!t){return}var r=He(t,{exceptionType:"timeout-without-response"});n.observerPipeline(r);Ve[Be]=Ve[Be].filter((function(n){return n.id!==e}))}),Ge)};var Qe=function(e){var n=XMLHttpRequest.prototype.open;var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function t(r,i,o,a,u){try{var s;var c=Ue();this.__requestId=c;var f=S(i,URL)?i.href:new URL(i,window.location.href).href;if(!Me(f,(s=e.config)===null||s===void 0?void 0:s.enableRecordAPIPerformanceWhitelist)){return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}var l={id:c,startTime:performance.now(),method:r,url:f,entries:[],initiatorType:"xmlhttprequest"};Ve[Be].push(l);Je(c,e);return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}catch(t){e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject XHR open error",error:t}});return n.call(this,r,i,o!==null&&o!==void 0?o:true,a,u)}};XMLHttpRequest.prototype.send=function n(){var r=this;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}try{var u=Ve[Be].find((function(e){return e.id===r.__requestId}));if(!u){return t.apply(this,o)}var s=this;this.addEventListener("loadend",b((function(){var n,t,r,i,o,a,c;return U(this,(function(f){switch(f.label){case 0:n=performance.now();t=n-u.startTime;r=s.status;if(r===0){return[2]}u.endTime=n;u.duration=t;u.responseStatus=r;f.label=1;case 1:f.trys.push([1,6,,7]);if(!(s.responseType===""||s.responseType==="text"))return[3,2];i=s.responseText;return[3,5];case 2:if(!(s.responseType==="json"))return[3,3];i=s.response;return[3,5];case 3:if(!(s.responseType==="blob"))return[3,5];o=s.response;if(!((o===null||o===void 0?void 0:o.type)==="application/json"))return[3,5];return[4,o.text()];case 4:i=f.sent();f.label=5;case 5:a=i&&typeof i==="string"?JSON.parse(i):i;if(a&&ze(a)){u.errorType="graphqlError";u.errorDetail=a.errors}return[3,7];case 6:c=f.sent();e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in XHR",url:u===null||u===void 0?void 0:u.url,error:c}});return[3,7];case 7:$e(u,e);return[2]}}))})));this.addEventListener("error",(function(){$e(u,e,{exceptionType:"network-error"})}));this.addEventListener("abort",(function(){$e(u,e,{exceptionType:"abort-error"})}));this.addEventListener("timeout",(function(){$e(u,e,{exceptionType:"timeout-error"})}));return t.apply(this,o)}catch(n){e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"InjectXHR send error",error:n}});throw n}}};var Ye=function(e){var n=window.fetch;window.fetch=b((function(){var t,r,i,o,a,u,s,c,f,l,d,v,p,m,h,y;var w=arguments;return U(this,(function(g){switch(g.label){case 0:for(t=w.length,r=new Array(t),i=0;i<t;i++){r[i]=w[i]}u=new URL(S(r[0],Request)?r[0].url:String(r[0]),window.location.href).href;if(!!Me(u,(o=e.config)===null||o===void 0?void 0:o.enableRecordAPIPerformanceWhitelist))return[3,2];return[4,n.apply(this,r)];case 1:return[2,g.sent()];case 2:g.trys.push([2,9,,10]);c=performance.now();f=Ue();a={id:f,startTime:c,method:((s=S(r[0],Request)?r[0]:r[1])===null||s===void 0?void 0:s.method)||"GET",url:u,entries:[],initiatorType:"fetch"};Ve[Be].push(a);Je(f,e);return[4,n.apply(this,r)];case 3:l=g.sent();d=performance.now();a.endTime=d;a.duration=d-c;a.responseStatus=l.status;v=l.clone();g.label=4;case 4:g.trys.push([4,7,,8]);if(!v.ok)return[3,6];return[4,v.json()];case 5:p=g.sent();if(p&&ze(p)){a.errorType="graphqlError";a.errorDetail=p.errors}g.label=6;case 6:return[3,8];case 7:m=g.sent();e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Parse response body error in fetch",url:a===null||a===void 0?void 0:a.url,error:m}});return[3,8];case 8:$e(a,e);return[2,l];case 9:h=g.sent();if(a&&a.id&&Ve[Be].find((function(e){return e.id===(a===null||a===void 0?void 0:a.id)}))){y="fetch-error";if(S(h,TypeError)){y="network-error"}else if(S(h,DOMException)&&h.name==="AbortError"){y="abort-error"}$e(a,e,{exceptionType:y})}else{e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{message:"Inject fetch error",error:h}})}throw h;case 10:return[2]}}))}))};var Ze=function(e){var n;Qe(e);Ye(e);if((n=window)===null||n===void 0?void 0:n.PerformanceObserver){var t=new window.PerformanceObserver((function(e){var n=e.getEntries();n.forEach((function(e){var n=e;if(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest"){var t=Ve[Be].filter((function(e){return e.url===n.name}));t.forEach((function(e){e.entries.push(n)}))}}))}));t.observe({entryTypes:["resource"],buffered:true})}else{e.normalLogPipeLine({severity:"warn",eventName:"apiPerformancePluginError",extraInfo:{error:"PerformanceObserver Not Supported"}})}};var en=new be({name:"apiPerformancePlugin",setUp:function(){var e=b((function(e){var n,t;return U(this,(function(r){if(Ve[We]){return[2]}if(((n=e.config)===null||n===void 0?void 0:n.enableRecordAPIPerformance)&&Math.random()<(((t=e.config)===null||t===void 0?void 0:t.enableRecordAPIPerformancePercentage)||0)){Ve[We]=true;Ze(e)}return[2]}))}));return function(n){return e.apply(this,arguments)}}()});var nn="3.1.0";var tn=function(){function e(n){var t=this;var r=n.config,i=n.plugins,o=i===void 0?[]:i;k(this,e);this.config=K;this.lifeCycle=new ge;this.plugins=[];this._commonData=q;this._MFECommonDataMap={};this.timeMap={};this.packedDataConvert=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o,a;var u=j({severity:n,eventName:r,currentHref:t.config.hideSearchParams?(((o=location)===null||o===void 0?void 0:o.href)||"").split("?")[0]||"":((a=location)===null||a===void 0?void 0:a.href)||""},i);if(t.config.isWebappContainer){u.MFEName=Z(t)}return u};this.normalPipelineObj=we([me(this,8),he(this),ve(this)]);this.observerPipelineObj=we([me(this,8),pe(this)]);this.immediateSendPipe=ve(this);this.observerPipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.observerPipelineObj(o)};this.normalLogPipeLine=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});if(t.config.disableThrottle){return t.immediateSendPipe(o)}else{return t.normalPipelineObj(o)}};this.ImmediatePipeline=function(e){var n=e.severity,r=e.eventName,i=e.extraInfo;var o=t.packedDataConvert({severity:n,eventName:r,extraInfo:i});return t.immediateSendPipe(o)};this.plugins=_(o);this.setConfig(r);this.initCommonData(r);this.lifeCycle.emit(X.onInit);if(r.enableErrorMonitoring){this.plugins.push(Se)}if((r===null||r===void 0?void 0:r.assetSpeedMonitoringWhiteList)&&r.assetSpeedMonitoringWhiteList.length>0||r.isWebappContainer){this.plugins.push(Re)}if(r===null||r===void 0?void 0:r.enableDetectPageChange){this.plugins.push(_e)}if(r===null||r===void 0?void 0:r.enableRecordPageRetention){this.plugins.push(Le)}if((r===null||r===void 0?void 0:r.enableRecordAPIPerformance)&&(r===null||r===void 0?void 0:r.enableRecordAPIPerformancePercentage)&&r.enableRecordAPIPerformancePercentage>0&&r.enableRecordAPIPerformancePercentage<=1){this.plugins.push(en)}this.installPlugins()}E(e,[{key:"installPlugins",value:function e(){var n=this;this.plugins.forEach((function(e){e.patch(n)}))}},{key:"commonData",get:function e(){return this._commonData}},{key:"MFECommonDataMap",get:function e(){return this._MFECommonDataMap}},{key:"initCommonData",value:function e(n){this._commonData.sessionId=n.useSessionStorageForSessionId?ee():Y();this._commonData.deviceId=ne()||F;this._commonData.riskDeviceId=te();this._commonData.networkType=re()||"unknown";this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||F;this._commonData.appVersion=n.appVersion;this._commonData.appName=n.appName;this._commonData.sdkVersion=nn;this.lifeCycle.emit(X.onCommonDataInit,this.commonData)}},{key:"updateCommonDataBasedOnConfig",value:function e(n){this.lifeCycle.emit(X.onCommonUpdated,this._commonData);this._commonData.env=n.env||this._commonData.env;this._commonData.appName=n.appName||this._commonData.appName;this._commonData.env=n.env||this._commonData.env;this._commonData.accountId=n.accountId||this._commonData.accountId;this._commonData.appVersion=n.appVersion||this._commonData.appVersion}},{key:"updateCommonData",value:function e(n){this.lifeCycle.emit(X.onCommonUpdated,this._commonData);this._commonData=j({},this._commonData,n)}},{key:"removeCommonDataByKey",value:function e(n){var t=this;this.lifeCycle.emit(X.onCommonUpdated,this._commonData);setTimeout((function(){n.forEach((function(e){delete t._commonData[e]}))}),1e3)}},{key:"addToMFECommonData",value:function e(n){var t=n.MFEName,r=n.MFECommonData;var i;if(!this.config.isWebappContainer){return}if(!t||!r){return}this._MFECommonDataMap=R(j({},this._MFECommonDataMap||{}),I({},t,j({},((i=this._MFECommonDataMap)===null||i===void 0?void 0:i[t])||{},r)))}},{key:"setConfig",value:function e(n){var t=this;if(this.config.isWebappContainer){return}var r=function(e,n){t.config[e]=n};Object.entries(n).forEach((function(e){var n=O(e,2),t=n[0],i=n[1];if((typeof i==="undefined"?"undefined":A(i))!==void 0){r(t,i)}}));this.lifeCycle.emit(X.onConfigInit,this.config);this.updateCommonDataBasedOnConfig(n)}},{key:"verbose",value:function e(n,t){this.normalLogPipeLine({severity:"verbose",eventName:n,extraInfo:t})}},{key:"httpLog",value:function e(n,t){this.normalLogPipeLine({severity:"http",eventName:n,extraInfo:t})}},{key:"info",value:function e(n,t){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:t})}},{key:"warn",value:function e(n,t){this.normalLogPipeLine({severity:"warn",eventName:n,extraInfo:t})}},{key:"error",value:function e(n,t){console.error("error",n);this.normalLogPipeLine({severity:"error",eventName:n,extraInfo:t})}},{key:"businessLog",value:function e(n,t){this.normalLogPipeLine({severity:"info",eventName:n,extraInfo:R(j({},t),{isBusinessLog:true})})}},{key:"reportDuration",value:function e(n,t,r){if(typeof n!=="string"){console.warn("reportDuration: eventName (first param) must be a string");return}if(typeof t!=="number"){console.warn("reportDuration: duration (second param) must be number");return}if(t<0||t>6e4){console.warn("reportDuration: duration (second param) must between 0 and 60000");return}this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:j({duration:t},r)})}},{key:"getTimerKey",value:function e(n){var t=Z(this);return this.config.isWebappContainer?"".concat(t,"_").concat(n):n}},{key:"timeStart",value:function e(n){if(typeof n!=="string"){console.warn("time: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){console.warn("Timer ".concat(n," already exists"))}this.timeMap[this.getTimerKey(n)]=Date.now()}},{key:"timeEnd",value:function e(n,t){if(typeof n!=="string"){console.warn("timeEnd: first param must be a string");return}if(this.timeMap[this.getTimerKey(n)]){var r=Date.now()-this.timeMap[this.getTimerKey(n)]+(t||0);this.normalLogPipeLine({severity:"speed",eventName:n,extraInfo:{duration:r}});delete this.timeMap[this.getTimerKey(n)]}else{console.warn("Timer key :".concat(n," does not exist"))}}},{key:"addToAssetSpeedWhiteListByMFE",value:function e(n){var t=n.MFEName,r=n.whiteList;var i;if(!this.config.isWebappContainer){return}if(!t||!(r===null||r===void 0?void 0:r.length)){return}if(!this.config.assetSpeedMonitoringWhiteListByMFE){this.config.assetSpeedMonitoringWhiteListByMFE={}}if(!((i=this.config.assetSpeedMonitoringWhiteListByMFE)===null||i===void 0?void 0:i[t])){this.config.assetSpeedMonitoringWhiteListByMFE=R(j({},this.config.assetSpeedMonitoringWhiteListByMFE),I({},t,r))}else{var o;var a,u;(u=this.config.assetSpeedMonitoringWhiteListByMFE)===null||u===void 0?void 0:(a=u[t])===null||a===void 0?void 0:(o=a).push.apply(o,_(r))}}},{key:"destroy",value:function e(){if(this.config.isWebappContainer){return}this.plugins.forEach((function(e){e.uninstall()}))}}]);return e}();var rn=tn;var on=function(e,n){on=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t))e[t]=n[t]};return on(e,n)};function an(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");on(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}var un=function(){un=Object.assign||function e(n){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))n[o]=t[o]}return n};return un.apply(this,arguments)};function sn(e,n,t,r){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):i(e.value).then(a,u)}s((r=r.apply(e,n||[])).next())}))}function cn(e,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(n){return s([e,n])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(t=0)),t)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;i=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1];o=u;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(u);break}if(o[2])t.ops.pop();t.trys.pop();continue}u=n.call(e,t)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}function fn(e,n,t){if(t||arguments.length===2)for(var r=0,i=n.length,o;r<i;r++){if(o||!(r in n)){if(!o)o=Array.prototype.slice.call(n,0,r);o[r]=n[r]}}return e.concat(o||Array.prototype.slice.call(n))}typeof SuppressedError==="function"?SuppressedError:function(e,n,t){var r=new Error(t);return r.name="SuppressedError",r.error=e,r.suppressed=n,r};var ln="@airwallex/components-sdk";var dn="1.30.2";var vn="./lib/index.js";var pn="./lib/index.mjs";var mn="./lib/index.d.ts";var hn=["lib/**"];var yn="MIT";var wn={"load-types":"node ./load-types.js && yarn prettier -w src/types/*d.ts",prebuild:"yarn clean",build:"yarn rollup --config",postbuild:"yarn bundle-types","bundle-types":"dts-bundle-generator -o ./lib/index.d.ts ./src/index.ts",clean:"rm -rf dist lib",lint:'eslint "src/**/*.ts*"',test:"jest",sonar:"sonar-scanner",release:"semantic-release","lint-stage":"lint-staged",prepare:"husky"};var gn={semi:true,singleQuote:true,printWidth:80,trailingComma:"all"};var bn={access:"public"};var kn={"@babel/preset-typescript":"^7.18.6","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.6","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/gitlab":"^6.1.0","@semantic-release/release-notes-generator":"^9.0.0","@swc/core":"^1.3.46","@types/jest":"^29.5.0","@typescript-eslint/eslint-plugin":"^5.57.0","@typescript-eslint/parser":"^5.57.0","dts-bundle-generator":"^9.0.0",eslint:"^7.23.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^5.1.3",husky:"^9.0.11",jest:"^29.5.0","jest-environment-jsdom":"^29.5.0","lint-staged":"^15.2.7",prettier:"^3.3.2",rollup:"^4.9.6","semantic-release":"^17.3.8","sonarqube-scanner":"^3.0.1","ts-jest":"^29.0.5","ts-loader":"^9.5.1",tslib:"^2.6.2",typescript:"^4.5.2"};var xn={"@airwallex/airtracker":"^3.0.0"};var En={name:ln,version:dn,main:vn,module:pn,types:mn,files:hn,license:yn,scripts:wn,prettier:gn,"lint-staged":{"src/**/*.{ts,tsx}":["yarn lint"],"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}":"prettier --write"},publishConfig:bn,devDependencies:kn,dependencies:xn};var In={dev:M.staging,staging:M.staging,demo:M.demo,prod:M.production};var Sn=function(e,n){if(e===void 0){e=M.production}if(!window._AirwallexSDKs.airTracker){window._AirwallexSDKs.airTracker=new rn({config:{appName:"components-sdk",appVersion:En.version,env:In[e]||M.production}});window._AirwallexSDKs.airTracker.updateCommonData({clientId:n})}return window._AirwallexSDKs.airTracker};var Cn=function(e){if(typeof e!=="object"){return e}try{var n=JSON.parse(JSON.stringify(e));Object.keys(n).forEach((function(e){if(typeof e==="string"&&["auth","code"].some((function(n){return e.includes(n)}))){n[e]="***"}}));return n}catch(n){return e}};var Nn=function(e,n){var t,r;(r=(t=window._AirwallexSDKs)===null||t===void 0?void 0:t.airTracker)===null||r===void 0?void 0:r.error(e,un(un({},n),{context:"components-sdk"}))};var Tn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.warn(e,un(un({},n),{context:"components-sdk"}))};var Dn=function(e,n){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.info(e,un(un({},n),{context:"components-sdk"}))};var jn=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="LOAD_SCRIPT_ERROR";return t}return n}(Error);var Pn,Rn;var On;(function(e){e["dev"]="dev";e["staging"]="staging";e["demo"]="demo";e["prod"]="prod";e["sandbox"]="sandbox"})(On||(On={}));var _n=(Pn={},Pn[On.dev]="https://checkout-staging.airwallex.com",Pn[On.staging]="https://checkout-staging.airwallex.com",Pn[On.demo]="https://checkout-demo.airwallex.com",Pn[On.prod]="https://checkout.airwallex.com",Pn[On.sandbox]="https://checkout.sandbox.airwallex.com",Pn);var An=(Rn={},Rn[On.dev]="https://static-staging.airwallex.com",Rn[On.staging]="https://static-staging.airwallex.com",Rn[On.demo]="https://static-demo.airwallex.com",Rn[On.prod]="https://static.airwallex.com",Rn[On.sandbox]="https://static.sandbox.airwallex.com",Rn);var Ln="sdkController";var Un="payments";var Mn={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js"};var Fn={kyc:"kyc",paymentsKyb:"paymentsKyb",kycRfi:"rfi",transactionRfi:"rfi",paymentEnablementRfi:"rfi",lendingRfi:"rfi",mrmRfi:"rfi",payoutForm:"payouts",beneficiaryForm:"payouts",hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments",cardNumber:"payments",applePayButton:"payments",googlePayButton:"payments",krCardNumber:"payments",krCardIdentifier:"payments",krCardExpiry:"payments",krCardPswFirstTwo:"payments",scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",embeddedCheckout:"billing"};var Kn={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"]};var qn={billing:["payments"]};var Hn=["payments","sca"];var zn=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INVALID_STATIC_RESOURCE_ERROR";return t}return n}(Error);var Bn=Date.now();var Wn=function(e){return Object.keys(Kn).includes(e)};var Xn=function(e){if(e===void 0){e=500}return new Promise((function(n){return window.setTimeout(n,e)}))};var Gn=function(e){return Fn[e]};var Vn=function(e,n){var t=e===Un?_n:An;return t[n]||t.prod};var $n=function(e){var n=e.reduce((function(e,n){return e.concat(Wn(n)?Kn[n]:n)}),[]);return Array.from(new Set(n)).map((function(e){return{elementName:e,sdkName:Gn(e)}}))};var Jn=function(e){return Array.from(new Set($n(e).map((function(e){var n=e.sdkName;return n})).filter((function(e){return Hn.includes(e)}))))};var Qn=function(e){return e==="payments"?"payment":e};var Yn=function(e){var n=e.name,t=e.env,r=t===void 0?On.prod:t;var i=Vn(n,r);var o=Mn[n];if(!o){Nn("[components-sdk] Element static resource not found",{sdkName:n});throw new zn("Element ".concat(n," static resource URL is invalid."))}return"".concat(i).concat(o,"?ts=").concat(Bn)};var Zn=function(){return Hn.reduce((function(e,n){var t;return un(un({},e),(t={},t[n]=window._AirwallexSDKs.__controller__.internalSDKs[n],t))}),{})};var et=function(e){return qn[e]||[]};var nt=function(){return Math.floor(performance.now())};var tt=function(e){var n=document.createElement("script");n.src=e;n.type="module";var t=document.head||document.body;t.appendChild(n);return n};var rt=3;var it=function(e){return sn(void 0,void 0,void 0,(function(){var n,t;return cn(this,(function(r){switch(r.label){case 0:if(typeof window==="undefined"){throw new Error("Please load script in browser environment")}n=0;t=function(){return sn(void 0,void 0,void 0,(function(){var t,r,i;return cn(this,(function(o){t=nt();if(n>0&&e.includes("?ts=")){r=new URL(e,window.location.href);r.searchParams.set("ts","".concat(Date.now()));e=r.toString()}i=tt(e);return[2,new Promise((function(r,o){i.addEventListener("load",(function(){var i=nt();Dn("[components-sdk] SDK script loaded",{scriptUrl:e,start:t,latency:i-t,end:i,retryCount:n});r(true)}));i.addEventListener("error",(function(r){i.remove();console.error(r);var a=nt();Nn("[components-sdk] Failed to load script",{scriptUrl:e,error:r,start:t,latency:a-t,end:a,retryCount:n});o(new jn("Failed to load Airwallex SDK scripts: ".concat(e)))}))}))]}))}))};r.label=1;case 1:if(!(n<rt))return[3,7];r.label=2;case 2:r.trys.push([2,4,,6]);return[4,t()];case 3:return[2,r.sent()];case 4:r.sent();n++;return[4,Xn()];case 5:r.sent();return[3,6];case 6:return[3,1];case 7:Nn("[components-sdk] Failed to load script after retry",{scriptUrl:e,retryCount:n});throw new jn("Failed to load Airwallex SDK scripts: ".concat(e))}}))}))};var ot=function(e){an(n,e);function n(n){var t=e.call(this,n)||this;t.code="INSTANCE_NOT_FOUND_ERROR";return t}return n}(Error);var at;var ut=new Map;var st=function(e){var n=e.env,t=e.scriptName;var r=Yn({name:t,env:n});var i=ut.get(t);if(i){return i}var o=it(r);ut.set(t,o);return o};var ct=function(e){var n=e.env,t=e.scriptName;return sn(void 0,void 0,void 0,(function(){var e;return cn(this,(function(r){switch(r.label){case 0:e=et(t);if(!(e.length>0))return[3,2];return[4,Promise.all(e.map((function(e){return st({env:n,scriptName:e})})))];case 1:r.sent();r.label=2;case 2:return[2,st({env:n,scriptName:t})]}}))}))};var ft=function(e){return sn(void 0,void 0,void 0,(function(){return cn(this,(function(n){if(typeof window==="undefined"){throw new Error("Please call the `init()` function in a browser environment.")}Sn(e.env,e.clientId);Dn("[components-sdk] SDK init start",{options:Cn(e),start:nt()});at=new Promise((function(n,t){var r;var i=un(un({},e),{env:e.env&&On[e.env]?e.env:On.prod});window.AirwallexComponentsSDK.__env__=i.env;var o=st({env:i.env,scriptName:Ln}).then((function(){return window._AirwallexSDKs.__controller__.init(i)}));var a=(r=e.enabledElements)!==null&&r!==void 0?r:[];var u=Jn(a);var s=u.map((function(e){return st({env:i.env,scriptName:e}).then((function(){return o})).then((function(){var n=window._AirwallexSDKs[Qn(e)];if(!n){Nn("[components-sdk] SDK instance not found",{functionsNamespace:e,windowSDKInstanceName:Qn(e)});throw new ot("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerFunctions({functionsNamespace:e,instance:n})}))}));var c=$n(a);var f=c.map((function(e){var n=e.sdkName,t=e.elementName;return ct({scriptName:n,env:i.env}).then((function(){return o})).then((function(){var e=window._AirwallexSDKs[Qn(n)];if(!e){Nn("[components-sdk] SDK instance not found",{sdkName:n,windowSDKInstanceName:Qn(n)});throw new ot("SDK instance not found")}return window._AirwallexSDKs.__controller__.registerElement({sdkName:n,elementName:t,instance:e})}))}));Promise.all(fn(fn([o],s,true),f,true)).then((function(){Dn("[components-sdk] SDK initialized",{options:Cn(e),start:nt()});n(Zn())}))["catch"]((function(e){if(!e.code){Nn("[components-sdk] Unexpected errors when init",{error:e})}t(e)}))}));return[2,at]}))}))};var lt=e("l",(function(e,n){return sn(void 0,void 0,void 0,(function(){var t,r,i,o,a;return cn(this,(function(u){switch(u.label){case 0:if(!e){throw new Error("Element type is missing. Please specify a valid element.")}Dn("[components-sdk] SDK createElement start",{elementName:e,options:Cn(n),timestamp:nt()});if(!at){Tn("[components-sdk] Did not call init before createElement");throw new Error("Please initialize the Element before creating it.")}return[4,at];case 1:u.sent();t=Gn(e);if(!t){throw new Error("`createElement()` with type `".concat(e,"` is not supported. Please specify a valid Element type."))}r=nt();u.label=2;case 2:u.trys.push([2,6,,7]);return[4,ct({scriptName:t,env:window.AirwallexComponentsSDK.__env__||On.prod})];case 3:u.sent();return[4,window._AirwallexSDKs.__controller__.registerElement({sdkName:t,elementName:e,instance:window._AirwallexSDKs[Qn(t)]})];case 4:u.sent();return[4,window._AirwallexSDKs.__controller__.createElement(e,n)];case 5:i=u.sent();o=nt();Dn("[components-sdk] SDK createElement being called",{elementName:e,options:Cn(n),start:r,latency:o-r,end:o});return[3,7];case 6:a=u.sent();if(!a.code){Nn("[components-sdk] Unexpected errors when createElement",{error:a})}else{throw a}return[3,7];case 7:return[2,i]}}))}))}));var dt=[Ln,Un];var vt=function(){dt.forEach((function(e){var n=Yn({name:e,env:On.prod});var t=document.createElement("link");t.href=n;t.rel="modulepreload";t.as="script";var r=document.head||document.body;r.appendChild(t)}))};var pt=typeof document==="undefined"||typeof window==="undefined";if(!pt){if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",vt)}else{vt()}}if(typeof window!=="undefined"){if(!window.AirwallexComponentsSDK){Object.defineProperties(window,{AirwallexComponentsSDK:{value:{},writable:false},_AirwallexSDKs:{value:{},writable:false}})}window.AirwallexComponentsSDK.init=ft;window.AirwallexComponentsSDK.createElement=lt}var mt=n((function(){return{clientSecret:null,currency:null,hasPaymentError:false,isReady:false,paymentConfirmed:false,paymentIntentId:null}})),ht=mt.onChange,yt=mt.reset,wt=mt.state;e({n:ht,k:yt,b:wt});var gt=e("a",(function(e){if(e.paymentProcessor!=="AIRWALLEX"){return false}if(e.clientSecret){wt.clientSecret=e.clientSecret}if(e.paymentIntentId){wt.paymentIntentId=e.paymentIntentId}if(!wt.clientSecret){a("Airwallex checkout session is missing the client secret");return false}return true}));var bt={ar:"ar",da:"da",de:"de",en:"en",es:"es",fr:"fr",id:"id",it:"it",ja:"ja",ko:"ko",nl:"nl",pl:"pl",pt:"pt",ru:"ru",sv:"sv",zh:"zh"};var kt=e("m",(function(e){return bt[e]||"en"}));var xt=null;var Et=e("f",(function(){return sn(m,void 0,void 0,(function(){var e;return cn(this,(function(n){if(wt.isReady){return[2,true]}if(!xt){e=(!t.zonosMode||t.zonosMode==="production")&&t.checkoutSettings.mode==="LIVE";xt=ft({enabledElements:["payments"],env:e?"prod":"demo",locale:kt(i.selectedLocale)}).then((function(){wt.isReady=true;c("Airwallex SDK initialized");return true})).catch((function(e){a(e);xt=null;return false}))}return[2,xt]}))}))}));var It=["SUCCEEDED","REQUIRES_CAPTURE","PENDING_REVIEW","PENDING"];var St=e("e",(function(e){return!!e&&It.includes(e)}));var Ct=e("j",(function(e){switch(e){case"SUCCEEDED":{return{isError:false,messages:[r("Thank you for submitting your payment. We appreciate your prompt attention."),"",r("A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.")]}}case"PENDING":case"PENDING_REVIEW":case"REQUIRES_CAPTURE":{return{isError:false,messages:[r("Payment processing. We'll update you when payment is received.")]}}case"REQUIRES_CUSTOMER_ACTION":{return{isError:false,messages:[r("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.")]}}case"CANCELLED":case"REQUIRES_PAYMENT_METHOD":{return{isError:true,messages:[r("Payment failed. Please reload the page and try another payment method.")]}}default:{return{isError:true,messages:[r("Something went wrong.")]}}}}));var Nt=e("d",(function(e){return sn(m,void 0,void 0,(function(){var n,t,r;return cn(this,(function(i){switch(i.label){case 0:return[4,u("/api/zonos-elements/collect/airwallex-payment-intent",{body:{paymentIntentId:e},method:"POST"})];case 1:n=i.sent(),t=n.errors,r=n.json;if(t.length||!r){a("Failed to retrieve Airwallex payment intent",t);return[2,{status:null}]}return[2,{status:r.airwallexPaymentIntent.status}]}}))}))}));var Tt=n((function(){return{amountDutyTaxFeeTotal:null,amountTotalPaid:null,collectLogoUrl:null,isFetchingShippingInfo:true,landedCostShortId:null,originCompanyName:null,partyBillingId:null,paymentProcessor:null,shippingAddress:null}})),Dt=Tt.reset,jt=Tt.state;e("c",jt);var Pt=e("h",(function(e){return sn(m,[e],void 0,(function(e){var n,r,i,o,a,c,f,l,d,p,m,h,y,w;var g=e.landedCostId,b=e.retries,k=b===void 0?5:b;return cn(this,(function(e){switch(e.label){case 0:jt.isFetchingShippingInfo=true;return[4,u("/api/zonos-elements/collect/get-shipping-info-by-lc-id",{body:{landedCostId:g},method:"POST"})];case 1:m=e.sent();if(!m.errors.length)return[3,4];if(!(k>0))return[3,3];return[4,new Promise((function(e){return setTimeout(e,1e3)}))];case 2:e.sent();return[2,Pt({landedCostId:g,retries:k-1})];case 3:return[2,null];case 4:jt.landedCostShortId=((n=m.json)===null||n===void 0?void 0:n.landedCostShortId)||null;jt.isFetchingShippingInfo=false;jt.shippingAddress=((r=m.json)===null||r===void 0?void 0:r.shipping)||null;h=(i=v.checkoutSession)===null||i===void 0?void 0:i.landedCost;y=(o=v.checkoutSession)===null||o===void 0?void 0:o.subtotals;w=(((a=h===null||h===void 0?void 0:h.amountSubtotals)===null||a===void 0?void 0:a.shipping)||0)+(((c=h===null||h===void 0?void 0:h.amountSubtotals)===null||c===void 0?void 0:c.items)||0);jt.amountTotalPaid=w*(((f=y===null||y===void 0?void 0:y.exchangeRate)===null||f===void 0?void 0:f.rate)||1);jt.amountDutyTaxFeeTotal=((y===null||y===void 0?void 0:y.duties)||0)+((y===null||y===void 0?void 0:y.taxes)||0)+((y===null||y===void 0?void 0:y.fees)||0);jt.originCompanyName=((d=(l=m.json)===null||l===void 0?void 0:l.origin)===null||d===void 0?void 0:d.companyName)||null;jt.collectLogoUrl=((p=m.json)===null||p===void 0?void 0:p.collectLogoUrl)||null;if(jt.amountTotalPaid===0){void s({endpoint:"COLLECT_NO_TOTAL_PAID",errors:[],metadata:{landedCostId:g,organizationId:t.organizationId}})}return[2]}}))}))}));var Rt=e("i",(function(){return sn(m,void 0,void 0,(function(){var e,n,t,r,i,c,p,m,h,y;return cn(this,(function(w){switch(w.label){case 0:if(!((e=l.stripeBillingAddressEventData)===null||e===void 0?void 0:e.complete)){return[2,{partiesCreated:false}]}i=(t=(n=v.checkoutSession)===null||n===void 0?void 0:n.landedCost)===null||t===void 0?void 0:t.rootId;if(!i){void s({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:f,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId}});return[2,{partiesCreated:false}]}if(!o.checkoutSessionId){void s({endpoint:"COLLECT_NO_CHECKOUT_SESSION_ID",errors:["No checkout session id"],metadata:{allLogs:f,cartId:window.Zonos.cartId,landedCostRootId:i}});return[2,{partiesCreated:false}]}c=d({address:l.stripeBillingAddressEventData.value.address,firstName:l.stripeBillingAddressEventData.value.firstName,lastName:l.stripeBillingAddressEventData.value.lastName,name:l.stripeBillingAddressEventData.value.name,phone:l.stripeBillingAddressEventData.value.phone});p=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";return[4,u("/api/zonos-elements/create-billing-party",{body:{billingAddress:c,checkoutSessionId:o.checkoutSessionId,companyName:l.companyName,email:((r=l.stripeLinkEventData)===null||r===void 0?void 0:r.value.email)||"",isTest:p,rootId:i},method:"POST"})];case 1:m=w.sent(),h=m.errors,y=m.json;if(h.length||!y){a("Error occurs when creating billing party",JSON.stringify(h,null,2));void s({endpoint:"COLLECT_BILLING_PARTY_CREATE_FAILED",errors:["[COLLECT] Failed to create billing party"],metadata:{allLogs:f,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,errors:h,json:y}});return[2,{partiesCreated:false}]}jt.partyBillingId=y.billToPartyId;return[2,{partiesCreated:true}]}}))}))}));var Ot=e("g",(function(e){return sn(m,void 0,void 0,(function(){var n;return cn(this,(function(t){n=e.landedCost;if(!n){return[2,false]}v.landedCostData=[Object.assign(Object.assign({},e),{landedCost:Object.assign({},n),landedCostId:n.id})];return[2,p({applySubtotalsOnly:true,landedCostId:n.id,selectedShippingOption:n.shipmentRating})]}))}))}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,n,t,a){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,s){function o(e){try{l(a.next(e))}catch(e){s(e)}}function r(e){try{l(a["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,r)}l((a=a.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,i,s,o;return o={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function r(e){return function(n){return l([e,n])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,r[0]&&(t=0)),t)try{if(a=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=n.call(e,t)}catch(e){r=[6,e];i=0}finally{a=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,t,a){function i(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,s){function o(e){try{l(a.next(e))}catch(e){s(e)}}function r(e){try{l(a["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,r)}l((a=a.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,i,s,o;return o={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function r(e){return function(n){return l([e,n])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,r[0]&&(t=0)),t)try{if(a=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=n.call(e,t)}catch(e){r=[6,e];i=0}finally{a=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-016b5bde.system.js","./p-f55a2352.system.js","./p-fd2d4d04.system.js","./p-47a1d469.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-dab78981.system.js","./p-30e9a6d7.system.js","./p-2b8345d8.system.js"],(function(e){"use strict";var n,t,a,i,s,o,r,l,c,u,f,h,m,y,p,w,x,d;return{setters:[function(e){n=e.r;t=e.d;a=e.h;i=e.a;s=e.g},function(e){o=e.b;r=e.c;l=e.f;c=e.l;u=e.m;f=e.n},function(e){h=e.d},function(e){m=e.e;y=e.t;p=e.l},function(e){w=e.z},function(e){x=e.l},function(e){d=e.l},function(){},function(){},function(){}],execute:function(){var z=".sc-zonos-airwallex-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-airwallex-payment-h *.sc-zonos-airwallex-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-airwallex-payment-h img.sc-zonos-airwallex-payment{max-width:100%}.sc-zonos-airwallex-payment-h dl.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h dd.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h1.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h2.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h3.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h4.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h5.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h6.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h hr.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h figure.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h p.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h pre.sc-zonos-airwallex-payment{margin:0}.sc-zonos-airwallex-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-airwallex-payment-h{display:block}.sc-zonos-airwallex-payment-h .zonos--payment-error-banner.sc-zonos-airwallex-payment{margin-bottom:16px}.sc-zonos-airwallex-payment-h .zonos--airwallex-payment-component.sc-zonos-airwallex-payment{margin-bottom:4px;min-height:40px}";var b=z;var v=e("zonos_airwallex_payment",function(){function e(e){var a=this;n(this,e);this.airwallexPaymentSuccess=t(this,"airwallexPaymentSuccess",7);this.airwallexPaymentError=t(this,"airwallexPaymentError",7);this.element=null;this.storeUnsubscribeList=[];this.mountingClientSecret=null;this.hasError=false;this.clientSecret=o.clientSecret;this.getDropInOptions=function(e){var n;var t=w.checkoutSettings.captureDelay&&w.checkoutSettings.captureDelay>0;return{autoCapture:!t,client_secret:e,country_code:((n=r.shippingAddress)===null||n===void 0?void 0:n.location.countryCode)||undefined,currency:o.currency||h.currency,intent_id:o.paymentIntentId||undefined}};this.mountPaymentElement=function(){return __awaiter(a,void 0,void 0,(function(){var e,n,t,a,i,s;var r=this;return __generator(this,(function(u){switch(u.label){case 0:n=this.clientSecret;if(!n){return[2]}if(this.mountingClientSecret===n){return[2]}this.mountingClientSecret=n;return[4,l()];case 1:t=u.sent();if(!t){this.hasError=true;this.mountingClientSecret=null;return[2]}a=this.el.querySelector(".zonos--airwallex-payment-component");if(!a){d("Cannot find container element for Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2]}u.label=2;case 2:u.trys.push([2,4,,5]);(e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null;return[4,c("dropIn",this.getDropInOptions(n))];case 3:i=u.sent();if(!i){d("Failed to create Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2]}i.mount(a);i.on("success",(function(){x("Airwallex payment succeeded");o.hasPaymentError=false;o.paymentConfirmed=true;r.airwallexPaymentSuccess.emit()}));i.on("error",(function(e){d(e);o.hasPaymentError=true;r.airwallexPaymentError.emit()}));this.element=i;this.hasError=false;return[3,5];case 4:s=u.sent();d(s);this.hasError=true;this.mountingClientSecret=null;return[3,5];case 5:return[2]}}))}))};this.localeChangeHandler=function(){if(!a.element||!a.clientSecret){return}a.element.update(a.getDropInOptions(a.clientSecret),{locale:u(p.selectedLocale)})}}e.prototype.clientSecretWatcher=function(){void this.mountPaymentElement()};e.prototype.componentWillLoad=function(){var e=this;this.storeUnsubscribeList=[f("clientSecret",(function(n){e.clientSecret=n})),m("selectedLocale",this.localeChangeHandler)]};e.prototype.componentDidLoad=function(){void this.mountPaymentElement()};e.prototype.disconnectedCallback=function(){var e;this.storeUnsubscribeList.forEach((function(e){return e()}));(e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null};e.prototype.render=function(){return a(i,{key:"3d5f4aaea91533348ae6273757b8af6f17a7ab59",class:"zonos--airwallex-payment zonos--elements"},this.hasError&&a("zonos-banner",{key:"27fe7775145b9ff4f9b572ee592eb0cdc5f2ef13",class:"zonos--payment-error-banner",intent:"error"},y("We couldn't complete your payment. Please verify the payment details and try again.")),a("div",{key:"48a50ebcc6ad1e3b3cbf807ef5d466030995a171",class:"zonos--airwallex-payment-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{clientSecret:["clientSecretWatcher"]}},enumerable:false,configurable:true});return e}());v.style=b}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-67426156.system.js"],(function(r){"use strict";var n;return{setters:[function(r){n=r.i}],execute:function(){var t=r("f",(function(r){var t=/\[([^\]]+)\]\((https?:\/\/[^\s\)]+)\)|(https?:\/\/[^\s]+)/g;var e=r.replace(t,(function(r,t,e,o){var s;var i=e||o;var u=!!((s=window.Zonos)===null||s===void 0?void 0:s.isBigCommerce)&&n(i)?"_self":"_blank";var a=e?t:o;return'<zonos-link href="'.concat(i,'" target="').concat(u,'" rel="noopener noreferrer">').concat(a,"</zonos-link>")}));return e}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=t=>{try{const n=new URL(t,window.location.href),c=n.pathname.replace(/\/+$/,"");return n.hostname===window.location.hostname&&"/checkout"===c}catch(t){return!1}};export{t as i}
|