MockProcessor-498b60c5.js
1 year ago
MockProcessor-498b60c5.js.map
1 year ago
add-query-args-0e2a8393.js
1 year ago
add-query-args-0e2a8393.js.map
1 year ago
address-b892540d.js
1 year ago
address-b892540d.js.map
1 year ago
animation-registry-12eed2e3.js
1 year ago
animation-registry-12eed2e3.js.map
1 year ago
app-globals-707edcd4.js
1 year ago
app-globals-707edcd4.js.map
1 year ago
consumer-e06b16d3.js
1 year ago
consumer-e06b16d3.js.map
1 year ago
countries-c2f41f03.js
1 year ago
countries-c2f41f03.js.map
1 year ago
currency-a0c9bff4.js
1 year ago
currency-a0c9bff4.js.map
1 year ago
error-12ea55b3.js
1 year ago
error-12ea55b3.js.map
1 year ago
fetch-e3c5d1b9.js
1 year ago
fetch-e3c5d1b9.js.map
1 year ago
form-data-76641f16.js
1 year ago
form-data-76641f16.js.map
1 year ago
functions-2a4a4ba3.js
1 year ago
functions-2a4a4ba3.js.map
1 year ago
getters-09dda855.js
1 year ago
getters-09dda855.js.map
1 year ago
getters-1a55b8a4.js
1 year ago
getters-1a55b8a4.js.map
1 year ago
getters-26526b7c.js
1 year ago
getters-26526b7c.js.map
1 year ago
getters-a7eec27c.js
1 year ago
getters-a7eec27c.js.map
1 year ago
getters-b1d93841.js
1 year ago
getters-b1d93841.js.map
1 year ago
google-a86aa761.js
1 year ago
google-a86aa761.js.map
1 year ago
google-dd89f242.js
1 year ago
google-dd89f242.js.map
1 year ago
index-06061d4e.js
1 year ago
index-06061d4e.js.map
1 year ago
index-675be13e.js
1 year ago
index-675be13e.js.map
1 year ago
index-745b6bec.js
1 year ago
index-745b6bec.js.map
1 year ago
index-822e5799.js
1 year ago
index-822e5799.js.map
1 year ago
index-871d88b8.js
1 year ago
index-871d88b8.js.map
1 year ago
index-c5a96d53.js
2 years ago
index-c5a96d53.js.map
2 years ago
index.js
1 year ago
index.js.map
2 years ago
inline-c012a0f9.js
1 year ago
inline-c012a0f9.js.map
1 year ago
lazy-deb42890.js
1 year ago
lazy-deb42890.js.map
1 year ago
library-e110eea6.js
1 year ago
library-e110eea6.js.map
1 year ago
loader.js
1 year ago
loader.js.map
1 year ago
media-d21119a3.js
1 year ago
media-d21119a3.js.map
1 year ago
mutations-066b82f0.js
1 year ago
mutations-066b82f0.js.map
1 year ago
mutations-7ba12644.js
1 year ago
mutations-7ba12644.js.map
1 year ago
mutations-e77bd122.js
1 year ago
mutations-e77bd122.js.map
1 year ago
mutations-ed6d0770.js
1 year ago
mutations-ed6d0770.js.map
1 year ago
mutations-f11a19f9.js
1 year ago
mutations-f11a19f9.js.map
1 year ago
page-align-0cdacf32.js
1 year ago
page-align-0cdacf32.js.map
1 year ago
price-d5770168.js
1 year ago
price-d5770168.js.map
1 year ago
pure-963214cb.js
1 year ago
pure-963214cb.js.map
1 year ago
quantity-1f39f750.js
1 year ago
quantity-1f39f750.js.map
1 year ago
remove-query-args-938c53ea.js
1 year ago
remove-query-args-938c53ea.js.map
1 year ago
sc-address_3.entry.js
1 year ago
sc-address_3.entry.js.map
1 year ago
sc-alert_13.entry.js
1 year ago
sc-alert_13.entry.js.map
1 year ago
sc-avatar.entry.js
1 year ago
sc-avatar.entry.js.map
1 year ago
sc-badge-notice.entry.js
1 year ago
sc-badge-notice.entry.js.map
1 year ago
sc-breadcrumb.entry.js
1 year ago
sc-breadcrumb.entry.js.map
1 year ago
sc-breadcrumbs.entry.js
1 year ago
sc-breadcrumbs.entry.js.map
1 year ago
sc-button-group.entry.js
1 year ago
sc-button-group.entry.js.map
1 year ago
sc-cancel-dialog_2.entry.js
1 year ago
sc-cancel-dialog_2.entry.js.map
1 year ago
sc-cancel-discount_4.entry.js
1 year ago
sc-cancel-discount_4.entry.js.map
1 year ago
sc-card.entry.js
1 year ago
sc-card.entry.js.map
1 year ago
sc-cart-button.entry.js
1 year ago
sc-cart-button.entry.js.map
1 year ago
sc-cart-form-submit.entry.js
1 year ago
sc-cart-form-submit.entry.js.map
1 year ago
sc-cart-form.entry.js
1 year ago
sc-cart-form.entry.js.map
1 year ago
sc-cart-header.entry.js
1 year ago
sc-cart-header.entry.js.map
1 year ago
sc-cart-icon.entry.js
1 year ago
sc-cart-icon.entry.js.map
1 year ago
sc-cart-loader.entry.js
1 year ago
sc-cart-loader.entry.js.map
1 year ago
sc-cart-session-provider_3.entry.js
1 year ago
sc-cart-session-provider_3.entry.js.map
1 year ago
sc-cart-submit.entry.js
1 year ago
sc-cart-submit.entry.js.map
1 year ago
sc-cart.entry.js
1 year ago
sc-cart.entry.js.map
1 year ago
sc-cc-logo_2.entry.js
1 year ago
sc-cc-logo_2.entry.js.map
1 year ago
sc-charges-list.entry.js
1 year ago
sc-charges-list.entry.js.map
1 year ago
sc-checkout-form-errors.entry.js
1 year ago
sc-checkout-form-errors.entry.js.map
1 year ago
sc-checkout-mollie-payment_2.entry.js
1 year ago
sc-checkout-mollie-payment_2.entry.js.map
1 year ago
sc-checkout-product-price-variant-selector.entry.js
1 year ago
sc-checkout-product-price-variant-selector.entry.js.map
1 year ago
sc-checkout-stock-alert_8.entry.js
1 year ago
sc-checkout-stock-alert_8.entry.js.map
1 year ago
sc-checkout.entry.js
1 year ago
sc-checkout.entry.js.map
1 year ago
sc-choice-container.entry.js
1 year ago
sc-choice-container.entry.js.map
1 year ago
sc-choice.entry.js
1 year ago
sc-choice.entry.js.map
1 year ago
sc-choices.entry.js
1 year ago
sc-choices.entry.js.map
1 year ago
sc-column_2.entry.js
1 year ago
sc-column_2.entry.js.map
1 year ago
sc-compact-address_11.entry.js
1 year ago
sc-compact-address_11.entry.js.map
1 year ago
sc-conditional-form.entry.js
1 year ago
sc-conditional-form.entry.js.map
1 year ago
sc-consumer.entry.js
1 year ago
sc-consumer.entry.js.map
1 year ago
sc-coupon-form.entry.js
1 year ago
sc-coupon-form.entry.js.map
1 year ago
sc-custom-order-price-input.entry.js
1 year ago
sc-custom-order-price-input.entry.js.map
1 year ago
sc-customer-details.entry.js
1 year ago
sc-customer-details.entry.js.map
1 year ago
sc-customer-edit.entry.js
1 year ago
sc-customer-edit.entry.js.map
1 year ago
sc-customer-email.entry.js
1 year ago
sc-customer-email.entry.js.map
1 year ago
sc-customer-firstname.entry.js
1 year ago
sc-customer-firstname.entry.js.map
1 year ago
sc-customer-lastname.entry.js
1 year ago
sc-customer-lastname.entry.js.map
1 year ago
sc-customer-name.entry.js
1 year ago
sc-customer-name.entry.js.map
1 year ago
sc-customer-phone.entry.js
1 year ago
sc-customer-phone.entry.js.map
1 year ago
sc-dashboard-customer-details.entry.js
1 year ago
sc-dashboard-customer-details.entry.js.map
1 year ago
sc-dashboard-downloads-list.entry.js
1 year ago
sc-dashboard-downloads-list.entry.js.map
1 year ago
sc-divider.entry.js
1 year ago
sc-divider.entry.js.map
1 year ago
sc-donation-choices.entry.js
1 year ago
sc-donation-choices.entry.js.map
1 year ago
sc-downloads-list.entry.js
1 year ago
sc-downloads-list.entry.js.map
1 year ago
sc-dropdown_3.entry.js
1 year ago
sc-dropdown_3.entry.js.map
1 year ago
sc-empty.entry.js
1 year ago
sc-empty.entry.js.map
1 year ago
sc-express-payment.entry.js
1 year ago
sc-express-payment.entry.js.map
1 year ago
sc-feature-demo-banner.entry.js
1 year ago
sc-feature-demo-banner.entry.js.map
1 year ago
sc-form-control_2.entry.js
1 year ago
sc-form-control_2.entry.js.map
1 year ago
sc-form-row.entry.js
1 year ago
sc-form-row.entry.js.map
1 year ago
sc-form.entry.js
1 year ago
sc-form.entry.js.map
1 year ago
sc-format-bytes.entry.js
1 year ago
sc-format-bytes.entry.js.map
1 year ago
sc-format-interval.entry.js
1 year ago
sc-format-interval.entry.js.map
1 year ago
sc-fulfillment-shipping-status-badge.entry.js
1 year ago
sc-fulfillment-shipping-status-badge.entry.js.map
1 year ago
sc-fulfillments.entry.js
1 year ago
sc-fulfillments.entry.js.map
1 year ago
sc-heading_2.entry.js
1 year ago
sc-heading_2.entry.js.map
1 year ago
sc-image-slider.entry.js
1 year ago
sc-image-slider.entry.js.map
1 year ago
sc-invoices-list.entry.js
1 year ago
sc-invoices-list.entry.js.map
1 year ago
sc-license.entry.js
1 year ago
sc-license.entry.js.map
1 year ago
sc-licenses-list.entry.js
1 year ago
sc-licenses-list.entry.js.map
1 year ago
sc-line-item-bump.entry.js
1 year ago
sc-line-item-bump.entry.js.map
1 year ago
sc-line-item-total.entry.js
1 year ago
sc-line-item-total.entry.js.map
1 year ago
sc-line-item.entry.js
1 year ago
sc-line-item.entry.js.map
1 year ago
sc-line-items-provider.entry.js
1 year ago
sc-line-items-provider.entry.js.map
1 year ago
sc-line-items.entry.js
1 year ago
sc-line-items.entry.js.map
1 year ago
sc-login-form.entry.js
1 year ago
sc-login-form.entry.js.map
1 year ago
sc-manual-payment-method_3.entry.js
1 year ago
sc-manual-payment-method_3.entry.js.map
1 year ago
sc-menu-divider.entry.js
1 year ago
sc-menu-divider.entry.js.map
1 year ago
sc-menu-label_2.entry.js
1 year ago
sc-menu-label_2.entry.js.map
1 year ago
sc-mollie-add-method.entry.js
1 year ago
sc-mollie-add-method.entry.js.map
1 year ago
sc-order-confirmation-customer.entry.js
1 year ago
sc-order-confirmation-customer.entry.js.map
1 year ago
sc-order-confirmation-details.entry.js
1 year ago
sc-order-confirmation-details.entry.js.map
1 year ago
sc-order-confirmation-line-items_2.entry.js
1 year ago
sc-order-confirmation-line-items_2.entry.js.map
1 year ago
sc-order-confirmation.entry.js
1 year ago
sc-order-confirmation.entry.js.map
1 year ago
sc-order-coupon-form.entry.js
1 year ago
sc-order-coupon-form.entry.js.map
1 year ago
sc-order-detail.entry.js
1 year ago
sc-order-detail.entry.js.map
1 year ago
sc-order-fulfillment-badge.entry.js
1 year ago
sc-order-fulfillment-badge.entry.js.map
1 year ago
sc-order-manual-instructions.entry.js
1 year ago
sc-order-manual-instructions.entry.js.map
1 year ago
sc-order-password.entry.js
1 year ago
sc-order-password.entry.js.map
1 year ago
sc-order-return-badge.entry.js
1 year ago
sc-order-return-badge.entry.js.map
1 year ago
sc-order-shipment-badge.entry.js
1 year ago
sc-order-shipment-badge.entry.js.map
1 year ago
sc-order-status-badge.entry.js
1 year ago
sc-order-status-badge.entry.js.map
1 year ago
sc-order-submit.entry.js
1 year ago
sc-order-submit.entry.js.map
1 year ago
sc-order-summary.entry.js
1 year ago
sc-order-summary.entry.js.map
1 year ago
sc-order.entry.js
1 year ago
sc-order.entry.js.map
1 year ago
sc-orders-list.entry.js
1 year ago
sc-orders-list.entry.js.map
1 year ago
sc-pagination.entry.js
1 year ago
sc-pagination.entry.js.map
1 year ago
sc-password-nag.entry.js
1 year ago
sc-password-nag.entry.js.map
1 year ago
sc-password.entry.js
1 year ago
sc-password.entry.js.map
1 year ago
sc-payment-method-choice_2.entry.js
1 year ago
sc-payment-method-choice_2.entry.js.map
1 year ago
sc-payment-method-details.entry.js
1 year ago
sc-payment-method-details.entry.js.map
1 year ago
sc-payment-methods-list.entry.js
1 year ago
sc-payment-methods-list.entry.js.map
1 year ago
sc-payment.entry.js
1 year ago
sc-payment.entry.js.map
1 year ago
sc-paypal-add-method.entry.js
1 year ago
sc-paypal-add-method.entry.js.map
1 year ago
sc-paypal-buttons_2.entry.js
1 year ago
sc-paypal-buttons_2.entry.js.map
1 year ago
sc-paystack-add-method.entry.js
1 year ago
sc-paystack-add-method.entry.js.map
1 year ago
sc-phone-input.entry.js
1 year ago
sc-phone-input.entry.js.map
1 year ago
sc-pill-option.entry.js
1 year ago
sc-pill-option.entry.js.map
1 year ago
sc-premium-tag.entry.js
1 year ago
sc-premium-tag.entry.js.map
1 year ago
sc-price-choice-container.entry.js
1 year ago
sc-price-choice-container.entry.js.map
1 year ago
sc-price-choice.entry.js
1 year ago
sc-price-choice.entry.js.map
1 year ago
sc-price-choices.entry.js
1 year ago
sc-price-choices.entry.js.map
1 year ago
sc-price-input.entry.js
1 year ago
sc-price-input.entry.js.map
1 year ago
sc-price-range.entry.js
1 year ago
sc-price-range.entry.js.map
1 year ago
sc-price.entry.js
1 year ago
sc-price.entry.js.map
1 year ago
sc-product-buy-button.entry.js
1 year ago
sc-product-buy-button.entry.js.map
1 year ago
sc-product-donation-amount-choice.entry.js
1 year ago
sc-product-donation-amount-choice.entry.js.map
1 year ago
sc-product-donation-choices.entry.js
1 year ago
sc-product-donation-choices.entry.js.map
1 year ago
sc-product-donation-custom-amount.entry.js
1 year ago
sc-product-donation-custom-amount.entry.js.map
1 year ago
sc-product-item-image_3.entry.js
1 year ago
sc-product-item-image_3.entry.js.map
1 year ago
sc-product-item-list.entry.js
1 year ago
sc-product-item-list.entry.js.map
1 year ago
sc-product-item.entry.js
1 year ago
sc-product-item.entry.js.map
1 year ago
sc-product-line-item_2.entry.js
1 year ago
sc-product-line-item_2.entry.js.map
1 year ago
sc-product-pills-variant-option.entry.js
1 year ago
sc-product-pills-variant-option.entry.js.map
1 year ago
sc-product-price-choices.entry.js
1 year ago
sc-product-price-choices.entry.js.map
1 year ago
sc-product-price-modal.entry.js
1 year ago
sc-product-price-modal.entry.js.map
1 year ago
sc-product-price.entry.js
1 year ago
sc-product-price.entry.js.map
1 year ago
sc-product-quantity.entry.js
1 year ago
sc-product-quantity.entry.js.map
1 year ago
sc-product-selected-price.entry.js
1 year ago
sc-product-selected-price.entry.js.map
1 year ago
sc-product-text.entry.js
1 year ago
sc-product-text.entry.js.map
1 year ago
sc-provider.entry.js
1 year ago
sc-provider.entry.js.map
1 year ago
sc-provisional-banner.entry.js
1 year ago
sc-provisional-banner.entry.js.map
1 year ago
sc-purchase-downloads-list.entry.js
1 year ago
sc-purchase-downloads-list.entry.js.map
1 year ago
sc-recurring-price-choice-container.entry.js
1 year ago
sc-recurring-price-choice-container.entry.js.map
1 year ago
sc-rich-text.entry.js
1 year ago
sc-rich-text.entry.js.map
1 year ago
sc-spacing.entry.js
1 year ago
sc-spacing.entry.js.map
1 year ago
sc-stacked-list_2.entry.js
1 year ago
sc-stacked-list_2.entry.js.map
1 year ago
sc-stripe-add-method.entry.js
1 year ago
sc-stripe-add-method.entry.js.map
1 year ago
sc-stripe-element.entry.js
1 year ago
sc-stripe-element.entry.js.map
1 year ago
sc-stripe-payment-element.entry.js
1 year ago
sc-stripe-payment-element.entry.js.map
1 year ago
sc-stripe-payment-request.entry.js
1 year ago
sc-stripe-payment-request.entry.js.map
1 year ago
sc-subscription-ad-hoc-confirm.entry.js
1 year ago
sc-subscription-ad-hoc-confirm.entry.js.map
1 year ago
sc-subscription-details_2.entry.js
1 year ago
sc-subscription-details_2.entry.js.map
1 year ago
sc-subscription-payment-method.entry.js
1 year ago
sc-subscription-payment-method.entry.js.map
1 year ago
sc-subscription-payment.entry.js
1 year ago
sc-subscription-payment.entry.js.map
1 year ago
sc-subscription-switch.entry.js
1 year ago
sc-subscription-switch.entry.js.map
1 year ago
sc-subscription-variation-confirm.entry.js
1 year ago
sc-subscription-variation-confirm.entry.js.map
1 year ago
sc-subscription.entry.js
1 year ago
sc-subscription.entry.js.map
1 year ago
sc-subscriptions-list.entry.js
1 year ago
sc-subscriptions-list.entry.js.map
1 year ago
sc-summary.entry.js
1 year ago
sc-summary.entry.js.map
1 year ago
sc-switch.entry.js
1 year ago
sc-switch.entry.js.map
1 year ago
sc-tab-group.entry.js
1 year ago
sc-tab-group.entry.js.map
1 year ago
sc-tab-panel.entry.js
1 year ago
sc-tab-panel.entry.js.map
1 year ago
sc-tab.entry.js
1 year ago
sc-tab.entry.js.map
1 year ago
sc-table-head.entry.js
1 year ago
sc-table-head.entry.js.map
1 year ago
sc-table_3.entry.js
1 year ago
sc-table_3.entry.js.map
1 year ago
sc-tag.entry.js
1 year ago
sc-tag.entry.js.map
1 year ago
sc-toggle.entry.js
1 year ago
sc-toggle.entry.js.map
1 year ago
sc-toggles.entry.js
1 year ago
sc-toggles.entry.js.map
1 year ago
sc-total.entry.js
1 year ago
sc-total.entry.js.map
1 year ago
sc-upcoming-invoice.entry.js
1 year ago
sc-upcoming-invoice.entry.js.map
1 year ago
sc-upgrade-required.entry.js
1 year ago
sc-upgrade-required.entry.js.map
1 year ago
sc-upsell-countdown-timer.entry.js
1 year ago
sc-upsell-countdown-timer.entry.js.map
1 year ago
sc-upsell-no-thanks-button.entry.js
1 year ago
sc-upsell-no-thanks-button.entry.js.map
1 year ago
sc-upsell-submit-button.entry.js
1 year ago
sc-upsell-submit-button.entry.js.map
1 year ago
sc-upsell-totals.entry.js
1 year ago
sc-upsell-totals.entry.js.map
1 year ago
sc-upsell.entry.js
1 year ago
sc-upsell.entry.js.map
1 year ago
sc-visually-hidden.entry.js
1 year ago
sc-visually-hidden.entry.js.map
1 year ago
sc-wordpress-password-edit.entry.js
1 year ago
sc-wordpress-password-edit.entry.js.map
1 year ago
sc-wordpress-user-edit.entry.js
1 year ago
sc-wordpress-user-edit.entry.js.map
1 year ago
sc-wordpress-user.entry.js
1 year ago
sc-wordpress-user.entry.js.map
1 year ago
store-093f0f6a.js
1 year ago
store-093f0f6a.js.map
1 year ago
store-a8bae355.js
1 year ago
store-a8bae355.js.map
1 year ago
store-dcefd119.js
1 year ago
store-dcefd119.js.map
1 year ago
surecart.js
1 year ago
surecart.js.map
1 year ago
tax-d4911dbc.js
1 year ago
tax-d4911dbc.js.map
1 year ago
universe-5a73abb7.js
1 year ago
universe-5a73abb7.js.map
1 year ago
util-50af2a83.js
1 year ago
util-50af2a83.js.map
1 year ago
utils-e9ee502a.js
1 year ago
utils-e9ee502a.js.map
1 year ago
watchers-38693c1f.js
1 year ago
watchers-38693c1f.js.map
1 year ago
watchers-4d2edfb0.js
1 year ago
watchers-4d2edfb0.js.map
1 year ago
watchers-4e5b728a.js
1 year ago
watchers-4e5b728a.js.map
1 year ago
watchers-67501779.js
1 year ago
watchers-67501779.js.map
1 year ago
watchers-a697b0c8.js
1 year ago
watchers-a697b0c8.js.map
1 year ago
sc-cancel-discount_4.entry.js
415 lines
| 1 | import { r as registerInstance, c as createEvent, h, F as Fragment, a as getElement } from './index-745b6bec.js'; |
| 2 | import { a as apiFetch } from './fetch-e3c5d1b9.js'; |
| 3 | import { a as getHumanDiscount } from './price-d5770168.js'; |
| 4 | import { a as addQueryArgs } from './add-query-args-0e2a8393.js'; |
| 5 | import { F as FormSubmitController } from './form-data-76641f16.js'; |
| 6 | import './remove-query-args-938c53ea.js'; |
| 7 | import './currency-a0c9bff4.js'; |
| 8 | |
| 9 | /** |
| 10 | * Replace the {{ name }} in a string with a new value |
| 11 | */ |
| 12 | const replaceAmount = (string, replace, name = 'amount') => { |
| 13 | return string.replaceAll('{{' + name + '}}', replace).replaceAll('{{ ' + name + ' }}', replace); |
| 14 | }; |
| 15 | /** |
| 16 | * Replace the amount in a string with discount. |
| 17 | */ |
| 18 | const replaceAmountFromString = (amountStr, protocol) => (protocol === null || protocol === void 0 ? void 0 : protocol.preservation_coupon) ? replaceAmount(amountStr, getHumanDiscount(protocol === null || protocol === void 0 ? void 0 : protocol.preservation_coupon)) : amountStr; |
| 19 | /** |
| 20 | * |
| 21 | */ |
| 22 | const getCurrentBehaviourContent = (protocol, hasDiscount) => { |
| 23 | const { preserve_title, preserve_description, preserve_button, cancel_link } = (protocol === null || protocol === void 0 ? void 0 : protocol.preservation_locales) || {}; |
| 24 | if (hasDiscount) { |
| 25 | const discountLocales = { |
| 26 | title: replaceAmountFromString(wp.i18n.__('Your {{ amount }} discount is still active.', 'surecart'), protocol), |
| 27 | description: replaceAmountFromString(wp.i18n.__('You have a {{ amount }} discount active. Cancelling now will forfeit this discount forever. Are you sure you wish to cancel?', 'surecart'), protocol), |
| 28 | button: wp.i18n.__('Keep My Discount', 'surecart'), |
| 29 | cancel_link: wp.i18n.__('Cancel Anyway', 'surecart'), |
| 30 | }; |
| 31 | return discountLocales; |
| 32 | } |
| 33 | const defaultLocales = { |
| 34 | title: replaceAmountFromString(preserve_title, protocol), |
| 35 | description: replaceAmountFromString(preserve_description, protocol), |
| 36 | button: preserve_button, |
| 37 | cancel_link: cancel_link, |
| 38 | }; |
| 39 | return defaultLocales; |
| 40 | }; |
| 41 | |
| 42 | const scCancelDiscountCss = ".cancel-discount__abort-link{color:var(--sc-color-gray-500)}"; |
| 43 | const ScCancelDiscountStyle0 = scCancelDiscountCss; |
| 44 | |
| 45 | const ScCancelDiscount = class { |
| 46 | constructor(hostRef) { |
| 47 | registerInstance(this, hostRef); |
| 48 | this.scCancel = createEvent(this, "scCancel", 7); |
| 49 | this.scPreserved = createEvent(this, "scPreserved", 7); |
| 50 | this.subscription = undefined; |
| 51 | this.reason = undefined; |
| 52 | this.comment = undefined; |
| 53 | this.protocol = undefined; |
| 54 | this.loading = undefined; |
| 55 | this.error = undefined; |
| 56 | } |
| 57 | async addDiscount() { |
| 58 | var _a, _b; |
| 59 | try { |
| 60 | this.loading = true; |
| 61 | this.subscription = (await apiFetch({ |
| 62 | method: 'PATCH', |
| 63 | path: addQueryArgs(`surecart/v1/subscriptions/${(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.id}/preserve`, { |
| 64 | cancellation_act: { |
| 65 | ...(!!this.comment ? { comment: this.comment } : {}), |
| 66 | cancellation_reason_id: (_b = this.reason) === null || _b === void 0 ? void 0 : _b.id, |
| 67 | }, |
| 68 | }), |
| 69 | })); |
| 70 | this.scPreserved.emit(); |
| 71 | } |
| 72 | catch (e) { |
| 73 | console.error(e); |
| 74 | this.error = e; |
| 75 | } |
| 76 | finally { |
| 77 | this.loading = false; |
| 78 | } |
| 79 | } |
| 80 | hasDiscount() { |
| 81 | var _a, _b; |
| 82 | return !!((_b = (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.discount) === null || _b === void 0 ? void 0 : _b.id); |
| 83 | } |
| 84 | render() { |
| 85 | var _a, _b; |
| 86 | const { title, description, button, cancel_link } = getCurrentBehaviourContent(this.protocol, (_b = (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.discount) === null || _b === void 0 ? void 0 : _b.id); |
| 87 | return (h("div", { key: 'b0a2829ea2bdaf9229ad48cdd9cf5a03fac94d67', class: "cancel-discount" }, h("sc-dashboard-module", { key: '355cf0c4a851b8401ef066fe0d3086d692b89fdb', heading: title, style: { '--sc-dashboard-module-spacing': '2em' } }, h("span", { key: '1d15f870471875f902020230ac5bf1d431c393a5', slot: "description" }, description), h("sc-flex", { key: 'ad7f5336c0592b35c454f552922dc387aa21114d', justifyContent: "flex-start" }, h("sc-button", { key: '4708a11995f9e3a4a7fd791d6de72c9b562bf290', type: "primary", onClick: () => this.addDiscount() }, button), h("sc-button", { key: '6ad1134cdfbfefa4708451454dd9a395880fe5af', class: "cancel-discount__abort-link", type: "text", onClick: () => this.scCancel.emit() }, cancel_link)), !!this.loading && h("sc-block-ui", { key: '25eff6f9f995b1265409f466a3a5ebc9d1528894', spinner: true })))); |
| 88 | } |
| 89 | }; |
| 90 | ScCancelDiscount.style = ScCancelDiscountStyle0; |
| 91 | |
| 92 | const scCancelSurveyCss = ".cancel-survey{color:var(--sc-color-gray-900)}.cancel-survey__abort-link{color:var(--sc-color-gray-500)}"; |
| 93 | const ScCancelSurveyStyle0 = scCancelSurveyCss; |
| 94 | |
| 95 | const ScCancelSurvey = class { |
| 96 | constructor(hostRef) { |
| 97 | registerInstance(this, hostRef); |
| 98 | this.scAbandon = createEvent(this, "scAbandon", 7); |
| 99 | this.scSubmitReason = createEvent(this, "scSubmitReason", 7); |
| 100 | this.protocol = undefined; |
| 101 | this.reasons = undefined; |
| 102 | this.loading = undefined; |
| 103 | this.selectedReason = undefined; |
| 104 | this.comment = undefined; |
| 105 | this.error = undefined; |
| 106 | } |
| 107 | componentWillLoad() { |
| 108 | if (!this.reasons) { |
| 109 | this.fetchReasons(); |
| 110 | } |
| 111 | } |
| 112 | handleSelectedReasonChange() { |
| 113 | var _a; |
| 114 | if ((_a = this.selectedReason) === null || _a === void 0 ? void 0 : _a.comment_enabled) { |
| 115 | setTimeout(() => { |
| 116 | this.textArea.triggerFocus(); |
| 117 | }, 50); |
| 118 | } |
| 119 | } |
| 120 | async fetchReasons() { |
| 121 | try { |
| 122 | this.loading = true; |
| 123 | this.reasons = await apiFetch({ |
| 124 | path: 'surecart/v1/cancellation_reasons', |
| 125 | }); |
| 126 | } |
| 127 | catch (e) { |
| 128 | console.error(e); |
| 129 | this.error = e; |
| 130 | } |
| 131 | finally { |
| 132 | this.loading = false; |
| 133 | } |
| 134 | } |
| 135 | async handleSubmit(e) { |
| 136 | e.preventDefault(); |
| 137 | e.stopImmediatePropagation(); |
| 138 | try { |
| 139 | this.scSubmitReason.emit({ reason: this.selectedReason, comment: this.comment }); |
| 140 | } |
| 141 | catch (e) { |
| 142 | console.error(e); |
| 143 | this.error = e; |
| 144 | } |
| 145 | } |
| 146 | renderReasons() { |
| 147 | if (this.loading) { |
| 148 | return (h("sc-choice", null, h("sc-skeleton", null))); |
| 149 | } |
| 150 | return (this.reasons || []).map(reason => (h("sc-choice", { value: reason === null || reason === void 0 ? void 0 : reason.id, name: "reason", onScChange: e => { |
| 151 | if (e.target.checked) { |
| 152 | this.selectedReason = reason; |
| 153 | } |
| 154 | } }, reason === null || reason === void 0 ? void 0 : reason.label))); |
| 155 | } |
| 156 | render() { |
| 157 | var _a, _b, _c; |
| 158 | const { reasons_title, reasons_description, skip_link } = ((_a = this.protocol) === null || _a === void 0 ? void 0 : _a.preservation_locales) || {}; |
| 159 | if (this.loading) { |
| 160 | return h("sc-skeleton", null); |
| 161 | } |
| 162 | return (h("div", { class: "cancel-survey" }, h("sc-dashboard-module", { heading: reasons_title, style: { '--sc-dashboard-module-spacing': '2em' } }, h("span", { slot: "description" }, reasons_description), h("sc-form", { onScSubmit: e => this.handleSubmit(e), style: { '--sc-form-row-spacing': '2em' } }, h("sc-choices", { showLabel: false, label: wp.i18n.__('Choose a reason', 'surecart'), style: { '--columns': '2' }, required: true }, this.renderReasons()), ((_b = this.selectedReason) === null || _b === void 0 ? void 0 : _b.comment_enabled) && (h("sc-textarea", { label: ((_c = this.selectedReason) === null || _c === void 0 ? void 0 : _c.comment_prompt) || wp.i18n.__('Additional Comments', 'surecart'), required: true, ref: el => (this.textArea = el), onScInput: e => (this.comment = e.target.value) })), h("sc-flex", { justifyContent: "flex-start" }, h("sc-button", { type: "primary", submit: true }, wp.i18n.__('Continue', 'surecart'), h("sc-icon", { name: "arrow-right", slot: "suffix" })), !!skip_link && (h("sc-button", { class: "cancel-survey__abort-link", type: "text", onClick: () => this.scAbandon.emit() }, skip_link))))))); |
| 163 | } |
| 164 | static get watchers() { return { |
| 165 | "selectedReason": ["handleSelectedReasonChange"] |
| 166 | }; } |
| 167 | }; |
| 168 | ScCancelSurvey.style = ScCancelSurveyStyle0; |
| 169 | |
| 170 | const scSubscriptionCancelCss = ":host{display:block;position:relative}.subscription-cancel{display:grid;gap:0.5em}.subscription-cancel__terms{color:var(--sc-color-gray-600);font-size:var(--sc-font-size-small)}"; |
| 171 | const ScSubscriptionCancelStyle0 = scSubscriptionCancelCss; |
| 172 | |
| 173 | const ScSubscriptionCancel = class { |
| 174 | constructor(hostRef) { |
| 175 | registerInstance(this, hostRef); |
| 176 | this.scAbandon = createEvent(this, "scAbandon", 7); |
| 177 | this.scCancelled = createEvent(this, "scCancelled", 7); |
| 178 | this.heading = undefined; |
| 179 | this.backUrl = undefined; |
| 180 | this.successUrl = undefined; |
| 181 | this.subscription = undefined; |
| 182 | this.protocol = undefined; |
| 183 | this.reason = undefined; |
| 184 | this.comment = undefined; |
| 185 | this.loading = undefined; |
| 186 | this.busy = undefined; |
| 187 | this.error = undefined; |
| 188 | } |
| 189 | async cancelSubscription() { |
| 190 | var _a, _b; |
| 191 | try { |
| 192 | this.error = ''; |
| 193 | this.busy = true; |
| 194 | await apiFetch({ |
| 195 | path: addQueryArgs(`/surecart/v1/subscriptions/${(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.id}/cancel`, { |
| 196 | cancellation_act: { |
| 197 | ...(!!this.comment ? { comment: this.comment } : {}), |
| 198 | cancellation_reason_id: (_b = this.reason) === null || _b === void 0 ? void 0 : _b.id, |
| 199 | }, |
| 200 | }), |
| 201 | method: 'PATCH', |
| 202 | }); |
| 203 | this.scCancelled.emit(); |
| 204 | } |
| 205 | catch (e) { |
| 206 | this.error = (e === null || e === void 0 ? void 0 : e.message) || wp.i18n.__('Something went wrong', 'surecart'); |
| 207 | this.busy = false; |
| 208 | } |
| 209 | } |
| 210 | renderContent() { |
| 211 | var _a, _b; |
| 212 | if (this.loading) { |
| 213 | return this.renderLoading(); |
| 214 | } |
| 215 | return (h(Fragment, null, ((_a = this === null || this === void 0 ? void 0 : this.protocol) === null || _a === void 0 ? void 0 : _a.cancel_behavior) === 'pending' ? (h("div", { slot: "description" }, wp.i18n.__('Your plan will be canceled, but is still available until the end of your billing period on', 'surecart'), ' ', h("strong", null, h("sc-format-date", { type: "timestamp", date: (_b = this === null || this === void 0 ? void 0 : this.subscription) === null || _b === void 0 ? void 0 : _b.current_period_end_at, month: "long", day: "numeric", year: "numeric" })), ". ", wp.i18n.__('If you change your mind, you can renew your subscription.', 'surecart'))) : (h("div", { slot: "description" }, wp.i18n.__('Your plan will be canceled immediately and cannot be modified later.', 'surecart'))))); |
| 216 | } |
| 217 | renderLoading() { |
| 218 | return (h("div", { style: { padding: '0.5em' } }, h("sc-skeleton", { style: { width: '30%', marginBottom: '0.75em' } }), h("sc-skeleton", { style: { width: '20%', marginBottom: '0.75em' } }), h("sc-skeleton", { style: { width: '40%' } }))); |
| 219 | } |
| 220 | render() { |
| 221 | return (h("sc-dashboard-module", { key: 'b00ea4327e6ef1815aab6b22276e1ee1a42160a1', heading: this.heading || wp.i18n.__('Cancel your plan', 'surecart'), class: "subscription-cancel", error: this.error, style: { '--sc-dashboard-module-spacing': '1em' } }, this.renderContent(), h("sc-flex", { key: 'd02612f3037068221a8af8514ccbfe825ecccabf', justifyContent: "flex-start" }, h("sc-button", { key: '568f730cfa7bf239dc31c3b2cc1a1aa8ab19597d', type: "primary", loading: this.loading || this.busy, disabled: this.loading || this.busy, onClick: () => this.cancelSubscription() }, wp.i18n.__('Cancel Plan', 'surecart')), h("sc-button", { key: 'c07b56254689a8c3030f2f7c14f8ca787aea717b', style: { color: 'var(--sc-color-gray-500' }, type: "text", onClick: () => this.scAbandon.emit(), loading: this.loading || this.busy, disabled: this.loading || this.busy }, wp.i18n.__('Keep My Plan', 'surecart'))), this.busy && h("sc-block-ui", { key: 'e976959c2b7c009dd8e0d16ffb3ec7b6639e6edd' }))); |
| 222 | } |
| 223 | }; |
| 224 | ScSubscriptionCancel.style = ScSubscriptionCancelStyle0; |
| 225 | |
| 226 | const scTextareaCss = ":host{display:block}.textarea{display:flex;align-items:center;position:relative;width:100%;font-family:var(--sc-input-font-family);font-weight:var(--sc-input-font-weight);line-height:var(--sc-line-height-normal);letter-spacing:var(--sc-input-letter-spacing);vertical-align:middle;transition:var(--sc-input-transition, var(--sc-transition-medium)) color, var(--sc-input-transition, var(--sc-transition-medium)) border, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow,\n var(--sc-input-transition, var(--sc-transition-medium)) background-color;cursor:text}.textarea--standard{background-color:var(--sc-input-background-color);border:solid var(--sc-input-border-width) var(--sc-input-border-color)}.textarea--standard:hover:not(.textarea--disabled){background-color:var(--sc-input-background-color-hover);border-color:var(--sc-input-border-color-hover)}.textarea--standard:hover:not(.textarea--disabled) .textarea__control{color:var(--sc-input-color-hover)}.textarea--standard.textarea--focused:not(.textarea--disabled){background-color:var(--sc-input-background-color-focus);border-color:var(--sc-input-border-color-focus);color:var(--sc-input-color-focus);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-input-focus-ring-color)}.textarea--standard.textarea--focused:not(.textarea--disabled) .textarea__control{color:var(--sc-input-color-focus)}.textarea--standard.textarea--disabled{background-color:var(--sc-input-background-color-disabled);border-color:var(--sc-input-border-color-disabled);opacity:0.5;cursor:not-allowed}.textarea--standard.textarea--disabled .textarea__control{color:var(--sc-input-color-disabled)}.textarea--standard.textarea--disabled .textarea__control::placeholder{color:var(--sc-input-placeholder-color-disabled)}.textarea--filled{border:none;background-color:var(--sc-input-filled-background-color);color:var(--sc-input-color)}.textarea--filled:hover:not(.textarea--disabled){background-color:var(--sc-input-filled-background-color-hover)}.textarea--filled.textarea--focused:not(.textarea--disabled){background-color:var(--sc-input-filled-background-color-focus);outline:var(--sc-focus-ring);outline-offset:var(--sc-focus-ring-offset)}.textarea--filled.textarea--disabled{background-color:var(--sc-input-filled-background-color-disabled);opacity:0.5;cursor:not-allowed}.textarea__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.4;color:var(--sc-input-color);border:none;background:none;box-shadow:none;cursor:inherit;-webkit-appearance:none}.textarea__control::-webkit-search-decoration,.textarea__control::-webkit-search-cancel-button,.textarea__control::-webkit-search-results-button,.textarea__control::-webkit-search-results-decoration{-webkit-appearance:none}.textarea__control::placeholder{color:var(--sc-input-placeholder-color);user-select:none}.textarea__control:focus{outline:none}.textarea--small{border-radius:var(--sc-input-border-radius-small);font-size:var(--sc-input-font-size-small)}.textarea--small .textarea__control{padding:0.5em var(--sc-input-spacing-small)}.textarea--medium{border-radius:var(--sc-input-border-radius-medium);font-size:var(--sc-input-font-size-medium)}.textarea--medium .textarea__control{padding:0.5em var(--sc-input-spacing-medium)}.textarea--large{border-radius:var(--sc-input-border-radius-large);font-size:var(--sc-input-font-size-large)}.textarea--large .textarea__control{padding:0.5em var(--sc-input-spacing-large)}.textarea--resize-none .textarea__control{resize:none}.textarea--resize-vertical .textarea__control{resize:vertical}.textarea--resize-auto .textarea__control{height:auto;resize:none}.textarea__char-limit-warning{margin-top:var(--sc-input-spacing-small);color:var(--sc-input-help-text-color);font-size:var(--sc-input-help-text-font-size-medium)}"; |
| 227 | const ScTextareaStyle0 = scTextareaCss; |
| 228 | |
| 229 | const CHAR_LIMIT_THRESHOLD = 20; |
| 230 | let id = 0; |
| 231 | const ScTextarea = class { |
| 232 | constructor(hostRef) { |
| 233 | registerInstance(this, hostRef); |
| 234 | this.scChange = createEvent(this, "scChange", 7); |
| 235 | this.scInput = createEvent(this, "scInput", 7); |
| 236 | this.scBlur = createEvent(this, "scBlur", 7); |
| 237 | this.scFocus = createEvent(this, "scFocus", 7); |
| 238 | this.inputId = `textarea-${++id}`; |
| 239 | this.helpId = `textarea-help-text-${id}`; |
| 240 | this.labelId = `textarea-label-${id}`; |
| 241 | this.hasFocus = false; |
| 242 | this.showCharLimit = false; |
| 243 | this.size = 'medium'; |
| 244 | this.name = undefined; |
| 245 | this.value = ''; |
| 246 | this.filled = false; |
| 247 | this.label = ''; |
| 248 | this.showLabel = true; |
| 249 | this.help = ''; |
| 250 | this.placeholder = undefined; |
| 251 | this.rows = 4; |
| 252 | this.resize = 'vertical'; |
| 253 | this.disabled = false; |
| 254 | this.readonly = false; |
| 255 | this.minlength = undefined; |
| 256 | this.maxlength = undefined; |
| 257 | this.required = false; |
| 258 | this.invalid = false; |
| 259 | this.autocapitalize = undefined; |
| 260 | this.autocorrect = undefined; |
| 261 | this.autocomplete = undefined; |
| 262 | this.autofocus = undefined; |
| 263 | this.enterkeyhint = undefined; |
| 264 | this.spellcheck = undefined; |
| 265 | this.inputmode = undefined; |
| 266 | } |
| 267 | handleRowsChange() { |
| 268 | this.setTextareaHeight(); |
| 269 | } |
| 270 | handleValueChange() { |
| 271 | this.invalid = !this.input.checkValidity(); |
| 272 | this.showCharLimit = this.maxlength - this.value.length <= CHAR_LIMIT_THRESHOLD; |
| 273 | } |
| 274 | handleDisabledChange() { |
| 275 | // Disabled form controls are always valid, so we need to recheck validity when the state changes |
| 276 | this.input.disabled = this.disabled; |
| 277 | this.invalid = !this.input.checkValidity(); |
| 278 | } |
| 279 | /** Sets focus on the input. */ |
| 280 | async triggerFocus(options) { |
| 281 | return this.input.focus(options); |
| 282 | } |
| 283 | /** Sets focus on the textarea. */ |
| 284 | focus(options) { |
| 285 | this.input.focus(options); |
| 286 | } |
| 287 | /** Removes focus from the textarea. */ |
| 288 | blur() { |
| 289 | this.input.blur(); |
| 290 | } |
| 291 | /** Selects all the text in the textarea. */ |
| 292 | select() { |
| 293 | this.input.select(); |
| 294 | } |
| 295 | /** Gets or sets the textarea's scroll position. */ |
| 296 | scrollPosition(position) { |
| 297 | if (position) { |
| 298 | if (typeof position.top === 'number') |
| 299 | this.input.scrollTop = position.top; |
| 300 | if (typeof position.left === 'number') |
| 301 | this.input.scrollLeft = position.left; |
| 302 | return; |
| 303 | } |
| 304 | // eslint-disable-next-line consistent-return |
| 305 | return { |
| 306 | top: this.input.scrollTop, |
| 307 | left: this.input.scrollTop, |
| 308 | }; |
| 309 | } |
| 310 | /** Sets the start and end positions of the text selection (0-based). */ |
| 311 | setSelectionRange(selectionStart, selectionEnd, selectionDirection = 'none') { |
| 312 | this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); |
| 313 | } |
| 314 | /** Replaces a range of text with a new string. */ |
| 315 | setRangeText(replacement, start, end, selectMode = 'preserve') { |
| 316 | this.input.setRangeText(replacement, start, end, selectMode); |
| 317 | if (this.value !== this.input.value) { |
| 318 | this.value = this.input.value; |
| 319 | this.scInput.emit(); |
| 320 | } |
| 321 | if (this.value !== this.input.value) { |
| 322 | this.value = this.input.value; |
| 323 | this.setTextareaHeight(); |
| 324 | this.scInput.emit(); |
| 325 | this.scChange.emit(); |
| 326 | } |
| 327 | } |
| 328 | /** Checks for validity and shows the browser's validation message if the control is invalid. */ |
| 329 | async reportValidity() { |
| 330 | return this.input.reportValidity(); |
| 331 | } |
| 332 | /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */ |
| 333 | setCustomValidity(message) { |
| 334 | this.input.setCustomValidity(message); |
| 335 | this.invalid = !this.input.checkValidity(); |
| 336 | } |
| 337 | handleBlur() { |
| 338 | this.hasFocus = false; |
| 339 | this.scBlur.emit(); |
| 340 | } |
| 341 | handleChange() { |
| 342 | this.value = this.input.value; |
| 343 | this.setTextareaHeight(); |
| 344 | this.scChange.emit(); |
| 345 | } |
| 346 | handleFocus() { |
| 347 | this.hasFocus = true; |
| 348 | this.scFocus.emit(); |
| 349 | } |
| 350 | handleInput() { |
| 351 | this.value = this.input.value; |
| 352 | this.setTextareaHeight(); |
| 353 | this.scInput.emit(); |
| 354 | } |
| 355 | componentWillLoad() { |
| 356 | if (!(window === null || window === void 0 ? void 0 : window.ResizeObserver)) { |
| 357 | return; |
| 358 | } |
| 359 | this.resizeObserver = new window.ResizeObserver(() => this.setTextareaHeight()); |
| 360 | } |
| 361 | componentDidLoad() { |
| 362 | this.formController = new FormSubmitController(this.el).addFormData(); |
| 363 | if (!(window === null || window === void 0 ? void 0 : window.ResizeObserver)) { |
| 364 | return; |
| 365 | } |
| 366 | this.resizeObserver.observe(this.input); |
| 367 | } |
| 368 | disconnectedCallback() { |
| 369 | var _a; |
| 370 | (_a = this.formController) === null || _a === void 0 ? void 0 : _a.removeFormData(); |
| 371 | this.resizeObserver.unobserve(this.input); |
| 372 | } |
| 373 | setTextareaHeight() { |
| 374 | if (this.resize === 'auto') { |
| 375 | this.input.style.height = 'auto'; |
| 376 | this.input.style.height = `${this.input.scrollHeight}px`; |
| 377 | } |
| 378 | else { |
| 379 | this.input.style.height = undefined; |
| 380 | } |
| 381 | } |
| 382 | render() { |
| 383 | return (h("div", { key: '27c543f54353efba4c61759b99ec23f434822b7a', part: "form-control", class: { |
| 384 | 'form-control': true, |
| 385 | 'form-control--small': this.size === 'small', |
| 386 | 'form-control--medium': this.size === 'medium', |
| 387 | 'form-control--large': this.size === 'large', |
| 388 | } }, h("sc-form-control", { key: '635f3c0299ffcdd95ccc8186e46d3db4b8d91136', exportparts: "label, help-text, form-control", size: this.size, required: this.required, label: this.label, showLabel: this.showLabel, help: this.help, inputId: this.inputId, helpId: this.helpId, labelId: this.labelId, name: this.name }, h("div", { key: '2969c666f526c4238751f55f91310fad3397b217', part: "form-control-input", class: "form-control-input" }, h("div", { key: '755bb26337d9e512d4e622057bd8f66399e89fd8', part: "base", class: { |
| 389 | 'textarea': true, |
| 390 | 'textarea--small': this.size === 'small', |
| 391 | 'textarea--medium': this.size === 'medium', |
| 392 | 'textarea--large': this.size === 'large', |
| 393 | 'textarea--standard': !this.filled, |
| 394 | 'textarea--filled': this.filled, |
| 395 | 'textarea--disabled': this.disabled, |
| 396 | 'textarea--focused': this.hasFocus, |
| 397 | 'textarea--empty': !this.value, |
| 398 | 'textarea--invalid': this.invalid, |
| 399 | 'textarea--resize-none': this.resize === 'none', |
| 400 | 'textarea--resize-vertical': this.resize === 'vertical', |
| 401 | 'textarea--resize-auto': this.resize === 'auto', |
| 402 | } }, h("textarea", { key: '1711be9fc3fbabc9ae4021548219e1bcd7d78bdb', part: "textarea", ref: el => (this.input = el), id: "input", class: "textarea__control", name: this.name, value: this.value, disabled: this.disabled, readonly: this.readonly, required: this.required, placeholder: this.placeholder, rows: this.rows, minlength: this.minlength, maxlength: this.maxlength, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect, autofocus: this.autofocus, spellcheck: this.spellcheck, enterkeyhint: this.enterkeyhint, inputmode: this.inputmode, "aria-describedby": "help-text", onChange: () => this.handleChange(), onInput: () => this.handleInput(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onKeyDown: (e) => e.stopPropagation() })), this.showCharLimit && (h("div", { key: '6c0791969b5ae22f80de7d5a3076e2fe55d3a630', slot: "help", class: 'textarea__char-limit-warning' }, wp.i18n.sprintf(wp.i18n.__('%d characters remaining', 'surecart'), this.maxlength - this.input.value.length))))))); |
| 403 | } |
| 404 | get el() { return getElement(this); } |
| 405 | static get watchers() { return { |
| 406 | "rows": ["handleRowsChange"], |
| 407 | "value": ["handleValueChange"], |
| 408 | "disabled": ["handleDisabledChange"] |
| 409 | }; } |
| 410 | }; |
| 411 | ScTextarea.style = ScTextareaStyle0; |
| 412 | |
| 413 | export { ScCancelDiscount as sc_cancel_discount, ScCancelSurvey as sc_cancel_survey, ScSubscriptionCancel as sc_subscription_cancel, ScTextarea as sc_textarea }; |
| 414 | |
| 415 | //# sourceMappingURL=sc-cancel-discount_4.entry.js.map |