ManualPaymentMethods-e5dcf410.js
3 years ago
ManualPaymentMethods-e5dcf410.js.map
3 years ago
_commonjsHelpers-537d719a.js
4 years ago
_commonjsHelpers-537d719a.js.map
3 years ago
add-query-args-17c551b6.js
4 years ago
add-query-args-17c551b6.js.map
3 years ago
address-42b5c61b.js
3 years ago
address-42b5c61b.js.map
3 years ago
animation-registry-58bec802.js
3 years ago
animation-registry-58bec802.js.map
3 years ago
consumer-51f6d265.js
3 years ago
consumer-51f6d265.js.map
3 years ago
countries-0ec7ecdc.js
4 years ago
countries-0ec7ecdc.js.map
3 years ago
fetch-b673a242.js
3 years ago
fetch-b673a242.js.map
3 years ago
form-data-69000afe.js
3 years ago
form-data-69000afe.js.map
3 years ago
functions-77ef3f22.js
4 years ago
functions-77ef3f22.js.map
3 years ago
get-query-arg-53bf21e2.js
4 years ago
get-query-arg-53bf21e2.js.map
3 years ago
getters-52a52d79.js
3 years ago
getters-52a52d79.js.map
3 years ago
getters-6f3470fb.js
3 years ago
getters-6f3470fb.js.map
3 years ago
getters-c8a04b97.js
3 years ago
getters-c8a04b97.js.map
3 years ago
getters-f0455d23.js
3 years ago
getters-f0455d23.js.map
3 years ago
global-6f39d5d2.js
3 years ago
global-6f39d5d2.js.map
3 years ago
index-261b56ec.js
3 years ago
index-261b56ec.js.map
3 years ago
index-2643f18b.js
3 years ago
index-2643f18b.js.map
3 years ago
index-ac77ca60.js
3 years ago
index-ac77ca60.js.map
3 years ago
index-b901844d.js
3 years ago
index-b901844d.js.map
3 years ago
index-cf22257b.js
3 years ago
index-cf22257b.js.map
3 years ago
index.cjs.js
3 years ago
index.cjs.js.map
3 years ago
lazy-bc8baeab.js
4 years ago
lazy-bc8baeab.js.map
3 years ago
library-289cf13f.js
4 years ago
library-289cf13f.js.map
3 years ago
loader.cjs.js
3 years ago
loader.cjs.js.map
3 years ago
media-a7872d6d.js
3 years ago
media-a7872d6d.js.map
3 years ago
mutations-a3ec6490.js
3 years ago
mutations-a3ec6490.js.map
3 years ago
mutations-b8d54585.js
3 years ago
mutations-b8d54585.js.map
3 years ago
page-align-bf197eb4.js
3 years ago
page-align-bf197eb4.js.map
3 years ago
price-d3e21aa4.js
3 years ago
price-d3e21aa4.js.map
3 years ago
pure-5be33f24.js
4 years ago
pure-5be33f24.js.map
3 years ago
sc-address_3.cjs.entry.js
3 years ago
sc-address_3.cjs.entry.js.map
3 years ago
sc-alert.cjs.entry.js
3 years ago
sc-alert.cjs.entry.js.map
3 years ago
sc-avatar.cjs.entry.js
3 years ago
sc-avatar.cjs.entry.js.map
3 years ago
sc-badge-notice.cjs.entry.js
3 years ago
sc-badge-notice.cjs.entry.js.map
3 years ago
sc-block-ui.cjs.entry.js
3 years ago
sc-block-ui.cjs.entry.js.map
3 years ago
sc-breadcrumb.cjs.entry.js
3 years ago
sc-breadcrumb.cjs.entry.js.map
3 years ago
sc-breadcrumbs.cjs.entry.js
3 years ago
sc-breadcrumbs.cjs.entry.js.map
3 years ago
sc-button-group.cjs.entry.js
3 years ago
sc-button-group.cjs.entry.js.map
3 years ago
sc-button_2.cjs.entry.js
3 years ago
sc-button_2.cjs.entry.js.map
3 years ago
sc-cancel-dialog_2.cjs.entry.js
3 years ago
sc-cancel-dialog_2.cjs.entry.js.map
3 years ago
sc-cancel-discount_4.cjs.entry.js
3 years ago
sc-cancel-discount_4.cjs.entry.js.map
3 years ago
sc-card_2.cjs.entry.js
3 years ago
sc-card_2.cjs.entry.js.map
3 years ago
sc-cart-button.cjs.entry.js
3 years ago
sc-cart-button.cjs.entry.js.map
3 years ago
sc-cart-form-submit.cjs.entry.js
3 years ago
sc-cart-form-submit.cjs.entry.js.map
3 years ago
sc-cart-form.cjs.entry.js
3 years ago
sc-cart-form.cjs.entry.js.map
3 years ago
sc-cart-header.cjs.entry.js
3 years ago
sc-cart-header.cjs.entry.js.map
3 years ago
sc-cart-icon.cjs.entry.js
3 years ago
sc-cart-icon.cjs.entry.js.map
3 years ago
sc-cart-loader.cjs.entry.js
3 years ago
sc-cart-loader.cjs.entry.js.map
3 years ago
sc-cart-session-provider_3.cjs.entry.js
3 years ago
sc-cart-session-provider_3.cjs.entry.js.map
3 years ago
sc-cart-submit.cjs.entry.js
3 years ago
sc-cart-submit.cjs.entry.js.map
3 years ago
sc-cart.cjs.entry.js
3 years ago
sc-cart.cjs.entry.js.map
3 years ago
sc-cc-logo_2.cjs.entry.js
3 years ago
sc-cc-logo_2.cjs.entry.js.map
3 years ago
sc-charges-list.cjs.entry.js
3 years ago
sc-charges-list.cjs.entry.js.map
3 years ago
sc-checkbox.cjs.entry.js
3 years ago
sc-checkbox.cjs.entry.js.map
3 years ago
sc-checkout-form-errors.cjs.entry.js
3 years ago
sc-checkout-form-errors.cjs.entry.js.map
3 years ago
sc-checkout-mollie-payment.cjs.entry.js
3 years ago
sc-checkout-mollie-payment.cjs.entry.js.map
3 years ago
sc-checkout-unsaved-changes-warning_7.cjs.entry.js
3 years ago
sc-checkout-unsaved-changes-warning_7.cjs.entry.js.map
3 years ago
sc-checkout.cjs.entry.js
3 years ago
sc-checkout.cjs.entry.js.map
3 years ago
sc-choice-container.cjs.entry.js
3 years ago
sc-choice-container.cjs.entry.js.map
3 years ago
sc-choice.cjs.entry.js
3 years ago
sc-choice.cjs.entry.js.map
3 years ago
sc-choices.cjs.entry.js
3 years ago
sc-choices.cjs.entry.js.map
3 years ago
sc-column_2.cjs.entry.js
3 years ago
sc-column_2.cjs.entry.js.map
3 years ago
sc-compact-address_6.cjs.entry.js
3 years ago
sc-compact-address_6.cjs.entry.js.map
3 years ago
sc-conditional-form.cjs.entry.js
3 years ago
sc-conditional-form.cjs.entry.js.map
3 years ago
sc-consumer.cjs.entry.js
3 years ago
sc-consumer.cjs.entry.js.map
3 years ago
sc-coupon-form.cjs.entry.js
3 years ago
sc-coupon-form.cjs.entry.js.map
3 years ago
sc-custom-order-price-input.cjs.entry.js
3 years ago
sc-custom-order-price-input.cjs.entry.js.map
3 years ago
sc-customer-details.cjs.entry.js
3 years ago
sc-customer-details.cjs.entry.js.map
3 years ago
sc-customer-edit.cjs.entry.js
3 years ago
sc-customer-edit.cjs.entry.js.map
3 years ago
sc-customer-email.cjs.entry.js
3 years ago
sc-customer-email.cjs.entry.js.map
3 years ago
sc-customer-firstname.cjs.entry.js
3 years ago
sc-customer-firstname.cjs.entry.js.map
3 years ago
sc-customer-lastname.cjs.entry.js
3 years ago
sc-customer-lastname.cjs.entry.js.map
3 years ago
sc-customer-name.cjs.entry.js
3 years ago
sc-customer-name.cjs.entry.js.map
3 years ago
sc-customer-phone.cjs.entry.js
3 years ago
sc-customer-phone.cjs.entry.js.map
3 years ago
sc-dashboard-customer-details.cjs.entry.js
3 years ago
sc-dashboard-customer-details.cjs.entry.js.map
3 years ago
sc-dashboard-downloads-list.cjs.entry.js
3 years ago
sc-dashboard-downloads-list.cjs.entry.js.map
3 years ago
sc-dialog.cjs.entry.js
3 years ago
sc-dialog.cjs.entry.js.map
3 years ago
sc-divider.cjs.entry.js
3 years ago
sc-divider.cjs.entry.js.map
3 years ago
sc-donation-choices.cjs.entry.js
3 years ago
sc-donation-choices.cjs.entry.js.map
3 years ago
sc-downloads-list.cjs.entry.js
3 years ago
sc-downloads-list.cjs.entry.js.map
3 years ago
sc-dropdown_4.cjs.entry.js
3 years ago
sc-dropdown_4.cjs.entry.js.map
3 years ago
sc-empty.cjs.entry.js
3 years ago
sc-empty.cjs.entry.js.map
3 years ago
sc-express-payment.cjs.entry.js
3 years ago
sc-express-payment.cjs.entry.js.map
3 years ago
sc-flex.cjs.entry.js
3 years ago
sc-flex.cjs.entry.js.map
3 years ago
sc-form-control_2.cjs.entry.js
3 years ago
sc-form-control_2.cjs.entry.js.map
3 years ago
sc-form-row.cjs.entry.js
3 years ago
sc-form-row.cjs.entry.js.map
3 years ago
sc-form.cjs.entry.js
3 years ago
sc-form.cjs.entry.js.map
3 years ago
sc-format-bytes.cjs.entry.js
3 years ago
sc-format-bytes.cjs.entry.js.map
3 years ago
sc-format-date.cjs.entry.js
3 years ago
sc-format-date.cjs.entry.js.map
3 years ago
sc-format-interval.cjs.entry.js
3 years ago
sc-format-interval.cjs.entry.js.map
3 years ago
sc-format-number.cjs.entry.js
3 years ago
sc-format-number.cjs.entry.js.map
3 years ago
sc-heading_2.cjs.entry.js
3 years ago
sc-heading_2.cjs.entry.js.map
3 years ago
sc-icon.cjs.entry.js
3 years ago
sc-icon.cjs.entry.js.map
3 years ago
sc-image-slider.cjs.entry.js
3 years ago
sc-image-slider.cjs.entry.js.map
3 years ago
sc-invoices-list.cjs.entry.js
3 years ago
sc-invoices-list.cjs.entry.js.map
3 years ago
sc-licenses-list.cjs.entry.js
3 years ago
sc-licenses-list.cjs.entry.js.map
3 years ago
sc-line-item-bump.cjs.entry.js
3 years ago
sc-line-item-bump.cjs.entry.js.map
3 years ago
sc-line-item-total.cjs.entry.js
3 years ago
sc-line-item-total.cjs.entry.js.map
3 years ago
sc-line-item.cjs.entry.js
3 years ago
sc-line-item.cjs.entry.js.map
3 years ago
sc-line-items-provider.cjs.entry.js
3 years ago
sc-line-items-provider.cjs.entry.js.map
3 years ago
sc-line-items.cjs.entry.js
3 years ago
sc-line-items.cjs.entry.js.map
3 years ago
sc-login-form.cjs.entry.js
3 years ago
sc-login-form.cjs.entry.js.map
3 years ago
sc-menu-divider.cjs.entry.js
3 years ago
sc-menu-divider.cjs.entry.js.map
3 years ago
sc-mollie-add-method.cjs.entry.js
3 years ago
sc-mollie-add-method.cjs.entry.js.map
3 years ago
sc-order-confirmation-customer.cjs.entry.js
3 years ago
sc-order-confirmation-customer.cjs.entry.js.map
3 years ago
sc-order-confirmation-details.cjs.entry.js
3 years ago
sc-order-confirmation-details.cjs.entry.js.map
3 years ago
sc-order-confirmation-line-items_2.cjs.entry.js
3 years ago
sc-order-confirmation-line-items_2.cjs.entry.js.map
3 years ago
sc-order-confirmation.cjs.entry.js
3 years ago
sc-order-confirmation.cjs.entry.js.map
3 years ago
sc-order-coupon-form.cjs.entry.js
3 years ago
sc-order-coupon-form.cjs.entry.js.map
3 years ago
sc-order-detail.cjs.entry.js
3 years ago
sc-order-detail.cjs.entry.js.map
3 years ago
sc-order-manual-instructions.cjs.entry.js
3 years ago
sc-order-manual-instructions.cjs.entry.js.map
3 years ago
sc-order-password.cjs.entry.js
3 years ago
sc-order-password.cjs.entry.js.map
3 years ago
sc-order-status-badge.cjs.entry.js
3 years ago
sc-order-status-badge.cjs.entry.js.map
3 years ago
sc-order-submit.cjs.entry.js
3 years ago
sc-order-submit.cjs.entry.js.map
3 years ago
sc-order-summary.cjs.entry.js
3 years ago
sc-order-summary.cjs.entry.js.map
3 years ago
sc-order.cjs.entry.js
3 years ago
sc-order.cjs.entry.js.map
3 years ago
sc-orders-list.cjs.entry.js
3 years ago
sc-orders-list.cjs.entry.js.map
3 years ago
sc-pagination.cjs.entry.js
3 years ago
sc-pagination.cjs.entry.js.map
3 years ago
sc-password-nag.cjs.entry.js
3 years ago
sc-password-nag.cjs.entry.js.map
3 years ago
sc-payment-method-choice_2.cjs.entry.js
3 years ago
sc-payment-method-choice_2.cjs.entry.js.map
3 years ago
sc-payment-methods-list.cjs.entry.js
3 years ago
sc-payment-methods-list.cjs.entry.js.map
3 years ago
sc-payment.cjs.entry.js
3 years ago
sc-payment.cjs.entry.js.map
3 years ago
sc-paypal-add-method.cjs.entry.js
3 years ago
sc-paypal-add-method.cjs.entry.js.map
3 years ago
sc-paypal-buttons_2.cjs.entry.js
3 years ago
sc-paypal-buttons_2.cjs.entry.js.map
3 years ago
sc-phone-input.cjs.entry.js
3 years ago
sc-phone-input.cjs.entry.js.map
3 years ago
sc-premium-tag.cjs.entry.js
3 years ago
sc-premium-tag.cjs.entry.js.map
3 years ago
sc-price-choice-container.cjs.entry.js
3 years ago
sc-price-choice-container.cjs.entry.js.map
3 years ago
sc-price-choice.cjs.entry.js
3 years ago
sc-price-choice.cjs.entry.js.map
3 years ago
sc-price-choices.cjs.entry.js
3 years ago
sc-price-choices.cjs.entry.js.map
3 years ago
sc-price-input.cjs.entry.js
3 years ago
sc-price-input.cjs.entry.js.map
3 years ago
sc-price-range.cjs.entry.js
3 years ago
sc-price-range.cjs.entry.js.map
3 years ago
sc-product-buy-button.cjs.entry.js
3 years ago
sc-product-buy-button.cjs.entry.js.map
3 years ago
sc-product-item-image_3.cjs.entry.js
3 years ago
sc-product-item-image_3.cjs.entry.js.map
3 years ago
sc-product-item-list.cjs.entry.js
3 years ago
sc-product-item-list.cjs.entry.js.map
3 years ago
sc-product-item.cjs.entry.js
3 years ago
sc-product-item.cjs.entry.js.map
3 years ago
sc-product-line-item_2.cjs.entry.js
3 years ago
sc-product-line-item_2.cjs.entry.js.map
3 years ago
sc-product-price-choices.cjs.entry.js
3 years ago
sc-product-price-choices.cjs.entry.js.map
3 years ago
sc-product-price-modal.cjs.entry.js
3 years ago
sc-product-price-modal.cjs.entry.js.map
3 years ago
sc-product-price.cjs.entry.js
3 years ago
sc-product-price.cjs.entry.js.map
3 years ago
sc-product-quantity.cjs.entry.js
3 years ago
sc-product-quantity.cjs.entry.js.map
3 years ago
sc-product-selected-price.cjs.entry.js
3 years ago
sc-product-selected-price.cjs.entry.js.map
3 years ago
sc-product-text.cjs.entry.js
3 years ago
sc-product-text.cjs.entry.js.map
3 years ago
sc-prose.cjs.entry.js
3 years ago
sc-prose.cjs.entry.js.map
3 years ago
sc-provider.cjs.entry.js
3 years ago
sc-provider.cjs.entry.js.map
3 years ago
sc-purchase-downloads-list_2.cjs.entry.js
3 years ago
sc-purchase-downloads-list_2.cjs.entry.js.map
3 years ago
sc-radio-group.cjs.entry.js
3 years ago
sc-radio-group.cjs.entry.js.map
3 years ago
sc-radio.cjs.entry.js
3 years ago
sc-radio.cjs.entry.js.map
3 years ago
sc-rich-text.cjs.entry.js
3 years ago
sc-rich-text.cjs.entry.js.map
3 years ago
sc-skeleton.cjs.entry.js
3 years ago
sc-skeleton.cjs.entry.js.map
3 years ago
sc-stacked-list_2.cjs.entry.js
3 years ago
sc-stacked-list_2.cjs.entry.js.map
3 years ago
sc-stripe-add-method.cjs.entry.js
3 years ago
sc-stripe-add-method.cjs.entry.js.map
3 years ago
sc-stripe-element.cjs.entry.js
3 years ago
sc-stripe-element.cjs.entry.js.map
3 years ago
sc-stripe-payment-element.cjs.entry.js
3 years ago
sc-stripe-payment-element.cjs.entry.js.map
3 years ago
sc-stripe-payment-request.cjs.entry.js
3 years ago
sc-stripe-payment-request.cjs.entry.js.map
3 years ago
sc-subscription-ad-hoc-confirm.cjs.entry.js
3 years ago
sc-subscription-ad-hoc-confirm.cjs.entry.js.map
3 years ago
sc-subscription-details_2.cjs.entry.js
3 years ago
sc-subscription-details_2.cjs.entry.js.map
3 years ago
sc-subscription-payment-method.cjs.entry.js
3 years ago
sc-subscription-payment-method.cjs.entry.js.map
3 years ago
sc-subscription-payment.cjs.entry.js
3 years ago
sc-subscription-payment.cjs.entry.js.map
3 years ago
sc-subscription-switch.cjs.entry.js
3 years ago
sc-subscription-switch.cjs.entry.js.map
3 years ago
sc-subscription.cjs.entry.js
3 years ago
sc-subscription.cjs.entry.js.map
3 years ago
sc-subscriptions-list.cjs.entry.js
3 years ago
sc-subscriptions-list.cjs.entry.js.map
3 years ago
sc-switch.cjs.entry.js
3 years ago
sc-switch.cjs.entry.js.map
3 years ago
sc-tab-group.cjs.entry.js
3 years ago
sc-tab-group.cjs.entry.js.map
3 years ago
sc-tab-panel.cjs.entry.js
3 years ago
sc-tab-panel.cjs.entry.js.map
3 years ago
sc-tab.cjs.entry.js
3 years ago
sc-tab.cjs.entry.js.map
3 years ago
sc-table-head.cjs.entry.js
3 years ago
sc-table-head.cjs.entry.js.map
3 years ago
sc-table_3.cjs.entry.js
3 years ago
sc-table_3.cjs.entry.js.map
3 years ago
sc-tag.cjs.entry.js
3 years ago
sc-tag.cjs.entry.js.map
3 years ago
sc-text.cjs.entry.js
3 years ago
sc-text.cjs.entry.js.map
3 years ago
sc-toggle.cjs.entry.js
3 years ago
sc-toggle.cjs.entry.js.map
3 years ago
sc-toggles.cjs.entry.js
3 years ago
sc-toggles.cjs.entry.js.map
3 years ago
sc-tooltip.cjs.entry.js
3 years ago
sc-tooltip.cjs.entry.js.map
3 years ago
sc-total.cjs.entry.js
3 years ago
sc-total.cjs.entry.js.map
3 years ago
sc-upcoming-invoice.cjs.entry.js
3 years ago
sc-upcoming-invoice.cjs.entry.js.map
3 years ago
sc-upgrade-required.cjs.entry.js
3 years ago
sc-upgrade-required.cjs.entry.js.map
3 years ago
sc-wordpress-password-edit.cjs.entry.js
3 years ago
sc-wordpress-password-edit.cjs.entry.js.map
3 years ago
sc-wordpress-user-edit.cjs.entry.js
3 years ago
sc-wordpress-user-edit.cjs.entry.js.map
3 years ago
sc-wordpress-user.cjs.entry.js
3 years ago
sc-wordpress-user.cjs.entry.js.map
3 years ago
store-79bafee3.js
3 years ago
store-79bafee3.js.map
3 years ago
store-a92c3e74.js
3 years ago
store-a92c3e74.js.map
3 years ago
surecart.cjs.js
3 years ago
surecart.cjs.js.map
3 years ago
tax-39abdb3c.js
3 years ago
tax-39abdb3c.js.map
3 years ago
ui-c6cc5556.js
3 years ago
ui-c6cc5556.js.map
3 years ago
universe-874f42bb.js
3 years ago
universe-874f42bb.js.map
3 years ago
util-872b1a55.js
3 years ago
util-872b1a55.js.map
3 years ago
utils-806dad60.js
3 years ago
utils-806dad60.js.map
3 years ago
watchers-42477f79.js
3 years ago
watchers-42477f79.js.map
3 years ago
watchers-437b71fb.js
3 years ago
watchers-437b71fb.js.map
3 years ago
watchers-503cdd2a.js
3 years ago
watchers-503cdd2a.js.map
3 years ago
watchers-bce289f5.js
3 years ago
watchers-bce289f5.js.map
3 years ago
sc-switch.cjs.entry.js
106 lines
| 1 | 'use strict'; |
| 2 | |
| 3 | Object.defineProperty(exports, '__esModule', { value: true }); |
| 4 | |
| 5 | const index = require('./index-ac77ca60.js'); |
| 6 | const formData = require('./form-data-69000afe.js'); |
| 7 | |
| 8 | const scSwitchCss = ":host{--height:var(--sc-toggle-size);--thumb-size:calc(var(--sc-toggle-size) - 2px);--width:calc(var(--height) * 2);display:block}.switch{display:inline-flex;align-items:flex-start;gap:0.7em;font-family:var(--sc-input-font-family);font-size:var(--sc-input-font-size-medium);font-weight:var(--sc-input-font-weight);color:var(--sc-input-color);vertical-align:middle;cursor:pointer}.switch--reversed{flex-direction:row-reverse}.switch--editing{cursor:initial}.switch__control{flex:0 0 auto;position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--sc-switch-control-background-color, var(--sc-color-gray-300));border:solid var(--sc-input-border-width) var(--sc-switch-border-color, var(--sc-color-gray-300));border-radius:var(--height);transition:var(--sc-input-transition, var(--sc-transition-medium)) border-color, var(--sc-input-transition, var(--sc-transition-medium)) background-color}.switch__control .switch__thumb{width:var(--thumb-size);height:var(--thumb-size);background-color:var(--sc-switch-thumb-background-color, var(--sc-color-white));border-radius:50%;border:solid var(--sc-input-border-width) var(--sc-input-border-color);transform:translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));transition:var(--sc-input-transition, var(--sc-transition-medium)) transform ease, var(--sc-input-transition, var(--sc-transition-medium)) background-color, var(--sc-input-transition, var(--sc-transition-medium)) border-color, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow}.switch__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover{background-color:var(--sc-switch-control-hover-background-color, var(--sc-color-gray-200));border-color:var(--sc-switch-control-hover-border-color, var(--sc-color-gray-200))}.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb{background-color:var(--sc-switch-background-thumb-hover-color, var(--sc-color-white));border-color:var(--sc-switch-thumb-border-color, var(--sc-input-border-color))}.switch.switch--focused:not(.switch--checked):not(.switch--disabled) .switch__control{background-color:var(--sc-switch-control-hover-background-color, var(--sc-color-gray-200));border-color:var(--sc-switch-control-hover-border-color, var(--sc-color-gray-200))}.switch.switch--focused:not(.switch--checked):not(.switch--disabled) .switch__control .switch__thumb{background-color:var(--sc-color-white);border-color:var(--sc-color-gray-300);box-shadow:0 0 0 1px var(--sc-color-gray-300)}.switch--checked .switch__control{background-color:var(--sc-switch-checked-control-background-color, var(--sc-color-primary-500));border-color:var(--sc-switch-checked-control-border-color, var(--sc-color-primary-500))}.switch--checked .switch__control .switch__thumb{background-color:var(--sc-color-white);border-color:var(--sc-color-primary-500);transform:translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2))}.switch.switch--checked:not(.switch--disabled) .switch__control:hover{opacity:0.8}.switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb{background-color:var(--sc-color-white);border-color:var(--sc-color-primary-500)}.switch.switch--checked:not(.switch--disabled).switch--focused .switch__control .switch__thumb{background-color:var(--sc-color-white);border-color:var(--sc-color-primary-500);box-shadow:0 0 0 1px var(--sc-focus-ring-color-primary)}.switch--disabled{opacity:0.5;cursor:not-allowed}.switch__label{user-select:none;line-height:var(--height)}.switch--is-required .switch__title:after{content:\" *\";color:var(--sc-color-danger-500)}.switch__title{color:var(--sc-swith-label-color, var(--sc-input-label-color));font-weight:var(--sc-input-label-font-weight);font-size:var(--sc-input-label-font-size-medium)}.switch__description{display:none;color:var(--sc-switch-description-color, var(--sc-color-gray-500));line-height:var(--sc-line-height-dense);margin:0.5em 0 0;font-size:var(--sc-font-size-small)}.switch--has-description .switch__description{display:block}slot[name=description]::slotted(*){margin:0.75em 0;line-height:var(--sc-line-height-dense);vertical-align:center}"; |
| 9 | |
| 10 | let id = 0; |
| 11 | const ScSwitch = class { |
| 12 | constructor(hostRef) { |
| 13 | index.registerInstance(this, hostRef); |
| 14 | this.scBlur = index.createEvent(this, "scBlur", 7); |
| 15 | this.scChange = index.createEvent(this, "scChange", 7); |
| 16 | this.scFocus = index.createEvent(this, "scFocus", 7); |
| 17 | this.switchId = `switch-${++id}`; |
| 18 | this.labelId = `switch-label-${id}`; |
| 19 | this.hasDescription = undefined; |
| 20 | this.hasFocus = false; |
| 21 | this.name = undefined; |
| 22 | this.value = undefined; |
| 23 | this.disabled = false; |
| 24 | this.required = false; |
| 25 | this.checked = false; |
| 26 | this.invalid = false; |
| 27 | this.reversed = undefined; |
| 28 | this.edit = false; |
| 29 | } |
| 30 | /** Checks for validity and shows the browser's validation message if the control is invalid. */ |
| 31 | async reportValidity() { |
| 32 | this.invalid = !this.input.checkValidity(); |
| 33 | return this.input.reportValidity(); |
| 34 | } |
| 35 | handleClick() { |
| 36 | this.checked = !this.checked; |
| 37 | this.scChange.emit(); |
| 38 | } |
| 39 | handleBlur() { |
| 40 | this.hasFocus = false; |
| 41 | this.scBlur.emit(); |
| 42 | } |
| 43 | handleFocus() { |
| 44 | this.hasFocus = true; |
| 45 | this.scFocus.emit(); |
| 46 | } |
| 47 | handleKeyDown(event) { |
| 48 | if (this.edit) |
| 49 | return true; |
| 50 | if (event.key === 'ArrowLeft') { |
| 51 | event.preventDefault(); |
| 52 | this.checked = false; |
| 53 | this.scChange.emit(); |
| 54 | } |
| 55 | if (event.key === 'ArrowRight') { |
| 56 | event.preventDefault(); |
| 57 | this.checked = true; |
| 58 | this.scChange.emit(); |
| 59 | } |
| 60 | } |
| 61 | handleMouseDown(event) { |
| 62 | if (this.edit) |
| 63 | return true; |
| 64 | // Prevent clicks on the label from briefly blurring the input |
| 65 | event.preventDefault(); |
| 66 | this.input.focus(); |
| 67 | } |
| 68 | handleCheckedChange() { |
| 69 | if (this.input) { |
| 70 | this.input.checked = this.checked; |
| 71 | this.invalid = !this.input.checkValidity(); |
| 72 | } |
| 73 | } |
| 74 | componentDidLoad() { |
| 75 | this.formController = new formData.FormSubmitController(this.el, { |
| 76 | value: (control) => (control.checked ? control.value : undefined), |
| 77 | }).addFormData(); |
| 78 | this.hasDescription = !!this.el.querySelector('[slot="description"]'); |
| 79 | } |
| 80 | disconnectedCallback() { |
| 81 | var _a; |
| 82 | (_a = this.formController) === null || _a === void 0 ? void 0 : _a.removeFormData(); |
| 83 | } |
| 84 | render() { |
| 85 | const Tag = this.edit ? 'div' : 'label'; |
| 86 | return (index.h(Tag, { part: "base", htmlFor: this.switchId, class: { |
| 87 | 'switch': true, |
| 88 | 'switch--is-required': this.required, |
| 89 | 'switch--checked': this.checked, |
| 90 | 'switch--disabled': this.disabled, |
| 91 | 'switch--focused': this.hasFocus, |
| 92 | 'switch--reversed': this.reversed, |
| 93 | 'switch--editing': this.edit, |
| 94 | 'switch--has-description': this.hasDescription, |
| 95 | }, onMouseDown: e => this.handleMouseDown(e) }, index.h("span", { part: "control", class: "switch__control" }, index.h("span", { part: "thumb", class: "switch__thumb" }), index.h("input", { ref: el => (this.input = el), id: this.switchId, type: "checkbox", role: "switch", name: this.name, value: this.value || 'on', checked: this.checked, disabled: this.disabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-labelledby": this.labelId, onClick: () => this.handleClick(), onBlur: () => this.handleBlur(), onFocus: () => this.handleFocus(), onKeyDown: e => this.handleKeyDown(e) })), index.h("span", { class: "switch__label" }, index.h("span", { part: "title", id: this.labelId, class: "switch__title" }, index.h("slot", null)), index.h("span", { class: "switch__description", part: "description" }, index.h("slot", { name: "description" }))))); |
| 96 | } |
| 97 | get el() { return index.getElement(this); } |
| 98 | static get watchers() { return { |
| 99 | "checked": ["handleCheckedChange"] |
| 100 | }; } |
| 101 | }; |
| 102 | ScSwitch.style = scSwitchCss; |
| 103 | |
| 104 | exports.sc_switch = ScSwitch; |
| 105 | |
| 106 | //# sourceMappingURL=sc-switch.cjs.entry.js.map |