JezK
Edit File: sc-line-item-invoice-receipt-download2.js.map
{"file":"sc-line-item-invoice-receipt-download2.js","mappings":";;;;;;;AAAA,MAAM,mCAAmC,GAAG,4OAA4O,CAAC;AACzR,+CAAe,mCAAmC;;;;;;;;;;;;;;;;;;;;;wGC0CpB,UAAE,yOAKnB,UAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["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"],"sourcesContent":[":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"],"version":3}