JezK
Edit File: sc-compact-address_18.cjs.entry.js.map
{"file":"sc-compact-address.sc-customer-phone.sc-invoice-details.sc-invoice-memo.sc-line-item-invoice-due-date.sc-line-item-invoice-number.sc-line-item-invoice-receipt-download.sc-line-item-shipping.sc-line-item-tax.sc-line-item-trial.sc-order-billing-address.sc-order-bump.sc-order-bumps.sc-order-shipping-address.sc-order-tax-id-input.sc-radio.sc-radio-group.sc-shipping-choices.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,sfAAsf,CAAC;AACnhB,+BAAe,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC6DR,UAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sKAiH2B,UAAE,0vCA4BM,UAAE,2lBAUV,UAAE;;;;;;;;;ACrNzD,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAClD,8BAAe,kBAAkB;;MCUpB,eAAe;;;;;;;;oBAOoC,QAAQ;qBAGrC,EAAE;oBAGH,KAAK;;yBAMR,IAAI;oBAGV,EAAE;;wBAMoB,KAAK;wBAGL,KAAK;wBAGd,KAAK;uBAMS,KAAK;;;;;IA0BvD,MAAM,YAAY;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACtB;IAGD,MAAM,cAAc;;QAClB,OAAO,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,kDAAI,CAAC;KACvC;IAED,iBAAiB;QACf,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,oBAAoB,GAAGA,kBAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;KACrF;IAED,oBAAoB;QAClB,IAAI,CAAC,oB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,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAC,IAAI,GAAG,EACnKA,kEAAK,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,oBAAoB,IAC1CA,oEAAa,CACT,CACG,EACX;KACH;;;;;ACrFH,MAAM,oBAAoB,GAAG,kjEAAkjE,CAAC;AAChlE,gCAAe,oBAAoB;;;;;;;;;;;;;;;;;;;;;0BC8CvB,UAAE;;;0BAIF,eAAO,CAAC,UAAE;;;;;;;;;;;;;;;;;;;;;0EAsB0B,UAAE,gFACD,UAAE;;;;yFAQU,UAAE,gFACd,UAAE;;;yGAQM,UAAE;;8jBAUsC,UAAE,sZAKZ,UAAE;;;;;;;;;;;;;;;;;;;;;;;;;","names":["onChange","checkoutState","h","Host","openWormhole","updateFormState","createOrUpdateCheckout","createErrorNotice","formBusy","FormSubmitController","isRtl"],"sources":["src/components/ui/sc-compact-address/sc-compact-address.scss?tag=sc-compact-address&encapsulation=shadow","src/components/ui/sc-compact-address/sc-compact-address.tsx","src/components/controllers/checkout-form/customer-phone/sc-customer-phone.css?tag=sc-customer-phone&encapsulation=shadow","src/components/controllers/checkout-form/customer-phone/sc-customer-phone.tsx","src/components/controllers/checkout-form/invoice-details/sc-invoice-details.scss?tag=sc-invoice-details&encapsulation=shadow","src/components/controllers/checkout-form/invoice-details/sc-invoice-details.tsx","src/components/controllers/checkout-form/invoice-memo/sc-invoice-memo.scss?tag=sc-invoice-memo&encapsulation=shadow","src/components/controllers/checkout-form/invoice-memo/sc-invoice-memo.tsx","src/components/controllers/checkout-form/invoice-due-date/sc-line-item-invoice-due-date.scss?tag=sc-line-item-invoice-due-date&encapsulation=shadow","src/components/controllers/checkout-form/invoice-due-date/sc-line-item-invoice-due-date.tsx","src/components/controllers/checkout-form/invoice-number/sc-line-item-invoice-number.scss?tag=sc-line-item-invoice-number&encapsulation=shadow","src/components/controllers/checkout-form/invoice-number/sc-line-item-invoice-number.tsx","src/components/controllers/checkout-form/invoice-receipt-download/sc-line-item-invoice-receipt-download.scss?tag=sc-line-item-invoice-receipt-download&encapsulation=shadow","src/components/controllers/checkout-form/invoice-receipt-download/sc-line-item-invoice-receipt-download.tsx","src/components/controllers/checkout-form/sc-line-item-shipping/sc-line-item-shipping.scss?tag=sc-line-item-shipping&encapsulation=shadow","src/components/controllers/checkout-form/sc-line-item-shipping/sc-line-item-shipping.tsx","src/components/controllers/checkout-form/line-item-tax/sc-line-item-tax.scss?tag=sc-line-item-tax&encapsulation=shadow","src/components/controllers/checkout-form/line-item-tax/sc-line-item-tax.tsx","src/components/controllers/checkout-form/line-item-trial/sc-line-item-trial.scss?tag=sc-line-item-trial&encapsulation=shadow","src/components/controllers/checkout-form/line-item-trial/sc-line-item-trial.tsx","src/components/controllers/checkout-form/sc-order-billing-address/sc-order-billing-address.scss?tag=sc-order-billing-address&encapsulation=shadow","src/components/controllers/checkout-form/sc-order-billing-address/sc-order-billing-address.tsx","src/components/controllers/checkout-form/sc-order-bump/sc-order-bump.scss?tag=sc-order-bump&encapsulation=shadow","src/components/controllers/checkout-form/sc-order-bump/sc-order-bump.tsx","src/components/controllers/checkout-form/sc-order-bumps/sc-order-bumps.scss?tag=sc-order-bumps&encapsulation=shadow","src/components/controllers/checkout-form/sc-order-bumps/sc-order-bumps.tsx","src/components/controllers/checkout-form/order-shipping-address/sc-order-shipping-address.scss?tag=sc-order-shipping-address&encapsulation=shadow","src/components/controllers/checkout-form/order-shipping-address/sc-order-shipping-address.tsx","src/components/controllers/checkout-form/order-tax-id-input/sc-order-tax-id-input.css?tag=sc-order-tax-id-input&encapsulation=shadow","src/components/controllers/checkout-form/order-tax-id-input/sc-order-tax-id-input.tsx","src/components/ui/radio/sc-radio.scss?tag=sc-radio&encapsulation=shadow","src/components/ui/radio/sc-radio.tsx","src/components/ui/radio-group/sc-radio-group.scss?tag=sc-radio-group&encapsulation=shadow","src/components/ui/radio-group/sc-radio-group.tsx","src/components/ui/sc-shipping-choices/sc-shipping-choices.scss?tag=sc-shipping-choices&encapsulation=shadow","src/components/ui/sc-shipping-choices/sc-shipping-choices.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.sc-address {\n display: block;\n position: relative;\n\n [hidden] {\n display: none;\n }\n\n &--loading {\n min-height: 70px;\n\n sc-skeleton {\n display: block;\n margin-bottom: 1em;\n }\n }\n\n\n &__control {\n display: block;\n\n > * {\n margin-bottom: -1px;\n }\n }\n\n &__columns {\n display: flex;\n flex-direction: row;\n align-items: center;\n flex-wrap: wrap;\n justify-content: space-between;\n\n > * {\n flex: 1;\n width: 50%;\n margin-left: -1px;\n\n &:first-child {\n margin-left: 0;\n }\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { Address } from '../../../types';\nimport { countryChoices, getCountryDetails } from '../../../functions/address';\nimport { __ } from '@wordpress/i18n';\nimport { reportChildrenValidity } from '../../../functions/form-data';\nimport { getCurrentUserCountryCode } from '../../../functions/google-maps';\n\n/**\n * @part base - The elements base wrapper.\n * @part input__base - The inputs base element.\n * @part select__base - The select boxes base element.\n * @part input - The html input element.\n * @part form-control - The form control wrapper.\n * @part label - The input label.\n * @part help-text - Help text that describes how to use the input.\n * @part trigger - The select box trigger.\n * @part panel - The select box panel.\n * @part caret - The select box caret.\n * @part search__base - The select search base.\n * @part search__input - The select search input.\n * @part search__form-control - The select search form control.\n * @part menu__base - The select menu base.\n * @part spinner__base - The select spinner base.\n * @part empty - The select empty message.\n * @part block-ui - The block ui base component.\n * @part block-ui__content - The block ui content (spinner).\n */\n@Component({\n tag: 'sc-compact-address',\n styleUrl: 'sc-compact-address.scss',\n shadow: true,\n})\nexport class ScCompactAddress {\n @Element() el: HTMLScCompactAddressElement;\n\n /** The address. */\n @Prop({ mutable: true }) address: Partial<Address> = {\n country: null,\n city: null,\n line_1: null,\n line_2: null,\n postal_code: null,\n state: null,\n };\n\n @Prop() names: Partial<Address> = {\n country: 'shipping_country',\n city: 'shipping_city',\n line_1: 'shipping_line_1',\n line_2: 'shipping_line_2',\n postal_code: 'shipping_postal_code',\n state: 'shipping_state',\n };\n\n /**Placeholders */\n @Prop() placeholders: Partial<Address> = {\n country: '',\n postal_code: '',\n state: '',\n };\n\n /** Label for the address */\n @Prop() label: string = __('Country or region', 'surecart');\n\n /** Is this required? */\n @Prop() required: boolean;\n\n /** Is this loading */\n @Prop() loading: boolean;\n\n /** Address change event. */\n @Event() scChangeAddress: EventEmitter<Partial<Address>>;\n\n /** Address input event. */\n @Event() scInputAddress: EventEmitter<Partial<Address>>;\n\n /** Holds our country choices. */\n @State() countryChoices: Array<{ value: string; label: string }>;\n\n /** Holds the regions for a given country. */\n @State() regions: Array<{ value: string; label: string }>;\n\n @State() showState: boolean;\n @State() showPostal: boolean;\n\n /** Postal code regex pattern for validation. */\n @State() postalCodeRegex: string;\n\n /** When the state changes, we want to update city and postal fields. */\n @Watch('address')\n handleAddressChange() {\n if (!this.address?.country) return;\n this.setRegions();\n this.showState = ['US', 'CA'].includes(this.address.country);\n this.showPostal = ['US'].includes(this.address.country);\n this.scChangeAddress.emit(this.address);\n this.scInputAddress.emit(this.address);\n }\n\n updateAddress(address: Partial<Address>) {\n this.address = { ...this.address, ...address };\n }\n\n handleAddressInput(address: Partial<Address>) {\n this.scInputAddress.emit({ ...this.address, ...address });\n }\n\n clearAddress() {\n this.address = {\n name: this.address?.name,\n country: null,\n line_1: null,\n line_2: null,\n city: null,\n postal_code: null,\n state: null,\n };\n }\n\n /** Set the regions based on the country. */\n async setRegions() {\n const countryDetails = await getCountryDetails(this.address?.country);\n this.regions =\n countryDetails?.states?.map(state => ({\n value: state?.code,\n label: state?.name,\n })) || [];\n\n this.placeholders = countryDetails?.address_labels;\n this.postalCodeRegex = countryDetails?.postal_code_regex || undefined;\n }\n\n componentWillLoad() {\n this.initCountryChoices();\n this.handleAddressChange();\n const country = this.countryChoices?.find(country => country.value === this.address.country)?.value;\n if (country) {\n this.updateAddress({ country });\n }\n this.fetchUserCountry();\n }\n\n async fetchUserCountry() {\n if (this.address?.country) {\n return;\n }\n\n const countryCode = await getCurrentUserCountryCode();\n if (countryCode) {\n this.updateAddress({ country: countryCode });\n }\n }\n\n async initCountryChoices() {\n this.countryChoices = await countryChoices();\n }\n\n @Method()\n async reportValidity() {\n return reportChildrenValidity(this.el);\n }\n\n render() {\n return (\n <div class=\"sc-address\" part=\"base\">\n <sc-form-control exportparts=\"label, help-text, form-control\" label={this.label} class=\"sc-address__control\" part=\"control\" required={this.required}>\n <sc-select\n exportparts=\"base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty\"\n value={this.address?.country}\n onScChange={(e: any) => {\n this.clearAddress();\n this.updateAddress({ country: e.target.value || null });\n }}\n choices={this.countryChoices}\n autocomplete={'country-name'}\n placeholder={this.placeholders?.country || __('Select Your Country', 'surecart')}\n name={this.names.country}\n search\n unselect={false}\n squared-bottom={this.showState || this.showPostal}\n required={this.required}\n />\n\n <div class=\"sc-address__columns\">\n {this.showState && (\n <sc-select\n exportparts=\"base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty\"\n placeholder={this.placeholders?.state}\n name={this.names.state}\n autocomplete={'address-level1'}\n value={this?.address?.state}\n onScChange={(e: any) => this.updateAddress({ state: e.target.value || null })}\n choices={this.regions}\n required={this.required}\n search\n squared-top\n unselect={false}\n squared-right={this.showPostal}\n />\n )}\n {this.showPostal && (\n <sc-input\n exportparts=\"base:input__base, input, form-control, label, help-text\"\n placeholder={this.placeholders?.postal_code || __('Postal Code/Zip', 'surecart')}\n name={this.names.postal_code}\n onScChange={(e: any) => this.updateAddress({ postal_code: e.target.value || null })}\n onScInput={(e: any) => this.handleAddressInput({ postal_code: e.target.value || null })}\n autocomplete={'postal-code'}\n required={this.required}\n value={this?.address?.postal_code}\n squared-top\n maxlength={this.address?.country === 'US' ? 5 : undefined}\n pattern={this.postalCodeRegex}\n customValidity={this.postalCodeRegex ? __('Please enter a valid postal code', 'surecart') : undefined}\n squared-left={this.showState}\n />\n )}\n </div>\n </sc-form-control>\n {this.loading && <sc-block-ui exportparts=\"base:block-ui, content:block-ui__content\"></sc-block-ui>}\n </div>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, h, Method, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\nimport { state as checkoutState, onChange } from '@store/checkout';\n\nimport { Customer } from '../../../../types';\n\n@Component({\n tag: 'sc-customer-phone',\n styleUrl: 'sc-customer-phone.css',\n shadow: true,\n})\nexport class ScCustomerPhone {\n private input: HTMLScInputElement;\n\n /** Remove the change listener */\n private removeChangeListener: () => void;\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's value attribute. */\n @Prop({ mutable: true }) value = '';\n\n /** Draws a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's label. */\n @Prop() label: string;\n\n /** Should we show the label */\n @Prop() showLabel: boolean = true;\n\n /** The input's help text. */\n @Prop() help: string = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder: string;\n\n /** Disables the input. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Makes the input readonly. */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /** Makes the input a required field. */\n @Prop({ reflect: true }) required = false;\n\n /**\n * This will be true when the control is in an invalid state. Validity is determined by props such as `type`,\n * `required`, `minlength`, `maxlength`, and `pattern` using the browser's constraint validation API.\n */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** The input's autofocus attribute. */\n @Prop() autofocus: boolean;\n\n /** Inputs focus */\n @Prop({ mutable: true, reflect: true }) hasFocus: boolean;\n\n /** Error focus */\n @Prop({ mutable: true }) error: boolean;\n\n /** Emitted when the control's value changes. */\n @Event({ composed: true }) scChange: EventEmitter<void>;\n\n /** Emitted when the clear button is activated. */\n @Event() scClear: EventEmitter<void>;\n\n /** Emitted when the control receives input. */\n @Event() scInput: EventEmitter<void>;\n\n /** Emitted when the control gains focus. */\n @Event() scFocus: EventEmitter<void>;\n\n /** Emitted when the control loses focus. */\n @Event() scBlur: EventEmitter<void>;\n\n async handleChange() {\n this.value = this.input.value;\n this.scChange.emit();\n }\n\n @Method()\n async reportValidity() {\n return this.input?.reportValidity?.();\n }\n\n componentWillLoad() {\n this.handleCheckoutChange();\n this.removeChangeListener = onChange('checkout', () => this.handleCheckoutChange());\n }\n\n disconnectedCallback() {\n this.removeChangeListener();\n }\n\n handleCheckoutChange() {\n // we only want to do this if we don't have a value.\n if (this?.value) return;\n\n // if the checkout has a phone, use that.\n if (checkoutState.checkout?.phone) {\n this.value = checkoutState.checkout?.phone;\n return;\n }\n\n // if the customer has a phone, use that.\n if ((checkoutState.checkout?.customer as Customer)?.phone) {\n this.value = (checkoutState.checkout?.customer as Customer)?.phone;\n return;\n }\n }\n\n render() {\n return (\n <sc-phone-input\n name=\"phone\"\n ref={el => (this.input = el as HTMLScInputElement)}\n value={this.value}\n label={this.label}\n help={this.help}\n autocomplete=\"phone\"\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n invalid={this.invalid}\n autofocus={this.autofocus}\n hasFocus={this.hasFocus}\n onScChange={() => this.handleChange()}\n onScInput={() => this.scInput.emit()}\n onScFocus={() => this.scFocus.emit()}\n onScBlur={() => this.scBlur.emit()}\n />\n );\n }\n}\n",":host {\n display: block;\n}\n\n::slotted(*) {\n margin: 4px 0 !important;\n}\n::slotted(sc-divider) {\n margin: 16px 0 !important;\n}\n","/**\n * External dependencies.\n */\nimport { Component, Host, h } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies.\n */\nimport { state as checkoutState } from '@store/checkout';\n\n@Component({\n tag: 'sc-invoice-details',\n styleUrl: 'sc-invoice-details.scss',\n shadow: true,\n})\nexport class ScInvoiceDetails {\n render() {\n return (\n <Host style={{ ...(!checkoutState?.checkout?.invoice ? { display: 'none' } : {}) }}>\n <div class=\"invoice-details\">\n <slot />\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.invoice-memo {\n font-size: var(--sc-font-size-small);\n line-height: var(--sc-line-height-dense);\n color: var(--sc-input-label-color);\n display: grid;\n gap: 5px;\n\n &__content {\n text-align: left;\n color: var(--sc-input-help-text-color);\n }\n}\n","/**\n * External dependencies.\n */\nimport { Component, h, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies.\n */\nimport { formBusy } from '@store/form/getters';\nimport { state as checkoutState } from '@store/checkout';\nimport { Invoice } from '../../../../types';\n\n@Component({\n tag: 'sc-invoice-memo',\n styleUrl: 'sc-invoice-memo.scss',\n shadow: true,\n})\nexport class ScLineItemInvoiceMemo {\n /** Memo Label */\n @Prop() text: string;\n\n render() {\n const checkout = checkoutState?.checkout;\n const memo = (checkout?.invoice as Invoice)?.memo || null;\n\n // Stop if checkout has no invoice number.\n if (!memo) {\n return null;\n }\n\n // loading state\n if (formBusy() && !checkout?.invoice) {\n return (\n <div>\n <sc-skeleton style={{ width: '100px' }}></sc-skeleton>\n <sc-skeleton style={{ width: '200px' }}></sc-skeleton>\n </div>\n );\n }\n\n return (\n <div class=\"invoice-memo\">\n <div class=\"invoice-memo__title\">{this.text || __('Memo', 'surecart')}</div>\n <div class=\"invoice-memo__content\">{memo}</div>\n </div>\n );\n }\n}\n",":host {\n display: block;\n}\n\nsc-line-item {\n text-align: left;\n line-height: var(--sc-line-height-dense);\n color: var(--sc-input-label-color);\n}\n","/**\n * External dependencies.\n */\nimport { Component, h } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies.\n */\nimport { formBusy } from '@store/form/getters';\nimport { state as checkoutState } from '@store/checkout';\nimport { Invoice } from '../../../../types';\n\n@Component({\n tag: 'sc-line-item-invoice-due-date',\n styleUrl: 'sc-line-item-invoice-due-date.scss',\n shadow: true,\n})\nexport class ScLineItemInvoiceDueDate {\n render() {\n const checkout = checkoutState?.checkout;\n const dueDate = (checkout?.invoice as Invoice)?.due_date_date || null;\n\n // Stop if checkout has no invoice due date.\n if (!dueDate) {\n return null;\n }\n\n // loading state\n if (formBusy() && !checkout?.invoice) {\n return (\n <sc-line-item>\n <sc-skeleton slot=\"title\" style={{ width: '120px', display: 'inline-block' }}></sc-skeleton>\n <sc-skeleton slot=\"price\" style={{ 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' }}></sc-skeleton>\n </sc-line-item>\n );\n }\n\n return (\n <sc-line-item>\n <span slot=\"description\">\n <slot name=\"title\">{__('Due Date', 'surecart')}</slot>\n </span>\n <span slot=\"price-description\">{dueDate}</span>\n </sc-line-item>\n );\n }\n}\n",":host {\n display: block;\n}\n\nsc-line-item {\n text-align: left;\n line-height: var(--sc-line-height-dense);\n color: var(--sc-input-label-color);\n}\n","/**\n * External dependencies.\n */\nimport { Component, h } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies.\n */\nimport { formBusy } from '@store/form/getters';\nimport { state as checkoutState } from '@store/checkout';\nimport { Invoice } from '../../../../types';\n\n@Component({\n tag: 'sc-line-item-invoice-number',\n styleUrl: 'sc-line-item-invoice-number.scss',\n shadow: true,\n})\nexport class ScLineItemInvoiceNumber {\n render() {\n const checkout = checkoutState?.checkout;\n const invoiceNumber = (checkout?.invoice as Invoice)?.order_number || null;\n\n // Stop if checkout has no invoice number.\n if (!invoiceNumber) {\n return null;\n }\n\n // loading state\n if (formBusy() && !checkout?.invoice) {\n return (\n <sc-line-item>\n <sc-skeleton slot=\"title\" style={{ width: '120px', display: 'inline-block' }}></sc-skeleton>\n <sc-skeleton slot=\"price\" style={{ 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' }}></sc-skeleton>\n </sc-line-item>\n );\n }\n\n return (\n <sc-line-item>\n <span slot=\"description\">\n <slot name=\"title\">{__('Invoice Number', 'surecart')}</slot>\n </span>\n <span slot=\"price-description\">#{invoiceNumber}</span>\n </sc-line-item>\n );\n }\n}\n",":host {\n display: block;\n}\n\nsc-line-item {\n text-align: left;\n line-height: var(--sc-line-height-dense);\n color: var(--sc-input-label-color);\n}\n\n.sc-invoice-download-link {\n display: inline-flex;\n gap: var(--sc-spacing-x-small);\n text-decoration: none;\n color: inherit;\n}\n","/**\n * External dependencies.\n */\nimport { Component, h, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies.\n */\nimport { formBusy } from '@store/form/getters';\nimport { state as checkoutState } from '@store/checkout';\nimport { Checkout, Invoice } from '../../../../types';\n\n@Component({\n tag: 'sc-line-item-invoice-receipt-download',\n styleUrl: 'sc-line-item-invoice-receipt-download.scss',\n shadow: true,\n})\nexport class ScLineItemInvoiceReceiptDownload {\n @Prop() checkout: Checkout;\n\n render() {\n const checkout = checkoutState?.checkout;\n const receiptDownloadLink = (checkout?.invoice as Invoice)?.id ? checkout?.pdf_url : null;\n\n // Stop if checkout has no receipt download link.\n if (!receiptDownloadLink) {\n return null;\n }\n\n // loading state\n if (formBusy() && !checkout?.invoice) {\n return (\n <sc-line-item>\n <sc-skeleton slot=\"title\" style={{ width: '120px', display: 'inline-block' }}></sc-skeleton>\n <sc-skeleton slot=\"price\" style={{ 'width': '50px', 'display': 'inline-block', '--border-radius': '6px' }}></sc-skeleton>\n </sc-line-item>\n );\n }\n\n return (\n <sc-line-item>\n <span slot=\"description\">\n <slot name=\"title\">{__('Receipt / Invoice', 'surecart')}</slot>\n </span>\n <span slot=\"price-description\">\n <a class=\"sc-invoice-download-link\" href={receiptDownloadLink} target=\"_blank\" rel=\"noopener noreferrer\">\n <sc-icon name=\"download\" />\n {__('Download', 'surecart')}\n </a>\n </span>\n </sc-line-item>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, Fragment, Host, Prop, h } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\nimport { state as formState } from '@store/form';\nimport { state as checkoutState } from '@store/checkout';\nimport { Checkout } from 'src/types';\n\n@Component({\n tag: 'sc-line-item-shipping',\n styleUrl: 'sc-line-item-shipping.scss',\n shadow: true,\n})\nexport class ScLineItemShipping {\n /**Label */\n @Prop() label: string;\n\n renderShippingFees(checkout: Checkout) {\n if (!checkout?.shipping_fees?.data?.length) {\n return null;\n }\n\n return (\n <Fragment>\n {checkout?.shipping_fees?.data?.map(fee => (\n <sc-line-item key={fee.id}>\n <span slot=\"description\">{fee.description}</span>\n <span slot=\"price\">{fee.display_amount}</span>\n </sc-line-item>\n ))}\n </Fragment>\n );\n }\n\n render() {\n const { checkout } = checkoutState;\n\n // don't show if no shipping amount if no choice selected\n if (!checkout?.selected_shipping_choice) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n\n if (formState.formState.value === 'loading') {\n return (\n <sc-line-item>\n <sc-skeleton slot=\"title\" style={{ width: '120px', display: 'inline-block' }}></sc-skeleton>\n <sc-skeleton slot=\"price\" style={{ 'width': '70px', 'display': 'inline-block', '--border-radius': '6px' }}></sc-skeleton>\n </sc-line-item>\n );\n }\n\n return (\n <Fragment>\n <sc-line-item>\n <span slot=\"description\">{this.label || __('Shipping', 'surecart')}</span>\n <span slot=\"price\">{checkout?.shipping_display_amount}</span>\n </sc-line-item>\n {this.renderShippingFees(checkout)}\n </Fragment>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, Prop, h, Fragment } from '@stencil/core';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { openWormhole } from 'stencil-wormhole';\nimport { Checkout } from '../../../../types';\n\n@Component({\n tag: 'sc-line-item-tax',\n styleUrl: 'sc-line-item-tax.scss',\n shadow: true,\n})\nexport class ScLineItemTax {\n @Prop() order: Checkout;\n @Prop() loading: boolean;\n\n renderLabel() {\n let label = sprintf(__('Estimated %s', 'surecart'), this?.order?.tax_label || '');\n\n if (this?.order?.tax_status === 'calculated') {\n label = this.order?.tax_label || '';\n }\n\n return <Fragment>{`${__('Tax', 'surecart')} ${label}`}</Fragment>;\n }\n\n render() {\n // hide if tax is 0\n if (!this?.order?.tax_amount) {\n return null;\n }\n\n return (\n <sc-line-item>\n <span slot=\"description\">{this.renderLabel()}</span>\n\n {this.order?.tax_exclusive_amount && <span slot=\"price\">{this.order?.tax_exclusive_display_amount}</span>}\n\n {this.order?.tax_inclusive_amount && (\n <span slot=\"price-description\">\n {'('}\n {this.order?.tax_inclusive_display_amount} {__('included', 'surecart')}\n {')'}\n </span>\n )}\n </sc-line-item>\n );\n }\n}\n\nopenWormhole(ScLineItemTax, ['order', 'loading'], false);\n",":host {\n display: block;\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\nimport { state as checkoutState } from '@store/checkout';\nimport { __ } from '@wordpress/i18n';\n\n@Component({\n tag: 'sc-line-item-trial',\n styleUrl: 'sc-line-item-trial.scss',\n shadow: true,\n})\nexport class ScLineItemTrial {\n /**\n * The label for the trial item\n */\n @Prop() label: string;\n\n render() {\n if (!checkoutState?.checkout?.trial_amount) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n\n return (\n <sc-line-item>\n <span slot=\"description\">{this.label || __('Trial', 'surecart')}</span>\n <span slot=\"price-description\">{checkoutState?.checkout?.trial_display_amount}</span>\n </sc-line-item>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.order-billing-address {\n &__toggle {\n margin-bottom: var(--sc-form-row-spacing, var(--sc-spacing-medium));\n }\n}\n","import { Component, Fragment, h, Method, Prop, State } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\nimport { Address, Checkout } from '../../../../types';\nimport { state as checkoutState, onChange } from '@store/checkout';\nimport { formLoading } from '@store/form/getters';\nimport { lockCheckout, unLockCheckout } from '@store/checkout/mutations';\nimport { createOrUpdateCheckout } from '@services/session';\nimport { ScCheckboxCustomEvent } from 'src/components';\nimport { isAddressEmpty } from '../../../../services/customer-address';\n\n@Component({\n tag: 'sc-order-billing-address',\n styleUrl: 'sc-order-billing-address.scss',\n shadow: true,\n})\nexport class ScOrderBillingAddress {\n /** The input */\n private input: HTMLScAddressElement | HTMLScCompactAddressElement;\n\n /** Label for the field */\n @Prop() label: string;\n\n /** Show the name field */\n @Prop({ reflect: true }) showName: boolean;\n\n /** Name placeholder */\n @Prop() namePlaceholder: string = __('Name or Company Name', 'surecart');\n\n /** Default country for address */\n @Prop() defaultCountry: string;\n\n /** Toggle label */\n @Prop() toggleLabel: string = __('Billing address is same as shipping', 'surecart');\n\n /** Address to pass to the component */\n @State() address: Partial<Address> = {\n country: null,\n city: null,\n line_1: null,\n line_2: null,\n postal_code: null,\n state: null,\n };\n\n @Method()\n async reportValidity() {\n if (!this.input) return true;\n return this.input?.reportValidity?.();\n }\n\n prefillAddress() {\n // Autofill is handled by sc-checkout-autofill-provider which patches checkoutState.checkout with any logged-in customer profile data.\n if (isAddressEmpty(this.address)) {\n this.address = { ...this.address, ...(checkoutState.checkout?.billing_address as Address) };\n }\n }\n\n componentWillLoad() {\n if (this.defaultCountry && !this.address?.country) {\n this.address.country = this.defaultCountry;\n }\n\n this.prefillAddress();\n onChange('checkout', () => this.prefillAddress());\n }\n\n async updateAddressState(address: Partial<Address>) {\n if (JSON.stringify(address) === JSON.stringify(this.address)) return; // no change, don't update.\n this.address = address;\n try {\n lockCheckout('billing-address');\n checkoutState.checkout = (await createOrUpdateCheckout({\n id: checkoutState?.checkout?.id,\n data: {\n billing_matches_shipping: checkoutState.checkout?.billing_matches_shipping,\n billing_address: this.address as Address,\n },\n })) as Checkout;\n } catch (e) {\n console.error(e);\n } finally {\n unLockCheckout('billing-address');\n }\n }\n\n async onToggleBillingMatchesShipping(e: ScCheckboxCustomEvent<void>) {\n checkoutState.checkout = {\n ...checkoutState.checkout,\n billing_matches_shipping: e.target.checked,\n };\n }\n\n shippingAddressFieldExists() {\n return !!document.querySelector('sc-order-shipping-address');\n }\n\n render() {\n return (\n <Fragment>\n {/* Only display this toggle if there is a shipping address. */}\n {this.shippingAddressFieldExists() && (\n <sc-checkbox class=\"order-billing-address__toggle\" onScChange={e => this.onToggleBillingMatchesShipping(e)} checked={checkoutState.checkout?.billing_matches_shipping}>\n {this.toggleLabel}\n </sc-checkbox>\n )}\n\n {/* If the shipping address field does not exist, always display this field. */}\n {(!this.shippingAddressFieldExists() || !checkoutState.checkout?.billing_matches_shipping) && (\n <sc-address\n exportparts=\"label, help-text, form-control, input__base, select__base, columns, search__base, menu__base\"\n ref={el => {\n this.input = el;\n }}\n label={this.label || __('Billing Address', 'surecart')}\n names={{\n name: 'billing_name',\n country: 'billing_country',\n city: 'billing_city',\n line_1: 'billing_line_1',\n line_2: 'billing_line_2',\n postal_code: 'billing_postal_code',\n state: 'billing_state',\n }}\n required={true}\n loading={formLoading()}\n address={this.address}\n show-name={this.showName}\n onScChangeAddress={e => this.updateAddressState(e.detail)}\n />\n )}\n </Fragment>\n );\n }\n}\n",":host {\n display: block;\n}\n\n// ============================================================\n// MODERN DESIGN\n// ============================================================\n\n// Override sc-choice internals: no padding, rounded corners,\n// neutral border always. Suppress checked/focus borders and pointer cursor.\n:host([data-design='modern']) sc-choice::part(base) {\n padding: 0;\n overflow: hidden;\n border-radius: var(--sc-order-bump-border-radius, 12px);\n // !important is needed to override sc-choice's checked/focus styles,\n // but it blocks consumer overrides via ::part(choice__base).\n border-color: var(--sc-order-bump-border-color, #e0e0e0) !important;\n box-shadow: none !important;\n outline: none !important;\n cursor: default;\n}\n\n:host([data-design='modern']) sc-choice::part(content) {\n cursor: default;\n}\n\n// Note: sc-choice parts are exported as choice__base and choice__content\n// to avoid naming conflicts with sc-order-bump's own parts.\n\n:host([data-design='modern']) {\n .bump {\n display: flex;\n align-items: center;\n gap: var(--sc-order-bump-gap, 1em);\n padding: var(--sc-order-bump-padding, 0.75em 1em 0.75em 0.75em);\n\n &__text {\n display: grid;\n gap: 5px;\n flex: 1;\n min-width: 0;\n }\n &__title {\n font-size: var(--sc-order-bump-title-size, 15px);\n font-weight: 600;\n line-height: 1.3;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n &__cta {\n font-size: var(--sc-order-bump-cta-size, 12px);\n font-weight: 600;\n line-height: 1.3;\n display: var(--sc-order-bump-cta-display, -webkit-box);\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n &__tag {\n display: var(--sc-order-bump-tag-display, inline-block);\n background: var(--sc-color-primary-500);\n color: var(--sc-color-white);\n border-radius: 999px;\n padding: var(--sc-spacing-x-small);\n font-size: var(--sc-font-size-x-small);\n }\n\n &__description {\n display: var(--sc-order-bump-description-display, block);\n font-size: var(--sc-order-bump-description-size, 13px);\n color: var(--sc-order-bump-description-color, #6b7280);\n opacity: 0.8;\n line-height: 1.3;\n font-weight: normal;\n p {\n margin: 0;\n }\n }\n\n &__image {\n width: var(--sc-order-bump-image-size, 72px);\n height: var(--sc-order-bump-image-size, 72px);\n flex: 0 0 var(--sc-order-bump-image-size, 72px);\n object-fit: cover;\n border-radius: var(--sc-order-bump-image-radius, 8px);\n border: 1px solid var(--sc-color-gray-200);\n display: var(--sc-order-bump-image-display, block);\n }\n\n &__price {\n &--has-discount {\n display: flex;\n align-items: baseline;\n gap: 4px;\n .bump__original-price {\n text-decoration: line-through;\n color: var(--sc-color-gray-500);\n font-size: var(--sc-order-bump-price-size, 14px);\n font-weight: normal;\n }\n }\n .bump__new-price {\n font-size: var(--sc-order-bump-price-size, 14px);\n font-weight: 500;\n color: var(--sc-color-gray-700);\n }\n .bump__interval {\n color: var(--sc-color-gray-500);\n }\n }\n\n &__button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--sc-order-bump-button-radius, 74.6%);\n border: 1px solid var(--sc-order-bump-button-border-color, #d1d5db);\n background-color: transparent;\n color: var(--sc-color-gray-500);\n flex-shrink: 0;\n line-height: 1;\n font-size: var(--sc-order-bump-button-size, 18px);\n padding: 0.5em;\n cursor: pointer;\n transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;\n\n sc-icon {\n font-size: 1em;\n }\n\n &--checked {\n background-color: var(--sc-color-primary-500);\n border-color: var(--sc-color-primary-500);\n color: var(--sc-color-white, #fff);\n }\n\n &--loading {\n border-color: var(--sc-color-primary-500);\n\n sc-spinner {\n --spinner-size: 1em;\n --indicator-color: var(--sc-color-gray-500);\n }\n }\n }\n\n &__amount {\n display: var(--sc-order-bump-amount-display, flex);\n align-items: center;\n gap: 4px;\n flex-wrap: wrap;\n }\n }\n}\n\n// ============================================================\n// CLASSIC DESIGN\n// ============================================================\n\n:host([data-design='classic']) {\n .bump {\n display: grid;\n gap: 1em;\n\n &__text {\n display: grid;\n gap: 0.25em;\n }\n &__tag {\n background: var(--sc-color-primary-500);\n color: var(--sc-color-white);\n border-radius: var(--sc-input-border-radius-medium);\n padding: var(--sc-spacing-x-small);\n font-size: var(--sc-font-size-x-small);\n }\n\n &__product {\n display: flex;\n align-items: center;\n gap: var(--sc-choice-padding, 1.3em 1.1em);\n line-height: var(--sc-line-height-dense);\n &--wrapper {\n container-type: inline-size;\n }\n @container (max-width: 325px) {\n flex-direction: column;\n align-items: start;\n }\n }\n\n &__title {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n\n &__product-title {\n font-weight: var(--sc-font-weight-semibold);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n\n &__product-description {\n color: var(--sc-input-label-color);\n }\n\n &__image {\n width: var(--sc-product-line-item-image-size, 4em);\n height: var(--sc-product-line-item-image-size, 4em);\n flex: 0 0 var(--sc-product-line-item-image-size, 4em);\n object-fit: cover;\n border-radius: 4px;\n border: 1px solid var(--sc-color-gray-200);\n display: block;\n box-shadow: var(--sc-input-box-shadow);\n }\n\n &__price {\n &--has-discount {\n display: flex;\n align-items: baseline;\n gap: var(--sc-spacing-x-small);\n .bump__original-price {\n text-decoration: line-through;\n color: var(--sc-color-gray-500);\n font-size: var(--sc-font-size-small);\n }\n }\n .bump__new-price {\n font-size: var(--sc-font-size-large);\n color: var(--sc-color-gray-700);\n }\n .bump__interval {\n color: var(--sc-color-gray-500);\n }\n }\n\n &__amount {\n display: flex;\n align-items: center;\n gap: var(--sc-spacing-x-small);\n flex-wrap: wrap;\n margin-top: var(--sc-spacing-xx-small);\n }\n }\n}\n","import { Component, Element, h, Prop, State } from '@stencil/core';\nimport { sprintf, __, _x } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { intervalString } from '../../../../functions/price';\nimport { state as checkoutState } from '@store/checkout';\n\nimport { Bump, Price, Product } from '../../../../types';\nimport { addCheckoutLineItem, removeCheckoutLineItem, trackOrderBump } from '@store/checkout/mutations';\n\n@Component({\n tag: 'sc-order-bump',\n styleUrl: 'sc-order-bump.scss',\n shadow: true,\n})\nexport class ScOrderBump {\n @Element() el: HTMLElement;\n\n /** The bump */\n @Prop() bump: Bump;\n\n /** Should we show the controls (classic design) */\n @Prop({ reflect: true }) showControl: boolean;\n\n /** Loading state */\n @State() loading: boolean = false;\n\n /** Cached design mode */\n private isModern: boolean = true;\n\n /** The bump line item */\n lineItem() {\n return checkoutState?.checkout?.line_items?.data?.find(item => item?.bump === this.bump?.id);\n }\n\n /** Update the line item. */\n async updateLineItem() {\n if (this.loading) return;\n\n const price = (this.bump.price as Price)?.id || (this.bump?.price as string);\n const lineItem = this.lineItem();\n\n this.loading = true;\n try {\n if (lineItem) {\n await removeCheckoutLineItem(lineItem.id);\n speak(__('Order bump Removed.', 'surecart'));\n } else {\n await addCheckoutLineItem({\n bump: this.bump?.id,\n price,\n quantity: 1,\n });\n speak(__('Order bump applied.', 'surecart'));\n }\n } catch (e) {\n console.error('[sc-order-bump] updateLineItem failed:', e);\n speak(__('Something went wrong. Please try again.', 'surecart'));\n } finally {\n this.loading = false;\n }\n }\n\n componentWillLoad() {\n this.isModern = !!(window as any).scData?.modern_order_bump;\n this.el.setAttribute('data-design', this.isModern ? 'modern' : 'classic');\n }\n\n componentDidLoad() {\n trackOrderBump(this.bump?.id);\n }\n\n renderInterval() {\n const interval = intervalString(this.bump?.price as Price, { labels: { interval: '/', period: __('for', 'surecart') } });\n if (!interval.trim().length) return null;\n return <span class=\"bump__interval\">{interval}</span>;\n }\n\n renderDiscount() {\n if (!!this.bump?.amount_off) {\n return (\n <div\n class=\"bump__tag\"\n part=\"tag\"\n aria-label={\n /** translators: %1$s: amount off, %2$s: currency */\n sprintf(__('You save %1$s%2$s.', 'surecart'), this.bump?.amount_off, (this.bump?.price as Price).currency)\n }\n >\n <span aria-hidden=\"true\">\n {_x('Save', 'Save money', 'surecart')} {this.bump?.amount_off_display_amount}\n </span>\n </div>\n );\n }\n\n if (!!this.bump?.percent_off) {\n const percent = `${this.bump.percent_off}%`;\n return (\n <div\n class=\"bump__tag\"\n part=\"tag\"\n aria-label={\n /** translators: %s is the discount percentage (e.g. \"10%\"). */\n sprintf(__('You save %s.', 'surecart'), percent)\n }\n >\n <span aria-hidden=\"true\">\n {sprintf(\n /** translators: %s is the discount percentage (e.g. \"10%\"). */\n _x('Save %s', 'Save money', 'surecart'),\n percent,\n )}\n </span>\n </div>\n );\n }\n }\n\n /** Modern price (no slot) */\n renderModernPrice() {\n return (\n <div class={{ 'bump__price': true, 'bump__price--has-discount': !!this.bump?.percent_off || !!this.bump?.amount_off }} part=\"price\">\n {!!(this.bump?.percent_off || this.bump?.amount_off) && (\n <span\n aria-label={\n /** translators: %s: old price */\n sprintf(__('Originally priced at %s.', 'surecart'), this.bump?.subtotal_display_amount)\n }\n class=\"bump__original-price\"\n >\n {this.bump?.subtotal_display_amount}\n </span>\n )}\n\n <span>\n <span aria-hidden=\"true\">\n {this.bump?.total_amount === 0 && __('Free', 'surecart')}\n {this.bump?.total_amount > 0 && <span class=\"bump__new-price\">{this.bump?.total_display_amount}</span>}\n {this.renderInterval()}\n </span>\n </span>\n </div>\n );\n }\n\n /** Classic price (with slot=\"description\") */\n renderClassicPrice() {\n return (\n <div slot=\"description\" class={{ 'bump__price': true, 'bump__price--has-discount': !!this.bump?.percent_off || !!this.bump?.amount_off }} part=\"price\">\n {!!(this.bump?.percent_off || this.bump?.amount_off) && (\n <span\n aria-label={\n /** translators: %s: old price */\n sprintf(__('Originally priced at %s.', 'surecart'), this.bump?.subtotal_display_amount)\n }\n class=\"bump__original-price\"\n >\n {this.bump?.subtotal_display_amount}\n </span>\n )}\n\n <span>\n <span aria-hidden=\"true\">\n {this.bump?.total_amount === 0 && __('Free', 'surecart')}\n {this.bump?.total_amount > 0 && <span class=\"bump__new-price\">{this.bump?.total_display_amount}</span>}\n {this.renderInterval()}\n </span>\n </span>\n </div>\n );\n }\n\n /** Modern design: rounded button, inline image, no checkbox */\n renderModern() {\n const product = (this.bump?.price as Price)?.product as Product;\n const lineItem = this.lineItem();\n return (\n <sc-choice value={this.bump?.id} type=\"checkbox\" showControl={false} checked={!!lineItem} exportparts=\"base:choice__base, content:choice__content\">\n <div\n part=\"base-content\"\n class=\"bump\"\n onClick={e => e.stopPropagation()}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') e.stopPropagation();\n }}\n >\n {!!product?.line_item_image?.src && <img {...(product?.line_item_image as any)} class=\"bump__image\" part=\"image\" />}\n <div class=\"bump__text\" part=\"text\">\n <div\n class=\"bump__title\"\n part=\"title\"\n aria-label={sprintf(\n /* translators: %s: order bump name */\n __('Product: %s.', 'surecart'),\n this.bump?.name || product?.name,\n )}\n >\n <span aria-hidden=\"true\">{this.bump?.name || product?.name}</span>\n </div>\n {!!this.bump?.metadata?.cta && (\n <div class=\"bump__cta\" part=\"cta\">\n <span>{this.bump?.metadata?.cta}</span>\n </div>\n )}\n <div class=\"bump__amount\" part=\"amount\">\n {this.renderModernPrice()}\n {this.renderDiscount()}\n </div>\n {!!this.bump?.metadata?.description && (\n <div\n class=\"bump__description\"\n part=\"description\"\n aria-label={sprintf(\n /* translators: %s: Product description */\n __('Product description: %s.', 'surecart'),\n this.bump?.rendered_description,\n )}\n >\n <span aria-hidden=\"true\" innerHTML={this.bump?.rendered_description}></span>\n </div>\n )}\n </div>\n <button\n type=\"button\"\n class={{\n 'bump__button': true,\n 'bump__button--checked': !!lineItem,\n 'bump__button--loading': this.loading,\n }}\n part=\"button\"\n onClick={() => this.updateLineItem()}\n aria-label={lineItem ? __('Remove from order', 'surecart') : __('Add to order', 'surecart')}\n aria-pressed={!!lineItem}\n aria-busy={this.loading}\n >\n {this.loading ? <sc-spinner /> : <sc-icon name={lineItem ? 'check' : 'plus'} />}\n </button>\n </div>\n </sc-choice>\n );\n }\n\n /** Classic design: checkbox control, footer with divider + image + description */\n renderClassic() {\n const product = (this.bump?.price as Price)?.product as Product;\n return (\n <sc-choice\n value={this.bump?.id}\n type=\"checkbox\"\n showControl={this.showControl}\n checked={!!this.lineItem()}\n disabled={this.loading}\n onClick={e => {\n e.preventDefault();\n e.stopImmediatePropagation();\n this.updateLineItem();\n }}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopImmediatePropagation();\n this.updateLineItem();\n }\n }}\n exportparts=\"base, control, checked-icon, title\"\n >\n <div part=\"base-content\" class=\"bump\">\n <div class=\"bump__text\">\n <div\n class=\"bump__title\"\n aria-label={sprintf(\n /* translators: %s: order bump name */\n __('Product: %s.', 'surecart'),\n this.bump?.metadata?.cta || this.bump?.name || product?.name,\n )}\n >\n <span aria-hidden=\"true\">{this.bump?.metadata?.cta || this.bump?.name || product?.name}</span>\n </div>\n <div class=\"bump__amount\">\n {this.renderClassicPrice()}\n {this.renderDiscount()}\n </div>\n </div>\n </div>\n\n {this.bump?.metadata?.description && (\n <div slot=\"footer\" class=\"bump__product--wrapper\">\n <sc-divider style={{ '--spacing': 'var(--sc-spacing-medium)' }}></sc-divider>\n <div class=\"bump__product\">\n {!!product?.line_item_image?.src && <img {...(product?.line_item_image as any)} class=\"bump__image\" />}\n <div class=\"bump__product-text\">\n {!!this.bump?.metadata?.cta && (\n <div class=\"bump__product-title\" aria-hidden=\"true\">\n {this.bump.name || product?.name}\n </div>\n )}\n\n {!!this.bump?.metadata?.description && (\n <div\n class=\"bump__product-description\"\n aria-label={sprintf(\n /* translators: %s: Product description */\n __('Product description: %s.', 'surecart'),\n this.bump?.rendered_description,\n )}\n >\n <span aria-hidden=\"true\" innerHTML={this.bump?.rendered_description}></span>\n </div>\n )}\n </div>\n </div>\n </div>\n )}\n </sc-choice>\n );\n }\n\n render() {\n return this.isModern ? this.renderModern() : this.renderClassic();\n }\n}\n",":host {\n display: block;\n}\n\n.bumps__list {\n display: grid;\n gap: 10px;\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\nimport { state as checkoutState } from '@store/checkout';\nimport { Price, Product } from '../../../../types';\n\n@Component({\n tag: 'sc-order-bumps',\n styleUrl: 'sc-order-bumps.scss',\n shadow: true,\n})\nexport class ScOrderBumps {\n @Prop() label: string;\n @Prop() help: string;\n\n /** Should we show the controls (classic design) */\n @Prop() showControl: boolean;\n\n /** Hide bumps that have already been added to the checkout. */\n @Prop() hideAddedItems: boolean;\n\n /** Check if a bump is already added as a line item. */\n isBumpAdded(bumpId: string) {\n return (checkoutState?.checkout?.line_items?.data || []).some(item => item?.bump === bumpId);\n }\n\n render() {\n const bumps = (checkoutState?.checkout?.recommended_bumps?.data || []).filter(bump => {\n // exclude variants for now.\n if (((bump?.price as Price)?.product as Product)?.variants?.pagination?.count !== 0) {\n return false;\n }\n // optionally exclude bumps already added to the checkout.\n if (this.hideAddedItems && this.isBumpAdded(bump?.id)) {\n return false;\n }\n return true;\n });\n\n if (!bumps?.length) {\n return null;\n }\n\n return (\n <sc-form-control label={this.label || __('Recommended', 'surecart')} help={this.help}>\n <div class=\"bumps__list\" aria-label={__('Order bump summary', 'surecart')}>\n {bumps.map(bump => (\n <sc-order-bump key={bump?.id} bump={bump} showControl={this.showControl} exportparts=\"choice__base, choice__content, base-content, image, text, title, cta, amount, price, tag, description, button, base, control, checked-icon\" />\n ))}\n </div>\n </sc-form-control>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.sc-order-shipping {\n &__loading {\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n }\n}\n","import { Component, h, Method, Prop, State } from '@stencil/core';\nimport { state as checkoutState, onChange } from '@store/checkout';\nimport { lockCheckout, unLockCheckout } from '@store/checkout/mutations';\nimport { __ } from '@wordpress/i18n';\nimport { createOrUpdateCheckout } from '../../../../services/session';\n\nimport { Address, Checkout } from '../../../../types';\nimport { fullShippingAddressRequired, shippingAddressRequired } from '@store/checkout/getters';\nimport { formLoading } from '@store/form/getters';\nimport { isAddressEmpty } from '../../../../services/customer-address';\n\n@Component({\n tag: 'sc-order-shipping-address',\n styleUrl: 'sc-order-shipping-address.scss',\n shadow: true,\n})\nexport class ScOrderShippingAddress {\n private input: HTMLScAddressElement | HTMLScCompactAddressElement;\n\n /** Label for the field. */\n @Prop() label: string;\n\n /** Is this required (defaults to false) */\n @Prop({ mutable: true, reflect: true }) required: boolean = false;\n\n /** Show the address */\n @Prop({ mutable: true }) full: boolean;\n\n /** Show the name field. */\n @Prop({ reflect: true }) showName: boolean;\n\n /** Default country for address */\n @Prop() defaultCountry: string;\n\n /** Show the line 2 field. */\n @Prop({ reflect: true }) showLine2: boolean;\n\n /** Whether to require the name in the address */\n @Prop({ reflect: true }) requireName: boolean = false;\n\n /** Address to pass to the component */\n @State() address: Partial<Address> = {\n country: null,\n city: null,\n line_1: null,\n line_2: null,\n postal_code: null,\n state: null,\n };\n\n /** Names for the address */\n names = {\n name: 'shipping_name',\n country: 'shipping_country',\n city: 'shipping_city',\n line_1: 'shipping_line_1',\n line_2: 'shipping_line_2',\n postal_code: 'shipping_postal_code',\n state: 'shipping_state',\n };\n\n async updateAddressState(address: Partial<Address>) {\n if (JSON.stringify(address) === JSON.stringify(this.address)) return; // no change, don't update.\n this.address = address;\n try {\n lockCheckout('shipping-address');\n checkoutState.checkout = (await createOrUpdateCheckout({\n id: checkoutState.checkout?.id,\n data: {\n shipping_address: this.address as Address,\n },\n })) as Checkout;\n } catch (e) {\n console.error(e);\n } finally {\n unLockCheckout('shipping-address');\n }\n }\n\n @Method()\n async reportValidity() {\n if (!this.input) return true;\n return this.input?.reportValidity?.();\n }\n\n prefillAddress() {\n // Autofill is handled by sc-checkout-autofill-provider which patches checkoutState.checkout with any logged-in customer profile data.\n if (isAddressEmpty(this.address)) {\n this.address = { ...this.address, ...(checkoutState.checkout?.shipping_address as Address) };\n }\n }\n\n componentWillLoad() {\n if (this.defaultCountry && !this.address?.country) {\n this.address.country = this.defaultCountry;\n }\n\n this.prefillAddress();\n onChange('checkout', () => this.prefillAddress());\n }\n\n render() {\n // use full if checkout requires it, it's set, or we're showing/requiring name field.\n if (fullShippingAddressRequired() || this.full || this.requireName || this.showName) {\n return (\n <sc-address\n exportparts=\"label, help-text, form-control, input__base, select__base, columns, search__base, menu__base\"\n ref={el => (this.input = el as any)}\n label={this.label || __('Shipping Address', 'surecart')}\n names={this.names}\n required={this.required || shippingAddressRequired()}\n loading={formLoading()}\n address={this.address}\n show-name={this.showName}\n require-name={this.requireName}\n show-line-2={this.showLine2}\n onScChangeAddress={e => this.updateAddressState(e.detail)}\n ></sc-address>\n );\n }\n return (\n <sc-compact-address\n ref={el => (this.input = el as any)}\n required={this.required || shippingAddressRequired()}\n loading={formLoading()}\n address={this.address}\n names={this.names}\n label={this.label}\n onScChangeAddress={e => this.updateAddressState(e.detail)}\n ></sc-compact-address>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { state as checkoutState } from '@store/checkout';\nimport { __ } from '@wordpress/i18n';\nimport { createOrUpdateCheckout } from '../../../../services/session';\n\nimport { Address, Checkout, TaxIdentifier } from '../../../../types';\nimport { formBusy } from '@store/form/getters';\nimport { createErrorNotice } from '@store/notices/mutations';\nimport { updateFormState } from '@store/form/mutations';\n\n@Component({\n tag: 'sc-order-tax-id-input',\n styleUrl: 'sc-order-tax-id-input.css',\n shadow: true,\n})\nexport class ScOrderTaxIdInput {\n /** The tax id input */\n private input: HTMLScTaxIdInputElement;\n\n /** Force show the field. */\n @Prop() show: boolean = false;\n\n /** Other zones label */\n @Prop() otherLabel: string;\n\n /** GST zone label */\n @Prop() caGstLabel: string;\n\n /** AU zone label */\n @Prop() auAbnLabel: string;\n\n /** UK zone label */\n @Prop() gbVatLabel: string;\n\n /** EU zone label */\n @Prop() euVatLabel: string;\n\n /** Help text */\n @Prop() helpText: string;\n\n /** Tax ID Types which will be shown Eg: '[\"eu_vat\", \"gb_vat\"]' */\n @Prop() taxIdTypes: string | string[];\n\n /** Whether tax input is required */\n @Prop() required: boolean = false;\n\n /** Tax ID Types data as array */\n @State() taxIdTypesData: string[] = [];\n\n @Watch('taxIdTypes')\n handleTaxIdTypesChange() {\n this.taxIdTypesData = typeof this.taxIdTypes === 'string' ? JSON.parse(this.taxIdTypes) : this.taxIdTypes;\n }\n\n @Method()\n async reportValidity() {\n return this.input.reportValidity();\n }\n\n getStatus() {\n if (checkoutState.checkout?.tax_identifier?.number_type !== 'eu_vat') {\n return 'unknown';\n }\n if (checkoutState.taxProtocol?.eu_vat_unverified_behavior === 'apply_reverse_charge') {\n return 'unknown';\n }\n return (checkoutState.checkout?.tax_identifier as TaxIdentifier)?.eu_vat_verified ? 'valid' : 'invalid';\n }\n\n async updateOrder(tax_identifier: { number: string; number_type: string }) {\n try {\n updateFormState('FETCH');\n checkoutState.checkout = (await createOrUpdateCheckout({\n id: checkoutState.checkout.id,\n data: { tax_identifier },\n })) as Checkout;\n updateFormState('RESOLVE');\n } catch (e) {\n console.error(e);\n createErrorNotice(e);\n updateFormState('REJECT');\n }\n }\n\n componentWillLoad() {\n this.handleTaxIdTypesChange();\n }\n\n isRequired() {\n // If the block has explicitly set required, use that value.\n if (this.required) {\n return true;\n }\n\n // Only apply EU VAT requirement if eu_vat is one of the allowed tax types.\n // If taxIdTypesData is empty, all types are allowed.\n const isEuVatAllowed = !this.taxIdTypesData?.length || this.taxIdTypesData.includes('eu_vat');\n\n // Fall back to EU VAT protocol requirement only if EU VAT is an allowed type.\n return isEuVatAllowed && checkoutState.taxProtocol?.eu_vat_required && checkoutState.checkout?.tax_identifier?.number_type === 'eu_vat';\n }\n\n render() {\n return (\n <sc-tax-id-input\n ref={el => (this.input = el as HTMLScTaxIdInputElement)}\n show={this.show}\n number={checkoutState.checkout?.tax_identifier?.number}\n type={checkoutState.checkout?.tax_identifier?.number_type || this.taxIdTypesData?.[0] || 'eu_vat'}\n country={(checkoutState.checkout?.shipping_address as Address)?.country}\n status={this.getStatus()}\n loading={formBusy()}\n onScChange={e => {\n e.stopImmediatePropagation();\n this.updateOrder(e.detail);\n }}\n otherLabel={this.otherLabel}\n caGstLabel={this.caGstLabel}\n auAbnLabel={this.auAbnLabel}\n gbVatLabel={this.gbVatLabel}\n euVatLabel={this.euVatLabel}\n help={this.helpText}\n taxIdTypes={this.taxIdTypesData}\n required={this.isRequired()}\n ></sc-tax-id-input>\n );\n }\n}\n",":host {\n display: inline-block;\n}\n\n::slotted([slot='description']) {\n display: block;\n color: var(--sc-radio-description-color, var(--sc-input-help-text-color, var(--sc-color-gray-500)));\n line-height: var(--sc-line-height-dense);\n margin: 0.5em 0 0;\n font-size: var(--sc-font-size-small);\n}\n\n.radio {\n display: inline-flex;\n align-items: flex-start;\n font-family: var(--sc-input-font-family);\n font-size: var(--sc-input-font-size-medium);\n font-weight: var(--sc-input-font-weight);\n color: var(--sc-input-color);\n vertical-align: middle;\n gap: var(--sc-spacing-xx-small);\n}\n\n.radio:not(.radio--editing) {\n cursor: pointer;\n}\n\n.radio__icon {\n display: inline-flex;\n width: var(--sc-radio-size);\n height: var(--sc-radio-size);\n\n svg {\n width: 100%;\n height: 100%;\n }\n}\n\n.radio__control {\n flex: 0 0 auto;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--sc-radio-size);\n height: var(--sc-radio-size);\n border: solid var(--sc-input-border-width) var(--sc-input-border-color);\n border-radius: 50%;\n background-color: var(--sc-input-background-color);\n color: transparent;\n transition: var(--sc-input-transition, var(--sc-transition-medium)) border-color, var(--sc-input-transition, var(--sc-transition-medium)) opacity,\n var(--sc-input-transition, var(--sc-transition-medium)) background-color, var(--sc-input-transition, var(--sc-transition-medium)) color,\n var(--sc-input-transition, var(--sc-transition-medium)) box-shadow;\n\n input[type='radio'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover {\n border-color: var(--sc-input-border-color-hover);\n background-color: var(--sc-input-background-color-hover);\n}\n\n// Focus\n.radio.radio--focused:not(.radio--checked):not(.radio--disabled) .radio__control {\n border-color: var(--sc-input-border-color-focus);\n background-color: var(--sc-input-background-color-focus);\n box-shadow: 0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary);\n}\n\n// Checked\n.radio--checked .radio__control {\n color: var(--var-sc-checked-radio-background-color, var(--sc-input-background-color));\n border-color: var(--sc-color-primary-500);\n background-color: var(--sc-color-primary-500);\n}\n\n// Checked + hover\n.radio.radio--checked:not(.radio--disabled) .radio__control:hover {\n opacity: 0.8;\n}\n\n// Checked + focus\n.radio.radio--checked:not(.radio--disabled).radio--focused .radio__control {\n border-color: var(--var-sc-checked-radio-border-color, var(--sc-input-background-color));\n background-color: var(--sc-color-primary-500);\n box-shadow: 0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary);\n}\n\n// Disabled\n.radio--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n// When the control isn't checked, hide the circle for Windows High Contrast mode a11y\n.radio:not(.radio--checked) svg circle {\n opacity: 0;\n}\n\n.radio__label {\n line-height: var(--sc-radio-size);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Element, Watch } from '@stencil/core';\nimport { FormSubmitController } from '../../../functions/form-data';\n\nlet id = 0;\n\n/**\n * @part base - The elements base wrapper.\n * @part control - The control wrapper.\n * @part checked-icon - Checked icon.\n * @part label - The label.\n */\n@Component({\n tag: 'sc-radio',\n styleUrl: 'sc-radio.scss',\n shadow: true,\n})\nexport class ScRadio {\n @Element() el: HTMLScRadioElement;\n private input: HTMLInputElement;\n private formController: any;\n private inputId: string = `radio-${++id}`;\n private labelId: string = `radio-label-${id}`;\n\n /** Does the radio have focus */\n @State() hasFocus: boolean = false;\n\n /** The radios name attribute */\n @Prop() name: string;\n\n /** The radios value */\n @Prop() value: string;\n\n /** Is the radio disabled */\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n\n /** Draws the radio in a checked state. */\n @Prop({ reflect: true, mutable: true }) checked: boolean = false;\n\n /** Is this required */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */\n @Prop({ reflect: true, mutable: true }) invalid: boolean = false;\n\n /** This will be true as a workaround in the block editor to focus on the content. */\n @Prop() edit: boolean;\n\n /** Emitted when the control loses focus. */\n @Event() scBlur: EventEmitter<void>;\n\n /** Emitted when the control's checked state changes. */\n @Event() scChange: EventEmitter<void>;\n\n /** Emitted when the control gains focus. */\n @Event() scFocus: EventEmitter<void>;\n\n /** Simulates a click on the radio. */\n @Method()\n async ceClick() {\n this.input.click();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n @Method()\n async reportValidity() {\n this.invalid = !this.input.checkValidity();\n return this.input.reportValidity();\n }\n\n @Watch('checked')\n handleCheckedChange() {\n if (!this.input) return;\n if (this.checked) {\n this.getSiblingRadios().map(radio => (radio.checked = false));\n }\n this.input.checked = this.checked;\n this.scChange.emit();\n }\n\n handleClick() {\n this.checked = true;\n }\n\n handleBlur() {\n this.hasFocus = false;\n this.scBlur.emit();\n }\n\n handleFocus() {\n this.hasFocus = true;\n this.scFocus.emit();\n }\n\n /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */\n setCustomValidity(message: string) {\n this.input.setCustomValidity(message);\n this.invalid = !this.input.checkValidity();\n }\n\n getAllRadios() {\n const radioGroup = this.el.closest('sc-radio-group');\n // Radios must be part of a radio group\n if (!radioGroup) {\n return [];\n }\n return [...radioGroup.querySelectorAll('sc-radio')] as HTMLScRadioElement[];\n }\n\n getSiblingRadios() {\n return this.getAllRadios().filter(radio => radio !== this.el) as HTMLScRadioElement[];\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (this.edit) return true;\n\n if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const incr = ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n let index = radios.indexOf(this.el) + incr;\n if (index < 0) index = radios.length - 1;\n if (index > radios.length - 1) index = 0;\n\n this.getAllRadios().map(radio => (radio.checked = false));\n radios[index].focus();\n radios[index].checked = true;\n\n event.preventDefault();\n }\n }\n\n // Prevent clicks on the label from briefly blurring the input\n handleMouseDown(event: MouseEvent) {\n if (this.edit) return true;\n event.preventDefault();\n this.input.focus();\n }\n\n componentDidLoad() {\n this.formController = new FormSubmitController(this.el, {\n value: (control: HTMLScChoiceElement) => (control.checked ? control.value : undefined),\n }).addFormData();\n }\n\n disconnectedCallback() {\n this.formController?.removeFormData();\n }\n\n render() {\n const Tag = this.edit ? 'div' : 'label';\n return (\n <Tag\n part=\"base\"\n class={{\n 'radio': true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n 'radio--focused': this.hasFocus,\n 'radio--editing': this.edit,\n }}\n htmlFor={this.inputId}\n onKeyDown={e => this.handleKeyDown(e)}\n onMouseDown={e => this.handleMouseDown(e)}\n >\n <span part=\"control\" class=\"radio__control\">\n <span part=\"checked-icon\" class=\"radio__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"3.42857143\"></circle>\n </g>\n </g>\n </svg>\n </span>\n <input\n id={this.inputId}\n ref={el => (this.input = el as HTMLInputElement)}\n type=\"radio\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={() => this.handleClick()}\n onBlur={() => this.handleBlur()}\n onFocus={() => this.handleFocus()}\n />\n </span>\n <span part=\"label\" id={this.labelId} class=\"radio__label\">\n <slot />\n <slot name=\"description\"></slot>\n </span>\n </Tag>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.radio-group {\n border: none;\n padding: 0;\n margin: 0;\n min-width: 0;\n\n .radio-group__label {\n display: inline-block;\n padding: 0;\n color: var(--sc-input-label-color);\n font-weight: var(--sc-input-label-font-weight);\n text-transform: var(--sc-input-label-text-transform, none);\n letter-spacing: var(--sc-input-label-letter-spacing, 0);\n margin-bottom: var(--sc-input-label-margin);\n }\n\n &__hidden-input {\n position: absolute;\n opacity: 0;\n padding: 0px;\n margin: 0px;\n pointer-events: none;\n }\n\n &--is-required .radio-group__label:after {\n content: ' *';\n color: var(--sc-color-danger-500);\n }\n}\n\n::slotted(sc-radio:not(:last-of-type)) {\n display: block;\n margin-bottom: var(--sc-spacing-x-small);\n}\n\n// .radio-group:not(.radio-group--has-fieldset) {\n// border: none;\n// padding: 0;\n// margin: 0;\n// min-width: 0;\n// }\n// .radio-group:not(.radio-group--has-fieldset) .radio-group__label {\n// position: absolute;\n// width: 0;\n// height: 0;\n// clip: rect(0 0 0 0);\n// clip-path: inset(50%);\n// overflow: hidden;\n// white-space: nowrap;\n// }\n\n.radio-group--is-rtl {\n &.radio-group {\n &,\n .radio-group__label {\n text-align: right;\n }\n }\n}\n","import { Component, Prop, h, Method, Listen, Event, EventEmitter, Element } from '@stencil/core';\nimport { isRtl } from '../../../functions/page-align';\n\n@Component({\n tag: 'sc-radio-group',\n styleUrl: 'sc-radio-group.scss',\n shadow: true,\n})\nexport class ScRadioGroup {\n /** The radio group element */\n @Element() el: HTMLScRadioGroupElement;\n\n /** The input for validation */\n private input: HTMLInputElement;\n\n /** The radio group label. Required for proper accessibility. */\n @Prop() label = '';\n\n /**\n * This will be true when the control is in an invalid state. Validity is determined by props such as `type`,\n * `required`, `minlength`, `maxlength`, and `pattern` using the browser's constraint validation API.\n */\n @Prop({ reflect: true, mutable: true }) invalid: boolean;\n\n /** The selected value of the control. */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /** Is one of these items required. */\n @Prop() required: boolean;\n\n @Event() scChange: EventEmitter<string>;\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n @Method()\n async reportValidity() {\n this.invalid = !this.input.checkValidity();\n return this.input.reportValidity();\n }\n\n @Listen('scChange')\n handleRadioClick(event) {\n if (event.target.tagName !== 'SC-RADIO') return;\n event.stopImmediatePropagation();\n const target = event.target as HTMLScRadioElement;\n if (target.disabled) {\n return;\n }\n if (target.checked) {\n this.value = target.value;\n this.scChange.emit(target.value);\n }\n }\n\n componentDidLoad() {\n const choices = [...this.el.querySelectorAll('sc-radio')] as Array<HTMLScRadioElement>;\n choices.forEach(choice => {\n if (choice.checked) {\n this.value = choice.value;\n }\n });\n }\n\n render() {\n return (\n <fieldset\n part=\"base\"\n class={{\n 'radio-group': true,\n 'radio-group--invalid': this.invalid,\n 'radio-group--is-required': this.required,\n 'radio-group--is-rtl': isRtl(),\n }}\n aria-invalid={this.invalid}\n role=\"radiogroup\"\n >\n <legend part=\"label\" class=\"radio-group__label\">\n <slot name=\"label\">{this.label}</slot>\n </legend>\n\n <input type=\"text\" class=\"radio-group__hidden-input\" ref={el => (this.input = el as HTMLInputElement)} required={this.required} value={this.value} tabindex=\"-1\" />\n <div part=\"items\" class=\"radio-group__items\">\n <slot></slot>\n </div>\n </fieldset>\n );\n }\n}\n",":host {\n display: block;\n}\n\n.shipping-choice {\n width: 100%;\n padding: var(--sc-spacing-medium);\n margin: 0;\n box-sizing: border-box;\n border-bottom: var(--sc-input-border, 1px solid var(--sc-color-gray-300));\n background-color: var(--sc-shipping-choice-background-color, var(--sc-input-background-color));\n\n &__empty {\n background: var(--sc-alert-background-color, var(--sc-color-gray-100));\n opacity: 0.75;\n padding: var(--sc-spacing-large);\n border-radius: var(--sc-input-border-radius-medium);\n line-height: var(--sc-line-height-dense);\n font-size: var(--sc-font-size-small);\n border: solid 1px var(--sc-input-border-color, var(--sc-input-border));\n }\n\n &:last-child {\n border-bottom-width: 0;\n }\n\n &__text {\n display: flex;\n flex-direction: column;\n gap: var(--sc-spacing-xx-small);\n }\n\n &__price {\n color: var(--sc-input-label-color);\n font-weight: var(--sc-price-choice-price-font-weight, var(--sc-font-weight-normal));\n white-space: nowrap;\n display: var(--sc-shipping-choice-price-display, inherit);\n }\n\n &__name {\n display: inline-block;\n color: var(--sc-price-choice-name-color, var(--sc-input-label-color));\n font-size: var(--sc-price-choice-name-size, var(--sc-input-label-font-size-medium));\n font-weight: var(--sc-price-choice-name-font-weight, var(--sc-font-weight-bold));\n text-transform: var(--sc-price-choice-text-transform, var(--sc-input-label-text-transform, none));\n line-height: var(--sc-shipping-name-line-height, 1);\n }\n\n &__description {\n color: var(--sc-input-label-color);\n font-weight: var(--sc-price-choice-price-font-weight, var(--sc-font-weight-normal));\n line-height: var(--sc-shipping-description-line-height, 1.2);\n }\n}\n\nsc-radio-group::part(items) {\n border: var(--sc-input-border, 1px solid var(--sc-color-gray-300));\n border-radius: var(--sc-shipping-choice-border-radius, var(--sc-input-border-radius-medium));\n box-shadow: var(--sc-shipping-box-shadow, var(--sc-input-box-shadow));\n overflow: hidden;\n position: relative;\n}\n\nsc-radio::part(base) {\n width: 100%;\n}\n\nsc-radio::part(label) {\n width: 100%;\n display: flex;\n justify-content: space-between;\n gap: var(--sc-spacing-small);\n}\n\nsc-radio-group::slotted(sc-radio:not(:last-of-type)) {\n margin-bottom: 0;\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { state as checkoutState } from '@store/checkout';\nimport { Address, Checkout, ShippingMethod } from '../../../types';\nimport { lockCheckout, unLockCheckout } from '@store/checkout/mutations';\nimport { createOrUpdateCheckout } from '@services/session';\nimport { checkoutIsLocked } from '@store/checkout/getters';\nimport { createErrorNotice } from '@store/notices/mutations';\nimport { speak } from '@wordpress/a11y';\nimport { getFormattedPrice } from '../../../functions/price';\n\n/**\n * @part base - The elements base wrapper.\n * @part empty - The empty message.\n * @part block-ui - The block ui loader.\n * @part radio__base - The radio base wrapper.\n * @part radio__label - The radio label.\n * @part radio__control - The radio control wrapper.\n * @part radio__checked-icon - The radio checked icon.\n */\n@Component({\n tag: 'sc-shipping-choices',\n styleUrl: 'sc-shipping-choices.scss',\n shadow: true,\n})\nexport class ScShippingChoices {\n /** The shipping section label */\n @Prop() label: string;\n\n /** Whether to show the shipping choice description */\n @Prop() showDescription: boolean = true;\n\n /** Override shipping choices data (used for editor preview) */\n @Prop() shippingChoices: any[] | undefined;\n\n /** Maybe update the order. */\n async updateCheckout(selectedShippingChoiceId: string) {\n if (!selectedShippingChoiceId) return;\n try {\n lockCheckout('selected_shipping_choice');\n checkoutState.checkout = (await createOrUpdateCheckout({\n id: checkoutState.checkout.id,\n data: {\n selected_shipping_choice_id: selectedShippingChoiceId,\n },\n })) as Checkout;\n\n speak(__('Shipping choice updated.', 'surecart'), 'assertive');\n const { total_amount, currency } = checkoutState.checkout;\n\n /** translators: %1$s: formatted amount */\n speak(sprintf(__('Your order total has changed to: %1$s.', 'surecart'), getFormattedPrice({ amount: total_amount, currency })), 'assertive');\n } catch (e) {\n console.error(e);\n createErrorNotice(e);\n } finally {\n unLockCheckout('selected_shipping_choice');\n }\n }\n\n render() {\n const choices = this.shippingChoices || checkoutState?.checkout?.shipping_choices?.data;\n\n // When not using prop override, apply checkout state guards.\n if (!this.shippingChoices) {\n // shipping choice is not required.\n if (!checkoutState?.checkout?.selected_shipping_choice_required) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n\n // no shipping choices but no country either\n if (!choices?.length && !(checkoutState?.checkout?.shipping_address as Address)?.country) {\n return (\n <sc-form-control label={this.label || __('Shipping', 'surecart')}>\n <div class=\"shipping-choice__empty\">{__('To check available shipping choices, please provide your shipping country in the address section.', 'surecart')}</div>\n </sc-form-control>\n );\n }\n\n // no shipping choices yet.\n if (!choices?.length) {\n return (\n <sc-form-control part=\"empty\" label={this.label || __('Shipping', 'surecart')}>\n <div class=\"shipping-choice__empty\">{__('Sorry, we are not able to ship to your address.', 'surecart')}</div>\n </sc-form-control>\n );\n }\n }\n\n return (\n <Host>\n <sc-radio-group part=\"base\" label={this.label || __('Shipping', 'surecart')} class=\"shipping-choices\" onScChange={e => this.updateCheckout(e.detail)}>\n {(choices || []).map(({ id, display_amount, shipping_method }) => (\n <sc-radio\n key={id}\n checked={checkoutState?.checkout?.selected_shipping_choice === id}\n exportparts=\"base:radio__base,label:radio__label,control:radio__control,checked-icon:radio__checked-icon\"\n class=\"shipping-choice\"\n value={id}\n >\n <div class=\"shipping-choice__text\">\n <div class=\"shipping-choice__name\">{(shipping_method as ShippingMethod)?.name || __('Standard Shipping', 'surecart')}</div>\n {this.showDescription && !!(shipping_method as ShippingMethod)?.description && (\n <div class=\"shipping-choice__description\">{(shipping_method as ShippingMethod)?.description}</div>\n )}\n </div>\n <div class=\"shipping-choice__price\">{!!display_amount ? display_amount : __('Free', 'surecart')}</div>\n </sc-radio>\n ))}\n </sc-radio-group>\n {checkoutIsLocked('selected_shipping_choice') && <sc-block-ui></sc-block-ui>}\n </Host>\n );\n }\n}\n"],"version":3}