From 54d8a9b5a906972ad16ee799bc2e9db4a9ba02be Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 10 May 2023 08:05:44 +0300 Subject: [PATCH 01/67] Use order currency instead of shop currency on order-pay page --- .../ppcp-button/src/Assets/SmartButton.php | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 9fbff3bdf..1aae5e3fa 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -11,6 +11,7 @@ namespace WooCommerce\PayPalCommerce\Button\Assets; use Exception; use Psr\Log\LoggerInterface; +use WC_Order; use WC_Product; use WC_Product_Variation; use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentToken; @@ -766,8 +767,6 @@ class SmartButton implements SmartButtonInterface { * @throws NotFoundException If a setting hasn't been found. */ public function script_data(): array { - global $wp; - $is_free_trial_cart = $this->is_free_trial_cart(); $url_params = $this->url_params(); @@ -898,7 +897,7 @@ class SmartButton implements SmartButtonInterface { // phpcs:ignore WordPress.WP.I18n 'shipping_field' => _x( 'Shipping %s', 'checkout-validation', 'woocommerce' ), ), - 'order_id' => 'pay-now' === $this->context() ? absint( $wp->query_vars['order-pay'] ) : 0, + 'order_id' => 'pay-now' === $this->context() ? $this->get_order_pay_id() : 0, 'single_product_buttons_enabled' => $this->settings_status->is_smart_button_enabled_for_location( 'product' ), 'mini_cart_buttons_enabled' => $this->settings_status->is_smart_button_enabled_for_location( 'mini-cart' ), 'basic_checkout_validation_enabled' => $this->basic_checkout_validation_enabled, @@ -959,6 +958,19 @@ class SmartButton implements SmartButtonInterface { $params['buyer-country'] = WC()->customer->get_billing_country(); } + if ( 'pay-now' === $this->context() ) { + $wc_order_id = $this->get_order_pay_id(); + if ( $wc_order_id ) { + $wc_order = wc_get_order( $wc_order_id ); + if ( $wc_order instanceof WC_Order ) { + $currency = $wc_order->get_currency(); + if ( $currency ) { + $params['currency'] = $currency; + } + } + } + } + $disable_funding = $this->settings->has( 'disable_funding' ) ? $this->settings->get( 'disable_funding' ) : array(); @@ -1349,4 +1361,19 @@ class SmartButton implements SmartButtonInterface { return false; } + + /** + * Returns the ID of WC order on the order-pay page, or 0. + * + * @return int + */ + protected function get_order_pay_id(): int { + global $wp; + + if ( ! isset( $wp->query_vars['order-pay'] ) ) { + return 0; + } + + return absint( $wp->query_vars['order-pay'] ); + } } From 6ddc364eb2626bf7bdadf64754b1c2fedc5b14d1 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 11 May 2023 15:14:33 +0200 Subject: [PATCH 02/67] Cast $column to string before sending PCP-1675 --- modules/ppcp-wc-gateway/src/WCGatewayModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index f19a244e6..ccdbc9b1e 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -615,7 +615,7 @@ class WCGatewayModule implements ModuleInterface { * @var OrderTablePaymentStatusColumn $payment_status_column */ $payment_status_column = $container->get( 'wcgateway.admin.orders-payment-status-column' ); - $payment_status_column->render( $column, intval( $wc_order_id ) ); + $payment_status_column->render( (string) $column, intval( $wc_order_id ) ); }, 10, 2 From ca2b76f18f401a6b08b771ccc8b9448c9f4a0961 Mon Sep 17 00:00:00 2001 From: Fitim Vata Date: Mon, 15 May 2023 12:14:05 +0200 Subject: [PATCH 03/67] [Fix] Fix undefined array key 0 when checking $retry_errors in process_payment method. --- .../ppcp-wc-gateway/src/Gateway/PayPalGateway.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php index 0e71fa812..06722c6aa 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php @@ -486,12 +486,15 @@ class PayPalGateway extends \WC_Payment_Gateway { 'INSTRUMENT_DECLINED' => __( 'Instrument declined.', 'woocommerce-paypal-payments' ), 'PAYER_ACTION_REQUIRED' => __( 'Payer action required, possibly overcharge.', 'woocommerce-paypal-payments' ), ); - $retry_errors = array_filter( - array_keys( $retry_keys_messages ), - function ( string $key ) use ( $error ): bool { - return $error->has_detail( $key ); - } + $retry_errors = array_values( + array_filter( + array_keys( $retry_keys_messages ), + function ( string $key ) use ( $error ): bool { + return $error->has_detail( $key ); + } + ) ); + if ( $retry_errors ) { $retry_error_key = $retry_errors[0]; From 0322aac244cb79b95a7498124518d3ca4ebdbe23 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 17 May 2023 17:21:24 +0300 Subject: [PATCH 04/67] Trigger WC checkout_error event Triggering WC checkout_error event for our validation, similarly to the WC submit ajax handler. --- .../js/modules/ActionHandler/CheckoutActionHandler.js | 3 +++ .../js/modules/ActionHandler/FreeTrialHandler.js | 4 ++++ modules/ppcp-button/resources/js/modules/ErrorHandler.js | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js index 7c1b6f238..46378596d 100644 --- a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js +++ b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js @@ -102,6 +102,9 @@ class CheckoutActionHandler { } else { errorHandler.message(data.data.message); } + + // fire WC event for other plugins + jQuery( document.body ).trigger( 'checkout_error' , [ errorHandler.currentHtml() ] ); } throw {type: 'create-order-error', data: data.data}; diff --git a/modules/ppcp-button/resources/js/modules/ActionHandler/FreeTrialHandler.js b/modules/ppcp-button/resources/js/modules/ActionHandler/FreeTrialHandler.js index 878e20207..5486576ff 100644 --- a/modules/ppcp-button/resources/js/modules/ActionHandler/FreeTrialHandler.js +++ b/modules/ppcp-button/resources/js/modules/ActionHandler/FreeTrialHandler.js @@ -40,6 +40,10 @@ class FreeTrialHandler { if (errors.length > 0) { this.spinner.unblock(); this.errorHandler.messages(errors); + + // fire WC event for other plugins + jQuery( document.body ).trigger( 'checkout_error' , [ this.errorHandler.currentHtml() ] ); + return; } } catch (error) { diff --git a/modules/ppcp-button/resources/js/modules/ErrorHandler.js b/modules/ppcp-button/resources/js/modules/ErrorHandler.js index 726ef2074..6048360b2 100644 --- a/modules/ppcp-button/resources/js/modules/ErrorHandler.js +++ b/modules/ppcp-button/resources/js/modules/ErrorHandler.js @@ -40,6 +40,15 @@ class ErrorHandler { this._scrollToMessages(); } + /** + * @returns {String} + */ + currentHtml() + { + const messageContainer = this._getMessageContainer(); + return messageContainer.outerHTML; + } + /** * @private * @param {String} text From ad5af164462b6044f2a4ef33942d5fb1994dd43b Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Tue, 30 May 2023 13:57:21 +0200 Subject: [PATCH 05/67] Update wording in buttons previews PCP-1713 --- .../Settings/Fields/pay-later-tab-fields.php | 18 ++++++++++-------- .../Fields/paypal-smart-button-fields.php | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php index fab61ca83..b3af60d5b 100644 --- a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php +++ b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php @@ -33,11 +33,13 @@ return function ( ContainerInterface $container, array $fields ): array { $selected_country = $container->get( 'api.shop.country' ); $default_messaging_flex_color = $selected_country === 'US' ? 'white-no-border' : 'white'; - - $render_preview_element = function ( string $id, string $type ): string { + $button_message = __( 'Pay Later Button Preview', 'woocommerce-paypal-payments' ); + $messaging_message = __( 'Pay Later Messaging Preview', 'woocommerce-paypal-payments' ); + $default_message = __( 'Preview', 'woocommerce-paypal-payments' ); + $render_preview_element = function ( string $id, string $type, string $message ): string { return '
-

' . __( 'Preview', 'woocommerce-paypal-payments' ) . '

+

' . $message . '

'; }; @@ -82,7 +84,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_button_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpPayLaterButtonPreview', 'button' ), + 'text' => $render_preview_element( 'ppcpPayLaterButtonPreview', 'button', $button_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -245,7 +247,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_general_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpGeneralMessagePreview', 'message' ), + 'text' => $render_preview_element( 'ppcpGeneralMessagePreview', 'message', $messaging_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -369,7 +371,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_product_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpProductMessagePreview', 'message' ), + 'text' => $render_preview_element( 'ppcpProductMessagePreview', 'message', $default_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -493,7 +495,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_cart_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpCartMessagePreview', 'message' ), + 'text' => $render_preview_element( 'ppcpCartMessagePreview', 'message', $default_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -617,7 +619,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_checkout_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpCheckoutMessagePreview', 'message' ), + 'text' => $render_preview_element( 'ppcpCheckoutMessagePreview', 'message', $default_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, diff --git a/modules/ppcp-wc-gateway/src/Settings/Fields/paypal-smart-button-fields.php b/modules/ppcp-wc-gateway/src/Settings/Fields/paypal-smart-button-fields.php index f064b1e7b..82fa1d5f3 100644 --- a/modules/ppcp-wc-gateway/src/Settings/Fields/paypal-smart-button-fields.php +++ b/modules/ppcp-wc-gateway/src/Settings/Fields/paypal-smart-button-fields.php @@ -31,7 +31,7 @@ return function ( ContainerInterface $container, array $fields ): array { $render_preview_element = function ( string $id ): string { return '
-

' . __( 'Preview', 'woocommerce-paypal-payments' ) . '

+

' . __( 'Button Styling Preview', 'woocommerce-paypal-payments' ) . '

'; }; From 3cd9e6829b0a27a9e327bc511eae5f5a9949d98e Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 9 May 2023 17:24:03 +0300 Subject: [PATCH 06/67] Do not exclude free items --- modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php index 9f8f12c5e..e66de1c7e 100644 --- a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php +++ b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php @@ -110,7 +110,7 @@ class PurchaseUnitFactory { $items = array_filter( $this->item_factory->from_wc_order( $order ), function ( Item $item ): bool { - return $item->unit_amount()->value() > 0; + return $item->unit_amount()->value() >= 0; } ); $shipping = $this->shipping_factory->from_wc_order( $order ); @@ -166,7 +166,7 @@ class PurchaseUnitFactory { $items = array_filter( $this->item_factory->from_wc_cart( $cart ), function ( Item $item ): bool { - return $item->unit_amount()->value() > 0; + return $item->unit_amount()->value() >= 0; } ); From 729251495f332ba39b96b5721538f209b5a5ed9a Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 9 May 2023 12:01:26 +0300 Subject: [PATCH 07/67] Handle empty acdc fields --- .../js/modules/Renderer/CreditCardRenderer.js | 18 +++++++++++++++++- modules/ppcp-button/src/Assets/SmartButton.php | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js index 0ddafdd15..ac0d62841 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js @@ -10,6 +10,7 @@ class CreditCardRenderer { this.spinner = spinner; this.cardValid = false; this.formValid = false; + this.emptyFields = new Set(['number', 'cvv', 'expirationDate']); this.currentHostedFieldsInstance = null; } @@ -138,6 +139,12 @@ class CreditCardRenderer { this.formValid = formValid; }); + hostedFields.on('empty', (event) => { + this.emptyFields.add(event.emittedBy); + }); + hostedFields.on('notEmpty', (event) => { + this.emptyFields.delete(event.emittedBy); + }); show(buttonSelector); @@ -249,7 +256,16 @@ class CreditCardRenderer { }); } else { this.spinner.unblock(); - const message = ! this.cardValid ? this.defaultConfig.hosted_fields.labels.card_not_supported : this.defaultConfig.hosted_fields.labels.fields_not_valid; + + let message = this.defaultConfig.labels.error.generic; + if (this.emptyFields.size > 0) { + message = this.defaultConfig.hosted_fields.labels.fields_empty; + } else if (!this.cardValid) { + message = this.defaultConfig.hosted_fields.labels.card_not_supported; + } else if (!this.formValid) { + message = this.defaultConfig.hosted_fields.labels.fields_not_valid; + } + this.errorHandler.message(message); } } diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 7f07c332a..bc4e4d82b 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -893,6 +893,10 @@ class SmartButton implements SmartButtonInterface { 'credit_card_number' => '', 'cvv' => '', 'mm_yy' => __( 'MM/YY', 'woocommerce-paypal-payments' ), + 'fields_empty' => __( + 'Card payment details are missing. Please fill in all required fields.', + 'woocommerce-paypal-payments' + ), 'fields_not_valid' => __( 'Unfortunately, your credit card details are not valid.', 'woocommerce-paypal-payments' From 04bc1ba37f3ddf78bd224fdccd469075091d9936 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 9 May 2023 12:02:57 +0300 Subject: [PATCH 08/67] Fix js error --- .../resources/js/modules/Renderer/CreditCardRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js index ac0d62841..fcd20a609 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js @@ -131,7 +131,7 @@ class CreditCardRenderer { return event.fields[key].isValid; }); - const className = this._cardNumberFiledCLassNameByCardType(event.cards[0].type); + const className = event.cards.length ? this._cardNumberFiledCLassNameByCardType(event.cards[0].type) : ''; event.fields.number.isValid ? cardNumber.classList.add(className) : this._recreateElementClassAttribute(cardNumber, cardNumberField.className); From c0368e9ada0a9fcf9306ec13199d4f388c519827 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 8 May 2023 09:51:32 +0300 Subject: [PATCH 09/67] Do not show broken card button gateway when no checkout location Removes the card button gateway together with the PayPal gateway when disabled in checkout (since it gets broken anyway). Also refactored the admin notice about disabled gateway to add a message about disabled location. --- modules/ppcp-wc-gateway/services.php | 3 +- .../src/Checkout/DisableGateways.php | 7 +- .../GatewayWithoutPayPalAdminNotice.php | 83 ++++++++++++++----- 3 files changed, 68 insertions(+), 25 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 901c1f94a..f5a745076 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -223,7 +223,8 @@ return array( $container->get( 'onboarding.state' ), $container->get( 'wcgateway.settings' ), $container->get( 'wcgateway.is-wc-payments-page' ), - $container->get( 'wcgateway.is-ppcp-settings-page' ) + $container->get( 'wcgateway.is-ppcp-settings-page' ), + $container->get( 'wcgateway.settings.status' ) ); }, 'wcgateway.notice.authorize-order-action' => diff --git a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php index bbd9b30d3..a842fc28c 100644 --- a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php +++ b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php @@ -82,8 +82,11 @@ class DisableGateways { unset( $methods[ CreditCardGateway::ID ] ); } - if ( ! $this->settings_status->is_smart_button_enabled_for_location( 'checkout' ) && ! $this->session_handler->order() && is_checkout() ) { - unset( $methods[ PayPalGateway::ID ] ); + if ( ! $this->settings_status->is_smart_button_enabled_for_location( 'checkout' ) ) { + unset( $methods[ CardButtonGateway::ID ] ); + if ( ! $this->session_handler->order() && is_checkout() ) { + unset( $methods[ PayPalGateway::ID ] ); + } } if ( ! $this->needs_to_disable_gateways() ) { diff --git a/modules/ppcp-wc-gateway/src/Notice/GatewayWithoutPayPalAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/GatewayWithoutPayPalAdminNotice.php index 08a20651b..81b057423 100644 --- a/modules/ppcp-wc-gateway/src/Notice/GatewayWithoutPayPalAdminNotice.php +++ b/modules/ppcp-wc-gateway/src/Notice/GatewayWithoutPayPalAdminNotice.php @@ -13,11 +13,16 @@ use WC_Payment_Gateway; use WooCommerce\PayPalCommerce\AdminNotices\Entity\Message; use WooCommerce\PayPalCommerce\Onboarding\State; use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface; +use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; /** * Creates the admin message about the gateway being enabled without the PayPal gateway. */ class GatewayWithoutPayPalAdminNotice { + private const NOTICE_OK = ''; + private const NOTICE_DISABLED_GATEWAY = 'disabled_gateway'; + private const NOTICE_DISABLED_LOCATION = 'disabled_location'; + /** * The gateway ID. * @@ -53,27 +58,37 @@ class GatewayWithoutPayPalAdminNotice { */ private $is_ppcp_settings_page; + /** + * The Settings status helper. + * + * @var SettingsStatus|null + */ + protected $settings_status; + /** * ConnectAdminNotice constructor. * - * @param string $id The gateway ID. - * @param State $state The state. - * @param ContainerInterface $settings The settings. - * @param bool $is_payments_page Whether the current page is the WC payment page. - * @param bool $is_ppcp_settings_page Whether the current page is the PPCP settings page. + * @param string $id The gateway ID. + * @param State $state The state. + * @param ContainerInterface $settings The settings. + * @param bool $is_payments_page Whether the current page is the WC payment page. + * @param bool $is_ppcp_settings_page Whether the current page is the PPCP settings page. + * @param SettingsStatus|null $settings_status The Settings status helper. */ public function __construct( string $id, State $state, ContainerInterface $settings, bool $is_payments_page, - bool $is_ppcp_settings_page + bool $is_ppcp_settings_page, + ?SettingsStatus $settings_status = null ) { $this->id = $id; $this->state = $state; $this->settings = $settings; $this->is_payments_page = $is_payments_page; $this->is_ppcp_settings_page = $is_ppcp_settings_page; + $this->settings_status = $settings_status; } /** @@ -82,8 +97,25 @@ class GatewayWithoutPayPalAdminNotice { * @return Message|null */ public function message(): ?Message { - if ( ! $this->should_display() ) { - return null; + $notice_type = $this->check(); + + switch ( $notice_type ) { + case self::NOTICE_DISABLED_GATEWAY: + /* translators: %1$s the gateway name, %2$s URL. */ + $text = __( + '%1$s cannot be used without the PayPal gateway. Enable the PayPal gateway.', + 'woocommerce-paypal-payments' + ); + break; + case self::NOTICE_DISABLED_LOCATION: + /* translators: %1$s the gateway name, %2$s URL. */ + $text = __( + '%1$s cannot be used without enabling the Checkout location for the PayPal gateway. Enable the Checkout location.', + 'woocommerce-paypal-payments' + ); + break; + default: + return null; } $gateway = $this->get_gateway(); @@ -94,11 +126,7 @@ class GatewayWithoutPayPalAdminNotice { $name = $gateway->get_method_title(); $message = sprintf( - /* translators: %1$s the gateway name, %2$s URL. */ - __( - '%1$s cannot be used without the PayPal gateway. Enable the PayPal gateway.', - 'woocommerce-paypal-payments' - ), + $text, $name, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' ) ); @@ -106,22 +134,33 @@ class GatewayWithoutPayPalAdminNotice { } /** - * Whether the message should be displayed. + * Checks whether one of the messages should be displayed. * - * @return bool + * @return string One of the NOTICE_* constants. */ - protected function should_display(): bool { + protected function check(): string { if ( State::STATE_ONBOARDED !== $this->state->current_state() || ( ! $this->is_payments_page && ! $this->is_ppcp_settings_page ) ) { - return false; - } - if ( $this->settings->has( 'enabled' ) && $this->settings->get( 'enabled' ) ) { - return false; + return self::NOTICE_OK; } - $gateway = $this->get_gateway(); + $gateway = $this->get_gateway(); + $gateway_enabled = $gateway && wc_string_to_bool( $gateway->get_option( 'enabled' ) ); - return $gateway && wc_string_to_bool( $gateway->get_option( 'enabled' ) ); + if ( ! $gateway_enabled ) { + return self::NOTICE_OK; + } + + $paypal_enabled = $this->settings->has( 'enabled' ) && $this->settings->get( 'enabled' ); + if ( ! $paypal_enabled ) { + return self::NOTICE_DISABLED_GATEWAY; + } + + if ( $this->settings_status && ! $this->settings_status->is_smart_button_enabled_for_location( 'checkout' ) ) { + return self::NOTICE_DISABLED_LOCATION; + } + + return self::NOTICE_OK; } /** From e3bd42b93bf5f8d9eed8effdaad13bce90437ec6 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 7 Jun 2023 16:27:31 +0300 Subject: [PATCH 10/67] Add return-url error logging --- modules/ppcp-wc-gateway/services.php | 3 ++- .../src/Endpoint/ReturnUrlEndpoint.php | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 901c1f94a..64de3e79c 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -942,7 +942,8 @@ return array( return new ReturnUrlEndpoint( $gateway, $endpoint, - $prefix + $prefix, + $container->get( 'woocommerce.logger.woocommerce' ) ); }, diff --git a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php index 57c29c2a4..3a503b540 100644 --- a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php +++ b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Endpoint; +use Psr\Log\LoggerInterface; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; @@ -36,17 +37,31 @@ class ReturnUrlEndpoint { */ private $order_endpoint; + /** + * The logger. + * + * @var LoggerInterface + */ + protected $logger; + /** * ReturnUrlEndpoint constructor. * - * @param PayPalGateway $gateway The PayPal Gateway. - * @param OrderEndpoint $order_endpoint The Order Endpoint. - * @param string $prefix The prefix. + * @param PayPalGateway $gateway The PayPal Gateway. + * @param OrderEndpoint $order_endpoint The Order Endpoint. + * @param string $prefix The prefix. + * @param LoggerInterface $logger The logger. */ - public function __construct( PayPalGateway $gateway, OrderEndpoint $order_endpoint, string $prefix ) { + public function __construct( + PayPalGateway $gateway, + OrderEndpoint $order_endpoint, + string $prefix, + LoggerInterface $logger + ) { $this->gateway = $gateway; $this->order_endpoint = $order_endpoint; $this->prefix = $prefix; + $this->logger = $logger; } /** @@ -65,11 +80,13 @@ class ReturnUrlEndpoint { $wc_order_id = $this->sanitize_custom_id( $order->purchase_units()[0]->custom_id() ); if ( ! $wc_order_id ) { + $this->logger->warning( "Return URL endpoint $token: no WC order ID." ); exit(); } $wc_order = wc_get_order( $wc_order_id ); if ( ! is_a( $wc_order, \WC_Order::class ) ) { + $this->logger->warning( "Return URL endpoint $token: WC order $wc_order_id not found." ); exit(); } From eb4418931a540e1f3f213cc5e00b9da52581e5bb Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 7 Jun 2023 20:12:28 +0300 Subject: [PATCH 11/67] Improve return url handling when no WC order --- modules/ppcp-wc-gateway/services.php | 1 + .../src/Endpoint/ReturnUrlEndpoint.php | 38 +++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 64de3e79c..f2dd4b69d 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -943,6 +943,7 @@ return array( $gateway, $endpoint, $prefix, + $container->get( 'session.handler' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, diff --git a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php index 3a503b540..69cf4d8ac 100644 --- a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php +++ b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php @@ -11,6 +11,8 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Endpoint; use Psr\Log\LoggerInterface; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; +use WooCommerce\PayPalCommerce\Session\SessionHandler; use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait; @@ -37,6 +39,13 @@ class ReturnUrlEndpoint { */ private $order_endpoint; + /** + * The session handler + * + * @var SessionHandler + */ + protected $session_handler; + /** * The logger. * @@ -47,21 +56,24 @@ class ReturnUrlEndpoint { /** * ReturnUrlEndpoint constructor. * - * @param PayPalGateway $gateway The PayPal Gateway. - * @param OrderEndpoint $order_endpoint The Order Endpoint. - * @param string $prefix The prefix. - * @param LoggerInterface $logger The logger. + * @param PayPalGateway $gateway The PayPal Gateway. + * @param OrderEndpoint $order_endpoint The Order Endpoint. + * @param string $prefix The prefix. + * @param SessionHandler $session_handler The session handler. + * @param LoggerInterface $logger The logger. */ public function __construct( PayPalGateway $gateway, OrderEndpoint $order_endpoint, string $prefix, + SessionHandler $session_handler, LoggerInterface $logger ) { - $this->gateway = $gateway; - $this->order_endpoint = $order_endpoint; - $this->prefix = $prefix; - $this->logger = $logger; + $this->gateway = $gateway; + $this->order_endpoint = $order_endpoint; + $this->prefix = $prefix; + $this->session_handler = $session_handler; + $this->logger = $logger; } /** @@ -80,6 +92,16 @@ class ReturnUrlEndpoint { $wc_order_id = $this->sanitize_custom_id( $order->purchase_units()[0]->custom_id() ); if ( ! $wc_order_id ) { + // We cannot finish processing here without WC order, but at least go into the continuation mode. + if ( $order->status()->is( OrderStatus::APPROVED ) + || $order->status()->is( OrderStatus::COMPLETED ) + ) { + $this->session_handler->replace_order( $order ); + + wp_safe_redirect( wc_get_checkout_url() ); + exit(); + } + $this->logger->warning( "Return URL endpoint $token: no WC order ID." ); exit(); } From 8979c9e6055fb6c557719cf11a542636b30c2911 Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 8 Jun 2023 16:00:21 +0300 Subject: [PATCH 12/67] Stop searching for prefix in custom IDs we are not creating such IDs for 2 years already --- modules/ppcp-button/services.php | 3 +- .../src/Helper/EarlyOrderHandler.php | 10 +---- modules/ppcp-wc-gateway/services.php | 2 - .../src/Endpoint/ReturnUrlEndpoint.php | 7 +--- modules/ppcp-webhooks/services.php | 10 ++--- .../src/Handler/CheckoutOrderApproved.php | 14 ++----- .../src/Handler/CheckoutOrderCompleted.php | 6 +-- .../CheckoutPaymentApprovalReversed.php | 2 +- .../src/Handler/PaymentCaptureCompleted.php | 8 +--- .../src/Handler/PaymentCapturePending.php | 4 +- .../src/Handler/PaymentCaptureRefunded.php | 8 ++-- .../src/Handler/PaymentCaptureReversed.php | 8 ++-- .../ppcp-webhooks/src/Handler/PrefixTrait.php | 40 ------------------- .../src/Handler/RequestHandlerTrait.php | 8 +--- 14 files changed, 26 insertions(+), 104 deletions(-) delete mode 100644 modules/ppcp-webhooks/src/Handler/PrefixTrait.php diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index 7f8c50b14..f378a3836 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -184,8 +184,7 @@ return array( $state = $container->get( 'onboarding.state' ); $order_processor = $container->get( 'wcgateway.order-processor' ); $session_handler = $container->get( 'session.handler' ); - $prefix = $container->get( 'api.prefix' ); - return new EarlyOrderHandler( $state, $order_processor, $session_handler, $prefix ); + return new EarlyOrderHandler( $state, $order_processor, $session_handler ); }, 'button.endpoint.approve-order' => static function ( ContainerInterface $container ): ApproveOrderEndpoint { $request_data = $container->get( 'button.request-data' ); diff --git a/modules/ppcp-button/src/Helper/EarlyOrderHandler.php b/modules/ppcp-button/src/Helper/EarlyOrderHandler.php index 3776a6698..4ac8583d0 100644 --- a/modules/ppcp-button/src/Helper/EarlyOrderHandler.php +++ b/modules/ppcp-button/src/Helper/EarlyOrderHandler.php @@ -15,15 +15,12 @@ use WooCommerce\PayPalCommerce\Onboarding\State; use WooCommerce\PayPalCommerce\Session\SessionHandler; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\WcGateway\Processor\OrderProcessor; -use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait; /** * Class EarlyOrderHandler */ class EarlyOrderHandler { - use PrefixTrait; - /** * The State. * @@ -51,19 +48,16 @@ class EarlyOrderHandler { * @param State $state The State. * @param OrderProcessor $order_processor The Order Processor. * @param SessionHandler $session_handler The Session Handler. - * @param string $prefix The Prefix. */ public function __construct( State $state, OrderProcessor $order_processor, - SessionHandler $session_handler, - string $prefix + SessionHandler $session_handler ) { $this->state = $state; $this->order_processor = $order_processor; $this->session_handler = $session_handler; - $this->prefix = $prefix; } /** @@ -101,7 +95,7 @@ class EarlyOrderHandler { $order_id = false; foreach ( $order->purchase_units() as $purchase_unit ) { if ( $purchase_unit->custom_id() === sanitize_text_field( wp_unslash( $_REQUEST['ppcp-resume-order'] ) ) ) { - $order_id = (int) $this->sanitize_custom_id( $purchase_unit->custom_id() ); + $order_id = (int) $purchase_unit->custom_id(); } } if ( $order_id === $resume_order_id ) { diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index f2dd4b69d..c90fe0ef7 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -938,11 +938,9 @@ return array( 'wcgateway.endpoint.return-url' => static function ( ContainerInterface $container ) : ReturnUrlEndpoint { $gateway = $container->get( 'wcgateway.paypal-gateway' ); $endpoint = $container->get( 'api.endpoint.order' ); - $prefix = $container->get( 'api.prefix' ); return new ReturnUrlEndpoint( $gateway, $endpoint, - $prefix, $container->get( 'session.handler' ), $container->get( 'woocommerce.logger.woocommerce' ) ); diff --git a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php index 69cf4d8ac..3efe16542 100644 --- a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php +++ b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php @@ -15,14 +15,12 @@ use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; use WooCommerce\PayPalCommerce\Session\SessionHandler; use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; -use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait; /** * Class ReturnUrlEndpoint */ class ReturnUrlEndpoint { - use PrefixTrait; const ENDPOINT = 'ppc-return-url'; /** @@ -58,20 +56,17 @@ class ReturnUrlEndpoint { * * @param PayPalGateway $gateway The PayPal Gateway. * @param OrderEndpoint $order_endpoint The Order Endpoint. - * @param string $prefix The prefix. * @param SessionHandler $session_handler The session handler. * @param LoggerInterface $logger The logger. */ public function __construct( PayPalGateway $gateway, OrderEndpoint $order_endpoint, - string $prefix, SessionHandler $session_handler, LoggerInterface $logger ) { $this->gateway = $gateway; $this->order_endpoint = $order_endpoint; - $this->prefix = $prefix; $this->session_handler = $session_handler; $this->logger = $logger; } @@ -90,7 +85,7 @@ class ReturnUrlEndpoint { // phpcs:enable WordPress.Security.NonceVerification.Recommended $order = $this->order_endpoint->order( $token ); - $wc_order_id = $this->sanitize_custom_id( $order->purchase_units()[0]->custom_id() ); + $wc_order_id = (int) $order->purchase_units()[0]->custom_id(); if ( ! $wc_order_id ) { // We cannot finish processing here without WC order, but at least go into the continuation mode. if ( $order->status()->is( OrderStatus::APPROVED ) diff --git a/modules/ppcp-webhooks/services.php b/modules/ppcp-webhooks/services.php index ce0338228..24bc9e971 100644 --- a/modules/ppcp-webhooks/services.php +++ b/modules/ppcp-webhooks/services.php @@ -82,12 +82,12 @@ return array( $payment_token_factory = $container->get( 'vaulting.payment-token-factory' ); return array( - new CheckoutOrderApproved( $logger, $prefix, $order_endpoint ), - new CheckoutOrderCompleted( $logger, $prefix ), + new CheckoutOrderApproved( $logger, $order_endpoint ), + new CheckoutOrderCompleted( $logger ), new CheckoutPaymentApprovalReversed( $logger ), - new PaymentCaptureRefunded( $logger, $prefix ), - new PaymentCaptureReversed( $logger, $prefix ), - new PaymentCaptureCompleted( $logger, $prefix, $order_endpoint ), + new PaymentCaptureRefunded( $logger ), + new PaymentCaptureReversed( $logger ), + new PaymentCaptureCompleted( $logger, $order_endpoint ), new VaultPaymentTokenCreated( $logger, $prefix, $authorized_payments_processor, $payment_token_factory ), new VaultPaymentTokenDeleted( $logger ), new PaymentCapturePending( $logger ), diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php index 350d0e168..4eb6ecb3d 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php @@ -20,7 +20,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayUponInvoice\PayUponInvoiceGa */ class CheckoutOrderApproved implements RequestHandler { - use PrefixTrait; + use RequestHandlerTrait; /** * The logger. @@ -40,12 +40,10 @@ class CheckoutOrderApproved implements RequestHandler { * CheckoutOrderApproved constructor. * * @param LoggerInterface $logger The logger. - * @param string $prefix The prefix. * @param OrderEndpoint $order_endpoint The order endpoint. */ - public function __construct( LoggerInterface $logger, string $prefix, OrderEndpoint $order_endpoint ) { + public function __construct( LoggerInterface $logger, OrderEndpoint $order_endpoint ) { $this->logger = $logger; - $this->prefix = $prefix; $this->order_endpoint = $order_endpoint; } @@ -160,13 +158,7 @@ class CheckoutOrderApproved implements RequestHandler { return rest_ensure_response( $response ); } - $wc_order_ids = array_map( - array( - $this, - 'sanitize_custom_id', - ), - $custom_ids - ); + $wc_order_ids = $custom_ids; $args = array( 'post__in' => $wc_order_ids, 'limit' => -1, diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php index 85bbd376d..02fa8f6d7 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php @@ -19,7 +19,7 @@ use WP_REST_Response; */ class CheckoutOrderCompleted implements RequestHandler { - use PrefixTrait, RequestHandlerTrait; + use RequestHandlerTrait; /** * The logger. @@ -32,11 +32,9 @@ class CheckoutOrderCompleted implements RequestHandler { * CheckoutOrderCompleted constructor. * * @param LoggerInterface $logger The logger. - * @param string $prefix The prefix. */ - public function __construct( LoggerInterface $logger, string $prefix ) { + public function __construct( LoggerInterface $logger ) { $this->logger = $logger; - $this->prefix = $prefix; } /** diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php index 7377ec3bd..22b73bcc4 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php @@ -18,7 +18,7 @@ use WP_REST_Response; */ class CheckoutPaymentApprovalReversed implements RequestHandler { - use RequestHandlerTrait, PrefixTrait; + use RequestHandlerTrait; /** * The logger. diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php index eda546118..775ea8dfd 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php @@ -22,7 +22,7 @@ use WP_REST_Response; */ class PaymentCaptureCompleted implements RequestHandler { - use PrefixTrait, TransactionIdHandlingTrait; + use TransactionIdHandlingTrait; /** * The logger. @@ -42,16 +42,13 @@ class PaymentCaptureCompleted implements RequestHandler { * PaymentCaptureCompleted constructor. * * @param LoggerInterface $logger The logger. - * @param string $prefix The prefix. * @param OrderEndpoint $order_endpoint The order endpoint. */ public function __construct( LoggerInterface $logger, - string $prefix, OrderEndpoint $order_endpoint ) { $this->logger = $logger; - $this->prefix = $prefix; $this->order_endpoint = $order_endpoint; } @@ -95,8 +92,7 @@ class PaymentCaptureCompleted implements RequestHandler { return new WP_REST_Response( $response ); } - $wc_order_id = isset( $resource['custom_id'] ) ? - $this->sanitize_custom_id( (string) $resource['custom_id'] ) : 0; + $wc_order_id = isset( $resource['custom_id'] ) ? (string) $resource['custom_id'] : 0; if ( ! $wc_order_id ) { $message = sprintf( 'No order for webhook event %s was found.', $webhook_id ); $this->logger->warning( $message, array( 'request' => $request ) ); diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php b/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php index 225e70121..e216effd0 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php @@ -18,7 +18,7 @@ use WP_REST_Response; */ class PaymentCapturePending implements RequestHandler { - use PrefixTrait; + use RequestHandlerTrait; /** * The logger. @@ -68,7 +68,7 @@ class PaymentCapturePending implements RequestHandler { public function handle_request( WP_REST_Request $request ): WP_REST_Response { $response = array( 'success' => false ); $order_id = $request['resource'] !== null && isset( $request['resource']['custom_id'] ) - ? $this->sanitize_custom_id( $request['resource']['custom_id'] ) + ? $request['resource']['custom_id'] : 0; if ( ! $order_id ) { $message = sprintf( diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php index d879a2345..52f195c60 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php @@ -20,7 +20,7 @@ use WP_REST_Response; */ class PaymentCaptureRefunded implements RequestHandler { - use PrefixTrait, TransactionIdHandlingTrait, RefundMetaTrait; + use TransactionIdHandlingTrait, RefundMetaTrait; /** * The logger. @@ -33,11 +33,9 @@ class PaymentCaptureRefunded implements RequestHandler { * PaymentCaptureRefunded constructor. * * @param LoggerInterface $logger The logger. - * @param string $prefix The prefix. */ - public function __construct( LoggerInterface $logger, string $prefix ) { + public function __construct( LoggerInterface $logger ) { $this->logger = $logger; - $this->prefix = $prefix; } /** @@ -70,7 +68,7 @@ class PaymentCaptureRefunded implements RequestHandler { public function handle_request( WP_REST_Request $request ): WP_REST_Response { $response = array( 'success' => false ); $order_id = isset( $request['resource']['custom_id'] ) ? - $this->sanitize_custom_id( $request['resource']['custom_id'] ) : 0; + $request['resource']['custom_id'] : 0; $refund_id = (string) ( $request['resource']['id'] ?? '' ); if ( ! $order_id ) { $message = sprintf( diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php index 5354e555c..27c766b08 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php @@ -19,7 +19,7 @@ use Psr\Log\LoggerInterface; */ class PaymentCaptureReversed implements RequestHandler { - use PrefixTrait; + use RequestHandlerTrait; /** * The logger. @@ -32,11 +32,9 @@ class PaymentCaptureReversed implements RequestHandler { * PaymentCaptureReversed constructor. * * @param LoggerInterface $logger The logger. - * @param string $prefix The prefix. */ - public function __construct( LoggerInterface $logger, string $prefix ) { + public function __construct( LoggerInterface $logger ) { $this->logger = $logger; - $this->prefix = $prefix; } /** @@ -73,7 +71,7 @@ class PaymentCaptureReversed implements RequestHandler { public function handle_request( \WP_REST_Request $request ): \WP_REST_Response { $response = array( 'success' => false ); $order_id = isset( $request['resource']['custom_id'] ) ? - $this->sanitize_custom_id( $request['resource']['custom_id'] ) : 0; + $request['resource']['custom_id'] : 0; if ( ! $order_id ) { $message = sprintf( // translators: %s is the PayPal webhook Id. diff --git a/modules/ppcp-webhooks/src/Handler/PrefixTrait.php b/modules/ppcp-webhooks/src/Handler/PrefixTrait.php deleted file mode 100644 index bc92d9e36..000000000 --- a/modules/ppcp-webhooks/src/Handler/PrefixTrait.php +++ /dev/null @@ -1,40 +0,0 @@ -prefix ) > 0 && 0 === strpos( $id, $this->prefix ) ) { - $id = substr( $id, strlen( $this->prefix ) ); - } - return (int) $id; - } -} diff --git a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php index be155c0ee..68ab36255 100644 --- a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php +++ b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php @@ -45,13 +45,7 @@ trait RequestHandlerTrait { * @return WC_Order[] */ protected function get_wc_orders_from_custom_ids( array $custom_ids ): array { - $order_ids = array_map( - array( - $this, - 'sanitize_custom_id', - ), - $custom_ids - ); + $order_ids = $custom_ids; $args = array( 'post__in' => $order_ids, 'limit' => -1, From 774fe51cfc801e3bfe6b5de6241638ee8b274bd9 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 9 Jun 2023 07:45:41 +0300 Subject: [PATCH 13/67] Refactor webhook responses --- .../BillingPlanPricingChangeActivated.php | 7 +- .../src/Handler/BillingPlanUpdated.php | 7 +- .../Handler/BillingSubscriptionCancelled.php | 7 +- .../src/Handler/CatalogProductUpdated.php | 7 +- .../src/Handler/CheckoutOrderApproved.php | 104 ++---------------- .../src/Handler/CheckoutOrderCompleted.php | 15 +-- .../CheckoutPaymentApprovalReversed.php | 15 +-- .../src/Handler/PaymentCaptureCompleted.php | 35 ++---- .../src/Handler/PaymentCapturePending.php | 29 +---- .../src/Handler/PaymentCaptureRefunded.php | 78 +++---------- .../src/Handler/PaymentCaptureReversed.php | 67 +++-------- .../src/Handler/PaymentSaleCompleted.php | 12 +- .../src/Handler/PaymentSaleRefunded.php | 31 ++---- .../src/Handler/RequestHandlerTrait.php | 48 ++++---- .../src/Handler/VaultPaymentTokenCreated.php | 10 +- .../src/Handler/VaultPaymentTokenDeleted.php | 6 +- .../src/IncomingWebhookEndpoint.php | 36 ++---- 17 files changed, 134 insertions(+), 380 deletions(-) diff --git a/modules/ppcp-webhooks/src/Handler/BillingPlanPricingChangeActivated.php b/modules/ppcp-webhooks/src/Handler/BillingPlanPricingChangeActivated.php index 96d0cd3e4..7a1461caf 100644 --- a/modules/ppcp-webhooks/src/Handler/BillingPlanPricingChangeActivated.php +++ b/modules/ppcp-webhooks/src/Handler/BillingPlanPricingChangeActivated.php @@ -17,6 +17,7 @@ use WP_REST_Response; * Class BillingPlanPricingChangeActivated */ class BillingPlanPricingChangeActivated implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -64,9 +65,8 @@ class BillingPlanPricingChangeActivated implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $plan_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) ); @@ -92,7 +92,6 @@ class BillingPlanPricingChangeActivated implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/BillingPlanUpdated.php b/modules/ppcp-webhooks/src/Handler/BillingPlanUpdated.php index 1c6aa14c9..b341a80c2 100644 --- a/modules/ppcp-webhooks/src/Handler/BillingPlanUpdated.php +++ b/modules/ppcp-webhooks/src/Handler/BillingPlanUpdated.php @@ -17,6 +17,7 @@ use WP_REST_Response; * Class BillingPlanUpdated */ class BillingPlanUpdated implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -64,9 +65,8 @@ class BillingPlanUpdated implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $plan_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) ); @@ -109,7 +109,6 @@ class BillingPlanUpdated implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/BillingSubscriptionCancelled.php b/modules/ppcp-webhooks/src/Handler/BillingSubscriptionCancelled.php index 8b06f06fe..0fc79f0d3 100644 --- a/modules/ppcp-webhooks/src/Handler/BillingSubscriptionCancelled.php +++ b/modules/ppcp-webhooks/src/Handler/BillingSubscriptionCancelled.php @@ -17,6 +17,7 @@ use WP_REST_Response; * Class BillingSubscriptionCancelled */ class BillingSubscriptionCancelled implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -64,9 +65,8 @@ class BillingSubscriptionCancelled implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $subscription_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) ); @@ -87,7 +87,6 @@ class BillingSubscriptionCancelled implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/CatalogProductUpdated.php b/modules/ppcp-webhooks/src/Handler/CatalogProductUpdated.php index 21e5423c3..dea42333d 100644 --- a/modules/ppcp-webhooks/src/Handler/CatalogProductUpdated.php +++ b/modules/ppcp-webhooks/src/Handler/CatalogProductUpdated.php @@ -17,6 +17,7 @@ use WP_REST_Response; * Class CatalogProductUpdated */ class CatalogProductUpdated implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -64,9 +65,8 @@ class CatalogProductUpdated implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $product_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) ); @@ -104,7 +104,6 @@ class CatalogProductUpdated implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php index 4eb6ecb3d..a37cab34c 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php @@ -77,39 +77,9 @@ class CheckoutOrderApproved implements RequestHandler { * @return \WP_REST_Response */ public function handle_request( \WP_REST_Request $request ): \WP_REST_Response { - $response = array( 'success' => false ); - $custom_ids = array_filter( - array_map( - static function ( array $purchase_unit ): string { - return isset( $purchase_unit['custom_id'] ) ? - (string) $purchase_unit['custom_id'] : ''; - }, - isset( $request['resource']['purchase_units'] ) ? - (array) $request['resource']['purchase_units'] : array() - ), - static function ( string $order_id ): bool { - return ! empty( $order_id ); - } - ); - + $custom_ids = $this->get_custom_ids_from_request( $request ); if ( empty( $custom_ids ) ) { - $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'No order for webhook event %s was found.', - 'woocommerce-paypal-payments' - ), - isset( $request['id'] ) ? $request['id'] : '' - ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->no_custom_ids_response( $request ); } try { @@ -117,22 +87,10 @@ class CheckoutOrderApproved implements RequestHandler { $this->order_endpoint->order( $request['resource']['id'] ) : null; if ( ! $order ) { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'No paypal payment for webhook event %s was found.', - 'woocommerce-paypal-payments' - ), + 'No paypal payment for webhook event %s was found.', isset( $request['id'] ) ? $request['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->failure_response( $message ); } if ( $order->intent() === 'CAPTURE' ) { @@ -140,45 +98,15 @@ class CheckoutOrderApproved implements RequestHandler { } } catch ( RuntimeException $error ) { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'Could not capture payment for webhook event %s.', - 'woocommerce-paypal-payments' - ), + 'Could not capture payment for webhook event %s.', isset( $request['id'] ) ? $request['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->failure_response( $message ); } - $wc_order_ids = $custom_ids; - $args = array( - 'post__in' => $wc_order_ids, - 'limit' => -1, - ); - $wc_orders = wc_get_orders( $args ); + $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); if ( ! $wc_orders ) { - $message = sprintf( - // translators: %s is the PayPal order Id. - __( 'Order for PayPal order %s not found.', 'woocommerce-paypal-payments' ), - isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' - ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->no_wc_orders_response( $request ); } foreach ( $wc_orders as $wc_order ) { @@ -197,23 +125,13 @@ class CheckoutOrderApproved implements RequestHandler { __( 'Payment can be captured.', 'woocommerce-paypal-payments' ) ); } - $this->logger->log( - 'info', + $this->logger->info( sprintf( - // translators: %s is the order ID. - __( - 'Order %s has been updated through PayPal', - 'woocommerce-paypal-payments' - ), + 'Order %s has been updated through PayPal', (string) $wc_order->get_id() - ), - array( - 'request' => $request, - 'order' => $wc_order, ) ); } - $response['success'] = true; - return rest_ensure_response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php index 02fa8f6d7..a175bec3e 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php @@ -67,16 +67,14 @@ class CheckoutOrderCompleted implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); - $custom_ids = $this->get_custom_ids_from_request( $request ); if ( empty( $custom_ids ) ) { - return $this->no_custom_ids_from_request( $request, $response ); + return $this->no_custom_ids_response( $request ); } $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); if ( ! $wc_orders ) { - return $this->no_wc_orders_from_custom_ids( $request, $response ); + return $this->no_wc_orders_response( $request ); } foreach ( $wc_orders as $wc_order ) { @@ -91,17 +89,12 @@ class CheckoutOrderCompleted implements RequestHandler { $this->logger->info( sprintf( - // translators: %s is the order ID. - __( - 'Order %s has been updated through PayPal', - 'woocommerce-paypal-payments' - ), + 'Order %s has been updated through PayPal', (string) $wc_order->get_id() ) ); } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php index 22b73bcc4..56ed1ec11 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php @@ -66,26 +66,20 @@ class CheckoutPaymentApprovalReversed implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); - $custom_ids = $this->get_custom_ids_from_request( $request ); if ( empty( $custom_ids ) ) { - return $this->no_custom_ids_from_request( $request, $response ); + return $this->no_custom_ids_response( $request ); } $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); if ( ! $wc_orders ) { - return $this->no_wc_orders_from_custom_ids( $request, $response ); + return $this->no_wc_orders_response( $request ); } foreach ( $wc_orders as $wc_order ) { if ( in_array( $wc_order->get_status(), array( 'pending', 'on-hold' ), true ) ) { $error_message = sprintf( - // translators: %1$s is the order id. - __( - 'Failed to capture order %1$s through PayPal.', - 'woocommerce-paypal-payments' - ), + 'Failed to capture order %1$s through PayPal.', (string) $wc_order->get_id() ); @@ -95,7 +89,6 @@ class CheckoutPaymentApprovalReversed implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php index 775ea8dfd..d8f927b42 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php @@ -22,7 +22,7 @@ use WP_REST_Response; */ class PaymentCaptureCompleted implements RequestHandler { - use TransactionIdHandlingTrait; + use TransactionIdHandlingTrait, RequestHandlerTrait; /** * The logger. @@ -80,32 +80,24 @@ class PaymentCaptureCompleted implements RequestHandler { * @return WP_REST_Response */ public function handle_request( \WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); - $webhook_id = (string) ( $request['id'] ?? '' ); $resource = $request['resource']; if ( ! is_array( $resource ) ) { $message = 'Resource data not found in webhook request.'; - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $wc_order_id = isset( $resource['custom_id'] ) ? (string) $resource['custom_id'] : 0; if ( ! $wc_order_id ) { $message = sprintf( 'No order for webhook event %s was found.', $webhook_id ); - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $wc_order = wc_get_order( $wc_order_id ); if ( ! is_a( $wc_order, \WC_Order::class ) ) { $message = sprintf( 'No order for webhook event %s was found.', $webhook_id ); - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $order_id = $resource['supplementary_data']['related_ids']['order_id'] ?? null; @@ -116,8 +108,7 @@ class PaymentCaptureCompleted implements RequestHandler { do_action( 'ppcp_payment_capture_completed_webhook_handler', $wc_order, $order_id ); if ( $wc_order->get_status() !== 'on-hold' ) { - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } $wc_order->add_order_note( __( 'Payment successfully captured.', 'woocommerce-paypal-payments' ) @@ -126,19 +117,10 @@ class PaymentCaptureCompleted implements RequestHandler { $wc_order->payment_complete(); $wc_order->update_meta_data( AuthorizedPaymentsProcessor::CAPTURED_META_KEY, 'true' ); $wc_order->save(); - $this->logger->log( - 'info', + $this->logger->info( sprintf( - // translators: %s is the order ID. - __( - 'Order %s has been updated through PayPal', - 'woocommerce-paypal-payments' - ), + 'Order %s has been updated through PayPal', (string) $wc_order->get_id() - ), - array( - 'request' => $request, - 'order' => $wc_order, ) ); @@ -155,7 +137,6 @@ class PaymentCaptureCompleted implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php b/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php index e216effd0..bbbc41dd8 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCapturePending.php @@ -66,36 +66,21 @@ class PaymentCapturePending implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); $order_id = $request['resource'] !== null && isset( $request['resource']['custom_id'] ) ? $request['resource']['custom_id'] : 0; if ( ! $order_id ) { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'No order for webhook event %s was found.', - 'woocommerce-paypal-payments' - ), + 'No order for webhook event %s was found.', $request['id'] !== null && isset( $request['id'] ) ? $request['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $resource = $request['resource']; if ( ! is_array( $resource ) ) { $message = 'Resource data not found in webhook request.'; - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $wc_order = wc_get_order( $order_id ); @@ -105,10 +90,7 @@ class PaymentCapturePending implements RequestHandler { $request['resource'] !== null && isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' ); - $this->logger->warning( $message ); - - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } if ( $wc_order->get_status() === 'pending' ) { @@ -116,7 +98,6 @@ class PaymentCapturePending implements RequestHandler { } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php index 52f195c60..ede513aa2 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php @@ -10,8 +10,10 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Webhooks\Handler; use Psr\Log\LoggerInterface; +use WC_Order; use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundMetaTrait; use WooCommerce\PayPalCommerce\WcGateway\Processor\TransactionIdHandlingTrait; +use WP_Error; use WP_REST_Request; use WP_REST_Response; @@ -20,7 +22,7 @@ use WP_REST_Response; */ class PaymentCaptureRefunded implements RequestHandler { - use TransactionIdHandlingTrait, RefundMetaTrait; + use TransactionIdHandlingTrait, RefundMetaTrait, RequestHandlerTrait; /** * The logger. @@ -66,59 +68,32 @@ class PaymentCaptureRefunded implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); $order_id = isset( $request['resource']['custom_id'] ) ? $request['resource']['custom_id'] : 0; $refund_id = (string) ( $request['resource']['id'] ?? '' ); if ( ! $order_id ) { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'No order for webhook event %s was found.', - 'woocommerce-paypal-payments' - ), + 'No order for webhook event %s was found.', isset( $request['id'] ) ? $request['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $wc_order = wc_get_order( $order_id ); - if ( ! is_a( $wc_order, \WC_Order::class ) ) { + if ( ! is_a( $wc_order, WC_Order::class ) ) { $message = sprintf( - // translators: %s is the PayPal refund Id. - __( 'Order for PayPal refund %s not found.', 'woocommerce-paypal-payments' ), + 'Order for PayPal refund %s not found.', $refund_id ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $already_added_refunds = $this->get_refunds_meta( $wc_order ); if ( in_array( $refund_id, $already_added_refunds, true ) ) { $this->logger->info( "Refund {$refund_id} is already handled." ); - return new WP_REST_Response( $response ); + return $this->success_response(); } - /** - * The WooCommerce order. - * - * @var \WC_Order $wc_order - */ $refund = wc_create_refund( array( 'order_id' => $wc_order->get_id(), @@ -126,37 +101,21 @@ class PaymentCaptureRefunded implements RequestHandler { ) ); if ( is_wp_error( $refund ) ) { - $this->logger->log( - 'warning', - sprintf( - // translators: %s is the order id. - __( 'Order %s could not be refunded', 'woocommerce-paypal-payments' ), - (string) $wc_order->get_id() - ), - array( - 'request' => $request, - 'error' => $refund, - ) + assert( $refund instanceof WP_Error ); + $message = sprintf( + 'Order %1$s could not be refunded. %2$s', + (string) $wc_order->get_id(), + $refund->get_error_message() ); - $response['message'] = $refund->get_error_message(); - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } - $this->logger->log( - 'info', + $this->logger->info( sprintf( - // translators: %1$s is the order id %2$s is the amount which has been refunded. - __( - 'Order %1$s has been refunded with %2$s through PayPal', - 'woocommerce-paypal-payments' - ), + 'Order %1$s has been refunded with %2$s through PayPal', (string) $wc_order->get_id(), (string) $refund->get_amount() - ), - array( - 'request' => $request, - 'order' => $wc_order, ) ); @@ -165,7 +124,6 @@ class PaymentCaptureRefunded implements RequestHandler { $this->add_refund_to_meta( $wc_order, $refund_id ); } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php index 27c766b08..5369a9ca3 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php @@ -69,45 +69,23 @@ class PaymentCaptureReversed implements RequestHandler { * @return \WP_REST_Response */ public function handle_request( \WP_REST_Request $request ): \WP_REST_Response { - $response = array( 'success' => false ); $order_id = isset( $request['resource']['custom_id'] ) ? $request['resource']['custom_id'] : 0; if ( ! $order_id ) { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( - 'No order for webhook event %s was found.', - 'woocommerce-paypal-payments' - ), + 'No order for webhook event %s was found.', isset( $request['id'] ) ? $request['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->failure_response( $message ); } $wc_order = wc_get_order( $order_id ); if ( ! is_a( $wc_order, \WC_Order::class ) ) { $message = sprintf( - // translators: %s is the PayPal refund Id. - __( 'Order for PayPal refund %s not found.', 'woocommerce-paypal-payments' ), + 'Order for PayPal refund %s not found.', isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response['message'] = $message; - return rest_ensure_response( $response ); + return $this->failure_response( $message ); } /** @@ -115,33 +93,20 @@ class PaymentCaptureReversed implements RequestHandler { */ $note = apply_filters( 'ppcp_payment_capture_reversed_webhook_update_status_note', '', $wc_order, $request['event_type'] ); - /** - * The WooCommerce order. - * - * @var \WC_Order $wc_order - */ - $response['success'] = (bool) $wc_order->update_status( 'cancelled', $note ); + $is_success = $wc_order->update_status( 'cancelled', $note ); + if ( ! $is_success ) { + $message = sprintf( + 'Failed to cancel order %1$s cancelled through PayPal', + (string) $wc_order->get_id() + ); + return $this->failure_response( $message ); + } - $message = $response['success'] ? sprintf( - // translators: %1$s is the order id. - __( - 'Order %1$s has been cancelled through PayPal', - 'woocommerce-paypal-payments' - ), - (string) $wc_order->get_id() - ) : sprintf( - // translators: %1$s is the order id. - __( 'Failed to cancel order %1$s through PayPal', 'woocommerce-paypal-payments' ), + $message = sprintf( + 'Order %1$s has been cancelled through PayPal', (string) $wc_order->get_id() ); - $this->logger->log( - $response['success'] ? 'info' : 'warning', - $message, - array( - 'request' => $request, - 'order' => $wc_order, - ) - ); - return rest_ensure_response( $response ); + $this->logger->info( $message ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentSaleCompleted.php b/modules/ppcp-webhooks/src/Handler/PaymentSaleCompleted.php index 6f5cb491d..b606e2bd9 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentSaleCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentSaleCompleted.php @@ -20,7 +20,7 @@ use WP_REST_Response; */ class PaymentSaleCompleted implements RequestHandler { - use TransactionIdHandlingTrait; + use TransactionIdHandlingTrait, RequestHandlerTrait; /** * The logger. @@ -67,17 +67,14 @@ class PaymentSaleCompleted implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $billing_agreement_id = wc_clean( wp_unslash( $request['resource']['billing_agreement_id'] ?? '' ) ); if ( ! $billing_agreement_id ) { $message = 'Could not retrieve billing agreement id for subscription.'; - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $args = array( @@ -99,7 +96,6 @@ class PaymentSaleCompleted implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/PaymentSaleRefunded.php b/modules/ppcp-webhooks/src/Handler/PaymentSaleRefunded.php index ff3c1dc6a..b3f2c06bb 100644 --- a/modules/ppcp-webhooks/src/Handler/PaymentSaleRefunded.php +++ b/modules/ppcp-webhooks/src/Handler/PaymentSaleRefunded.php @@ -21,7 +21,7 @@ use WP_REST_Response; */ class PaymentSaleRefunded implements RequestHandler { - use TransactionIdHandlingTrait, RefundMetaTrait; + use TransactionIdHandlingTrait, RefundMetaTrait, RequestHandlerTrait; /** * The logger. @@ -68,16 +68,15 @@ class PaymentSaleRefunded implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); if ( is_null( $request['resource'] ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $refund_id = (string) ( $request['resource']['id'] ?? '' ); $transaction_id = $request['resource']['sale_id'] ?? ''; $total_refunded_amount = $request['resource']['total_refunded_amount']['value'] ?? ''; if ( ! $refund_id || ! $transaction_id || ! $total_refunded_amount ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } $args = array( @@ -90,7 +89,7 @@ class PaymentSaleRefunded implements RequestHandler { $wc_orders = wc_get_orders( $args ); if ( ! is_array( $wc_orders ) ) { - return new WP_REST_Response( $response ); + return $this->failure_response(); } foreach ( $wc_orders as $wc_order ) { @@ -102,24 +101,17 @@ class PaymentSaleRefunded implements RequestHandler { ); if ( $refund instanceof WP_Error ) { - $this->logger->warning( - sprintf( - // translators: %s is the order id. - __( 'Order %s could not be refunded', 'woocommerce-paypal-payments' ), - (string) $wc_order->get_id() - ) + $message = sprintf( + 'Order %s could not be refunded. %s', + (string) $wc_order->get_id(), + $refund->get_error_message() ); - $response['message'] = $refund->get_error_message(); - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $order_refunded_message = sprintf( - // translators: %1$s is the order id %2$s is the amount which has been refunded. - __( - 'Order %1$s has been refunded with %2$s through PayPal.', - 'woocommerce-paypal-payments' - ), + 'Order %1$s has been refunded with %2$s through PayPal.', (string) $wc_order->get_id(), (string) $total_refunded_amount ); @@ -130,7 +122,6 @@ class PaymentSaleRefunded implements RequestHandler { $this->add_refund_to_meta( $wc_order, $refund_id ); } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php index 68ab36255..2194bd06b 100644 --- a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php +++ b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php @@ -9,7 +9,6 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Webhooks\Handler; -use stdClass; use WC_Order; use WP_REST_Request; use WP_REST_Response; @@ -19,7 +18,7 @@ trait RequestHandlerTrait { /** * Get available custom ids from the given request * - * @param \WP_REST_Request $request The request. + * @param WP_REST_Request $request The request. * @return array */ protected function get_custom_ids_from_request( WP_REST_Request $request ): array { @@ -56,49 +55,58 @@ trait RequestHandlerTrait { } /** - * Return and log response for no custom ids found in request. + * Logs and returns response for no custom ids found in request. * * @param WP_REST_Request $request The request. - * @param array $response The response. * @return WP_REST_Response */ - protected function no_custom_ids_from_request( WP_REST_Request $request, array $response ): WP_REST_Response { + protected function no_custom_ids_response( WP_REST_Request $request ): WP_REST_Response { $message = sprintf( - // translators: %s is the PayPal webhook Id. - __( 'No order for webhook event %s was found.', 'woocommerce-paypal-payments' ), + 'No order for webhook event %s was found.', $request['id'] !== null && isset( $request['id'] ) ? $request['id'] : '' ); - return $this->log_and_return_response( $message, $response ); + return $this->failure_response( $message ); } /** - * Return and log response for no WC orders found in response. + * Logs and returns response for no WC orders found via custom ids. * * @param WP_REST_Request $request The request. - * @param array $response The response. * @return WP_REST_Response */ - protected function no_wc_orders_from_custom_ids( WP_REST_Request $request, array $response ): WP_REST_Response { + protected function no_wc_orders_response( WP_REST_Request $request ): WP_REST_Response { $message = sprintf( - // translators: %s is the PayPal order Id. - __( 'WC order for PayPal order %s not found.', 'woocommerce-paypal-payments' ), + 'WC order for PayPal order %s not found.', $request['resource'] !== null && isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' ); - return $this->log_and_return_response( $message, $response ); + return $this->failure_response( $message ); } /** - * Return and log response with the given message. + * Returns success response. * - * @param string $message The message. - * @param array $response The response. * @return WP_REST_Response */ - private function log_and_return_response( string $message, array $response ): WP_REST_Response { - $this->logger->warning( $message ); - $response['message'] = $message; + protected function success_response(): WP_REST_Response { + return new WP_REST_Response( array( 'success' => true ) ); + } + + /** + * Logs and returns failure response with the given message. + * + * @param string $message The message. + * @return WP_REST_Response + */ + private function failure_response( string $message = '' ): WP_REST_Response { + $response = array( + 'success' => false, + ); + if ( $message ) { + $this->logger->warning( $message ); + $response['message'] = $message; + } return new WP_REST_Response( $response ); } diff --git a/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenCreated.php b/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenCreated.php index 28da46a32..8f2b1abce 100644 --- a/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenCreated.php +++ b/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenCreated.php @@ -24,6 +24,7 @@ use WP_REST_Response; * Class VaultPaymentTokenCreated */ class VaultPaymentTokenCreated implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -103,16 +104,12 @@ class VaultPaymentTokenCreated implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); - $customer_id = null !== $request['resource'] && isset( $request['resource']['customer_id'] ) ? $request['resource']['customer_id'] : ''; if ( ! $customer_id ) { $message = 'No customer id was found.'; - $this->logger->warning( $message, array( 'request' => $request ) ); - $response['message'] = $message; - return new WP_REST_Response( $response ); + return $this->failure_response( $message ); } $wc_customer_id = (int) str_replace( $this->prefix, '', $customer_id ); @@ -150,7 +147,6 @@ class VaultPaymentTokenCreated implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenDeleted.php b/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenDeleted.php index 9a623081f..92dad5ed9 100644 --- a/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenDeleted.php +++ b/modules/ppcp-webhooks/src/Handler/VaultPaymentTokenDeleted.php @@ -18,6 +18,7 @@ use WP_REST_Response; * Class VaultPaymentTokenDeleted */ class VaultPaymentTokenDeleted implements RequestHandler { + use RequestHandlerTrait; /** * The logger. @@ -65,8 +66,6 @@ class VaultPaymentTokenDeleted implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $response = array( 'success' => false ); - if ( ! is_null( $request['resource'] ) && isset( $request['resource']['id'] ) ) { $token_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) ); @@ -89,7 +88,6 @@ class VaultPaymentTokenDeleted implements RequestHandler { } } - $response['success'] = true; - return new WP_REST_Response( $response ); + return $this->success_response(); } } diff --git a/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php b/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php index b228139e0..df556e0f0 100644 --- a/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php +++ b/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php @@ -17,12 +17,14 @@ use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; use WooCommerce\PayPalCommerce\ApiClient\Factory\WebhookEventFactory; use WooCommerce\PayPalCommerce\Webhooks\Handler\RequestHandler; use Psr\Log\LoggerInterface; +use WooCommerce\PayPalCommerce\Webhooks\Handler\RequestHandlerTrait; use WooCommerce\PayPalCommerce\Webhooks\Status\WebhookSimulation; /** * Class IncomingWebhookEndpoint */ class IncomingWebhookEndpoint { + use RequestHandlerTrait; const NAMESPACE = 'paypal/v1'; const ROUTE = 'incoming'; @@ -211,26 +213,16 @@ class IncomingWebhookEndpoint { if ( $this->simulation->is_simulation_event( $event ) ) { $this->logger->info( 'Received simulated webhook.' ); $this->simulation->receive( $event ); - return rest_ensure_response( - array( - 'success' => true, - ) - ); + return $this->success_response(); } foreach ( $this->handlers as $handler ) { if ( $handler->responsible_for_request( $request ) ) { $response = $handler->handle_request( $request ); - $this->logger->log( - 'info', + $this->logger->info( sprintf( - // translators: %s is the event type. - __( 'Webhook has been handled by %s', 'woocommerce-paypal-payments' ), + 'Webhook has been handled by %s', ( $handler->event_types() ) ? current( $handler->event_types() ) : '' - ), - array( - 'request' => $request, - 'response' => $response, ) ); return $response; @@ -238,22 +230,10 @@ class IncomingWebhookEndpoint { } $message = sprintf( - // translators: %s is the request type. - __( 'Could not find handler for request type %s', 'woocommerce-paypal-payments' ), - $request['event_type'] + 'Could not find handler for request type %s', + $request['event_type'] ?: '' ); - $this->logger->log( - 'warning', - $message, - array( - 'request' => $request, - ) - ); - $response = array( - 'success' => false, - 'message' => $message, - ); - return rest_ensure_response( $response ); + return $this->failure_response( $message ); } /** From 9db147679d9ec039a94f97d8035492d1749dde51 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 9 Jun 2023 20:23:07 +0300 Subject: [PATCH 14/67] Improve webhook wc order error messages --- .../src/Handler/RequestHandlerTrait.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php index 2194bd06b..2b47fc8b2 100644 --- a/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php +++ b/modules/ppcp-webhooks/src/Handler/RequestHandlerTrait.php @@ -19,7 +19,7 @@ trait RequestHandlerTrait { * Get available custom ids from the given request * * @param WP_REST_Request $request The request. - * @return array + * @return string[] */ protected function get_custom_ids_from_request( WP_REST_Request $request ): array { return array_filter( @@ -62,8 +62,10 @@ trait RequestHandlerTrait { */ protected function no_custom_ids_response( WP_REST_Request $request ): WP_REST_Response { $message = sprintf( - 'No order for webhook event %s was found.', - $request['id'] !== null && isset( $request['id'] ) ? $request['id'] : '' + 'WC order ID was not found in webhook event %s for PayPal order %s.', + (string) ( $request['id'] ?? '' ), + // Psalm 4.x does not seem to understand ?? with ArrayAccess correctly. + $request['resource'] !== null && isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' ); return $this->failure_response( $message ); @@ -77,7 +79,9 @@ trait RequestHandlerTrait { */ protected function no_wc_orders_response( WP_REST_Request $request ): WP_REST_Response { $message = sprintf( - 'WC order for PayPal order %s not found.', + 'WC order %s not found in webhook event %s for PayPal order %s.', + implode( ', ', $this->get_custom_ids_from_request( $request ) ), + (string) ( $request['id'] ?? '' ), $request['resource'] !== null && isset( $request['resource']['id'] ) ? $request['resource']['id'] : '' ); From f31fbb89160038c4c096db6d7f6e2dc72edc2e3a Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Sun, 11 Jun 2023 11:52:15 +0200 Subject: [PATCH 15/67] Remove default preview message --- .../src/Settings/Fields/pay-later-tab-fields.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php index b3af60d5b..f87a7285e 100644 --- a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php +++ b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php @@ -25,7 +25,7 @@ return function ( ContainerInterface $container, array $fields ): array { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); - $vault_enabled = $settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ); + $vault_enabled = false;//$settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ); $pay_later_messaging_enabled_label = $vault_enabled ? __( "You have PayPal vaulting enabled, that's why Pay Later options are unavailable now. You cannot use both features at the same time.", 'woocommerce-paypal-payments' ) @@ -35,7 +35,6 @@ return function ( ContainerInterface $container, array $fields ): array { $default_messaging_flex_color = $selected_country === 'US' ? 'white-no-border' : 'white'; $button_message = __( 'Pay Later Button Preview', 'woocommerce-paypal-payments' ); $messaging_message = __( 'Pay Later Messaging Preview', 'woocommerce-paypal-payments' ); - $default_message = __( 'Preview', 'woocommerce-paypal-payments' ); $render_preview_element = function ( string $id, string $type, string $message ): string { return '
@@ -371,7 +370,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_product_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpProductMessagePreview', 'message', $default_message ), + 'text' => $render_preview_element( 'ppcpProductMessagePreview', 'message', $messaging_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -495,7 +494,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_cart_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpCartMessagePreview', 'message', $default_message ), + 'text' => $render_preview_element( 'ppcpCartMessagePreview', 'message', $messaging_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, @@ -619,7 +618,7 @@ return function ( ContainerInterface $container, array $fields ): array { ), 'pay_later_checkout_message_preview' => array( 'type' => 'ppcp-text', - 'text' => $render_preview_element( 'ppcpCheckoutMessagePreview', 'message', $default_message ), + 'text' => $render_preview_element( 'ppcpCheckoutMessagePreview', 'message', $messaging_message ), 'screens' => array( State::STATE_ONBOARDED ), 'requirements' => array( 'messages' ), 'gateway' => Settings::PAY_LATER_TAB_ID, From fde0aae9a0939cf39a149d52a246a8060facaac4 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 12 Jun 2023 15:24:28 +0300 Subject: [PATCH 16/67] Remove code duplication --- .../src/Cancellation/CancelController.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/ppcp-session/src/Cancellation/CancelController.php b/modules/ppcp-session/src/Cancellation/CancelController.php index 79dbd4dcf..167afc25a 100644 --- a/modules/ppcp-session/src/Cancellation/CancelController.php +++ b/modules/ppcp-session/src/Cancellation/CancelController.php @@ -9,12 +9,14 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Session\Cancellation; +use WooCommerce\PayPalCommerce\Button\Helper\ContextTrait; use WooCommerce\PayPalCommerce\Session\SessionHandler; /** * Class CancelController */ class CancelController { + use ContextTrait; public const NONCE = 'ppcp-cancel'; @@ -61,20 +63,10 @@ class CancelController { $this->session_handler->destroy_session_data(); } - $order = $this->session_handler->order(); - if ( ! $order ) { + if ( ! $this->is_paypal_continuation() ) { return; } - $source = $order->payment_source(); - if ( $source && $source->card() ) { - return; // Ignore for DCC. - } - - if ( 'card' === $this->session_handler->funding_source() ) { - return; // Ignore for card buttons. - } - $url = add_query_arg( array( $param_name => wp_create_nonce( self::NONCE ) ), wc_get_checkout_url() ); add_action( 'woocommerce_review_order_after_submit', From 8a6437b558d362f36cd5d25e74b31800db26e8cb Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 13 Jun 2023 12:31:59 +0300 Subject: [PATCH 17/67] Add buyer-country for guests too --- modules/ppcp-button/src/Assets/SmartButton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 7f07c332a..1c9862a5e 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -1000,7 +1000,7 @@ class SmartButton implements SmartButtonInterface { ); if ( $this->environment->current_environment_is( Environment::SANDBOX ) - && defined( 'WP_DEBUG' ) && \WP_DEBUG && is_user_logged_in() + && defined( 'WP_DEBUG' ) && \WP_DEBUG && WC()->customer instanceof \WC_Customer && WC()->customer->get_billing_country() && 2 === strlen( WC()->customer->get_billing_country() ) ) { From e29ef9c7d60e951c4f86a6f84114e4034ebdd40e Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 08:59:30 +0300 Subject: [PATCH 18/67] Use continuation mode when APM does not redirect back --- modules/ppcp-button/services.php | 2 + .../src/Endpoint/CreateOrderEndpoint.php | 43 ++++++++++------ .../ppcp-button/src/Helper/ContextTrait.php | 8 +++ modules/ppcp-session/src/SessionHandler.php | 2 + modules/ppcp-session/src/SessionModule.php | 50 +++++++++++++++++++ modules/ppcp-wc-gateway/services.php | 6 +++ .../src/Gateway/PayPalGateway.php | 10 +++- 7 files changed, 105 insertions(+), 16 deletions(-) diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index f378a3836..fffd57226 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -125,6 +125,7 @@ return array( $container->get( 'button.basic-checkout-validation-enabled' ), $container->get( 'button.early-wc-checkout-validation-enabled' ), $container->get( 'button.pay-now-contexts' ), + $container->get( 'wcgateway.funding-sources-without-redirect' ), $container->get( 'woocommerce.logger.woocommerce' ) ); }, @@ -176,6 +177,7 @@ return array( $container->get( 'button.early-wc-checkout-validation-enabled' ), $container->get( 'button.pay-now-contexts' ), $container->get( 'button.handle-shipping-in-paypal' ), + $container->get( 'wcgateway.funding-sources-without-redirect' ), $logger ); }, diff --git a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php index 83d5f89b1..9ac7aea26 100644 --- a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php +++ b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php @@ -152,6 +152,13 @@ class CreateOrderEndpoint implements EndpointInterface { */ private $handle_shipping_in_paypal; + /** + * The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. + * + * @var string[] + */ + private $funding_sources_without_redirect; + /** * The logger. * @@ -175,6 +182,7 @@ class CreateOrderEndpoint implements EndpointInterface { * @param bool $early_validation_enabled Whether to execute WC validation of the checkout form. * @param string[] $pay_now_contexts The contexts that should have the Pay Now button. * @param bool $handle_shipping_in_paypal If true, the shipping methods are sent to PayPal allowing the customer to select it inside the popup. + * @param string[] $funding_sources_without_redirect The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. * @param LoggerInterface $logger The logger. */ public function __construct( @@ -191,23 +199,25 @@ class CreateOrderEndpoint implements EndpointInterface { bool $early_validation_enabled, array $pay_now_contexts, bool $handle_shipping_in_paypal, + array $funding_sources_without_redirect, LoggerInterface $logger ) { - $this->request_data = $request_data; - $this->purchase_unit_factory = $purchase_unit_factory; - $this->shipping_preference_factory = $shipping_preference_factory; - $this->api_endpoint = $order_endpoint; - $this->payer_factory = $payer_factory; - $this->session_handler = $session_handler; - $this->settings = $settings; - $this->early_order_handler = $early_order_handler; - $this->registration_needed = $registration_needed; - $this->card_billing_data_mode = $card_billing_data_mode; - $this->early_validation_enabled = $early_validation_enabled; - $this->pay_now_contexts = $pay_now_contexts; - $this->handle_shipping_in_paypal = $handle_shipping_in_paypal; - $this->logger = $logger; + $this->request_data = $request_data; + $this->purchase_unit_factory = $purchase_unit_factory; + $this->shipping_preference_factory = $shipping_preference_factory; + $this->api_endpoint = $order_endpoint; + $this->payer_factory = $payer_factory; + $this->session_handler = $session_handler; + $this->settings = $settings; + $this->early_order_handler = $early_order_handler; + $this->registration_needed = $registration_needed; + $this->card_billing_data_mode = $card_billing_data_mode; + $this->early_validation_enabled = $early_validation_enabled; + $this->pay_now_contexts = $pay_now_contexts; + $this->handle_shipping_in_paypal = $handle_shipping_in_paypal; + $this->funding_sources_without_redirect = $funding_sources_without_redirect; + $this->logger = $logger; } /** @@ -288,6 +298,11 @@ class CreateOrderEndpoint implements EndpointInterface { } if ( 'checkout' === $data['context'] ) { + if ( ! in_array( $funding_source, $this->funding_sources_without_redirect, true ) ) { + $this->session_handler->replace_order( $order ); + $this->session_handler->replace_funding_source( $funding_source ); + } + if ( ! $this->early_order_handler->should_create_early_order() || $this->registration_needed diff --git a/modules/ppcp-button/src/Helper/ContextTrait.php b/modules/ppcp-button/src/Helper/ContextTrait.php index daddbb0a9..c8125066d 100644 --- a/modules/ppcp-button/src/Helper/ContextTrait.php +++ b/modules/ppcp-button/src/Helper/ContextTrait.php @@ -9,6 +9,8 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Button\Helper; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; + trait ContextTrait { /** @@ -56,6 +58,12 @@ trait ContextTrait { return false; } + if ( ! $order->status()->is( OrderStatus::APPROVED ) + && ! $order->status()->is( OrderStatus::COMPLETED ) + ) { + return false; + } + $source = $order->payment_source(); if ( $source && $source->card() ) { return false; // Ignore for DCC. diff --git a/modules/ppcp-session/src/SessionHandler.php b/modules/ppcp-session/src/SessionHandler.php index 7bceb34a6..be269332e 100644 --- a/modules/ppcp-session/src/SessionHandler.php +++ b/modules/ppcp-session/src/SessionHandler.php @@ -55,6 +55,8 @@ class SessionHandler { public function order() { $this->load_session(); + do_action( 'ppcp_session_get_order', $this->order, $this ); + return $this->order; } diff --git a/modules/ppcp-session/src/SessionModule.php b/modules/ppcp-session/src/SessionModule.php index a27effb47..cecc1a98f 100644 --- a/modules/ppcp-session/src/SessionModule.php +++ b/modules/ppcp-session/src/SessionModule.php @@ -9,6 +9,11 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Session; +use Psr\Log\LoggerInterface; +use Throwable; +use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\ServiceProvider; use WooCommerce\PayPalCommerce\Vendor\Dhii\Modular\Module\ModuleInterface; use WooCommerce\PayPalCommerce\Session\Cancellation\CancelController; @@ -19,6 +24,12 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface; * Class SessionModule */ class SessionModule implements ModuleInterface { + /** + * A flag to avoid multiple requests to reload order. + * + * @var bool + */ + private $reloaded_order = false; /** * {@inheritDoc} @@ -46,6 +57,45 @@ class SessionModule implements ModuleInterface { $controller->run(); } ); + + add_action( + 'ppcp_session_get_order', + function ( ?Order $order, SessionHandler $session_handler ) use ( $c ): void { + if ( ! isset( WC()->session ) ) { + return; + } + + if ( $this->reloaded_order ) { + return; + } + + if ( ! $order ) { + return; + } + + if ( $order->status()->is( OrderStatus::APPROVED ) + || $order->status()->is( OrderStatus::COMPLETED ) + ) { + return; + } + + $order_endpoint = $c->get( 'api.endpoint.order' ); + assert( $order_endpoint instanceof OrderEndpoint ); + + $this->reloaded_order = true; + + try { + $session_handler->replace_order( $order_endpoint->order( $order->id() ) ); + } catch ( Throwable $exception ) { + $logger = $c->get( 'woocommerce.logger.woocommerce' ); + assert( $logger instanceof LoggerInterface ); + + $logger->warning( 'Failed to reload PayPal order in the session: ' . $exception->getMessage() ); + } + }, + 10, + 2 + ); } /** diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index c90fe0ef7..c2244f348 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -903,6 +903,12 @@ return array( 'paylater' => _x( 'Pay Later', 'Name of payment method', 'woocommerce-paypal-payments' ), ); }, + /** + * The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. + */ + 'wcgateway.funding-sources-without-redirect' => static function( ContainerInterface $container ): array { + return array( 'paypal', 'paylater', 'venmo', 'card' ); + }, 'wcgateway.settings.funding-sources' => static function( ContainerInterface $container ): array { return array_diff_key( $container->get( 'wcgateway.all-funding-sources' ), diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php index 0a5835c31..71634f07a 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php @@ -13,6 +13,7 @@ use Exception; use Psr\Log\LoggerInterface; use WC_Order; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentToken; use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; @@ -253,8 +254,13 @@ class PayPalGateway extends \WC_Payment_Gateway { $funding_source = $this->session_handler->funding_source(); if ( $funding_source ) { - $this->title = $this->funding_source_renderer->render_name( $funding_source ); - $this->description = $this->funding_source_renderer->render_description( $funding_source ); + $order = $this->session_handler->order(); + if ( $order && + ( $order->status()->is( OrderStatus::APPROVED ) || $order->status()->is( OrderStatus::COMPLETED ) ) + ) { + $this->title = $this->funding_source_renderer->render_name( $funding_source ); + $this->description = $this->funding_source_renderer->render_description( $funding_source ); + } } $this->init_form_fields(); From a5af3677e26c18af388020ca60a2c52823194644 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 12:40:01 +0300 Subject: [PATCH 19/67] Fix psalm --- .psalm/stubs.php | 3 +++ modules/ppcp-session/src/Cancellation/CancelController.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.psalm/stubs.php b/.psalm/stubs.php index 8b4990022..b57753212 100644 --- a/.psalm/stubs.php +++ b/.psalm/stubs.php @@ -1,4 +1,7 @@ Date: Wed, 14 Jun 2023 12:41:56 +0300 Subject: [PATCH 20/67] Send customer id as custom_id when no wc order yet --- .../src/Factory/PurchaseUnitFactory.php | 11 ++- modules/ppcp-webhooks/src/CustomIds.php | 18 +++++ .../src/Handler/RequestHandlerTrait.php | 77 ++++++++++++++++--- 3 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 modules/ppcp-webhooks/src/CustomIds.php diff --git a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php index 9f8f12c5e..27e045297 100644 --- a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php +++ b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php @@ -9,10 +9,12 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\ApiClient\Factory; +use WC_Session_Handler; use WooCommerce\PayPalCommerce\ApiClient\Entity\Item; use WooCommerce\PayPalCommerce\ApiClient\Entity\PurchaseUnit; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; use WooCommerce\PayPalCommerce\ApiClient\Repository\PayeeRepository; +use WooCommerce\PayPalCommerce\Webhooks\CustomIds; /** * Class PurchaseUnitFactory @@ -187,7 +189,14 @@ class PurchaseUnitFactory { $payee = $this->payee_repository->payee(); - $custom_id = ''; + $custom_id = ''; + $session = WC()->session; + if ( $session instanceof WC_Session_Handler ) { + $session_id = $session->get_customer_unique_id(); + if ( $session_id ) { + $custom_id = CustomIds::CUSTOMER_ID_PREFIX . $session_id; + } + } $invoice_id = ''; $soft_descriptor = ''; $purchase_unit = new PurchaseUnit( diff --git a/modules/ppcp-webhooks/src/CustomIds.php b/modules/ppcp-webhooks/src/CustomIds.php new file mode 100644 index 000000000..97a78e43d --- /dev/null +++ b/modules/ppcp-webhooks/src/CustomIds.php @@ -0,0 +1,18 @@ +get_custom_ids_from_request( $request ); + + return array_values( + array_filter( + $ids, + function ( string $id ): bool { + return strpos( $id, CustomIds::CUSTOMER_ID_PREFIX ) === false; + } + ) + ); + } + + /** + * Get available WC customer ids from the given request. + * + * @param WP_REST_Request $request The request. + * @return string[] + */ + protected function get_wc_customer_ids_from_request( WP_REST_Request $request ): array { + $ids = $this->get_custom_ids_from_request( $request ); + + $customer_ids = array_values( + array_filter( + $ids, + function ( string $id ): bool { + return strpos( $id, CustomIds::CUSTOMER_ID_PREFIX ) === 0; + } + ) + ); + return array_map( + function ( string $str ): string { + return (string) substr( $str, strlen( CustomIds::CUSTOMER_ID_PREFIX ) ); + }, + $customer_ids ); } From 46ea7621d3bd208b3553d1990763d36c15a978cc Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 12:44:06 +0300 Subject: [PATCH 21/67] Create wc order in approval webhook if missing --- modules/ppcp-button/resources/js/button.js | 13 +- modules/ppcp-button/services.php | 4 +- .../ppcp-button/src/Assets/SmartButton.php | 11 ++ .../src/Helper/CheckoutFormSaver.php | 21 ++ modules/ppcp-session/src/MemoryWcSession.php | 75 ++++++++ modules/ppcp-session/src/SessionHandler.php | 34 ++++ modules/ppcp-webhooks/services.php | 8 +- .../src/Handler/CheckoutOrderApproved.php | 180 ++++++++++++++---- 8 files changed, 302 insertions(+), 44 deletions(-) create mode 100644 modules/ppcp-session/src/MemoryWcSession.php diff --git a/modules/ppcp-button/resources/js/button.js b/modules/ppcp-button/resources/js/button.js index 6708b0275..7ac5bb38e 100644 --- a/modules/ppcp-button/resources/js/button.js +++ b/modules/ppcp-button/resources/js/button.js @@ -28,6 +28,8 @@ const cardsSpinner = new Spinner('#ppcp-hosted-fields'); const bootstrap = () => { const checkoutFormSelector = 'form.woocommerce-checkout'; + const context = PayPalCommerceGateway.context; + const errorHandler = new ErrorHandler( PayPalCommerceGateway.labels.error.generic, document.querySelector(checkoutFormSelector) ?? document.querySelector('.woocommerce-notices-wrapper') @@ -58,7 +60,7 @@ const bootstrap = () => { } }); - const onSmartButtonClick = (data, actions) => { + const onSmartButtonClick = async (data, actions) => { window.ppcpFundingSource = data.fundingSource; const requiredFields = jQuery('form.woocommerce-checkout .validate-required:visible :input'); requiredFields.each((i, input) => { @@ -120,13 +122,20 @@ const bootstrap = () => { freeTrialHandler.handle(); return actions.reject(); } + + if (context === 'checkout' && !PayPalCommerceGateway.funding_sources_without_redirect.includes(data.fundingSource)) { + try { + await formSaver.save(form); + } catch (error) { + console.error(error); + } + } }; const onSmartButtonsInit = () => { buttonsSpinner.unblock(); }; const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit); const messageRenderer = new MessageRenderer(PayPalCommerceGateway.messages); - const context = PayPalCommerceGateway.context; if (context === 'mini-cart' || context === 'product') { if (PayPalCommerceGateway.mini_cart_buttons_enabled === '1') { const miniCartBootstrap = new MiniCartBootstap( diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index fffd57226..e100e5ea3 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -216,7 +216,9 @@ return array( ); }, 'button.checkout-form-saver' => static function ( ContainerInterface $container ): CheckoutFormSaver { - return new CheckoutFormSaver(); + return new CheckoutFormSaver( + $container->get( 'session.handler' ) + ); }, 'button.endpoint.save-checkout-form' => static function ( ContainerInterface $container ): SaveCheckoutFormEndpoint { return new SaveCheckoutFormEndpoint( diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 1c9862a5e..eb7a020dd 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -173,6 +173,13 @@ class SmartButton implements SmartButtonInterface { */ private $pay_now_contexts; + /** + * The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. + * + * @var string[] + */ + private $funding_sources_without_redirect; + /** * The logger. * @@ -208,6 +215,7 @@ class SmartButton implements SmartButtonInterface { * @param bool $basic_checkout_validation_enabled Whether the basic JS validation of the form iss enabled. * @param bool $early_validation_enabled Whether to execute WC validation of the checkout form. * @param array $pay_now_contexts The contexts that should have the Pay Now button. + * @param string[] $funding_sources_without_redirect The sources that do not cause issues about redirecting (on mobile, ...) and sometimes not returning back. * @param LoggerInterface $logger The logger. */ public function __construct( @@ -229,6 +237,7 @@ class SmartButton implements SmartButtonInterface { bool $basic_checkout_validation_enabled, bool $early_validation_enabled, array $pay_now_contexts, + array $funding_sources_without_redirect, LoggerInterface $logger ) { @@ -250,6 +259,7 @@ class SmartButton implements SmartButtonInterface { $this->basic_checkout_validation_enabled = $basic_checkout_validation_enabled; $this->early_validation_enabled = $early_validation_enabled; $this->pay_now_contexts = $pay_now_contexts; + $this->funding_sources_without_redirect = $funding_sources_without_redirect; $this->logger = $logger; } @@ -939,6 +949,7 @@ class SmartButton implements SmartButtonInterface { 'mini_cart_buttons_enabled' => $this->settings_status->is_smart_button_enabled_for_location( 'mini-cart' ), 'basic_checkout_validation_enabled' => $this->basic_checkout_validation_enabled, 'early_checkout_validation_enabled' => $this->early_validation_enabled, + 'funding_sources_without_redirect' => $this->funding_sources_without_redirect, ); if ( $this->style_for_context( 'layout', 'mini-cart' ) !== 'horizontal' ) { diff --git a/modules/ppcp-button/src/Helper/CheckoutFormSaver.php b/modules/ppcp-button/src/Helper/CheckoutFormSaver.php index 73f8eeefc..c2f10ca28 100644 --- a/modules/ppcp-button/src/Helper/CheckoutFormSaver.php +++ b/modules/ppcp-button/src/Helper/CheckoutFormSaver.php @@ -10,11 +10,30 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Button\Helper; use WC_Checkout; +use WooCommerce\PayPalCommerce\Session\SessionHandler; /** * Class CheckoutFormSaver */ class CheckoutFormSaver extends WC_Checkout { + /** + * The Session handler. + * + * @var SessionHandler + */ + private $session_handler; + + /** + * CheckoutFormSaver constructor. + * + * @param SessionHandler $session_handler The session handler. + */ + public function __construct( + SessionHandler $session_handler + ) { + $this->session_handler = $session_handler; + } + /** * Saves the form data to the WC customer and session. * @@ -28,5 +47,7 @@ class CheckoutFormSaver extends WC_Checkout { $data = $this->get_posted_data(); $this->update_session( $data ); + + $this->session_handler->replace_checkout_form( $data ); } } diff --git a/modules/ppcp-session/src/MemoryWcSession.php b/modules/ppcp-session/src/MemoryWcSession.php new file mode 100644 index 000000000..583aa5a9d --- /dev/null +++ b/modules/ppcp-session/src/MemoryWcSession.php @@ -0,0 +1,75 @@ +session->get_session). + * + * @var array + */ + private static $data; + + /** + * The customer ID. + * + * @var string|int + */ + private static $customer_id; + + /** + * Enqueues this session handler with the given data to be used by WC. + * + * @param array $session_data The session data (from WC()->session->get_session). + * @param int|string $customer_id The customer ID. + */ + public static function replace_session_handler( array $session_data, $customer_id ): void { + self::$data = $session_data; + self::$customer_id = $customer_id; + + add_filter( + 'woocommerce_session_handler', + function () { + return MemoryWcSession::class; + } + ); + } + + /** + * @inerhitDoc + */ + public function init_session_cookie() { + $this->_customer_id = self::$customer_id; + $this->_data = self::$data; + } + + /** + * @inerhitDoc + */ + public function get_session_data() { + return self::$data; + } + + /** + * @inerhitDoc + */ + public function forget_session() { + self::$data = array(); + + parent::forget_session(); + } +} diff --git a/modules/ppcp-session/src/SessionHandler.php b/modules/ppcp-session/src/SessionHandler.php index be269332e..d85c40b65 100644 --- a/modules/ppcp-session/src/SessionHandler.php +++ b/modules/ppcp-session/src/SessionHandler.php @@ -47,6 +47,13 @@ class SessionHandler { */ private $funding_source = null; + /** + * The checkout form data. + * + * @var array + */ + private $checkout_form = array(); + /** * Returns the order. * @@ -73,6 +80,30 @@ class SessionHandler { $this->store_session(); } + /** + * Returns the checkout form data. + * + * @return array + */ + public function checkout_form(): array { + $this->load_session(); + + return $this->checkout_form; + } + + /** + * Replaces the checkout form data. + * + * @param array $checkout_form The checkout form data. + */ + public function replace_checkout_form( array $checkout_form ): void { + $this->load_session(); + + $this->checkout_form = $checkout_form; + + $this->store_session(); + } + /** * Returns the BN Code. * @@ -153,6 +184,7 @@ class SessionHandler { $this->bn_code = ''; $this->insufficient_funding_tries = 0; $this->funding_source = null; + $this->checkout_form = array(); $this->store_session(); return $this; } @@ -190,6 +222,7 @@ class SessionHandler { if ( ! is_string( $this->funding_source ) ) { $this->funding_source = null; } + $this->checkout_form = $data['checkout_form'] ?? array(); } /** @@ -204,6 +237,7 @@ class SessionHandler { 'bn_code' => $obj->bn_code, 'insufficient_funding_tries' => $obj->insufficient_funding_tries, 'funding_source' => $obj->funding_source, + 'checkout_form' => $obj->checkout_form, ); } } diff --git a/modules/ppcp-webhooks/services.php b/modules/ppcp-webhooks/services.php index 24bc9e971..cd0424a19 100644 --- a/modules/ppcp-webhooks/services.php +++ b/modules/ppcp-webhooks/services.php @@ -82,7 +82,13 @@ return array( $payment_token_factory = $container->get( 'vaulting.payment-token-factory' ); return array( - new CheckoutOrderApproved( $logger, $order_endpoint ), + new CheckoutOrderApproved( + $logger, + $order_endpoint, + $container->get( 'session.handler' ), + $container->get( 'wcgateway.funding-source.renderer' ), + $container->get( 'wcgateway.order-processor' ) + ), new CheckoutOrderCompleted( $logger ), new CheckoutPaymentApprovalReversed( $logger ), new PaymentCaptureRefunded( $logger ), diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php index a37cab34c..f7a8d8f27 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php @@ -9,11 +9,18 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Webhooks\Handler; +use WC_Checkout; +use WC_Order; +use WC_Session_Handler; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; -use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; use Psr\Log\LoggerInterface; +use WooCommerce\PayPalCommerce\Session\MemoryWcSession; +use WooCommerce\PayPalCommerce\Session\SessionHandler; +use WooCommerce\PayPalCommerce\WcGateway\FundingSource\FundingSourceRenderer; use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayUponInvoice\PayUponInvoiceGateway; +use WooCommerce\PayPalCommerce\WcGateway\Processor\OrderProcessor; /** * Class CheckoutOrderApproved @@ -36,15 +43,48 @@ class CheckoutOrderApproved implements RequestHandler { */ private $order_endpoint; + /** + * The Session handler. + * + * @var SessionHandler + */ + private $session_handler; + + /** + * The funding source renderer. + * + * @var FundingSourceRenderer + */ + protected $funding_source_renderer; + + /** + * The processor for orders. + * + * @var OrderProcessor + */ + protected $order_processor; + /** * CheckoutOrderApproved constructor. * - * @param LoggerInterface $logger The logger. - * @param OrderEndpoint $order_endpoint The order endpoint. + * @param LoggerInterface $logger The logger. + * @param OrderEndpoint $order_endpoint The order endpoint. + * @param SessionHandler $session_handler The session handler. + * @param FundingSourceRenderer $funding_source_renderer The funding source renderer. + * @param OrderProcessor $order_processor The Order Processor. */ - public function __construct( LoggerInterface $logger, OrderEndpoint $order_endpoint ) { - $this->logger = $logger; - $this->order_endpoint = $order_endpoint; + public function __construct( + LoggerInterface $logger, + OrderEndpoint $order_endpoint, + SessionHandler $session_handler, + FundingSourceRenderer $funding_source_renderer, + OrderProcessor $order_processor + ) { + $this->logger = $logger; + $this->order_endpoint = $order_endpoint; + $this->session_handler = $session_handler; + $this->funding_source_renderer = $funding_source_renderer; + $this->order_processor = $order_processor; } /** @@ -77,36 +117,93 @@ class CheckoutOrderApproved implements RequestHandler { * @return \WP_REST_Response */ public function handle_request( \WP_REST_Request $request ): \WP_REST_Response { - $custom_ids = $this->get_custom_ids_from_request( $request ); - if ( empty( $custom_ids ) ) { - return $this->no_custom_ids_response( $request ); - } - - try { - $order = isset( $request['resource']['id'] ) ? - $this->order_endpoint->order( $request['resource']['id'] ) : null; - if ( ! $order ) { - $message = sprintf( - 'No paypal payment for webhook event %s was found.', - isset( $request['id'] ) ? $request['id'] : '' - ); - return $this->failure_response( $message ); - } - - if ( $order->intent() === 'CAPTURE' ) { - $order = $this->order_endpoint->capture( $order ); - } - } catch ( RuntimeException $error ) { - $message = sprintf( - 'Could not capture payment for webhook event %s.', - isset( $request['id'] ) ? $request['id'] : '' + $order_id = isset( $request['resource']['id'] ) ? $request['resource']['id'] : null; + if ( ! $order_id ) { + return $this->failure_response( + sprintf( + 'No order ID in webhook event %s.', + $request['id'] ?: '' + ) ); - return $this->failure_response( $message ); } - $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); - if ( ! $wc_orders ) { - return $this->no_wc_orders_response( $request ); + $order = $this->order_endpoint->order( $order_id ); + + if ( $order->status()->is( OrderStatus::COMPLETED ) ) { + return $this->success_response(); + } + + $wc_orders = array(); + + $custom_ids = $this->get_wc_order_ids_from_request( $request ); + if ( empty( $custom_ids ) ) { + $custom_ids = $this->get_wc_customer_ids_from_request( $request ); + if ( empty( $custom_ids ) ) { + return $this->no_custom_ids_response( $request ); + } + + $customer_id = $custom_ids[0]; + + $wc_session = new WC_Session_Handler(); + + $session_data = $wc_session->get_session( $customer_id ); + if ( ! is_array( $session_data ) ) { + return $this->failure_response( "Failed to get session data {$customer_id}" ); + } + + MemoryWcSession::replace_session_handler( $session_data, $customer_id ); + + wc_load_cart(); + WC()->cart->get_cart_from_session(); + WC()->cart->calculate_shipping(); + + $form = $this->session_handler->checkout_form(); + + $checkout = new WC_Checkout(); + $wc_order_id = $checkout->create_order( $form ); + $wc_order = wc_get_order( $wc_order_id ); + if ( ! $wc_order instanceof WC_Order ) { + return $this->failure_response( + sprintf( + 'Failed to create WC order in webhook event %s.', + $request['id'] ?: '' + ) + ); + } + + $funding_source = $this->session_handler->funding_source(); + if ( $funding_source ) { + $wc_order->set_payment_method_title( $this->funding_source_renderer->render_name( $funding_source ) ); + } + + if ( is_numeric( $customer_id ) ) { + $wc_order->set_customer_id( (int) $customer_id ); + } + + $wc_order->save(); + + $wc_orders[] = $wc_order; + + add_action( + 'shutdown', + function () use ( $customer_id ): void { + $session = WC()->session; + assert( $session instanceof WC_Session_Handler ); + + /** + * Wrong type-hint. + * + * @psalm-suppress InvalidScalarArgument + */ + $session->delete_session( $customer_id ); + $session->forget_session(); + } + ); + } else { + $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); + if ( ! $wc_orders ) { + return $this->no_wc_orders_response( $request ); + } } foreach ( $wc_orders as $wc_order ) { @@ -117,17 +214,20 @@ class CheckoutOrderApproved implements RequestHandler { if ( ! in_array( $wc_order->get_status(), array( 'pending', 'on-hold' ), true ) ) { continue; } - if ( $order->intent() === 'CAPTURE' ) { - $wc_order->payment_complete(); - } else { - $wc_order->update_status( - 'on-hold', - __( 'Payment can be captured.', 'woocommerce-paypal-payments' ) + + if ( ! $this->order_processor->process( $wc_order ) ) { + return $this->failure_response( + sprintf( + 'Failed to process WC order %s: %s.', + (string) $wc_order->get_id(), + $this->order_processor->last_error() + ) ); } + $this->logger->info( sprintf( - 'Order %s has been updated through PayPal', + 'WC order %s has been processed after approval in PayPal.', (string) $wc_order->get_id() ) ); From d3249b140a108b16ce2d19740e2aa3b5e7c5e37d Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 14 Jun 2023 12:15:20 +0200 Subject: [PATCH 22/67] Add unsupported currency admin notice --- modules/ppcp-wc-gateway/services.php | 6 ++ .../Notice/UnsupportedCurrencyAdminNotice.php | 81 +++++++++++++++++++ .../ppcp-wc-gateway/src/WCGatewayModule.php | 8 ++ 3 files changed, 95 insertions(+) create mode 100644 modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 901c1f94a..429191589 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -57,6 +57,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; use WooCommerce\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice; use WooCommerce\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice; use WooCommerce\PayPalCommerce\WcGateway\Notice\GatewayWithoutPayPalAdminNotice; +use WooCommerce\PayPalCommerce\WcGateway\Notice\UnsupportedCurrencyAdminNotice; use WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor; use WooCommerce\PayPalCommerce\WcGateway\Processor\OrderProcessor; use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundProcessor; @@ -208,6 +209,11 @@ return array( $settings = $container->get( 'wcgateway.settings' ); return new ConnectAdminNotice( $state, $settings ); }, + 'wcgateway.notice.currency-unsupported' => static function (ContainerInterface $container): UnsupportedCurrencyAdminNotice { + $state = $container->get('onboarding.state'); + $settings = $container->get('wcgateway.settings'); + return new UnsupportedCurrencyAdminNotice($state, $settings); + }, 'wcgateway.notice.dcc-without-paypal' => static function ( ContainerInterface $container ): GatewayWithoutPayPalAdminNotice { return new GatewayWithoutPayPalAdminNotice( CreditCardGateway::ID, diff --git a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php new file mode 100644 index 000000000..600b64f9b --- /dev/null +++ b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php @@ -0,0 +1,81 @@ +state = $state; + $this->settings = $settings; + } + + /** + * Returns the message. + * + * @return Message|null + */ + public function unsupported_currency_message() { + if ( ! $this->should_display() ) { + return null; + } + + $message = sprintf( + /* translators: %1$s the gateway name. */ + __( + 'Attention: Your current WooCommerce store currency is not supported by PayPal. Please update your store currency to one that is supported by PayPal to ensure smooth transactions. Visit the PayPal currency support page for more information on supported currencies.', + 'woocommerce-paypal-payments' + ), + "https://developer.paypal.com/api/rest/reference/currency-codes/" + ); + return new Message( $message, 'warning' ); + } + + /** + * Whether the message should display. + * + * @return bool + */ + protected function should_display(): bool { + return $this->state->current_state() === State::STATE_ONBOARDED && ! $this->currency_supported(); + } + + private function currency_supported() + { + //TODO - get the currency from the settings + } +} diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index f49fb8f08..9f3282b58 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -39,6 +39,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Helper\PayUponInvoiceProductStatus; use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; use WooCommerce\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice; use WooCommerce\PayPalCommerce\WcGateway\Notice\GatewayWithoutPayPalAdminNotice; +use WooCommerce\PayPalCommerce\WcGateway\Notice\UnsupportedCurrencyAdminNotice; use WooCommerce\PayPalCommerce\WcGateway\Processor\AuthorizedPaymentsProcessor; use WooCommerce\PayPalCommerce\WcGateway\Settings\HeaderRenderer; use WooCommerce\PayPalCommerce\WcGateway\Settings\SectionsRenderer; @@ -197,6 +198,13 @@ class WCGatewayModule implements ModuleInterface { $notices[] = $connect_message; } + $notice = $c->get( 'wcgateway.notice.currency-unsupported' ); + assert( $notice instanceof UnsupportedCurrencyAdminNotice ); + $unsupported_currency_message = $notice->unsupported_currency_message(); + if ( $unsupported_currency_message ) { + $notices[] = $unsupported_currency_message; + } + foreach ( array( $c->get( 'wcgateway.notice.dcc-without-paypal' ), $c->get( 'wcgateway.notice.card-button-without-paypal' ), From 013ffb52137b140ed4b8a9a6126e02ef21382c4d Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 14 Jun 2023 12:36:55 +0200 Subject: [PATCH 23/67] Check supported currencies in notice method --- modules/ppcp-wc-gateway/services.php | 9 +++--- .../Notice/UnsupportedCurrencyAdminNotice.php | 28 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 429191589..069b8c539 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -209,10 +209,11 @@ return array( $settings = $container->get( 'wcgateway.settings' ); return new ConnectAdminNotice( $state, $settings ); }, - 'wcgateway.notice.currency-unsupported' => static function (ContainerInterface $container): UnsupportedCurrencyAdminNotice { - $state = $container->get('onboarding.state'); - $settings = $container->get('wcgateway.settings'); - return new UnsupportedCurrencyAdminNotice($state, $settings); + 'wcgateway.notice.currency-unsupported' => static function ( ContainerInterface $container ): UnsupportedCurrencyAdminNotice { + $state = $container->get( 'onboarding.state' ); + $settings = $container->get( 'wcgateway.settings' ); + $supported_currencies = $container->get( 'api.supported-currencies' ); + return new UnsupportedCurrencyAdminNotice( $state, $settings, $supported_currencies ); }, 'wcgateway.notice.dcc-without-paypal' => static function ( ContainerInterface $container ): GatewayWithoutPayPalAdminNotice { return new GatewayWithoutPayPalAdminNotice( diff --git a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php index 600b64f9b..89c177b01 100644 --- a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php +++ b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php @@ -32,16 +32,24 @@ class UnsupportedCurrencyAdminNotice { * @var ContainerInterface */ private $settings; + /** + * The supported currencies. + * + * @var array + */ + private $supported_currencies; /** * ConnectAdminNotice constructor. * * @param State $state The state. * @param ContainerInterface $settings The settings. + * @param array $supported_currencies The supported currencies. */ - public function __construct( State $state, ContainerInterface $settings ) { - $this->state = $state; - $this->settings = $settings; + public function __construct( State $state, ContainerInterface $settings, array $supported_currencies ) { + $this->state = $state; + $this->settings = $settings; + $this->supported_currencies = $supported_currencies; } /** @@ -60,7 +68,7 @@ class UnsupportedCurrencyAdminNotice { 'Attention: Your current WooCommerce store currency is not supported by PayPal. Please update your store currency to one that is supported by PayPal to ensure smooth transactions. Visit the PayPal currency support page for more information on supported currencies.', 'woocommerce-paypal-payments' ), - "https://developer.paypal.com/api/rest/reference/currency-codes/" + 'https://developer.paypal.com/api/rest/reference/currency-codes/' ); return new Message( $message, 'warning' ); } @@ -74,8 +82,14 @@ class UnsupportedCurrencyAdminNotice { return $this->state->current_state() === State::STATE_ONBOARDED && ! $this->currency_supported(); } - private function currency_supported() - { - //TODO - get the currency from the settings + /** + * Whether the currency is supported by PayPal. + * + * @return bool + */ + private function currency_supported(): bool { + $currency = get_woocommerce_currency(); + $supported_currencies = $this->supported_currencies; + return in_array( $currency, $supported_currencies, true ); } } From c9595e29bd7b94295e84494d6b82b8b8e0fe15ea Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 15:39:24 +0300 Subject: [PATCH 24/67] Fix tests --- .../PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php | 6 +++--- tests/PHPUnit/Button/Endpoint/CreateOrderEndpointTest.php | 1 + tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php b/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php index 54be500fc..a693bbb7b 100644 --- a/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php +++ b/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php @@ -258,7 +258,7 @@ class PurchaseUnitFactoryTest extends TestCase { $wcCustomer = Mockery::mock(\WC_Customer::class); expect('WC') - ->andReturn((object) ['customer' => $wcCustomer]); + ->andReturn((object) ['customer' => $wcCustomer, 'session' => null]); $wcCart = Mockery::mock(\WC_Cart::class); $amount = Mockery::mock(Amount::class); @@ -322,7 +322,7 @@ class PurchaseUnitFactoryTest extends TestCase public function testWcCartShippingGetsDroppendWhenNoCustomer() { expect('WC') - ->andReturn((object) ['customer' => null]); + ->andReturn((object) ['customer' => null, 'session' => null]); $wcCart = Mockery::mock(\WC_Cart::class); $amount = Mockery::mock(Amount::class); @@ -360,7 +360,7 @@ class PurchaseUnitFactoryTest extends TestCase public function testWcCartShippingGetsDroppendWhenNoCountryCode() { expect('WC') - ->andReturn((object) ['customer' => Mockery::mock(\WC_Customer::class)]); + ->andReturn((object) ['customer' => Mockery::mock(\WC_Customer::class), 'session' => null]); $wcCart = Mockery::mock(\WC_Cart::class); $amount = Mockery::mock(Amount::class); diff --git a/tests/PHPUnit/Button/Endpoint/CreateOrderEndpointTest.php b/tests/PHPUnit/Button/Endpoint/CreateOrderEndpointTest.php index d2fc1a4fa..79f80de3f 100644 --- a/tests/PHPUnit/Button/Endpoint/CreateOrderEndpointTest.php +++ b/tests/PHPUnit/Button/Endpoint/CreateOrderEndpointTest.php @@ -169,6 +169,7 @@ class CreateOrderEndpointTest extends TestCase false, ['checkout'], false, + ['paypal'], new NullLogger() ); return array($payer_factory, $testee); diff --git a/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php b/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php index cfe7a2eec..a5a1dea3e 100644 --- a/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php +++ b/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php @@ -5,6 +5,8 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Gateway; use Psr\Log\LoggerInterface; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; +use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; use WooCommerce\PayPalCommerce\Onboarding\Environment; use WooCommerce\PayPalCommerce\Onboarding\State; use WooCommerce\PayPalCommerce\Session\SessionHandler; @@ -75,6 +77,11 @@ class WcGatewayTest extends TestCase ->andReturnUsing(function () { return $this->fundingSource; }); + $order = Mockery::mock(Order::class); + $order->shouldReceive('status')->andReturn(new OrderStatus(OrderStatus::APPROVED)); + $this->sessionHandler + ->shouldReceive('order') + ->andReturn($order); $this->settings->shouldReceive('has')->andReturnFalse(); From ffff0639988b45072906a26f45c1e4132ea86a05 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 16:05:44 +0300 Subject: [PATCH 25/67] Refactor --- .../src/Handler/CheckoutOrderApproved.php | 12 ++++++------ .../src/Handler/CheckoutOrderCompleted.php | 2 +- .../src/Handler/CheckoutPaymentApprovalReversed.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php index f7a8d8f27..f1735348c 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php @@ -135,14 +135,14 @@ class CheckoutOrderApproved implements RequestHandler { $wc_orders = array(); - $custom_ids = $this->get_wc_order_ids_from_request( $request ); - if ( empty( $custom_ids ) ) { - $custom_ids = $this->get_wc_customer_ids_from_request( $request ); - if ( empty( $custom_ids ) ) { + $wc_order_ids = $this->get_wc_order_ids_from_request( $request ); + if ( empty( $wc_order_ids ) ) { + $customer_ids = $this->get_wc_customer_ids_from_request( $request ); + if ( empty( $customer_ids ) ) { return $this->no_custom_ids_response( $request ); } - $customer_id = $custom_ids[0]; + $customer_id = $customer_ids[0]; $wc_session = new WC_Session_Handler(); @@ -200,7 +200,7 @@ class CheckoutOrderApproved implements RequestHandler { } ); } else { - $wc_orders = $this->get_wc_orders_from_custom_ids( $custom_ids ); + $wc_orders = $this->get_wc_orders_from_custom_ids( $wc_order_ids ); if ( ! $wc_orders ) { return $this->no_wc_orders_response( $request ); } diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php index a175bec3e..6bf897720 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php @@ -67,7 +67,7 @@ class CheckoutOrderCompleted implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $custom_ids = $this->get_custom_ids_from_request( $request ); + $custom_ids = $this->get_wc_order_ids_from_request( $request ); if ( empty( $custom_ids ) ) { return $this->no_custom_ids_response( $request ); } diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php index 56ed1ec11..168d76382 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutPaymentApprovalReversed.php @@ -66,7 +66,7 @@ class CheckoutPaymentApprovalReversed implements RequestHandler { * @return WP_REST_Response */ public function handle_request( WP_REST_Request $request ): WP_REST_Response { - $custom_ids = $this->get_custom_ids_from_request( $request ); + $custom_ids = $this->get_wc_order_ids_from_request( $request ); if ( empty( $custom_ids ) ) { return $this->no_custom_ids_response( $request ); } From 8de593018f73b209e54bea9206730d8fef53c24f Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 14 Jun 2023 16:32:26 +0300 Subject: [PATCH 26/67] Log already completed order --- .../ppcp-webhooks/src/Handler/CheckoutOrderApproved.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php index f1735348c..60b51b513 100644 --- a/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php +++ b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php @@ -129,10 +129,6 @@ class CheckoutOrderApproved implements RequestHandler { $order = $this->order_endpoint->order( $order_id ); - if ( $order->status()->is( OrderStatus::COMPLETED ) ) { - return $this->success_response(); - } - $wc_orders = array(); $wc_order_ids = $this->get_wc_order_ids_from_request( $request ); @@ -144,6 +140,11 @@ class CheckoutOrderApproved implements RequestHandler { $customer_id = $customer_ids[0]; + if ( $order->status()->is( OrderStatus::COMPLETED ) ) { + $this->logger->info( "Order {$order->id()} already completed." ); + return $this->success_response(); + } + $wc_session = new WC_Session_Handler(); $session_data = $wc_session->get_session( $customer_id ); From c97df85c570d8256bcbc20f47721bfa78b2e5a54 Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 15 Jun 2023 10:01:05 +0300 Subject: [PATCH 27/67] Fix code duplication --- .../src/Checkout/DisableGateways.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php index bbd9b30d3..1d297c4e9 100644 --- a/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php +++ b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Checkout; +use WooCommerce\PayPalCommerce\Button\Helper\ContextTrait; use WooCommerce\PayPalCommerce\Session\SessionHandler; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CardButtonGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway; @@ -20,6 +21,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; * Class DisableGateways */ class DisableGateways { + use ContextTrait; /** * The Session Handler. @@ -124,20 +126,6 @@ class DisableGateways { * @return bool */ private function needs_to_disable_gateways(): bool { - $order = $this->session_handler->order(); - if ( ! $order ) { - return false; - } - - $source = $order->payment_source(); - if ( $source && $source->card() ) { - return false; // DCC. - } - - if ( 'card' === $this->session_handler->funding_source() ) { - return false; // Card buttons. - } - - return true; + return $this->is_paypal_continuation(); } } From 356fc386982e42dd3c8bb92facdcab58e87696d0 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 15 Jun 2023 11:39:29 +0200 Subject: [PATCH 28/67] Use api currency service --- modules/ppcp-wc-gateway/services.php | 4 +-- .../Notice/UnsupportedCurrencyAdminNotice.php | 25 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 069b8c539..de4b6ee63 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -211,9 +211,9 @@ return array( }, 'wcgateway.notice.currency-unsupported' => static function ( ContainerInterface $container ): UnsupportedCurrencyAdminNotice { $state = $container->get( 'onboarding.state' ); - $settings = $container->get( 'wcgateway.settings' ); + $shop_currency = $container->get( 'api.shop.currency' ); $supported_currencies = $container->get( 'api.supported-currencies' ); - return new UnsupportedCurrencyAdminNotice( $state, $settings, $supported_currencies ); + return new UnsupportedCurrencyAdminNotice( $state, $shop_currency, $supported_currencies ); }, 'wcgateway.notice.dcc-without-paypal' => static function ( ContainerInterface $container ): GatewayWithoutPayPalAdminNotice { return new GatewayWithoutPayPalAdminNotice( diff --git a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php index 89c177b01..1f8b3b98f 100644 --- a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php +++ b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php @@ -26,12 +26,6 @@ class UnsupportedCurrencyAdminNotice { */ private $state; - /** - * The settings. - * - * @var ContainerInterface - */ - private $settings; /** * The supported currencies. * @@ -39,16 +33,23 @@ class UnsupportedCurrencyAdminNotice { */ private $supported_currencies; + /** + * The shop currency. + * + * @var string + */ + private $shop_currency; + /** * ConnectAdminNotice constructor. * - * @param State $state The state. - * @param ContainerInterface $settings The settings. - * @param array $supported_currencies The supported currencies. + * @param State $state The state. + * @param string $shop_currency The shop currency. + * @param array $supported_currencies The supported currencies. */ - public function __construct( State $state, ContainerInterface $settings, array $supported_currencies ) { + public function __construct( State $state, string $shop_currency, array $supported_currencies ) { $this->state = $state; - $this->settings = $settings; + $this->shop_currency = $shop_currency; $this->supported_currencies = $supported_currencies; } @@ -88,7 +89,7 @@ class UnsupportedCurrencyAdminNotice { * @return bool */ private function currency_supported(): bool { - $currency = get_woocommerce_currency(); + $currency = $this->shop_currency; $supported_currencies = $this->supported_currencies; return in_array( $currency, $supported_currencies, true ); } From 9b697ddaa2fc82d35f374d07a06fa091b9ec2da6 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 19 Jun 2023 08:12:32 +0200 Subject: [PATCH 29/67] Add currency to message line --- .../src/Notice/UnsupportedCurrencyAdminNotice.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php index 1f8b3b98f..3da5a3b6f 100644 --- a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php +++ b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php @@ -64,11 +64,12 @@ class UnsupportedCurrencyAdminNotice { } $message = sprintf( - /* translators: %1$s the gateway name. */ + /* translators: %1$s the shop currency, 2$s the gateway name. */ __( - 'Attention: Your current WooCommerce store currency is not supported by PayPal. Please update your store currency to one that is supported by PayPal to ensure smooth transactions. Visit the PayPal currency support page for more information on supported currencies.', + 'Attention: Your current WooCommerce store currency (%1$s) is not supported by PayPal. Please update your store currency to one that is supported by PayPal to ensure smooth transactions. Visit the PayPal currency support page for more information on supported currencies.', 'woocommerce-paypal-payments' ), + $this->shop_currency, 'https://developer.paypal.com/api/rest/reference/currency-codes/' ); return new Message( $message, 'warning' ); From a87748e44ce4907edf51f2ba604a0f26e285c245 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 19 Jun 2023 09:27:37 +0300 Subject: [PATCH 30/67] Fix phpdoc --- .../src/Notice/UnsupportedCurrencyAdminNotice.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php index 3da5a3b6f..27ef14f79 100644 --- a/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php +++ b/modules/ppcp-wc-gateway/src/Notice/UnsupportedCurrencyAdminNotice.php @@ -1,6 +1,6 @@ Date: Thu, 22 Jun 2023 14:55:25 +0200 Subject: [PATCH 31/67] Add initalized flag to prevent migration run multiple times --- .../assets/js/paypal-subscription.js | 2 ++ .../assets/js/paypal-subscription.js.LICENSE.txt | 1 + .../assets/js/paypal-subscription.js.map | 1 + modules/ppcp-vaulting/src/VaultingModule.php | 15 +++++---------- 4 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js create mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt create mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js.map diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js b/modules/ppcp-subscription/assets/js/paypal-subscription.js new file mode 100644 index 000000000..b6bcd78d8 --- /dev/null +++ b/modules/ppcp-subscription/assets/js/paypal-subscription.js @@ -0,0 +1,2 @@ +(()=>{var t={9662:(t,r,e)=>{var n=e(614),o=e(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},9483:(t,r,e)=>{var n=e(4411),o=e(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a constructor")}},6077:(t,r,e)=>{var n=e(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},5787:(t,r,e)=>{var n=e(7976),o=TypeError;t.exports=function(t,r){if(n(r,t))return t;throw o("Incorrect invocation")}},9670:(t,r,e)=>{var n=e(111),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},1318:(t,r,e)=>{var n=e(5656),o=e(1400),i=e(6244),a=function(t){return function(r,e,a){var c,u=n(r),s=i(u),f=o(a,s);if(t&&e!=e){for(;s>f;)if((c=u[f++])!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},206:(t,r,e)=>{var n=e(1702);t.exports=n([].slice)},7072:(t,r,e)=>{var n=e(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var e=!1;try{var i={};i[n]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(t){}return e}},4326:(t,r,e)=>{var n=e(1702),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,r,e)=>{var n=e(1694),o=e(614),i=e(4326),a=e(5112)("toStringTag"),c=Object,u="Arguments"==i(function(){return arguments}());t.exports=n?i:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=c(t),a))?e:u?i(r):"Object"==(n=i(r))&&o(r.callee)?"Arguments":n}},9920:(t,r,e)=>{var n=e(2597),o=e(3887),i=e(1236),a=e(3070);t.exports=function(t,r,e){for(var c=o(r),u=a.f,s=i.f,f=0;f{var n=e(9781),o=e(3070),i=e(9114);t.exports=n?function(t,r,e){return o.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},9114:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},7045:(t,r,e)=>{var n=e(6339),o=e(3070);t.exports=function(t,r,e){return e.get&&n(e.get,r,{getter:!0}),e.set&&n(e.set,r,{setter:!0}),o.f(t,r,e)}},8052:(t,r,e)=>{var n=e(614),o=e(3070),i=e(6339),a=e(3072);t.exports=function(t,r,e,c){c||(c={});var u=c.enumerable,s=void 0!==c.name?c.name:r;if(n(e)&&i(e,s,c),c.global)u?t[r]=e:a(r,e);else{try{c.unsafe?t[r]&&(u=!0):delete t[r]}catch(t){}u?t[r]=e:o.f(t,r,{value:e,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},3072:(t,r,e)=>{var n=e(7854),o=Object.defineProperty;t.exports=function(t,r){try{o(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},9781:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:t=>{var r="object"==typeof document&&document.all,e=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:e}},317:(t,r,e)=>{var n=e(7854),o=e(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},7871:(t,r,e)=>{var n=e(3823),o=e(5268);t.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},3823:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1528:(t,r,e)=>{var n=e(8113);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},6833:(t,r,e)=>{var n=e(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,r,e)=>{var n=e(4326);t.exports="undefined"!=typeof process&&"process"==n(process)},1036:(t,r,e)=>{var n=e(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:(t,r,e)=>{var n,o,i=e(7854),a=e(8113),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1060:(t,r,e)=>{var n=e(1702),o=Error,i=n("".replace),a=String(o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(a);t.exports=function(t,r){if(u&&"string"==typeof t&&!o.prepareStackTrace)for(;r--;)t=i(t,c,"");return t}},5392:(t,r,e)=>{var n=e(8880),o=e(1060),i=e(2914),a=Error.captureStackTrace;t.exports=function(t,r,e,c){i&&(a?a(t,r):n(t,"stack",o(e,c)))}},2914:(t,r,e)=>{var n=e(7293),o=e(9114);t.exports=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},2109:(t,r,e)=>{var n=e(7854),o=e(1236).f,i=e(8880),a=e(8052),c=e(3072),u=e(9920),s=e(4705);t.exports=function(t,r){var e,f,p,l,v,d=t.target,y=t.global,h=t.stat;if(e=y?n:h?n[d]||c(d,{}):(n[d]||{}).prototype)for(f in r){if(l=r[f],p=t.dontCallGetSet?(v=o(e,f))&&v.value:e[f],!s(y?f:d+(h?".":"#")+f,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;u(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),a(e,f,l,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:(t,r,e)=>{var n=e(4374),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:(t,r,e)=>{var n=e(1470),o=e(9662),i=e(4374),a=n(n.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?a(t,r):function(){return t.apply(r,arguments)}}},4374:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,r,e)=>{var n=e(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,r,e)=>{var n=e(9781),o=e(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},5668:(t,r,e)=>{var n=e(1702),o=e(9662);t.exports=function(t,r,e){try{return n(o(Object.getOwnPropertyDescriptor(t,r)[e]))}catch(t){}}},1470:(t,r,e)=>{var n=e(4326),o=e(1702);t.exports=function(t){if("Function"===n(t))return o(t)}},1702:(t,r,e)=>{var n=e(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},5005:(t,r,e)=>{var n=e(7854),o=e(614);t.exports=function(t,r){return arguments.length<2?(e=n[t],o(e)?e:void 0):n[t]&&n[t][r];var e}},1246:(t,r,e)=>{var n=e(648),o=e(8173),i=e(8554),a=e(7497),c=e(5112)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||a[n(t)]}},4121:(t,r,e)=>{var n=e(6916),o=e(9662),i=e(9670),a=e(6330),c=e(1246),u=TypeError;t.exports=function(t,r){var e=arguments.length<2?c(t):r;if(o(e))return i(n(e,t));throw u(a(t)+" is not iterable")}},8044:(t,r,e)=>{var n=e(1702),o=e(3157),i=e(614),a=e(4326),c=e(1340),u=n([].push);t.exports=function(t){if(i(t))return t;if(o(t)){for(var r=t.length,e=[],n=0;n{var n=e(9662),o=e(8554);t.exports=function(t,r){var e=t[r];return o(e)?void 0:n(e)}},7854:function(t,r,e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e.g&&e.g)||function(){return this}()||this||Function("return this")()},2597:(t,r,e)=>{var n=e(1702),o=e(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},3501:t=>{t.exports={}},842:t=>{t.exports=function(t,r){try{1==arguments.length?console.error(t):console.error(t,r)}catch(t){}}},490:(t,r,e)=>{var n=e(5005);t.exports=n("document","documentElement")},4664:(t,r,e)=>{var n=e(9781),o=e(7293),i=e(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(4326),a=Object,c=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):a(t)}:a},9587:(t,r,e)=>{var n=e(614),o=e(111),i=e(7674);t.exports=function(t,r,e){var a,c;return i&&n(a=r.constructor)&&a!==e&&o(c=a.prototype)&&c!==e.prototype&&i(t,c),t}},2788:(t,r,e)=>{var n=e(1702),o=e(614),i=e(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},8340:(t,r,e)=>{var n=e(111),o=e(8880);t.exports=function(t,r){n(r)&&"cause"in r&&o(t,"cause",r.cause)}},9909:(t,r,e)=>{var n,o,i,a=e(4811),c=e(7854),u=e(111),s=e(8880),f=e(2597),p=e(5465),l=e(6200),v=e(3501),d="Object already initialized",y=c.TypeError,h=c.WeakMap;if(a||p.state){var m=p.state||(p.state=new h);m.get=m.get,m.has=m.has,m.set=m.set,n=function(t,r){if(m.has(t))throw y(d);return r.facade=t,m.set(t,r),r},o=function(t){return m.get(t)||{}},i=function(t){return m.has(t)}}else{var b=l("state");v[b]=!0,n=function(t,r){if(f(t,b))throw y(d);return r.facade=t,s(t,b,r),r},o=function(t){return f(t,b)?t[b]:{}},i=function(t){return f(t,b)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!u(r)||(e=o(r)).type!==t)throw y("Incompatible receiver, "+t+" required");return e}}}},7659:(t,r,e)=>{var n=e(5112),o=e(7497),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},3157:(t,r,e)=>{var n=e(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},614:(t,r,e)=>{var n=e(4154),o=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4411:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(614),a=e(648),c=e(5005),u=e(2788),s=function(){},f=[],p=c("Reflect","construct"),l=/^\s*(?:class|function)\b/,v=n(l.exec),d=!l.exec(s),y=function(t){if(!i(t))return!1;try{return p(s,f,t),!0}catch(t){return!1}},h=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!v(l,u(t))}catch(t){return!0}};h.sham=!0,t.exports=!p||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?h:y},4705:(t,r,e)=>{var n=e(7293),o=e(614),i=/#|\.prototype\./,a=function(t,r){var e=u[c(t)];return e==f||e!=s&&(o(r)?n(r):!!r)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},8554:t=>{t.exports=function(t){return null==t}},111:(t,r,e)=>{var n=e(614),o=e(4154),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===i}:function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,r,e)=>{var n=e(5005),o=e(614),i=e(7976),a=e(3307),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var r=n("Symbol");return o(r)&&i(r.prototype,c(t))}},408:(t,r,e)=>{var n=e(9974),o=e(6916),i=e(9670),a=e(6330),c=e(7659),u=e(6244),s=e(7976),f=e(4121),p=e(1246),l=e(9212),v=TypeError,d=function(t,r){this.stopped=t,this.result=r},y=d.prototype;t.exports=function(t,r,e){var h,m,b,g,x,S,w,j=e&&e.that,E=!(!e||!e.AS_ENTRIES),O=!(!e||!e.IS_RECORD),P=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),_=n(r,j),C=function(t){return h&&l(h,"normal",t),new d(!0,t)},R=function(t){return E?(i(t),T?_(t[0],t[1],C):_(t[0],t[1])):T?_(t,C):_(t)};if(O)h=t.iterator;else if(P)h=t;else{if(!(m=p(t)))throw v(a(t)+" is not iterable");if(c(m)){for(b=0,g=u(t);g>b;b++)if((x=R(t[b]))&&s(y,x))return x;return new d(!1)}h=f(t,m)}for(S=O?t.next:h.next;!(w=o(S,h)).done;){try{x=R(w.value)}catch(t){l(h,"throw",t)}if("object"==typeof x&&x&&s(y,x))return x}return new d(!1)}},9212:(t,r,e)=>{var n=e(6916),o=e(9670),i=e(8173);t.exports=function(t,r,e){var a,c;o(t);try{if(!(a=i(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(t){c=!0,a=t}if("throw"===r)throw e;if(c)throw a;return o(a),e}},7497:t=>{t.exports={}},6244:(t,r,e)=>{var n=e(7466);t.exports=function(t){return n(t.length)}},6339:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(614),a=e(2597),c=e(9781),u=e(6530).CONFIGURABLE,s=e(2788),f=e(9909),p=f.enforce,l=f.get,v=String,d=Object.defineProperty,y=n("".slice),h=n("".replace),m=n([].join),b=c&&!o((function(){return 8!==d((function(){}),"length",{value:8}).length})),g=String(String).split("String"),x=t.exports=function(t,r,e){"Symbol("===y(v(r),0,7)&&(r="["+h(v(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!a(t,"name")||u&&t.name!==r)&&(c?d(t,"name",{value:r,configurable:!0}):t.name=r),b&&e&&a(e,"arity")&&t.length!==e.arity&&d(t,"length",{value:e.arity});try{e&&a(e,"constructor")&&e.constructor?c&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=p(t);return a(n,"source")||(n.source=m(g,"string"==typeof r?r:"")),t};Function.prototype.toString=x((function(){return i(this)&&l(this).source||s(this)}),"toString")},4758:t=>{var r=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?e:r)(n)}},5948:(t,r,e)=>{var n,o,i,a,c,u=e(7854),s=e(9974),f=e(1236).f,p=e(261).set,l=e(8572),v=e(6833),d=e(1528),y=e(1036),h=e(5268),m=u.MutationObserver||u.WebKitMutationObserver,b=u.document,g=u.process,x=u.Promise,S=f(u,"queueMicrotask"),w=S&&S.value;if(!w){var j=new l,E=function(){var t,r;for(h&&(t=g.domain)&&t.exit();r=j.get();)try{r()}catch(t){throw j.head&&n(),t}t&&t.enter()};v||h||y||!m||!b?!d&&x&&x.resolve?((a=x.resolve(void 0)).constructor=x,c=s(a.then,a),n=function(){c(E)}):h?n=function(){g.nextTick(E)}:(p=s(p,u),n=function(){p(E)}):(o=!0,i=b.createTextNode(""),new m(E).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),w=function(t){j.head||n(),j.add(t)}}t.exports=w},8523:(t,r,e)=>{"use strict";var n=e(9662),o=TypeError,i=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw o("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new i(t)}},6277:(t,r,e)=>{var n=e(1340);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:n(t)}},3070:(t,r,e)=>{var n=e(9781),o=e(4664),i=e(3353),a=e(9670),c=e(4948),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";r.f=n?i?function(t,r,e){if(a(t),r=c(r),a(e),"function"==typeof t&&"prototype"===r&&"value"in e&&v in e&&!e[v]){var n=f(t,r);n&&n[v]&&(t[r]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(t,r,e)}:s:function(t,r,e){if(a(t),r=c(r),a(e),o)try{return s(t,r,e)}catch(t){}if("get"in e||"set"in e)throw u("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},1236:(t,r,e)=>{var n=e(9781),o=e(6916),i=e(5296),a=e(9114),c=e(5656),u=e(4948),s=e(2597),f=e(4664),p=Object.getOwnPropertyDescriptor;r.f=n?p:function(t,r){if(t=c(t),r=u(r),f)try{return p(t,r)}catch(t){}if(s(t,r))return a(!o(i.f,t,r),t[r])}},8006:(t,r,e)=>{var n=e(6324),o=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,r)=>{r.f=Object.getOwnPropertySymbols},7976:(t,r,e)=>{var n=e(1702);t.exports=n({}.isPrototypeOf)},6324:(t,r,e)=>{var n=e(1702),o=e(2597),i=e(5656),a=e(1318).indexOf,c=e(3501),u=n([].push);t.exports=function(t,r){var e,n=i(t),s=0,f=[];for(e in n)!o(c,e)&&o(n,e)&&u(f,e);for(;r.length>s;)o(n,e=r[s++])&&(~a(f,e)||u(f,e));return f}},5296:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!e.call({1:2},1);r.f=o?function(t){var r=n(this,t);return!!r&&r.enumerable}:e},7674:(t,r,e)=>{var n=e(5668),o=e(9670),i=e(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=n(Object.prototype,"__proto__","set"))(e,[]),r=e instanceof Array}catch(t){}return function(e,n){return o(e),i(n),r?t(e,n):e.__proto__=n,e}}():void 0)},288:(t,r,e)=>{"use strict";var n=e(1694),o=e(648);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,r,e)=>{var n=e(6916),o=e(614),i=e(111),a=TypeError;t.exports=function(t,r){var e,c;if("string"===r&&o(e=t.toString)&&!i(c=n(e,t)))return c;if(o(e=t.valueOf)&&!i(c=n(e,t)))return c;if("string"!==r&&o(e=t.toString)&&!i(c=n(e,t)))return c;throw a("Can't convert object to primitive value")}},3887:(t,r,e)=>{var n=e(5005),o=e(1702),i=e(8006),a=e(5181),c=e(9670),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var r=i.f(c(t)),e=a.f;return e?u(r,e(t)):r}},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},3702:(t,r,e)=>{var n=e(7854),o=e(2492),i=e(614),a=e(4705),c=e(2788),u=e(5112),s=e(7871),f=e(3823),p=e(1913),l=e(7392),v=o&&o.prototype,d=u("species"),y=!1,h=i(n.PromiseRejectionEvent),m=a("Promise",(function(){var t=c(o),r=t!==String(o);if(!r&&66===l)return!0;if(p&&(!v.catch||!v.finally))return!0;if(!l||l<51||!/native code/.test(t)){var e=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((e.constructor={})[d]=n,!(y=e.then((function(){}))instanceof n))return!0}return!r&&(s||f)&&!h}));t.exports={CONSTRUCTOR:m,REJECTION_EVENT:h,SUBCLASSING:y}},2492:(t,r,e)=>{var n=e(7854);t.exports=n.Promise},9478:(t,r,e)=>{var n=e(9670),o=e(111),i=e(8523);t.exports=function(t,r){if(n(t),o(r)&&r.constructor===t)return r;var e=i.f(t);return(0,e.resolve)(r),e.promise}},612:(t,r,e)=>{var n=e(2492),o=e(7072),i=e(3702).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},2626:(t,r,e)=>{var n=e(3070).f;t.exports=function(t,r,e){e in t||n(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})}},8572:t=>{var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null},e=this.tail;e?e.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=r},4488:(t,r,e)=>{var n=e(8554),o=TypeError;t.exports=function(t){if(n(t))throw o("Can't call method on "+t);return t}},6340:(t,r,e)=>{"use strict";var n=e(5005),o=e(7045),i=e(5112),a=e(9781),c=i("species");t.exports=function(t){var r=n(t);a&&r&&!r[c]&&o(r,c,{configurable:!0,get:function(){return this}})}},8003:(t,r,e)=>{var n=e(3070).f,o=e(2597),i=e(5112)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:r})}},6200:(t,r,e)=>{var n=e(2309),o=e(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,r,e)=>{var n=e(7854),o=e(3072),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,r,e)=>{var n=e(1913),o=e(5465);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.30.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:(t,r,e)=>{var n=e(9670),o=e(9483),i=e(8554),a=e(5112)("species");t.exports=function(t,r){var e,c=n(t).constructor;return void 0===c||i(e=n(c)[a])?r:o(e)}},6293:(t,r,e)=>{var n=e(7392),o=e(7293),i=e(7854).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},261:(t,r,e)=>{var n,o,i,a,c=e(7854),u=e(2104),s=e(9974),f=e(614),p=e(2597),l=e(7293),v=e(490),d=e(206),y=e(317),h=e(8053),m=e(6833),b=e(5268),g=c.setImmediate,x=c.clearImmediate,S=c.process,w=c.Dispatch,j=c.Function,E=c.MessageChannel,O=c.String,P=0,T={},_="onreadystatechange";l((function(){n=c.location}));var C=function(t){if(p(T,t)){var r=T[t];delete T[t],r()}},R=function(t){return function(){C(t)}},I=function(t){C(t.data)},k=function(t){c.postMessage(O(t),n.protocol+"//"+n.host)};g&&x||(g=function(t){h(arguments.length,1);var r=f(t)?t:j(t),e=d(arguments,1);return T[++P]=function(){u(r,void 0,e)},o(P),P},x=function(t){delete T[t]},b?o=function(t){S.nextTick(R(t))}:w&&w.now?o=function(t){w.now(R(t))}:E&&!m?(a=(i=new E).port2,i.port1.onmessage=I,o=s(a.postMessage,a)):c.addEventListener&&f(c.postMessage)&&!c.importScripts&&n&&"file:"!==n.protocol&&!l(k)?(o=k,c.addEventListener("message",I,!1)):o=_ in y("script")?function(t){v.appendChild(y("script"))[_]=function(){v.removeChild(this),C(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:g,clear:x}},1400:(t,r,e)=>{var n=e(9303),o=Math.max,i=Math.min;t.exports=function(t,r){var e=n(t);return e<0?o(e+r,0):i(e,r)}},5656:(t,r,e)=>{var n=e(8361),o=e(4488);t.exports=function(t){return n(o(t))}},9303:(t,r,e)=>{var n=e(4758);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},7466:(t,r,e)=>{var n=e(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,r,e)=>{var n=e(4488),o=Object;t.exports=function(t){return o(n(t))}},7593:(t,r,e)=>{var n=e(6916),o=e(111),i=e(2190),a=e(8173),c=e(2140),u=e(5112),s=TypeError,f=u("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var e,u=a(t,f);if(u){if(void 0===r&&(r="default"),e=n(u,t,r),!o(e)||i(e))return e;throw s("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},4948:(t,r,e)=>{var n=e(7593),o=e(2190);t.exports=function(t){var r=n(t,"string");return o(r)?r:r+""}},1694:(t,r,e)=>{var n={};n[e(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},1340:(t,r,e)=>{var n=e(648),o=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},9711:(t,r,e)=>{var n=e(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,r,e)=>{var n=e(6293);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,r,e)=>{var n=e(9781),o=e(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:t=>{var r=TypeError;t.exports=function(t,e){if(t{var n=e(7854),o=e(614),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},5112:(t,r,e)=>{var n=e(7854),o=e(2309),i=e(2597),a=e(9711),c=e(6293),u=e(3307),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return i(f,t)||(f[t]=c&&i(s,t)?s[t]:p("Symbol."+t)),f[t]}},9191:(t,r,e)=>{"use strict";var n=e(5005),o=e(2597),i=e(8880),a=e(7976),c=e(7674),u=e(9920),s=e(2626),f=e(9587),p=e(6277),l=e(8340),v=e(5392),d=e(9781),y=e(1913);t.exports=function(t,r,e,h){var m="stackTraceLimit",b=h?2:1,g=t.split("."),x=g[g.length-1],S=n.apply(null,g);if(S){var w=S.prototype;if(!y&&o(w,"cause")&&delete w.cause,!e)return S;var j=n("Error"),E=r((function(t,r){var e=p(h?r:t,void 0),n=h?new S(t):new S;return void 0!==e&&i(n,"message",e),v(n,E,n.stack,2),this&&a(w,this)&&f(n,this,E),arguments.length>b&&l(n,arguments[b]),n}));if(E.prototype=w,"Error"!==x?c?c(E,j):u(E,j,{name:!0}):d&&m in S&&(s(E,S,m),s(E,S,"prepareStackTrace")),u(E,S),!y)try{w.name!==x&&i(w,"name",x),w.constructor=E}catch(t){}return E}}},1703:(t,r,e)=>{var n=e(2109),o=e(7854),i=e(2104),a=e(9191),c="WebAssembly",u=o[c],s=7!==Error("e",{cause:7}).cause,f=function(t,r){var e={};e[t]=a(t,r,s),n({global:!0,constructor:!0,arity:1,forced:s},e)},p=function(t,r){if(u&&u[t]){var e={};e[t]=a(c+"."+t,r,s),n({target:c,stat:!0,constructor:!0,arity:1,forced:s},e)}};f("Error",(function(t){return function(r){return i(t,this,arguments)}})),f("EvalError",(function(t){return function(r){return i(t,this,arguments)}})),f("RangeError",(function(t){return function(r){return i(t,this,arguments)}})),f("ReferenceError",(function(t){return function(r){return i(t,this,arguments)}})),f("SyntaxError",(function(t){return function(r){return i(t,this,arguments)}})),f("TypeError",(function(t){return function(r){return i(t,this,arguments)}})),f("URIError",(function(t){return function(r){return i(t,this,arguments)}})),p("CompileError",(function(t){return function(r){return i(t,this,arguments)}})),p("LinkError",(function(t){return function(r){return i(t,this,arguments)}})),p("RuntimeError",(function(t){return function(r){return i(t,this,arguments)}}))},8862:(t,r,e)=>{var n=e(2109),o=e(5005),i=e(2104),a=e(6916),c=e(1702),u=e(7293),s=e(614),f=e(2190),p=e(206),l=e(8044),v=e(6293),d=String,y=o("JSON","stringify"),h=c(/./.exec),m=c("".charAt),b=c("".charCodeAt),g=c("".replace),x=c(1..toString),S=/[\uD800-\uDFFF]/g,w=/^[\uD800-\uDBFF]$/,j=/^[\uDC00-\uDFFF]$/,E=!v||u((function(){var t=o("Symbol")();return"[null]"!=y([t])||"{}"!=y({a:t})||"{}"!=y(Object(t))})),O=u((function(){return'"\\udf06\\ud834"'!==y("\udf06\ud834")||'"\\udead"'!==y("\udead")})),P=function(t,r){var e=p(arguments),n=l(r);if(s(n)||void 0!==t&&!f(t))return e[1]=function(t,r){if(s(n)&&(r=a(n,this,d(t),r)),!f(r))return r},i(y,null,e)},T=function(t,r,e){var n=m(e,r-1),o=m(e,r+1);return h(w,t)&&!h(j,o)||h(j,t)&&!h(w,n)?"\\u"+x(b(t,0),16):t};y&&n({target:"JSON",stat:!0,arity:3,forced:E||O},{stringify:function(t,r,e){var n=p(arguments),o=i(E?P:y,null,n);return O&&"string"==typeof o?g(o,S,T):o}})},1539:(t,r,e)=>{var n=e(1694),o=e(8052),i=e(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},821:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(9662),a=e(8523),c=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{all:function(t){var r=this,e=a.f(r),n=e.resolve,s=e.reject,f=c((function(){var e=i(r.resolve),a=[],c=0,f=1;u(t,(function(t){var i=c++,u=!1;f++,o(e,r,t).then((function(t){u||(u=!0,a[i]=t,--f||n(a))}),s)})),--f||n(a)}));return f.error&&s(f.value),e.promise}})},4164:(t,r,e)=>{"use strict";var n=e(2109),o=e(1913),i=e(3702).CONSTRUCTOR,a=e(2492),c=e(5005),u=e(614),s=e(8052),f=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&u(a)){var p=c("Promise").prototype.catch;f.catch!==p&&s(f,"catch",p,{unsafe:!0})}},3401:(t,r,e)=>{"use strict";var n,o,i,a=e(2109),c=e(1913),u=e(5268),s=e(7854),f=e(6916),p=e(8052),l=e(7674),v=e(8003),d=e(6340),y=e(9662),h=e(614),m=e(111),b=e(5787),g=e(6707),x=e(261).set,S=e(5948),w=e(842),j=e(2534),E=e(8572),O=e(9909),P=e(2492),T=e(3702),_=e(8523),C="Promise",R=T.CONSTRUCTOR,I=T.REJECTION_EVENT,k=T.SUBCLASSING,A=O.getterFor(C),D=O.set,N=P&&P.prototype,F=P,M=N,L=s.TypeError,U=s.document,B=s.process,G=_.f,z=G,q=!!(U&&U.createEvent&&s.dispatchEvent),J="unhandledrejection",W=function(t){var r;return!(!m(t)||!h(r=t.then))&&r},H=function(t,r){var e,n,o,i=r.value,a=1==r.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,p=t.domain;try{c?(a||(2===r.rejection&&Y(r),r.rejection=1),!0===c?e=i:(p&&p.enter(),e=c(i),p&&(p.exit(),o=!0)),e===t.promise?s(L("Promise-chain cycle")):(n=W(e))?f(n,e,u,s):u(e)):s(i)}catch(t){p&&!o&&p.exit(),s(t)}},V=function(t,r){t.notified||(t.notified=!0,S((function(){for(var e,n=t.reactions;e=n.get();)H(e,t);t.notified=!1,r&&!t.rejection&&K(t)})))},$=function(t,r,e){var n,o;q?((n=U.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),s.dispatchEvent(n)):n={promise:r,reason:e},!I&&(o=s["on"+t])?o(n):t===J&&w("Unhandled promise rejection",e)},K=function(t){f(x,s,(function(){var r,e=t.facade,n=t.value;if(X(t)&&(r=j((function(){u?B.emit("unhandledRejection",n,e):$(J,e,n)})),t.rejection=u||X(t)?2:1,r.error))throw r.value}))},X=function(t){return 1!==t.rejection&&!t.parent},Y=function(t){f(x,s,(function(){var r=t.facade;u?B.emit("rejectionHandled",r):$("rejectionhandled",r,t.value)}))},Q=function(t,r,e){return function(n){t(r,n,e)}},Z=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,V(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw L("Promise can't be resolved itself");var n=W(r);n?S((function(){var e={done:!1};try{f(n,r,Q(tt,e,t),Q(Z,e,t))}catch(r){Z(e,r,t)}})):(t.value=r,t.state=1,V(t,!1))}catch(r){Z({done:!1},r,t)}}};if(R&&(M=(F=function(t){b(this,M),y(t),f(n,this);var r=A(this);try{t(Q(tt,r),Q(Z,r))}catch(t){Z(r,t)}}).prototype,(n=function(t){D(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=p(M,"then",(function(t,r){var e=A(this),n=G(g(this,F));return e.parent=!0,n.ok=!h(t)||t,n.fail=h(r)&&r,n.domain=u?B.domain:void 0,0==e.state?e.reactions.add(n):S((function(){H(n,e)})),n.promise})),o=function(){var t=new n,r=A(t);this.promise=t,this.resolve=Q(tt,r),this.reject=Q(Z,r)},_.f=G=function(t){return t===F||void 0===t?new o(t):z(t)},!c&&h(P)&&N!==Object.prototype)){i=N.then,k||p(N,"then",(function(t,r){var e=this;return new F((function(t,r){f(i,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete N.constructor}catch(t){}l&&l(N,M)}a({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:F}),v(F,C,!1,!0),d(C)},8674:(t,r,e)=>{e(3401),e(821),e(4164),e(6027),e(683),e(6294)},6027:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(9662),a=e(8523),c=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{race:function(t){var r=this,e=a.f(r),n=e.reject,s=c((function(){var a=i(r.resolve);u(t,(function(t){o(a,r,t).then(e.resolve,n)}))}));return s.error&&n(s.value),e.promise}})},683:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(8523);n({target:"Promise",stat:!0,forced:e(3702).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},6294:(t,r,e)=>{"use strict";var n=e(2109),o=e(5005),i=e(1913),a=e(2492),c=e(3702).CONSTRUCTOR,u=e(9478),s=o("Promise"),f=i&&!c;n({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return u(f&&this===s?a:this,t)}})}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n].call(i.exports,i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";e(1539),e(8674),e(8862),e(1703),document.addEventListener("DOMContentLoaded",(function(){"yes"===PayPalCommerceGatewayPayPalSubscription.product_connected&&(document.querySelector("#_subscription_period_interval").setAttribute("disabled","disabled"),document.querySelector("#_subscription_period").setAttribute("disabled","disabled"),document.querySelector("._subscription_length_field").style.display="none",document.querySelector("._subscription_trial_length_field").style.display="none"),console.log("testing");var t=document.getElementById("ppcp_unlink_sub_plan");null==t||t.addEventListener("click",(function(r){r.preventDefault(),t.disabled=!0;var e=document.getElementById("spinner-unlink-plan");e.style.display="inline-block",fetch(PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.nonce,plan_id:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.plan_id,product_id:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.product_id})}).then((function(t){return t.json()})).then((function(r){if(!r.success)throw t.disabled=!1,e.style.display="none",console.error(r),Error(r.data.message);var n=document.getElementById("ppcp-enable-subscription"),o=document.getElementById("pcpp-product"),i=document.getElementById("pcpp-plan");n.style.display="none",o.style.display="none",i.style.display="none",document.getElementById("ppcp_enable_subscription_product").disabled=!0,document.getElementById("pcpp-plan-unlinked").style.display="block",setTimeout((function(){location.reload()}),1e3)}))}))}))})()})(); +//# sourceMappingURL=paypal-subscription.js.map \ No newline at end of file diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt b/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt new file mode 100644 index 000000000..ae386fb79 --- /dev/null +++ b/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt @@ -0,0 +1 @@ +/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js.map b/modules/ppcp-subscription/assets/js/paypal-subscription.js.map new file mode 100644 index 000000000..158fcc0db --- /dev/null +++ b/modules/ppcp-subscription/assets/js/paypal-subscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js/paypal-subscription.js","mappings":"4BAAA,IAAIA,EAAa,EAAQ,KACrBC,EAAc,EAAQ,MAEtBC,EAAaC,UAGjBC,EAAOC,QAAU,SAAUC,GACzB,GAAIN,EAAWM,GAAW,OAAOA,EACjC,MAAMJ,EAAWD,EAAYK,GAAY,qBAC3C,C,iBCTA,IAAIC,EAAgB,EAAQ,MACxBN,EAAc,EAAQ,MAEtBC,EAAaC,UAGjBC,EAAOC,QAAU,SAAUC,GACzB,GAAIC,EAAcD,GAAW,OAAOA,EACpC,MAAMJ,EAAWD,EAAYK,GAAY,wBAC3C,C,iBCTA,IAAIN,EAAa,EAAQ,KAErBQ,EAAUC,OACVP,EAAaC,UAEjBC,EAAOC,QAAU,SAAUC,GACzB,GAAuB,iBAAZA,GAAwBN,EAAWM,GAAW,OAAOA,EAChE,MAAMJ,EAAW,aAAeM,EAAQF,GAAY,kBACtD,C,iBCRA,IAAII,EAAgB,EAAQ,MAExBR,EAAaC,UAEjBC,EAAOC,QAAU,SAAUM,EAAIC,GAC7B,GAAIF,EAAcE,EAAWD,GAAK,OAAOA,EACzC,MAAMT,EAAW,uBACnB,C,iBCPA,IAAIW,EAAW,EAAQ,KAEnBL,EAAUC,OACVP,EAAaC,UAGjBC,EAAOC,QAAU,SAAUC,GACzB,GAAIO,EAASP,GAAW,OAAOA,EAC/B,MAAMJ,EAAWM,EAAQF,GAAY,oBACvC,C,iBCTA,IAAIQ,EAAkB,EAAQ,MAC1BC,EAAkB,EAAQ,MAC1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C,QAAU,OACxBlW,QAAQhJ,MAAMwL,GACR7G,MAAM6G,EAAKA,KAAKsN,SAG1B,IAAMyH,EAAqBjd,SAAS+b,eAAe,4BAC7CmB,EAAUld,SAAS+b,eAAe,gBAClCoB,EAAOnd,SAAS+b,eAAe,aACrCkB,EAAmBtB,MAAMC,QAAU,OACnCsB,EAAQvB,MAAMC,QAAU,OACxBuB,EAAKxB,MAAMC,QAAU,OAEe5b,SAAS+b,eAAe,oCAChCE,UAAW,EAElBjc,SAAS+b,eAAe,sBAChCJ,MAAMC,QAAU,QAE7B1I,YAAW,WACPpB,SAASsL,QACb,GAAG,IACP,GACJ,GACJ,G","sources":["webpack://ppcp-subscription/./node_modules/core-js/internals/a-callable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/a-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/a-possible-prototype.js","webpack://ppcp-subscription/./node_modules/core-js/internals/an-instance.js","webpack://ppcp-subscription/./node_modules/core-js/internals/an-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/array-includes.js","webpack://ppcp-subscription/./node_modules/core-js/internals/array-slice.js","webpack://ppcp-subscription/./node_modules/core-js/internals/check-correctness-of-iteration.js","webpack://ppcp-subscription/./node_modules/core-js/internals/classof-raw.js","webpack://ppcp-subscription/./node_modules/core-js/internals/classof.js","webpack://ppcp-subscription/./node_modules/core-js/internals/copy-constructor-properties.js","webpack://ppcp-subscription/./node_modules/core-js/internals/create-non-enumerable-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/create-property-descriptor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-built-in-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-global-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/descriptors.js","webpack://ppcp-subscription/./node_modules/core-js/internals/document-all.js","webpack://ppcp-subscription/./node_modules/core-js/internals/document-create-element.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-browser.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-deno.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-ios-pebble.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-ios.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-node.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-webos-webkit.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-user-agent.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-v8-version.js","webpack://ppcp-subscription/./node_modules/core-js/internals/enum-bug-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-clear.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-install.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-installable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/export.js","webpack://ppcp-subscription/./node_modules/core-js/internals/fails.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-apply.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-bind-context.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-bind-native.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-call.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-name.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this-clause.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-iterator-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-iterator.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-json-replacer-function.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/global.js","webpack://ppcp-subscription/./node_modules/core-js/internals/has-own-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/hidden-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/host-report-errors.js","webpack://ppcp-subscription/./node_modules/core-js/internals/html.js","webpack://ppcp-subscription/./node_modules/core-js/internals/ie8-dom-define.js","webpack://ppcp-subscription/./node_modules/core-js/internals/indexed-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/inherit-if-required.js","webpack://ppcp-subscription/./node_modules/core-js/internals/inspect-source.js","webpack://ppcp-subscription/./node_modules/core-js/internals/install-error-cause.js","webpack://ppcp-subscription/./node_modules/core-js/internals/internal-state.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-array-iterator-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-array.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-callable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-forced.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-null-or-undefined.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-pure.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-symbol.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterate.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterator-close.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterators.js","webpack://ppcp-subscription/./node_modules/core-js/internals/length-of-array-like.js","webpack://ppcp-subscription/./node_modules/core-js/internals/make-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/math-trunc.js","webpack://ppcp-subscription/./node_modules/core-js/internals/microtask.js","webpack://ppcp-subscription/./node_modules/core-js/internals/new-promise-capability.js","webpack://ppcp-subscription/./node_modules/core-js/internals/normalize-string-argument.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-define-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-names.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-is-prototype-of.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-keys-internal.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-property-is-enumerable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-set-prototype-of.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/ordinary-to-primitive.js","webpack://ppcp-subscription/./node_modules/core-js/internals/own-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/perform.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-constructor-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-native-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-resolve.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-statics-incorrect-iteration.js","webpack://ppcp-subscription/./node_modules/core-js/internals/proxy-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/queue.js","webpack://ppcp-subscription/./node_modules/core-js/internals/require-object-coercible.js","webpack://ppcp-subscription/./node_modules/core-js/internals/set-species.js","webpack://ppcp-subscription/./node_modules/core-js/internals/set-to-string-tag.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared-key.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared-store.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared.js","webpack://ppcp-subscription/./node_modules/core-js/internals/species-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/symbol-constructor-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/task.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-absolute-index.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-indexed-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-integer-or-infinity.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-length.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-primitive.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-property-key.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-string-tag-support.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/try-to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/uid.js","webpack://ppcp-subscription/./node_modules/core-js/internals/use-symbol-as-uid.js","webpack://ppcp-subscription/./node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://ppcp-subscription/./node_modules/core-js/internals/validate-arguments-length.js","webpack://ppcp-subscription/./node_modules/core-js/internals/weak-map-basic-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/well-known-symbol.js","webpack://ppcp-subscription/./node_modules/core-js/internals/wrap-error-constructor-with-cause.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.error.cause.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.json.stringify.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.object.to-string.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.all.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.catch.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.constructor.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.race.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.reject.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.resolve.js","webpack://ppcp-subscription/webpack/bootstrap","webpack://ppcp-subscription/webpack/runtime/compat get default export","webpack://ppcp-subscription/webpack/runtime/define property getters","webpack://ppcp-subscription/webpack/runtime/global","webpack://ppcp-subscription/webpack/runtime/hasOwnProperty shorthand","webpack://ppcp-subscription/./resources/js/paypal-subscription.js"],"sourcesContent":["var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","var isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw $TypeError('Incorrect invocation');\n};\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","var isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var IS_DENO = require('../internals/engine-is-deno');\nvar IS_NODE = require('../internals/engine-is-node');\n\nmodule.exports = !IS_DENO && !IS_NODE\n && typeof window == 'object'\n && typeof document == 'object';\n","/* global Deno -- Deno case */\nmodule.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';\n","var userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","var classof = require('../internals/classof-raw');\n\nmodule.exports = typeof process != 'undefined' && classof(process) == 'process';\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar clearErrorStack = require('../internals/error-stack-clear');\nvar ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');\n\n// non-standard V8\nvar captureStackTrace = Error.captureStackTrace;\n\nmodule.exports = function (error, C, stack, dropEntries) {\n if (ERROR_STACK_INSTALLABLE) {\n if (captureStackTrace) captureStackTrace(error, C);\n else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));\n }\n};\n","var fails = require('../internals/fails');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","var classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var classof = require('../internals/classof');\nvar getMethod = require('../internals/get-method');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n","var call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw $TypeError(tryToString(argument) + ' is not iterable');\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","var aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || this || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","module.exports = function (a, b) {\n try {\n // eslint-disable-next-line no-console -- safe\n arguments.length == 1 ? console.error(a) : console.error(a, b);\n } catch (error) { /* empty */ }\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","var $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","var isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = false;\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","var call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","module.exports = {};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","var global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var toString = require('../internals/to-string');\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","var global = require('../internals/global');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar isCallable = require('../internals/is-callable');\nvar isForced = require('../internals/is-forced');\nvar inspectSource = require('../internals/inspect-source');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_PURE = require('../internals/is-pure');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","var isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineBuiltInAccessor(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.30.2',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar bind = require('../internals/function-bind-context');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar fails = require('../internals/fails');\nvar html = require('../internals/html');\nvar arraySlice = require('../internals/array-slice');\nvar createElement = require('../internals/document-create-element');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\nfails(function () {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = global.location;\n});\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar eventListener = function (event) {\n run(event.data);\n};\n\nvar globalPostMessageDefer = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = eventListener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n isCallable(global.postMessage) &&\n !global.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(globalPostMessageDefer)\n ) {\n defer = globalPostMessageDefer;\n global.addEventListener('message', eventListener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar proxyAccessor = require('../internals/proxy-accessor');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar normalizeStringArgument = require('../internals/normalize-string-argument');\nvar installErrorCause = require('../internals/install-error-cause');\nvar installErrorStack = require('../internals/error-stack-install');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n installErrorStack(result, WrappedError, result.stack, 2);\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n","/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor-with-cause');\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\nvar FORCED = Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://tc39.es/ecma262/#sec-nativeerror\n// https://github.com/tc39/proposal-error-cause\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar IS_NODE = require('../internals/engine-is-node');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar perform = require('../internals/perform');\nvar Queue = require('../internals/queue');\nvar InternalStateModule = require('../internals/internal-state');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar PromiseConstructorDetection = require('../internals/promise-constructor-detection');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state == PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n","// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.promise.constructor');\nrequire('../modules/es.promise.all');\nrequire('../modules/es.promise.catch');\nrequire('../modules/es.promise.race');\nrequire('../modules/es.promise.reject');\nrequire('../modules/es.promise.resolve');\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar promiseResolve = require('../internals/promise-resolve');\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","document.addEventListener(\n 'DOMContentLoaded',\n () => {\n if(PayPalCommerceGatewayPayPalSubscription.product_connected === 'yes') {\n const periodInterval = document.querySelector('#_subscription_period_interval');\n periodInterval.setAttribute('disabled', 'disabled');\n\n const subscriptionPeriod = document.querySelector('#_subscription_period');\n subscriptionPeriod.setAttribute('disabled', 'disabled');\n\n const subscriptionLength = document.querySelector('._subscription_length_field');\n subscriptionLength.style.display = 'none';\n\n const subscriptionTrial = document.querySelector('._subscription_trial_length_field');\n subscriptionTrial.style.display = 'none';\n }\n\n console.log('testing')\n\n const unlinkBtn = document.getElementById('ppcp_unlink_sub_plan');\n unlinkBtn?.addEventListener('click', (event)=>{\n event.preventDefault();\n unlinkBtn.disabled = true;\n const spinner = document.getElementById('spinner-unlink-plan');\n spinner.style.display = 'inline-block';\n\n fetch(PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n credentials: 'same-origin',\n body: JSON.stringify({\n nonce: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.nonce,\n plan_id: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.plan_id,\n product_id: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.product_id\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n unlinkBtn.disabled = false;\n spinner.style.display = 'none';\n console.error(data);\n throw Error(data.data.message);\n }\n\n const enableSubscription = document.getElementById('ppcp-enable-subscription');\n const product = document.getElementById('pcpp-product');\n const plan = document.getElementById('pcpp-plan');\n enableSubscription.style.display = 'none';\n product.style.display = 'none';\n plan.style.display = 'none';\n\n const enable_subscription_product = document.getElementById('ppcp_enable_subscription_product');\n enable_subscription_product.disabled = true;\n\n const planUnlinked = document.getElementById('pcpp-plan-unlinked');\n planUnlinked.style.display = 'block';\n\n setTimeout(() => {\n location.reload();\n }, 1000)\n });\n });\n });\n"],"names":["isCallable","tryToString","$TypeError","TypeError","module","exports","argument","isConstructor","$String","String","isPrototypeOf","it","Prototype","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","value","O","length","index","includes","indexOf","uncurryThis","slice","ITERATOR","wellKnownSymbol","SAFE_CLOSING","called","iteratorWithReturn","next","done","this","Array","from","error","exec","SKIP_CLOSING","ITERATION_SUPPORT","object","toString","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","$Object","Object","CORRECT_ARGUMENTS","arguments","tag","result","undefined","key","tryGet","callee","hasOwn","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","target","source","exceptions","keys","defineProperty","f","getOwnPropertyDescriptor","i","DESCRIPTORS","createPropertyDescriptor","bitmap","enumerable","configurable","writable","makeBuiltIn","name","descriptor","get","getter","set","setter","defineGlobalProperty","options","simple","global","unsafe","nonConfigurable","nonWritable","fails","documentAll","document","all","IS_HTMLDDA","EXISTS","createElement","IS_DENO","IS_NODE","window","Deno","version","userAgent","test","Pebble","classof","process","navigator","match","versions","v8","split","$Error","Error","replace","TEST","stack","V8_OR_CHAKRA_STACK_ENTRY","IS_V8_OR_CHAKRA_STACK","dropEntries","prepareStackTrace","createNonEnumerableProperty","clearErrorStack","ERROR_STACK_INSTALLABLE","captureStackTrace","C","defineBuiltIn","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","prototype","dontCallGetSet","forced","sham","NATIVE_BIND","FunctionPrototype","Function","apply","call","Reflect","bind","aCallable","fn","that","hasOwnProperty","getDescriptor","PROPER","CONFIGURABLE","method","uncurryThisWithBind","namespace","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","isArray","push","replacer","rawLength","element","keysLength","root","j","V","P","func","check","Math","globalThis","self","g","toObject","a","b","console","getBuiltIn","propertyIsEnumerable","setPrototypeOf","dummy","Wrapper","NewTarget","NewTargetPrototype","constructor","store","functionToString","inspectSource","cause","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","state","metadata","facade","STATE","enforce","getterFor","TYPE","type","ArrayPrototype","$documentAll","noop","empty","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","toLowerCase","USE_SYMBOL_AS_UID","$Symbol","isArrayIteratorMethod","getIterator","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterator","iterFn","step","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","stop","condition","callFn","kind","innerResult","innerError","toLength","obj","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","join","CONFIGURABLE_LENGTH","TEMPLATE","arity","ceil","floor","trunc","x","n","notify","toggle","node","promise","then","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","MutationObserver","WebKitMutationObserver","Promise","queueMicrotaskDescriptor","microtask","queue","flush","parent","domain","exit","head","enter","resolve","nextTick","createTextNode","observe","characterData","add","PromiseCapability","reject","$$resolve","$$reject","$default","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","concat","getOwnPropertyNames","getOwnPropertySymbols","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","aPossiblePrototype","CORRECT_SETTER","proto","__proto__","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_BROWSER","IS_PURE","V8_VERSION","NativePromisePrototype","SPECIES","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","Target","Source","tail","item","entry","defineBuiltInAccessor","CONSTRUCTOR_NAME","Constructor","TAG","uid","SHARED","mode","copyright","license","aConstructor","defaultConstructor","S","symbol","Symbol","$location","defer","channel","port","html","arraySlice","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","MessageChannel","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","event","globalPostMessageDefer","postMessage","protocol","host","handler","args","now","port2","port1","onmessage","addEventListener","importScripts","appendChild","removeChild","setTimeout","toIntegerOrInfinity","max","min","integer","IndexedObject","requireObjectCoercible","number","isSymbol","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","postfix","random","NATIVE_SYMBOL","passed","required","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","proxyAccessor","inheritIfRequired","normalizeStringArgument","installErrorCause","installErrorStack","FULL_NAME","wrapper","FORCED","IS_AGGREGATE_ERROR","STACK_TRACE_LIMIT","OPTIONS_POSITION","path","ERROR_NAME","OriginalError","OriginalErrorPrototype","BaseError","WrappedError","message","$","wrapErrorConstructorWithCause","WEB_ASSEMBLY","WebAssembly","exportGlobalErrorCauseWrapper","exportWebAssemblyErrorCauseWrapper","init","getReplacerFunction","$stringify","charAt","charCodeAt","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","offset","prev","stringify","space","newPromiseCapabilityModule","perform","iterate","capability","$promiseResolve","values","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","setToStringTag","setSpecies","anInstance","speciesConstructor","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","setInternalState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","createEvent","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","emit","unwrap","internalReject","internalResolve","executor","onFulfilled","PromiseWrapper","wrap","race","r","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","o","e","prop","PayPalCommerceGatewayPayPalSubscription","product_connected","querySelector","setAttribute","style","display","log","unlinkBtn","getElementById","preventDefault","disabled","spinner","fetch","ajax","deactivate_plan","endpoint","headers","credentials","body","JSON","nonce","plan_id","product_id","res","json","success","enableSubscription","product","plan","reload"],"sourceRoot":""} \ No newline at end of file diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index 824f206e8..9e53dc81c 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -178,16 +178,6 @@ class VaultingModule implements ModuleInterface { } ); - add_action( - 'pcp_migrate_payment_tokens', - function() use ( $container ) { - $logger = $container->get( 'woocommerce.logger.woocommerce' ); - assert( $logger instanceof LoggerInterface ); - - $this->migrate_payment_tokens( $logger ); - } - ); - add_action( 'woocommerce_paypal_payments_payment_tokens_migration', function( int $customer_id ) use ( $container ) { @@ -218,6 +208,10 @@ class VaultingModule implements ModuleInterface { * @return void */ public function migrate_payment_tokens( LoggerInterface $logger ): void { + $initialized = get_option( 'ppcp_payment_tokens_migration_initialized', null ); + if ( $initialized ) { + return; + } // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_key // phpcs:disable WordPress.DB.SlowDBQuery.slow_db_query_meta_query $customers = new WP_User_Query( @@ -236,6 +230,7 @@ class VaultingModule implements ModuleInterface { } $logger->info( 'Starting payment tokens migration for ' . (string) count( $customers ) . ' users' ); + update_option( 'ppcp_payment_tokens_migration_initialized', true ); $interval_in_seconds = 5; $timestamp = time(); From 3cab410be0fd278d1f8718c9378fd388036d1db3 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Thu, 22 Jun 2023 14:56:33 +0200 Subject: [PATCH 32/67] Add initalized flag to prevent migration run multiple times --- modules/ppcp-subscription/.gitignore | 2 ++ modules/ppcp-subscription/assets/js/paypal-subscription.js | 2 -- .../assets/js/paypal-subscription.js.LICENSE.txt | 1 - modules/ppcp-subscription/assets/js/paypal-subscription.js.map | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 modules/ppcp-subscription/.gitignore delete mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js delete mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt delete mode 100644 modules/ppcp-subscription/assets/js/paypal-subscription.js.map diff --git a/modules/ppcp-subscription/.gitignore b/modules/ppcp-subscription/.gitignore new file mode 100644 index 000000000..265c2208c --- /dev/null +++ b/modules/ppcp-subscription/.gitignore @@ -0,0 +1,2 @@ +node_modules +assets diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js b/modules/ppcp-subscription/assets/js/paypal-subscription.js deleted file mode 100644 index b6bcd78d8..000000000 --- a/modules/ppcp-subscription/assets/js/paypal-subscription.js +++ /dev/null @@ -1,2 +0,0 @@ -(()=>{var t={9662:(t,r,e)=>{var n=e(614),o=e(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},9483:(t,r,e)=>{var n=e(4411),o=e(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a constructor")}},6077:(t,r,e)=>{var n=e(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},5787:(t,r,e)=>{var n=e(7976),o=TypeError;t.exports=function(t,r){if(n(r,t))return t;throw o("Incorrect invocation")}},9670:(t,r,e)=>{var n=e(111),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},1318:(t,r,e)=>{var n=e(5656),o=e(1400),i=e(6244),a=function(t){return function(r,e,a){var c,u=n(r),s=i(u),f=o(a,s);if(t&&e!=e){for(;s>f;)if((c=u[f++])!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},206:(t,r,e)=>{var n=e(1702);t.exports=n([].slice)},7072:(t,r,e)=>{var n=e(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var e=!1;try{var i={};i[n]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(t){}return e}},4326:(t,r,e)=>{var n=e(1702),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,r,e)=>{var n=e(1694),o=e(614),i=e(4326),a=e(5112)("toStringTag"),c=Object,u="Arguments"==i(function(){return arguments}());t.exports=n?i:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=c(t),a))?e:u?i(r):"Object"==(n=i(r))&&o(r.callee)?"Arguments":n}},9920:(t,r,e)=>{var n=e(2597),o=e(3887),i=e(1236),a=e(3070);t.exports=function(t,r,e){for(var c=o(r),u=a.f,s=i.f,f=0;f{var n=e(9781),o=e(3070),i=e(9114);t.exports=n?function(t,r,e){return o.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},9114:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},7045:(t,r,e)=>{var n=e(6339),o=e(3070);t.exports=function(t,r,e){return e.get&&n(e.get,r,{getter:!0}),e.set&&n(e.set,r,{setter:!0}),o.f(t,r,e)}},8052:(t,r,e)=>{var n=e(614),o=e(3070),i=e(6339),a=e(3072);t.exports=function(t,r,e,c){c||(c={});var u=c.enumerable,s=void 0!==c.name?c.name:r;if(n(e)&&i(e,s,c),c.global)u?t[r]=e:a(r,e);else{try{c.unsafe?t[r]&&(u=!0):delete t[r]}catch(t){}u?t[r]=e:o.f(t,r,{value:e,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},3072:(t,r,e)=>{var n=e(7854),o=Object.defineProperty;t.exports=function(t,r){try{o(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},9781:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:t=>{var r="object"==typeof document&&document.all,e=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:e}},317:(t,r,e)=>{var n=e(7854),o=e(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},7871:(t,r,e)=>{var n=e(3823),o=e(5268);t.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},3823:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1528:(t,r,e)=>{var n=e(8113);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},6833:(t,r,e)=>{var n=e(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,r,e)=>{var n=e(4326);t.exports="undefined"!=typeof process&&"process"==n(process)},1036:(t,r,e)=>{var n=e(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7392:(t,r,e)=>{var n,o,i=e(7854),a=e(8113),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1060:(t,r,e)=>{var n=e(1702),o=Error,i=n("".replace),a=String(o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(a);t.exports=function(t,r){if(u&&"string"==typeof t&&!o.prepareStackTrace)for(;r--;)t=i(t,c,"");return t}},5392:(t,r,e)=>{var n=e(8880),o=e(1060),i=e(2914),a=Error.captureStackTrace;t.exports=function(t,r,e,c){i&&(a?a(t,r):n(t,"stack",o(e,c)))}},2914:(t,r,e)=>{var n=e(7293),o=e(9114);t.exports=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},2109:(t,r,e)=>{var n=e(7854),o=e(1236).f,i=e(8880),a=e(8052),c=e(3072),u=e(9920),s=e(4705);t.exports=function(t,r){var e,f,p,l,v,d=t.target,y=t.global,h=t.stat;if(e=y?n:h?n[d]||c(d,{}):(n[d]||{}).prototype)for(f in r){if(l=r[f],p=t.dontCallGetSet?(v=o(e,f))&&v.value:e[f],!s(y?f:d+(h?".":"#")+f,t.forced)&&void 0!==p){if(typeof l==typeof p)continue;u(l,p)}(t.sham||p&&p.sham)&&i(l,"sham",!0),a(e,f,l,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:(t,r,e)=>{var n=e(4374),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:(t,r,e)=>{var n=e(1470),o=e(9662),i=e(4374),a=n(n.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?a(t,r):function(){return t.apply(r,arguments)}}},4374:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,r,e)=>{var n=e(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,r,e)=>{var n=e(9781),o=e(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},5668:(t,r,e)=>{var n=e(1702),o=e(9662);t.exports=function(t,r,e){try{return n(o(Object.getOwnPropertyDescriptor(t,r)[e]))}catch(t){}}},1470:(t,r,e)=>{var n=e(4326),o=e(1702);t.exports=function(t){if("Function"===n(t))return o(t)}},1702:(t,r,e)=>{var n=e(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},5005:(t,r,e)=>{var n=e(7854),o=e(614);t.exports=function(t,r){return arguments.length<2?(e=n[t],o(e)?e:void 0):n[t]&&n[t][r];var e}},1246:(t,r,e)=>{var n=e(648),o=e(8173),i=e(8554),a=e(7497),c=e(5112)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||a[n(t)]}},4121:(t,r,e)=>{var n=e(6916),o=e(9662),i=e(9670),a=e(6330),c=e(1246),u=TypeError;t.exports=function(t,r){var e=arguments.length<2?c(t):r;if(o(e))return i(n(e,t));throw u(a(t)+" is not iterable")}},8044:(t,r,e)=>{var n=e(1702),o=e(3157),i=e(614),a=e(4326),c=e(1340),u=n([].push);t.exports=function(t){if(i(t))return t;if(o(t)){for(var r=t.length,e=[],n=0;n{var n=e(9662),o=e(8554);t.exports=function(t,r){var e=t[r];return o(e)?void 0:n(e)}},7854:function(t,r,e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e.g&&e.g)||function(){return this}()||this||Function("return this")()},2597:(t,r,e)=>{var n=e(1702),o=e(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},3501:t=>{t.exports={}},842:t=>{t.exports=function(t,r){try{1==arguments.length?console.error(t):console.error(t,r)}catch(t){}}},490:(t,r,e)=>{var n=e(5005);t.exports=n("document","documentElement")},4664:(t,r,e)=>{var n=e(9781),o=e(7293),i=e(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(4326),a=Object,c=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?c(t,""):a(t)}:a},9587:(t,r,e)=>{var n=e(614),o=e(111),i=e(7674);t.exports=function(t,r,e){var a,c;return i&&n(a=r.constructor)&&a!==e&&o(c=a.prototype)&&c!==e.prototype&&i(t,c),t}},2788:(t,r,e)=>{var n=e(1702),o=e(614),i=e(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},8340:(t,r,e)=>{var n=e(111),o=e(8880);t.exports=function(t,r){n(r)&&"cause"in r&&o(t,"cause",r.cause)}},9909:(t,r,e)=>{var n,o,i,a=e(4811),c=e(7854),u=e(111),s=e(8880),f=e(2597),p=e(5465),l=e(6200),v=e(3501),d="Object already initialized",y=c.TypeError,h=c.WeakMap;if(a||p.state){var m=p.state||(p.state=new h);m.get=m.get,m.has=m.has,m.set=m.set,n=function(t,r){if(m.has(t))throw y(d);return r.facade=t,m.set(t,r),r},o=function(t){return m.get(t)||{}},i=function(t){return m.has(t)}}else{var b=l("state");v[b]=!0,n=function(t,r){if(f(t,b))throw y(d);return r.facade=t,s(t,b,r),r},o=function(t){return f(t,b)?t[b]:{}},i=function(t){return f(t,b)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!u(r)||(e=o(r)).type!==t)throw y("Incompatible receiver, "+t+" required");return e}}}},7659:(t,r,e)=>{var n=e(5112),o=e(7497),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},3157:(t,r,e)=>{var n=e(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},614:(t,r,e)=>{var n=e(4154),o=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4411:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(614),a=e(648),c=e(5005),u=e(2788),s=function(){},f=[],p=c("Reflect","construct"),l=/^\s*(?:class|function)\b/,v=n(l.exec),d=!l.exec(s),y=function(t){if(!i(t))return!1;try{return p(s,f,t),!0}catch(t){return!1}},h=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!v(l,u(t))}catch(t){return!0}};h.sham=!0,t.exports=!p||o((function(){var t;return y(y.call)||!y(Object)||!y((function(){t=!0}))||t}))?h:y},4705:(t,r,e)=>{var n=e(7293),o=e(614),i=/#|\.prototype\./,a=function(t,r){var e=u[c(t)];return e==f||e!=s&&(o(r)?n(r):!!r)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},8554:t=>{t.exports=function(t){return null==t}},111:(t,r,e)=>{var n=e(614),o=e(4154),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===i}:function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,r,e)=>{var n=e(5005),o=e(614),i=e(7976),a=e(3307),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var r=n("Symbol");return o(r)&&i(r.prototype,c(t))}},408:(t,r,e)=>{var n=e(9974),o=e(6916),i=e(9670),a=e(6330),c=e(7659),u=e(6244),s=e(7976),f=e(4121),p=e(1246),l=e(9212),v=TypeError,d=function(t,r){this.stopped=t,this.result=r},y=d.prototype;t.exports=function(t,r,e){var h,m,b,g,x,S,w,j=e&&e.that,E=!(!e||!e.AS_ENTRIES),O=!(!e||!e.IS_RECORD),P=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),_=n(r,j),C=function(t){return h&&l(h,"normal",t),new d(!0,t)},R=function(t){return E?(i(t),T?_(t[0],t[1],C):_(t[0],t[1])):T?_(t,C):_(t)};if(O)h=t.iterator;else if(P)h=t;else{if(!(m=p(t)))throw v(a(t)+" is not iterable");if(c(m)){for(b=0,g=u(t);g>b;b++)if((x=R(t[b]))&&s(y,x))return x;return new d(!1)}h=f(t,m)}for(S=O?t.next:h.next;!(w=o(S,h)).done;){try{x=R(w.value)}catch(t){l(h,"throw",t)}if("object"==typeof x&&x&&s(y,x))return x}return new d(!1)}},9212:(t,r,e)=>{var n=e(6916),o=e(9670),i=e(8173);t.exports=function(t,r,e){var a,c;o(t);try{if(!(a=i(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(t){c=!0,a=t}if("throw"===r)throw e;if(c)throw a;return o(a),e}},7497:t=>{t.exports={}},6244:(t,r,e)=>{var n=e(7466);t.exports=function(t){return n(t.length)}},6339:(t,r,e)=>{var n=e(1702),o=e(7293),i=e(614),a=e(2597),c=e(9781),u=e(6530).CONFIGURABLE,s=e(2788),f=e(9909),p=f.enforce,l=f.get,v=String,d=Object.defineProperty,y=n("".slice),h=n("".replace),m=n([].join),b=c&&!o((function(){return 8!==d((function(){}),"length",{value:8}).length})),g=String(String).split("String"),x=t.exports=function(t,r,e){"Symbol("===y(v(r),0,7)&&(r="["+h(v(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!a(t,"name")||u&&t.name!==r)&&(c?d(t,"name",{value:r,configurable:!0}):t.name=r),b&&e&&a(e,"arity")&&t.length!==e.arity&&d(t,"length",{value:e.arity});try{e&&a(e,"constructor")&&e.constructor?c&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=p(t);return a(n,"source")||(n.source=m(g,"string"==typeof r?r:"")),t};Function.prototype.toString=x((function(){return i(this)&&l(this).source||s(this)}),"toString")},4758:t=>{var r=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?e:r)(n)}},5948:(t,r,e)=>{var n,o,i,a,c,u=e(7854),s=e(9974),f=e(1236).f,p=e(261).set,l=e(8572),v=e(6833),d=e(1528),y=e(1036),h=e(5268),m=u.MutationObserver||u.WebKitMutationObserver,b=u.document,g=u.process,x=u.Promise,S=f(u,"queueMicrotask"),w=S&&S.value;if(!w){var j=new l,E=function(){var t,r;for(h&&(t=g.domain)&&t.exit();r=j.get();)try{r()}catch(t){throw j.head&&n(),t}t&&t.enter()};v||h||y||!m||!b?!d&&x&&x.resolve?((a=x.resolve(void 0)).constructor=x,c=s(a.then,a),n=function(){c(E)}):h?n=function(){g.nextTick(E)}:(p=s(p,u),n=function(){p(E)}):(o=!0,i=b.createTextNode(""),new m(E).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),w=function(t){j.head||n(),j.add(t)}}t.exports=w},8523:(t,r,e)=>{"use strict";var n=e(9662),o=TypeError,i=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw o("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new i(t)}},6277:(t,r,e)=>{var n=e(1340);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:n(t)}},3070:(t,r,e)=>{var n=e(9781),o=e(4664),i=e(3353),a=e(9670),c=e(4948),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",v="writable";r.f=n?i?function(t,r,e){if(a(t),r=c(r),a(e),"function"==typeof t&&"prototype"===r&&"value"in e&&v in e&&!e[v]){var n=f(t,r);n&&n[v]&&(t[r]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(t,r,e)}:s:function(t,r,e){if(a(t),r=c(r),a(e),o)try{return s(t,r,e)}catch(t){}if("get"in e||"set"in e)throw u("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},1236:(t,r,e)=>{var n=e(9781),o=e(6916),i=e(5296),a=e(9114),c=e(5656),u=e(4948),s=e(2597),f=e(4664),p=Object.getOwnPropertyDescriptor;r.f=n?p:function(t,r){if(t=c(t),r=u(r),f)try{return p(t,r)}catch(t){}if(s(t,r))return a(!o(i.f,t,r),t[r])}},8006:(t,r,e)=>{var n=e(6324),o=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,r)=>{r.f=Object.getOwnPropertySymbols},7976:(t,r,e)=>{var n=e(1702);t.exports=n({}.isPrototypeOf)},6324:(t,r,e)=>{var n=e(1702),o=e(2597),i=e(5656),a=e(1318).indexOf,c=e(3501),u=n([].push);t.exports=function(t,r){var e,n=i(t),s=0,f=[];for(e in n)!o(c,e)&&o(n,e)&&u(f,e);for(;r.length>s;)o(n,e=r[s++])&&(~a(f,e)||u(f,e));return f}},5296:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!e.call({1:2},1);r.f=o?function(t){var r=n(this,t);return!!r&&r.enumerable}:e},7674:(t,r,e)=>{var n=e(5668),o=e(9670),i=e(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=n(Object.prototype,"__proto__","set"))(e,[]),r=e instanceof Array}catch(t){}return function(e,n){return o(e),i(n),r?t(e,n):e.__proto__=n,e}}():void 0)},288:(t,r,e)=>{"use strict";var n=e(1694),o=e(648);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,r,e)=>{var n=e(6916),o=e(614),i=e(111),a=TypeError;t.exports=function(t,r){var e,c;if("string"===r&&o(e=t.toString)&&!i(c=n(e,t)))return c;if(o(e=t.valueOf)&&!i(c=n(e,t)))return c;if("string"!==r&&o(e=t.toString)&&!i(c=n(e,t)))return c;throw a("Can't convert object to primitive value")}},3887:(t,r,e)=>{var n=e(5005),o=e(1702),i=e(8006),a=e(5181),c=e(9670),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var r=i.f(c(t)),e=a.f;return e?u(r,e(t)):r}},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},3702:(t,r,e)=>{var n=e(7854),o=e(2492),i=e(614),a=e(4705),c=e(2788),u=e(5112),s=e(7871),f=e(3823),p=e(1913),l=e(7392),v=o&&o.prototype,d=u("species"),y=!1,h=i(n.PromiseRejectionEvent),m=a("Promise",(function(){var t=c(o),r=t!==String(o);if(!r&&66===l)return!0;if(p&&(!v.catch||!v.finally))return!0;if(!l||l<51||!/native code/.test(t)){var e=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((e.constructor={})[d]=n,!(y=e.then((function(){}))instanceof n))return!0}return!r&&(s||f)&&!h}));t.exports={CONSTRUCTOR:m,REJECTION_EVENT:h,SUBCLASSING:y}},2492:(t,r,e)=>{var n=e(7854);t.exports=n.Promise},9478:(t,r,e)=>{var n=e(9670),o=e(111),i=e(8523);t.exports=function(t,r){if(n(t),o(r)&&r.constructor===t)return r;var e=i.f(t);return(0,e.resolve)(r),e.promise}},612:(t,r,e)=>{var n=e(2492),o=e(7072),i=e(3702).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},2626:(t,r,e)=>{var n=e(3070).f;t.exports=function(t,r,e){e in t||n(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})}},8572:t=>{var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null},e=this.tail;e?e.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=r},4488:(t,r,e)=>{var n=e(8554),o=TypeError;t.exports=function(t){if(n(t))throw o("Can't call method on "+t);return t}},6340:(t,r,e)=>{"use strict";var n=e(5005),o=e(7045),i=e(5112),a=e(9781),c=i("species");t.exports=function(t){var r=n(t);a&&r&&!r[c]&&o(r,c,{configurable:!0,get:function(){return this}})}},8003:(t,r,e)=>{var n=e(3070).f,o=e(2597),i=e(5112)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:r})}},6200:(t,r,e)=>{var n=e(2309),o=e(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,r,e)=>{var n=e(7854),o=e(3072),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,r,e)=>{var n=e(1913),o=e(5465);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.30.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:(t,r,e)=>{var n=e(9670),o=e(9483),i=e(8554),a=e(5112)("species");t.exports=function(t,r){var e,c=n(t).constructor;return void 0===c||i(e=n(c)[a])?r:o(e)}},6293:(t,r,e)=>{var n=e(7392),o=e(7293),i=e(7854).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},261:(t,r,e)=>{var n,o,i,a,c=e(7854),u=e(2104),s=e(9974),f=e(614),p=e(2597),l=e(7293),v=e(490),d=e(206),y=e(317),h=e(8053),m=e(6833),b=e(5268),g=c.setImmediate,x=c.clearImmediate,S=c.process,w=c.Dispatch,j=c.Function,E=c.MessageChannel,O=c.String,P=0,T={},_="onreadystatechange";l((function(){n=c.location}));var C=function(t){if(p(T,t)){var r=T[t];delete T[t],r()}},R=function(t){return function(){C(t)}},I=function(t){C(t.data)},k=function(t){c.postMessage(O(t),n.protocol+"//"+n.host)};g&&x||(g=function(t){h(arguments.length,1);var r=f(t)?t:j(t),e=d(arguments,1);return T[++P]=function(){u(r,void 0,e)},o(P),P},x=function(t){delete T[t]},b?o=function(t){S.nextTick(R(t))}:w&&w.now?o=function(t){w.now(R(t))}:E&&!m?(a=(i=new E).port2,i.port1.onmessage=I,o=s(a.postMessage,a)):c.addEventListener&&f(c.postMessage)&&!c.importScripts&&n&&"file:"!==n.protocol&&!l(k)?(o=k,c.addEventListener("message",I,!1)):o=_ in y("script")?function(t){v.appendChild(y("script"))[_]=function(){v.removeChild(this),C(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:g,clear:x}},1400:(t,r,e)=>{var n=e(9303),o=Math.max,i=Math.min;t.exports=function(t,r){var e=n(t);return e<0?o(e+r,0):i(e,r)}},5656:(t,r,e)=>{var n=e(8361),o=e(4488);t.exports=function(t){return n(o(t))}},9303:(t,r,e)=>{var n=e(4758);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},7466:(t,r,e)=>{var n=e(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,r,e)=>{var n=e(4488),o=Object;t.exports=function(t){return o(n(t))}},7593:(t,r,e)=>{var n=e(6916),o=e(111),i=e(2190),a=e(8173),c=e(2140),u=e(5112),s=TypeError,f=u("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var e,u=a(t,f);if(u){if(void 0===r&&(r="default"),e=n(u,t,r),!o(e)||i(e))return e;throw s("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},4948:(t,r,e)=>{var n=e(7593),o=e(2190);t.exports=function(t){var r=n(t,"string");return o(r)?r:r+""}},1694:(t,r,e)=>{var n={};n[e(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},1340:(t,r,e)=>{var n=e(648),o=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var r=String;t.exports=function(t){try{return r(t)}catch(t){return"Object"}}},9711:(t,r,e)=>{var n=e(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,r,e)=>{var n=e(6293);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,r,e)=>{var n=e(9781),o=e(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:t=>{var r=TypeError;t.exports=function(t,e){if(t{var n=e(7854),o=e(614),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},5112:(t,r,e)=>{var n=e(7854),o=e(2309),i=e(2597),a=e(9711),c=e(6293),u=e(3307),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return i(f,t)||(f[t]=c&&i(s,t)?s[t]:p("Symbol."+t)),f[t]}},9191:(t,r,e)=>{"use strict";var n=e(5005),o=e(2597),i=e(8880),a=e(7976),c=e(7674),u=e(9920),s=e(2626),f=e(9587),p=e(6277),l=e(8340),v=e(5392),d=e(9781),y=e(1913);t.exports=function(t,r,e,h){var m="stackTraceLimit",b=h?2:1,g=t.split("."),x=g[g.length-1],S=n.apply(null,g);if(S){var w=S.prototype;if(!y&&o(w,"cause")&&delete w.cause,!e)return S;var j=n("Error"),E=r((function(t,r){var e=p(h?r:t,void 0),n=h?new S(t):new S;return void 0!==e&&i(n,"message",e),v(n,E,n.stack,2),this&&a(w,this)&&f(n,this,E),arguments.length>b&&l(n,arguments[b]),n}));if(E.prototype=w,"Error"!==x?c?c(E,j):u(E,j,{name:!0}):d&&m in S&&(s(E,S,m),s(E,S,"prepareStackTrace")),u(E,S),!y)try{w.name!==x&&i(w,"name",x),w.constructor=E}catch(t){}return E}}},1703:(t,r,e)=>{var n=e(2109),o=e(7854),i=e(2104),a=e(9191),c="WebAssembly",u=o[c],s=7!==Error("e",{cause:7}).cause,f=function(t,r){var e={};e[t]=a(t,r,s),n({global:!0,constructor:!0,arity:1,forced:s},e)},p=function(t,r){if(u&&u[t]){var e={};e[t]=a(c+"."+t,r,s),n({target:c,stat:!0,constructor:!0,arity:1,forced:s},e)}};f("Error",(function(t){return function(r){return i(t,this,arguments)}})),f("EvalError",(function(t){return function(r){return i(t,this,arguments)}})),f("RangeError",(function(t){return function(r){return i(t,this,arguments)}})),f("ReferenceError",(function(t){return function(r){return i(t,this,arguments)}})),f("SyntaxError",(function(t){return function(r){return i(t,this,arguments)}})),f("TypeError",(function(t){return function(r){return i(t,this,arguments)}})),f("URIError",(function(t){return function(r){return i(t,this,arguments)}})),p("CompileError",(function(t){return function(r){return i(t,this,arguments)}})),p("LinkError",(function(t){return function(r){return i(t,this,arguments)}})),p("RuntimeError",(function(t){return function(r){return i(t,this,arguments)}}))},8862:(t,r,e)=>{var n=e(2109),o=e(5005),i=e(2104),a=e(6916),c=e(1702),u=e(7293),s=e(614),f=e(2190),p=e(206),l=e(8044),v=e(6293),d=String,y=o("JSON","stringify"),h=c(/./.exec),m=c("".charAt),b=c("".charCodeAt),g=c("".replace),x=c(1..toString),S=/[\uD800-\uDFFF]/g,w=/^[\uD800-\uDBFF]$/,j=/^[\uDC00-\uDFFF]$/,E=!v||u((function(){var t=o("Symbol")();return"[null]"!=y([t])||"{}"!=y({a:t})||"{}"!=y(Object(t))})),O=u((function(){return'"\\udf06\\ud834"'!==y("\udf06\ud834")||'"\\udead"'!==y("\udead")})),P=function(t,r){var e=p(arguments),n=l(r);if(s(n)||void 0!==t&&!f(t))return e[1]=function(t,r){if(s(n)&&(r=a(n,this,d(t),r)),!f(r))return r},i(y,null,e)},T=function(t,r,e){var n=m(e,r-1),o=m(e,r+1);return h(w,t)&&!h(j,o)||h(j,t)&&!h(w,n)?"\\u"+x(b(t,0),16):t};y&&n({target:"JSON",stat:!0,arity:3,forced:E||O},{stringify:function(t,r,e){var n=p(arguments),o=i(E?P:y,null,n);return O&&"string"==typeof o?g(o,S,T):o}})},1539:(t,r,e)=>{var n=e(1694),o=e(8052),i=e(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},821:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(9662),a=e(8523),c=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{all:function(t){var r=this,e=a.f(r),n=e.resolve,s=e.reject,f=c((function(){var e=i(r.resolve),a=[],c=0,f=1;u(t,(function(t){var i=c++,u=!1;f++,o(e,r,t).then((function(t){u||(u=!0,a[i]=t,--f||n(a))}),s)})),--f||n(a)}));return f.error&&s(f.value),e.promise}})},4164:(t,r,e)=>{"use strict";var n=e(2109),o=e(1913),i=e(3702).CONSTRUCTOR,a=e(2492),c=e(5005),u=e(614),s=e(8052),f=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&u(a)){var p=c("Promise").prototype.catch;f.catch!==p&&s(f,"catch",p,{unsafe:!0})}},3401:(t,r,e)=>{"use strict";var n,o,i,a=e(2109),c=e(1913),u=e(5268),s=e(7854),f=e(6916),p=e(8052),l=e(7674),v=e(8003),d=e(6340),y=e(9662),h=e(614),m=e(111),b=e(5787),g=e(6707),x=e(261).set,S=e(5948),w=e(842),j=e(2534),E=e(8572),O=e(9909),P=e(2492),T=e(3702),_=e(8523),C="Promise",R=T.CONSTRUCTOR,I=T.REJECTION_EVENT,k=T.SUBCLASSING,A=O.getterFor(C),D=O.set,N=P&&P.prototype,F=P,M=N,L=s.TypeError,U=s.document,B=s.process,G=_.f,z=G,q=!!(U&&U.createEvent&&s.dispatchEvent),J="unhandledrejection",W=function(t){var r;return!(!m(t)||!h(r=t.then))&&r},H=function(t,r){var e,n,o,i=r.value,a=1==r.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,p=t.domain;try{c?(a||(2===r.rejection&&Y(r),r.rejection=1),!0===c?e=i:(p&&p.enter(),e=c(i),p&&(p.exit(),o=!0)),e===t.promise?s(L("Promise-chain cycle")):(n=W(e))?f(n,e,u,s):u(e)):s(i)}catch(t){p&&!o&&p.exit(),s(t)}},V=function(t,r){t.notified||(t.notified=!0,S((function(){for(var e,n=t.reactions;e=n.get();)H(e,t);t.notified=!1,r&&!t.rejection&&K(t)})))},$=function(t,r,e){var n,o;q?((n=U.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),s.dispatchEvent(n)):n={promise:r,reason:e},!I&&(o=s["on"+t])?o(n):t===J&&w("Unhandled promise rejection",e)},K=function(t){f(x,s,(function(){var r,e=t.facade,n=t.value;if(X(t)&&(r=j((function(){u?B.emit("unhandledRejection",n,e):$(J,e,n)})),t.rejection=u||X(t)?2:1,r.error))throw r.value}))},X=function(t){return 1!==t.rejection&&!t.parent},Y=function(t){f(x,s,(function(){var r=t.facade;u?B.emit("rejectionHandled",r):$("rejectionhandled",r,t.value)}))},Q=function(t,r,e){return function(n){t(r,n,e)}},Z=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,V(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw L("Promise can't be resolved itself");var n=W(r);n?S((function(){var e={done:!1};try{f(n,r,Q(tt,e,t),Q(Z,e,t))}catch(r){Z(e,r,t)}})):(t.value=r,t.state=1,V(t,!1))}catch(r){Z({done:!1},r,t)}}};if(R&&(M=(F=function(t){b(this,M),y(t),f(n,this);var r=A(this);try{t(Q(tt,r),Q(Z,r))}catch(t){Z(r,t)}}).prototype,(n=function(t){D(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=p(M,"then",(function(t,r){var e=A(this),n=G(g(this,F));return e.parent=!0,n.ok=!h(t)||t,n.fail=h(r)&&r,n.domain=u?B.domain:void 0,0==e.state?e.reactions.add(n):S((function(){H(n,e)})),n.promise})),o=function(){var t=new n,r=A(t);this.promise=t,this.resolve=Q(tt,r),this.reject=Q(Z,r)},_.f=G=function(t){return t===F||void 0===t?new o(t):z(t)},!c&&h(P)&&N!==Object.prototype)){i=N.then,k||p(N,"then",(function(t,r){var e=this;return new F((function(t,r){f(i,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete N.constructor}catch(t){}l&&l(N,M)}a({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:F}),v(F,C,!1,!0),d(C)},8674:(t,r,e)=>{e(3401),e(821),e(4164),e(6027),e(683),e(6294)},6027:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(9662),a=e(8523),c=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{race:function(t){var r=this,e=a.f(r),n=e.reject,s=c((function(){var a=i(r.resolve);u(t,(function(t){o(a,r,t).then(e.resolve,n)}))}));return s.error&&n(s.value),e.promise}})},683:(t,r,e)=>{"use strict";var n=e(2109),o=e(6916),i=e(8523);n({target:"Promise",stat:!0,forced:e(3702).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},6294:(t,r,e)=>{"use strict";var n=e(2109),o=e(5005),i=e(1913),a=e(2492),c=e(3702).CONSTRUCTOR,u=e(9478),s=o("Promise"),f=i&&!c;n({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return u(f&&this===s?a:this,t)}})}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n].call(i.exports,i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";e(1539),e(8674),e(8862),e(1703),document.addEventListener("DOMContentLoaded",(function(){"yes"===PayPalCommerceGatewayPayPalSubscription.product_connected&&(document.querySelector("#_subscription_period_interval").setAttribute("disabled","disabled"),document.querySelector("#_subscription_period").setAttribute("disabled","disabled"),document.querySelector("._subscription_length_field").style.display="none",document.querySelector("._subscription_trial_length_field").style.display="none"),console.log("testing");var t=document.getElementById("ppcp_unlink_sub_plan");null==t||t.addEventListener("click",(function(r){r.preventDefault(),t.disabled=!0;var e=document.getElementById("spinner-unlink-plan");e.style.display="inline-block",fetch(PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.nonce,plan_id:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.plan_id,product_id:PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.product_id})}).then((function(t){return t.json()})).then((function(r){if(!r.success)throw t.disabled=!1,e.style.display="none",console.error(r),Error(r.data.message);var n=document.getElementById("ppcp-enable-subscription"),o=document.getElementById("pcpp-product"),i=document.getElementById("pcpp-plan");n.style.display="none",o.style.display="none",i.style.display="none",document.getElementById("ppcp_enable_subscription_product").disabled=!0,document.getElementById("pcpp-plan-unlinked").style.display="block",setTimeout((function(){location.reload()}),1e3)}))}))}))})()})(); -//# sourceMappingURL=paypal-subscription.js.map \ No newline at end of file diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt b/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt deleted file mode 100644 index ae386fb79..000000000 --- a/modules/ppcp-subscription/assets/js/paypal-subscription.js.LICENSE.txt +++ /dev/null @@ -1 +0,0 @@ -/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ diff --git a/modules/ppcp-subscription/assets/js/paypal-subscription.js.map b/modules/ppcp-subscription/assets/js/paypal-subscription.js.map deleted file mode 100644 index 158fcc0db..000000000 --- a/modules/ppcp-subscription/assets/js/paypal-subscription.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js/paypal-subscription.js","mappings":"4BAAA,IAAIA,EAAa,EAAQ,KACrBC,EAAc,EAAQ,MAEtBC,EAAaC,UAGjBC,EAAOC,QA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pack://ppcp-subscription/./node_modules/core-js/internals/a-callable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/a-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/a-possible-prototype.js","webpack://ppcp-subscription/./node_modules/core-js/internals/an-instance.js","webpack://ppcp-subscription/./node_modules/core-js/internals/an-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/array-includes.js","webpack://ppcp-subscription/./node_modules/core-js/internals/array-slice.js","webpack://ppcp-subscription/./node_modules/core-js/internals/check-correctness-of-iteration.js","webpack://ppcp-subscription/./node_modules/core-js/internals/classof-raw.js","webpack://ppcp-subscription/./node_modules/core-js/internals/classof.js","webpack://ppcp-subscription/./node_modules/core-js/internals/copy-constructor-properties.js","webpack://ppcp-subscription/./node_modules/core-js/internals/create-non-enumerable-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/create-property-descriptor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-built-in-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/define-global-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/descriptors.js","webpack://ppcp-subscription/./node_modules/core-js/internals/document-all.js","webpack://ppcp-subscription/./node_modules/core-js/internals/document-create-element.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-browser.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-deno.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-ios-pebble.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-ios.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-node.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-is-webos-webkit.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-user-agent.js","webpack://ppcp-subscription/./node_modules/core-js/internals/engine-v8-version.js","webpack://ppcp-subscription/./node_modules/core-js/internals/enum-bug-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-clear.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-install.js","webpack://ppcp-subscription/./node_modules/core-js/internals/error-stack-installable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/export.js","webpack://ppcp-subscription/./node_modules/core-js/internals/fails.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-apply.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-bind-context.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-bind-native.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-call.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-name.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this-clause.js","webpack://ppcp-subscription/./node_modules/core-js/internals/function-uncurry-this.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-iterator-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-iterator.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-json-replacer-function.js","webpack://ppcp-subscription/./node_modules/core-js/internals/get-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/global.js","webpack://ppcp-subscription/./node_modules/core-js/internals/has-own-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/hidden-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/host-report-errors.js","webpack://ppcp-subscription/./node_modules/core-js/internals/html.js","webpack://ppcp-subscription/./node_modules/core-js/internals/ie8-dom-define.js","webpack://ppcp-subscription/./node_modules/core-js/internals/indexed-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/inherit-if-required.js","webpack://ppcp-subscription/./node_modules/core-js/internals/inspect-source.js","webpack://ppcp-subscription/./node_modules/core-js/internals/install-error-cause.js","webpack://ppcp-subscription/./node_modules/core-js/internals/internal-state.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-array-iterator-method.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-array.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-callable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-forced.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-null-or-undefined.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-pure.js","webpack://ppcp-subscription/./node_modules/core-js/internals/is-symbol.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterate.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterator-close.js","webpack://ppcp-subscription/./node_modules/core-js/internals/iterators.js","webpack://ppcp-subscription/./node_modules/core-js/internals/length-of-array-like.js","webpack://ppcp-subscription/./node_modules/core-js/internals/make-built-in.js","webpack://ppcp-subscription/./node_modules/core-js/internals/math-trunc.js","webpack://ppcp-subscription/./node_modules/core-js/internals/microtask.js","webpack://ppcp-subscription/./node_modules/core-js/internals/new-promise-capability.js","webpack://ppcp-subscription/./node_modules/core-js/internals/normalize-string-argument.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-define-property.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-names.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-is-prototype-of.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-keys-internal.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-property-is-enumerable.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-set-prototype-of.js","webpack://ppcp-subscription/./node_modules/core-js/internals/object-to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/ordinary-to-primitive.js","webpack://ppcp-subscription/./node_modules/core-js/internals/own-keys.js","webpack://ppcp-subscription/./node_modules/core-js/internals/perform.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-constructor-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-native-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-resolve.js","webpack://ppcp-subscription/./node_modules/core-js/internals/promise-statics-incorrect-iteration.js","webpack://ppcp-subscription/./node_modules/core-js/internals/proxy-accessor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/queue.js","webpack://ppcp-subscription/./node_modules/core-js/internals/require-object-coercible.js","webpack://ppcp-subscription/./node_modules/core-js/internals/set-species.js","webpack://ppcp-subscription/./node_modules/core-js/internals/set-to-string-tag.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared-key.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared-store.js","webpack://ppcp-subscription/./node_modules/core-js/internals/shared.js","webpack://ppcp-subscription/./node_modules/core-js/internals/species-constructor.js","webpack://ppcp-subscription/./node_modules/core-js/internals/symbol-constructor-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/task.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-absolute-index.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-indexed-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-integer-or-infinity.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-length.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-object.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-primitive.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-property-key.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-string-tag-support.js","webpack://ppcp-subscription/./node_modules/core-js/internals/to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/try-to-string.js","webpack://ppcp-subscription/./node_modules/core-js/internals/uid.js","webpack://ppcp-subscription/./node_modules/core-js/internals/use-symbol-as-uid.js","webpack://ppcp-subscription/./node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://ppcp-subscription/./node_modules/core-js/internals/validate-arguments-length.js","webpack://ppcp-subscription/./node_modules/core-js/internals/weak-map-basic-detection.js","webpack://ppcp-subscription/./node_modules/core-js/internals/well-known-symbol.js","webpack://ppcp-subscription/./node_modules/core-js/internals/wrap-error-constructor-with-cause.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.error.cause.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.json.stringify.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.object.to-string.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.all.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.catch.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.constructor.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.race.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.reject.js","webpack://ppcp-subscription/./node_modules/core-js/modules/es.promise.resolve.js","webpack://ppcp-subscription/webpack/bootstrap","webpack://ppcp-subscription/webpack/runtime/compat get default export","webpack://ppcp-subscription/webpack/runtime/define property getters","webpack://ppcp-subscription/webpack/runtime/global","webpack://ppcp-subscription/webpack/runtime/hasOwnProperty shorthand","webpack://ppcp-subscription/./resources/js/paypal-subscription.js"],"sourcesContent":["var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","var isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw $TypeError('Incorrect invocation');\n};\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","var isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var IS_DENO = require('../internals/engine-is-deno');\nvar IS_NODE = require('../internals/engine-is-node');\n\nmodule.exports = !IS_DENO && !IS_NODE\n && typeof window == 'object'\n && typeof document == 'object';\n","/* global Deno -- Deno case */\nmodule.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';\n","var userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","var classof = require('../internals/classof-raw');\n\nmodule.exports = typeof process != 'undefined' && classof(process) == 'process';\n","var userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n","var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar clearErrorStack = require('../internals/error-stack-clear');\nvar ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');\n\n// non-standard V8\nvar captureStackTrace = Error.captureStackTrace;\n\nmodule.exports = function (error, C, stack, dropEntries) {\n if (ERROR_STACK_INSTALLABLE) {\n if (captureStackTrace) captureStackTrace(error, C);\n else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));\n }\n};\n","var fails = require('../internals/fails');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","var uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","var classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var classof = require('../internals/classof');\nvar getMethod = require('../internals/get-method');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n","var call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw $TypeError(tryToString(argument) + ' is not iterable');\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","var aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || this || Function('return this')();\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","module.exports = {};\n","module.exports = function (a, b) {\n try {\n // eslint-disable-next-line no-console -- safe\n arguments.length == 1 ? console.error(a) : console.error(a, b);\n } catch (error) { /* empty */ }\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) == 'Array';\n};\n","var $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","var isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","module.exports = false;\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","var call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","module.exports = {};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","var global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","var toString = require('../internals/to-string');\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","module.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","var global = require('../internals/global');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar isCallable = require('../internals/is-callable');\nvar isForced = require('../internals/is-forced');\nvar inspectSource = require('../internals/inspect-source');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_PURE = require('../internals/is-pure');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n","var global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","var anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","var NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","var defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","var Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","var isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineBuiltInAccessor(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","var defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.30.2',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","var global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar bind = require('../internals/function-bind-context');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar fails = require('../internals/fails');\nvar html = require('../internals/html');\nvar arraySlice = require('../internals/array-slice');\nvar createElement = require('../internals/document-create-element');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\nfails(function () {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = global.location;\n});\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar eventListener = function (event) {\n run(event.data);\n};\n\nvar globalPostMessageDefer = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = eventListener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n isCallable(global.postMessage) &&\n !global.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(globalPostMessageDefer)\n ) {\n defer = globalPostMessageDefer;\n global.addEventListener('message', eventListener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","var classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar proxyAccessor = require('../internals/proxy-accessor');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar normalizeStringArgument = require('../internals/normalize-string-argument');\nvar installErrorCause = require('../internals/install-error-cause');\nvar installErrorStack = require('../internals/error-stack-install');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n installErrorStack(result, WrappedError, result.stack, 2);\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n","/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor-with-cause');\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\nvar FORCED = Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://tc39.es/ecma262/#sec-nativeerror\n// https://github.com/tc39/proposal-error-cause\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')();\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) != '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) != '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) != '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar IS_NODE = require('../internals/engine-is-node');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar perform = require('../internals/perform');\nvar Queue = require('../internals/queue');\nvar InternalStateModule = require('../internals/internal-state');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar PromiseConstructorDetection = require('../internals/promise-constructor-detection');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state == FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state == PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n","// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.promise.constructor');\nrequire('../modules/es.promise.all');\nrequire('../modules/es.promise.catch');\nrequire('../modules/es.promise.race');\nrequire('../modules/es.promise.reject');\nrequire('../modules/es.promise.resolve');\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar promiseResolve = require('../internals/promise-resolve');\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","document.addEventListener(\n 'DOMContentLoaded',\n () => {\n if(PayPalCommerceGatewayPayPalSubscription.product_connected === 'yes') {\n const periodInterval = document.querySelector('#_subscription_period_interval');\n periodInterval.setAttribute('disabled', 'disabled');\n\n const subscriptionPeriod = document.querySelector('#_subscription_period');\n subscriptionPeriod.setAttribute('disabled', 'disabled');\n\n const subscriptionLength = document.querySelector('._subscription_length_field');\n subscriptionLength.style.display = 'none';\n\n const subscriptionTrial = document.querySelector('._subscription_trial_length_field');\n subscriptionTrial.style.display = 'none';\n }\n\n console.log('testing')\n\n const unlinkBtn = document.getElementById('ppcp_unlink_sub_plan');\n unlinkBtn?.addEventListener('click', (event)=>{\n event.preventDefault();\n unlinkBtn.disabled = true;\n const spinner = document.getElementById('spinner-unlink-plan');\n spinner.style.display = 'inline-block';\n\n fetch(PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.endpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n credentials: 'same-origin',\n body: JSON.stringify({\n nonce: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.nonce,\n plan_id: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.plan_id,\n product_id: PayPalCommerceGatewayPayPalSubscription.ajax.deactivate_plan.product_id\n })\n }).then(function (res) {\n return res.json();\n }).then(function (data) {\n if (!data.success) {\n unlinkBtn.disabled = false;\n spinner.style.display = 'none';\n console.error(data);\n throw Error(data.data.message);\n }\n\n const enableSubscription = document.getElementById('ppcp-enable-subscription');\n const product = document.getElementById('pcpp-product');\n const plan = document.getElementById('pcpp-plan');\n enableSubscription.style.display = 'none';\n product.style.display = 'none';\n plan.style.display = 'none';\n\n const enable_subscription_product = document.getElementById('ppcp_enable_subscription_product');\n enable_subscription_product.disabled = true;\n\n const planUnlinked = document.getElementById('pcpp-plan-unlinked');\n planUnlinked.style.display = 'block';\n\n setTimeout(() => {\n location.reload();\n }, 1000)\n });\n });\n });\n"],"names":["isCallable","tryToString","$TypeError","TypeError","module","exports","argument","isConstructor","$String","String","isPrototypeOf","it","Prototype","isObject","toIndexedObject","toAbsoluteIndex","lengthOfArrayLike","createMethod","IS_INCLUDES","$this","el","fromIndex","value","O","length","index","includes","indexOf","uncurryThis","slice","ITERATOR","wellKnownSymbol","SAFE_CLOSING","called","iteratorWithReturn","next","done","this","Array","from","error","exec","SKIP_CLOSING","ITERATION_SUPPORT","object","toString","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","$Object","Object","CORRECT_ARGUMENTS","arguments","tag","result","undefined","key","tryGet","callee","hasOwn","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","target","source","exceptions","keys","defineProperty","f","getOwnPropertyDescriptor","i","DESCRIPTORS","createPropertyDescriptor","bitmap","enumerable","configurable","writable","makeBuiltIn","name","descriptor","get","getter","set","setter","defineGlobalProperty","options","simple","global","unsafe","nonConfigurable","nonWritable","fails","documentAll","document","all","IS_HTMLDDA","EXISTS","createElement","IS_DENO","IS_NODE","window","Deno","version","userAgent","test","Pebble","classof","process","navigator","match","versions","v8","split","$Error","Error","replace","TEST","stack","V8_OR_CHAKRA_STACK_ENTRY","IS_V8_OR_CHAKRA_STACK","dropEntries","prepareStackTrace","createNonEnumerableProperty","clearErrorStack","ERROR_STACK_INSTALLABLE","captureStackTrace","C","defineBuiltIn","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","prototype","dontCallGetSet","forced","sham","NATIVE_BIND","FunctionPrototype","Function","apply","call","Reflect","bind","aCallable","fn","that","hasOwnProperty","getDescriptor","PROPER","CONFIGURABLE","method","uncurryThisWithBind","namespace","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","isArray","push","replacer","rawLength","element","keysLength","root","j","V","P","func","check","Math","globalThis","self","g","toObject","a","b","console","getBuiltIn","propertyIsEnumerable","setPrototypeOf","dummy","Wrapper","NewTarget","NewTargetPrototype","constructor","store","functionToString","inspectSource","cause","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","state","metadata","facade","STATE","enforce","getterFor","TYPE","type","ArrayPrototype","$documentAll","noop","empty","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","string","toLowerCase","USE_SYMBOL_AS_UID","$Symbol","isArrayIteratorMethod","getIterator","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterator","iterFn","step","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","stop","condition","callFn","kind","innerResult","innerError","toLength","obj","CONFIGURABLE_FUNCTION_NAME","InternalStateModule","enforceInternalState","getInternalState","join","CONFIGURABLE_LENGTH","TEMPLATE","arity","ceil","floor","trunc","x","n","notify","toggle","node","promise","then","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","MutationObserver","WebKitMutationObserver","Promise","queueMicrotaskDescriptor","microtask","queue","flush","parent","domain","exit","head","enter","resolve","nextTick","createTextNode","observe","characterData","add","PromiseCapability","reject","$$resolve","$$reject","$default","IE8_DOM_DEFINE","V8_PROTOTYPE_DEFINE_BUG","toPropertyKey","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","internalObjectKeys","concat","getOwnPropertyNames","getOwnPropertySymbols","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","aPossiblePrototype","CORRECT_SETTER","proto","__proto__","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_BROWSER","IS_PURE","V8_VERSION","NativePromisePrototype","SPECIES","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","Target","Source","tail","item","entry","defineBuiltInAccessor","CONSTRUCTOR_NAME","Constructor","TAG","uid","SHARED","mode","copyright","license","aConstructor","defaultConstructor","S","symbol","Symbol","$location","defer","channel","port","html","arraySlice","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","MessageChannel","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","event","globalPostMessageDefer","postMessage","protocol","host","handler","args","now","port2","port1","onmessage","addEventListener","importScripts","appendChild","removeChild","setTimeout","toIntegerOrInfinity","max","min","integer","IndexedObject","requireObjectCoercible","number","isSymbol","ordinaryToPrimitive","TO_PRIMITIVE","exoticToPrim","toPrimitive","postfix","random","NATIVE_SYMBOL","passed","required","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","proxyAccessor","inheritIfRequired","normalizeStringArgument","installErrorCause","installErrorStack","FULL_NAME","wrapper","FORCED","IS_AGGREGATE_ERROR","STACK_TRACE_LIMIT","OPTIONS_POSITION","path","ERROR_NAME","OriginalError","OriginalErrorPrototype","BaseError","WrappedError","message","$","wrapErrorConstructorWithCause","WEB_ASSEMBLY","WebAssembly","exportGlobalErrorCauseWrapper","exportWebAssemblyErrorCauseWrapper","init","getReplacerFunction","$stringify","charAt","charCodeAt","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","offset","prev","stringify","space","newPromiseCapabilityModule","perform","iterate","capability","$promiseResolve","values","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","setToStringTag","setSpecies","anInstance","speciesConstructor","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","setInternalState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","createEvent","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","emit","unwrap","internalReject","internalResolve","executor","onFulfilled","PromiseWrapper","wrap","race","r","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","o","e","prop","PayPalCommerceGatewayPayPalSubscription","product_connected","querySelector","setAttribute","style","display","log","unlinkBtn","getElementById","preventDefault","disabled","spinner","fetch","ajax","deactivate_plan","endpoint","headers","credentials","body","JSON","nonce","plan_id","product_id","res","json","success","enableSubscription","product","plan","reload"],"sourceRoot":""} \ No newline at end of file From f382ec4bd8bef076c3a302e1b3c7309e1e54187c Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Thu, 22 Jun 2023 15:03:49 +0200 Subject: [PATCH 33/67] Add migration flag option name to clear db service --- modules/ppcp-uninstall/services.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ppcp-uninstall/services.php b/modules/ppcp-uninstall/services.php index 054a0d9dc..6f7cda722 100644 --- a/modules/ppcp-uninstall/services.php +++ b/modules/ppcp-uninstall/services.php @@ -33,6 +33,7 @@ return array( 'woocommerce-ppcp-version', WebhookSimulation::OPTION_ID, WebhookRegistrar::KEY, + 'ppcp_payment_tokens_migration_initialized', ); }, @@ -40,6 +41,7 @@ return array( return array( 'woocommerce_paypal_payments_check_pui_payment_captured', 'woocommerce_paypal_payments_check_saved_payment', + 'woocommerce_paypal_payments_payment_tokens_migration', ); }, From 2c0b4365108d1bddcb0be07e3449894a4a5d5f77 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 23 Jun 2023 09:47:31 +0300 Subject: [PATCH 34/67] Remove unused service --- modules/ppcp-button/services.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index e100e5ea3..56381fcc2 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -67,23 +67,6 @@ return array( return $dummy_ids[ $shop_country ] ?? $container->get( 'button.client_id' ); }, - 'button.is_paypal_continuation' => static function( ContainerInterface $container ): bool { - $session_handler = $container->get( 'session.handler' ); - - $order = $session_handler->order(); - if ( ! $order ) { - return false; - } - $source = $order->payment_source(); - if ( $source && $source->card() ) { - return false; // Ignore for DCC. - } - if ( 'card' === $session_handler->funding_source() ) { - return false; // Ignore for card buttons. - } - - return true; - }, 'button.smart-button' => static function ( ContainerInterface $container ): SmartButtonInterface { $state = $container->get( 'onboarding.state' ); if ( $state->current_state() !== State::STATE_ONBOARDED ) { From 587e065fba83e0270f359ea36797974101b9fd53 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 23 Jun 2023 08:23:11 +0100 Subject: [PATCH 35/67] Refactored button display logic Replaced show / hide buttons mode with enable / disable buttons mode --- .../SingleProductActionHandler.js | 1 - .../ContextBootstrap/SingleProductBootstap.js | 67 +++++++++++-------- .../js/modules/Helper/ButtonDisabler.js | 58 ++++++++++++++++ .../modules/Helper/ButtonsToggleListener.js | 39 ----------- 4 files changed, 98 insertions(+), 67 deletions(-) create mode 100644 modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js delete mode 100644 modules/ppcp-button/resources/js/modules/Helper/ButtonsToggleListener.js diff --git a/modules/ppcp-button/resources/js/modules/ActionHandler/SingleProductActionHandler.js b/modules/ppcp-button/resources/js/modules/ActionHandler/SingleProductActionHandler.js index 3c3371542..146fd7e94 100644 --- a/modules/ppcp-button/resources/js/modules/ActionHandler/SingleProductActionHandler.js +++ b/modules/ppcp-button/resources/js/modules/ActionHandler/SingleProductActionHandler.js @@ -1,4 +1,3 @@ -import ButtonsToggleListener from '../Helper/ButtonsToggleListener'; import Product from '../Entity/Product'; import onApprove from '../OnApproveHandler/onApproveForContinue'; import {payerData} from "../Helper/PayerData"; diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 376962772..c6b86657c 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -1,7 +1,6 @@ import UpdateCart from "../Helper/UpdateCart"; import SingleProductActionHandler from "../ActionHandler/SingleProductActionHandler"; -import {hide, show, setVisible} from "../Helper/Hiding"; -import ButtonsToggleListener from "../Helper/ButtonsToggleListener"; +import {disable, enable} from "../Helper/ButtonDisabler"; class SingleProductBootstap { constructor(gateway, renderer, messages, errorHandler) { @@ -10,56 +9,70 @@ class SingleProductBootstap { this.messages = messages; this.errorHandler = errorHandler; this.mutationObserver = new MutationObserver(this.handleChange.bind(this)); + this.formSelector = 'form.cart'; } + form() { + return document.querySelector(this.formSelector); + } handleChange() { - const shouldRender = this.shouldRender(); - setVisible(this.gateway.button.wrapper, shouldRender); - setVisible(this.gateway.messages.wrapper, shouldRender); - if (!shouldRender) { + if (!this.shouldRender()) { return; } this.render(); + this.handleButtonStatus(); + } + + handleButtonStatus() { + if (!this.shouldEnable()) { + disable(this.gateway.button.wrapper, this.formSelector); + disable(this.gateway.messages.wrapper); + return; + } + enable(this.gateway.button.wrapper); + enable(this.gateway.messages.wrapper); + this.messages.renderWithAmount(this.priceAmount()) } init() { - const form = document.querySelector('form.cart'); + const form = this.form(); + if (!form) { return; } form.addEventListener('change', this.handleChange.bind(this)); - this.mutationObserver.observe(form, {childList: true, subtree: true}); + this.mutationObserver.observe(form, { childList: true, subtree: true }); - const buttonObserver = new ButtonsToggleListener( - form.querySelector('.single_add_to_cart_button'), - () => { - show(this.gateway.button.wrapper); - show(this.gateway.messages.wrapper); - this.messages.renderWithAmount(this.priceAmount()) - }, - () => { - hide(this.gateway.button.wrapper); - hide(this.gateway.messages.wrapper); - }, - ); - buttonObserver.init(); + const addToCartButton = form.querySelector('.single_add_to_cart_button'); + + if (addToCartButton) { + (new MutationObserver(this.handleButtonStatus.bind(this))) + .observe(addToCartButton, { attributes : true }); + } if (!this.shouldRender()) { - hide(this.gateway.button.wrapper); - hide(this.gateway.messages.wrapper); return; } this.render(); + this.handleButtonStatus(); } shouldRender() { - return document.querySelector('form.cart') !== null + return this.form() !== null + && !this.isDisabledReasonExternalPlugins(); + } + + shouldEnable() { + const form = this.form(); + const addToCartButton = form ? form.querySelector('.single_add_to_cart_button') : null; + + return this.shouldRender() && !this.priceAmountIsZero() - && !this.isSubscriptionMode(); + && ((null === addToCartButton) || !addToCartButton.classList.contains('disabled')); } priceAmount() { @@ -93,7 +106,7 @@ class SingleProductBootstap { return !price || price === 0; } - isSubscriptionMode() { + isDisabledReasonExternalPlugins() { // Check "All products for subscriptions" plugin. return document.querySelector('.wcsatt-options-product:not(.wcsatt-options-product--hidden) .subscription-option input[type="radio"]:checked') !== null || document.querySelector('.wcsatt-options-prompt-label-subscription input[type="radio"]:checked') !== null; // grouped @@ -106,7 +119,7 @@ class SingleProductBootstap { this.gateway.ajax.change_cart.endpoint, this.gateway.ajax.change_cart.nonce, ), - document.querySelector('form.cart'), + this.form(), this.errorHandler, ); diff --git a/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js new file mode 100644 index 000000000..b9f98cbab --- /dev/null +++ b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js @@ -0,0 +1,58 @@ +/** + * @param selectorOrElement + * @returns {Element} + */ +const getElement = (selectorOrElement) => { + if (typeof selectorOrElement === 'string') { + return document.querySelector(selectorOrElement); + } + return selectorOrElement; +} + +export const setEnabled = (selectorOrElement, enable, form = null) => { + const element = getElement(selectorOrElement); + + if (!element) { + return; + } + + if (enable) { + jQuery(element).css({ + 'cursor': '', + '-webkit-filter': '', + 'filter': '', + } ) + .off('mouseup') + .find('> *') + .css('pointer-events', ''); + } else { + jQuery(element).css( { + 'cursor': '', + '-webkit-filter': '', + 'filter': '', + } ) + .css({ + 'cursor': 'not-allowed', + '-webkit-filter': 'grayscale(100%)', + 'filter': 'grayscale(100%)', + }) + .on('mouseup', function(event) { + event.stopImmediatePropagation(); + + if (form) { + // Trigger form submit to show the error message + jQuery(form).find(':submit').trigger('click'); + } + }) + .find('> *') + .css('pointer-events', 'none'); + } +}; + +export const disable = (selectorOrElement, form = null) => { + setEnabled(selectorOrElement, false, form); +}; + +export const enable = (selectorOrElement) => { + setEnabled(selectorOrElement, true); +}; diff --git a/modules/ppcp-button/resources/js/modules/Helper/ButtonsToggleListener.js b/modules/ppcp-button/resources/js/modules/Helper/ButtonsToggleListener.js deleted file mode 100644 index add1ee28a..000000000 --- a/modules/ppcp-button/resources/js/modules/Helper/ButtonsToggleListener.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * When you can't add something to the cart, the PayPal buttons should not show. - * Therefore we listen for changes on the add to cart button and show/hide the buttons accordingly. - */ - -class ButtonsToggleListener { - constructor(element, showCallback, hideCallback) - { - this.element = element; - this.showCallback = showCallback; - this.hideCallback = hideCallback; - this.observer = null; - } - - init() - { - if (!this.element) { - return; - } - const config = { attributes : true }; - const callback = () => { - if (this.element.classList.contains('disabled')) { - this.hideCallback(); - return; - } - this.showCallback(); - } - this.observer = new MutationObserver(callback); - this.observer.observe(this.element, config); - callback(); - } - - disconnect() - { - this.observer.disconnect(); - } -} - -export default ButtonsToggleListener; From 39b56734352ec18673a1144db489dfd90538eb56 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 23 Jun 2023 10:54:18 +0300 Subject: [PATCH 36/67] Refactor openPaypalPopup options, add fundingSource --- tests/playwright/utils/paypal-popup.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/playwright/utils/paypal-popup.js b/tests/playwright/utils/paypal-popup.js index a39e06759..1d4ceac35 100644 --- a/tests/playwright/utils/paypal-popup.js +++ b/tests/playwright/utils/paypal-popup.js @@ -8,16 +8,24 @@ const { /** * Opens the PayPal popup by pressing the button, and returns the popup object. * @param page + * @param {{timeout: ?int, fundingSource: ?string}} options * @param {boolean} retry Retries the button click if the popup did not appear after timeout. - * @param {int} timeout */ -export const openPaypalPopup = async (page, retry = true, timeout = 5000) => { +export const openPaypalPopup = async (page, options = {}, retry = true) => { + options = { + ...{ + timeout: 5000, + fundingSource: 'paypal', + }, + ...options + }; + try { await page.locator('.component-frame').scrollIntoViewIfNeeded(); const [popup] = await Promise.all([ - page.waitForEvent('popup', {timeout}), - page.frameLocator('.component-frame').locator('[data-funding-source="paypal"]').click(), + page.waitForEvent('popup', {timeout: options.timeout}), + page.frameLocator('.component-frame').locator(`[data-funding-source="${options.fundingSource}"]`).click(), ]); await popup.waitForLoadState(); @@ -41,7 +49,7 @@ export const openPaypalPopup = async (page, retry = true, timeout = 5000) => { } if (retry) { - return openPaypalPopup(page, false); + return openPaypalPopup(page, options, false); } throw err; } From e0a39b1c4eab35bdb590c081359480f401a98693 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 23 Jun 2023 10:55:43 +0300 Subject: [PATCH 37/67] Refactor/fix continuation handling in pw --- tests/playwright/place-order.spec.js | 29 +++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tests/playwright/place-order.spec.js b/tests/playwright/place-order.spec.js index b0028fafa..52b5e40d9 100644 --- a/tests/playwright/place-order.spec.js +++ b/tests/playwright/place-order.spec.js @@ -21,11 +21,25 @@ async function completeBlockContinuation(page) { await expect(page.locator('.component-frame')).toHaveCount(0); - await page.locator('.wc-block-components-checkout-place-order-button').click(); + await Promise.all( + page.waitForNavigation(), + page.locator('.wc-block-components-checkout-place-order-button').click(), + ); +} - await page.waitForNavigation(); +async function expectContinuation(page) { + await expect(page.locator('#payment_method_ppcp-gateway')).toBeChecked(); - await expectOrderReceivedPage(page); + await expect(page.locator('.component-frame')).toHaveCount(0); +} + +async function completeContinuation(page) { + await expectContinuation(page); + + await Promise.all([ + page.waitForNavigation(), + page.locator('#place_order').click(), + ]); } test.describe('Classic checkout', () => { @@ -44,10 +58,7 @@ test.describe('Classic checkout', () => { await fillCheckoutForm(page); - await Promise.all([ - page.waitForNavigation(), - page.locator('#place_order').click(), - ]); + await completeContinuation(page); await expectOrderReceivedPage(page); }); @@ -97,6 +108,8 @@ test.describe('Block checkout', () => { await completePaypalPayment(popup); await completeBlockContinuation(page); + + await expectOrderReceivedPage(page); }); test('PayPal express block cart', async ({page}) => { @@ -109,6 +122,8 @@ test.describe('Block checkout', () => { await completePaypalPayment(popup); await completeBlockContinuation(page); + + await expectOrderReceivedPage(page); }); test.describe('Without review', () => { From a088c9cabb77cdd9693f7c611dd1f25d3db2b5e9 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 23 Jun 2023 10:56:21 +0300 Subject: [PATCH 38/67] Add APM tests in pw --- .env.e2e.example | 2 ++ tests/playwright/place-order.spec.js | 45 +++++++++++++++++++++++++- tests/playwright/utils/checkout.js | 4 +++ tests/playwright/utils/paypal-popup.js | 17 ++++++++-- 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/.env.e2e.example b/.env.e2e.example index f080f8faf..98ad27c23 100644 --- a/.env.e2e.example +++ b/.env.e2e.example @@ -15,6 +15,8 @@ PRODUCT_ID=123 SUBSCRIPTION_URL="/product/sub" +APM_ID="sofort" + WP_MERCHANT_USER="admin" WP_MERCHANT_PASSWORD="admin" diff --git a/tests/playwright/place-order.spec.js b/tests/playwright/place-order.spec.js index 52b5e40d9..c0228c351 100644 --- a/tests/playwright/place-order.spec.js +++ b/tests/playwright/place-order.spec.js @@ -1,6 +1,6 @@ const {test, expect} = require('@playwright/test'); const {serverExec} = require("./utils/server"); -const {fillCheckoutForm, expectOrderReceivedPage} = require("./utils/checkout"); +const {fillCheckoutForm, expectOrderReceivedPage, acceptTerms} = require("./utils/checkout"); const {openPaypalPopup, loginIntoPaypal, waitForPaypalShippingList, completePaypalPayment} = require("./utils/paypal-popup"); const { @@ -11,9 +11,11 @@ const { PRODUCT_ID, CHECKOUT_URL, CHECKOUT_PAGE_ID, + CART_URL, BLOCK_CHECKOUT_URL, BLOCK_CHECKOUT_PAGE_ID, BLOCK_CART_URL, + APM_ID, } = process.env; async function completeBlockContinuation(page) { @@ -88,6 +90,47 @@ test.describe('Classic checkout', () => { await expectOrderReceivedPage(page); }); + + test('PayPal APM button place order', async ({page}) => { + await page.goto(CART_URL + '?add-to-cart=' + PRODUCT_ID); + + await page.goto(CHECKOUT_URL); + + await fillCheckoutForm(page); + + const popup = await openPaypalPopup(page, {fundingSource: APM_ID}); + + await popup.getByText('Continue', { exact: true }).click(); + await completePaypalPayment(popup, {selector: '[name="Successful"]'}); + + await expectOrderReceivedPage(page); + }); + + test('PayPal APM button place order when redirect fails', async ({page}) => { + await page.goto(CART_URL + '?add-to-cart=' + PRODUCT_ID); + + await page.goto(CHECKOUT_URL); + + await fillCheckoutForm(page); + + await page.evaluate('PayPalCommerceGateway.ajax.approve_order = null'); + + const popup = await openPaypalPopup(page, {fundingSource: APM_ID}); + + await popup.getByText('Continue', { exact: true }).click(); + await completePaypalPayment(popup, {selector: '[name="Successful"]'}); + + await expect(page.locator('.woocommerce-error')).toBeVisible(); + + await page.reload(); + await expectContinuation(page); + + await acceptTerms(page); + + await completeContinuation(page); + + await expectOrderReceivedPage(page); + }); }); test.describe('Block checkout', () => { diff --git a/tests/playwright/utils/checkout.js b/tests/playwright/utils/checkout.js index 625c543fa..a93ba8b93 100644 --- a/tests/playwright/utils/checkout.js +++ b/tests/playwright/utils/checkout.js @@ -26,6 +26,10 @@ export const fillCheckoutForm = async (page) => { await differentShippingLocator.uncheck(); } + await acceptTerms(page); +} + +export const acceptTerms = async (page) => { const termsLocator = page.locator('[name="terms"]'); if (await termsLocator.count() > 0) { await termsLocator.check(); diff --git a/tests/playwright/utils/paypal-popup.js b/tests/playwright/utils/paypal-popup.js index 1d4ceac35..3b84e7417 100644 --- a/tests/playwright/utils/paypal-popup.js +++ b/tests/playwright/utils/paypal-popup.js @@ -91,9 +91,20 @@ export const waitForPaypalShippingList = async (popup) => { await expect(popup.locator('#shippingMethodsDropdown')).toBeVisible({timeout: 15000}); } -export const completePaypalPayment = async (popup) => { +/** + * @param popup + * @param {{timeout: ?int, selector: ?string}} options + */ +export const completePaypalPayment = async (popup, options) => { + options = { + ...{ + timeout: 20000, + selector: '#payment-submit-btn', + }, + ...options + }; await Promise.all([ - popup.waitForEvent('close', {timeout: 20000}), - popup.click('#payment-submit-btn'), + popup.waitForEvent('close', {timeout: options.timeout}), + popup.click(options.selector), ]); } From 73be9a11d9065954426934f87584ff45b514a21e Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Fri, 23 Jun 2023 11:23:59 +0200 Subject: [PATCH 39/67] Do not run migration if empty key by default --- modules/ppcp-vaulting/src/VaultingModule.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index 9e53dc81c..8760ede0c 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -236,6 +236,12 @@ class VaultingModule implements ModuleInterface { $timestamp = time(); foreach ( $customers as $id ) { + $metadata_exist = metadata_exists( 'user', $id, 'ppcp-vault-token' ); + $skip_empty_key_migration = apply_filters( 'ppcp_skip_payment_tokens_empty_key_migration', true ); + if ( ! $metadata_exist && ! $skip_empty_key_migration ) { + return; + } + /** * Function already exist in WooCommerce * From ba10ef98f3db882d6f170511633cf2e330a6da56 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Fri, 23 Jun 2023 11:39:25 +0200 Subject: [PATCH 40/67] Fix skip conditional --- modules/ppcp-vaulting/src/VaultingModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index 8760ede0c..f1369b1fa 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -238,7 +238,7 @@ class VaultingModule implements ModuleInterface { foreach ( $customers as $id ) { $metadata_exist = metadata_exists( 'user', $id, 'ppcp-vault-token' ); $skip_empty_key_migration = apply_filters( 'ppcp_skip_payment_tokens_empty_key_migration', true ); - if ( ! $metadata_exist && ! $skip_empty_key_migration ) { + if ( ! $metadata_exist && $skip_empty_key_migration ) { return; } From e38bd8f50314e7a11682925c42cbf250101ca880 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Fri, 23 Jun 2023 11:51:19 +0200 Subject: [PATCH 41/67] Revert action to re-run migration externally --- modules/ppcp-vaulting/src/VaultingModule.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index f1369b1fa..debe8c1f5 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -178,6 +178,19 @@ class VaultingModule implements ModuleInterface { } ); + /** + * Allows running migration externally via `do_action('pcp_migrate_payment_tokens')`. + */ + add_action( + 'pcp_migrate_payment_tokens', + function() use ( $container ) { + $logger = $container->get( 'woocommerce.logger.woocommerce' ); + assert( $logger instanceof LoggerInterface ); + + $this->migrate_payment_tokens( $logger ); + } + ); + add_action( 'woocommerce_paypal_payments_payment_tokens_migration', function( int $customer_id ) use ( $container ) { From 75bf98c1748459ba821884b68b1627743aa68766 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 23 Jun 2023 15:49:08 +0100 Subject: [PATCH 42/67] Add hide / show conditions on SingleProduct Buttons for when they shouldn't be rendered. Refactor MessageRenderer not to reload when it has no changes. --- .../ContextBootstrap/SingleProductBootstap.js | 7 +++ .../js/modules/Renderer/MessageRenderer.js | 52 +++++++++++++------ 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index c6b86657c..8d6f61cb1 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -1,5 +1,6 @@ import UpdateCart from "../Helper/UpdateCart"; import SingleProductActionHandler from "../ActionHandler/SingleProductActionHandler"; +import {hide, show} from "../Helper/Hiding"; import {disable, enable} from "../Helper/ButtonDisabler"; class SingleProductBootstap { @@ -18,10 +19,16 @@ class SingleProductBootstap { handleChange() { if (!this.shouldRender()) { + hide(this.gateway.button.wrapper, this.formSelector); + hide(this.gateway.messages.wrapper); return; } this.render(); + + show(this.gateway.button.wrapper, this.formSelector); + show(this.gateway.messages.wrapper); + this.handleButtonStatus(); } diff --git a/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js index a07e81d21..82c10769f 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js @@ -2,6 +2,7 @@ class MessageRenderer { constructor(config) { this.config = config; + this.optionsFingerprint = null; } render() { @@ -9,18 +10,20 @@ class MessageRenderer { return; } - paypal.Messages({ + const options = { amount: this.config.amount, placement: this.config.placement, style: this.config.style - }).render(this.config.wrapper); + }; + + if (this.isOptionsFingerprintEqual(options)) { + return; + } + + paypal.Messages(options).render(this.config.wrapper); jQuery(document.body).on('updated_cart_totals', () => { - paypal.Messages({ - amount: this.config.amount, - placement: this.config.placement, - style: this.config.style - }).render(this.config.wrapper); + paypal.Messages(options).render(this.config.wrapper); }); } @@ -30,17 +33,36 @@ class MessageRenderer { return; } - const newWrapper = document.createElement('div'); - newWrapper.setAttribute('id', this.config.wrapper.replace('#', '')); - - const sibling = document.querySelector(this.config.wrapper).nextSibling; - document.querySelector(this.config.wrapper).parentElement.removeChild(document.querySelector(this.config.wrapper)); - sibling.parentElement.insertBefore(newWrapper, sibling); - paypal.Messages({ + const options = { amount, placement: this.config.placement, style: this.config.style - }).render(this.config.wrapper); + }; + + if (this.isOptionsFingerprintEqual(options)) { + return; + } + + const newWrapper = document.createElement('div'); + newWrapper.setAttribute('id', this.config.wrapper.replace('#', '')); + + const oldWrapper = document.querySelector(this.config.wrapper); + const sibling = oldWrapper.nextSibling; + oldWrapper.parentElement.removeChild(oldWrapper); + sibling.parentElement.insertBefore(newWrapper, sibling); + + paypal.Messages(options).render(this.config.wrapper); + } + + isOptionsFingerprintEqual(options) { + const fingerprint = JSON.stringify(options); + + if (this.optionsFingerprint === fingerprint) { + return true; + } + + this.optionsFingerprint = fingerprint; + return false; } shouldRender() { From f4c3caedcf0033d8b7cbcc2a77a820926ed302d9 Mon Sep 17 00:00:00 2001 From: Alex P Date: Sun, 25 Jun 2023 12:50:55 +0300 Subject: [PATCH 43/67] Refresh dcc/pui status caches on plugin update Since #1273 we started clearing these caches on plugin updates. But we are updating these caches only on some admin pages ( https://github.com/woocommerce/woocommerce-paypal-payments/blob/583dea8d99f60f710f54f6d689c5f57694562180/modules/ppcp-wc-gateway/src/WCGatewayModule.php#L421-L428 ) to avoid the API calls on every request in some cases, so DCC may become hidden if not visited these pages after update. Maybe we can do it more frequently now after 92ae16f99. But for now simply refreshing the caches during plugin update. --- modules/ppcp-wc-gateway/src/WCGatewayModule.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/WCGatewayModule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php index f49fb8f08..db26bad78 100644 --- a/modules/ppcp-wc-gateway/src/WCGatewayModule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -278,6 +278,15 @@ class WCGatewayModule implements ModuleInterface { $settings->set( 'products_dcc_enabled', false ); $settings->set( 'products_pui_enabled', false ); $settings->persist(); + + // Update caches. + $dcc_status = $c->get( 'wcgateway.helper.dcc-product-status' ); + assert( $dcc_status instanceof DCCProductStatus ); + $dcc_status->dcc_is_active(); + + $pui_status = $c->get( 'wcgateway.pay-upon-invoice-product-status' ); + assert( $pui_status instanceof PayUponInvoiceProductStatus ); + $pui_status->pui_is_active(); } ); From adf7a2e2977e8fc55e810c4e217f4b56d57a4d7a Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 26 Jun 2023 11:55:30 +0100 Subject: [PATCH 44/67] Remove unnecessary code --- .../resources/js/modules/Helper/ButtonDisabler.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js index b9f98cbab..9e4bf51ee 100644 --- a/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js +++ b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js @@ -18,20 +18,15 @@ export const setEnabled = (selectorOrElement, enable, form = null) => { if (enable) { jQuery(element).css({ - 'cursor': '', - '-webkit-filter': '', - 'filter': '', - } ) + 'cursor': '', + '-webkit-filter': '', + 'filter': '', + } ) .off('mouseup') .find('> *') .css('pointer-events', ''); } else { - jQuery(element).css( { - 'cursor': '', - '-webkit-filter': '', - 'filter': '', - } ) - .css({ + jQuery(element).css({ 'cursor': 'not-allowed', '-webkit-filter': 'grayscale(100%)', 'filter': 'grayscale(100%)', From 82828c299123fe7f40421deb9a356cae6b7ea545 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 26 Jun 2023 18:14:41 +0100 Subject: [PATCH 45/67] Add support for PayPal SmartButtons enable / disable Rename functions Remove invalid function arguments --- modules/ppcp-button/resources/js/button.js | 18 ++++++++++-- .../ContextBootstrap/SingleProductBootstap.js | 29 +++++++++++++++---- .../js/modules/Renderer/MessageRenderer.js | 7 ++--- .../resources/js/modules/Renderer/Renderer.js | 17 ++++++++++- 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/modules/ppcp-button/resources/js/button.js b/modules/ppcp-button/resources/js/button.js index 6708b0275..0fbccd095 100644 --- a/modules/ppcp-button/resources/js/button.js +++ b/modules/ppcp-button/resources/js/button.js @@ -121,10 +121,22 @@ const bootstrap = () => { return actions.reject(); } }; - const onSmartButtonsInit = () => { - buttonsSpinner.unblock(); + + let smartButtonsOptions = { + onInit: null, + init: function (actions) { + this.actions = actions; + if (typeof this.onInit === 'function') { + this.onInit(); + } + } }; - const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit); + + const onSmartButtonsInit = (data, actions) => { + buttonsSpinner.unblock(); + smartButtonsOptions.init(actions); + }; + const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit, smartButtonsOptions); const messageRenderer = new MessageRenderer(PayPalCommerceGateway.messages); const context = PayPalCommerceGateway.context; if (context === 'mini-cart' || context === 'product') { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 8d6f61cb1..540b085c1 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -11,6 +11,12 @@ class SingleProductBootstap { this.errorHandler = errorHandler; this.mutationObserver = new MutationObserver(this.handleChange.bind(this)); this.formSelector = 'form.cart'; + + if (this.renderer && this.renderer.smartButtonsOptions) { + this.renderer.smartButtonsOptions.onInit = () => { + this.handleChange(); + }; + } } form() { @@ -19,6 +25,7 @@ class SingleProductBootstap { handleChange() { if (!this.shouldRender()) { + this.renderer.disableSmartButtons(); hide(this.gateway.button.wrapper, this.formSelector); hide(this.gateway.messages.wrapper); return; @@ -26,7 +33,8 @@ class SingleProductBootstap { this.render(); - show(this.gateway.button.wrapper, this.formSelector); + this.renderer.enableSmartButtons(); + show(this.gateway.button.wrapper); show(this.gateway.messages.wrapper); this.handleButtonStatus(); @@ -34,13 +42,14 @@ class SingleProductBootstap { handleButtonStatus() { if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(); disable(this.gateway.button.wrapper, this.formSelector); disable(this.gateway.messages.wrapper); return; } + this.renderer.enableSmartButtons(); enable(this.gateway.button.wrapper); enable(this.gateway.messages.wrapper); - this.messages.renderWithAmount(this.priceAmount()) } init() { @@ -50,7 +59,15 @@ class SingleProductBootstap { return; } - form.addEventListener('change', this.handleChange.bind(this)); + form.addEventListener('change', () => { + this.handleChange(); + + setTimeout(() => { // Wait for the DOM to be fully updated + // For the moment renderWithAmount should only be done here to prevent undesired side effects due to priceAmount() + // not being correctly formatted in some cases, can be moved to handleButtonStatus() once this issue is fixed + this.messages.renderWithAmount(this.priceAmount()); + }, 100); + }); this.mutationObserver.observe(form, { childList: true, subtree: true }); const addToCartButton = form.querySelector('.single_add_to_cart_button'); @@ -65,12 +82,12 @@ class SingleProductBootstap { } this.render(); - this.handleButtonStatus(); + this.handleChange(); } shouldRender() { return this.form() !== null - && !this.isDisabledReasonExternalPlugins(); + && !this.isWcsattSubscriptionMode(); } shouldEnable() { @@ -113,7 +130,7 @@ class SingleProductBootstap { return !price || price === 0; } - isDisabledReasonExternalPlugins() { + isWcsattSubscriptionMode() { // Check "All products for subscriptions" plugin. return document.querySelector('.wcsatt-options-product:not(.wcsatt-options-product--hidden) .subscription-option input[type="radio"]:checked') !== null || document.querySelector('.wcsatt-options-prompt-label-subscription input[type="radio"]:checked') !== null; // grouped diff --git a/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js index 82c10769f..80c90c0ef 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/MessageRenderer.js @@ -16,7 +16,7 @@ class MessageRenderer { style: this.config.style }; - if (this.isOptionsFingerprintEqual(options)) { + if (this.optionsEqual(options)) { return; } @@ -28,7 +28,6 @@ class MessageRenderer { } renderWithAmount(amount) { - if (! this.shouldRender()) { return; } @@ -39,7 +38,7 @@ class MessageRenderer { style: this.config.style }; - if (this.isOptionsFingerprintEqual(options)) { + if (this.optionsEqual(options)) { return; } @@ -54,7 +53,7 @@ class MessageRenderer { paypal.Messages(options).render(this.config.wrapper); } - isOptionsFingerprintEqual(options) { + optionsEqual(options) { const fingerprint = JSON.stringify(options); if (this.optionsFingerprint === fingerprint) { diff --git a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js index 17f58aff3..efd3c0bfa 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js @@ -1,11 +1,12 @@ import merge from "deepmerge"; class Renderer { - constructor(creditCardRenderer, defaultSettings, onSmartButtonClick, onSmartButtonsInit) { + constructor(creditCardRenderer, defaultSettings, onSmartButtonClick, onSmartButtonsInit, smartButtonsOptions) { this.defaultSettings = defaultSettings; this.creditCardRenderer = creditCardRenderer; this.onSmartButtonClick = onSmartButtonClick; this.onSmartButtonsInit = onSmartButtonsInit; + this.smartButtonsOptions = smartButtonsOptions; this.renderedSources = new Set(); } @@ -106,6 +107,20 @@ class Renderer { enableCreditCardFields() { this.creditCardRenderer.enableFields(); } + + disableSmartButtons() { + if (!this.smartButtonsOptions || !this.smartButtonsOptions.actions) { + return; + } + this.smartButtonsOptions.actions.disable(); + } + + enableSmartButtons() { + if (!this.smartButtonsOptions || !this.smartButtonsOptions.actions) { + return; + } + this.smartButtonsOptions.actions.enable(); + } } export default Renderer; From bf5179d3744d2be85c0b234b6bfcab8710153c36 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 27 Jun 2023 11:00:59 +0100 Subject: [PATCH 46/67] Add PayPal Vault enabled and ACDC Vault enabled on WooCommerce System status Remove Vault enabled on WooCommerce System status --- .../src/StatusReportModule.php | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/modules/ppcp-status-report/src/StatusReportModule.php b/modules/ppcp-status-report/src/StatusReportModule.php index abf84b83b..9e2df9599 100644 --- a/modules/ppcp-status-report/src/StatusReportModule.php +++ b/modules/ppcp-status-report/src/StatusReportModule.php @@ -120,11 +120,19 @@ class StatusReportModule implements ModuleInterface { 'value' => $this->bool_to_html( ! $last_webhook_storage->is_empty() ), ), array( - 'label' => esc_html__( 'Vault enabled', 'woocommerce-paypal-payments' ), - 'exported_label' => 'Vault enabled', - 'description' => esc_html__( 'Whether vaulting is enabled on PayPal account or not.', 'woocommerce-paypal-payments' ), + 'label' => esc_html__( 'PayPal Vault enabled', 'woocommerce-paypal-payments' ), + 'exported_label' => 'PayPal Vault enabled', + 'description' => esc_html__( 'Whether vaulting option is enabled on Standard Payments settings or not.', 'woocommerce-paypal-payments' ), 'value' => $this->bool_to_html( - $this->vault_enabled( $bearer ) + $settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ) + ), + ), + array( + 'label' => esc_html__( 'ACDC Vault enabled', 'woocommerce-paypal-payments' ), + 'exported_label' => 'ACDC Vault enabled', + 'description' => esc_html__( 'Whether vaulting option is enabled on Advanced Card Processing settings or not.', 'woocommerce-paypal-payments' ), + 'value' => $this->bool_to_html( + $settings->has( 'vault_enabled_dcc' ) && $settings->get( 'vault_enabled_dcc' ) ), ), array( @@ -192,21 +200,6 @@ class StatusReportModule implements ModuleInterface { return $token->is_valid() && $current_state === $state::STATE_ONBOARDED; } - /** - * It returns whether vaulting is enabled or not. - * - * @param Bearer $bearer The bearer. - * @return bool - */ - private function vault_enabled( Bearer $bearer ): bool { - try { - $token = $bearer->bearer(); - return $token->vaulting_available(); - } catch ( RuntimeException $exception ) { - return false; - } - } - /** * Checks if reference transactions are enabled in account. * From 0d34fead070cd38f7c7e8e13f887ce19696c01a7 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 27 Jun 2023 16:28:44 +0300 Subject: [PATCH 47/67] Revert accidentally committed line --- .../src/Settings/Fields/pay-later-tab-fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php index f87a7285e..6428b1389 100644 --- a/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php +++ b/modules/ppcp-wc-gateway/src/Settings/Fields/pay-later-tab-fields.php @@ -25,7 +25,7 @@ return function ( ContainerInterface $container, array $fields ): array { $settings = $container->get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); - $vault_enabled = false;//$settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ); + $vault_enabled = $settings->has( 'vault_enabled' ) && $settings->get( 'vault_enabled' ); $pay_later_messaging_enabled_label = $vault_enabled ? __( "You have PayPal vaulting enabled, that's why Pay Later options are unavailable now. You cannot use both features at the same time.", 'woocommerce-paypal-payments' ) From 4c33f0bee3a99a4eafb841482c25172a55388046 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 28 Jun 2023 11:22:11 +0100 Subject: [PATCH 48/67] Add woocommerce-one-page-checkout detection in product page --- modules/ppcp-button/src/Helper/ContextTrait.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ppcp-button/src/Helper/ContextTrait.php b/modules/ppcp-button/src/Helper/ContextTrait.php index daddbb0a9..55169dac8 100644 --- a/modules/ppcp-button/src/Helper/ContextTrait.php +++ b/modules/ppcp-button/src/Helper/ContextTrait.php @@ -18,6 +18,12 @@ trait ContextTrait { */ protected function context(): string { if ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) { + + // Detection if "woocommerce-one-page-checkout" is enabled for this product. + if ( is_callable( 'is_wcopc_checkout' ) && is_wcopc_checkout( get_the_ID() ) ) { + return 'checkout'; + } + return 'product'; } From f517ac4719cbb2a1f5088d6db69afedbd0a66813 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Wed, 28 Jun 2023 15:15:49 +0100 Subject: [PATCH 49/67] Add checkout detection in product page --- modules/ppcp-button/src/Helper/ContextTrait.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/src/Helper/ContextTrait.php b/modules/ppcp-button/src/Helper/ContextTrait.php index 55169dac8..e1af3e3c0 100644 --- a/modules/ppcp-button/src/Helper/ContextTrait.php +++ b/modules/ppcp-button/src/Helper/ContextTrait.php @@ -19,8 +19,9 @@ trait ContextTrait { protected function context(): string { if ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) { - // Detection if "woocommerce-one-page-checkout" is enabled for this product. - if ( is_callable( 'is_wcopc_checkout' ) && is_wcopc_checkout( get_the_ID() ) ) { + // Do this check here instead of reordering outside conditions. + // In order to have more control over the context. + if ( ( is_checkout() ) && ! $this->is_paypal_continuation() ) { return 'checkout'; } From e94316aecd784abe33f7ea84d3aca1a2845018e0 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 3 Jul 2023 08:25:35 +0100 Subject: [PATCH 50/67] Add filter woocommerce_paypal_payments_product_button_disabled to disable PayPal buttons on single product page. --- .../ContextBootstrap/SingleProductBootstap.js | 3 ++- .../js/modules/Helper/ButtonDisabler.js | 5 ++++- modules/ppcp-button/src/Assets/SmartButton.php | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 540b085c1..8e88d0a2b 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -96,7 +96,8 @@ class SingleProductBootstap { return this.shouldRender() && !this.priceAmountIsZero() - && ((null === addToCartButton) || !addToCartButton.classList.contains('disabled')); + && ((null === addToCartButton) || !addToCartButton.classList.contains('disabled')) + && this.gateway.button.is_disabled !== true; } priceAmount() { diff --git a/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js index 9e4bf51ee..ae7f3665c 100644 --- a/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js +++ b/modules/ppcp-button/resources/js/modules/Helper/ButtonDisabler.js @@ -36,7 +36,10 @@ export const setEnabled = (selectorOrElement, enable, form = null) => { if (form) { // Trigger form submit to show the error message - jQuery(form).find(':submit').trigger('click'); + let $form = jQuery(form); + if ($form.find('.single_add_to_cart_button').hasClass('disabled')) { + $form.find(':submit').trigger('click'); + } } }) .find('> *') diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 4625fab5a..4ba295547 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -860,6 +860,7 @@ class SmartButton implements SmartButtonInterface { 'wrapper' => '#ppc-button-' . PayPalGateway::ID, 'mini_cart_wrapper' => '#ppc-button-minicart', 'cancel_wrapper' => '#ppcp-cancel', + 'is_disabled' => $this->is_button_disabled(), 'mini_cart_style' => array( 'layout' => $this->style_for_context( 'layout', 'mini-cart' ), 'color' => $this->style_for_context( 'color', 'mini-cart' ), @@ -1350,6 +1351,23 @@ class SmartButton implements SmartButtonInterface { ); } + protected function is_button_disabled(): bool { + if ( 'product' !== $this->context() ) { + return false; + } + + $product = wc_get_product(); + + /** + * Allows to decide if the button should be disabled for a given product + */ + return apply_filters( + 'woocommerce_paypal_payments_product_button_disabled', + false, + $product + ); + } + /** * Retrieves all payment tokens for the user, via API or cached if already queried. * From cdd4a69bf572e0e290133e7fa27e41725f0cdccb Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 3 Jul 2023 08:31:27 +0100 Subject: [PATCH 51/67] Fix lint --- modules/ppcp-button/src/Assets/SmartButton.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 4ba295547..68583f793 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -860,7 +860,7 @@ class SmartButton implements SmartButtonInterface { 'wrapper' => '#ppc-button-' . PayPalGateway::ID, 'mini_cart_wrapper' => '#ppc-button-minicart', 'cancel_wrapper' => '#ppcp-cancel', - 'is_disabled' => $this->is_button_disabled(), + 'is_disabled' => $this->is_button_disabled(), 'mini_cart_style' => array( 'layout' => $this->style_for_context( 'layout', 'mini-cart' ), 'color' => $this->style_for_context( 'color', 'mini-cart' ), @@ -1351,6 +1351,11 @@ class SmartButton implements SmartButtonInterface { ); } + /** + * Checks if PayPal buttons/messages should be rendered for the current page. + * + * @return bool + */ protected function is_button_disabled(): bool { if ( 'product' !== $this->context() ) { return false; From 74f28ca921a39e36d65c6fbf543693ebb7751370 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 3 Jul 2023 11:40:37 +0100 Subject: [PATCH 52/67] Add filter woocommerce_paypal_payments__button_disabled to disable PayPal buttons on a given context. --- .../modules/ContextBootstrap/CartBootstap.js | 13 ++++++ .../ContextBootstrap/CheckoutBootstap.js | 13 ++++++ .../ContextBootstrap/MiniCartBootstap.js | 13 ++++++ .../ppcp-button/src/Assets/SmartButton.php | 45 ++++++++++++++----- 4 files changed, 73 insertions(+), 11 deletions(-) diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js index 72d28932b..cc613da83 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js @@ -1,5 +1,6 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; import {setVisible} from "../Helper/Hiding"; +import {disable} from "../Helper/ButtonDisabler"; class CartBootstrap { constructor(gateway, renderer, errorHandler) { @@ -15,6 +16,13 @@ class CartBootstrap { this.render(); + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(); + disable(this.gateway.button.wrapper); + disable(this.gateway.messages.wrapper); + return; + } + jQuery(document.body).on('updated_cart_totals updated_checkout', () => { this.render(); @@ -44,6 +52,11 @@ class CartBootstrap { return document.querySelector(this.gateway.button.wrapper) !== null; } + shouldEnable() { + return this.shouldRender() + && this.gateway.button.is_disabled !== true; + } + render() { const actionHandler = new CartActionHandler( PayPalCommerceGateway, diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js index 59c6197a3..a42902d9b 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js @@ -5,6 +5,7 @@ import { isSavedCardSelected, ORDER_BUTTON_SELECTOR, PaymentMethods } from "../Helper/CheckoutMethodState"; +import {disable} from "../Helper/ButtonDisabler"; class CheckoutBootstap { constructor(gateway, renderer, messages, spinner, errorHandler) { @@ -20,6 +21,13 @@ class CheckoutBootstap { init() { this.render(); + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(); + disable(this.gateway.button.wrapper); + disable(this.gateway.messages.wrapper); + return; + } + // Unselect saved card. // WC saves form values, so with our current UI it would be a bit weird // if the user paid with saved, then after some time tries to pay again, @@ -51,6 +59,11 @@ class CheckoutBootstap { return document.querySelector(this.gateway.button.wrapper) !== null || document.querySelector(this.gateway.hosted_fields.wrapper) !== null; } + shouldEnable() { + return this.shouldRender() + && this.gateway.button.is_disabled !== true; + } + render() { if (!this.shouldRender()) { return; diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js index 443c9afe4..a391ee7cd 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js @@ -1,4 +1,5 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; +import {disable} from "../Helper/ButtonDisabler"; class MiniCartBootstap { constructor(gateway, renderer, errorHandler) { @@ -16,6 +17,13 @@ class MiniCartBootstap { ); this.render(); + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(); + disable(this.gateway.button.wrapper); + disable(this.gateway.messages.wrapper); + return; + } + jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => { this.render(); }); @@ -26,6 +34,11 @@ class MiniCartBootstap { || document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !== null; } + shouldEnable() { + return this.shouldRender() + && this.gateway.button.is_disabled !== true; + } + render() { if (!this.shouldRender()) { return; diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 68583f793..5a7341e77 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -1357,20 +1357,43 @@ class SmartButton implements SmartButtonInterface { * @return bool */ protected function is_button_disabled(): bool { - if ( 'product' !== $this->context() ) { - return false; + $context = $this->context(); + + if ( 'product' === $context ) { + $product = wc_get_product(); + + /** + * Allows to decide if the button should be disabled for a given product + */ + if ( ( $isDisabled = apply_filters( + 'woocommerce_paypal_payments_product_button_disabled', + null, + $product ) + ) !== null) { + return $isDisabled; + } + } else { + $filterName = 'woocommerce_paypal_payments_' + . str_replace('-', '_', $context) + . '_button_disabled'; + + /** + * Allows to decide if the button should be disabled in a given context + */ + if ( ( $isDisabled = apply_filters( $filterName, null ) ) !== null ) { + return $isDisabled; + } } - $product = wc_get_product(); + if ( ( $isDisabled = apply_filters( + 'woocommerce_paypal_payments_button_disabled', + null, + $context + ) ) !== null ) { + return $isDisabled; + } - /** - * Allows to decide if the button should be disabled for a given product - */ - return apply_filters( - 'woocommerce_paypal_payments_product_button_disabled', - false, - $product - ); + return false; } /** From 5fb72b58dc15f7a3d708dec79efd8432b6f7cbe9 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 3 Jul 2023 11:46:55 +0100 Subject: [PATCH 53/67] Remove hook rewrite filter for woocommerce_review_order_after_submit --- modules/ppcp-compat/src/CompatModule.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/modules/ppcp-compat/src/CompatModule.php b/modules/ppcp-compat/src/CompatModule.php index 059425be7..979056835 100644 --- a/modules/ppcp-compat/src/CompatModule.php +++ b/modules/ppcp-compat/src/CompatModule.php @@ -339,14 +339,6 @@ class CompatModule implements ModuleInterface { }, 5 ); - - add_filter( - 'woocommerce_paypal_payments_checkout_button_renderer_hook', - function(): string { - return 'woocommerce_review_order_after_submit'; - }, - 5 - ); } } From 3d61aa1ead0fed74e1714436bf1e7c5b264ea264 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 3 Jul 2023 17:17:45 +0300 Subject: [PATCH 54/67] Make the blocks integration (partial) available without feature flag The `woocommerce_paypal_payments_blocks_enabled` filter or `PCP_BLOCKS_ENABLED` env var are not used anymore, the blocks can be enabled in the settings without activating this feature flag first. --- .ddev/config.yaml | 1 - modules.php | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.ddev/config.yaml b/.ddev/config.yaml index b56e10cf2..d65593b7c 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -27,7 +27,6 @@ web_environment: - ADMIN_PASS=admin - ADMIN_EMAIL=admin@example.com - WC_VERSION=7.7.2 - - PCP_BLOCKS_ENABLED=1 # Key features of ddev's config.yaml: diff --git a/modules.php b/modules.php index 2962988ce..9bda3f6a4 100644 --- a/modules.php +++ b/modules.php @@ -26,14 +26,8 @@ return function ( string $root_dir ): iterable { ( require "$modules_dir/ppcp-vaulting/module.php" )(), ( require "$modules_dir/ppcp-order-tracking/module.php" )(), ( require "$modules_dir/ppcp-uninstall/module.php" )(), + ( require "$modules_dir/ppcp-blocks/module.php" )(), ); - if ( apply_filters( - 'woocommerce_paypal_payments_blocks_enabled', - getenv( 'PCP_BLOCKS_ENABLED' ) === '1' - ) ) { - $modules[] = ( require "$modules_dir/ppcp-blocks/module.php" )(); - } - return $modules; }; From 6b03960de78e257723091e0ca96e79a8eacf5080 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 3 Jul 2023 17:35:01 +0100 Subject: [PATCH 55/67] Refactor button renderer and filter woocommerce_paypal_payments__button_disabled --- modules/ppcp-button/resources/js/button.js | 15 +----- .../modules/ContextBootstrap/CartBootstap.js | 27 +++++++--- .../ContextBootstrap/CheckoutBootstap.js | 27 +++++++--- .../ContextBootstrap/MiniCartBootstap.js | 27 ++++++---- .../ContextBootstrap/SingleProductBootstap.js | 16 +++--- .../resources/js/modules/Renderer/Renderer.js | 51 +++++++++++++++---- .../ppcp-button/src/Assets/SmartButton.php | 51 ++++++++++--------- 7 files changed, 131 insertions(+), 83 deletions(-) diff --git a/modules/ppcp-button/resources/js/button.js b/modules/ppcp-button/resources/js/button.js index 0fbccd095..17fcf1bfd 100644 --- a/modules/ppcp-button/resources/js/button.js +++ b/modules/ppcp-button/resources/js/button.js @@ -122,21 +122,10 @@ const bootstrap = () => { } }; - let smartButtonsOptions = { - onInit: null, - init: function (actions) { - this.actions = actions; - if (typeof this.onInit === 'function') { - this.onInit(); - } - } - }; - - const onSmartButtonsInit = (data, actions) => { + const onSmartButtonsInit = () => { buttonsSpinner.unblock(); - smartButtonsOptions.init(actions); }; - const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit, smartButtonsOptions); + const renderer = new Renderer(creditCardRenderer, PayPalCommerceGateway, onSmartButtonClick, onSmartButtonsInit); const messageRenderer = new MessageRenderer(PayPalCommerceGateway.messages); const context = PayPalCommerceGateway.context; if (context === 'mini-cart' || context === 'product') { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js index cc613da83..978ee2578 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js @@ -1,12 +1,16 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; import {setVisible} from "../Helper/Hiding"; -import {disable} from "../Helper/ButtonDisabler"; +import {disable, enable} from "../Helper/ButtonDisabler"; class CartBootstrap { constructor(gateway, renderer, errorHandler) { this.gateway = gateway; this.renderer = renderer; this.errorHandler = errorHandler; + + this.renderer.onButtonsInit(this.gateway.button.wrapper, () => { + this.handleButtonStatus(); + }, true); } init() { @@ -15,16 +19,11 @@ class CartBootstrap { } this.render(); - - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(); - disable(this.gateway.button.wrapper); - disable(this.gateway.messages.wrapper); - return; - } + this.handleButtonStatus(); jQuery(document.body).on('updated_cart_totals updated_checkout', () => { this.render(); + this.handleButtonStatus(); fetch( this.gateway.ajax.cart_script_params.endpoint, @@ -48,6 +47,18 @@ class CartBootstrap { }); } + handleButtonStatus() { + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(this.gateway.button.wrapper); + disable(this.gateway.button.wrapper); + disable(this.gateway.messages.wrapper); + return; + } + this.renderer.enableSmartButtons(this.gateway.button.wrapper); + enable(this.gateway.button.wrapper); + enable(this.gateway.messages.wrapper); + } + shouldRender() { return document.querySelector(this.gateway.button.wrapper) !== null; } diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js index a42902d9b..551baa75b 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js @@ -5,7 +5,7 @@ import { isSavedCardSelected, ORDER_BUTTON_SELECTOR, PaymentMethods } from "../Helper/CheckoutMethodState"; -import {disable} from "../Helper/ButtonDisabler"; +import {disable, enable} from "../Helper/ButtonDisabler"; class CheckoutBootstap { constructor(gateway, renderer, messages, spinner, errorHandler) { @@ -16,17 +16,15 @@ class CheckoutBootstap { this.errorHandler = errorHandler; this.standardOrderButtonSelector = ORDER_BUTTON_SELECTOR; + + this.renderer.onButtonsInit(this.gateway.button.wrapper, () => { + this.handleButtonStatus(); + }, true); } init() { this.render(); - - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(); - disable(this.gateway.button.wrapper); - disable(this.gateway.messages.wrapper); - return; - } + this.handleButtonStatus(); // Unselect saved card. // WC saves form values, so with our current UI it would be a bit weird @@ -36,6 +34,7 @@ class CheckoutBootstap { jQuery(document.body).on('updated_checkout', () => { this.render() + this.handleButtonStatus(); }); jQuery(document.body).on('updated_checkout payment_method_selected', () => { @@ -51,6 +50,18 @@ class CheckoutBootstap { this.updateUi(); } + handleButtonStatus() { + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(this.gateway.button.wrapper); + disable(this.gateway.button.wrapper); + disable(this.gateway.messages.wrapper); + return; + } + this.renderer.enableSmartButtons(this.gateway.button.wrapper); + enable(this.gateway.button.wrapper); + enable(this.gateway.messages.wrapper); + } + shouldRender() { if (document.querySelector(this.gateway.button.cancel_wrapper)) { return false; diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js index a391ee7cd..c993f3be0 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js @@ -1,5 +1,5 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; -import {disable} from "../Helper/ButtonDisabler"; +import {disable, enable} from "../Helper/ButtonDisabler"; class MiniCartBootstap { constructor(gateway, renderer, errorHandler) { @@ -16,17 +16,26 @@ class MiniCartBootstap { this.errorHandler, ); this.render(); - - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(); - disable(this.gateway.button.wrapper); - disable(this.gateway.messages.wrapper); - return; - } + this.handleButtonStatus(); jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => { this.render(); + this.handleButtonStatus(); }); + + this.renderer.onButtonsInit(this.gateway.button.mini_cart_wrapper, () => { + this.handleButtonStatus(); + }, true); + } + + handleButtonStatus() { + if (!this.shouldEnable()) { + this.renderer.disableSmartButtons(this.gateway.button.mini_cart_wrapper); + disable(this.gateway.button.mini_cart_wrapper); + return; + } + this.renderer.enableSmartButtons(this.gateway.button.mini_cart_wrapper); + enable(this.gateway.button.mini_cart_wrapper); } shouldRender() { @@ -36,7 +45,7 @@ class MiniCartBootstap { shouldEnable() { return this.shouldRender() - && this.gateway.button.is_disabled !== true; + && this.gateway.button.is_mini_cart_disabled !== true; } render() { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index 8e88d0a2b..b7addb4a5 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -12,11 +12,9 @@ class SingleProductBootstap { this.mutationObserver = new MutationObserver(this.handleChange.bind(this)); this.formSelector = 'form.cart'; - if (this.renderer && this.renderer.smartButtonsOptions) { - this.renderer.smartButtonsOptions.onInit = () => { - this.handleChange(); - }; - } + this.renderer.onButtonsInit(this.gateway.button.wrapper, () => { + this.handleChange(); + }, true); } form() { @@ -25,7 +23,7 @@ class SingleProductBootstap { handleChange() { if (!this.shouldRender()) { - this.renderer.disableSmartButtons(); + this.renderer.disableSmartButtons(this.gateway.button.wrapper); hide(this.gateway.button.wrapper, this.formSelector); hide(this.gateway.messages.wrapper); return; @@ -33,7 +31,7 @@ class SingleProductBootstap { this.render(); - this.renderer.enableSmartButtons(); + this.renderer.enableSmartButtons(this.gateway.button.wrapper); show(this.gateway.button.wrapper); show(this.gateway.messages.wrapper); @@ -42,12 +40,12 @@ class SingleProductBootstap { handleButtonStatus() { if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(); + this.renderer.disableSmartButtons(this.gateway.button.wrapper); disable(this.gateway.button.wrapper, this.formSelector); disable(this.gateway.messages.wrapper); return; } - this.renderer.enableSmartButtons(); + this.renderer.enableSmartButtons(this.gateway.button.wrapper); enable(this.gateway.button.wrapper); enable(this.gateway.messages.wrapper); } diff --git a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js index efd3c0bfa..1f0e3d31a 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js @@ -1,12 +1,14 @@ import merge from "deepmerge"; class Renderer { - constructor(creditCardRenderer, defaultSettings, onSmartButtonClick, onSmartButtonsInit, smartButtonsOptions) { + constructor(creditCardRenderer, defaultSettings, onSmartButtonClick, onSmartButtonsInit) { this.defaultSettings = defaultSettings; this.creditCardRenderer = creditCardRenderer; this.onSmartButtonClick = onSmartButtonClick; this.onSmartButtonsInit = onSmartButtonsInit; - this.smartButtonsOptions = smartButtonsOptions; + + this.buttonsOptions = {}; + this.onButtonsInitListeners = {}; this.renderedSources = new Set(); } @@ -78,7 +80,10 @@ class Renderer { style, ...contextConfig, onClick: this.onSmartButtonClick, - onInit: this.onSmartButtonsInit, + onInit: (data, actions) => { + this.onSmartButtonsInit(data, actions); + this.handleOnButtonsInit(wrapper, data, actions); + }, }); if (!btn.isEligible()) { return; @@ -108,18 +113,42 @@ class Renderer { this.creditCardRenderer.enableFields(); } - disableSmartButtons() { - if (!this.smartButtonsOptions || !this.smartButtonsOptions.actions) { - return; - } - this.smartButtonsOptions.actions.disable(); + onButtonsInit(wrapper, handler, reset) { + this.onButtonsInitListeners[wrapper] = reset ? [] : (this.onButtonsInitListeners[wrapper] || []); + this.onButtonsInitListeners[wrapper].push(handler); } - enableSmartButtons() { - if (!this.smartButtonsOptions || !this.smartButtonsOptions.actions) { + handleOnButtonsInit(wrapper, data, actions) { + + this.buttonsOptions[wrapper] = { + data: data, + actions: actions + } + + if (this.onButtonsInitListeners[wrapper]) { + for (let handler of this.onButtonsInitListeners[wrapper]) { + if (typeof handler === 'function') { + handler({ + wrapper: wrapper, + ...this.buttonsOptions[wrapper] + }); + } + } + } + } + + disableSmartButtons(wrapper) { + if (!this.buttonsOptions[wrapper]) { return; } - this.smartButtonsOptions.actions.enable(); + this.buttonsOptions[wrapper].actions.disable(); + } + + enableSmartButtons(wrapper) { + if (!this.buttonsOptions[wrapper]) { + return; + } + this.buttonsOptions[wrapper].actions.enable(); } } diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 5a7341e77..e64633d1f 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -857,11 +857,12 @@ class SmartButton implements SmartButtonInterface { 'bn_codes' => $this->bn_codes(), 'payer' => $this->payerData(), 'button' => array( - 'wrapper' => '#ppc-button-' . PayPalGateway::ID, - 'mini_cart_wrapper' => '#ppc-button-minicart', - 'cancel_wrapper' => '#ppcp-cancel', - 'is_disabled' => $this->is_button_disabled(), - 'mini_cart_style' => array( + 'wrapper' => '#ppc-button-' . PayPalGateway::ID, + 'is_disabled' => $this->is_button_disabled(), + 'mini_cart_wrapper' => '#ppc-button-minicart', + 'is_mini_cart_disabled' => $this->is_button_disabled( 'mini-cart' ), + 'cancel_wrapper' => '#ppcp-cancel', + 'mini_cart_style' => array( 'layout' => $this->style_for_context( 'layout', 'mini-cart' ), 'color' => $this->style_for_context( 'color', 'mini-cart' ), 'shape' => $this->style_for_context( 'shape', 'mini-cart' ), @@ -869,7 +870,7 @@ class SmartButton implements SmartButtonInterface { 'tagline' => $this->style_for_context( 'tagline', 'mini-cart' ), 'height' => $this->settings->has( 'button_mini-cart_height' ) && $this->settings->get( 'button_mini-cart_height' ) ? $this->normalize_height( (int) $this->settings->get( 'button_mini-cart_height' ) ) : 35, ), - 'style' => array( + 'style' => array( 'layout' => $this->style_for_context( 'layout', $this->context() ), 'color' => $this->style_for_context( 'color', $this->context() ), 'shape' => $this->style_for_context( 'shape', $this->context() ), @@ -1354,10 +1355,14 @@ class SmartButton implements SmartButtonInterface { /** * Checks if PayPal buttons/messages should be rendered for the current page. * + * @param string|null $context The context that should be checked, use default otherwise. + * * @return bool */ - protected function is_button_disabled(): bool { - $context = $this->context(); + protected function is_button_disabled( string $context = null ): bool { + if ( null === $context ) { + $context = $this->context(); + } if ( 'product' === $context ) { $product = wc_get_product(); @@ -1365,32 +1370,28 @@ class SmartButton implements SmartButtonInterface { /** * Allows to decide if the button should be disabled for a given product */ - if ( ( $isDisabled = apply_filters( + $is_disabled = apply_filters( 'woocommerce_paypal_payments_product_button_disabled', null, - $product ) - ) !== null) { - return $isDisabled; - } - } else { - $filterName = 'woocommerce_paypal_payments_' - . str_replace('-', '_', $context) - . '_button_disabled'; + $product + ); - /** - * Allows to decide if the button should be disabled in a given context - */ - if ( ( $isDisabled = apply_filters( $filterName, null ) ) !== null ) { - return $isDisabled; + if ( $is_disabled !== null ) { + return $is_disabled; } } - if ( ( $isDisabled = apply_filters( + /** + * Allows to decide if the button should be disabled globally or on a given context + */ + $is_disabled = apply_filters( 'woocommerce_paypal_payments_button_disabled', null, $context - ) ) !== null ) { - return $isDisabled; + ); + + if ( $is_disabled !== null ) { + return $is_disabled; } return false; From 87665401e5ea83213b3160dfcb205bcd2b50ba38 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 4 Jul 2023 08:29:48 +0100 Subject: [PATCH 56/67] Change filter names to plural woocommerce_paypal_payments_buttons_disabled and woocommerce_paypal_payments_product_buttons_disabled --- modules/ppcp-button/src/Assets/SmartButton.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index e64633d1f..1516843b5 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -1371,7 +1371,7 @@ class SmartButton implements SmartButtonInterface { * Allows to decide if the button should be disabled for a given product */ $is_disabled = apply_filters( - 'woocommerce_paypal_payments_product_button_disabled', + 'woocommerce_paypal_payments_product_buttons_disabled', null, $product ); @@ -1385,7 +1385,7 @@ class SmartButton implements SmartButtonInterface { * Allows to decide if the button should be disabled globally or on a given context */ $is_disabled = apply_filters( - 'woocommerce_paypal_payments_button_disabled', + 'woocommerce_paypal_payments_buttons_disabled', null, $context ); From d20d4dd35382b0b028496f2caa621aa7ac11ea38 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 4 Jul 2023 15:31:19 +0300 Subject: [PATCH 57/67] Check order id before requesting order --- modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php b/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php index 6cc9c7ce4..d2e2b6fef 100644 --- a/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php +++ b/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php @@ -166,7 +166,7 @@ class OrderProcessor { // phpcs:ignore WordPress.Security.NonceVerification $order_id = $wc_order->get_meta( PayPalGateway::ORDER_ID_META_KEY ) ?: wc_clean( wp_unslash( $_POST['paypal_order_id'] ?? '' ) ); $order = $this->session_handler->order(); - if ( ! $order && is_string( $order_id ) ) { + if ( ! $order && is_string( $order_id ) && $order_id ) { $order = $this->order_endpoint->order( $order_id ); } if ( ! $order ) { From 298a72b6c5d2d7f20bebb32534cb8768919ecdf3 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 4 Jul 2023 15:32:41 +0300 Subject: [PATCH 58/67] Improve error message --- modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php b/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php index d2e2b6fef..443fd1cbd 100644 --- a/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php +++ b/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php @@ -178,7 +178,7 @@ class OrderProcessor { $wc_order->get_id() ) ); - $this->last_error = __( 'Could not retrieve order. This browser may not be supported. Please try again with a different browser.', 'woocommerce-paypal-payments' ); + $this->last_error = __( 'Could not retrieve order. Maybe it was already completed or this browser is not supported. Please check your email or try again with a different browser.', 'woocommerce-paypal-payments' ); return false; } From 4a74911f6d5729c06b8b8f9b7a8a0259d38a5f93 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 4 Jul 2023 16:43:37 +0300 Subject: [PATCH 59/67] Fix funding source check --- modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php index 9ac7aea26..686b87dd8 100644 --- a/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php +++ b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php @@ -298,7 +298,7 @@ class CreateOrderEndpoint implements EndpointInterface { } if ( 'checkout' === $data['context'] ) { - if ( ! in_array( $funding_source, $this->funding_sources_without_redirect, true ) ) { + if ( $payment_method === PayPalGateway::ID && ! in_array( $funding_source, $this->funding_sources_without_redirect, true ) ) { $this->session_handler->replace_order( $order ); $this->session_handler->replace_funding_source( $funding_source ); } From f6e625718ea2de64096f2953557171d4bde704e0 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 4 Jul 2023 14:43:55 +0100 Subject: [PATCH 60/67] Refactor handleButtonStatus and shouldEnable methods in buttons bootstraps --- .../modules/ContextBootstrap/CartBootstap.js | 15 ++----- .../ContextBootstrap/CheckoutBootstap.js | 14 ++----- .../ContextBootstrap/MiniCartBootstap.js | 18 ++++----- .../ContextBootstrap/SingleProductBootstap.js | 19 +++------ .../js/modules/Helper/BootstrapHelper.js | 40 +++++++++++++++++++ 5 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 modules/ppcp-button/resources/js/modules/Helper/BootstrapHelper.js diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js index 978ee2578..504fc4c42 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CartBootstap.js @@ -1,6 +1,6 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; +import BootstrapHelper from "../Helper/BootstrapHelper"; import {setVisible} from "../Helper/Hiding"; -import {disable, enable} from "../Helper/ButtonDisabler"; class CartBootstrap { constructor(gateway, renderer, errorHandler) { @@ -48,15 +48,7 @@ class CartBootstrap { } handleButtonStatus() { - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(this.gateway.button.wrapper); - disable(this.gateway.button.wrapper); - disable(this.gateway.messages.wrapper); - return; - } - this.renderer.enableSmartButtons(this.gateway.button.wrapper); - enable(this.gateway.button.wrapper); - enable(this.gateway.messages.wrapper); + BootstrapHelper.handleButtonStatus(this); } shouldRender() { @@ -64,8 +56,7 @@ class CartBootstrap { } shouldEnable() { - return this.shouldRender() - && this.gateway.button.is_disabled !== true; + return BootstrapHelper.shouldEnable(this); } render() { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js index 551baa75b..b426ac3ee 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js @@ -5,6 +5,7 @@ import { isSavedCardSelected, ORDER_BUTTON_SELECTOR, PaymentMethods } from "../Helper/CheckoutMethodState"; +import BootstrapHelper from "../Helper/BootstrapHelper"; import {disable, enable} from "../Helper/ButtonDisabler"; class CheckoutBootstap { @@ -51,15 +52,7 @@ class CheckoutBootstap { } handleButtonStatus() { - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(this.gateway.button.wrapper); - disable(this.gateway.button.wrapper); - disable(this.gateway.messages.wrapper); - return; - } - this.renderer.enableSmartButtons(this.gateway.button.wrapper); - enable(this.gateway.button.wrapper); - enable(this.gateway.messages.wrapper); + BootstrapHelper.handleButtonStatus(this); } shouldRender() { @@ -71,8 +64,7 @@ class CheckoutBootstap { } shouldEnable() { - return this.shouldRender() - && this.gateway.button.is_disabled !== true; + return BootstrapHelper.shouldEnable(this); } render() { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js index c993f3be0..4b4e3efd6 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/MiniCartBootstap.js @@ -1,5 +1,5 @@ import CartActionHandler from '../ActionHandler/CartActionHandler'; -import {disable, enable} from "../Helper/ButtonDisabler"; +import BootstrapHelper from "../Helper/BootstrapHelper"; class MiniCartBootstap { constructor(gateway, renderer, errorHandler) { @@ -29,13 +29,10 @@ class MiniCartBootstap { } handleButtonStatus() { - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(this.gateway.button.mini_cart_wrapper); - disable(this.gateway.button.mini_cart_wrapper); - return; - } - this.renderer.enableSmartButtons(this.gateway.button.mini_cart_wrapper); - enable(this.gateway.button.mini_cart_wrapper); + BootstrapHelper.handleButtonStatus(this, { + wrapper: this.gateway.button.mini_cart_wrapper, + skipMessages: true + }); } shouldRender() { @@ -44,8 +41,9 @@ class MiniCartBootstap { } shouldEnable() { - return this.shouldRender() - && this.gateway.button.is_mini_cart_disabled !== true; + return BootstrapHelper.shouldEnable(this, { + isDisabled: !!this.gateway.button.is_mini_cart_disabled + }); } render() { diff --git a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js index b7addb4a5..231460642 100644 --- a/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js +++ b/modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstap.js @@ -1,7 +1,7 @@ import UpdateCart from "../Helper/UpdateCart"; import SingleProductActionHandler from "../ActionHandler/SingleProductActionHandler"; import {hide, show} from "../Helper/Hiding"; -import {disable, enable} from "../Helper/ButtonDisabler"; +import BootstrapHelper from "../Helper/BootstrapHelper"; class SingleProductBootstap { constructor(gateway, renderer, messages, errorHandler) { @@ -39,15 +39,9 @@ class SingleProductBootstap { } handleButtonStatus() { - if (!this.shouldEnable()) { - this.renderer.disableSmartButtons(this.gateway.button.wrapper); - disable(this.gateway.button.wrapper, this.formSelector); - disable(this.gateway.messages.wrapper); - return; - } - this.renderer.enableSmartButtons(this.gateway.button.wrapper); - enable(this.gateway.button.wrapper); - enable(this.gateway.messages.wrapper); + BootstrapHelper.handleButtonStatus(this, { + formSelector: this.formSelector + }); } init() { @@ -92,10 +86,9 @@ class SingleProductBootstap { const form = this.form(); const addToCartButton = form ? form.querySelector('.single_add_to_cart_button') : null; - return this.shouldRender() + return BootstrapHelper.shouldEnable(this) && !this.priceAmountIsZero() - && ((null === addToCartButton) || !addToCartButton.classList.contains('disabled')) - && this.gateway.button.is_disabled !== true; + && ((null === addToCartButton) || !addToCartButton.classList.contains('disabled')); } priceAmount() { diff --git a/modules/ppcp-button/resources/js/modules/Helper/BootstrapHelper.js b/modules/ppcp-button/resources/js/modules/Helper/BootstrapHelper.js new file mode 100644 index 000000000..ba00e2c76 --- /dev/null +++ b/modules/ppcp-button/resources/js/modules/Helper/BootstrapHelper.js @@ -0,0 +1,40 @@ +import {disable, enable} from "./ButtonDisabler"; + +/** + * Common Bootstrap methods to avoid code repetition. + */ +export default class BootstrapHelper { + + static handleButtonStatus(bs, options) { + options = options || {}; + options.wrapper = options.wrapper || bs.gateway.button.wrapper; + options.messagesWrapper = options.messagesWrapper || bs.gateway.messages.wrapper; + options.skipMessages = options.skipMessages || false; + + if (!bs.shouldEnable()) { + bs.renderer.disableSmartButtons(options.wrapper); + disable(options.wrapper, options.formSelector || null); + + if (!options.skipMessages) { + disable(options.messagesWrapper); + } + return; + } + bs.renderer.enableSmartButtons(options.wrapper); + enable(options.wrapper); + + if (!options.skipMessages) { + enable(options.messagesWrapper); + } + } + + static shouldEnable(bs, options) { + options = options || {}; + if (typeof options.isDisabled === 'undefined') { + options.isDisabled = bs.gateway.button.is_disabled; + } + + return bs.shouldRender() + && options.isDisabled !== true; + } +} From 45c69350e37704a615b7802591218b979c11549c Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Tue, 4 Jul 2023 17:29:44 +0200 Subject: [PATCH 61/67] Fix skip empty key logic --- modules/ppcp-vaulting/src/VaultingModule.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index debe8c1f5..0c2c283b0 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -249,10 +249,10 @@ class VaultingModule implements ModuleInterface { $timestamp = time(); foreach ( $customers as $id ) { - $metadata_exist = metadata_exists( 'user', $id, 'ppcp-vault-token' ); + $tokens = array_filter( get_user_meta( $id, 'ppcp-vault-token' ) ); $skip_empty_key_migration = apply_filters( 'ppcp_skip_payment_tokens_empty_key_migration', true ); - if ( ! $metadata_exist && $skip_empty_key_migration ) { - return; + if ( empty( $tokens ) && $skip_empty_key_migration ) { + continue; } /** From 04adf15df2823face11e0c2dea72d4fc9a27185d Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Wed, 5 Jul 2023 17:04:33 +0200 Subject: [PATCH 62/67] Update user tokens migration message --- modules/ppcp-vaulting/src/VaultingModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ppcp-vaulting/src/VaultingModule.php b/modules/ppcp-vaulting/src/VaultingModule.php index 0c2c283b0..5b7251abb 100644 --- a/modules/ppcp-vaulting/src/VaultingModule.php +++ b/modules/ppcp-vaulting/src/VaultingModule.php @@ -242,7 +242,7 @@ class VaultingModule implements ModuleInterface { return; } - $logger->info( 'Starting payment tokens migration for ' . (string) count( $customers ) . ' users' ); + $logger->info( 'Identified ' . (string) count( $customers ) . ' users with payment tokens. Initiating token migration.' ); update_option( 'ppcp_payment_tokens_migration_initialized', true ); $interval_in_seconds = 5; From a0e125841bfd97dd5c05ca37db07366af4149e54 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Thu, 6 Jul 2023 11:01:48 +0200 Subject: [PATCH 63/67] Bump 2.2.0 version --- changelog.txt | 21 +++++++++++++++++++++ package.json | 2 +- readme.txt | 23 ++++++++++++++++++++++- woocommerce-paypal-payments.php | 6 +++--- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index ee1e2256c..2df55a0ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,26 @@ *** Changelog *** += 2.2.0 - TBD = +* Fix - iDeal Payment method have never worked #1233 +* Fix - Use order currency instead of shop currency on order-pay page #1363 +* Fix - Do not show broken card button gateway when no checkout location #1358 +* Fix - Smart buttons not greyed out/removed on single product when deselecting product variation #1469 +* Fix - Type error with advanced columns pro #1367 +* Fix - Undefined array key 0 when checking $retry_errors in process_payment method #1375 +* Fix - Advanced Card Processing gateway becomes invisible post-plugin update unless admin pages are accessed once #1432 +* Fix - Incompatibility with WooCommerce One Page Checkout (or similar use cases) in Version 2.1.0 #1473 +* Fix - Prevent Repetitive Token Migration and Database Overload After 2.1.0 Update #1461 +* Enhancement - Make the blocks integration (partial) available without feature flag #1483 +* Enhancement - Add notice when shop currency is unsupported #1433 +* Enhancement - Improve ACDC error message when empty fields #1360 +* Enhancement - Do not exclude free items #1362 +* Enhancement - Trigger WC checkout_error event #1384 +* Enhancement - Update wording in buttons previews #1408 +* Enhancement - Filter to conditionally block the PayPal buttons #1485 +* Enhancement - Display funding source on the admin order page #1450 +* Enhancement - Update system report plugin status for Vaulting #1471 +* Enhancement - Revert Elementor Pro Checkout hook compatibility #1482 + = 2.1.0 - 2023-06-13 = * Fix - Performance issue #1182 * Fix - Webhooks not registered when onboarding with manual credentials #1223 diff --git a/package.json b/package.json index ccc69d50d..47a99da9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "woocommerce-paypal-payments", - "version": "2.1.0", + "version": "2.2.0", "description": "WooCommerce PayPal Payments", "repository": "https://github.com/woocommerce/woocommerce-paypal-payments", "license": "GPL-2.0", diff --git a/readme.txt b/readme.txt index b46a5283a..3b3b7cabf 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: woocommerce, paypal, payments, ecommerce, e-commerce, store, sales, sell, Requires at least: 5.3 Tested up to: 6.2 Requires PHP: 7.2 -Stable tag: 2.1.0 +Stable tag: 2.2.0 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -81,6 +81,27 @@ Follow the steps below to connect the plugin to your PayPal account: == Changelog == += 2.2.0 - TBD = +* Fix - iDeal Payment method have never worked #1233 +* Fix - Use order currency instead of shop currency on order-pay page #1363 +* Fix - Do not show broken card button gateway when no checkout location #1358 +* Fix - Smart buttons not greyed out/removed on single product when deselecting product variation #1469 +* Fix - Type error with advanced columns pro #1367 +* Fix - Undefined array key 0 when checking $retry_errors in process_payment method #1375 +* Fix - Advanced Card Processing gateway becomes invisible post-plugin update unless admin pages are accessed once #1432 +* Fix - Incompatibility with WooCommerce One Page Checkout (or similar use cases) in Version 2.1.0 #1473 +* Fix - Prevent Repetitive Token Migration and Database Overload After 2.1.0 Update #1461 +* Enhancement - Make the blocks integration (partial) available without feature flag #1483 +* Enhancement - Add notice when shop currency is unsupported #1433 +* Enhancement - Improve ACDC error message when empty fields #1360 +* Enhancement - Do not exclude free items #1362 +* Enhancement - Trigger WC checkout_error event #1384 +* Enhancement - Update wording in buttons previews #1408 +* Enhancement - Filter to conditionally block the PayPal buttons #1485 +* Enhancement - Display funding source on the admin order page #1450 +* Enhancement - Update system report plugin status for Vaulting #1471 +* Enhancement - Revert Elementor Pro Checkout hook compatibility #1482 + = 2.1.0 - 2023-06-13 = * Fix - Performance issue #1182 * Fix - Webhooks not registered when onboarding with manual credentials #1223 diff --git a/woocommerce-paypal-payments.php b/woocommerce-paypal-payments.php index 4fad31bcd..86a30e525 100644 --- a/woocommerce-paypal-payments.php +++ b/woocommerce-paypal-payments.php @@ -3,13 +3,13 @@ * Plugin Name: WooCommerce PayPal Payments * Plugin URI: https://woocommerce.com/products/woocommerce-paypal-payments/ * Description: PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage. - * Version: 2.1.0 + * Version: 2.2.0 * Author: WooCommerce * Author URI: https://woocommerce.com/ * License: GPL-2.0 * Requires PHP: 7.2 * WC requires at least: 3.9 - * WC tested up to: 7.7 + * WC tested up to: 7.8 * Text Domain: woocommerce-paypal-payments * * @package WooCommerce\PayPalCommerce @@ -23,7 +23,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; define( 'PAYPAL_API_URL', 'https://api.paypal.com' ); define( 'PAYPAL_SANDBOX_API_URL', 'https://api.sandbox.paypal.com' ); -define( 'PAYPAL_INTEGRATION_DATE', '2023-06-02' ); +define( 'PAYPAL_INTEGRATION_DATE', '2023-07-06' ); ! defined( 'CONNECT_WOO_CLIENT_ID' ) && define( 'CONNECT_WOO_CLIENT_ID', 'AcCAsWta_JTL__OfpjspNyH7c1GGHH332fLwonA5CwX4Y10mhybRZmHLA0GdRbwKwjQIhpDQy0pluX_P' ); ! defined( 'CONNECT_WOO_SANDBOX_CLIENT_ID' ) && define( 'CONNECT_WOO_SANDBOX_CLIENT_ID', 'AYmOHbt1VHg-OZ_oihPdzKEVbU3qg0qXonBcAztuzniQRaKE0w1Hr762cSFwd4n8wxOl-TCWohEa0XM_' ); From dd0e8a2fdb1f94cb78ab4ced9ab7e2688656b1db Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Thu, 6 Jul 2023 11:34:18 +0200 Subject: [PATCH 64/67] Update changelog --- changelog.txt | 4 ++-- readme.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2df55a0ab..37e6ce54e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ *** Changelog *** = 2.2.0 - TBD = -* Fix - iDeal Payment method have never worked #1233 +* Fix - Improve handling of APM payments when buyer did not return to Checkout #1233 * Fix - Use order currency instead of shop currency on order-pay page #1363 * Fix - Do not show broken card button gateway when no checkout location #1358 * Fix - Smart buttons not greyed out/removed on single product when deselecting product variation #1469 @@ -10,7 +10,7 @@ * Fix - Advanced Card Processing gateway becomes invisible post-plugin update unless admin pages are accessed once #1432 * Fix - Incompatibility with WooCommerce One Page Checkout (or similar use cases) in Version 2.1.0 #1473 * Fix - Prevent Repetitive Token Migration and Database Overload After 2.1.0 Update #1461 -* Enhancement - Make the blocks integration (partial) available without feature flag #1483 +* Enhancement - Remove feature flag requirement for express cart/checkout block integration #1483 * Enhancement - Add notice when shop currency is unsupported #1433 * Enhancement - Improve ACDC error message when empty fields #1360 * Enhancement - Do not exclude free items #1362 diff --git a/readme.txt b/readme.txt index 3b3b7cabf..7c9d182c4 100644 --- a/readme.txt +++ b/readme.txt @@ -82,7 +82,7 @@ Follow the steps below to connect the plugin to your PayPal account: == Changelog == = 2.2.0 - TBD = -* Fix - iDeal Payment method have never worked #1233 +* Fix - Improve handling of APM payments when buyer did not return to Checkout #1233 * Fix - Use order currency instead of shop currency on order-pay page #1363 * Fix - Do not show broken card button gateway when no checkout location #1358 * Fix - Smart buttons not greyed out/removed on single product when deselecting product variation #1469 @@ -91,7 +91,7 @@ Follow the steps below to connect the plugin to your PayPal account: * Fix - Advanced Card Processing gateway becomes invisible post-plugin update unless admin pages are accessed once #1432 * Fix - Incompatibility with WooCommerce One Page Checkout (or similar use cases) in Version 2.1.0 #1473 * Fix - Prevent Repetitive Token Migration and Database Overload After 2.1.0 Update #1461 -* Enhancement - Make the blocks integration (partial) available without feature flag #1483 +* Enhancement - Remove feature flag requirement for express cart/checkout block integration #1483 * Enhancement - Add notice when shop currency is unsupported #1433 * Enhancement - Improve ACDC error message when empty fields #1360 * Enhancement - Do not exclude free items #1362 From 9802495c8c36c547a1a0a0b05b543864aeda2620 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 11 Jul 2023 09:15:02 +0300 Subject: [PATCH 65/67] Improve continuation mode label --- modules/ppcp-session/src/Cancellation/CancelView.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-session/src/Cancellation/CancelView.php b/modules/ppcp-session/src/Cancellation/CancelView.php index 2242b15c1..260bfcace 100644 --- a/modules/ppcp-session/src/Cancellation/CancelView.php +++ b/modules/ppcp-session/src/Cancellation/CancelView.php @@ -63,13 +63,13 @@ class CancelView { printf( // translators: %3$ is funding source like "PayPal" or "Venmo", other placeholders are html tags for a link. esc_html__( - 'You are currently paying with %3$s. If you want to cancel - this process, please click %1$shere%2$s.', + 'You are currently paying with %3$s. %4$s%1$sChoose another payment method%2$s.', 'woocommerce-paypal-payments' ), '', '', - esc_html( $name ) + esc_html( $name ), + '
' ); ?>

From d83eace9b83988957224277405f982d47905d908 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 11 Jul 2023 09:15:36 +0300 Subject: [PATCH 66/67] Show buttons in block editing --- modules/ppcp-blocks/resources/js/checkout-block.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-blocks/resources/js/checkout-block.js b/modules/ppcp-blocks/resources/js/checkout-block.js index 1766fcf26..bec1827c3 100644 --- a/modules/ppcp-blocks/resources/js/checkout-block.js +++ b/modules/ppcp-blocks/resources/js/checkout-block.js @@ -16,6 +16,7 @@ const PayPalComponent = ({ emitResponse, activePaymentMethod, shippingData, + isEditing, }) => { const {onPaymentSetup, onCheckoutAfterProcessingWithError} = eventRegistration; const {responseTypes} = emitResponse; @@ -125,6 +126,10 @@ const PayPalComponent = ({ }; const handleClick = (data, actions) => { + if (isEditing) { + return actions.reject(); + } + window.ppcpFundingSource = data.fundingSource; onClick(); @@ -259,8 +264,8 @@ if (config.scriptData.continuation) { registerMethod({ name: config.id, label:
, - content: , - edit: TODO: editing, + content: , + edit: , ariaLabel: config.title, canMakePayment: () => config.enabled, supports: { From f67db5c5241c0715b10de6f7f7ba030bea8d0013 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 11 Jul 2023 11:31:34 +0300 Subject: [PATCH 67/67] Check that event handler is not null It is passed as null in https://github.com/woocommerce/woocommerce-paypal-payments/blob/5a0b0b41a9478a133df732f8d29f46b97cce54e2/modules/ppcp-wc-gateway/resources/js/gateway-settings.js#L85 --- modules/ppcp-button/resources/js/modules/Renderer/Renderer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js index 1f0e3d31a..ae0997c17 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/Renderer.js @@ -81,7 +81,9 @@ class Renderer { ...contextConfig, onClick: this.onSmartButtonClick, onInit: (data, actions) => { - this.onSmartButtonsInit(data, actions); + if (this.onSmartButtonsInit) { + this.onSmartButtonsInit(data, actions); + } this.handleOnButtonsInit(wrapper, data, actions); }, });