@foxy.io/elements 1.32.0-beta.6 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +3 -3
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +7 -7
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-007d5b96.js → shared-015da8ca.js} +1 -1
- package/dist/cdn/{shared-d74032c0.js → shared-01cbaba9.js} +1 -1
- package/dist/cdn/{shared-c221c015.js → shared-08be5c32.js} +1 -1
- package/dist/cdn/{shared-b147e6ed.js → shared-0b4a62e9.js} +1 -1
- package/dist/cdn/{shared-cafda07e.js → shared-0d43de87.js} +1 -1
- package/dist/cdn/shared-0e83a899.js +1 -0
- package/dist/cdn/{shared-528bd90f.js → shared-0f4472d2.js} +1 -1
- package/dist/cdn/{shared-f1134145.js → shared-1024aa20.js} +1 -1
- package/dist/cdn/{shared-f7736718.js → shared-1220bf7d.js} +1 -1
- package/dist/cdn/{shared-e4403e14.js → shared-14bf37ae.js} +1 -1
- package/dist/cdn/{shared-361d84ab.js → shared-2dd497e5.js} +1 -1
- package/dist/cdn/{shared-c8a3f983.js → shared-30cc688f.js} +1 -1
- package/dist/cdn/{shared-1eb5be1b.js → shared-317cb721.js} +1 -1
- package/dist/cdn/{shared-0037d294.js → shared-3493737e.js} +1 -1
- package/dist/cdn/{shared-fad00e47.js → shared-359793d4.js} +1 -1
- package/dist/cdn/{shared-175a31f9.js → shared-377e3168.js} +1 -1
- package/dist/cdn/{shared-f21f2fec.js → shared-3a7db771.js} +1 -1
- package/dist/cdn/{shared-e26244f2.js → shared-3bfbd5af.js} +1 -1
- package/dist/cdn/{shared-8b855a8b.js → shared-3ca58fb9.js} +1 -1
- package/dist/cdn/{shared-b4cbb9b3.js → shared-455856d9.js} +1 -1
- package/dist/cdn/{shared-7739b962.js → shared-4b4c8ccf.js} +1 -1
- package/dist/cdn/{shared-bdc287af.js → shared-4b52b410.js} +1 -1
- package/dist/cdn/{shared-a676e474.js → shared-4beb6fef.js} +1 -1
- package/dist/cdn/{shared-71dc8e26.js → shared-4f852fd5.js} +1 -1
- package/dist/cdn/{shared-1f2fee09.js → shared-51efaf53.js} +1 -1
- package/dist/cdn/{shared-01cf9d37.js → shared-53443b27.js} +1 -1
- package/dist/cdn/{shared-e90ebfee.js → shared-5452fdfe.js} +1 -1
- package/dist/cdn/shared-54d7dfdb.js +1 -0
- package/dist/cdn/{shared-0c9e6467.js → shared-57164953.js} +1 -1
- package/dist/cdn/{shared-a2d242ac.js → shared-68f01c8d.js} +1 -1
- package/dist/cdn/{shared-146ec178.js → shared-6a8ccf0c.js} +1 -1
- package/dist/cdn/{shared-4552d25b.js → shared-6be8e65e.js} +1 -1
- package/dist/cdn/{shared-d9383fb0.js → shared-6d7c1a2f.js} +2 -2
- package/dist/cdn/{shared-3ba2b804.js → shared-7448fda4.js} +1 -1
- package/dist/cdn/{shared-2674fb94.js → shared-78bfc71e.js} +1 -1
- package/dist/cdn/{shared-ae1528b6.js → shared-81bf4ca2.js} +1 -1
- package/dist/cdn/{shared-17770c6b.js → shared-838bd79c.js} +1 -1
- package/dist/cdn/{shared-030dd9a9.js → shared-91321de3.js} +1 -1
- package/dist/cdn/{shared-aed33031.js → shared-91500a0f.js} +1 -1
- package/dist/cdn/{shared-3c4ceb0a.js → shared-935adc3b.js} +1 -1
- package/dist/cdn/{shared-a28e0b27.js → shared-97627d50.js} +1 -1
- package/dist/cdn/{shared-c51ef0d1.js → shared-9b1b4c9d.js} +1 -1
- package/dist/cdn/{shared-c654d8d7.js → shared-a84befbf.js} +1 -1
- package/dist/cdn/{shared-a5bfa671.js → shared-ad3eea80.js} +1 -1
- package/dist/cdn/{shared-31849175.js → shared-b14bf56d.js} +1 -1
- package/dist/cdn/{shared-b6ce3673.js → shared-b2bc3a0e.js} +1 -1
- package/dist/cdn/{shared-096b5cb0.js → shared-b384e653.js} +1 -1
- package/dist/cdn/{shared-a747cbc1.js → shared-b3d36746.js} +2 -2
- package/dist/cdn/{shared-7ce50e85.js → shared-b7dc7e64.js} +5 -5
- package/dist/cdn/{shared-a294328f.js → shared-bb9f0d8b.js} +1 -1
- package/dist/cdn/{shared-5d5c784f.js → shared-bbc53ef2.js} +1 -1
- package/dist/cdn/{shared-de7d4f69.js → shared-bdcf2d35.js} +1 -1
- package/dist/cdn/{shared-c50af5c9.js → shared-c24bc616.js} +1 -1
- package/dist/cdn/{shared-f35c09f5.js → shared-c671d5c7.js} +1 -1
- package/dist/cdn/{shared-9d57783e.js → shared-c86db2c0.js} +1 -1
- package/dist/cdn/{shared-7788b1f9.js → shared-cacd4407.js} +1 -1
- package/dist/cdn/{shared-2d304645.js → shared-ceafb6c3.js} +1 -1
- package/dist/cdn/{shared-8bd31970.js → shared-d0e0f8a1.js} +1 -1
- package/dist/cdn/{shared-7a6b68f2.js → shared-d6985b5f.js} +1 -1
- package/dist/cdn/{shared-880c4463.js → shared-dbe8536b.js} +1 -1
- package/dist/cdn/{shared-a6debf9c.js → shared-e0c93cfa.js} +1 -1
- package/dist/cdn/{shared-1b7449f8.js → shared-e1dea184.js} +1 -1
- package/dist/cdn/{shared-22d9d709.js → shared-e231722c.js} +1 -1
- package/dist/cdn/{shared-f75e4557.js → shared-e39760d5.js} +1 -1
- package/dist/cdn/{shared-2ad18636.js → shared-e8b8c8d0.js} +1 -1
- package/dist/cdn/{shared-8c1ea9bc.js → shared-eecba1f5.js} +1 -1
- package/dist/cdn/{shared-1e14e4ce.js → shared-f09454f9.js} +1 -1
- package/dist/cdn/{shared-14dff823.js → shared-fb18400f.js} +1 -1
- package/dist/cdn/{shared-30dc4148.js → shared-fd1adc35.js} +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +28 -20
- package/dist/cdn/translations/cart-form/en.json +28 -20
- package/dist/cdn/translations/coupon-code-form/en.json +11 -7
- package/dist/cdn/translations/coupon-form/en.json +11 -7
- package/dist/cdn/translations/gift-card-code-form/en.json +26 -21
- package/dist/cdn/translations/gift-card-form/en.json +234 -222
- package/dist/cdn/translations/item-form/en.json +28 -20
- package/dist/cdn/translations/item-option-form/en.json +28 -20
- package/dist/cdn/translations/transaction/en.json +28 -20
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +12 -16
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +4 -13
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +4 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/index.d.ts +1 -0
- package/dist/elements/public/CouponCodeForm/index.js +1 -0
- package/dist/elements/public/CouponCodeForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +1 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +30 -9
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.d.ts +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.js +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.d.ts +6 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +100 -14
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/index.d.ts +3 -1
- package/dist/elements/public/GiftCardForm/index.js +3 -1
- package/dist/elements/public/GiftCardForm/index.js.map +1 -1
- package/dist/elements/public/ItemOptionForm/ItemOptionForm.js +12 -6
- package/dist/elements/public/ItemOptionForm/ItemOptionForm.js.map +1 -1
- package/dist/elements/public/ItemOptionForm/index.d.ts +1 -0
- package/dist/elements/public/ItemOptionForm/index.js +1 -0
- package/dist/elements/public/ItemOptionForm/index.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/Transaction/Transaction.js +19 -24
- package/dist/elements/public/Transaction/Transaction.js.map +1 -1
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js +3 -5
- package/dist/elements/public/Transaction/internal/InternalTransactionCustomerControl/InternalTransactionCustomerControl.js.map +1 -1
- package/dist/mixins/themeable.js +0 -22
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-55006e10.js +0 -1
- package/dist/cdn/shared-68a615fa.js +0 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.d.ts +0 -5
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js +0 -34
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js.map +0 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.d.ts +0 -5
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js +0 -7
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js.map +0 -1
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.d.ts +0 -14
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js +0 -94
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js.map +0 -1
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.d.ts +0 -6
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js +0 -8
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./shared-0e83a899.js";import"./foxy-spinner.js";import"./shared-3bfbd5af.js";import{a as e}from"./shared-6d7c1a2f.js";import{T as s}from"./shared-b384e653.js";import{h as t,s as r}from"./shared-dc73b9a5.js";import"./shared-fd1adc35.js";import"./shared-e8b8c8d0.js";import"./shared-d1195c27.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";let a,i,o,n,d,l,c=e=>e;const m=e(s,"downloadable-card");class h extends m{renderBody(){const e=this.__extension;return t(a||(a=c` <div class="flex gap-s"> <div class="w-s h-s flex-shrink-0 rounded-s bg-contrast-5 flex" aria-hidden="true"> ${0} </div> <div class="flex-1 min-w-0"> ${0} </div> </div> `),e.length<5?this.__renderExtension(e):r(i||(i=c`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="m-auto" style="width: 64%; height: 64%"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" /></svg>`)),super.renderBody({title:e=>t(o||(o=c` <span class="inline-flex w-full items-center"> <span class="mr-auto truncate min-w-0">${0} • ${0}</span> <span class="text-s text-tertiary font-normal flex-shrink-0"> ${0} ${0} </span> </span> `),e.name,e.code,r(n||(n=c`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="inline" style="width: 1.15em; height: 1.15em"><path d="M10.75 10.818v2.614A3.13 3.13 0 0011.888 13c.482-.315.612-.648.612-.875 0-.227-.13-.56-.612-.875a3.13 3.13 0 00-1.138-.432zM8.33 8.62c.053.055.115.11.184.164.208.16.46.284.736.363V6.603a2.45 2.45 0 00-.35.13c-.14.065-.27.143-.386.233-.377.292-.514.627-.514.909 0 .184.058.39.202.592.037.051.08.102.128.152z" /><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-6a.75.75 0 01.75.75v.316a3.78 3.78 0 011.653.713c.426.33.744.74.925 1.2a.75.75 0 01-1.395.55 1.35 1.35 0 00-.447-.563 2.187 2.187 0 00-.736-.363V9.3c.698.093 1.383.32 1.959.696.787.514 1.29 1.27 1.29 2.13 0 .86-.504 1.616-1.29 2.13-.576.377-1.261.603-1.96.696v.299a.75.75 0 11-1.5 0v-.3c-.697-.092-1.382-.318-1.958-.695-.482-.315-.857-.717-1.078-1.188a.75.75 0 111.359-.636c.08.173.245.376.54.569.313.205.706.353 1.138.432v-2.748a3.782 3.782 0 01-1.653-.713C6.9 9.433 6.5 8.681 6.5 7.875c0-.805.4-1.558 1.097-2.096a3.78 3.78 0 011.653-.713V4.75A.75.75 0 0110 4z" clip-rule="evenodd" /></svg>`)),this.__formattedPrice),subtitle:e=>t(d||(d=c`${0} (${0})`),e.file_name,this.__formattedFileSize)}))}get __formattedFileSize(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_size)&&void 0!==s?s:0,r=1024,a=1048576,i=1024*a,o={maximumFractionDigits:2},n=this.lang||"en";try{return t/i>1?`${(t/i).toLocaleString(n,o)} GB`:t/a>1?`${(t/a).toLocaleString(n,o)} MB`:t/r>1?`${(t/r).toLocaleString(n,o)} KB`:`${t.toLocaleString(n,o)} B`}catch(e){return`${t} B`}}get __formattedPrice(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.price)&&void 0!==s?s:0;try{return t.toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2})}catch(e){return String(t)}}get __extension(){var e,s;const t=null!==(s=null===(e=this.data)||void 0===e?void 0:e.file_name.split(".").filter((e=>!!e)))&&void 0!==s?s:[];return t.length<2?"?????":t.pop()}__renderExtension(e){const s=`font: 700 calc(var(--lumo-size-s) / ${Math.max(2,e.length)}) sans-serif`;return t(l||(l=c`<span style="${0}" class="m-auto font-medium uppercase">${0}</span>`),s,e)}}customElements.define("foxy-downloadable-card",h);export{h as DownloadableCard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,I as t}from"./shared-
|
|
1
|
+
import{a as e,I as t}from"./shared-2dd497e5.js";import"./shared-ad3eea80.js";import"./shared-08be5c32.js";import"./shared-78bfc71e.js";import"./shared-935adc3b.js";import{h as r,P as a,B as o}from"./shared-e0c93cfa.js";import{E as i,T as s}from"./shared-359793d4.js";import"./shared-5452fdfe.js";import"./shared-3bfbd5af.js";import{w as l,a as n}from"./shared-6d7c1a2f.js";import{c as d,h as A}from"./shared-dc73b9a5.js";import{i as u}from"./shared-9803aa7c.js";import{c as p}from"./shared-4e709717.js";import"./shared-3493737e.js";import{_ as c,B as m}from"./shared-d1195c27.js";import{A as h}from"./shared-c518ece2.js";import"./shared-91500a0f.js";import"./shared-bbc53ef2.js";import{I as g}from"./shared-015da8ca.js";import"./foxy-nucleon-element.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-61ade33e.js";import"./shared-6be8e65e.js";import"./shared-c24bc616.js";import"./shared-b2bc3a0e.js";import"./shared-4b52b410.js";import"./shared-651c44fa.js";import"./shared-377e3168.js";import"./shared-f09454f9.js";import"./shared-455856d9.js";import"./shared-317cb721.js";import"./shared-838bd79c.js";import"./shared-22ba9566.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./foxy-copy-to-clipboard.js";import"./shared-dbe8536b.js";import"./shared-e231722c.js";import"./shared-bb9f0d8b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";const f=r`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-3bfbd5af.js";import{a as e}from"./shared-6d7c1a2f.js";import{T as t}from"./shared-b384e653.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-fd1adc35.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let s,d,o=e=>e;const a=e(t,"email-template-card");class m extends a{renderBody(){return super.renderBody({title:e=>r(s||(s=o`${0}`),e.description),subtitle:e=>r(d||(d=o`<foxy-i18n infer="" key="${0}"></foxy-i18n>`),this.__getType(e))})}__getType(e){const{content_html_url:t,content_text_url:r}=e,{content_html:s,content_text:d}=e;return!d||r||s||t?!s||t||d||r?!t||r||s||d?!r||t||d||s?s||t||d||r?"type_mixed":"type_default":"type_custom_text_url":"type_custom_html_url":"type_custom_html":"type_custom_text"}}customElements.define("foxy-email-template-card",m);export{m as EmailTemplateCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-175a31f9.js";import"./shared-3c4ceb0a.js";import"./shared-01cf9d37.js";import"./shared-9d57783e.js";import"./shared-8bd31970.js";import"./shared-5d5c784f.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-e26244f2.js";import{_ as e}from"./shared-d1195c27.js";import"./shared-e90ebfee.js";import"./shared-c221c015.js";import"./shared-22d9d709.js";import{h as t}from"./shared-dc73b9a5.js";import{S as s,T as a,a as i}from"./shared-d9383fb0.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-1b7449f8.js";import"./shared-0c9e6467.js";import"./shared-2d304645.js";import{G as l}from"./shared-c51ef0d1.js";import"./shared-2674fb94.js";import"./shared-bdc287af.js";import"./shared-c50af5c9.js";import"./shared-1e14e4ce.js";import"./shared-8c1ea9bc.js";import"./shared-a5bfa671.js";import{M as d}from"./shared-f75e4557.js";import{C as c}from"./shared-d1cb97c6.js";import{N as h}from"./shared-2ad18636.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-a6debf9c.js";import"./shared-61ade33e.js";import"./shared-fad00e47.js";import"./shared-0037d294.js";import"./shared-4552d25b.js";import"./shared-b6ce3673.js";import"./shared-651c44fa.js";import"./shared-b4cbb9b3.js";import"./shared-1eb5be1b.js";import"./shared-361d84ab.js";import"./shared-17a61265.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-a294328f.js";import"./shared-343d1fd7.js";import"./shared-17770c6b.js";import"./shared-7788b1f9.js";import"./shared-a28e0b27.js";import"./shared-f1134145.js";import"./shared-99940888.js";import"./shared-fcdb896f.js";import"./shared-c518ece2.js";import"./shared-f7736718.js";import"./shared-7739b962.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=s(a(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,s,a;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(a=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==a?a:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new g.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new g.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,s;const a="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(s=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==s?s:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var s,a;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(s=this.data)||void 0===s?void 0:s[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(a=this.data)||void 0===a?void 0:a[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:s,href:a,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||s.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new g.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
|
|
1
|
+
import"./shared-377e3168.js";import"./shared-935adc3b.js";import"./shared-53443b27.js";import"./shared-c86db2c0.js";import"./shared-d0e0f8a1.js";import"./shared-bbc53ef2.js";import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-3bfbd5af.js";import{_ as e}from"./shared-d1195c27.js";import"./shared-5452fdfe.js";import"./shared-08be5c32.js";import"./shared-e231722c.js";import{h as t}from"./shared-dc73b9a5.js";import{S as s,T as a,a as i}from"./shared-6d7c1a2f.js";import{c as r}from"./shared-4e709717.js";import{C as o,a as n}from"./shared-e1dea184.js";import"./shared-57164953.js";import"./shared-ceafb6c3.js";import{G as l}from"./shared-9b1b4c9d.js";import"./shared-78bfc71e.js";import"./shared-4b52b410.js";import"./shared-c24bc616.js";import"./shared-f09454f9.js";import"./shared-eecba1f5.js";import"./shared-ad3eea80.js";import{M as d}from"./shared-e39760d5.js";import{C as c}from"./shared-d1cb97c6.js";import{N as h}from"./shared-e8b8c8d0.js";import{i as m}from"./shared-9803aa7c.js";import"./shared-e0c93cfa.js";import"./shared-61ade33e.js";import"./shared-359793d4.js";import"./shared-3493737e.js";import"./shared-6be8e65e.js";import"./shared-b2bc3a0e.js";import"./shared-651c44fa.js";import"./shared-455856d9.js";import"./shared-317cb721.js";import"./shared-2dd497e5.js";import"./shared-17a61265.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-bb9f0d8b.js";import"./shared-343d1fd7.js";import"./shared-838bd79c.js";import"./shared-cacd4407.js";import"./shared-97627d50.js";import"./shared-1024aa20.js";import"./shared-99940888.js";import"./shared-fcdb896f.js";import"./shared-c518ece2.js";import"./shared-1220bf7d.js";import"./shared-4b4c8ccf.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";let p,f,u,_,b,x,y,$,v=e=>e;const j=s(a(c(i(h,"email-template-form"))));class g extends j{constructor(){super(...arguments),this.__templateLanguageOptions=[{label:"Nunjucks",value:"nunjucks"},{label:"Handlebars",value:"handlebars"},{label:"Pug",value:"pug"},{label:"Twig",value:"twig"},{label:"EJS",value:"ejs"}],this.__textContentChoice="default",this.__htmlContentChoice="default",this.__cacheState="idle"}static get properties(){return e(e({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get scopedElements(){return{"foxy-internal-select-control":customElements.get("foxy-internal-select-control"),"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"foxy-internal-source-control":customElements.get("foxy-internal-source-control"),"foxy-internal-text-control":customElements.get("foxy-internal-text-control"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-metadata":d,"x-choice":o,"x-group":l}}render(){var e,s,a;const{hiddenSelector:i,href:o,lang:n,ns:l}=this,d=o?"delete":"create",c=this.in("busy"),h=this.in("fail");return t(p||(p=v` <div class="space-y-m"> ${0} <foxy-internal-text-control infer="subject"></foxy-internal-text-control> ${0} ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),i.matches("description",!0)?"":this.__renderDescription(),"Email Receipt Template"===(null===(e=this.data)||void 0===e?void 0:e.description)?"":t(f||(f=v` <foxy-internal-select-control infer="template-language" .options="${0}"> </foxy-internal-select-control> `),this.__templateLanguageOptions),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!o?"":this.__renderTimestamps(),i.matches(d)?"":this.__renderAction(d),r({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!c&&!h}),h?"error":c?"busy":"empty",n,l,null!==(a=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==a?a:"")}async _sendPost(e){const t=await super._sendPost(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new g.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}async _sendPatch(e){const t=await super._sendPatch(e);if(!t.content_html_url&&!t.content_text_url)return t;this.__cacheState="busy";const s=t._links["fx:cache"].href,a=await new g.API(this).fetch(s,{method:"POST"});return this.__cacheState=a.ok?"idle":"fail",await this._fetch(t._links.self.href)}__renderDescription(){var e,s;const a="description";return t(u||(u=v` <div> ${0} <vaadin-text-field data-testid="${0}" class="w-full mb-s" label="${0}" ?disabled="${0}" ?readonly="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),a,this.t(a),!this.in("idle")||this.disabledSelector.matches(a),this.readonlySelector.matches(a),null!==(s=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==s?s:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${a}:after`))}__renderContent(){return t(_||(_=v` <div data-testid="content"> <div class="space-y-l">${0}</div> </div> `),["text","html"].map((e=>this.__renderContentVariant(e))))}__renderContentVariant(e){var s,a;const i="text"===e?"content_text_url":"content_html_url",o="text"===e?"content_text":"content_html",l="text"===e?"text_template":"html_template",d=this.form[i],c=this.form[o],h="text"===e?"__textContentChoice":"__htmlContentChoice",p=d?"url":c?"clipboard":this[h],f=!this.in("idle")||this.disabledSelector.matches("content",!0),u=this.readonlySelector.matches("content",!0),_=u||!(null===(s=this.data)||void 0===s?void 0:s[i])||d!==this.data[i];return t(b||(b=v` <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="${0}" ns="${0}"> </foxy-i18n> <x-choice data-testid="${0}-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div style="--lumo-border-radius:var(--lumo-border-radius-s)" class="mb-m" slot="url" ?hidden="${0}"> <div class="flex items-end mt-0"> <vaadin-text-field data-testid="${0}-url" placeholder="https://example.com/my-template" label="${0}" class="flex-1 min-w-0" value="${0}" ?readonly="${0}" ?disabled="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="${0}-cache" class="relative flex-shrink-0 ml-s" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <foxy-i18n class="${0}" lang="${0}" key="cache" ns="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" class="m-auto" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </vaadin-button> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mt-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)"> </foxy-internal-source-control> </div> <foxy-internal-source-control placeholder="${0}" helper-text="" property="${0}" label="${0}" infer="content" class="mb-m${0}" style="--lumo-border-radius:var(--lumo-border-radius-s)" slot="clipboard"> </foxy-internal-source-control> </x-choice> </x-group> `),r({"transition-colors":!0,"text-disabled":f}),this.lang,l,this.ns,o.replace("_","-"),p,["default","url","clipboard"],u,f,(e=>{e instanceof n&&(this.edit({[o]:"",[i]:""}),this[h]=e.detail)}),["default","url","clipboard"].map((e=>t(x||(x=v` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns))),"url"!==p,o.replace("_","-"),this.t("url"),m(this.form[i]),u,f,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({[o]:"",[i]:t})}),o.replace("_","-"),f||"busy"===this.__cacheState,_,this.__cache,r({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,r({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,this.t("url_source_placeholder"),o,this.t("url_source_label"),(null===(a=this.data)||void 0===a?void 0:a[o])?"":" hidden",this.t("clipboard_source_placeholder"),o,this.t("clipboard_source_label"),"clipboard"===p?"":" hidden")}__renderTimestamps(){const e="timestamps";return t(y||(y=v` <div> ${0} <x-metadata data-testid="timestamps" .items="${0}"> </x-metadata> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),["date_modified","date_created"].map((e=>{var t;return{name:this.t(e),value:(null===(t=this.data)||void 0===t?void 0:t[e])?this.t("date",{value:new Date(this.data[e])}):""}})),this.renderTemplateOrSlot(`${e}:after`))}__renderAction(e){const{disabledSelector:s,href:a,lang:i,ns:r}=this,o=this.in({idle:{template:{dirty:"valid"}}}),n=this.in({idle:{snapshot:{dirty:"valid"}}}),l=!this.in("idle")||s.matches(e,!0),d=o||n;return t($||($=v` <div> ${0} <foxy-internal-confirm-dialog message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" data-testid="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0}" data-testid="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),i,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?a?"error":"primary success":"",e,this.in({idle:"template"})&&!d||l,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,i,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const s=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new g.API(this).fetch(s,{method:"POST"});this.__cacheState=a.ok?"idle":"fail",this.refresh()}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-email-template-form",g);export{g as EmailTemplateForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,c as t,h as a}from"./shared-dc73b9a5.js";import{T as i,a as n,S as o}from"./shared-
|
|
1
|
+
import{aH as e,_ as s}from"./shared-d1195c27.js";import{L as r,c as t,h as a}from"./shared-dc73b9a5.js";import{T as i,a as n,S as o}from"./shared-6d7c1a2f.js";import{c as d}from"./shared-4e709717.js";import{G as l}from"./shared-9b1b4c9d.js";import"./foxy-nucleon-element.js";import{g as c}from"./shared-bab2ea2c.js";import{N as p}from"./shared-e8b8c8d0.js";import{d as u}from"./shared-641786b2.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let m,f,h,y=e=>e;class x extends(i(r)){constructor(){super(...arguments),this.data=[]}static get properties(){return{data:{type:Array}}}static get styles(){return[super.styles,t(m||(m=y`dd,dt{display:inline-block;overflow:hidden;vertical-align:top;overflow-wrap:anywhere}dt{min-width:calc(5 * var(--lumo-size-l));padding-right:.5em}dd{max-width:calc(15 * var(--lumo-size-l));min-width:calc(10 * var(--lumo-size-l))}`))]}render(){return a(f||(f=y` <dl class="space-y-s"> ${0} </dl> `),this.data.map((e=>{const s=String(e[1]).trim();return a(h||(h=y` <div> <dt class="text-secondary truncate">${0}</dt> <dd class="${0}">${0}</dd> </div> `),e[0],d({"text-tertiary":!s}),s||"–")})))}}let g,v,$=e=>e;const _=["_links","_embedded"],b=n(i(o(p)));class j extends b{static get scopedElements(){return{"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x}}render(){if(this.in({idle:"snapshot"})){const s=this.data,{_links:r,_embedded:t}=s,i=e(s,_);try{const e=c(r.self.href);null!==e&&(i.id=e)}catch(e){}return a(g||(g=$` <x-data-list aria-live="polite" aria-busy="false" class="leading-s text-s" data="${0}"> </x-data-list> `),JSON.stringify(Array.from(Object.entries(i))))}const s=this.in("busy");return a(v||(v=$` <div aria-live="polite" aria-busy="${0}" data-testid="wrapper" class="flex justify-center"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> `),s,this.in("fail")?"error":s?"busy":"empty",this.lang,this.ns)}}let w,k,S,E,O,N,z,T,G,J,P,A=e=>e;const R=n(i(o(p)),"error-entry-card");class D extends R{constructor(){super(...arguments),this.open=!1}static get scopedElements(){return{"x-resource-viewer":j,"foxy-spinner":customElements.get("foxy-spinner"),"x-data-list":x,"iron-icon":customElements.get("iron-icon"),"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get properties(){return s(s({},super.properties),{},{open:{type:Boolean,reflect:!0}})}render(){var e,s;const r=this.data,t=this.in("busy");if(r){const{hide_error:e}=r,{open:s}=this;return a(w||(w=A` <details aria-busy="${0}" aria-live="polite" class="text-body w-full" ?open="${0}" @toggle="${0}"> <summary class="rounded-s ring-offset-4 ring-offset-base ring-primary-50 focus-outline-none focus-ring-2"> <div style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="${0}"> ${0} </div> </summary> ${0} </details> `),t,s,this.__handleToggle,d({"border-l-2 leading-s relative cursor-pointer":!0,"border-contrast":e&&!s,"border-primary":!e,"border-error":e&&s,"h-l":!s}),this.__renderSummary(r),s?this.__renderDetails(r):"")}return a(k||(k=A` <div aria-busy="${0}" aria-live="polite" style="padding-left:calc(var(--lumo-space-xs) + var(--lumo-space-s) - 1px)" class="flex items-center justify-center border-l-2 leading-s relative border-contrast-10 h-l"> <foxy-spinner data-testid="spinner" layout="horizontal" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),t,t?"busy":this.in("fail")?"error":"empty",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderGetOrPostValues(e,s){const r=new URLSearchParams(u(e||s));return a(S||(S=A` <div class="relative leading-xs pt-s"> <div class="absolute font-medium right-0 text-tertiary text-xs top-0 mt-s">${0}</div> <x-data-list data="${0}"></x-data-list> </div> `),e?"GET":"POST",JSON.stringify(Array.from(r.entries())))}__renderReferrer(e){return a(E||(E=A` <span class="text-secondary">Navigated from</span> <a target="_blank" class="font-medium text-primary hover-underline" href="${0}" rel="nofollow noopener noreferrer"> ${0} </a> `),e,e)}__renderSummary(e){return a(O||(O=A` <div class="text-s absolute right-0 top-0 text-tertiary"> <iron-icon icon="icons:expand-${0}"></iron-icon> </div> <div class="text-s mb-xs ${0}"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </div> <p class="${0} overflow-hidden font-medium"> ${0} </p> `),this.open?"less":"more",e.hide_error?"text-error":"text-primary",JSON.stringify({value:e.date_created}),this.lang,this.ns,JSON.stringify({value:e.date_created}),this.lang,this.ns,this.open?"":"truncate",e.error_message)}__renderDetails(e){return a(N||(N=A` <div class="space-y-m pt-m"> ${0} ${0} ${0} </div> `),e.referrer||e.get_values||e.post_values?a(z||(z=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="request" ns="${0}"></foxy-i18n> <div class="mx-xs p-s text-s divide-y divide-contrast-10 space-y-s"> <p> <span class="block font-medium">${0}</span> ${0} </p> ${0} </div> </x-group> `),this.lang,this.ns,e.url,e.referrer?this.__renderReferrer(e.referrer):"",e.get_values||e.post_values?this.__renderGetOrPostValues(e.get_values,e.post_values):""):"",e.ip_address||e.ip_country||e.user_agent?a(T||(T=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="client" ns="${0}"></foxy-i18n> <div class="text-s flex flex-col mx-xs p-s"> <span class="font-medium"> ${0} ${0} </span> ${0} </div> </x-group> `),this.lang,this.ns,e.ip_address,e.ip_country?a(G||(G=A`<span class="text-tertiary"> • </span>${0}`),e.ip_country):"",e.user_agent?a(J||(J=A`<span class="text-secondary">${0}</span>`),e.user_agent):""):"",Object.entries(e._links).map((([e,s])=>["self","fx:store","curies"].includes(e)?"":a(P||(P=A` <x-group frame> <foxy-i18n slot="header" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <x-resource-viewer class="p-s mx-xs" href="${0}" lang="${0}" ns="${0}"> </x-resource-viewer> </x-group> `),this.lang,e.substr(3),this.ns,s.href,this.lang,this.ns))))}__handleToggle(e){var s;const r=e.target;r.open&&!1===(null===(s=this.data)||void 0===s?void 0:s.hide_error)&&(this.edit({hide_error:!0}),this.submit()),this.open=r.open}}customElements.define("foxy-error-entry-card",D);export{D as ErrorEntryCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-0e83a899.js";import"./foxy-nucleon-element.js";import{_ as e}from"./shared-d1195c27.js";import{a as t}from"./shared-6d7c1a2f.js";import{I as r}from"./shared-fd1adc35.js";import{i as s}from"./shared-9803aa7c.js";import{c as a}from"./shared-4e709717.js";import{d as o}from"./shared-641786b2.js";import{h as i}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-3bfbd5af.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,n,u=e=>e;const c=t(r,"filter-attribute-card");class h extends c{constructor(){super(...arguments),this.getCountLoaderHref=null,this.__countLoaderId="countLoader",this.__refreshTimeout=null}static get properties(){return e(e({},super.properties),{},{countRefreshInterval:{attribute:"count-refresh-interval",type:Number},getCountLoaderHref:{attribute:!1}})}disconnectedCallback(){super.disconnectedCallback(),"number"==typeof this.__refreshTimeout&&clearTimeout(this.__refreshTimeout)}updated(e){if(super.updated(e),"number"!=typeof this.__refreshTimeout){const e=this.constructor.countRefreshInterval;this.__refreshTimeout=setTimeout((()=>{var e;return null===(e=this.__getCountLoader())||void 0===e?void 0:e.refresh()}),e)}}render(){var e,t;const r=this.constructor,c=null===(t=null===(e=this.__getCountLoader())||void 0===e?void 0:e.data)||void 0===t?void 0:t.total_items;let h;try{this.data&&this.getCountLoaderHref&&(h=new URL(this.getCountLoaderHref(o(this.data.value))),h.searchParams.set("limit","1"))}catch(e){h=void 0}return i(d||(d=u` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="${0}"> <span class="${0}"> ${0} </span> <span class="${0}"> ${0} </span> </div> `),s(null==h?void 0:h.toString()),this.__countLoaderId,(()=>this.requestUpdate()),a({"transition-colors flex gap-s font-medium text-m leading-xs rounded-s":!0,"bg-contrast-5":!this.in("fail")&&!this.data,"bg-error-10":this.in("fail")}),a({"transition-opacity truncate min-w-0":!0,"opacity-0":!this.data}),this.__getValueParam(r.filterNameKey)||i(n||(n=u`<foxy-i18n infer="" key="no_name"></foxy-i18n>`)),a({"transition-opacity bg-contrast-5 px-xs rounded-s":!0,"opacity-0":!this.data||"number"!=typeof c}),null!=c?c:0)}__getCountLoader(){return this.renderRoot.querySelector(`#${this.__countLoaderId}`)}__getValueParam(e){var t,r,s;try{return null!==(s=new URL(o(null!==(r=null===(t=this.data)||void 0===t?void 0:t.value)&&void 0!==r?r:""),"https://example.com").searchParams.get(e))&&void 0!==s?s:""}catch(e){return""}}}h.countRefreshInterval=6e5,h.filterQueryKey="filter_query",h.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-card",h);export{h as FilterAttributeCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./shared-
|
|
1
|
+
import{a as e}from"./shared-2dd497e5.js";import"./shared-935adc3b.js";import"./shared-3bfbd5af.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-bbc53ef2.js";import{I as r}from"./shared-015da8ca.js";import"./shared-01cbaba9.js";import{_ as s,B as a}from"./shared-d1195c27.js";import{a as i}from"./shared-6d7c1a2f.js";import{d as o,e as d}from"./shared-641786b2.js";import"./shared-51c4a6dd.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-17a61265.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-08be5c32.js";import"./shared-e0c93cfa.js";import"./shared-359793d4.js";import"./shared-61ade33e.js";import"./shared-377e3168.js";import"./shared-f09454f9.js";import"./shared-ad3eea80.js";import"./shared-78bfc71e.js";import"./shared-4e709717.js";import"./shared-22ba9566.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./foxy-copy-to-clipboard.js";import"./shared-dbe8536b.js";import"./shared-5452fdfe.js";import"./shared-e231722c.js";import"./shared-bb9f0d8b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-8874ec69.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a0c6a159.js";let n,l,m=e=>e;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends e{renderControl(){const e=this.nucleon,r=null==e?void 0:e.in({idle:{snapshot:"dirty"}}),s=!!(null==e?void 0:e.data);return t(n||(n=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),s&&r?t(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==e?void 0:e.undo())):"",s?r?"secondary":"error":"success",s&&r?"":"col-span-2",this.disabled,(()=>!s||r?null==e?void 0:e.submit():null==e?void 0:e.delete()),s?r?"update":"delete":"create")}});let h,c=e=>e;const u=i(r,"filter-attribute-form");class p extends u{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const e=this.constructor;return this.__getValueParam(e.filterNameKey)},this.__filterNameSetValue=e=>{const t=this.constructor;this.__setValueParam(t.filterNameKey,e)}}static get properties(){return s(s({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const e=[],t=this.constructor,r=this.__getValueParam(t.filterQueryKey),s=!!this.data;return s||e.push("filter-name"),r||s||e.push("action"),new a(`${e.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const e=this.constructor;return t(h||(h=c` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(e.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(e){var t;if(super.updated(e),"string"==typeof this.form.value){const e=new URL(o(this.form.value),"https://example.com");e.pathname=null!==(t=this.pathname)&&void 0!==t?t:"";const r=d(e.toString().substring(e.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const e=this.constructor;this.edit({visibility:e.attributeVisibility,name:e.attributeName}),super.submit()}__getValueParam(e){var t,r;try{return null!==(r=new URL(o(null!==(t=this.form.value)&&void 0!==t?t:""),"https://example.com").searchParams.get(e))&&void 0!==r?r:""}catch(e){return""}}__setValueParam(e,t){var r;try{const s=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");s.searchParams.set(e,t),this.edit({value:d(s.toString().substring(s.origin.length))})}catch(e){}}__handleFilterQueryChange(e){var t;const r=this.constructor,s=e.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(t=s.value)&&void 0!==t?t:"")}}p.attributeVisibility="restricted",p.filterQueryKey="filter_query",p.attributeName="foxy-admin-bookmark",p.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",p);export{p as FilterAttributeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-3bfbd5af.js";import"./shared-c86db2c0.js";import{_ as e,B as t}from"./shared-d1195c27.js";import{h as r}from"./shared-dc73b9a5.js";import{A as o}from"./shared-c518ece2.js";import{D as s}from"./shared-57164953.js";import{F as n}from"./shared-343d1fd7.js";import{U as i}from"./shared-cd96ff03.js";import{s as a}from"./shared-99940888.js";import"./shared-6d7c1a2f.js";import"./shared-17a61265.js";import"./shared-935adc3b.js";import"./shared-08be5c32.js";import"./shared-e0c93cfa.js";import"./shared-359793d4.js";import"./shared-61ade33e.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-4e709717.js";let d,p,l=e=>e;class h extends s{constructor(){super(...arguments),this.closeOnPatch=!1,this.keepOpenOnDelete=!1,this.keepOpenOnPost=!1,this.related=[],this.parent="",this.props={},this.group="",this.href="",this.__form=null,this.__renderForm=null,this.__handleFetch=e=>{e instanceof n&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))},this.__handleUpdate=e=>{var t;if(!(e instanceof i))return;const r=null===(t=e.detail)||void 0===t?void 0:t.result,o=i.UpdateResult,s=e.currentTarget;(!this.keepOpenOnDelete&&r===o.ResourceDeleted||!this.keepOpenOnPost&&r===o.ResourceCreated||this.closeOnPatch&&r===o.ResourceUpdated&&0===s.errors.length)&&(this.open=!1),this.parent!==s.parent&&(this.parent=s.parent),this.href!==s.href&&(this.href=s.href),this.closable=!s.in("busy"),this.editable=s.in({idle:{template:{dirty:"valid"}}})||s.in({idle:{snapshot:{dirty:"valid"}}})}}static get properties(){return e(e({},super.properties),{},{href:{type:String},form:{type:String,noAccessor:!0},group:{type:String},props:{type:Object},parent:{type:String},related:{type:Array},closeOnPatch:{type:Boolean,attribute:"close-on-patch"},keepOpenOnPost:{type:Boolean,attribute:"keep-open-on-post"},keepOpenOnDelete:{type:Boolean,attribute:"keep-open-on-delete"}})}get hiddenSelector(){return new t(`submit undo ${super.hiddenSelector}`.trim())}get form(){return this.__form}set form(e){this.__form=e,this.__renderForm="string"==typeof e?new Function("options",`return options.html\`\n <${e}\n id="form"\n ns="\${options.dialog.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n href=\${options.dialog.href}\n lang=\${options.dialog.lang}\n group=\${options.dialog.group}\n parent=\${options.dialog.parent}\n disabledcontrols=\${options.dialog.disabledSelector.toString()}\n readonlycontrols=\${options.dialog.readonlySelector.toString()}\n hiddencontrols=\${options.dialog.hiddenSelector.toString()}\n ?disabled=\${options.dialog.disabled}\n ?readonly=\${options.dialog.readonly}\n ?hidden=\${options.dialog.hidden}\n .templates=\${options.dialog.templates}\n .related=\${options.dialog.related}\n ...=\${options.spread(options.dialog.props)}\n @fetch=\${options.handleFetch}\n @update=\${options.handleUpdate}\n >\n </${e}>\``):e,this.requestUpdate()}render(){return r(d||(d=l` <foxy-internal-confirm-dialog message="undo_message" confirm="undo_confirm" cancel="undo_cancel" header="undo_header" theme="error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} `),this.lang,this.ns,(e=>!e.detail.cancelled&&super.hide(!0)),super.render((()=>{var e;return r(p||(p=l`${0}`),null===(e=this.__renderForm)||void 0===e?void 0:e.call(this,{handleUpdate:this.__handleUpdate,handleFetch:this.__handleFetch,spread:a,dialog:this,html:r}))})))}async hide(e=!1){if(!e||!this.editable)return super.hide(e);this.renderRoot.querySelector("#confirm").show()}async save(){this.renderRoot.querySelector("#form").submit()}}customElements.define("foxy-form-dialog",h);export{h as FormDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-838bd79c.js";import"./shared-377e3168.js";import"./shared-cacd4407.js";import{I as e}from"./shared-2dd497e5.js";import{_ as r,B as s}from"./shared-d1195c27.js";import{i as t}from"./shared-9803aa7c.js";import{h as i}from"./shared-dc73b9a5.js";import"./shared-91500a0f.js";import"./shared-d0e0f8a1.js";import"./shared-bbc53ef2.js";import{I as o}from"./shared-015da8ca.js";import{a}from"./shared-6d7c1a2f.js";import"./shared-ad3eea80.js";import"./shared-e0c93cfa.js";import"./shared-08be5c32.js";import"./shared-78bfc71e.js";import"./shared-f09454f9.js";import"./shared-61ade33e.js";import"./shared-359793d4.js";import"./shared-51c4a6dd.js";import"./shared-3bfbd5af.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-935adc3b.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./foxy-copy-to-clipboard.js";import"./shared-dbe8536b.js";import"./shared-5452fdfe.js";import"./shared-e231722c.js";import"./shared-bb9f0d8b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let n,d,l,h=e=>e;customElements.define("foxy-internal-integer-control",class extends e{constructor(){super(...arguments),this.showControls=!1,this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return r(r({},super.properties),{},{showControls:{type:Boolean,attribute:"show-controls"},prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,r;return i(n||(n=h` <vaadin-integer-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?has-controls="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-integer-field> `),t(this._errorMessage),this.placeholder,this.helperText,this.label,t(null!==(e=this.min)&&void 0!==e?e:void 0),t(null!==(r=this.max)&&void 0!==r?r:void 0),this.showControls,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{const r=e.currentTarget;this._value=parseInt(r.value)}),this.prefix?i(d||(d=h`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?i(l||(l=h`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}});let c,m=e=>e;const p=a(o,"generate-codes-form");class f extends p{constructor(){super(...arguments),this.__exampleGetValue=()=>{var e,r;const s=null!==(e=this.form.prefix)&&void 0!==e?e:"",t=(null!==(r=this.form.length)&&void 0!==r?r:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((e=>`${s}${e.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:e="",length:r=6})=>r-e.length>0&&r<=50&&!(null==e?void 0:e.includes(" "))||"error:invalid_form"]}get readonlySelector(){const e=["example",super.readonlySelector.toString()];return this.href&&e.push("length number-of-codes current-balance prefix"),new s(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("delete timestamps"),this.href&&e.push("example"),this.errors.includes("error:invalid_form")&&e.push("example"),new s(e.join(" ").trim())}renderBody(){return i(c||(c=m` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",f);export{f as GenerateCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-3bfbd5af.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-d1cb97c6.js";import{N as s}from"./shared-e8b8c8d0.js";import{T as i,a as r}from"./shared-6d7c1a2f.js";import{c as a}from"./shared-4e709717.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,o,n,l,c,p=t=>t;const h=i(e(r(s,"gift-card-card")));class f extends h{render(){var e,s;const i=this.hiddenSelector;return t(d||(d=p` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),a({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("status",!0)?"":this.__renderStatus(),a({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,r;const a=null!==(s=null===(e=this.data)||void 0===e?void 0:e.name)&&void 0!==s?s:t(o||(o=p`​`)),d=null!==(r=null===(i=this.data)||void 0===i?void 0:i.currency_code)&&void 0!==r?r:t(n||(n=p`​`));return t(l||(l=p` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <div class="text-tertiary uppercase text-s flex-shrink-0">${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),a,d,this.renderTemplateOrSlot("title:after"))}__renderStatus(){var e;const s=null===(e=this.data)||void 0===e?void 0:e.expires_after;return t(c||(c=p` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-secondary" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:s}),this.lang,s?"expires_after_value":"never_expires",this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-gift-card-card",f);export{f as GiftCardCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-0e83a899.js";import"./foxy-nucleon-element.js";import"./shared-3bfbd5af.js";import{a as e}from"./shared-6d7c1a2f.js";import{I as r}from"./shared-fd1adc35.js";import{i as t}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";let o,d=e=>e;const a=e(r,"gift-card-code-card");class i extends a{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}get isBodyReady(){var e,r;return super.isBodyReady&&!!(null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data)&&!!(null===(r=this.__storeLoader)||void 0===r?void 0:r.data)}renderBody(){var e,r,a,i,n;const c=null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data,f=null===(r=this.__storeLoader)||void 0===r?void 0:r.data;return s(o||(o=d` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="current_balance" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.data,{currencyDisplay:(null==f?void 0:f.use_international_currency_symbol)?"code":"symbol",value:`${null===(a=this.data)||void 0===a?void 0:a.current_balance} ${null==c?void 0:c.currency_code}`},this.data,t(null===(i=this.data)||void 0===i?void 0:i._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),t(null===(n=this.data)||void 0===n?void 0:n._links["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()))}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-card",i);export{i as GiftCardCodeCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-fb18400f.js";import"./shared-b3d36746.js";import"./shared-a84befbf.js";import"./shared-91500a0f.js";import"./shared-91321de3.js";import"./shared-bbc53ef2.js";import{I as e}from"./shared-015da8ca.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-6d7c1a2f.js";import{T as a}from"./shared-8874ec69.js";import{i}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";import"./shared-935adc3b.js";import"./shared-08be5c32.js";import"./shared-e0c93cfa.js";import"./shared-359793d4.js";import"./shared-61ade33e.js";import"./shared-2dd497e5.js";import"./shared-51c4a6dd.js";import"./shared-3bfbd5af.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./foxy-copy-to-clipboard.js";import"./shared-dbe8536b.js";import"./shared-5452fdfe.js";import"./shared-e231722c.js";import"./shared-bb9f0d8b.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./shared-4e709717.js";import"./shared-99940888.js";import"./shared-7448fda4.js";import"./shared-6be8e65e.js";import"./shared-c24bc616.js";import"./shared-b2bc3a0e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a0c6a159.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-838bd79c.js";import"./shared-ad3eea80.js";import"./shared-78bfc71e.js";import"./shared-377e3168.js";import"./shared-f09454f9.js";import"./shared-3a7db771.js";import"./shared-4b52b410.js";import"./shared-4b4c8ccf.js";import"./shared-455856d9.js";import"./shared-317cb721.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-22ba9566.js";import"./shared-0e83a899.js";import"./shared-fd1adc35.js";let n,l=e=>e;const m=s(e,"gift-card-code-form");class c extends m{constructor(){super(...arguments),this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=o(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:a.String,path:"id",label:"filters.id"},{type:a.String,path:"tax_id",label:"filters.tax_id"},{type:a.String,path:"email",label:"filters.email"},{type:a.String,path:"first_name",label:"filters.first_name"},{type:a.String,path:"last_name",label:"filters.last_name"},{type:a.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:a.Date,path:"last_login_date",label:"filters.last_login_date"},{type:a.Date,path:"date_created",label:"filters.date_created"},{type:a.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString(),"cart-item"];return new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new t(e.join(" ").trim())}renderBody(){var e,r,t,o,s,a,m,c;let f;try{const o=new URL(null!==(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==t?t:"");o.searchParams.set("zoom","item_options"),f=o.toString()}catch(e){f=void 0}return d(n||(n=l` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="current-balance"> </foxy-internal-number-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control infer="cart-item" item="foxy-item-card" .getValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),i(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,(()=>f),i(null===(m=null===(a=this.data)||void 0===a?void 0:a._links)||void 0===m?void 0:m["fx:gift_card_code_logs"].href),super.renderBody(),i(null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",c);export{c as GiftCardCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-0e83a899.js";import"./foxy-nucleon-element.js";import"./shared-3bfbd5af.js";import{a as e}from"./shared-6d7c1a2f.js";import{I as t}from"./shared-fd1adc35.js";import{i as r}from"./shared-9803aa7c.js";import{c as s}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-5452fdfe.js";import"./shared-e0c93cfa.js";import"./shared-bb9f0d8b.js";import"./shared-d1195c27.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";let d,a=e=>e;const i=e(t,"gift-card-code-log-card");class n extends i{constructor(){super(...arguments),this.__giftCardLoaderId="giftCardLoader",this.__storeLoaderId="storeLoader"}renderBody(){var e,t,i,n;const f=this.data,c=null!==(e=null==f?void 0:f.balance_adjustment)&&void 0!==e?e:0,l="number"==typeof(null==f?void 0:f.transaction_id),_=l?"title_used":"title_updated_via_api",u=l?"subtitle_transaction":"subtitle_no_transaction",p={transaction_id:null==f?void 0:f.transaction_id},h={date_created:null==f?void 0:f.date_created,month:"short"},m={currencyDisplay:(null===(t=this.__store)||void 0===t?void 0:t.use_international_currency_symbol)?"code":"symbol",signDisplay:"exceptZero",amount:`${c} ${null===(i=this.__giftCard)||void 0===i?void 0:i.currency_code}`};return o(d||(d=a` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="leading-s"> <div class="flex justify-between items-center"> <span class="text-body font-medium truncate"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </span> <span class="text-s text-tertiary flex-shrink-0"> <foxy-i18n infer="" key="date" .options="${0}"></foxy-i18n> </span> </div> <div class="text-s text-secondary truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> <span class="text-tertiary">•</span> <span class="${0}"> <foxy-i18n infer="" key="adjustment" .options="${0}"></foxy-i18n> </span> </div> </div> `),r(null===(n=null==f?void 0:f._links)||void 0===n?void 0:n["fx:gift_card"].href),this.__giftCardLoaderId,(()=>this.requestUpdate()),r(null==f?void 0:f._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()),_,h,u,p,s({"text-tertiary":0===c,"text-success":c>0,"text-error":c<0}),m)}get isBodyReady(){return super.isBodyReady&&!!this.__giftCard&&!!this.__store}get __giftCardLoader(){return this.renderRoot.querySelector(`#${this.__giftCardLoaderId}`)}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}get __giftCard(){var e;return null===(e=this.__giftCardLoader)||void 0===e?void 0:e.data}get __store(){var e;return null===(e=this.__storeLoader)||void 0===e?void 0:e.data}}customElements.define("foxy-gift-card-code-log-card",n);export{n as GiftCardCodeLogCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-4beb6fef.js";import"./shared-91500a0f.js";import{I as r}from"./shared-015da8ca.js";import{a as e}from"./shared-6d7c1a2f.js";import{B as s}from"./shared-d1195c27.js";import{h as t}from"./shared-dc73b9a5.js";import"./shared-dbe8536b.js";import"./shared-e0c93cfa.js";import"./shared-359793d4.js";import"./shared-08be5c32.js";import"./shared-5452fdfe.js";import"./shared-e231722c.js";import"./shared-2dd497e5.js";import"./shared-51c4a6dd.js";import"./shared-3bfbd5af.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-9803aa7c.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-838bd79c.js";import"./shared-ad3eea80.js";import"./shared-78bfc71e.js";import"./shared-377e3168.js";import"./shared-f09454f9.js";import"./shared-61ade33e.js";import"./shared-935adc3b.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./foxy-copy-to-clipboard.js";import"./shared-bb9f0d8b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let d,a=r=>r;const o=e(r,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var r,e;return null!==(e=null===(r=this.form.gift_card_codes)||void 0===r?void 0:r.map((r=>({value:r}))))&&void 0!==e?e:[]},this.__giftCardCodesSetValue=r=>{this.edit({gift_card_codes:r.map((({value:r})=>r.split(" ").map((r=>r.trim())))).flat().filter(((r,e,s)=>s.indexOf(r)===e))})}}static get v8n(){return[({gift_card_codes:r})=>r&&r.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const r=[super.readonlySelector.toString()];return this.href&&r.push("gift-card-codes"),new s(r.join(" ").trim())}get hiddenSelector(){const r=["delete timestamps",super.hiddenSelector.toString()];return new s(r.join(" ").trim())}renderBody(){return t(d||(d=a` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(r){const e=JSON.stringify(r),s=await this._fetch(this.parent,{body:e,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-ae1528b6.js";import"./shared-e4403e14.js";import"./shared-a676e474.js";import"./shared-a747cbc1.js";import"./shared-8b855a8b.js";import"./shared-01cf9d37.js";import"./shared-5d5c784f.js";import{I as e}from"./shared-007d5b96.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cafda07e.js";import{I as t}from"./shared-361d84ab.js";import{R as r,a as o}from"./shared-d9383fb0.js";import{h as i}from"./shared-dc73b9a5.js";import{_ as s,B as n}from"./shared-d1195c27.js";import{T as a}from"./shared-8874ec69.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-3ba2b804.js";import"./shared-c221c015.js";import"./shared-a6debf9c.js";import"./shared-fad00e47.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-e90ebfee.js";import"./shared-a294328f.js";import"./shared-e26244f2.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-2ad18636.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-3c4ceb0a.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-9d57783e.js";import"./shared-0c9e6467.js";import"./shared-880c4463.js";import"./shared-22d9d709.js";import"./shared-22ba9566.js";import"./shared-4552d25b.js";import"./shared-c50af5c9.js";import"./shared-b6ce3673.js";import"./foxy-swipe-actions.js";import"./shared-17770c6b.js";import"./shared-a5bfa671.js";import"./shared-2674fb94.js";import"./shared-175a31f9.js";import"./shared-1e14e4ce.js";import"./shared-7788b1f9.js";import"./shared-f1134145.js";import"./shared-0037d294.js";import"./shared-bdc287af.js";import"./shared-651c44fa.js";import"./shared-b4cbb9b3.js";import"./shared-1eb5be1b.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-aed33031.js";import"./shared-8bd31970.js";import"./shared-51c4a6dd.js";import"./shared-096b5cb0.js";import"./shared-30dc4148.js";import"./shared-55006e10.js";import"./shared-14dff823.js";import"./shared-030dd9a9.js";import"./shared-f21f2fec.js";import"./shared-7739b962.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-68a615fa.js";import"./shared-641786b2.js";import"./shared-71dc8e26.js";let l,c,f=e=>e;const m=r(t);customElements.define("foxy-internal-gift-card-form-provisioning-control",class extends m{constructor(){super(...arguments),this.__maxBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_max},this.__maxBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:s>e?e:s,initial_balance_max:e}})},this.__minBalanceValueGetter=()=>{var e,t;return null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.initial_balance_min},this.__minBalanceValueSetter=e=>{var t,r,o,i;const s=null!==(o=null===(r=null===(t=this.nucleon)||void 0===t?void 0:t.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==o?o:e;null===(i=this.nucleon)||void 0===i||i.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:s<e?e:s}})},this.__toggleValueGetter=()=>{var e,t;return(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?["allow"]:[]},this.__toggleValueSetter=e=>{var t,r,o,i,s,n,a,d;e.includes("allow")?null===(t=this.nucleon)||void 0===t||t.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(i=null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.form.provisioning_config)||void 0===o?void 0:o.initial_balance_min)&&void 0!==i?i:0,initial_balance_max:null!==(a=null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.form.provisioning_config)||void 0===n?void 0:n.initial_balance_max)&&void 0!==a?a:0}}):null===(d=this.nucleon)||void 0===d||d.edit({provisioning_config:null})},this.__toggleOptions=[{label:"text",value:"allow"}]}renderControl(){var e,t;return i(l||(l=f` <foxy-internal-checkbox-group-control infer="toggle" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__toggleValueGetter,this.__toggleValueSetter,this.__toggleOptions,(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning)?i(c||(c=f` <div class="grid grid-cols-2 sm-grid-cols-4 gap-m mt-s"> <foxy-internal-text-control infer="sku" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-integer-control infer="min-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="max-balance" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> </div> `),this.__minBalanceValueGetter,this.__minBalanceValueSetter,this.__maxBalanceValueGetter,this.__maxBalanceValueSetter):"")}});const p=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let u,_,h=e=>e;const g=r(o(e,"gift-card-form"));class v extends g{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,r)=>!!e&&r.indexOf(e)===t)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:a.String},{label:"current_balance",path:"current_balance",type:a.Number},{label:"end_date",path:"end_date",type:a.Date},{label:"date_created",path:"date_created",type:a.Date},{label:"date_modified",path:"date_modified",type:a.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(t.code),e.__codesActions[0].state="end"}catch(t){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return s(s({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var t;if(null===(t=e.provisioning_config)||void 0===t?void 0:t.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_min;return!("number"==typeof r&&r<0)||"min-balance:v8n_negative"},e=>{var t;const r=null===(t=e.provisioning_config)||void 0===t?void 0:t.initial_balance_max;return!("number"==typeof r&&r<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("codes","category-restrictions","attributes"),new n(e.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return i(u||(u=h` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,r,o,s,n,a,l;let c;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==t?t:"");r.searchParams.set("order","date_created desc"),c=r.toString()}catch(e){c=void 0}return i(_||(_=h` ${0} <div class="grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m"> <foxy-internal-text-control infer="name" class="md-col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" infer="expires"> </foxy-internal-frequency-control> </div> <foxy-internal-gift-card-form-provisioning-control infer="provisioning"> </foxy-internal-gift-card-form-provisioning-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,p.map((e=>({label:this.t(`currency.code_${e}`),value:e}))),c,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=null===(r=this.__storeLoader)||void 0===r?void 0:r.data)||void 0===o?void 0:o._links["fx:item_categories"].href),d(null===(s=this.data)||void 0===s?void 0:s._links["fx:gift_card_item_categories"].href),d(null===(n=this.data)||void 0===n?void 0:n._links.self.href),d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",v);export{v as GiftCardForm};
|
|
1
|
+
import"./shared-81bf4ca2.js";import"./shared-14bf37ae.js";import"./shared-4beb6fef.js";import"./shared-b3d36746.js";import"./shared-3ca58fb9.js";import"./shared-a84befbf.js";import"./shared-53443b27.js";import"./shared-6a8ccf0c.js";import"./shared-91500a0f.js";import"./shared-bbc53ef2.js";import{I as e}from"./shared-015da8ca.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as t}from"./shared-d1195c27.js";import{T as i}from"./shared-8874ec69.js";import{h as o}from"./shared-dc73b9a5.js";import{R as a,a as s}from"./shared-6d7c1a2f.js";import{i as n}from"./shared-9803aa7c.js";import"./shared-7448fda4.js";import"./shared-08be5c32.js";import"./shared-e0c93cfa.js";import"./shared-359793d4.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5452fdfe.js";import"./shared-bb9f0d8b.js";import"./shared-3bfbd5af.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";import"./shared-d1cb97c6.js";import"./shared-e8b8c8d0.js";import"./shared-c518ece2.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-935adc3b.js";import"./shared-4e709717.js";import"./shared-2dd497e5.js";import"./shared-51c4a6dd.js";import"./foxy-form-dialog.js";import"./shared-c86db2c0.js";import"./shared-57164953.js";import"./shared-dbe8536b.js";import"./shared-e231722c.js";import"./shared-22ba9566.js";import"./shared-6be8e65e.js";import"./shared-c24bc616.js";import"./shared-b2bc3a0e.js";import"./foxy-swipe-actions.js";import"./shared-838bd79c.js";import"./shared-ad3eea80.js";import"./shared-78bfc71e.js";import"./shared-377e3168.js";import"./shared-f09454f9.js";import"./shared-cacd4407.js";import"./shared-1024aa20.js";import"./shared-3493737e.js";import"./shared-4b52b410.js";import"./shared-651c44fa.js";import"./shared-455856d9.js";import"./shared-317cb721.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-d0e0f8a1.js";import"./shared-b384e653.js";import"./shared-fd1adc35.js";import"./shared-0e83a899.js";import"./shared-fb18400f.js";import"./shared-91321de3.js";import"./shared-3a7db771.js";import"./shared-4b4c8ccf.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./shared-4f852fd5.js";const d=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let c,l,f=e=>e;const m=a(s(e,"gift-card-form"));class p extends m{constructor(){var e;super(...arguments),e=this,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__provisioningMaxBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_max},this.__provisioningMaxBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:i>e?e:i,initial_balance_max:e}})},this.__provisioningMinBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_min},this.__provisioningMinBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:i<e?e:i}})},this.__provisioningToggleValueGetter=()=>{var e;return!!(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)},this.__provisioningToggleValueSetter=e=>{var r,t,i,o;e?this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:0,initial_balance_max:null!==(o=null===(i=this.form.provisioning_config)||void 0===i?void 0:i.initial_balance_max)&&void 0!==o?o:0}}):this.edit({provisioning_config:null})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:r})=>"block"===r?`-${e}`:e)).filter(((e,r,t)=>!!e&&t.indexOf(e)===r)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"current_balance",path:"current_balance",type:i.Number},{label:"end_date",path:"end_date",type:i.Date},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(r){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(r.code),e.__codesActions[0].state="end"}catch(r){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return r(r({},super.properties),{},{getCustomerHref:{attribute:!1}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var r;if(null===(r=e.provisioning_config)||void 0===r?void 0:r.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_min;return!("number"==typeof t&&t<0)||"min-balance:v8n_negative"},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_max;return!("number"==typeof t&&t<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){var e;const r=[super.hiddenSelector.toString()];return this.data||r.push("codes","category-restrictions","attributes"),(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)||r.push("provisioning:sku","provisioning:min-balance","provisioning:max-balance"),new t(r.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return o(c||(c=f` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,r,t,i,a,s,c,m,p,u;let _;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==r?r:"");t.searchParams.set("order","date_created desc"),_=t.toString()}catch(e){_=void 0}return o(l||(l=f` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" layout="summary-item" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" layout="summary-item" infer="expires"> </foxy-internal-frequency-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="provisioning"> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="sku"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="min-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="max-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,d.map((e=>({label:this.t(`general.currency.code_${e}`),value:e}))),this.__provisioningToggleValueGetter,this.__provisioningToggleValueSetter,n(null===(t=this.form.currency_code)||void 0===t?void 0:t.toUpperCase()),this.__provisioningMinBalanceValueGetter,this.__provisioningMinBalanceValueSetter,n(null===(i=this.form.currency_code)||void 0===i?void 0:i.toUpperCase()),this.__provisioningMaxBalanceValueGetter,this.__provisioningMaxBalanceValueSetter,_,{".getCustomerHref":this.getCustomerHref},this.__codesActions,this.__codesFilters,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],n(null===(s=null===(a=this.__storeLoader)||void 0===a?void 0:a.data)||void 0===s?void 0:s._links["fx:item_categories"].href),n(null===(c=this.data)||void 0===c?void 0:c._links["fx:gift_card_item_categories"].href),n(null===(m=this.data)||void 0===m?void 0:m._links.self.href),n(null===(p=this.data)||void 0===p?void 0:p._links["fx:attributes"].href),super.renderBody(),n(null===(u=this.data)||void 0===u?void 0:u._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",p);export{p as GiftCardForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-08be5c32.js";import{h as t,P as e}from"./shared-e0c93cfa.js";import{E as r,T as o}from"./shared-359793d4.js";import{I as a}from"./shared-651c44fa.js";import"./shared-ad3eea80.js";import{L as i}from"./shared-1220bf7d.js";import{I as s}from"./shared-317cb721.js";import{a as n}from"./shared-b2bc3a0e.js";import{a as l}from"./shared-5452fdfe.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-3bfbd5af.js";import"./shared-935adc3b.js";import"./shared-bb9f0d8b.js";import{_ as d}from"./shared-d1195c27.js";import{C as c}from"./shared-d1cb97c6.js";import{R as m,a as h,T as u}from"./shared-6d7c1a2f.js";import{N as f}from"./shared-e8b8c8d0.js";import{c as p,h as b}from"./shared-dc73b9a5.js";import{c as v}from"./shared-4e709717.js";import{i as g}from"./shared-9803aa7c.js";import{r as y}from"./shared-a0c6a159.js";import"./shared-c518ece2.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-17a61265.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-61ade33e.js";const w=t`<dom-module id="lumo-tab" theme-for="vaadin-tab">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -550,5 +550,5 @@ const k=/Apple.* Version\/(9|10)/.test(navigator.userAgent);class $ extends(r(i(
|
|
|
550
550
|
</div>
|
|
551
551
|
|
|
552
552
|
<div on-click="_scrollForward" part="forward-button"></div>
|
|
553
|
-
`}static get is(){return"vaadin-tabs"}static get version(){return"3.2.0"}static get properties(){return{orientation:{value:"horizontal",type:String},selected:{value:0,type:Number}}}static get observers(){return["_updateOverflow(items.*, vertical)"]}ready(){super.ready(),this.addEventListener("iron-resize",(()=>this._updateOverflow())),this._scrollerElement.addEventListener("scroll",(()=>this._updateOverflow())),this.setAttribute("role","tablist"),n(this,(()=>{this._updateOverflow()}))}_scrollForward(){this._scroll(-this.__direction*this._scrollOffset)}_scrollBack(){this._scroll(this.__direction*this._scrollOffset)}get _scrollOffset(){return this._vertical?this._scrollerElement.offsetHeight:this._scrollerElement.offsetWidth}get _scrollerElement(){return this.$.scroll}get __direction(){return this._vertical||"rtl"!==this.getAttribute("dir")?-1:1}_updateOverflow(){const t=this._vertical?this._scrollerElement.scrollTop:this.__getNormalizedScrollLeft(this._scrollerElement);let e=this._vertical?this._scrollerElement.scrollHeight:this._scrollerElement.scrollWidth;e-=1;let r=t>0?"start":"";r+=t+this._scrollOffset<e?" end":"",1==this.__direction&&(r=r.replace(/start|end/gi,(t=>"start"===t?"end":"start"))),r?this.setAttribute("overflow",r.trim()):this.removeAttribute("overflow"),this._repaintShadowNodesHack()}_repaintShadowNodesHack(){if(k&&this.root){const t="-webkit-backface-visibility";this.root.querySelectorAll("*").forEach((e=>{e.style[t]="visible",e.style[t]=""}))}}}customElements.define($.is,$);let j,z,S,O=t=>t;const E=m(h(c(u(f))));customElements.define("foxy-internal-i18n-editor-entry",class extends E{constructor(){super(...arguments),this.defaultValue=null,this.gateway=null,this.code=null}static get properties(){return d(d({},super.properties),{},{defaultValue:{attribute:"default-value"},gateway:{},code:{}})}static get styles(){return[super.styles,p(j||(j=O`:host{--button-height:1.703rem}textarea{-webkit-text-fill-color:var(--lumo-body-text-color)}vaadin-button{height:var(--button-height);--lumo-primary-color-50pct:var(--lumo-success-contrast-color)}.h-bottom-bar{height:calc(var(--button-height) + (var(--lumo-space-xs) * 2))}.h-0{height:0}`))]}render(){var t,e,r;const o=null!==(t=this.form.custom_value)&&void 0!==t?t:this.defaultValue,a=this.in({idle:"snapshot"}),i=this.in({idle:"template"}),s=this.in({idle:{snapshot:"dirty"}}),n=this.in({idle:{template:"dirty"}}),l=s||n,d=!this.in("idle")||this.disabled,c=this.readonly,m=!d&&!c,h=this.in("fail");return
|
|
554
|
-
</textarea> </div> ${0} </div> </label> <div class="${0}"> <vaadin-button theme="primary success small" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="undo_button"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary success small" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="save_button"></foxy-i18n> </vaadin-button> </div> </div> `),
|
|
553
|
+
`}static get is(){return"vaadin-tabs"}static get version(){return"3.2.0"}static get properties(){return{orientation:{value:"horizontal",type:String},selected:{value:0,type:Number}}}static get observers(){return["_updateOverflow(items.*, vertical)"]}ready(){super.ready(),this.addEventListener("iron-resize",(()=>this._updateOverflow())),this._scrollerElement.addEventListener("scroll",(()=>this._updateOverflow())),this.setAttribute("role","tablist"),n(this,(()=>{this._updateOverflow()}))}_scrollForward(){this._scroll(-this.__direction*this._scrollOffset)}_scrollBack(){this._scroll(this.__direction*this._scrollOffset)}get _scrollOffset(){return this._vertical?this._scrollerElement.offsetHeight:this._scrollerElement.offsetWidth}get _scrollerElement(){return this.$.scroll}get __direction(){return this._vertical||"rtl"!==this.getAttribute("dir")?-1:1}_updateOverflow(){const t=this._vertical?this._scrollerElement.scrollTop:this.__getNormalizedScrollLeft(this._scrollerElement);let e=this._vertical?this._scrollerElement.scrollHeight:this._scrollerElement.scrollWidth;e-=1;let r=t>0?"start":"";r+=t+this._scrollOffset<e?" end":"",1==this.__direction&&(r=r.replace(/start|end/gi,(t=>"start"===t?"end":"start"))),r?this.setAttribute("overflow",r.trim()):this.removeAttribute("overflow"),this._repaintShadowNodesHack()}_repaintShadowNodesHack(){if(k&&this.root){const t="-webkit-backface-visibility";this.root.querySelectorAll("*").forEach((e=>{e.style[t]="visible",e.style[t]=""}))}}}customElements.define($.is,$);let j,z,S,O=t=>t;const E=m(h(c(u(f))));customElements.define("foxy-internal-i18n-editor-entry",class extends E{constructor(){super(...arguments),this.defaultValue=null,this.gateway=null,this.code=null}static get properties(){return d(d({},super.properties),{},{defaultValue:{attribute:"default-value"},gateway:{},code:{}})}static get styles(){return[super.styles,p(j||(j=O`:host{--button-height:1.703rem}textarea{-webkit-text-fill-color:var(--lumo-body-text-color)}vaadin-button{height:var(--button-height);--lumo-primary-color-50pct:var(--lumo-success-contrast-color)}.h-bottom-bar{height:calc(var(--button-height) + (var(--lumo-space-xs) * 2))}.h-0{height:0}`))]}render(){var t,e,r;const o=null!==(t=this.form.custom_value)&&void 0!==t?t:this.defaultValue,a=this.in({idle:"snapshot"}),i=this.in({idle:"template"}),s=this.in({idle:{snapshot:"dirty"}}),n=this.in({idle:{template:"dirty"}}),l=s||n,d=!this.in("idle")||this.disabled,c=this.readonly,m=!d&&!c,h=this.in("fail");return b(z||(z=O` <div class="${0}"> <label class="group flex flex-col sm-flex-row"> <div class="flex-1 p-xs break-all" style="max-width:20rem"> <span class="inline-block rounded text-s p-xs font-medium"> ${0} </span> </div> <div class="flex-1 flex"> <div class="relative flex-1"> <div class="opacity-0 text-s p-s font-medium break-all"> <span class="whitespace-pre-wrap">${0}​</span> </div> <textarea class="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}">
|
|
554
|
+
</textarea> </div> ${0} </div> </label> <div class="${0}"> <vaadin-button theme="primary success small" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="undo_button"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary success small" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="save_button"></foxy-i18n> </vaadin-button> </div> </div> `),v({"transition-all rounded ring-1 leading-s text-secondary":!0,"ring-contrast-10":!h&&(!l||c),"ring-success":!h&&l&&!c,"ring-error":h,"opacity-75":d,"hover-ring-contrast-20":!h&&!l&&m,"hover-text-body":!h&&m}),null!==(r=null===(e=this.data)||void 0===e?void 0:e.code)&&void 0!==r?r:this.code,o,v({"absolute inset-0 p-s resize-none":!0,"sm-border-l sm-border-transparent":!0,"break-all text-body transition-colors text-s font-medium":!0,"rounded-b sm-rounded-bl-none sm-rounded-tr":i&&!l,"rounded-bl sm-rounded-bl-none":a&&!l,"sm-rounded-tr":i&&l,"sm-border-contrast-10":c,"bg-contrast-10":!c,"group-hover-bg-contrast-20":m,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0}),o,d,c,(t=>{const e=t.currentTarget;this.gateway&&this.edit({gateway:this.gateway}),this.code&&this.edit({code:this.code}),this.edit({custom_value:e.value})}),a?b(S||(S=O` <button class="${0}" title="${0}" theme="contrast icon" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline text-xl" icon="icons:restore"></iron-icon> </button> `),v({"flex-shrink-0 w-m flex items-center justify-center":!0,"transition-colors text-tertiary ring-inset":!0,"rounded-br sm-rounded-tr":!l,"sm-rounded-tr":l,"bg-contrast-10":!c,"cursor-default":!m,"cursor-pointer":m,"group-hover-bg-contrast-20 hover-text-body":m,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0}),this.t("delete_button_title"),d||c,(()=>this.delete())):"",v({"transition-all bg-success rounded-b overflow-hidden":!0,"flex items-center justify-end gap-xs px-xs":!0,"h-bottom-bar":l&&!c,"h-0":!l||c}),!m,(()=>this.undo()),!m,(()=>this.submit()))}});let T,L,A,C,I,q,W=t=>t;const H=h(c(u(f)),"i18n-editor");class N extends H{constructor(){super(...arguments),this.languageOverrides=null,this.selectedLanguage=null,this.__selectedTabIndex=0}static get properties(){return d(d({},super.properties),{},{languageOverrides:{attribute:"language-overrides"},selectedLanguage:{attribute:"selected-language"},__selectedTabIndex:{attribute:!1}})}render(){var t,e,r;const o=this.__tabs,a=o[this.__selectedTabIndex],i=null!==(r=null===(t=this.data)||void 0===t?void 0:t.values[null!==(e=this.selectedLanguage)&&void 0!==e?e:""])&&void 0!==r?r:{},s={},n=!this.in({idle:"snapshot"});if(a)if(a.includes("_")){const t=a.substring(0,a.indexOf("_")),e=a.substring(a.indexOf("_")+1),r=i[t][e];for(const o in r)s[`${t}_${e}_${o}`]=r[o]}else for(const t in i)t.startsWith(a)&&(s[t]=i[t]);const l=this.__renderOverridesLoader(),d=l.overrides;return b(T||(T=W` ${0} <div aria-busy="${0}" aria-live="polite" class="relative"> <div class="${0}"> <vaadin-tabs selected="${0}" class="-mx-l" theme="minimal" @selected-changed="${0}"> ${0} </vaadin-tabs> ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="${0}" class="m-auto" state="${0}" infer="spinner"> </foxy-spinner> </div> </div> `),l.template,this.in("busy"),v({"transition-opacity grid grid-cols-1 gap-s":!0,"opacity-0 pointer-events-none":n}),this.__selectedTabIndex,(t=>{var e;const r=t.currentTarget;this.__selectedTabIndex=null!==(e=r.selected)&&void 0!==e?e:0}),o.map((t=>{const e=t.substring(t.indexOf("_")+1).replace(/_/g," "),r=b(L||(L=W`<span class="capitalize">${0}</span>`),e);return b(A||(A=W`<vaadin-tab>${0}</vaadin-tab>`),r)})),y(Object.entries(s),(([t])=>t),(([t,e])=>{var r;let o,i,s;return t.startsWith("gateways_")?(o=t.substring(a.length+1),i=a.substring(9),s=d.find((t=>t.code===o&&t.gateway===i))):(o=t,i=void 0,s=d.find((t=>t.code===o))),b(C||(C=W` <foxy-internal-i18n-editor-entry default-value="${0}" gateway="${0}" parent="${0}" code="${0}" infer="" .data="${0}"> </foxy-internal-i18n-editor-entry> `),e,g(i),g(null!==(r=this.languageOverrides)&&void 0!==r?r:void 0),o,null!=s?s:null)})),v({"transition-opacity absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!n}),this.in("busy")?"no-label":"horizontal",this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy")}get __tabs(){var t;const e=this.selectedLanguage?null===(t=this.data)||void 0===t?void 0:t.values[this.selectedLanguage]:void 0,r=Object.entries(null!=e?e:{}).reduce(((t,[e,r])=>{if("string"==typeof r){const r=e.substring(0,e.indexOf("_"));t.add(r||e)}else Object.entries(r).forEach((([r,o])=>{0!==Object.keys(o).length&&t.add(`${e}_${r}`)}));return t}),new Set);return Array.from(r)}__renderOverridesLoader(){var t;const e=Array.from(this.renderRoot.querySelectorAll("foxy-nucleon")),r=e.reduce(((t,e)=>{var r,o;return[...t,...null!==(o=null===(r=e.data)||void 0===r?void 0:r._embedded["fx:language_overrides"])&&void 0!==o?o:[]]}),[]),o=e[0],a=new Array(Math.ceil(((null===(t=null==o?void 0:o.data)||void 0===t?void 0:t.total_items)||300)/300)).fill(0).map(((t,e)=>{var r;try{const t=new URL(null!==(r=this.languageOverrides)&&void 0!==r?r:"");return t.searchParams.set("offset",String(300*e)),t.searchParams.set("limit","300"),b(I||(I=W` <foxy-nucleon infer="" href="${0}" @update="${0}"> </foxy-nucleon> `),t.toString(),(()=>this.requestUpdate()))}catch(t){return}}));return{template:b(q||(q=W`<div class="hidden">${0}</div>`),a),overrides:r,loaders:e}}}customElements.define("foxy-i18n-editor",N);export{N as I18nEditor};
|
package/dist/cdn/foxy-i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{I as I18n}from"./shared-
|
|
1
|
+
export{I as I18n}from"./shared-3bfbd5af.js";import"./shared-d1195c27.js";import"./shared-dc73b9a5.js";import"./shared-6d7c1a2f.js";import"./shared-343d1fd7.js";import"./shared-17a61265.js";
|