@astropay/payments-lib 2.0.21 → 2.0.23

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.
@@ -585,6 +585,17 @@ ${te}` : ""}`;
585
585
  function validateValue(ee, re, te) {
586
586
  return re.includes(ee) ? ee : te;
587
587
  }
588
+ function debounce(ee, re) {
589
+ let te = null;
590
+ const ne = ((...ie) => {
591
+ te !== null && clearTimeout(te), te = setTimeout(() => {
592
+ te = null, ee(...ie);
593
+ }, re);
594
+ });
595
+ return ne.cancel = () => {
596
+ te !== null && (clearTimeout(te), te = null);
597
+ }, ne;
598
+ }
588
599
  const NON_BREAKING_SPACE = " ", toCamelCase$1 = (ee) => ee.toLowerCase().replace(
589
600
  /(?:^|[^a-zA-Z0-9]+)([a-zA-Z0-9])/g,
590
601
  (re, te, ne) => ne === 0 ? te.toLowerCase() : te.toUpperCase()
@@ -3276,11 +3287,11 @@ instance.setDefaultNamespace;
3276
3287
  instance.hasLoadedNamespace;
3277
3288
  instance.loadNamespaces;
3278
3289
  instance.loadLanguages;
3279
- const translation$2 = { additional_information: "Additional information", almost_done: "Almost done...", already_paid: "Already paid?", astro_express_checkout: "Express checkout", check_payment_status: "Check payment status", checkout_method: "Checkout method", or: "OR", email: "E-mail", enter_country_code: "Please enter a country or code", enter_your_email: "Enter your e-mail", enter_your_document_number: "Enter your document number", enter_your_document_type: "Select a document type", enter_your_first_name: "Enter your first name", enter_your_last_name: "Enter your last name", enter_your_phone: "Enter your phone number", continue: "Continue", copied: "Copied!", copy_payment_link: "Copy payment link", document_number: "Document number", document_type: "Document type", do_not_close_window: "Please do not close this window.", didnt_receive: "Didn't receive it?", first_name: "First name", generic_error: "An error occurred. Please try again.", hold_on: "Hold on!", invalid_field: "Invalid field", last_name: "Last name", loading_wait: "Loading, please wait...", pay_amount: "Pay {{amount}}", payment_amount: "Payment amount", push_notification_sent: "We sent a push notification to your app", qr_code: "QR code", required_field: "Required Field", scan_qr_copy_link: "Scan the QR code with your phone's camera or copy the link.", select: "Select", select_item: "Select an item", time_up: "Time's up!", try_again: "Try again", waiting_confirmation: "Waiting for confirmation...", card_holder_label: "Cardholder name", card_holder_placeholder: "Full name as on card", card_number: "Card number", card_exp_date: "Expiration date", card_tokenization_error: "We couldn't process your card payment. Please check your details and try again.", payment_processing: "Processing your payment...", payment_still_processing: "This is taking a bit longer than usual, please hold on...", save_card_title: "Save this card", save_card_subtitle: "Pay faster next time", saved_cards_title: "Saved cards", pay_with_new_card: "Use another card", credit: "Credit", debit: "Debit", expires: "Exp.", cvv_security_hint: "We ask every time for security. It's the 3 digits on the back of your card.", delete_card_label: "Delete card", delete_card_confirm: "Remove this card?", delete_card_confirm_action: "Delete", delete_card_cancel_label: "Cancel", delete_card_error: "Could not remove card. Please try again." }, en$1 = {
3290
+ const translation$2 = { additional_information: "Additional information", almost_done: "Almost done...", already_paid: "Already paid?", astro_express_checkout: "Express checkout", check_payment_status: "Check payment status", checkout_method: "Checkout method", or: "OR", email: "E-mail", enter_country_code: "Please enter a country or code", enter_your_email: "Enter your e-mail", enter_your_document_number: "Enter your document number", enter_your_document_type: "Select a document type", enter_your_first_name: "Enter your first name", enter_your_last_name: "Enter your last name", enter_your_phone: "Enter your phone number", continue: "Continue", copied: "Copied!", copy_payment_link: "Copy payment link", document_number: "Document number", document_type: "Document type", do_not_close_window: "Please do not close this window.", didnt_receive: "Didn't receive it?", first_name: "First name", generic_error: "An error occurred. Please try again.", hold_on: "Hold on!", invalid_field: "Invalid field", last_name: "Last name", loading_wait: "Loading, please wait...", pay_amount: "Pay {{amount}}", payment_amount: "Payment amount", payment_method_unavailable: "Payment method not available.", push_notification_sent: "We sent a push notification to your app", qr_code: "QR code", required_field: "Required Field", scan_qr_copy_link: "Scan the QR code with your phone's camera or copy the link.", select: "Select", select_item: "Select an item", time_up: "Time's up!", try_again: "Try again", waiting_confirmation: "Waiting for confirmation...", card_holder_label: "Cardholder name", card_holder_placeholder: "Full name as on card", card_number: "Card number", card_exp_date: "Expiration date", card_tokenization_error: "We couldn't process your card payment. Please check your details and try again.", payment_processing: "Processing your payment...", payment_still_processing: "This is taking a bit longer than usual, please hold on...", save_card_title: "Save this card", save_card_subtitle: "Pay faster next time", saved_cards_title: "Saved cards", pay_with_new_card: "Use another card", credit: "Credit", debit: "Debit", expires: "Exp.", cvv_security_hint: "We ask every time for security. It's the 3 digits on the back of your card.", delete_card_label: "Delete card", delete_card_confirm: "Remove this card?", delete_card_confirm_action: "Delete", delete_card_cancel_label: "Cancel", delete_card_error: "Could not remove card. Please try again." }, en$1 = {
3280
3291
  translation: translation$2
3281
- }, translation$1 = { additional_information: "Información adicional", almost_done: "Casi listo...", already_paid: "Ya pagaste?", astro_express_checkout: "Pago express", check_payment_status: "Ver estado del pago", checkout_method: "Método de pago", or: "O", email: "Correo electrónico", enter_country_code: "Introduce el país o código del país", enter_your_email: "Ingrese su correo electrónico", enter_your_document_number: "Ingrese su número de documento", enter_your_document_type: "Seleccione un tipo de documento", enter_your_first_name: "Ingrese su nombre", enter_your_last_name: "Ingrese su apellido", enter_your_phone: "Introduzca su número de teléfono", continue: "Continuar", copied: "Copiado!", copy_payment_link: "Copiar enlace de pago", document_number: "Número de documento", document_type: "Tipo de documento", do_not_close_window: "Por favor, no cierres esta ventana.", didnt_receive: "No lo recibiste?", first_name: "Nombre", generic_error: "Ocurrió un error. Por favor, inténtelo de nuevo.", hold_on: "¡Un instante...!", invalid_field: "Campo inválido", last_name: "Apellido", loading_wait: "Cargando, aguantá un toque...", pay_amount: "Pagar {{amount}}", payment_amount: "Monto a pagar", push_notification_sent: "Enviamos una notificación push a tu app", qr_code: "código QR", required_field: "Campo Requerido", scan_qr_copy_link: "Escaneá el código QR con la cámara de tu teléfono o copia el enlace.", select: "Seleccionar", select_item: "Selecciona una opción", time_up: "Se acabó el tiempo!", try_again: "Inténtalo de nuevo", waiting_confirmation: "Esperando confirmación...", card_holder_label: "Nombre del titular", card_holder_placeholder: "Nombre completo en la tarjeta", card_number: "Número de tarjeta", card_exp_date: "Fecha de vencimiento", card_tokenization_error: "No pudimos procesar tu pago con tarjeta. Verificá los datos y volvé a intentarlo.", payment_processing: "Procesando tu pago...", payment_still_processing: "Está tardando un poco más de lo habitual, estamos verificando su estado.", save_card_title: "Guardar esta tarjeta", save_card_subtitle: "Para pagar más rápido la próxima vez", saved_cards_title: "Tarjetas guardadas", pay_with_new_card: "Usar otra tarjeta", credit: "Crédito", debit: "Débito", expires: "Vence", cvv_security_hint: "Lo pedimos cada vez por seguridad. Son los 3 dígitos al dorso de tu tarjeta.", delete_card_label: "Eliminar tarjeta", delete_card_confirm: "¿Eliminar esta tarjeta?", delete_card_confirm_action: "Eliminar", delete_card_cancel_label: "Cancelar", delete_card_error: "No se pudo eliminar la tarjeta. Inténtalo de nuevo." }, es = {
3292
+ }, translation$1 = { additional_information: "Información adicional", almost_done: "Casi listo...", already_paid: "Ya pagaste?", astro_express_checkout: "Pago express", check_payment_status: "Ver estado del pago", checkout_method: "Método de pago", or: "O", email: "Correo electrónico", enter_country_code: "Introduce el país o código del país", enter_your_email: "Ingrese su correo electrónico", enter_your_document_number: "Ingrese su número de documento", enter_your_document_type: "Seleccione un tipo de documento", enter_your_first_name: "Ingrese su nombre", enter_your_last_name: "Ingrese su apellido", enter_your_phone: "Introduzca su número de teléfono", continue: "Continuar", copied: "Copiado!", copy_payment_link: "Copiar enlace de pago", document_number: "Número de documento", document_type: "Tipo de documento", do_not_close_window: "Por favor, no cierres esta ventana.", didnt_receive: "No lo recibiste?", first_name: "Nombre", generic_error: "Ocurrió un error. Por favor, inténtelo de nuevo.", hold_on: "¡Un instante...!", invalid_field: "Campo inválido", last_name: "Apellido", loading_wait: "Cargando, aguantá un toque...", pay_amount: "Pagar {{amount}}", payment_amount: "Monto a pagar", payment_method_unavailable: "Método de pago no disponible.", push_notification_sent: "Enviamos una notificación push a tu app", qr_code: "código QR", required_field: "Campo Requerido", scan_qr_copy_link: "Escaneá el código QR con la cámara de tu teléfono o copia el enlace.", select: "Seleccionar", select_item: "Selecciona una opción", time_up: "Se acabó el tiempo!", try_again: "Inténtalo de nuevo", waiting_confirmation: "Esperando confirmación...", card_holder_label: "Nombre del titular", card_holder_placeholder: "Nombre completo en la tarjeta", card_number: "Número de tarjeta", card_exp_date: "Fecha de vencimiento", card_tokenization_error: "No pudimos procesar tu pago con tarjeta. Verificá los datos y volvé a intentarlo.", payment_processing: "Procesando tu pago...", payment_still_processing: "Está tardando un poco más de lo habitual, estamos verificando su estado.", save_card_title: "Guardar esta tarjeta", save_card_subtitle: "Para pagar más rápido la próxima vez", saved_cards_title: "Tarjetas guardadas", pay_with_new_card: "Usar otra tarjeta", credit: "Crédito", debit: "Débito", expires: "Vence", cvv_security_hint: "Lo pedimos cada vez por seguridad. Son los 3 dígitos al dorso de tu tarjeta.", delete_card_label: "Eliminar tarjeta", delete_card_confirm: "¿Eliminar esta tarjeta?", delete_card_confirm_action: "Eliminar", delete_card_cancel_label: "Cancelar", delete_card_error: "No se pudo eliminar la tarjeta. Inténtalo de nuevo." }, es = {
3282
3293
  translation: translation$1
3283
- }, translation = { additional_information: "Informações adicionais", almost_done: "Finalizando...", already_paid: "Já pagou?", astro_express_checkout: "Pagamento expresso", check_payment_status: "Verificar status do pagamento", checkout_method: "Método de pagamento", or: "OU", email: "E-mail", enter_country_code: "Informe um país ou código", enter_your_email: "Digite seu e-mail", enter_your_document_number: "Digite seu número de documento", enter_your_document_type: "Selecione um tipo de documento", enter_your_first_name: "Digite seu primeiro nome", enter_your_last_name: "Digite seu sobrenome", enter_your_phone: "Digite seu número de telefone", continue: "Continuar", copied: "Copiado!", copy_payment_link: "Copiar link de pagamento", document_number: "Número do documento", document_type: "Tipo de documento", do_not_close_window: "Por favor, não feche esta janela.", didnt_receive: "Não recebeu?", first_name: "Primeiro nome", generic_error: "Ocorreu um erro. Por favor, tente novamente.", hold_on: "Só um instante!", invalid_field: "Campo inválido", last_name: "Sobrenome", loading_wait: "Carregando, por favor aguarde...", pay_amount: "Pagar {{amount}}", payment_amount: "Valor do pagamento", push_notification_sent: "Enviamos uma notificação push para seu app", qr_code: "QR code", required_field: "Campo Obrigatório", scan_qr_copy_link: "Escaneie o QR código com a câmera do seu celular ou copie o link.", select: "Selecione", select_item: "Selecione um item", time_up: "Tempo esgotado!", try_again: "Tente novamente", waiting_confirmation: "Aguardando confirmação...", card_holder_label: "Nome do titular", card_holder_placeholder: "Nome completo no cartão", card_number: "Número do cartão", card_exp_date: "Data de validade", card_tokenization_error: "Não foi possível processar seu pagamento com o cartão. Verifique os dados e tente novamente.", payment_processing: "Processando seu pagamento...", payment_still_processing: "Está demorando um pouco mais que o usual, por favor aguarde...", save_card_title: "Salvar este cartão", save_card_subtitle: "Para pagar mais rápido na próxima vez", saved_cards_title: "Cartões salvos", pay_with_new_card: "Usar outro cartão", credit: "Crédito", debit: "Débito", expires: "Vence", cvv_security_hint: "Pedimos sempre por segurança. São os 3 dígitos no verso do cartão.", delete_card_label: "Remover cartão", delete_card_confirm: "Remover este cartão?", delete_card_confirm_action: "Remover", delete_card_cancel_label: "Cancelar", delete_card_error: "Não foi possível remover o cartão. Tente novamente." }, pt$1 = {
3294
+ }, translation = { additional_information: "Informações adicionais", almost_done: "Finalizando...", already_paid: "Já pagou?", astro_express_checkout: "Pagamento expresso", check_payment_status: "Verificar status do pagamento", checkout_method: "Método de pagamento", or: "OU", email: "E-mail", enter_country_code: "Informe um país ou código", enter_your_email: "Digite seu e-mail", enter_your_document_number: "Digite seu número de documento", enter_your_document_type: "Selecione um tipo de documento", enter_your_first_name: "Digite seu primeiro nome", enter_your_last_name: "Digite seu sobrenome", enter_your_phone: "Digite seu número de telefone", continue: "Continuar", copied: "Copiado!", copy_payment_link: "Copiar link de pagamento", document_number: "Número do documento", document_type: "Tipo de documento", do_not_close_window: "Por favor, não feche esta janela.", didnt_receive: "Não recebeu?", first_name: "Primeiro nome", generic_error: "Ocorreu um erro. Por favor, tente novamente.", hold_on: "Só um instante!", invalid_field: "Campo inválido", last_name: "Sobrenome", loading_wait: "Carregando, por favor aguarde...", pay_amount: "Pagar {{amount}}", payment_amount: "Valor do pagamento", payment_method_unavailable: "Método de pagamento não disponível.", push_notification_sent: "Enviamos uma notificação push para seu app", qr_code: "QR code", required_field: "Campo Obrigatório", scan_qr_copy_link: "Escaneie o QR código com a câmera do seu celular ou copie o link.", select: "Selecione", select_item: "Selecione um item", time_up: "Tempo esgotado!", try_again: "Tente novamente", waiting_confirmation: "Aguardando confirmação...", card_holder_label: "Nome do titular", card_holder_placeholder: "Nome completo no cartão", card_number: "Número do cartão", card_exp_date: "Data de validade", card_tokenization_error: "Não foi possível processar seu pagamento com o cartão. Verifique os dados e tente novamente.", payment_processing: "Processando seu pagamento...", payment_still_processing: "Está demorando um pouco mais que o usual, por favor aguarde...", save_card_title: "Salvar este cartão", save_card_subtitle: "Para pagar mais rápido na próxima vez", saved_cards_title: "Cartões salvos", pay_with_new_card: "Usar outro cartão", credit: "Crédito", debit: "Débito", expires: "Vence", cvv_security_hint: "Pedimos sempre por segurança. São os 3 dígitos no verso do cartão.", delete_card_label: "Remover cartão", delete_card_confirm: "Remover este cartão?", delete_card_confirm_action: "Remover", delete_card_cancel_label: "Cancelar", delete_card_error: "Não foi possível remover o cartão. Tente novamente." }, pt$1 = {
3284
3295
  translation
3285
3296
  }, LOCAL_TRANSLATIONS = {
3286
3297
  en: en$1,
@@ -3331,7 +3342,7 @@ class LoadingSuccess extends Component {
3331
3342
  const RUNTIME_CONFIG = {
3332
3343
  test: {
3333
3344
  NAME: "@astropay/payments-lib",
3334
- VERSION: "2.0.21",
3345
+ VERSION: "2.0.23",
3335
3346
  MODE: "test",
3336
3347
  API_BASE_URL: "https://partners-api-tst.astropay.com/api",
3337
3348
  RESOURCES_BUCKET: "https://rs-tst.astropay.com",
@@ -3341,7 +3352,7 @@ const RUNTIME_CONFIG = {
3341
3352
  },
3342
3353
  sandbox: {
3343
3354
  NAME: "@astropay/payments-lib",
3344
- VERSION: "2.0.21",
3355
+ VERSION: "2.0.23",
3345
3356
  MODE: "staging",
3346
3357
  API_BASE_URL: "https://partners-api-sandbox.astropay.com/api",
3347
3358
  RESOURCES_BUCKET: "https://rs-tst.astropay.com",
@@ -3351,7 +3362,7 @@ const RUNTIME_CONFIG = {
3351
3362
  },
3352
3363
  production: {
3353
3364
  NAME: "@astropay/payments-lib",
3354
- VERSION: "2.0.21",
3365
+ VERSION: "2.0.23",
3355
3366
  MODE: "production",
3356
3367
  API_BASE_URL: "https://partners-api.astropay.com/api",
3357
3368
  RESOURCES_BUCKET: "https://rs.astropay.com",
@@ -9630,7 +9641,7 @@ async function lazyLoadRecorder(ee = importRecorder) {
9630
9641
  async function importRecorder() {
9631
9642
  return (await import(
9632
9643
  /* webpackChunkName: "recorder" */
9633
- "./startRecording-DwCTGpkI.js"
9644
+ "./startRecording-CKEF3p21.js"
9634
9645
  )).startRecording;
9635
9646
  }
9636
9647
  function isProfilingSupported() {
@@ -9650,7 +9661,7 @@ async function lazyLoadProfiler(ee = importProfiler) {
9650
9661
  async function importProfiler() {
9651
9662
  return (await import(
9652
9663
  /* webpackChunkName: "profiler" */
9653
- "./profiler-DVuj-X7d.js"
9664
+ "./profiler-BftqmTdG.js"
9654
9665
  )).createRumProfiler;
9655
9666
  }
9656
9667
  function makeProfilerApi() {
@@ -11885,6 +11896,102 @@ class Button extends Component {
11885
11896
  });
11886
11897
  }
11887
11898
  }
11899
+ const defineBadgeStyles = ({ variant: ee }) => {
11900
+ const re = ThemeManager.getStyles();
11901
+ switch (ee) {
11902
+ case "highlight":
11903
+ return re.badge.highlight;
11904
+ case "error":
11905
+ return re.badge.error;
11906
+ case "success":
11907
+ return re.badge.success;
11908
+ case "warning":
11909
+ return re.badge.warning;
11910
+ case "default":
11911
+ default:
11912
+ return re.badge.default;
11913
+ }
11914
+ }, getJustifyContent = (ee) => {
11915
+ switch (ee) {
11916
+ case "end":
11917
+ return "flex-end";
11918
+ case "center":
11919
+ return "center";
11920
+ case "space-between":
11921
+ return "space-between";
11922
+ case "start":
11923
+ default:
11924
+ return "flex-start";
11925
+ }
11926
+ }, getBadgeStyles = ({
11927
+ variant: ee = "default",
11928
+ isFullWidth: re,
11929
+ align: te
11930
+ }) => css`
11931
+ box-sizing: border-box;
11932
+ display: flex;
11933
+ align-items: center;
11934
+ gap: 8px;
11935
+ flex-wrap: wrap;
11936
+
11937
+ width: ${re ? "100%" : "fit-content"};
11938
+ padding: ${typeof defineBadgeStyles({ variant: ee }).padding == "number" ? `${defineBadgeStyles({ variant: ee }).padding}px` : defineBadgeStyles({ variant: ee }).padding};
11939
+
11940
+ background-color: ${defineBadgeStyles({ variant: ee }).backgroundColor};
11941
+ border-radius: ${defineBadgeStyles({ variant: ee }).borderRadius}px;
11942
+
11943
+ border: ${defineBadgeStyles({ variant: ee }).borderWidth}px
11944
+ ${defineBadgeStyles({ variant: ee }).borderStyle} ${defineBadgeStyles({ variant: ee }).borderColor};
11945
+
11946
+ justify-content: ${getJustifyContent(te)};
11947
+
11948
+ .badge-content {
11949
+ display: flex;
11950
+ align-items: center;
11951
+ gap: 4px;
11952
+ flex-wrap: nowrap;
11953
+ color: ${defineBadgeStyles({ variant: ee }).textColor};
11954
+ }
11955
+ `;
11956
+ class Badge extends Component {
11957
+ constructor({
11958
+ items: re,
11959
+ variant: te = "default",
11960
+ isFullWidth: ne = !1,
11961
+ align: ie = "center"
11962
+ }) {
11963
+ super({
11964
+ tag: "div",
11965
+ styles: () => getBadgeStyles({ variant: te, isFullWidth: ne, align: ie })
11966
+ }), re.forEach(({ title: oe, icon: se, iconLeft: ae, iconRight: ce }) => {
11967
+ const ue = document.createElement("div");
11968
+ if (ue.classList.add("badge-content"), se || ae) {
11969
+ const de = new Icon({
11970
+ name: se || ae,
11971
+ size: 12,
11972
+ color: defineBadgeStyles({ variant: te }).textColor
11973
+ }).element;
11974
+ ue.append(de);
11975
+ }
11976
+ const le = new Typography({
11977
+ text: oe,
11978
+ size: "xSmall",
11979
+ weight: 500,
11980
+ color: defineBadgeStyles({ variant: te }).textColor,
11981
+ align: "center"
11982
+ }).element;
11983
+ if (ue.append(le), ce) {
11984
+ const de = new Icon({
11985
+ name: ce,
11986
+ size: 12,
11987
+ color: defineBadgeStyles({ variant: te }).textColor
11988
+ }).element;
11989
+ ue.append(de);
11990
+ }
11991
+ this.element.append(ue);
11992
+ });
11993
+ }
11994
+ }
11888
11995
  const defineInputStyles = (ee, re, te) => {
11889
11996
  const ne = ThemeManager.getStyles();
11890
11997
  return re ? ne.input.disabled : ee ? ne.input.error : ne.input.normal;
@@ -11932,6 +12039,10 @@ const defineInputStyles = (ee, re, te) => {
11932
12039
  border-color: ${re ? void 0 : ee.input.focus.borderColor};
11933
12040
  }
11934
12041
 
12042
+ &.ap-select-loading {
12043
+ border-color: ${ee.input.focus.borderColor};
12044
+ }
12045
+
11935
12046
  &:focus {
11936
12047
  outline: none;
11937
12048
  background-color: ${re ? void 0 : ee.input.focus.backgroundColor};
@@ -11955,6 +12066,8 @@ const defineInputStyles = (ee, re, te) => {
11955
12066
 
11956
12067
  .selected-display {
11957
12068
  display: flex;
12069
+ align-items: center;
12070
+ justify-content: space-between;
11958
12071
  gap: 2px;
11959
12072
  }
11960
12073
 
@@ -12036,7 +12149,14 @@ const defineInputStyles = (ee, re, te) => {
12036
12149
  }
12037
12150
  }
12038
12151
 
12039
- .option-content {
12152
+ .ap-option-detail-wrapper {
12153
+ display: flex;
12154
+ flex-direction: column;
12155
+ gap: 4px;
12156
+ width: 100%;
12157
+ }
12158
+
12159
+ .ap-option-main-content {
12040
12160
  display: flex;
12041
12161
  align-items: center;
12042
12162
  justify-content: space-between;
@@ -12044,6 +12164,10 @@ const defineInputStyles = (ee, re, te) => {
12044
12164
  gap: 8px;
12045
12165
  flex-wrap: wrap;
12046
12166
  }
12167
+
12168
+ .ap-option-promotion-badge {
12169
+ align-self: flex-end;
12170
+ }
12047
12171
  `;
12048
12172
  };
12049
12173
  class SelectDropdown extends Component {
@@ -12056,7 +12180,7 @@ class SelectDropdown extends Component {
12056
12180
  }) {
12057
12181
  super({
12058
12182
  tag: "div",
12059
- styles: (ue) => getSelectDropdownStyles(ue, { disabled: ie, maxWidth: oe })
12183
+ styles: (ce) => getSelectDropdownStyles(ce, { disabled: ie, maxWidth: oe })
12060
12184
  });
12061
12185
  Ie(this, "selectContainer");
12062
12186
  Ie(this, "displayContent");
@@ -12064,6 +12188,7 @@ class SelectDropdown extends Component {
12064
12188
  Ie(this, "dropdownIcon");
12065
12189
  Ie(this, "optionsList");
12066
12190
  Ie(this, "isOpen", !1);
12191
+ Ie(this, "isLoading", !1);
12067
12192
  Ie(this, "blurTimeout", null);
12068
12193
  Ie(this, "selectedOption", null);
12069
12194
  Ie(this, "highlightedIndex", -1);
@@ -12080,26 +12205,38 @@ class SelectDropdown extends Component {
12080
12205
  weight: 500,
12081
12206
  color: defineInputStyles(!1, ie).textColor
12082
12207
  }).element;
12083
- this.displayContent.appendChild(ae), this.selectedDisplay = document.createElement("div"), this.selectedDisplay.classList.add("selected-display"), this.displayContent.appendChild(this.selectedDisplay), this.selectContainer.append(this.displayContent), this.dropdownIcon = document.createElement("span"), this.dropdownIcon.classList.add("dropdown-icon-wrapper");
12084
- const ce = new Icon({
12085
- name: "arrow_down_line",
12086
- size: 24,
12087
- color: defineInputStyles(!1, ie).textColor
12088
- }).element;
12089
- this.dropdownIcon.appendChild(ce), this.selectContainer.appendChild(this.dropdownIcon), this.element.appendChild(this.selectContainer), this.optionsList = document.createElement("ul"), this.optionsList.classList.add("dropdown-options"), this.element.appendChild(this.optionsList), this.renderOptions(ne), ne.length > 0 && this.setSelectedOption(ne[0], !0), ie || (this.boundHandleClick = this.handleContainerClick.bind(this), this.boundHandleKeyDown = this.handleKeyDown.bind(this), this.boundHandleClickOutside = this.handleClickOutside.bind(this), this.selectContainer.addEventListener("click", this.boundHandleClick), this.selectContainer.addEventListener("keydown", this.boundHandleKeyDown), document.addEventListener("click", this.boundHandleClickOutside), this.selectContainer.addEventListener("blur", () => {
12208
+ this.displayContent.appendChild(ae), this.selectedDisplay = document.createElement("div"), this.selectedDisplay.classList.add("selected-display"), this.displayContent.appendChild(this.selectedDisplay), this.selectContainer.append(this.displayContent), this.dropdownIcon = document.createElement("span"), this.dropdownIcon.classList.add("dropdown-icon-wrapper"), this.renderDropdownIcon(), this.selectContainer.appendChild(this.dropdownIcon), this.element.appendChild(this.selectContainer), this.optionsList = document.createElement("ul"), this.optionsList.classList.add("dropdown-options"), this.element.appendChild(this.optionsList), this.renderOptions(ne), ne.length > 0 && this.setSelectedOption(ne[0], !0), ie || (this.boundHandleClick = this.handleContainerClick.bind(this), this.boundHandleKeyDown = this.handleKeyDown.bind(this), this.boundHandleClickOutside = this.handleClickOutside.bind(this), this.selectContainer.addEventListener("click", this.boundHandleClick), this.selectContainer.addEventListener("keydown", this.boundHandleKeyDown), document.addEventListener("click", this.boundHandleClickOutside), this.selectContainer.addEventListener("blur", () => {
12090
12209
  this.blurTimeout = window.setTimeout(() => {
12091
12210
  !this.selectContainer.contains(document.activeElement) && !this.optionsList.contains(document.activeElement) && this.toggleDropdown(!1);
12092
12211
  }, 150);
12093
12212
  }));
12094
12213
  }
12095
12214
  // #region Private
12215
+ renderDropdownIcon() {
12216
+ if (this.dropdownIcon.innerHTML = "", this.isLoading)
12217
+ this.dropdownIcon.appendChild(new Loading({ size: 20 }).element);
12218
+ else {
12219
+ const te = new Icon({
12220
+ name: "arrow_down_line",
12221
+ size: 24,
12222
+ color: defineInputStyles(!1, this.disabled).textColor
12223
+ }).element;
12224
+ this.dropdownIcon.appendChild(te);
12225
+ }
12226
+ }
12227
+ createPromotionBadge(te) {
12228
+ return new Badge({
12229
+ variant: "success",
12230
+ items: [{ title: te }]
12231
+ }).element;
12232
+ }
12096
12233
  setSelectedOption(te, ne = !1) {
12097
12234
  var oe;
12098
12235
  const ie = ((oe = this.selectedOption) == null ? void 0 : oe.value) === te.value;
12099
12236
  this.selectedOption = te, this.updateSelectedDisplay(te), this.onChange && (ne || !ie) && this.onChange(te);
12100
12237
  }
12101
12238
  handleContainerClick(te) {
12102
- this.optionsList.contains(te.target) || this.toggleDropdown(!this.isOpen);
12239
+ this.isLoading || this.optionsList.contains(te.target) || this.toggleDropdown(!this.isOpen);
12103
12240
  }
12104
12241
  updateSelectedDisplay(te) {
12105
12242
  this.selectedDisplay.innerHTML = "";
@@ -12109,25 +12246,34 @@ class SelectDropdown extends Component {
12109
12246
  weight: 400,
12110
12247
  color: defineInputStyles(!1, this.disabled).textColor
12111
12248
  }).element;
12112
- this.selectedDisplay.appendChild(ne);
12249
+ if (this.selectedDisplay.appendChild(ne), te.promotionMessage) {
12250
+ const ie = this.createPromotionBadge(te.promotionMessage);
12251
+ this.selectedDisplay.appendChild(ie);
12252
+ }
12113
12253
  }
12114
12254
  renderOptions(te) {
12115
12255
  this.optionsList.innerHTML = "", te.length > 0 && te.forEach((ne, ie) => {
12116
- var ce;
12256
+ var ue;
12117
12257
  const oe = document.createElement("li");
12118
12258
  oe.classList.add("dropdown-option"), oe.setAttribute("role", "option"), oe.setAttribute(
12119
12259
  "aria-selected",
12120
- String(((ce = this.selectedOption) == null ? void 0 : ce.value) === ne.value)
12260
+ String(((ue = this.selectedOption) == null ? void 0 : ue.value) === ne.value)
12121
12261
  ), oe.id = `select-dropdown-option-${ie}`, this.highlightedIndex === ie && (oe.classList.add("highlighted"), this.scrollOptionIntoView(oe));
12122
12262
  const se = document.createElement("div");
12123
- se.classList.add("option-content");
12124
- const ae = new Typography({
12263
+ se.classList.add("ap-option-detail-wrapper");
12264
+ const ae = document.createElement("div");
12265
+ ae.classList.add("ap-option-main-content");
12266
+ const ce = new Typography({
12125
12267
  text: ne.content,
12126
12268
  size: "medium",
12127
12269
  weight: 500
12128
12270
  }).element;
12129
- se.appendChild(ae), ne.rightContent && se.appendChild(ne.rightContent), oe.appendChild(se), oe.dataset.value = String(ne.value), oe.dataset.index = String(ie), oe.addEventListener("click", (ue) => {
12130
- ue.stopPropagation(), this.handleOptionClick(ne);
12271
+ if (ae.appendChild(ce), ne.rightContent && ae.appendChild(ne.rightContent), se.appendChild(ae), ne.promotionMessage) {
12272
+ const le = this.createPromotionBadge(ne.promotionMessage);
12273
+ le.classList.add("ap-option-promotion-badge"), se.appendChild(le);
12274
+ }
12275
+ oe.appendChild(se), oe.dataset.value = String(ne.value), oe.dataset.index = String(ie), oe.addEventListener("click", (le) => {
12276
+ le.stopPropagation(), this.handleOptionClick(ne);
12131
12277
  }), this.optionsList.append(oe);
12132
12278
  });
12133
12279
  }
@@ -12135,7 +12281,7 @@ class SelectDropdown extends Component {
12135
12281
  this.setSelectedOption(te), this.renderOptions(this.options), this.toggleDropdown(!1), this.highlightedIndex = -1, this.selectContainer.focus();
12136
12282
  }
12137
12283
  toggleDropdown(te) {
12138
- if (!this.disabled)
12284
+ if (!(this.disabled || this.isLoading))
12139
12285
  if (this.isOpen = te, this.optionsList.style.display = this.isOpen ? "block" : "none", this.dropdownIcon.style.transform = this.isOpen ? "rotate(-180deg)" : "rotate(0deg)", this.isOpen) {
12140
12286
  if (this.selectedOption) {
12141
12287
  const ne = this.options.findIndex(
@@ -12155,7 +12301,7 @@ class SelectDropdown extends Component {
12155
12301
  !this.selectContainer.contains(te.target) && !this.optionsList.contains(te.target) && this.toggleDropdown(!1);
12156
12302
  }
12157
12303
  handleKeyDown(te) {
12158
- if (!this.disabled)
12304
+ if (!(this.disabled || this.isLoading))
12159
12305
  switch (te.key) {
12160
12306
  case "ArrowDown":
12161
12307
  te.preventDefault(), this.isOpen ? this.highlightNextOption() : this.toggleDropdown(!0);
@@ -12196,6 +12342,12 @@ class SelectDropdown extends Component {
12196
12342
  reset() {
12197
12343
  this.options.length > 0 && this.setSelectedOption(this.options[0], !0);
12198
12344
  }
12345
+ setLoading(te) {
12346
+ this.isLoading = te, this.selectContainer.classList.toggle("ap-select-loading", te), this.renderDropdownIcon();
12347
+ }
12348
+ setOptions(te) {
12349
+ this.options = te, this.highlightedIndex = -1, this.renderOptions(te), te.length > 0 ? this.setSelectedOption(te[0], !0) : (this.selectedOption = null, this.selectedDisplay.innerHTML = "");
12350
+ }
12199
12351
  destroy() {
12200
12352
  this.disabled || (document.removeEventListener("click", this.boundHandleClickOutside), this.selectContainer.removeEventListener("click", this.boundHandleClick), this.selectContainer.removeEventListener("keydown", this.boundHandleKeyDown), this.blurTimeout && window.clearTimeout(this.blurTimeout)), super.destroy();
12201
12353
  }
@@ -18504,7 +18656,7 @@ var NetworkEventCallback = (
18504
18656
  })(Config)
18505
18657
  ), useBrowserConfig = function(ee, re, te) {
18506
18658
  return re === void 0 && (re = {}), __awaiter(void 0, void 0, void 0, function() {
18507
- var ne, ie, oe, se, ae, ce, ue, le, de, fe, he, pe, ge, me, ye, ve, be, _e, Ce, Te, Se, Re, Ae, xe, Pe, De, $e, Ue, He, je, lr, Ke, hr, fr, dr, Qe, Bt, Cr, Fe, ke, qe, mr, ur, Sr, jr;
18659
+ var ne, ie, oe, se, ae, ce, ue, le, de, fe, he, pe, ge, me, ye, ve, be, _e, Ce, Te, Se, Re, Ae, xe, Pe, De, $e, Ue, He, je, lr, Ke, hr, fr, dr, Qe, Bt, Cr, Fe, ke, We, mr, ur, Sr, jr;
18508
18660
  return __generator(this, function($r) {
18509
18661
  switch ($r.label) {
18510
18662
  case 0:
@@ -18523,7 +18675,7 @@ var NetworkEventCallback = (
18523
18675
  return ce = $r.sent(), [4, ae.get(getCookieName(ee))];
18524
18676
  case 7:
18525
18677
  return ue = $r.sent(), le = getQueryParams(), de = le.ampTimestamp ? Number(le.ampTimestamp) : void 0, fe = de ? Date.now() < de : !0, he = (je = (He = (Ue = (De = re.deviceId) !== null && De !== void 0 ? De : fe ? ($e = le.ampDeviceId) !== null && $e !== void 0 ? $e : le.deviceId : void 0) !== null && Ue !== void 0 ? Ue : ue == null ? void 0 : ue.deviceId) !== null && He !== void 0 ? He : ce.deviceId) !== null && je !== void 0 ? je : UUID(), pe = (lr = ue == null ? void 0 : ue.lastEventId) !== null && lr !== void 0 ? lr : ce.lastEventId, ge = (Ke = ue == null ? void 0 : ue.lastEventTime) !== null && Ke !== void 0 ? Ke : ce.lastEventTime, me = (fr = (hr = re.optOut) !== null && hr !== void 0 ? hr : ue == null ? void 0 : ue.optOut) !== null && fr !== void 0 ? fr : ce.optOut, ye = (dr = ue == null ? void 0 : ue.sessionId) !== null && dr !== void 0 ? dr : ce.sessionId, ve = (Bt = (Qe = re.userId) !== null && Qe !== void 0 ? Qe : ue == null ? void 0 : ue.userId) !== null && Bt !== void 0 ? Bt : ce.userId, te.previousSessionDeviceId = (Cr = ue == null ? void 0 : ue.deviceId) !== null && Cr !== void 0 ? Cr : ce.deviceId, te.previousSessionUserId = (Fe = ue == null ? void 0 : ue.userId) !== null && Fe !== void 0 ? Fe : ce.userId, be = {
18526
- ipAddress: (qe = (ke = re.trackingOptions) === null || ke === void 0 ? void 0 : ke.ipAddress) !== null && qe !== void 0 ? qe : !0,
18678
+ ipAddress: (We = (ke = re.trackingOptions) === null || ke === void 0 ? void 0 : ke.ipAddress) !== null && We !== void 0 ? We : !0,
18527
18679
  language: (ur = (mr = re.trackingOptions) === null || mr === void 0 ? void 0 : mr.language) !== null && ur !== void 0 ? ur : !0,
18528
18680
  platform: (jr = (Sr = re.trackingOptions) === null || Sr === void 0 ? void 0 : Sr.platform) !== null && jr !== void 0 ? jr : !0
18529
18681
  }, _e = ue == null ? void 0 : ue.pageCounter, Ce = ue == null ? void 0 : ue.debugLogsEnabled, re.autocapture !== void 0 && (re.defaultTracking = re.autocapture), Te = new BrowserConfig(
@@ -23856,7 +24008,7 @@ function requireSingularSdk() {
23856
24008
  if (!ae) return ie[Ze];
23857
24009
  var Tr = lr(ie, Ze);
23858
24010
  return Tr && Tr.value;
23859
- }, hr = Ke("fetch"), fr = Ke("Request"), dr = Ke("Headers"), Qe = fr && fr.prototype, Bt = dr && dr.prototype, Cr = ie.RegExp, Fe = ie.TypeError, ke = ie.decodeURIComponent, qe = ie.encodeURIComponent, mr = se("".charAt), ur = se([].join), Sr = se([].push), jr = se("".replace), $r = se([].shift), Yr = se([].splice), Qr = se("".split), ii = se("".slice), Gr = /\+/g, Ye = Array(4), Ir = function(Ze) {
24011
+ }, hr = Ke("fetch"), fr = Ke("Request"), dr = Ke("Headers"), Qe = fr && fr.prototype, Bt = dr && dr.prototype, Cr = ie.RegExp, Fe = ie.TypeError, ke = ie.decodeURIComponent, We = ie.encodeURIComponent, mr = se("".charAt), ur = se([].join), Sr = se([].push), jr = se("".replace), $r = se([].shift), Yr = se([].splice), Qr = se("".split), ii = se("".slice), Gr = /\+/g, Ye = Array(4), Ir = function(Ze) {
23860
24012
  return Ye[Ze - 1] || (Ye[Ze - 1] = Cr("((?:%[\\da-f]{2}){" + Ze + "})", "gi"));
23861
24013
  }, Rr = function(Ze) {
23862
24014
  try {
@@ -23875,7 +24027,7 @@ function requireSingularSdk() {
23875
24027
  }, Br = /[!'()~]|%20/g, ci = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+" }, bi = function(Ze) {
23876
24028
  return ci[Ze];
23877
24029
  }, pi = function(Ze) {
23878
- return jr(qe(Ze), Br, bi);
24030
+ return jr(We(Ze), Br, bi);
23879
24031
  }, ei = fe((function(Ze, Tr) {
23880
24032
  Ue(this, { type: "URLSearchParamsIterator", iterator: Re(He(Ze).entries), kind: Tr });
23881
24033
  }), "Iterator", (function() {
@@ -24186,7 +24338,7 @@ function requireSingularSdk() {
24186
24338
  return ne(ce) && (ue = ce.constructor, (ie(ue) && (ue === ae || ne(ue.prototype)) || oe(ue) && (ue = ue[se]) === null) && (ue = void 0)), ue === void 0 ? ae : ue;
24187
24339
  };
24188
24340
  }, function(ee, re, te) {
24189
- var ne = te(1), ie = te(9), oe = te(14), se = te(6), ae = te(26), ce = te(15), ue = te(55), le = te(5), de = te(13), fe = te(16), he = te(20), pe = te(27), ge = te(84), me = te(29), ye = te(45), ve = te(57), be = te(73), _e = te(116), Ce = te(217), Te = te(92), Se = te(44), Re = te(28), Ae = te(112), xe = te(82), Pe = te(31), De = te(70), $e = te(91), Ue = te(90), He = te(107), je = te(8), lr = te(93), Ke = te(12), hr = te(138), fr = te(47), dr = te(58), Qe = te(94).forEach, Bt = $e("hidden"), Cr = dr.set, Fe = dr.getterFor("Symbol"), ke = Object.prototype, qe = ie.Symbol, mr = qe && qe.prototype, ur = ie.TypeError, Sr = ie.QObject, jr = Se.f, $r = Re.f, Yr = Ce.f, Qr = xe.f, ii = se([].push), Gr = De("symbols"), Ye = De("op-symbols"), Ir = De("wks"), Rr = !Sr || !Sr.prototype || !Sr.prototype.findChild, xr = ce && le((function() {
24341
+ var ne = te(1), ie = te(9), oe = te(14), se = te(6), ae = te(26), ce = te(15), ue = te(55), le = te(5), de = te(13), fe = te(16), he = te(20), pe = te(27), ge = te(84), me = te(29), ye = te(45), ve = te(57), be = te(73), _e = te(116), Ce = te(217), Te = te(92), Se = te(44), Re = te(28), Ae = te(112), xe = te(82), Pe = te(31), De = te(70), $e = te(91), Ue = te(90), He = te(107), je = te(8), lr = te(93), Ke = te(12), hr = te(138), fr = te(47), dr = te(58), Qe = te(94).forEach, Bt = $e("hidden"), Cr = dr.set, Fe = dr.getterFor("Symbol"), ke = Object.prototype, We = ie.Symbol, mr = We && We.prototype, ur = ie.TypeError, Sr = ie.QObject, jr = Se.f, $r = Re.f, Yr = Ce.f, Qr = xe.f, ii = se([].push), Gr = De("symbols"), Ye = De("op-symbols"), Ir = De("wks"), Rr = !Sr || !Sr.prototype || !Sr.prototype.findChild, xr = ce && le((function() {
24190
24342
  return ve($r({}, "a", { get: function() {
24191
24343
  return $r(this, "a", { value: 7 }).a;
24192
24344
  } })).a != 7;
@@ -24226,7 +24378,7 @@ function requireSingularSdk() {
24226
24378
  !de(Gr, Zr) || kr && !de(ke, Zr) || ii(Mr, Gr[Zr]);
24227
24379
  })), Mr;
24228
24380
  };
24229
- ue || (Pe(mr = (qe = function() {
24381
+ ue || (Pe(mr = (We = function() {
24230
24382
  if (fe(mr, this)) throw ur("Symbol is not a constructor");
24231
24383
  var Er = arguments.length && arguments[0] !== void 0 ? me(arguments[0]) : void 0, kr = He(Er), Pr = function(Mr) {
24232
24384
  this === ke && oe(Pr, Ye, Mr), de(this, Bt) && de(this[Bt], kr) && (this[Bt][kr] = !1), xr(this, kr, ye(1, Mr));
@@ -24234,13 +24386,13 @@ function requireSingularSdk() {
24234
24386
  return ce && Rr && xr(ke, kr, { configurable: !0, set: Pr }), Br(kr, Er);
24235
24387
  }).prototype, "toString", (function() {
24236
24388
  return Fe(this).tag;
24237
- })), Pe(qe, "withoutSetter", (function(Er) {
24389
+ })), Pe(We, "withoutSetter", (function(Er) {
24238
24390
  return Br(He(Er), Er);
24239
24391
  })), xe.f = pi, Re.f = ci, Ae.f = bi, Se.f = ei, _e.f = Ce.f = ui, Te.f = Xr, lr.f = function(Er) {
24240
24392
  return Br(je(Er), Er);
24241
24393
  }, ce && ($r(mr, "description", { configurable: !0, get: function() {
24242
24394
  return Fe(this).description;
24243
- } }), ae || Pe(ke, "propertyIsEnumerable", pi, { unsafe: !0 }))), ne({ global: !0, constructor: !0, wrap: !0, forced: !ue, sham: !ue }, { Symbol: qe }), Qe(be(Ir), (function(Er) {
24395
+ } }), ae || Pe(ke, "propertyIsEnumerable", pi, { unsafe: !0 }))), ne({ global: !0, constructor: !0, wrap: !0, forced: !ue, sham: !ue }, { Symbol: We }), Qe(be(Ir), (function(Er) {
24244
24396
  Ke(Er);
24245
24397
  })), ne({ target: "Symbol", stat: !0, forced: !ue }, { useSetter: function() {
24246
24398
  Rr = !0;
@@ -24248,7 +24400,7 @@ function requireSingularSdk() {
24248
24400
  Rr = !1;
24249
24401
  } }), ne({ target: "Object", stat: !0, forced: !ue, sham: !ce }, { create: function(Er, kr) {
24250
24402
  return kr === void 0 ? ve(Er) : bi(ve(Er), kr);
24251
- }, defineProperty: ci, defineProperties: bi, getOwnPropertyDescriptor: ei }), ne({ target: "Object", stat: !0, forced: !ue }, { getOwnPropertyNames: ui }), hr(), fr(qe, "Symbol"), Ue[Bt] = !0;
24403
+ }, defineProperty: ci, defineProperties: bi, getOwnPropertyDescriptor: ei }), ne({ target: "Object", stat: !0, forced: !ue }, { getOwnPropertyNames: ui }), hr(), fr(We, "Symbol"), Ue[Bt] = !0;
24252
24404
  }, function(ee, re, te) {
24253
24405
  var ne = te(51), ie = te(27), oe = te(116).f, se = te(117), ae = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
24254
24406
  ee.exports.f = function(ce) {
@@ -24816,26 +24968,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24816
24968
  ee.exports = he = function() {
24817
24969
  return pe;
24818
24970
  }, ee.exports.__esModule = !0, ee.exports.default = ee.exports;
24819
- var pe = {}, ge = Object.prototype, me = ge.hasOwnProperty, ye = ie || function(Fe, ke, qe) {
24820
- Fe[ke] = qe.value;
24971
+ var pe = {}, ge = Object.prototype, me = ge.hasOwnProperty, ye = ie || function(Fe, ke, We) {
24972
+ Fe[ke] = We.value;
24821
24973
  }, ve = typeof oe == "function" ? oe : {}, be = ve.iterator || "@@iterator", _e = ve.asyncIterator || "@@asyncIterator", Ce = ve.toStringTag || "@@toStringTag";
24822
- function Te(Fe, ke, qe) {
24823
- return ie(Fe, ke, { value: qe, enumerable: !0, configurable: !0, writable: !0 }), Fe[ke];
24974
+ function Te(Fe, ke, We) {
24975
+ return ie(Fe, ke, { value: We, enumerable: !0, configurable: !0, writable: !0 }), Fe[ke];
24824
24976
  }
24825
24977
  try {
24826
24978
  Te({}, "");
24827
24979
  } catch {
24828
- Te = function(ke, qe, mr) {
24829
- return ke[qe] = mr;
24980
+ Te = function(ke, We, mr) {
24981
+ return ke[We] = mr;
24830
24982
  };
24831
24983
  }
24832
- function Se(Fe, ke, qe, mr) {
24984
+ function Se(Fe, ke, We, mr) {
24833
24985
  var ur = ke && ke.prototype instanceof xe ? ke : xe, Sr = se(ur.prototype), jr = new Qe(mr || []);
24834
- return ye(Sr, "_invoke", { value: Ke(Fe, qe, jr) }), Sr;
24986
+ return ye(Sr, "_invoke", { value: Ke(Fe, We, jr) }), Sr;
24835
24987
  }
24836
- function Re(Fe, ke, qe) {
24988
+ function Re(Fe, ke, We) {
24837
24989
  try {
24838
- return { type: "normal", arg: Fe.call(ke, qe) };
24990
+ return { type: "normal", arg: Fe.call(ke, We) };
24839
24991
  } catch (mr) {
24840
24992
  return { type: "throw", arg: mr };
24841
24993
  }
@@ -24857,14 +25009,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24857
25009
  var He = De.prototype = xe.prototype = se($e);
24858
25010
  function je(Fe) {
24859
25011
  var ke;
24860
- ce(ke = ["next", "throw", "return"]).call(ke, (function(qe) {
24861
- Te(Fe, qe, (function(mr) {
24862
- return this._invoke(qe, mr);
25012
+ ce(ke = ["next", "throw", "return"]).call(ke, (function(We) {
25013
+ Te(Fe, We, (function(mr) {
25014
+ return this._invoke(We, mr);
24863
25015
  }));
24864
25016
  }));
24865
25017
  }
24866
25018
  function lr(Fe, ke) {
24867
- var qe;
25019
+ var We;
24868
25020
  ye(this, "_invoke", { value: function(mr, ur) {
24869
25021
  function Sr() {
24870
25022
  return new ke((function(jr, $r) {
@@ -24886,10 +25038,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24886
25038
  })(mr, ur, jr, $r);
24887
25039
  }));
24888
25040
  }
24889
- return qe = qe ? qe.then(Sr, Sr) : Sr();
25041
+ return We = We ? We.then(Sr, Sr) : Sr();
24890
25042
  } });
24891
25043
  }
24892
- function Ke(Fe, ke, qe) {
25044
+ function Ke(Fe, ke, We) {
24893
25045
  var mr = "suspendedStart";
24894
25046
  return function(ur, Sr) {
24895
25047
  if (mr === "executing") throw new Error("Generator is already running");
@@ -24897,33 +25049,33 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24897
25049
  if (ur === "throw") throw Sr;
24898
25050
  return Cr();
24899
25051
  }
24900
- for (qe.method = ur, qe.arg = Sr; ; ) {
24901
- var jr = qe.delegate;
25052
+ for (We.method = ur, We.arg = Sr; ; ) {
25053
+ var jr = We.delegate;
24902
25054
  if (jr) {
24903
- var $r = hr(jr, qe);
25055
+ var $r = hr(jr, We);
24904
25056
  if ($r) {
24905
25057
  if ($r === Ae) continue;
24906
25058
  return $r;
24907
25059
  }
24908
25060
  }
24909
- if (qe.method === "next") qe.sent = qe._sent = qe.arg;
24910
- else if (qe.method === "throw") {
24911
- if (mr === "suspendedStart") throw mr = "completed", qe.arg;
24912
- qe.dispatchException(qe.arg);
24913
- } else qe.method === "return" && qe.abrupt("return", qe.arg);
25061
+ if (We.method === "next") We.sent = We._sent = We.arg;
25062
+ else if (We.method === "throw") {
25063
+ if (mr === "suspendedStart") throw mr = "completed", We.arg;
25064
+ We.dispatchException(We.arg);
25065
+ } else We.method === "return" && We.abrupt("return", We.arg);
24914
25066
  mr = "executing";
24915
- var Yr = Re(Fe, ke, qe);
25067
+ var Yr = Re(Fe, ke, We);
24916
25068
  if (Yr.type === "normal") {
24917
- if (mr = qe.done ? "completed" : "suspendedYield", Yr.arg === Ae) continue;
24918
- return { value: Yr.arg, done: qe.done };
25069
+ if (mr = We.done ? "completed" : "suspendedYield", Yr.arg === Ae) continue;
25070
+ return { value: Yr.arg, done: We.done };
24919
25071
  }
24920
- Yr.type === "throw" && (mr = "completed", qe.method = "throw", qe.arg = Yr.arg);
25072
+ Yr.type === "throw" && (mr = "completed", We.method = "throw", We.arg = Yr.arg);
24921
25073
  }
24922
25074
  };
24923
25075
  }
24924
25076
  function hr(Fe, ke) {
24925
- var qe = ke.method, mr = Fe.iterator[qe];
24926
- if (mr === void 0) return ke.delegate = null, qe === "throw" && Fe.iterator.return && (ke.method = "return", ke.arg = void 0, hr(Fe, ke), ke.method === "throw") || qe !== "return" && (ke.method = "throw", ke.arg = new TypeError("The iterator does not provide a '" + qe + "' method")), Ae;
25077
+ var We = ke.method, mr = Fe.iterator[We];
25078
+ if (mr === void 0) return ke.delegate = null, We === "throw" && Fe.iterator.return && (ke.method = "return", ke.arg = void 0, hr(Fe, ke), ke.method === "throw") || We !== "return" && (ke.method = "throw", ke.arg = new TypeError("The iterator does not provide a '" + We + "' method")), Ae;
24927
25079
  var ur = Re(mr, Fe.iterator, ke.arg);
24928
25080
  if (ur.type === "throw") return ke.method = "throw", ke.arg = ur.arg, ke.delegate = null, Ae;
24929
25081
  var Sr = ur.arg;
@@ -24946,8 +25098,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24946
25098
  if (ke) return ke.call(Fe);
24947
25099
  if (typeof Fe.next == "function") return Fe;
24948
25100
  if (!isNaN(Fe.length)) {
24949
- var qe = -1, mr = function ur() {
24950
- for (; ++qe < Fe.length; ) if (me.call(Fe, qe)) return ur.value = Fe[qe], ur.done = !1, ur;
25101
+ var We = -1, mr = function ur() {
25102
+ for (; ++We < Fe.length; ) if (me.call(Fe, We)) return ur.value = Fe[We], ur.done = !1, ur;
24951
25103
  return ur.value = void 0, ur.done = !0, ur;
24952
25104
  };
24953
25105
  return mr.next = mr;
@@ -24967,9 +25119,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24967
25119
  return { __await: Fe };
24968
25120
  }, je(lr.prototype), Te(lr.prototype, _e, (function() {
24969
25121
  return this;
24970
- })), pe.AsyncIterator = lr, pe.async = function(Fe, ke, qe, mr, ur) {
25122
+ })), pe.AsyncIterator = lr, pe.async = function(Fe, ke, We, mr, ur) {
24971
25123
  ur === void 0 && (ur = le);
24972
- var Sr = new lr(Se(Fe, ke, qe, mr), ur);
25124
+ var Sr = new lr(Se(Fe, ke, We, mr), ur);
24973
25125
  return pe.isGeneratorFunction(ke) ? Sr : Sr.next().then((function(jr) {
24974
25126
  return jr.done ? jr.value : Sr.next();
24975
25127
  }));
@@ -24978,18 +25130,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24978
25130
  })), Te(He, "toString", (function() {
24979
25131
  return "[object Generator]";
24980
25132
  })), pe.keys = function(Fe) {
24981
- var ke = Object(Fe), qe = [];
24982
- for (var mr in ke) qe.push(mr);
24983
- return de(qe).call(qe), function ur() {
24984
- for (; qe.length; ) {
24985
- var Sr = qe.pop();
25133
+ var ke = Object(Fe), We = [];
25134
+ for (var mr in ke) We.push(mr);
25135
+ return de(We).call(We), function ur() {
25136
+ for (; We.length; ) {
25137
+ var Sr = We.pop();
24986
25138
  if (Sr in ke) return ur.value = Sr, ur.done = !1, ur;
24987
25139
  }
24988
25140
  return ur.done = !0, ur;
24989
25141
  };
24990
25142
  }, pe.values = Bt, Qe.prototype = { constructor: Qe, reset: function(Fe) {
24991
25143
  var ke;
24992
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, ce(ke = this.tryEntries).call(ke, dr), !Fe) for (var qe in this) qe.charAt(0) === "t" && me.call(this, qe) && !isNaN(+fe(qe).call(qe, 1)) && (this[qe] = void 0);
25144
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, ce(ke = this.tryEntries).call(ke, dr), !Fe) for (var We in this) We.charAt(0) === "t" && me.call(this, We) && !isNaN(+fe(We).call(We, 1)) && (this[We] = void 0);
24993
25145
  }, stop: function() {
24994
25146
  this.done = !0;
24995
25147
  var Fe = this.tryEntries[0].completion;
@@ -24998,28 +25150,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24998
25150
  }, dispatchException: function(Fe) {
24999
25151
  if (this.done) throw Fe;
25000
25152
  var ke = this;
25001
- function qe(Yr, Qr) {
25153
+ function We(Yr, Qr) {
25002
25154
  return Sr.type = "throw", Sr.arg = Fe, ke.next = Yr, Qr && (ke.method = "next", ke.arg = void 0), !!Qr;
25003
25155
  }
25004
25156
  for (var mr = this.tryEntries.length - 1; mr >= 0; --mr) {
25005
25157
  var ur = this.tryEntries[mr], Sr = ur.completion;
25006
- if (ur.tryLoc === "root") return qe("end");
25158
+ if (ur.tryLoc === "root") return We("end");
25007
25159
  if (ur.tryLoc <= this.prev) {
25008
25160
  var jr = me.call(ur, "catchLoc"), $r = me.call(ur, "finallyLoc");
25009
25161
  if (jr && $r) {
25010
- if (this.prev < ur.catchLoc) return qe(ur.catchLoc, !0);
25011
- if (this.prev < ur.finallyLoc) return qe(ur.finallyLoc);
25162
+ if (this.prev < ur.catchLoc) return We(ur.catchLoc, !0);
25163
+ if (this.prev < ur.finallyLoc) return We(ur.finallyLoc);
25012
25164
  } else if (jr) {
25013
- if (this.prev < ur.catchLoc) return qe(ur.catchLoc, !0);
25165
+ if (this.prev < ur.catchLoc) return We(ur.catchLoc, !0);
25014
25166
  } else {
25015
25167
  if (!$r) throw new Error("try statement without catch or finally");
25016
- if (this.prev < ur.finallyLoc) return qe(ur.finallyLoc);
25168
+ if (this.prev < ur.finallyLoc) return We(ur.finallyLoc);
25017
25169
  }
25018
25170
  }
25019
25171
  }
25020
25172
  }, abrupt: function(Fe, ke) {
25021
- for (var qe = this.tryEntries.length - 1; qe >= 0; --qe) {
25022
- var mr = this.tryEntries[qe];
25173
+ for (var We = this.tryEntries.length - 1; We >= 0; --We) {
25174
+ var mr = this.tryEntries[We];
25023
25175
  if (mr.tryLoc <= this.prev && me.call(mr, "finallyLoc") && this.prev < mr.finallyLoc) {
25024
25176
  var ur = mr;
25025
25177
  break;
@@ -25033,24 +25185,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25033
25185
  return Fe.type === "break" || Fe.type === "continue" ? this.next = Fe.arg : Fe.type === "return" ? (this.rval = this.arg = Fe.arg, this.method = "return", this.next = "end") : Fe.type === "normal" && ke && (this.next = ke), Ae;
25034
25186
  }, finish: function(Fe) {
25035
25187
  for (var ke = this.tryEntries.length - 1; ke >= 0; --ke) {
25036
- var qe = this.tryEntries[ke];
25037
- if (qe.finallyLoc === Fe) return this.complete(qe.completion, qe.afterLoc), dr(qe), Ae;
25188
+ var We = this.tryEntries[ke];
25189
+ if (We.finallyLoc === Fe) return this.complete(We.completion, We.afterLoc), dr(We), Ae;
25038
25190
  }
25039
25191
  }, catch: function(Fe) {
25040
25192
  for (var ke = this.tryEntries.length - 1; ke >= 0; --ke) {
25041
- var qe = this.tryEntries[ke];
25042
- if (qe.tryLoc === Fe) {
25043
- var mr = qe.completion;
25193
+ var We = this.tryEntries[ke];
25194
+ if (We.tryLoc === Fe) {
25195
+ var mr = We.completion;
25044
25196
  if (mr.type === "throw") {
25045
25197
  var ur = mr.arg;
25046
- dr(qe);
25198
+ dr(We);
25047
25199
  }
25048
25200
  return ur;
25049
25201
  }
25050
25202
  }
25051
25203
  throw new Error("illegal catch attempt");
25052
- }, delegateYield: function(Fe, ke, qe) {
25053
- return this.delegate = { iterator: Bt(Fe), resultName: ke, nextLoc: qe }, this.method === "next" && (this.arg = void 0), Ae;
25204
+ }, delegateYield: function(Fe, ke, We) {
25205
+ return this.delegate = { iterator: Bt(Fe), resultName: ke, nextLoc: We }, this.method === "next" && (this.arg = void 0), Ae;
25054
25206
  } }, pe;
25055
25207
  }
25056
25208
  ee.exports = he, ee.exports.__esModule = !0, ee.exports.default = ee.exports;
@@ -25124,13 +25276,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25124
25276
  }, function(ee, re, te) {
25125
25277
  te(375), te(383), te(384), te(385), te(386), te(387);
25126
25278
  }, function(ee, re, te) {
25127
- var ne, ie, oe, se = te(1), ae = te(26), ce = te(97), ue = te(9), le = te(14), de = te(31), fe = te(95), he = te(47), pe = te(376), ge = te(30), me = te(10), ye = te(17), ve = te(120), be = te(173), _e = te(174).set, Ce = te(378), Te = te(381), Se = te(61), Re = te(176), Ae = te(58), xe = te(62), Pe = te(78), De = te(49), $e = Pe.CONSTRUCTOR, Ue = Pe.REJECTION_EVENT, He = Pe.SUBCLASSING, je = Ae.getterFor("Promise"), lr = Ae.set, Ke = xe && xe.prototype, hr = xe, fr = Ke, dr = ue.TypeError, Qe = ue.document, Bt = ue.process, Cr = De.f, Fe = Cr, ke = !!(Qe && Qe.createEvent && ue.dispatchEvent), qe = function(Ye) {
25279
+ var ne, ie, oe, se = te(1), ae = te(26), ce = te(97), ue = te(9), le = te(14), de = te(31), fe = te(95), he = te(47), pe = te(376), ge = te(30), me = te(10), ye = te(17), ve = te(120), be = te(173), _e = te(174).set, Ce = te(378), Te = te(381), Se = te(61), Re = te(176), Ae = te(58), xe = te(62), Pe = te(78), De = te(49), $e = Pe.CONSTRUCTOR, Ue = Pe.REJECTION_EVENT, He = Pe.SUBCLASSING, je = Ae.getterFor("Promise"), lr = Ae.set, Ke = xe && xe.prototype, hr = xe, fr = Ke, dr = ue.TypeError, Qe = ue.document, Bt = ue.process, Cr = De.f, Fe = Cr, ke = !!(Qe && Qe.createEvent && ue.dispatchEvent), We = function(Ye) {
25128
25280
  var Ir;
25129
25281
  return !(!ye(Ye) || !me(Ir = Ye.then)) && Ir;
25130
25282
  }, mr = function(Ye, Ir) {
25131
25283
  var Rr, xr, Br, ci = Ir.value, bi = Ir.state == 1, pi = bi ? Ye.ok : Ye.fail, ei = Ye.resolve, ui = Ye.reject, Xr = Ye.domain;
25132
25284
  try {
25133
- pi ? (bi || (Ir.rejection === 2 && Yr(Ir), Ir.rejection = 1), pi === !0 ? Rr = ci : (Xr && Xr.enter(), Rr = pi(ci), Xr && (Xr.exit(), Br = !0)), Rr === Ye.promise ? ui(dr("Promise-chain cycle")) : (xr = qe(Rr)) ? le(xr, Rr, ei, ui) : ei(Rr)) : ui(ci);
25285
+ pi ? (bi || (Ir.rejection === 2 && Yr(Ir), Ir.rejection = 1), pi === !0 ? Rr = ci : (Xr && Xr.enter(), Rr = pi(ci), Xr && (Xr.exit(), Br = !0)), Rr === Ye.promise ? ui(dr("Promise-chain cycle")) : (xr = We(Rr)) ? le(xr, Rr, ei, ui) : ei(Rr)) : ui(ci);
25134
25286
  } catch (Er) {
25135
25287
  Xr && !Br && Xr.exit(), ui(Er);
25136
25288
  }
@@ -25167,7 +25319,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25167
25319
  Ye.done = !0, Rr && (Ye = Rr);
25168
25320
  try {
25169
25321
  if (Ye.facade === Ir) throw dr("Promise can't be resolved itself");
25170
- var xr = qe(Ir);
25322
+ var xr = We(Ir);
25171
25323
  xr ? Ce((function() {
25172
25324
  var Br = { done: !1 };
25173
25325
  try {
@@ -25599,42 +25751,42 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25599
25751
  te(442);
25600
25752
  }, function(ee, re, te) {
25601
25753
  te(60);
25602
- var ne, ie = te(1), oe = te(15), se = te(185), ae = te(9), ce = te(46), ue = te(6), le = te(31), de = te(443), fe = te(120), he = te(13), pe = te(160), ge = te(165), me = te(117), ye = te(150).codeAt, ve = te(444), be = te(29), _e = te(47), Ce = te(98), Te = te(184), Se = te(58), Re = Se.set, Ae = Se.getterFor("URL"), xe = Te.URLSearchParams, Pe = Te.getState, De = ae.URL, $e = ae.TypeError, Ue = ae.parseInt, He = Math.floor, je = Math.pow, lr = ue("".charAt), Ke = ue(/./.exec), hr = ue([].join), fr = ue(1 .toString), dr = ue([].pop), Qe = ue([].push), Bt = ue("".replace), Cr = ue([].shift), Fe = ue("".split), ke = ue("".slice), qe = ue("".toLowerCase), mr = ue([].unshift), ur = /[a-z]/i, Sr = /[\d+-.a-z]/i, jr = /\d/, $r = /^0x/i, Yr = /^[0-7]+$/, Qr = /^\d+$/, ii = /^[\da-f]+$/i, Gr = /[\0\t\n\r #%/:<>?@[\\\]^|]/, Ye = /[\0\t\n\r #/:<>?@[\\\]^|]/, Ir = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g, Rr = /[\t\n\r]/g, xr = function(Be) {
25603
- var Xe, We, Ur, ze;
25754
+ var ne, ie = te(1), oe = te(15), se = te(185), ae = te(9), ce = te(46), ue = te(6), le = te(31), de = te(443), fe = te(120), he = te(13), pe = te(160), ge = te(165), me = te(117), ye = te(150).codeAt, ve = te(444), be = te(29), _e = te(47), Ce = te(98), Te = te(184), Se = te(58), Re = Se.set, Ae = Se.getterFor("URL"), xe = Te.URLSearchParams, Pe = Te.getState, De = ae.URL, $e = ae.TypeError, Ue = ae.parseInt, He = Math.floor, je = Math.pow, lr = ue("".charAt), Ke = ue(/./.exec), hr = ue([].join), fr = ue(1 .toString), dr = ue([].pop), Qe = ue([].push), Bt = ue("".replace), Cr = ue([].shift), Fe = ue("".split), ke = ue("".slice), We = ue("".toLowerCase), mr = ue([].unshift), ur = /[a-z]/i, Sr = /[\d+-.a-z]/i, jr = /\d/, $r = /^0x/i, Yr = /^[0-7]+$/, Qr = /^\d+$/, ii = /^[\da-f]+$/i, Gr = /[\0\t\n\r #%/:<>?@[\\\]^|]/, Ye = /[\0\t\n\r #/:<>?@[\\\]^|]/, Ir = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g, Rr = /[\t\n\r]/g, xr = function(Be) {
25755
+ var Xe, qe, Ur, ze;
25604
25756
  if (typeof Be == "number") {
25605
- for (Xe = [], We = 0; We < 4; We++) mr(Xe, Be % 256), Be = He(Be / 256);
25757
+ for (Xe = [], qe = 0; qe < 4; qe++) mr(Xe, Be % 256), Be = He(Be / 256);
25606
25758
  return hr(Xe, ".");
25607
25759
  }
25608
25760
  if (typeof Be == "object") {
25609
25761
  for (Xe = "", Ur = (function(Kr) {
25610
25762
  for (var Vr = null, Nr = 1, Me = null, Je = 0, Hr = 0; Hr < 8; Hr++) Kr[Hr] !== 0 ? (Je > Nr && (Vr = Me, Nr = Je), Me = null, Je = 0) : (Me === null && (Me = Hr), ++Je);
25611
25763
  return Je > Nr && (Vr = Me, Nr = Je), Vr;
25612
- })(Be), We = 0; We < 8; We++) ze && Be[We] === 0 || (ze && (ze = !1), Ur === We ? (Xe += We ? ":" : "::", ze = !0) : (Xe += fr(Be[We], 16), We < 7 && (Xe += ":")));
25764
+ })(Be), qe = 0; qe < 8; qe++) ze && Be[qe] === 0 || (ze && (ze = !1), Ur === qe ? (Xe += qe ? ":" : "::", ze = !0) : (Xe += fr(Be[qe], 16), qe < 7 && (Xe += ":")));
25613
25765
  return "[" + Xe + "]";
25614
25766
  }
25615
25767
  return Be;
25616
25768
  }, Br = {}, ci = pe({}, Br, { " ": 1, '"': 1, "<": 1, ">": 1, "`": 1 }), bi = pe({}, ci, { "#": 1, "?": 1, "{": 1, "}": 1 }), pi = pe({}, bi, { "/": 1, ":": 1, ";": 1, "=": 1, "@": 1, "[": 1, "\\": 1, "]": 1, "^": 1, "|": 1 }), ei = function(Be, Xe) {
25617
- var We = ye(Be, 0);
25618
- return We > 32 && We < 127 && !he(Xe, Be) ? Be : encodeURIComponent(Be);
25769
+ var qe = ye(Be, 0);
25770
+ return qe > 32 && qe < 127 && !he(Xe, Be) ? Be : encodeURIComponent(Be);
25619
25771
  }, ui = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }, Xr = function(Be, Xe) {
25620
- var We;
25621
- return Be.length == 2 && Ke(ur, lr(Be, 0)) && ((We = lr(Be, 1)) == ":" || !Xe && We == "|");
25772
+ var qe;
25773
+ return Be.length == 2 && Ke(ur, lr(Be, 0)) && ((qe = lr(Be, 1)) == ":" || !Xe && qe == "|");
25622
25774
  }, Er = function(Be) {
25623
25775
  var Xe;
25624
25776
  return Be.length > 1 && Xr(ke(Be, 0, 2)) && (Be.length == 2 || (Xe = lr(Be, 2)) === "/" || Xe === "\\" || Xe === "?" || Xe === "#");
25625
25777
  }, kr = function(Be) {
25626
- return Be === "." || qe(Be) === "%2e";
25627
- }, Pr = {}, Mr = {}, Zr = {}, Ze = {}, Tr = {}, Or = {}, Dr = {}, zr = {}, hi = {}, Si = {}, Ai = {}, _i = {}, Pi = {}, ji = {}, Zi = {}, Fi = {}, Mi = {}, Ti = {}, Ji = {}, ki = {}, Ci = {}, zi = function(Be, Xe, We) {
25778
+ return Be === "." || We(Be) === "%2e";
25779
+ }, Pr = {}, Mr = {}, Zr = {}, Ze = {}, Tr = {}, Or = {}, Dr = {}, zr = {}, hi = {}, Si = {}, Ai = {}, _i = {}, Pi = {}, ji = {}, Zi = {}, Fi = {}, Mi = {}, Ti = {}, Ji = {}, ki = {}, Ci = {}, zi = function(Be, Xe, qe) {
25628
25780
  var Ur, ze, Kr, Vr = be(Be);
25629
25781
  if (Xe) {
25630
25782
  if (ze = this.parse(Vr)) throw $e(ze);
25631
25783
  this.searchParams = null;
25632
25784
  } else {
25633
- if (We !== void 0 && (Ur = new zi(We, !0)), ze = this.parse(Vr, null, Ur)) throw $e(ze);
25785
+ if (qe !== void 0 && (Ur = new zi(qe, !0)), ze = this.parse(Vr, null, Ur)) throw $e(ze);
25634
25786
  (Kr = Pe(new xe())).bindURL(this), this.searchParams = Kr;
25635
25787
  }
25636
25788
  };
25637
- zi.prototype = { type: "URL", parse: function(Be, Xe, We) {
25789
+ zi.prototype = { type: "URL", parse: function(Be, Xe, qe) {
25638
25790
  var Ur, ze, Kr, Vr, Nr, Me = this, Je = Xe || Pr, Hr = 0, Ar = "", Jr = !1, ti = !1, Ei = !1;
25639
25791
  for (Be = be(Be), Xe || (Me.scheme = "", Me.username = "", Me.password = "", Me.host = null, Me.port = null, Me.path = [], Me.query = null, Me.fragment = null, Me.cannotBeABaseURL = !1, Be = Bt(Be, Ir, "")), Be = Bt(Be, Rr, ""), Ur = ge(Be); Hr <= Ur.length; ) {
25640
25792
  switch (ze = Ur[Hr], Je) {
@@ -25644,10 +25796,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25644
25796
  Je = Zr;
25645
25797
  continue;
25646
25798
  }
25647
- Ar += qe(ze), Je = Mr;
25799
+ Ar += We(ze), Je = Mr;
25648
25800
  break;
25649
25801
  case Mr:
25650
- if (ze && (Ke(Sr, ze) || ze == "+" || ze == "-" || ze == ".")) Ar += qe(ze);
25802
+ if (ze && (Ke(Sr, ze) || ze == "+" || ze == "-" || ze == ".")) Ar += We(ze);
25651
25803
  else {
25652
25804
  if (ze != ":") {
25653
25805
  if (Xe) return "Invalid scheme";
@@ -25656,16 +25808,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25656
25808
  }
25657
25809
  if (Xe && (Me.isSpecial() != he(ui, Ar) || Ar == "file" && (Me.includesCredentials() || Me.port !== null) || Me.scheme == "file" && !Me.host)) return;
25658
25810
  if (Me.scheme = Ar, Xe) return void (Me.isSpecial() && ui[Me.scheme] == Me.port && (Me.port = null));
25659
- Ar = "", Me.scheme == "file" ? Je = ji : Me.isSpecial() && We && We.scheme == Me.scheme ? Je = Ze : Me.isSpecial() ? Je = zr : Ur[Hr + 1] == "/" ? (Je = Tr, Hr++) : (Me.cannotBeABaseURL = !0, Qe(Me.path, ""), Je = Ji);
25811
+ Ar = "", Me.scheme == "file" ? Je = ji : Me.isSpecial() && qe && qe.scheme == Me.scheme ? Je = Ze : Me.isSpecial() ? Je = zr : Ur[Hr + 1] == "/" ? (Je = Tr, Hr++) : (Me.cannotBeABaseURL = !0, Qe(Me.path, ""), Je = Ji);
25660
25812
  }
25661
25813
  break;
25662
25814
  case Zr:
25663
- if (!We || We.cannotBeABaseURL && ze != "#") return "Invalid scheme";
25664
- if (We.cannotBeABaseURL && ze == "#") {
25665
- Me.scheme = We.scheme, Me.path = me(We.path), Me.query = We.query, Me.fragment = "", Me.cannotBeABaseURL = !0, Je = Ci;
25815
+ if (!qe || qe.cannotBeABaseURL && ze != "#") return "Invalid scheme";
25816
+ if (qe.cannotBeABaseURL && ze == "#") {
25817
+ Me.scheme = qe.scheme, Me.path = me(qe.path), Me.query = qe.query, Me.fragment = "", Me.cannotBeABaseURL = !0, Je = Ci;
25666
25818
  break;
25667
25819
  }
25668
- Je = We.scheme == "file" ? ji : Or;
25820
+ Je = qe.scheme == "file" ? ji : Or;
25669
25821
  continue;
25670
25822
  case Ze:
25671
25823
  if (ze != "/" || Ur[Hr + 1] != "/") {
@@ -25682,21 +25834,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25682
25834
  Je = Ti;
25683
25835
  continue;
25684
25836
  case Or:
25685
- if (Me.scheme = We.scheme, ze == ne) Me.username = We.username, Me.password = We.password, Me.host = We.host, Me.port = We.port, Me.path = me(We.path), Me.query = We.query;
25837
+ if (Me.scheme = qe.scheme, ze == ne) Me.username = qe.username, Me.password = qe.password, Me.host = qe.host, Me.port = qe.port, Me.path = me(qe.path), Me.query = qe.query;
25686
25838
  else if (ze == "/" || ze == "\\" && Me.isSpecial()) Je = Dr;
25687
- else if (ze == "?") Me.username = We.username, Me.password = We.password, Me.host = We.host, Me.port = We.port, Me.path = me(We.path), Me.query = "", Je = ki;
25839
+ else if (ze == "?") Me.username = qe.username, Me.password = qe.password, Me.host = qe.host, Me.port = qe.port, Me.path = me(qe.path), Me.query = "", Je = ki;
25688
25840
  else {
25689
25841
  if (ze != "#") {
25690
- Me.username = We.username, Me.password = We.password, Me.host = We.host, Me.port = We.port, Me.path = me(We.path), Me.path.length--, Je = Ti;
25842
+ Me.username = qe.username, Me.password = qe.password, Me.host = qe.host, Me.port = qe.port, Me.path = me(qe.path), Me.path.length--, Je = Ti;
25691
25843
  continue;
25692
25844
  }
25693
- Me.username = We.username, Me.password = We.password, Me.host = We.host, Me.port = We.port, Me.path = me(We.path), Me.query = We.query, Me.fragment = "", Je = Ci;
25845
+ Me.username = qe.username, Me.password = qe.password, Me.host = qe.host, Me.port = qe.port, Me.path = me(qe.path), Me.query = qe.query, Me.fragment = "", Je = Ci;
25694
25846
  }
25695
25847
  break;
25696
25848
  case Dr:
25697
25849
  if (!Me.isSpecial() || ze != "/" && ze != "\\") {
25698
25850
  if (ze != "/") {
25699
- Me.username = We.username, Me.password = We.password, Me.host = We.host, Me.port = We.port, Je = Ti;
25851
+ Me.username = qe.username, Me.password = qe.password, Me.host = qe.host, Me.port = qe.port, Je = Ti;
25700
25852
  continue;
25701
25853
  }
25702
25854
  Je = Si;
@@ -25753,9 +25905,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25753
25905
  if (!Ke(jr, ze)) {
25754
25906
  if (ze == ne || ze == "/" || ze == "?" || ze == "#" || ze == "\\" && Me.isSpecial() || Xe) {
25755
25907
  if (Ar != "") {
25756
- var Wi = Ue(Ar, 10);
25757
- if (Wi > 65535) return "Invalid port";
25758
- Me.port = Me.isSpecial() && Wi === ui[Me.scheme] ? null : Wi, Ar = "";
25908
+ var qi = Ue(Ar, 10);
25909
+ if (qi > 65535) return "Invalid port";
25910
+ Me.port = Me.isSpecial() && qi === ui[Me.scheme] ? null : qi, Ar = "";
25759
25911
  }
25760
25912
  if (Xe) return;
25761
25913
  Je = Mi;
@@ -25768,18 +25920,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25768
25920
  case ji:
25769
25921
  if (Me.scheme = "file", ze == "/" || ze == "\\") Je = Zi;
25770
25922
  else {
25771
- if (!We || We.scheme != "file") {
25923
+ if (!qe || qe.scheme != "file") {
25772
25924
  Je = Ti;
25773
25925
  continue;
25774
25926
  }
25775
- if (ze == ne) Me.host = We.host, Me.path = me(We.path), Me.query = We.query;
25776
- else if (ze == "?") Me.host = We.host, Me.path = me(We.path), Me.query = "", Je = ki;
25927
+ if (ze == ne) Me.host = qe.host, Me.path = me(qe.path), Me.query = qe.query;
25928
+ else if (ze == "?") Me.host = qe.host, Me.path = me(qe.path), Me.query = "", Je = ki;
25777
25929
  else {
25778
25930
  if (ze != "#") {
25779
- Er(hr(me(Ur, Hr), "")) || (Me.host = We.host, Me.path = me(We.path), Me.shortenPath()), Je = Ti;
25931
+ Er(hr(me(Ur, Hr), "")) || (Me.host = qe.host, Me.path = me(qe.path), Me.shortenPath()), Je = Ti;
25780
25932
  continue;
25781
25933
  }
25782
- Me.host = We.host, Me.path = me(We.path), Me.query = We.query, Me.fragment = "", Je = Ci;
25934
+ Me.host = qe.host, Me.path = me(qe.path), Me.query = qe.query, Me.fragment = "", Je = Ci;
25783
25935
  }
25784
25936
  }
25785
25937
  break;
@@ -25788,7 +25940,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25788
25940
  Je = Fi;
25789
25941
  break;
25790
25942
  }
25791
- We && We.scheme == "file" && !Er(hr(me(Ur, Hr), "")) && (Xr(We.path[0], !0) ? Qe(Me.path, We.path[0]) : Me.host = We.host), Je = Ti;
25943
+ qe && qe.scheme == "file" && !Er(hr(me(Ur, Hr), "")) && (Xr(qe.path[0], !0) ? Qe(Me.path, qe.path[0]) : Me.host = qe.host), Je = Ti;
25792
25944
  continue;
25793
25945
  case Fi:
25794
25946
  if (ze == ne || ze == "/" || ze == "\\" || ze == "?" || ze == "#") {
@@ -25815,7 +25967,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25815
25967
  break;
25816
25968
  case Ti:
25817
25969
  if (ze == ne || ze == "/" || ze == "\\" && Me.isSpecial() || !Xe && (ze == "?" || ze == "#")) {
25818
- if ((Nr = qe(Nr = Ar)) === ".." || Nr === "%2e." || Nr === ".%2e" || Nr === "%2e%2e" ? (Me.shortenPath(), ze == "/" || ze == "\\" && Me.isSpecial() || Qe(Me.path, "")) : kr(Ar) ? ze == "/" || ze == "\\" && Me.isSpecial() || Qe(Me.path, "") : (Me.scheme == "file" && !Me.path.length && Xr(Ar) && (Me.host && (Me.host = ""), Ar = lr(Ar, 0) + ":"), Qe(Me.path, Ar)), Ar = "", Me.scheme == "file" && (ze == ne || ze == "?" || ze == "#")) for (; Me.path.length > 1 && Me.path[0] === ""; ) Cr(Me.path);
25970
+ if ((Nr = We(Nr = Ar)) === ".." || Nr === "%2e." || Nr === ".%2e" || Nr === "%2e%2e" ? (Me.shortenPath(), ze == "/" || ze == "\\" && Me.isSpecial() || Qe(Me.path, "")) : kr(Ar) ? ze == "/" || ze == "\\" && Me.isSpecial() || Qe(Me.path, "") : (Me.scheme == "file" && !Me.path.length && Xr(Ar) && (Me.host && (Me.host = ""), Ar = lr(Ar, 0) + ":"), Qe(Me.path, Ar)), Ar = "", Me.scheme == "file" && (ze == ne || ze == "?" || ze == "#")) for (; Me.path.length > 1 && Me.path[0] === ""; ) Cr(Me.path);
25819
25971
  ze == "?" ? (Me.query = "", Je = ki) : ze == "#" && (Me.fragment = "", Je = Ci);
25820
25972
  } else Ar += ei(ze, bi);
25821
25973
  break;
@@ -25831,7 +25983,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25831
25983
  Hr++;
25832
25984
  }
25833
25985
  }, parseHost: function(Be) {
25834
- var Xe, We, Ur;
25986
+ var Xe, qe, Ur;
25835
25987
  if (lr(Be, 0) == "[") {
25836
25988
  if (lr(Be, Be.length - 1) != "]" || !(Xe = (function(ze) {
25837
25989
  var Kr, Vr, Nr, Me, Je, Hr, Ar, Jr = [0, 0, 0, 0, 0, 0, 0, 0], ti = 0, Ei = null, vi = 0, ni = function() {
@@ -25903,7 +26055,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25903
26055
  this.host = Xe;
25904
26056
  } else {
25905
26057
  if (Ke(Ye, Be)) return "Invalid host";
25906
- for (Xe = "", We = ge(Be), Ur = 0; Ur < We.length; Ur++) Xe += ei(We[Ur], Br);
26058
+ for (Xe = "", qe = ge(Be), Ur = 0; Ur < qe.length; Ur++) Xe += ei(qe[Ur], Br);
25907
26059
  this.host = Xe;
25908
26060
  }
25909
26061
  }, cannotHaveUsernamePasswordPort: function() {
@@ -25916,8 +26068,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25916
26068
  var Be = this.path, Xe = Be.length;
25917
26069
  !Xe || this.scheme == "file" && Xe == 1 && Xr(Be[0], !0) || Be.length--;
25918
26070
  }, serialize: function() {
25919
- var Be = this, Xe = Be.scheme, We = Be.username, Ur = Be.password, ze = Be.host, Kr = Be.port, Vr = Be.path, Nr = Be.query, Me = Be.fragment, Je = Xe + ":";
25920
- return ze !== null ? (Je += "//", Be.includesCredentials() && (Je += We + (Ur ? ":" + Ur : "") + "@"), Je += xr(ze), Kr !== null && (Je += ":" + Kr)) : Xe == "file" && (Je += "//"), Je += Be.cannotBeABaseURL ? Vr[0] : Vr.length ? "/" + hr(Vr, "/") : "", Nr !== null && (Je += "?" + Nr), Me !== null && (Je += "#" + Me), Je;
26071
+ var Be = this, Xe = Be.scheme, qe = Be.username, Ur = Be.password, ze = Be.host, Kr = Be.port, Vr = Be.path, Nr = Be.query, Me = Be.fragment, Je = Xe + ":";
26072
+ return ze !== null ? (Je += "//", Be.includesCredentials() && (Je += qe + (Ur ? ":" + Ur : "") + "@"), Je += xr(ze), Kr !== null && (Je += ":" + Kr)) : Xe == "file" && (Je += "//"), Je += Be.cannotBeABaseURL ? Vr[0] : Vr.length ? "/" + hr(Vr, "/") : "", Nr !== null && (Je += "?" + Nr), Me !== null && (Je += "#" + Me), Je;
25921
26073
  }, setHref: function(Be) {
25922
26074
  var Xe = this.parse(Be);
25923
26075
  if (Xe) throw $e(Xe);
@@ -25940,7 +26092,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25940
26092
  var Xe = ge(be(Be));
25941
26093
  if (!this.cannotHaveUsernamePasswordPort()) {
25942
26094
  this.username = "";
25943
- for (var We = 0; We < Xe.length; We++) this.username += ei(Xe[We], pi);
26095
+ for (var qe = 0; qe < Xe.length; qe++) this.username += ei(Xe[qe], pi);
25944
26096
  }
25945
26097
  }, getPassword: function() {
25946
26098
  return this.password;
@@ -25948,7 +26100,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25948
26100
  var Xe = ge(be(Be));
25949
26101
  if (!this.cannotHaveUsernamePasswordPort()) {
25950
26102
  this.password = "";
25951
- for (var We = 0; We < Xe.length; We++) this.password += ei(Xe[We], pi);
26103
+ for (var qe = 0; qe < Xe.length; qe++) this.password += ei(Xe[qe], pi);
25952
26104
  }
25953
26105
  }, getHost: function() {
25954
26106
  var Be = this.host, Xe = this.port;
@@ -25986,13 +26138,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
25986
26138
  this.query = this.searchParams.serialize() || null;
25987
26139
  } };
25988
26140
  var Ui = function(Be) {
25989
- var Xe = fe(this, oi), We = Ce(arguments.length, 1) > 1 ? arguments[1] : void 0, Ur = Re(Xe, new zi(Be, !1, We));
26141
+ var Xe = fe(this, oi), qe = Ce(arguments.length, 1) > 1 ? arguments[1] : void 0, Ur = Re(Xe, new zi(Be, !1, qe));
25990
26142
  oe || (Xe.href = Ur.serialize(), Xe.origin = Ur.getOrigin(), Xe.protocol = Ur.getProtocol(), Xe.username = Ur.getUsername(), Xe.password = Ur.getPassword(), Xe.host = Ur.getHost(), Xe.hostname = Ur.getHostname(), Xe.port = Ur.getPort(), Xe.pathname = Ur.getPathname(), Xe.search = Ur.getSearch(), Xe.searchParams = Ur.getSearchParams(), Xe.hash = Ur.getHash());
25991
26143
  }, oi = Ui.prototype, gi = function(Be, Xe) {
25992
26144
  return { get: function() {
25993
26145
  return Ae(this)[Be]();
25994
- }, set: Xe && function(We) {
25995
- return Ae(this)[Xe](We);
26146
+ }, set: Xe && function(qe) {
26147
+ return Ae(this)[Xe](qe);
25996
26148
  }, configurable: !0, enumerable: !0 };
25997
26149
  };
25998
26150
  if (oe && (de(oi, "href", gi("serialize", "setHref")), de(oi, "origin", gi("getOrigin")), de(oi, "protocol", gi("getProtocol", "setProtocol")), de(oi, "username", gi("getUsername", "setUsername")), de(oi, "password", gi("getPassword", "setPassword")), de(oi, "host", gi("getHost", "setHost")), de(oi, "hostname", gi("getHostname", "setHostname")), de(oi, "port", gi("getPort", "setPort")), de(oi, "pathname", gi("getPathname", "setPathname")), de(oi, "search", gi("getSearch", "setSearch")), de(oi, "searchParams", gi("getSearchParams")), de(oi, "hash", gi("getHash", "setHash"))), le(oi, "toJSON", (function() {
@@ -26000,8 +26152,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26000
26152
  }), { enumerable: !0 }), le(oi, "toString", (function() {
26001
26153
  return Ae(this).serialize();
26002
26154
  }), { enumerable: !0 }), De) {
26003
- var qi = De.createObjectURL, Qi = De.revokeObjectURL;
26004
- qi && le(Ui, "createObjectURL", ce(qi, De)), Qi && le(Ui, "revokeObjectURL", ce(Qi, De));
26155
+ var Wi = De.createObjectURL, Qi = De.revokeObjectURL;
26156
+ Wi && le(Ui, "createObjectURL", ce(Wi, De)), Qi && le(Ui, "revokeObjectURL", ce(Qi, De));
26005
26157
  }
26006
26158
  _e(Ui, "URL"), ie({ global: !0, constructor: !0, forced: !se, sham: !oe }, { URL: Ui });
26007
26159
  }, function(ee, re, te) {
@@ -26166,7 +26318,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26166
26318
  })), te.d(ne, "Version", (function() {
26167
26319
  return ke;
26168
26320
  })), te.d(ne, "SdidPersistModeOff", (function() {
26169
- return qe;
26321
+ return We;
26170
26322
  })), te.d(ne, "SdidPersistModeAuto", (function() {
26171
26323
  return mr;
26172
26324
  })), te.d(ne, "SdidPersistModeManual", (function() {
@@ -26270,7 +26422,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26270
26422
  })), te.d(ae, "Extra", (function() {
26271
26423
  return gi;
26272
26424
  })), te.d(ae, "GlobalProperties", (function() {
26273
- return qi;
26425
+ return Wi;
26274
26426
  })), te.d(ae, "IsConversion", (function() {
26275
26427
  return Qi;
26276
26428
  })), te.d(ae, "IsFirstEvent", (function() {
@@ -26278,7 +26430,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26278
26430
  })), te.d(ae, "IsFirstVisit", (function() {
26279
26431
  return Xe;
26280
26432
  })), te.d(ae, "IsFirstPageVisitInSession", (function() {
26281
- return We;
26433
+ return qe;
26282
26434
  })), te.d(ae, "isAfterConversionEvent", (function() {
26283
26435
  return Ur;
26284
26436
  })), te.d(ae, "IsPageRefreshed", (function() {
@@ -26310,7 +26462,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26310
26462
  })), te.d(ae, "PreviousSdid", (function() {
26311
26463
  return eo;
26312
26464
  })), te.d(ae, "ProductId", (function() {
26313
- return Wi;
26465
+ return qi;
26314
26466
  })), te.d(ae, "RevenueAmount", (function() {
26315
26467
  return No;
26316
26468
  })), te.d(ae, "RevenueCurrency", (function() {
@@ -26332,9 +26484,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26332
26484
  })), te.d(ae, "SingularInstanceId", (function() {
26333
26485
  return zo;
26334
26486
  })), te.d(ae, "StorageType", (function() {
26335
- return qo;
26336
- })), te.d(ae, "Timezone", (function() {
26337
26487
  return Wo;
26488
+ })), te.d(ae, "Timezone", (function() {
26489
+ return qo;
26338
26490
  })), te.d(ae, "TouchpointTimestamp", (function() {
26339
26491
  return Go;
26340
26492
  })), te.d(ae, "UserAgent", (function() {
@@ -26434,7 +26586,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26434
26586
  })), te.d(fe, "SingularDeviceIdKey", (function() {
26435
26587
  return ks;
26436
26588
  }));
26437
- var he = te(2), pe = te.n(he), ge = te(4), me = te.n(ge), ye = te(0), ve = te.n(ye), be = te(63), _e = te.n(be), Ce = te(64), Te = te.n(Ce), Se = te(40), Re = te.n(Se), Ae = te(18), xe = te.n(Ae), Pe = te(41), De = te.n(Pe), $e = te(34), Ue = te.n($e), He = te(42), je = te.n(He), lr = te(19), Ke = te.n(lr), hr = te(32), fr = te.n(hr), dr = te(25), Qe = te.n(dr), Bt = te(33), Cr = te.n(Bt), Fe = 30, ke = "WebSDK-v".concat("1.4.8"), qe = "off", mr = "auto", ur = "manual", Sr = "__singular_ddl__", jr = "onbeforeunload", $r = "conversion_event", Yr = "custom_user_id_event", Qr = "event", ii = "page_visit", Gr = "__PAGE_VISIT__", Ye = "setMatchId", Ir = "fetch_banner", Rr = "singular_api_queue", xr = "singular_custom_user_id", Br = "banner_last_dismissed", ci = "did_visit_site", bi = "did_send_event", pi = "conversion_event_occurred", ei = "global", ui = "global_properties", Xr = 1e3, Er = "singular_session_id", kr = "singular_first_page_visit_occurred", Pr = "first_page_visit_url", Mr = "singular_id", Zr = "match_id", Ze = "singular_instance_id", Tr = "singular_storage_enabled_test", Or = "test_value", Dr = "last_event_timestamp", zr = "touchpoint_timestamp", hi = "web_url", Si = { Local: "local", Session: "session", Memory: "memory" }, Ai = "n", _i = "browser_available_memory", Pi = "browser_used_memory", ji = "counter_banner_showed", Zi = "source_url", Fi = "client_hints", Mi = "custom_user_id", Ti = "current_device_time", Ji = "_dl", ki = "_ddl", Ci = "document_referrer", zi = "event_id", Ui = "n", oi = "product_name", gi = "e", qi = "global_properties", Qi = "conversion_event", Be = "first", Xe = "is_first_visit", We = "is_first_page_visit_in_session", Ur = "is_after_conversion_event", ze = "is_page_refreshed", Kr = "is_revenue_event", Vr = "is_set_match_id", Nr = "k", Me = "lag", Je = "l", Hr = "match_id", Ar = "os", Jr = "ecid", ti = "a", Ei = "_p", vi = "p", ni = "Web", eo = "prev_sdid", Wi = "i", No = "r", Mo = "pcc", Uo = "screen_height", Fo = "screen_width", $o = "sdid_persist_mode", Bo = "sdid_persist_failed_reason", Vo = "sdk", Ho = "s", jo = "SDID", zo = "singular_instance_id", qo = "storage_type", Wo = "timezone", Go = "touchpoint_timestamp", mo = "device_user_agent", Ko = "u", Yo = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", Xo = "_web_params", vo = "web_url", Zo = "last_dismissed", Jo = "bn", Qo = "baid", ts = "utm_source", rs = { clid_params: ["clid="], singular_p_params: ["pcnid=", "pcrnid=", "pcid=", "pcn=", "psc=", "pscid=", "pscn=", "pcrid=", "pcrn=", "ps=", "psid=", "psn=", "pshid=", "paffid=", "paffn=", "pcc=", "psrc=", "pmed="], singular_wp_params: ["wpcid=", "wpcn=", "wpsc=", "wpscid=", "wpscn=", "wpcrid=", "wpcrn=", "wps=", "wpsid=", "wpsn=", "wpshid=", "wpaffid=", "wpaffn=", "wpkw=", "wpsrc=", "wpmed="], utm_params: ["utm_.+="], additional_params: ["kw=", "an=", "ud="] }, ns = "https://sdk-api-v1.singular.net/api/v1/", is = "Content-Type", os = "application/json", ss = { Session: "start", Event: "event", DeviceCustomUserId: "set_device_for_custom_id", FetchBanner: "banners" }, as = "POST", cs = "GET", us = [qi, gi, vo, mo, oi, Ci, Fi], ls = "status", ds = 3e4, fs = "ok", ps = 200, hs = "link", gs = "Android", ms = "iOS", vs = "Linux", ys = "MacOS", bs = "Unknown", _s = "Windows", Es = ["iPhone", "iPad", "iPod"], Ss = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"], Ts = ["Win32", "Win64", "Windows", "WinCE"], Cs = 3, Is = 2, ws = 1, As = 0, xs = ["platformVersion", yo, "uaFullVersion", "model", "architecture"], yo = "platform", Rs = "domain", Os = "expires", bo = 864e5, _o = 2592e3, Ps = 365 * bo, ks = "singular_device_id", Ls = te(188), Ds = te.n(Ls), Ns = te(189), Ms = te.n(Ns), Us = te(100), Eo = te.n(Us), Fs = te(53), Gi = te.n(Fs), $s = te(35), $i = te.n($s), Bs = te(79), oo = te.n(Bs), Vs = te(11), si = te.n(Vs), Hs = te(3), qr = te.n(Hs), js = te(190), zs = te.n(js), qs = te(191), Ws = te.n(qs), Gs = te(22), Li = te.n(Gs), Ks = te(23), xi = te.n(Ks), Ys = te(43), Bi = te.n(Ys), Xs = te(65), to = te.n(Xs), Zs = te(101), So = te.n(Zs), Js = te(192), Qs = te.n(Js), ea = te(193), ta = te.n(ea), yr = (function() {
26589
+ var he = te(2), pe = te.n(he), ge = te(4), me = te.n(ge), ye = te(0), ve = te.n(ye), be = te(63), _e = te.n(be), Ce = te(64), Te = te.n(Ce), Se = te(40), Re = te.n(Se), Ae = te(18), xe = te.n(Ae), Pe = te(41), De = te.n(Pe), $e = te(34), Ue = te.n($e), He = te(42), je = te.n(He), lr = te(19), Ke = te.n(lr), hr = te(32), fr = te.n(hr), dr = te(25), Qe = te.n(dr), Bt = te(33), Cr = te.n(Bt), Fe = 30, ke = "WebSDK-v".concat("1.4.8"), We = "off", mr = "auto", ur = "manual", Sr = "__singular_ddl__", jr = "onbeforeunload", $r = "conversion_event", Yr = "custom_user_id_event", Qr = "event", ii = "page_visit", Gr = "__PAGE_VISIT__", Ye = "setMatchId", Ir = "fetch_banner", Rr = "singular_api_queue", xr = "singular_custom_user_id", Br = "banner_last_dismissed", ci = "did_visit_site", bi = "did_send_event", pi = "conversion_event_occurred", ei = "global", ui = "global_properties", Xr = 1e3, Er = "singular_session_id", kr = "singular_first_page_visit_occurred", Pr = "first_page_visit_url", Mr = "singular_id", Zr = "match_id", Ze = "singular_instance_id", Tr = "singular_storage_enabled_test", Or = "test_value", Dr = "last_event_timestamp", zr = "touchpoint_timestamp", hi = "web_url", Si = { Local: "local", Session: "session", Memory: "memory" }, Ai = "n", _i = "browser_available_memory", Pi = "browser_used_memory", ji = "counter_banner_showed", Zi = "source_url", Fi = "client_hints", Mi = "custom_user_id", Ti = "current_device_time", Ji = "_dl", ki = "_ddl", Ci = "document_referrer", zi = "event_id", Ui = "n", oi = "product_name", gi = "e", Wi = "global_properties", Qi = "conversion_event", Be = "first", Xe = "is_first_visit", qe = "is_first_page_visit_in_session", Ur = "is_after_conversion_event", ze = "is_page_refreshed", Kr = "is_revenue_event", Vr = "is_set_match_id", Nr = "k", Me = "lag", Je = "l", Hr = "match_id", Ar = "os", Jr = "ecid", ti = "a", Ei = "_p", vi = "p", ni = "Web", eo = "prev_sdid", qi = "i", No = "r", Mo = "pcc", Uo = "screen_height", Fo = "screen_width", $o = "sdid_persist_mode", Bo = "sdid_persist_failed_reason", Vo = "sdk", Ho = "s", jo = "SDID", zo = "singular_instance_id", Wo = "storage_type", qo = "timezone", Go = "touchpoint_timestamp", mo = "device_user_agent", Ko = "u", Yo = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$", Xo = "_web_params", vo = "web_url", Zo = "last_dismissed", Jo = "bn", Qo = "baid", ts = "utm_source", rs = { clid_params: ["clid="], singular_p_params: ["pcnid=", "pcrnid=", "pcid=", "pcn=", "psc=", "pscid=", "pscn=", "pcrid=", "pcrn=", "ps=", "psid=", "psn=", "pshid=", "paffid=", "paffn=", "pcc=", "psrc=", "pmed="], singular_wp_params: ["wpcid=", "wpcn=", "wpsc=", "wpscid=", "wpscn=", "wpcrid=", "wpcrn=", "wps=", "wpsid=", "wpsn=", "wpshid=", "wpaffid=", "wpaffn=", "wpkw=", "wpsrc=", "wpmed="], utm_params: ["utm_.+="], additional_params: ["kw=", "an=", "ud="] }, ns = "https://sdk-api-v1.singular.net/api/v1/", is = "Content-Type", os = "application/json", ss = { Session: "start", Event: "event", DeviceCustomUserId: "set_device_for_custom_id", FetchBanner: "banners" }, as = "POST", cs = "GET", us = [Wi, gi, vo, mo, oi, Ci, Fi], ls = "status", ds = 3e4, fs = "ok", ps = 200, hs = "link", gs = "Android", ms = "iOS", vs = "Linux", ys = "MacOS", bs = "Unknown", _s = "Windows", Es = ["iPhone", "iPad", "iPod"], Ss = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"], Ts = ["Win32", "Win64", "Windows", "WinCE"], Cs = 3, Is = 2, ws = 1, As = 0, xs = ["platformVersion", yo, "uaFullVersion", "model", "architecture"], yo = "platform", Rs = "domain", Os = "expires", bo = 864e5, _o = 2592e3, Ps = 365 * bo, ks = "singular_device_id", Ls = te(188), Ds = te.n(Ls), Ns = te(189), Ms = te.n(Ns), Us = te(100), Eo = te.n(Us), Fs = te(53), Gi = te.n(Fs), $s = te(35), $i = te.n($s), Bs = te(79), oo = te.n(Bs), Vs = te(11), si = te.n(Vs), Hs = te(3), Wr = te.n(Hs), js = te(190), zs = te.n(js), Ws = te(191), qs = te.n(Ws), Gs = te(22), Li = te.n(Gs), Ks = te(23), xi = te.n(Ks), Ys = te(43), Bi = te.n(Ys), Xs = te(65), to = te.n(Xs), Zs = te(101), So = te.n(Zs), Js = te(192), Qs = te.n(Js), ea = te(193), ta = te.n(ea), yr = (function() {
26438
26590
  function Ve() {
26439
26591
  pe()(this, Ve);
26440
26592
  }
@@ -26525,9 +26677,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26525
26677
  this.isNullOrEmpty(di) || (Fr[ae.WebParams] = di), this.isNullOrEmpty(gr) || (Fr[ae.DeeplinkParam] = gr), this.isNullOrEmpty(_r) || (Fr[ae.PassthroughParam] = _r), this.isNullOrEmpty(vr) || (Fr[ae.DeferredDeeplinkParam] = vr);
26526
26678
  var fi = Eo()(br = Ke()(Fr)).call(br, (function(yi) {
26527
26679
  var Ii;
26528
- return qr()(Ii = "".concat(encodeURIComponent(yi), "=")).call(Ii, encodeURIComponent(Fr[yi]));
26680
+ return Wr()(Ii = "".concat(encodeURIComponent(yi), "=")).call(Ii, encodeURIComponent(Fr[yi]));
26529
26681
  }));
26530
- return qr()(wr = "".concat(this.extractUrlWithPath(Le), "?")).call(wr, fi.join("&"));
26682
+ return Wr()(wr = "".concat(this.extractUrlWithPath(Le), "?")).call(wr, fi.join("&"));
26531
26683
  } }, { key: "parseQueryFromUrl", value: function(Le) {
26532
26684
  if (this.isNullOrEmpty(Le)) return {};
26533
26685
  var Ge = Le.split("?");
@@ -26558,7 +26710,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26558
26710
  Ve.isNullOrEmpty(Le) || (this._sdkWrapper = Le);
26559
26711
  } }, { key: "getSdkVersion", value: function() {
26560
26712
  var Le;
26561
- return this._sdkWrapper ? qr()(Le = "".concat(ne.Version, "-")).call(Le, this._sdkWrapper) : ne.Version;
26713
+ return this._sdkWrapper ? Wr()(Le = "".concat(ne.Version, "-")).call(Le, this._sdkWrapper) : ne.Version;
26562
26714
  } }, { key: "getCookie", value: function(Le) {
26563
26715
  var Ge = document.cookie;
26564
26716
  if (Ve.isNullOrEmpty(Ge)) return null;
@@ -26570,7 +26722,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26570
26722
  var _r, vr, br, wr, Fr;
26571
26723
  if (!(Ve.isNullOrEmpty(Le) || Ve.isNullOrEmpty(Ge) || Ve.isNullOrEmpty(gr))) {
26572
26724
  var di = Ve._getCookieExpirationDate();
26573
- document.cookie = qr()(_r = qr()(vr = qr()(br = qr()(wr = qr()(Fr = "".concat(Le, "=")).call(Fr, encodeURIComponent(Ge), "; ")).call(wr, fe.CookieDomainKey, "=")).call(br, gr, "; ")).call(vr, fe.CookieExpiresKey, "=")).call(_r, di.toGMTString(), "; path=/");
26725
+ document.cookie = Wr()(_r = Wr()(vr = Wr()(br = Wr()(wr = Wr()(Fr = "".concat(Le, "=")).call(Fr, encodeURIComponent(Ge), "; ")).call(wr, fe.CookieDomainKey, "=")).call(br, gr, "; ")).call(vr, fe.CookieExpiresKey, "=")).call(_r, di.toGMTString(), "; path=/");
26574
26726
  }
26575
26727
  } }, { key: "_getCookieExpirationDate", value: function() {
26576
26728
  var Le = /* @__PURE__ */ new Date();
@@ -26671,7 +26823,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26671
26823
  return Ge;
26672
26824
  } }, { key: "appendQueryParamsToUrl", value: function(Le, Ge, gr) {
26673
26825
  var _r, vr, br;
26674
- return qr()(_r = qr()(vr = qr()(br = "".concat(gr.split(Le)[0], "?")).call(br, Ge)).call(vr, Le == "?" ? "&" : "#")).call(_r, gr.split(Le)[1]);
26826
+ return Wr()(_r = Wr()(vr = Wr()(br = "".concat(gr.split(Le)[0], "?")).call(br, Ge)).call(vr, Le == "?" ? "&" : "#")).call(_r, gr.split(Le)[1]);
26675
26827
  } }]), Ve;
26676
26828
  })(), ra = te(102), To = te.n(ra), na = te(194), ia = te.n(na), oa = te(122), Co = te.n(oa), sa = te(195), aa = te.n(sa), ca = te(196), ua = te.n(ca), la = te(50), Ki = te.n(la), ri = (function() {
26677
26829
  function Ve() {
@@ -26694,13 +26846,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26694
26846
  }
26695
26847
  return me()(Ve, [{ key: "getItem", value: function(Ee) {
26696
26848
  var we;
26697
- return yr.isNullOrEmpty(Ee) || !this._isInitialized ? null : this._storage.getItem(qr()(we = "".concat(this._storagePrefix, "_")).call(we, Ee));
26849
+ return yr.isNullOrEmpty(Ee) || !this._isInitialized ? null : this._storage.getItem(Wr()(we = "".concat(this._storagePrefix, "_")).call(we, Ee));
26698
26850
  } }, { key: "setItem", value: function(Ee, we) {
26699
26851
  var Oe;
26700
- !yr.isNullOrEmpty(Ee) && we && this._isInitialized && this._storage.setItem(qr()(Oe = "".concat(this._storagePrefix, "_")).call(Oe, Ee), we);
26852
+ !yr.isNullOrEmpty(Ee) && we && this._isInitialized && this._storage.setItem(Wr()(Oe = "".concat(this._storagePrefix, "_")).call(Oe, Ee), we);
26701
26853
  } }, { key: "removeItem", value: function(Ee) {
26702
26854
  var we;
26703
- !yr.isNullOrEmpty(Ee) && this._isInitialized && this._storage.removeItem(qr()(we = "".concat(this._storagePrefix, "_")).call(we, Ee));
26855
+ !yr.isNullOrEmpty(Ee) && this._isInitialized && this._storage.removeItem(Wr()(we = "".concat(this._storagePrefix, "_")).call(we, Ee));
26704
26856
  } }, { key: "_buildMemoryStorage", value: function() {
26705
26857
  var Ee = this;
26706
26858
  ri.warn("Using memory storage"), this._storage = { _data: {}, setItem: function(we, Oe) {
@@ -26761,7 +26913,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26761
26913
  return this._previousSdid;
26762
26914
  } }, { key: "getStoragePrefix", value: function() {
26763
26915
  var Ee;
26764
- return qr()(Ee = "".concat(this._singularConfig.apikey, "_")).call(Ee, this._singularConfig.productId);
26916
+ return Wr()(Ee = "".concat(this._singularConfig.apikey, "_")).call(Ee, this._singularConfig.productId);
26765
26917
  } }, { key: "getCustomUserId", value: function() {
26766
26918
  return this._customUserId || (this._customUserId = this._storage.getItem(se.CustomUserIdKey)), this._customUserId;
26767
26919
  } }, { key: "getWebUrl", value: function() {
@@ -26802,7 +26954,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26802
26954
  Oe[Ee] = we, this._storage.setItem(se.GlobalProperties, xi()(Oe));
26803
26955
  }
26804
26956
  } }, { key: "IsFirstEvent", value: function(Ee) {
26805
- var we, Oe = qr()(we = "".concat(se.DidSendEventKeyBase, ".")).call(we, Ee), Ne = !!this._storage.getItem(Oe);
26957
+ var we, Oe = Wr()(we = "".concat(se.DidSendEventKeyBase, ".")).call(we, Ee), Ne = !!this._storage.getItem(Oe);
26806
26958
  return Ne || this._storage.setItem(Oe, !0), !Ne;
26807
26959
  } }, { key: "updateLastEventTimestamp", value: function() {
26808
26960
  this._storage.setItem(se.StorageLastEventTimestamp, yr.getCurrentTimestamp());
@@ -26952,11 +27104,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
26952
27104
  case 2:
26953
27105
  return this._params[ae.OS] = Le.sent, Le.next = 5, yr.getClientHints();
26954
27106
  case 5:
26955
- return (Oe = Le.sent) && (this._params[ae.ClientHints] = xi()(Oe)), Le.abrupt("return", new Ws.a((function(Ge) {
27107
+ return (Oe = Le.sent) && (this._params[ae.ClientHints] = xi()(Oe)), Le.abrupt("return", new qs.a((function(Ge) {
26956
27108
  var gr;
26957
27109
  Ke()(Ne._extra).length > 0 && (Ne._params[ae.Extra] = xi()(Ne._extra)), Ne._params[ae.SessionId] || (Ne._params[ae.SessionId] = Lr.getInstance().getSessionId());
26958
27110
  var _r = da({}, Ne._params, ve()({}, ae.Lag, yr.getCurrentTimestamp() - zs()(Ne._params[ae.CurrentDeviceTime]))), vr = Ne._method === ce.PostMethod ? Ne._buildRequestBody(_r) : null, br = Ne._buildQueryParams(_r), wr = Ne._buildRequestUrl(br);
26959
- ri.debug(qr()(gr = `Sending api request
27111
+ ri.debug(Wr()(gr = `Sending api request
26960
27112
  Url:`.concat(wr, `
26961
27113
  Body:`)).call(gr, xi()(vr)));
26962
27114
  var Fr = new XMLHttpRequest();
@@ -26997,12 +27149,12 @@ Body:`)).call(gr, xi()(vr)));
26997
27149
  return !yr.isNullOrEmpty(we[br]) && (Ge._method !== ce.PostMethod || !Gi()(wr = ce.PostParams).call(wr, br));
26998
27150
  }))).call(Oe, (function(br) {
26999
27151
  var wr;
27000
- return qr()(wr = "".concat(encodeURIComponent(br), "=")).call(wr, encodeURIComponent(we[br]));
27152
+ return Wr()(wr = "".concat(encodeURIComponent(br), "=")).call(wr, encodeURIComponent(we[br]));
27001
27153
  })), _r = "?".concat(gr.join("&")), vr = yr.calculateHash(_r, Lr.getInstance().getSingularConfig().secret);
27002
- return qr()(Le = "".concat(_r, "&h=")).call(Le, vr);
27154
+ return Wr()(Le = "".concat(_r, "&h=")).call(Le, vr);
27003
27155
  } }, { key: "_buildRequestUrl", value: function(we) {
27004
27156
  var Oe, Ne;
27005
- return qr()(Oe = qr()(Ne = "".concat(ce.BaseUrl)).call(Ne, this._endpoint)).call(Oe, we);
27157
+ return Wr()(Oe = Wr()(Ne = "".concat(ce.BaseUrl)).call(Ne, this._endpoint)).call(Oe, we);
27006
27158
  } }, { key: "eventId", get: function() {
27007
27159
  return this._params[ae.EventId];
27008
27160
  } }], [{ key: "toJsonString", value: function(we) {
@@ -27212,7 +27364,7 @@ Body:`)).call(gr, xi()(vr)));
27212
27364
  return we.apply(this, arguments);
27213
27365
  }) }, { key: "_buildRequestUrl", value: function(Oe) {
27214
27366
  var Ne, Le;
27215
- return qr()(Ne = qr()(Le = "".concat(ce.BaseUrl.replace("v1/", ""))).call(Le, this._endpoint)).call(Ne, Oe);
27367
+ return Wr()(Ne = Wr()(Le = "".concat(ce.BaseUrl.replace("v1/", ""))).call(Le, this._endpoint)).call(Ne, Oe);
27216
27368
  } }, { key: "isValidResponse", value: function(Oe) {
27217
27369
  var Ne = Oe.display, Le = Oe.meta;
27218
27370
  return Ne && Le ? ce.FetchBannerResponseLinkKey in Le : (ri.debug("BannerApi.isValidResponse: missing display or meta keys"), !1);
@@ -27316,7 +27468,7 @@ Body:`)).call(gr, xi()(vr)));
27316
27468
  vr.next = 13;
27317
27469
  break;
27318
27470
  case 10:
27319
- vr.prev = 10, vr.t0 = vr.catch(5), ri.debug(qr()(_r = "failed to send banner impression ".concat(gr, ", error: ")).call(_r, vr.t0));
27471
+ vr.prev = 10, vr.t0 = vr.catch(5), ri.debug(Wr()(_r = "failed to send banner impression ".concat(gr, ", error: ")).call(_r, vr.t0));
27320
27472
  case 13:
27321
27473
  case "end":
27322
27474
  return vr.stop();
@@ -27326,7 +27478,7 @@ Body:`)).call(gr, xi()(vr)));
27326
27478
  return Ee.apply(this, arguments);
27327
27479
  }) }, { key: "getElementClassName", value: function(Oe) {
27328
27480
  var Ne;
27329
- return qr()(Ne = "".concat("singular-banner-")).call(Ne, Oe.replace("_", "-"));
27481
+ return Wr()(Ne = "".concat("singular-banner-")).call(Ne, Oe.replace("_", "-"));
27330
27482
  } }, { key: "htmlToElement", value: function(Oe) {
27331
27483
  var Ne = document.createElement("div");
27332
27484
  return Ne.innerHTML = So()(Oe).call(Oe), Ne.firstChild;
@@ -27367,7 +27519,7 @@ Body:`)).call(gr, xi()(vr)));
27367
27519
  }, Aa = (function() {
27368
27520
  function Ve(Ee) {
27369
27521
  var we;
27370
- pe()(this, Ve), this._singularState = Lr.getInstance().init(Ee), yr.isNullOrEmpty(Ee.customUserId) || this._singularState.setCustomUserId(Ee.customUserId), ri.info(qr()(we = "SDK is initialized Apikey:".concat(Ee.apikey, ", Product Id:")).call(we, Ee.productId)), this._apiManager = new ha(), this.sendApi(new uo()), this._bannerManager = new _a();
27522
+ pe()(this, Ve), this._singularState = Lr.getInstance().init(Ee), yr.isNullOrEmpty(Ee.customUserId) || this._singularState.setCustomUserId(Ee.customUserId), ri.info(Wr()(we = "SDK is initialized Apikey:".concat(Ee.apikey, ", Product Id:")).call(we, Ee.productId)), this._apiManager = new ha(), this.sendApi(new uo()), this._bannerManager = new _a();
27371
27523
  }
27372
27524
  return me()(Ve, [{ key: "sendApi", value: function(Ee) {
27373
27525
  this._apiManager.sendApi(Ee);
@@ -27433,8 +27585,8 @@ Body:`)).call(gr, xi()(vr)));
27433
27585
  })), gr = yr.extractMarketingData(Ge), _r = !0, vr = !1, br = void 0;
27434
27586
  try {
27435
27587
  for (var wr, Fr = Bi()(To()(gr).call(gr)); !(_r = (wr = Fr.next()).done); _r = !0) {
27436
- var di, fi, yi = $i()(wr.value, 2), Ii = (yi[0], yi[1]), mi = qr()(di = "".concat(encodeURIComponent(Ii), "=")).call(di, encodeURIComponent(we[Ii]));
27437
- Ee = to()(Ee).call(Ee, "?") != -1 ? yr.appendQueryParamsToUrl("?", mi, Ee) : to()(Ee).call(Ee, "#") != -1 ? yr.appendQueryParamsToUrl("#", mi, Ee) : qr()(fi = "".concat(Ee, "?")).call(fi, mi);
27588
+ var di, fi, yi = $i()(wr.value, 2), Ii = (yi[0], yi[1]), mi = Wr()(di = "".concat(encodeURIComponent(Ii), "=")).call(di, encodeURIComponent(we[Ii]));
27589
+ Ee = to()(Ee).call(Ee, "?") != -1 ? yr.appendQueryParamsToUrl("?", mi, Ee) : to()(Ee).call(Ee, "#") != -1 ? yr.appendQueryParamsToUrl("#", mi, Ee) : Wr()(fi = "".concat(Ee, "?")).call(fi, mi);
27438
27590
  }
27439
27591
  } catch (Ri) {
27440
27592
  vr = !0, br = Ri;
@@ -29597,7 +29749,7 @@ const {
29597
29749
  } = axios, mockPath = (ee, re) => {
29598
29750
  const te = AstroPayConfig.getRuntimeConfig().MODE === "test";
29599
29751
  return re && te ? `http://localhost:3333${ee.startsWith("/") ? ee : `/${ee}`}` : ee;
29600
- }, Wr = class Wr {
29752
+ }, qr = class qr {
29601
29753
  // #endregion
29602
29754
  // #region Useful methods
29603
29755
  static getAxiosInstance() {
@@ -29607,8 +29759,8 @@ const {
29607
29759
  }
29608
29760
  // #endregion
29609
29761
  };
29610
- Ie(Wr, "axiosInstance"), Ie(Wr, "config"), Ie(Wr, "init", (re) => {
29611
- Wr.config = re, Wr.axiosInstance = axios.create({
29762
+ Ie(qr, "axiosInstance"), Ie(qr, "config"), Ie(qr, "init", (re) => {
29763
+ qr.config = re, qr.axiosInstance = axios.create({
29612
29764
  baseURL: re.baseURL,
29613
29765
  timeout: re.timeout ?? 5e3,
29614
29766
  withCredentials: !0,
@@ -29616,9 +29768,9 @@ Ie(Wr, "axiosInstance"), Ie(Wr, "config"), Ie(Wr, "init", (re) => {
29616
29768
  "Accept-Language": AstroPayI18n.getCurrent(),
29617
29769
  ...re.headers
29618
29770
  }
29619
- }), Wr.setupInterceptors();
29771
+ }), qr.setupInterceptors();
29620
29772
  }), // #region API Methods
29621
- Ie(Wr, "GET", async ({
29773
+ Ie(qr, "GET", async ({
29622
29774
  url: re,
29623
29775
  params: te = {},
29624
29776
  mock: ne = !1,
@@ -29630,8 +29782,8 @@ Ie(Wr, "GET", async ({
29630
29782
  ...te
29631
29783
  }
29632
29784
  };
29633
- return await Wr.getAxiosInstance().get(oe, se);
29634
- }), Ie(Wr, "POST", async ({
29785
+ return await qr.getAxiosInstance().get(oe, se);
29786
+ }), Ie(qr, "POST", async ({
29635
29787
  url: re,
29636
29788
  data: te = {},
29637
29789
  mock: ne = !1,
@@ -29645,8 +29797,8 @@ Ie(Wr, "GET", async ({
29645
29797
  "Content-Type": "text/plain"
29646
29798
  }
29647
29799
  };
29648
- return await Wr.getAxiosInstance().post(oe, te, se);
29649
- }), Ie(Wr, "PUT", async ({
29800
+ return await qr.getAxiosInstance().post(oe, te, se);
29801
+ }), Ie(qr, "PUT", async ({
29650
29802
  url: re,
29651
29803
  data: te = {},
29652
29804
  mock: ne = !1,
@@ -29657,8 +29809,8 @@ Ie(Wr, "GET", async ({
29657
29809
  useQueryParams: ie
29658
29810
  }
29659
29811
  };
29660
- return await Wr.getAxiosInstance().put(oe, te, se);
29661
- }), Ie(Wr, "PATCH", async ({
29812
+ return await qr.getAxiosInstance().put(oe, te, se);
29813
+ }), Ie(qr, "PATCH", async ({
29662
29814
  url: re,
29663
29815
  data: te = {},
29664
29816
  mock: ne = !1,
@@ -29672,8 +29824,8 @@ Ie(Wr, "GET", async ({
29672
29824
  "Content-Type": "text/plain"
29673
29825
  }
29674
29826
  };
29675
- return await Wr.getAxiosInstance().patch(oe, te, se);
29676
- }), Ie(Wr, "DELETE", async ({
29827
+ return await qr.getAxiosInstance().patch(oe, te, se);
29828
+ }), Ie(qr, "DELETE", async ({
29677
29829
  url: re,
29678
29830
  params: te = {},
29679
29831
  mock: ne = !1,
@@ -29685,22 +29837,22 @@ Ie(Wr, "GET", async ({
29685
29837
  ...te
29686
29838
  }
29687
29839
  };
29688
- return await Wr.getAxiosInstance().delete(oe, se);
29689
- }), Ie(Wr, "setupInterceptors", () => {
29690
- Wr.axiosInstance.interceptors.request.use((re) => {
29840
+ return await qr.getAxiosInstance().delete(oe, se);
29841
+ }), Ie(qr, "setupInterceptors", () => {
29842
+ qr.axiosInstance.interceptors.request.use((re) => {
29691
29843
  const { useQueryParams: te, ...ne } = re.params || {};
29692
29844
  return te ? re.params = {
29693
29845
  ...ne,
29694
- data: Wr.getEncodeParams()
29846
+ data: qr.getEncodeParams()
29695
29847
  } : re.params = ne, re.data && (re.data = convertData(re.data, "camelCase-to-snake_case")), re;
29696
- }), Wr.axiosInstance.interceptors.response.use(
29697
- (re) => Wr.handleResponse(re),
29698
- (re) => Wr.handleError(re)
29848
+ }), qr.axiosInstance.interceptors.response.use(
29849
+ (re) => qr.handleResponse(re),
29850
+ (re) => qr.handleError(re)
29699
29851
  );
29700
- }), Ie(Wr, "handleResponse", (re) => {
29852
+ }), Ie(qr, "handleResponse", (re) => {
29701
29853
  const te = re.status === 202, ne = convertData(re.data, "snake_case-to-camelCase");
29702
29854
  return te ? { ...ne, statusCode: re.status } : ne;
29703
- }), Ie(Wr, "handleError", (re) => {
29855
+ }), Ie(qr, "handleError", (re) => {
29704
29856
  var ie;
29705
29857
  const te = convertData(
29706
29858
  (ie = re.response) == null ? void 0 : ie.data,
@@ -29709,12 +29861,13 @@ Ie(Wr, "GET", async ({
29709
29861
  error: (te == null ? void 0 : te.error) || "UNKNOWN_ERROR",
29710
29862
  internalTerm: te == null ? void 0 : te.internalTerm,
29711
29863
  message: (te == null ? void 0 : te.message) || AstroPayI18n.translate("generic_error"),
29712
- description: te == null ? void 0 : te.description
29864
+ description: te == null ? void 0 : te.description,
29865
+ code: te == null ? void 0 : te.code
29713
29866
  };
29714
29867
  return Promise.reject(ne);
29715
- }), Ie(Wr, "getEncodeParams", () => {
29868
+ }), Ie(qr, "getEncodeParams", () => {
29716
29869
  const re = {
29717
- app_name: Wr.config.appName,
29870
+ app_name: qr.config.appName,
29718
29871
  app_id: AstroPayCore.getToken(),
29719
29872
  environment: AstroPayConfig.getEnvironment(),
29720
29873
  platform: getCheckoutPlatform(),
@@ -29722,7 +29875,7 @@ Ie(Wr, "GET", async ({
29722
29875
  };
29723
29876
  return encodeData(re);
29724
29877
  });
29725
- let HttpClient = Wr;
29878
+ let HttpClient = qr;
29726
29879
  const END_POINTS = {
29727
29880
  // Payment
29728
29881
  createPayment: "/v1/web/payments",
@@ -29778,12 +29931,13 @@ class CardApService {
29778
29931
  if (this.callback) {
29779
29932
  const ie = Object.entries(ne).reduce(
29780
29933
  (oe, [se, ae]) => {
29781
- var ce;
29934
+ var ce, ue;
29782
29935
  return oe[se] = {
29783
29936
  isValid: ae.isValid || !ae.isDirty && !ae.isTouched,
29784
29937
  isTouched: ae.isTouched || ae.isDirty,
29785
29938
  ...se === "card_number" && {
29786
- brand: (ce = ae.details) == null ? void 0 : ce.brand
29939
+ brand: (ce = ae.details) == null ? void 0 : ce.brand,
29940
+ bin: ae.isValid ? (ue = ae.details) == null ? void 0 : ue.bin : void 0
29787
29941
  }
29788
29942
  }, oe;
29789
29943
  },
@@ -29959,6 +30113,16 @@ Ie(PaymentMethodsService, "getPaymentMethodDetail", async (re) => {
29959
30113
  } catch (te) {
29960
30114
  return Promise.reject(te);
29961
30115
  }
30116
+ }), Ie(PaymentMethodsService, "postInstallmentsUpdate", async (re, te) => {
30117
+ try {
30118
+ const ne = re.replace(/^\/?api\//, "");
30119
+ return await HttpClient.POST({
30120
+ url: ne,
30121
+ data: te
30122
+ });
30123
+ } catch (ne) {
30124
+ return DataDogTracker.trackError(ne), Promise.reject(ne);
30125
+ }
29962
30126
  }), Ie(PaymentMethodsService, "deleteCard", async (re, te) => {
29963
30127
  try {
29964
30128
  await HttpClient.DELETE({
@@ -30431,102 +30595,6 @@ class CardField extends Component {
30431
30595
  this.setValid(!0), this.setHelperText("", !0);
30432
30596
  }
30433
30597
  }
30434
- const defineBadgeStyles = ({ variant: ee }) => {
30435
- const re = ThemeManager.getStyles();
30436
- switch (ee) {
30437
- case "highlight":
30438
- return re.badge.highlight;
30439
- case "error":
30440
- return re.badge.error;
30441
- case "success":
30442
- return re.badge.success;
30443
- case "warning":
30444
- return re.badge.warning;
30445
- case "default":
30446
- default:
30447
- return re.badge.default;
30448
- }
30449
- }, getJustifyContent = (ee) => {
30450
- switch (ee) {
30451
- case "end":
30452
- return "flex-end";
30453
- case "center":
30454
- return "center";
30455
- case "space-between":
30456
- return "space-between";
30457
- case "start":
30458
- default:
30459
- return "flex-start";
30460
- }
30461
- }, getBadgeStyles = ({
30462
- variant: ee = "default",
30463
- isFullWidth: re,
30464
- align: te
30465
- }) => css`
30466
- box-sizing: border-box;
30467
- display: flex;
30468
- align-items: center;
30469
- gap: 8px;
30470
- flex-wrap: wrap;
30471
-
30472
- width: ${re ? "100%" : "fit-content"};
30473
- padding: ${typeof defineBadgeStyles({ variant: ee }).padding == "number" ? `${defineBadgeStyles({ variant: ee }).padding}px` : defineBadgeStyles({ variant: ee }).padding};
30474
-
30475
- background-color: ${defineBadgeStyles({ variant: ee }).backgroundColor};
30476
- border-radius: ${defineBadgeStyles({ variant: ee }).borderRadius}px;
30477
-
30478
- border: ${defineBadgeStyles({ variant: ee }).borderWidth}px
30479
- ${defineBadgeStyles({ variant: ee }).borderStyle} ${defineBadgeStyles({ variant: ee }).borderColor};
30480
-
30481
- justify-content: ${getJustifyContent(te)};
30482
-
30483
- .badge-content {
30484
- display: flex;
30485
- align-items: center;
30486
- gap: 4px;
30487
- flex-wrap: nowrap;
30488
- color: ${defineBadgeStyles({ variant: ee }).textColor};
30489
- }
30490
- `;
30491
- class Badge extends Component {
30492
- constructor({
30493
- items: re,
30494
- variant: te = "default",
30495
- isFullWidth: ne = !1,
30496
- align: ie = "center"
30497
- }) {
30498
- super({
30499
- tag: "div",
30500
- styles: () => getBadgeStyles({ variant: te, isFullWidth: ne, align: ie })
30501
- }), re.forEach(({ title: oe, icon: se, iconLeft: ae, iconRight: ce }) => {
30502
- const ue = document.createElement("div");
30503
- if (ue.classList.add("badge-content"), se || ae) {
30504
- const de = new Icon({
30505
- name: se || ae,
30506
- size: 12,
30507
- color: defineBadgeStyles({ variant: te }).textColor
30508
- }).element;
30509
- ue.append(de);
30510
- }
30511
- const le = new Typography({
30512
- text: oe,
30513
- size: "xSmall",
30514
- weight: 500,
30515
- color: defineBadgeStyles({ variant: te }).textColor,
30516
- align: "center"
30517
- }).element;
30518
- if (ue.append(le), ce) {
30519
- const de = new Icon({
30520
- name: ce,
30521
- size: 12,
30522
- color: defineBadgeStyles({ variant: te }).textColor
30523
- }).element;
30524
- ue.append(de);
30525
- }
30526
- this.element.append(ue);
30527
- });
30528
- }
30529
- }
30530
30598
  const APCardsFields = (ee, re, te) => [
30531
30599
  {
30532
30600
  field: "#cc-holder",
@@ -30601,13 +30669,111 @@ const APCardsFields = (ee, re, te) => [
30601
30669
  }).element;
30602
30670
  }, mountInstallmentData = (ee, re) => {
30603
30671
  var te;
30604
- return (te = ee == null ? void 0 : ee.data) != null && te.length ? ee.data.map((ne) => ({
30605
- value: ne.installmentNumber,
30672
+ return (te = ee == null ? void 0 : ee.data) != null && te.length ? ee.data.map((ne, ie) => ({
30673
+ value: ie,
30606
30674
  content: formatInstallmentContent(ne, re),
30607
30675
  rightContent: createInstallmentBadge(ne),
30676
+ promotionMessage: ne.promotionMessage ?? void 0,
30608
30677
  meta: ne
30609
30678
  })) : [];
30610
- }, DEFAULT_EXPIRATION_DATE_FORMAT = "MM/YY";
30679
+ }, createLoadingWrapper = (ee) => {
30680
+ const re = document.createElement("div");
30681
+ re.classList.add("loading-wrapper");
30682
+ const te = new Loading({
30683
+ size: 100,
30684
+ variant: "fetching",
30685
+ color: ThemeManager.getStyles().primaryColor
30686
+ }).element, ne = new Typography({
30687
+ text: ee,
30688
+ size: "base",
30689
+ lineHeight: 30,
30690
+ weight: 600,
30691
+ align: "center"
30692
+ }).element;
30693
+ return re.append(te, ne), re;
30694
+ }, buildBrandBadge = (ee) => {
30695
+ const re = (ee == null ? void 0 : ee.toLowerCase()) ?? "", ne = {
30696
+ visa: "payment_visa",
30697
+ mastercard: "payment_master",
30698
+ amex: "payment_amex"
30699
+ }[re] ?? "bank_card_line";
30700
+ return new Icon({
30701
+ name: ne,
30702
+ size: ThemeManager.getFontScale().xLarge
30703
+ }).element;
30704
+ }, INSTALLMENTS_BIN_DEBOUNCE_MS = 400, INSTALLMENTS_LOOKUP_MAX_ATTEMPTS = 3, INSTALLMENTS_LOOKUP_RETRY_DELAY_MS = 2e3;
30705
+ class InstallmentsPromotionManager {
30706
+ constructor(re) {
30707
+ Ie(this, "initialWrapper");
30708
+ Ie(this, "updateUrl");
30709
+ Ie(this, "onUpdate");
30710
+ Ie(this, "onLoadingChange");
30711
+ Ie(this, "onError");
30712
+ Ie(this, "currentBin");
30713
+ Ie(this, "resolvedBin");
30714
+ Ie(this, "isPending", !1);
30715
+ Ie(this, "destroyed", !1);
30716
+ Ie(this, "requestId", 0);
30717
+ Ie(this, "retryTimer", null);
30718
+ Ie(this, "debouncedFetch", debounce(
30719
+ (re, te) => {
30720
+ this.fetchWithRetry(re, te);
30721
+ },
30722
+ INSTALLMENTS_BIN_DEBOUNCE_MS
30723
+ ));
30724
+ this.initialWrapper = re.initialWrapper, this.updateUrl = re.updateUrl, this.onUpdate = re.onUpdate, this.onLoadingChange = re.onLoadingChange, this.onError = re.onError;
30725
+ }
30726
+ isReady() {
30727
+ return !this.isPending && (this.currentBin === void 0 || this.resolvedBin === this.currentBin);
30728
+ }
30729
+ handleBinChange(re) {
30730
+ if (this.destroyed) return;
30731
+ const te = re ? re.slice(0, 6) : void 0;
30732
+ if (te !== this.currentBin) {
30733
+ if (this.currentBin = te, this.resolvedBin = void 0, this.requestId += 1, this.cancelRetryTimer(), te === void 0) {
30734
+ this.debouncedFetch.cancel(), this.onUpdate(this.initialWrapper), this.setPending(!1);
30735
+ return;
30736
+ }
30737
+ this.debouncedFetch(te, this.requestId), this.setPending(!0);
30738
+ }
30739
+ }
30740
+ destroy() {
30741
+ this.destroyed = !0, this.requestId += 1, this.debouncedFetch.cancel(), this.cancelRetryTimer();
30742
+ }
30743
+ async fetchWithRetry(re, te) {
30744
+ for (let ne = 1; ne <= INSTALLMENTS_LOOKUP_MAX_ATTEMPTS; ne += 1) {
30745
+ if (te !== this.requestId) return;
30746
+ try {
30747
+ const ie = await PaymentMethodsService.postInstallmentsUpdate(this.updateUrl, {
30748
+ firstSixDigits: re
30749
+ });
30750
+ if (te !== this.requestId) return;
30751
+ this.resolvedBin = re, this.onUpdate(ie), this.setPending(!1);
30752
+ return;
30753
+ } catch {
30754
+ if (te !== this.requestId) return;
30755
+ ne < INSTALLMENTS_LOOKUP_MAX_ATTEMPTS && await this.waitBeforeRetry();
30756
+ }
30757
+ }
30758
+ te === this.requestId && (this.setPending(!1), this.onError());
30759
+ }
30760
+ setPending(re) {
30761
+ this.isPending !== re && (this.isPending = re, this.onLoadingChange(re));
30762
+ }
30763
+ waitBeforeRetry() {
30764
+ return new Promise((re) => {
30765
+ const te = setTimeout(() => {
30766
+ this.retryTimer = null, re();
30767
+ }, INSTALLMENTS_LOOKUP_RETRY_DELAY_MS);
30768
+ this.retryTimer = { id: te, resolve: re };
30769
+ });
30770
+ }
30771
+ /** Clears a pending retry delay and resolves it so the loop exits via the requestId check. */
30772
+ cancelRetryTimer() {
30773
+ this.retryTimer && (clearTimeout(this.retryTimer.id), this.retryTimer.resolve(), this.retryTimer = null);
30774
+ }
30775
+ }
30776
+ const DEFAULT_EXPIRATION_DATE_FORMAT = "MM/YY";
30611
30777
  class CardPaymentMethod extends Component {
30612
30778
  constructor(te) {
30613
30779
  super({
@@ -30633,6 +30799,8 @@ class CardPaymentMethod extends Component {
30633
30799
  Ie(this, "hasInstallments", !1);
30634
30800
  Ie(this, "installmentsEl", null);
30635
30801
  Ie(this, "installmentsDropdown", null);
30802
+ Ie(this, "installmentsPromotionManager", null);
30803
+ Ie(this, "installmentsUpdateUrl", null);
30636
30804
  Ie(this, "saveCardToggle", null);
30637
30805
  Ie(this, "saveCardsEnabled", !1);
30638
30806
  Ie(this, "mode", "new-card");
@@ -30649,7 +30817,7 @@ class CardPaymentMethod extends Component {
30649
30817
  ...te,
30650
30818
  showPaymentSummary: te.showPaymentSummary ?? !0,
30651
30819
  expirationDateFormat: te.expirationDateFormat ?? DEFAULT_EXPIRATION_DATE_FORMAT
30652
- }, this.loadingWrapper = this.createLoadingWrapper(AstroPayI18n.translate("hold_on")), this.element.append(this.loadingWrapper), localStorage.getItem(EStorageKey.SESSION_ID) || localStorage.setItem(EStorageKey.SESSION_ID, uuid()), this.fetchPaymentMethodDetail();
30820
+ }, this.loadingWrapper = createLoadingWrapper(AstroPayI18n.translate("hold_on")), this.element.append(this.loadingWrapper), localStorage.getItem(EStorageKey.SESSION_ID) || localStorage.setItem(EStorageKey.SESSION_ID, uuid()), this.fetchPaymentMethodDetail();
30653
30821
  }
30654
30822
  async fetchPaymentMethodDetail() {
30655
30823
  try {
@@ -30657,7 +30825,9 @@ class CardPaymentMethod extends Component {
30657
30825
  paymentExternalId: this.componentProps.paymentExternalId,
30658
30826
  methodCode: this.componentProps.paymentMethod.code
30659
30827
  });
30660
- this.saveCardsEnabled = te.saveCardEnabled ?? !1, this.savedCards = this.saveCardsEnabled ? te.savedCards ?? [] : [], this.renderCardSection(te.fields, te.installments);
30828
+ this.saveCardsEnabled = te.saveCardEnabled ?? !1, this.savedCards = this.saveCardsEnabled ? te.savedCards ?? [] : [];
30829
+ const ne = te.installmentsUpdateUrl, { paymentExternalId: ie, paymentMethod: oe } = this.componentProps;
30830
+ this.installmentsUpdateUrl = ne ? buildPathWithParams(ne, { paymentExternalId: ie, methodCode: oe.code }) : null, this.renderCardSection(te.fields, te.installments);
30661
30831
  } catch (te) {
30662
30832
  const ne = te;
30663
30833
  this.showErrorMessage(ne.description ?? ne.message);
@@ -30747,18 +30917,6 @@ class CardPaymentMethod extends Component {
30747
30917
  // state is read via isChecked() at submit time
30748
30918
  }), this.element.append(this.saveCardToggle.element);
30749
30919
  }
30750
- /** Returns an inline badge for a card brand */
30751
- buildBrandBadge(te) {
30752
- const ne = (te == null ? void 0 : te.toLowerCase()) ?? "", oe = {
30753
- visa: "payment_visa",
30754
- mastercard: "payment_master",
30755
- amex: "payment_amex"
30756
- }[ne] ?? "bank_card_line";
30757
- return new Icon({
30758
- name: oe,
30759
- size: ThemeManager.getFontScale().xLarge
30760
- }).element;
30761
- }
30762
30920
  renderSavedCardSelector(te) {
30763
30921
  var ie;
30764
30922
  this.savedCardSelectorWrapper = document.createElement("div"), this.savedCardSelectorWrapper.classList.add("ap-saved-card-selector"), te.forEach((oe) => {
@@ -30783,7 +30941,7 @@ class CardPaymentMethod extends Component {
30783
30941
  const oe = document.createElement("span");
30784
30942
  oe.classList.add("ap-sc-radio");
30785
30943
  const se = document.createElement("span");
30786
- se.classList.add("ap-sc-brand"), se.append(this.buildBrandBadge(te.brand));
30944
+ se.classList.add("ap-sc-brand"), se.append(buildBrandBadge(te.brand));
30787
30945
  const ae = te.type === "CC" ? AstroPayI18n.translate("credit") : AstroPayI18n.translate("debit"), ce = document.createElement("span");
30788
30946
  ce.classList.add("ap-sc-main");
30789
30947
  const ue = new Typography({ text: `•••• ${te.lastFourDigits}` });
@@ -30894,28 +31052,28 @@ class CardPaymentMethod extends Component {
30894
31052
  return te.append(ue.element), ue;
30895
31053
  }
30896
31054
  switchToSavedCardMode(te, ne, ie, oe) {
30897
- var ae, ce, ue, le, de, fe, he, pe, ge, me, ye, ve, be, _e, Ce;
31055
+ var ae, ce, ue, le, de, fe, he, pe, ge, me, ye, ve, be, _e, Ce, Te, Se;
30898
31056
  if (this.activeScRow === ne) {
30899
31057
  (ae = ne.querySelector(".ap-sc-confirm")) == null || ae.classList.remove("is-open"), (ce = ne.querySelector(".ap-sc-radio")) == null || ce.classList.remove("is-on"), (ue = ne.querySelector(".ap-sc-row__head")) == null || ue.setAttribute("aria-expanded", "false"), this.savedCardCvvInput && this.rowContainerEl && (this.savedCardCvvInput.element.classList.add("ap-hidden"), this.rowContainerEl.append(this.savedCardCvvInput.element)), this.hasInstallments && this.installmentsEl && (this.element.insertBefore(
30900
31058
  this.installmentsEl,
30901
31059
  ((le = this.requiredFieldsForm) == null ? void 0 : le.element) ?? ((de = this.saveCardToggle) == null ? void 0 : de.element) ?? ((fe = this.btnPay) == null ? void 0 : fe.element) ?? null
30902
- ), this.installmentsEl.classList.add("ap-hidden")), this.mode = "new-card", this.selectedSavedCard = null, this.activeScRow = null, this.savedCardPayBtn = null, this.savedCardCvvState = { isValid: !1, isTouched: !1 }, this.updateSubmitButton();
31060
+ ), this.installmentsEl.classList.add("ap-hidden")), this.mode = "new-card", this.selectedSavedCard = null, this.activeScRow = null, this.savedCardPayBtn = null, this.savedCardCvvState = { isValid: !1, isTouched: !1 }, (he = this.installmentsPromotionManager) == null || he.handleBinChange(void 0), this.updateSubmitButton();
30903
31061
  return;
30904
31062
  }
30905
- this.activeScRow && ((he = this.activeScRow.querySelector(".ap-sc-confirm")) == null || he.classList.remove("is-open"), (pe = this.activeScRow.querySelector(".ap-sc-radio")) == null || pe.classList.remove("is-on"), (ge = this.activeScRow.querySelector(".ap-sc-row__head")) == null || ge.setAttribute("aria-expanded", "false"), this.savedCardCvvInput && this.rowContainerEl && (this.savedCardCvvInput.element.classList.add("ap-hidden"), this.rowContainerEl.append(this.savedCardCvvInput.element))), this.mode = "saved-card", this.selectedSavedCard = te, this.activeScRow = ne, this.savedCardCvvState = { isValid: !1, isTouched: !1 }, (me = this.installmentsDropdown) == null || me.reset(), this.savedCardPayBtn = oe, ie.classList.add("is-open"), (ye = ne.querySelector(".ap-sc-radio")) == null || ye.classList.add("is-on"), (ve = ne.querySelector(".ap-sc-row__head")) == null || ve.setAttribute("aria-expanded", "true");
31063
+ this.activeScRow && ((pe = this.activeScRow.querySelector(".ap-sc-confirm")) == null || pe.classList.remove("is-open"), (ge = this.activeScRow.querySelector(".ap-sc-radio")) == null || ge.classList.remove("is-on"), (me = this.activeScRow.querySelector(".ap-sc-row__head")) == null || me.setAttribute("aria-expanded", "false"), this.savedCardCvvInput && this.rowContainerEl && (this.savedCardCvvInput.element.classList.add("ap-hidden"), this.rowContainerEl.append(this.savedCardCvvInput.element))), this.mode = "saved-card", this.selectedSavedCard = te, this.activeScRow = ne, this.savedCardCvvState = { isValid: !1, isTouched: !1 }, (ye = this.installmentsDropdown) == null || ye.reset(), (ve = this.installmentsPromotionManager) == null || ve.handleBinChange(te.firstSixDigits), this.savedCardPayBtn = oe, ie.classList.add("is-open"), (be = ne.querySelector(".ap-sc-radio")) == null || be.classList.add("is-on"), (_e = ne.querySelector(".ap-sc-row__head")) == null || _e.setAttribute("aria-expanded", "true");
30906
31064
  const se = ie.querySelector(".ap-sc-cvv-host");
30907
31065
  if (se && this.savedCardCvvInput && (this.savedCardCvvInput.element.classList.remove("ap-hidden"), se.append(this.savedCardCvvInput.element)), this.hasInstallments && this.installmentsEl) {
30908
- const Te = ie.querySelector(".ap-sc-installments-host");
30909
- Te && (Te.append(this.installmentsEl), this.installmentsEl.classList.remove("ap-hidden"));
31066
+ const Re = ie.querySelector(".ap-sc-installments-host");
31067
+ Re && (Re.append(this.installmentsEl), this.installmentsEl.classList.remove("ap-hidden"));
30910
31068
  }
30911
- this.cardHolderInput && this.cardHolderInput.element.classList.add("ap-hidden"), this.cardNumberInput && this.cardNumberInput.element.classList.add("ap-hidden"), this.rowContainerEl && this.rowContainerEl.classList.add("ap-hidden"), this.saveCardToggle && this.saveCardToggle.element.classList.add("ap-hidden"), (be = this.btnPay) == null || be.setDisabled(!0), (Ce = (_e = this.btnPay) == null ? void 0 : _e.element) == null || Ce.classList.add("ap-hidden"), this.requiredFieldsForm && (!!(te.documentType || te.documentNumber) ? this.requiredFieldsForm.element.classList.add("ap-hidden") : this.requiredFieldsForm.element.classList.remove("ap-hidden")), this.updateSubmitButton();
31069
+ this.cardHolderInput && this.cardHolderInput.element.classList.add("ap-hidden"), this.cardNumberInput && this.cardNumberInput.element.classList.add("ap-hidden"), this.rowContainerEl && this.rowContainerEl.classList.add("ap-hidden"), this.saveCardToggle && this.saveCardToggle.element.classList.add("ap-hidden"), (Ce = this.btnPay) == null || Ce.setDisabled(!0), (Se = (Te = this.btnPay) == null ? void 0 : Te.element) == null || Se.classList.add("ap-hidden"), this.requiredFieldsForm && (!!(te.documentType || te.documentNumber) ? this.requiredFieldsForm.element.classList.add("ap-hidden") : this.requiredFieldsForm.element.classList.remove("ap-hidden")), this.updateSubmitButton();
30912
31070
  }
30913
31071
  switchToNewCardMode() {
30914
- var te, ne, ie, oe, se, ae, ce, ue, le;
31072
+ var te, ne, ie, oe, se, ae, ce, ue, le, de;
30915
31073
  this.activeScRow && ((te = this.activeScRow.querySelector(".ap-sc-confirm")) == null || te.classList.remove("is-open"), (ne = this.activeScRow.querySelector(".ap-sc-radio")) == null || ne.classList.remove("is-on"), (ie = this.activeScRow.querySelector(".ap-sc-row__head")) == null || ie.setAttribute("aria-expanded", "false"), this.savedCardCvvInput && this.rowContainerEl && (this.savedCardCvvInput.element.classList.add("ap-hidden"), this.rowContainerEl.append(this.savedCardCvvInput.element))), this.mode = "new-card", this.selectedSavedCard = null, this.activeScRow = null, this.savedCardPayBtn = null, this.savedCardCvvState = { isValid: !1, isTouched: !1 }, this.cardHolderInput && this.cardHolderInput.element.classList.remove("ap-hidden"), this.cardNumberInput && this.cardNumberInput.element.classList.remove("ap-hidden"), this.rowContainerEl && this.rowContainerEl.classList.remove("ap-hidden"), this.installmentsEl && (this.element.insertBefore(
30916
31074
  this.installmentsEl,
30917
31075
  ((oe = this.requiredFieldsForm) == null ? void 0 : oe.element) ?? ((se = this.saveCardToggle) == null ? void 0 : se.element) ?? ((ae = this.btnPay) == null ? void 0 : ae.element) ?? null
30918
- ), this.installmentsEl.classList.remove("ap-hidden")), this.requiredFieldsForm && this.requiredFieldsForm.element.classList.remove("ap-hidden"), this.saveCardToggle && this.saveCardToggle.element.classList.remove("ap-hidden"), (ue = (ce = this.btnPay) == null ? void 0 : ce.element) == null || ue.classList.remove("ap-hidden"), this.formState = { ...EMPTY_FORM_DATA }, (le = this.cardNumberInput) == null || le.setBrandIcon(null), this.updateSubmitButton();
31076
+ ), this.installmentsEl.classList.remove("ap-hidden")), this.requiredFieldsForm && this.requiredFieldsForm.element.classList.remove("ap-hidden"), this.saveCardToggle && this.saveCardToggle.element.classList.remove("ap-hidden"), (ue = (ce = this.btnPay) == null ? void 0 : ce.element) == null || ue.classList.remove("ap-hidden"), this.formState = { ...EMPTY_FORM_DATA }, (le = this.cardNumberInput) == null || le.setBrandIcon(null), (de = this.installmentsPromotionManager) == null || de.handleBinChange(void 0), this.updateSubmitButton();
30919
31077
  }
30920
31078
  /**
30921
31079
  * Hides the new-card form. Called on initial render when saved cards are present —
@@ -31069,7 +31227,18 @@ class CardPaymentMethod extends Component {
31069
31227
  this.updateAmount((oe = ie.meta) == null ? void 0 : oe.totalAmount), this.selectedInstallment = ie.meta;
31070
31228
  }
31071
31229
  });
31072
- this.installmentsDropdown = ne, this.installmentsEl = ne.element, this.element.append(ne.element);
31230
+ this.installmentsDropdown = ne, this.installmentsEl = ne.element, this.element.append(ne.element), this.installmentsUpdateUrl && (this.installmentsPromotionManager = new InstallmentsPromotionManager({
31231
+ initialWrapper: te,
31232
+ updateUrl: this.installmentsUpdateUrl,
31233
+ onUpdate: (ie) => ne.setOptions(mountInstallmentData(ie, ie.currency)),
31234
+ onLoadingChange: (ie) => {
31235
+ ne.setLoading(ie), this.updateSubmitButton();
31236
+ },
31237
+ onError: () => {
31238
+ var ie;
31239
+ (ie = this.installmentsPromotionManager) == null || ie.destroy(), this.installmentsPromotionManager = null, this.showErrorMessage(AstroPayI18n.translate("generic_error")), this.renderRetryButton();
31240
+ }
31241
+ }));
31073
31242
  }
31074
31243
  updateAmount(te) {
31075
31244
  var ie, oe, se;
@@ -31084,10 +31253,10 @@ class CardPaymentMethod extends Component {
31084
31253
  (ie = this.btnPay) == null || ie.setText(ne), (oe = this.savedCardPayBtn) == null || oe.setText(ne), (se = this.paymentSummary) == null || se.setAmountAndCurrency(te, this.componentProps.currency);
31085
31254
  }
31086
31255
  handleFormStateChange(te) {
31087
- var ie;
31256
+ var ie, oe;
31088
31257
  this.formState = te;
31089
31258
  const ne = te.card_number.brand;
31090
- (ie = this.cardNumberInput) == null || ie.setBrandIcon(ne ? this.buildBrandBadge(ne) : null), this.updateInputsValidation(), this.updateSubmitButton();
31259
+ (ie = this.cardNumberInput) == null || ie.setBrandIcon(ne ? buildBrandBadge(ne) : null), (oe = this.installmentsPromotionManager) == null || oe.handleBinChange(te.card_number.bin), this.updateInputsValidation(), this.updateSubmitButton();
31091
31260
  }
31092
31261
  updateInputsValidation() {
31093
31262
  if (this.mode === "saved-card")
@@ -31102,30 +31271,19 @@ class CardPaymentMethod extends Component {
31102
31271
  });
31103
31272
  }
31104
31273
  updateSubmitButton() {
31105
- var se, ae, ce;
31274
+ var ae, ce, ue, le;
31106
31275
  let te;
31107
31276
  this.mode === "saved-card" ? te = this.savedCardCvvState.isValid && this.savedCardCvvState.isTouched : te = Object.values(this.formState).every(
31108
- (ue) => ue.isValid && ue.isTouched
31277
+ (de) => de.isValid && de.isTouched
31109
31278
  );
31110
- const ne = !!((se = this.selectedSavedCard) != null && se.documentType || (ae = this.selectedSavedCard) != null && ae.documentNumber), ie = this.requiredFieldsForm ? this.mode === "saved-card" ? !ne : !0 : !1, oe = te && (ie ? this.isFormTemplateValid : !0);
31111
- this.mode === "saved-card" ? this.savedCardPayBtn && this.savedCardPayBtn.setDisabled(!oe) : (ce = this.btnPay) == null || ce.setDisabled(!oe);
31279
+ const ne = !!((ae = this.selectedSavedCard) != null && ae.documentType || (ce = this.selectedSavedCard) != null && ce.documentNumber), ie = this.requiredFieldsForm ? this.mode === "saved-card" ? !ne : !0 : !1, oe = ((ue = this.installmentsPromotionManager) == null ? void 0 : ue.isReady()) ?? !0, se = te && oe && (ie ? this.isFormTemplateValid : !0);
31280
+ this.mode === "saved-card" ? this.savedCardPayBtn && this.savedCardPayBtn.setDisabled(!se) : (le = this.btnPay) == null || le.setDisabled(!se);
31112
31281
  }
31113
- /** Locks all editable fields to prevent changes during submission. */
31114
- lockFields() {
31115
- var ne, ie, oe, se;
31116
- [
31117
- (ne = this.cardHolderInput) == null ? void 0 : ne.element,
31118
- (ie = this.cardNumberInput) == null ? void 0 : ie.element,
31119
- this.rowContainerEl,
31120
- (oe = this.requiredFieldsForm) == null ? void 0 : oe.element,
31121
- this.installmentsEl,
31122
- (se = this.saveCardToggle) == null ? void 0 : se.element
31123
- ].forEach((ae) => {
31124
- ae && ae.classList.add("ap-locked");
31125
- });
31126
- }
31127
- /** Restores field interactivity after a failed submission. */
31128
- unlockFields() {
31282
+ /**
31283
+ * Locks all editable fields to prevent changes during submission (`true`), or restores
31284
+ * field interactivity after a failed submission (`false`).
31285
+ */
31286
+ setFieldsLocked(te) {
31129
31287
  var ne, ie, oe, se;
31130
31288
  [
31131
31289
  (ne = this.cardHolderInput) == null ? void 0 : ne.element,
@@ -31134,14 +31292,12 @@ class CardPaymentMethod extends Component {
31134
31292
  (oe = this.requiredFieldsForm) == null ? void 0 : oe.element,
31135
31293
  this.installmentsEl,
31136
31294
  (se = this.saveCardToggle) == null ? void 0 : se.element
31137
- ].forEach((ae) => {
31138
- ae && ae.classList.remove("ap-locked");
31139
- });
31295
+ ].forEach((ae) => ae == null ? void 0 : ae.classList.toggle("ap-locked", te));
31140
31296
  }
31141
31297
  async handleSubmit() {
31142
31298
  var te, ne, ie, oe, se, ae, ce, ue, le, de;
31143
31299
  try {
31144
- this.mode === "saved-card" ? this.savedCardPayBtn && this.savedCardPayBtn.setLoading(!0) : (te = this.btnPay) == null || te.setLoading(!0), this.lockFields(), (ie = (ne = this.componentProps).onProcessingStart) == null || ie.call(ne);
31300
+ this.mode === "saved-card" ? this.savedCardPayBtn && this.savedCardPayBtn.setLoading(!0) : (te = this.btnPay) == null || te.setLoading(!0), this.setFieldsLocked(!0), (ie = (ne = this.componentProps).onProcessingStart) == null || ie.call(ne);
31145
31301
  let fe;
31146
31302
  if (this.mode === "saved-card" && this.selectedSavedCard) {
31147
31303
  const { cvvToken: pe } = await this.handleTokenizeSavedCard();
@@ -31165,7 +31321,7 @@ class CardPaymentMethod extends Component {
31165
31321
  } else throw new Error(AstroPayI18n.translate("generic_error"));
31166
31322
  } catch (fe) {
31167
31323
  const he = fe;
31168
- console.error(he.message), this.unlockFields(), this.clearProcessingTextTimers(), (de = (le = this.componentProps).onProcessingEnd) == null || de.call(le), this.showErrorMessage(he.description ?? he.message), this.renderRetryButton();
31324
+ console.error(he.message), this.setFieldsLocked(!1), this.clearProcessingTextTimers(), (de = (le = this.componentProps).onProcessingEnd) == null || de.call(le), this.showErrorMessage(he.description ?? he.message), this.renderRetryButton();
31169
31325
  }
31170
31326
  }
31171
31327
  async handleTokenizeCard() {
@@ -31235,7 +31391,7 @@ class CardPaymentMethod extends Component {
31235
31391
  showWaitingInfo(te) {
31236
31392
  if (this.processingTextTimers.length > 0) return;
31237
31393
  this.element.innerHTML = "";
31238
- const ne = this.createLoadingWrapper(AstroPayI18n.translate("hold_on"));
31394
+ const ne = createLoadingWrapper(AstroPayI18n.translate("hold_on"));
31239
31395
  ne.style.minHeight = "400px", this.element.append(ne);
31240
31396
  const ie = ne.lastElementChild;
31241
31397
  this.processingTextTimers.push(
@@ -31273,22 +31429,6 @@ class CardPaymentMethod extends Component {
31273
31429
  }).element;
31274
31430
  ne.push(ie), this.componentProps.onError ? this.componentProps.onError(ne) : (this.element.innerHTML = "", ne.forEach((ae) => this.element.append(ae)));
31275
31431
  }
31276
- createLoadingWrapper(te) {
31277
- const ne = document.createElement("div");
31278
- ne.classList.add("loading-wrapper");
31279
- const ie = new Loading({
31280
- size: 100,
31281
- variant: "fetching",
31282
- color: ThemeManager.getStyles().primaryColor
31283
- }).element, oe = new Typography({
31284
- text: te,
31285
- size: "base",
31286
- lineHeight: 30,
31287
- weight: 600,
31288
- align: "center"
31289
- }).element;
31290
- return ne.append(ie, oe), ne;
31291
- }
31292
31432
  renderRetryButton() {
31293
31433
  const te = document.createElement("div");
31294
31434
  te.classList.add("center-row");
@@ -31304,8 +31444,8 @@ class CardPaymentMethod extends Component {
31304
31444
  te.append(ne), this.element.append(te);
31305
31445
  }
31306
31446
  destroy() {
31307
- var te, ne;
31308
- this.clearProcessingTextTimers(), this.stopPolling(), (te = this.cardManager) == null || te.unmount(), (ne = this.savedCardManager) == null || ne.unmount(), this.element.remove();
31447
+ var te, ne, ie;
31448
+ this.clearProcessingTextTimers(), this.stopPolling(), (te = this.cardManager) == null || te.unmount(), (ne = this.savedCardManager) == null || ne.unmount(), (ie = this.installmentsPromotionManager) == null || ie.destroy(), this.element.remove();
31309
31449
  }
31310
31450
  }
31311
31451
  class AmplitudeAnalytics {
@@ -33212,13 +33352,13 @@ function requireQrcode() {
33212
33352
  dr[ur] = Cr.slice(fr, fr + Sr), Qe[ur] = hr.encode(dr[ur]), fr += Sr, Bt = Math.max(Bt, Sr);
33213
33353
  }
33214
33354
  const Fe = new Uint8Array(Ae);
33215
- let ke = 0, qe, mr;
33216
- for (qe = 0; qe < Bt; qe++)
33355
+ let ke = 0, We, mr;
33356
+ for (We = 0; We < Bt; We++)
33217
33357
  for (mr = 0; mr < De; mr++)
33218
- qe < dr[mr].length && (Fe[ke++] = dr[mr][qe]);
33219
- for (qe = 0; qe < Ke; qe++)
33358
+ We < dr[mr].length && (Fe[ke++] = dr[mr][We]);
33359
+ for (We = 0; We < Ke; We++)
33220
33360
  for (mr = 0; mr < De; mr++)
33221
- Fe[ke++] = Qe[mr][qe];
33361
+ Fe[ke++] = Qe[mr][We];
33222
33362
  return Fe;
33223
33363
  }
33224
33364
  function Ce(Te, Se, Re, Ae) {
@@ -34235,7 +34375,8 @@ class PaymentMethod extends Component {
34235
34375
  text: `${te.text} ${formatAmountCurrency(te.amount, te.currency, AstroPayConfig.getCurrencyMode())}`,
34236
34376
  size: "medium",
34237
34377
  lineHeight: 24,
34238
- weight: 600
34378
+ weight: 600,
34379
+ align: "center"
34239
34380
  }).element;
34240
34381
  this.element.append(ne);
34241
34382
  }
@@ -34813,6 +34954,173 @@ class AstroPayPayment extends Component {
34813
34954
  this.element.remove(), AstroPayCore.unregisterComponent(this);
34814
34955
  }
34815
34956
  }
34957
+ const EXCLUDED_METHOD_CODES = [...CARDS_METHOD, EPaymentCode.AP], isSupportedSinglePaymentMethodCode = (ee) => typeof ee == "string" && ee.trim() !== "" && !EXCLUDED_METHOD_CODES.some((re) => re === ee), findRequestedPaymentMethod = (ee, re) => ee == null ? void 0 : ee.find((te) => te.code === re && te.enabled), getAstroPaySinglePaymentMethodStyles = (ee) => css`
34958
+ background-color: ${ee.backgroundColor};
34959
+
34960
+ display: flex;
34961
+ flex-direction: column;
34962
+ gap: 12px;
34963
+
34964
+ max-width: ${typeof ee.width == "number" ? `${ee.width}px` : ee.width};
34965
+ padding: ${typeof ee.paddingWrapper == "number" ? `${ee.paddingWrapper}px` : ee.paddingWrapper};
34966
+ border-radius: ${typeof ee.borderRadiusWrapper == "number" ? `${ee.borderRadiusWrapper}px` : ee.borderRadiusWrapper};
34967
+
34968
+ .ap-single-payment-method-loading {
34969
+ display: flex;
34970
+ flex-direction: column;
34971
+ justify-content: center;
34972
+ align-items: center;
34973
+ width: 100%;
34974
+ gap: 8px;
34975
+ min-height: 250px;
34976
+ }
34977
+ `, INITIALIZER = "single_payment_method";
34978
+ class AstroPaySinglePaymentMethod extends Component {
34979
+ constructor(te) {
34980
+ super({
34981
+ tag: "div",
34982
+ styles: (ae) => getAstroPaySinglePaymentMethodStyles(ae)
34983
+ });
34984
+ Ie(this, "componentProps");
34985
+ Ie(this, "loadingWrapper", null);
34986
+ Ie(this, "paymentMethod", null);
34987
+ // Set by destroy(); async/queued work checks it so nothing renders or calls back afterwards.
34988
+ Ie(this, "isDestroyed", !1);
34989
+ const ne = te.showTitle ?? !0, ie = te.paymentMethodCode, oe = typeof ie == "string" ? ie.trim().toUpperCase() : ie;
34990
+ if (this.componentProps = te.paymentExternalId !== void 0 ? { ...te, showTitle: ne, paymentMethodCode: oe } : {
34991
+ ...te,
34992
+ showTitle: ne,
34993
+ paymentMethodCode: oe,
34994
+ country: te.country.trim().toUpperCase(),
34995
+ currency: te.currency.trim().toUpperCase()
34996
+ }, AstroPayCore.registerComponent(this), AmplitudeAnalytics$1.astroPayPaymentImpression("AstroPaySinglePaymentMethod"), DataDogTracker.trackEvent("ap_cl_astropay_single_payment_method_init"), !isSupportedSinglePaymentMethodCode(this.componentProps.paymentMethodCode)) {
34997
+ this.showErrorMessage(AstroPayI18n.translate("payment_method_unavailable")), queueMicrotask(() => {
34998
+ var ae, ce;
34999
+ this.isDestroyed || (ce = (ae = this.componentProps).onError) == null || ce.call(ae);
35000
+ });
35001
+ return;
35002
+ }
35003
+ this.loadingWrapper = document.createElement("div"), this.loadingWrapper.classList.add("ap-single-payment-method-loading");
35004
+ const se = new Loading({
35005
+ size: 100,
35006
+ variant: "fetching",
35007
+ color: ThemeManager.getStyles().primaryColor
35008
+ }).element;
35009
+ this.loadingWrapper.append(se), this.element.appendChild(this.loadingWrapper), this.createPayment();
35010
+ }
35011
+ async createPayment() {
35012
+ var ne, ie;
35013
+ const te = this.componentProps;
35014
+ try {
35015
+ let oe;
35016
+ if (te.paymentExternalId !== void 0 ? oe = await PaymentService.getPaymentDetails(te.paymentExternalId, INITIALIZER) : oe = await PaymentService.postCreatePayment(
35017
+ {
35018
+ country: te.country,
35019
+ currency: te.currency,
35020
+ amount: te.amount,
35021
+ order: te.order,
35022
+ methodCode: te.paymentMethodCode
35023
+ },
35024
+ INITIALIZER
35025
+ ), this.isDestroyed)
35026
+ return;
35027
+ this.renderPaymentMethod(oe);
35028
+ } catch (oe) {
35029
+ if (this.isDestroyed)
35030
+ return;
35031
+ const se = oe;
35032
+ (ne = te.onError) == null || ne.call(te), this.showErrorMessage(se.description ?? se.message);
35033
+ } finally {
35034
+ (ie = this.loadingWrapper) == null || ie.remove();
35035
+ }
35036
+ }
35037
+ renderPaymentMethod(te) {
35038
+ var ie, oe;
35039
+ const ne = findRequestedPaymentMethod(
35040
+ te.paymentMethods,
35041
+ this.componentProps.paymentMethodCode
35042
+ );
35043
+ if (ne === void 0) {
35044
+ (oe = (ie = this.componentProps).onError) == null || oe.call(ie), this.showErrorMessage(AstroPayI18n.translate("payment_method_unavailable"));
35045
+ return;
35046
+ }
35047
+ if (this.element.innerHTML = "", this.componentProps.showTitle === !0 && ne.label.trim() !== "") {
35048
+ const se = new Typography({
35049
+ text: ne.label,
35050
+ variant: "div",
35051
+ size: ThemeManager.getFontScale().small,
35052
+ weight: 600
35053
+ }).element;
35054
+ se.classList.add("ap-single-payment-method-title"), this.element.append(se);
35055
+ }
35056
+ this.paymentMethod = new PaymentMethod({
35057
+ paymentExternalId: te.paymentExternalId,
35058
+ paymentMethod: ne,
35059
+ onSuccess: (se) => this.showResultScreen(se, {
35060
+ type: "success",
35061
+ onSuccess: this.componentProps.onSuccess
35062
+ }),
35063
+ onError: (se) => this.showResultScreen(se, {
35064
+ type: "error",
35065
+ onError: this.componentProps.onError
35066
+ })
35067
+ }), this.element.append(this.paymentMethod.element);
35068
+ }
35069
+ showErrorMessage(te) {
35070
+ this.element.innerHTML = "";
35071
+ const ne = new Typography({
35072
+ text: te,
35073
+ size: ThemeManager.getFontScale().xSmall,
35074
+ color: ThemeManager.getStyles().messages.error.textColor
35075
+ }).element;
35076
+ this.element.append(ne);
35077
+ }
35078
+ showResultScreen(te, ne) {
35079
+ var oe;
35080
+ (oe = this.paymentMethod) == null || oe.destroy(), this.paymentMethod = null, this.element.innerHTML = "";
35081
+ const ie = new ResultScreen({
35082
+ type: ne.type,
35083
+ contentElements: te,
35084
+ onSuccess: ne.onSuccess,
35085
+ onError: ne.onError
35086
+ });
35087
+ this.element.append(ie.element);
35088
+ }
35089
+ /**
35090
+ * Renders the payment component into the specified DOM container.
35091
+ *
35092
+ * @example
35093
+ * ```ts
35094
+ * const paymentComponent = new AstroPaySinglePaymentMethod(paymentSettings);
35095
+ * paymentComponent.render(document.getElementById('payment-container'));
35096
+ * ```
35097
+ *
35098
+ * @param {HTMLElement} container - The DOM element to render the payment component into.
35099
+ */
35100
+ render(te) {
35101
+ if (!te)
35102
+ throw new Error("Container element not found");
35103
+ te.appendChild(this.element);
35104
+ }
35105
+ /**
35106
+ * Destroys the payment component instance, cleaning up all DOM elements
35107
+ * and unregistering from the AstroPay Payments Library.
35108
+ *
35109
+ * @example
35110
+ * ```ts
35111
+ * // Initialize and render component
35112
+ * const paymentComponent = new AstroPaySinglePaymentMethod(paymentSettings);
35113
+ * paymentComponent.render(container);
35114
+ *
35115
+ * // Later cleanup
35116
+ * paymentComponent.destroy();
35117
+ * ```
35118
+ */
35119
+ destroy() {
35120
+ var te;
35121
+ this.isDestroyed = !0, (te = this.paymentMethod) == null || te.destroy(), this.paymentMethod = null, this.element.remove(), AstroPayCore.unregisterComponent(this);
35122
+ }
35123
+ }
34816
35124
  loadFonts();
34817
35125
  export {
34818
35126
  AstroPayCore as $,
@@ -34846,6 +35154,7 @@ export {
34846
35154
  CENSORED_IMG_MARK as a,
34847
35155
  AstroPayFullCheckout as a0,
34848
35156
  AstroPayPayment as a1,
35157
+ AstroPaySinglePaymentMethod as a2,
34849
35158
  buildUrl as b,
34850
35159
  isLongDataUrl as c,
34851
35160
  sanitizeDataUrl as d,