@foxy.io/elements 1.15.0-beta.6 → 1.15.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-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-cancellation-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-coupon-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-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.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +13 -13
- package/dist/cdn/foxy-customer.js +2 -2
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-donation.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-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-form.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.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-pagination.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-query-builder.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +3 -3
- 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-transaction-card.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-5272c758.js → shared-00d6a968.js} +1 -1
- package/dist/cdn/{shared-25e67340.js → shared-023a97c2.js} +8 -8
- package/dist/cdn/{shared-02945b27.js → shared-027c537d.js} +1 -1
- package/dist/cdn/{shared-f0a83bd6.js → shared-073cb8e9.js} +1 -1
- package/dist/cdn/{shared-4dc6d228.js → shared-09c5f9f1.js} +1 -1
- package/dist/cdn/{shared-94b0ae99.js → shared-0f38a631.js} +2 -2
- package/dist/cdn/{shared-200f613b.js → shared-1a67bc75.js} +2 -2
- package/dist/cdn/{shared-06e64d75.js → shared-340f7584.js} +3 -3
- package/dist/cdn/{shared-66633ff7.js → shared-3f0a9c2c.js} +1 -1
- package/dist/cdn/{shared-09069d7c.js → shared-3f965dce.js} +1 -1
- package/dist/cdn/{shared-0ced76a0.js → shared-5a54a9bc.js} +1 -1
- package/dist/cdn/{shared-40b5267a.js → shared-5e2fd1c7.js} +1 -1
- package/dist/cdn/{shared-a7095b6a.js → shared-60d43523.js} +1 -1
- package/dist/cdn/{shared-08c63028.js → shared-625c1272.js} +1 -1
- package/dist/cdn/{shared-36629ded.js → shared-65dfd512.js} +3 -3
- package/dist/cdn/shared-84d2d490.js +1 -0
- package/dist/cdn/{shared-df573cea.js → shared-8b20bc23.js} +0 -0
- package/dist/cdn/{shared-3be96355.js → shared-8c8a910c.js} +1 -1
- package/dist/cdn/{shared-b9f18aaa.js → shared-9cd49a3e.js} +4 -4
- package/dist/cdn/{shared-20b9ce70.js → shared-9fc4a896.js} +5 -5
- package/dist/cdn/{shared-bb824ab4.js → shared-a040d79d.js} +2 -2
- package/dist/cdn/{shared-e209cb55.js → shared-ab71552b.js} +1 -1
- package/dist/cdn/{shared-e68b9c83.js → shared-ae8cd227.js} +1 -1
- package/dist/cdn/{shared-07049bfe.js → shared-ba39823e.js} +1 -1
- package/dist/cdn/{shared-ffb27563.js → shared-d58c947c.js} +3 -3
- package/dist/cdn/{shared-a23cf7c8.js → shared-e55088b4.js} +1 -1
- package/dist/cdn/{shared-940a4826.js → shared-ecfd3539.js} +1 -1
- package/dist/cdn/shared-f2a69797.js +1 -0
- package/dist/cdn/{shared-16f72e27.js → shared-f4ad24f4.js} +1 -1
- package/dist/cdn/{shared-ec861f31.js → shared-fab8c705.js} +3 -3
- package/dist/cdn/translations/access-recovery-form/en.json +12 -0
- package/dist/cdn/translations/address-card/en.json +11 -0
- package/dist/cdn/translations/address-form/en.json +27 -0
- package/dist/cdn/translations/applied-tax-card/en.json +9 -0
- package/dist/cdn/translations/attribute-card/en.json +7 -0
- package/dist/cdn/translations/attribute-form/en.json +22 -0
- package/dist/cdn/translations/cancellation-form/en.json +10 -0
- package/dist/cdn/translations/country/pl.json +251 -0
- package/dist/cdn/translations/coupon-card/en.json +36 -0
- package/dist/cdn/translations/coupon-code-form/en.json +17 -0
- package/dist/cdn/translations/coupon-codes-form/en.json +20 -0
- package/dist/cdn/translations/coupon-form/en.json +186 -0
- package/dist/cdn/translations/custom-field-card/en.json +7 -0
- package/dist/cdn/translations/custom-field-form/en.json +19 -0
- package/dist/cdn/translations/customer/en.json +247 -0
- package/dist/cdn/translations/customer-card/en.json +7 -0
- package/dist/cdn/translations/customer-form/en.json +21 -0
- package/dist/cdn/translations/customer-portal/de.json +202 -14
- package/dist/cdn/translations/customer-portal/en.json +202 -14
- package/dist/cdn/translations/customer-portal/es.json +202 -14
- package/dist/cdn/translations/customer-portal/pl.json +223 -0
- package/dist/cdn/translations/customer-portal/zh-hk.json +202 -14
- package/dist/cdn/translations/customers-table/en.json +9 -0
- package/dist/cdn/translations/discount-card/en.json +8 -0
- package/dist/cdn/translations/email-template-form/en.json +25 -0
- package/dist/cdn/translations/error-entry-card/en.json +7 -0
- package/dist/cdn/translations/generate-codes-form/en.json +19 -0
- package/dist/cdn/translations/gift-card-card/en.json +9 -0
- package/dist/cdn/translations/gift-card-code-form/en.json +19 -0
- package/dist/cdn/translations/gift-card-codes-form/en.json +25 -0
- package/dist/cdn/translations/gift-card-form/en.json +314 -0
- package/dist/cdn/translations/pagination/en.json +7 -0
- package/dist/cdn/translations/payment-card/en.json +12 -0
- package/dist/cdn/translations/payment-method-card/en.json +13 -0
- package/dist/cdn/translations/query-builder/en.json +32 -0
- package/dist/cdn/translations/sign-in-form/en.json +21 -0
- package/dist/cdn/translations/spinner/en.json +7 -0
- package/dist/cdn/translations/subscription-card/en.json +26 -0
- package/dist/cdn/translations/subscription-form/en.json +76 -0
- package/dist/cdn/translations/subscriptions-table/en.json +26 -0
- package/dist/cdn/translations/tax-card/en.json +11 -0
- package/dist/cdn/translations/tax-form/en.json +38 -0
- package/dist/cdn/translations/template-config-form/en.json +107 -0
- package/dist/cdn/translations/template-form/en.json +23 -0
- package/dist/cdn/translations/transaction-card/en.json +25 -0
- package/dist/cdn/translations/transactions-table/en.json +22 -0
- package/dist/cdn/translations/user-form/en.json +26 -0
- package/dist/cdn/translations/users-table/en.json +44 -0
- package/dist/elements/private/Choice/Choice.js +1 -0
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +5 -5
- package/dist/elements/private/FrequencyInput/FrequencyInput.js +7 -22
- package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
- package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js +1 -1
- package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js.map +1 -1
- package/dist/elements/public/AttributeCard/types.d.ts +3 -3
- package/dist/elements/public/AttributeCard/types.js.map +1 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js +2 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
- package/dist/elements/public/AttributeForm/types.d.ts +3 -3
- package/dist/elements/public/AttributeForm/types.js.map +1 -1
- package/dist/elements/public/CouponCard/CouponCard.js +2 -1
- package/dist/elements/public/CouponCard/CouponCard.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +7 -7
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +6 -3
- package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +199 -164
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +4 -3
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +5 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -1
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +3 -4
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +3 -2
- package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +2 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/Customer/Customer.js +1 -1
- package/dist/elements/public/Customer/Customer.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +6 -2
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +20 -6
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +93 -73
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +7 -7
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +8 -3
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +103 -85
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.d.ts +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js +3 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.d.ts +1 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js +2 -4
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js.map +1 -1
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.d.ts +1 -3
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js +2 -2
- package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
- package/dist/elements/public/I18n/format/discount.js +2 -2
- package/dist/elements/public/I18n/format/discount.js.map +1 -1
- package/dist/elements/public/Pagination/Pagination.js +4 -0
- package/dist/elements/public/Pagination/Pagination.js.map +1 -1
- package/dist/elements/public/SignInForm/SignInForm.js +1 -1
- package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +16 -14
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js +1 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
- package/dist/elements/public/UserForm/UserForm.js +2 -1
- package/dist/elements/public/UserForm/UserForm.js.map +1 -1
- package/dist/elements/public/UsersTable/UsersTable.d.ts +5 -1
- package/dist/elements/public/UsersTable/UsersTable.js +2 -1
- package/dist/elements/public/UsersTable/UsersTable.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/dist/mixins/translatable.js +1 -1
- package/dist/mixins/translatable.js.map +1 -1
- package/package.json +3 -3
- package/dist/cdn/shared-11708514.js +0 -1
- package/dist/cdn/shared-805d18a2.js +0 -1
- package/dist/cdn/translations/shared/de.json +0 -271
- package/dist/cdn/translations/shared/en.json +0 -557
- package/dist/cdn/translations/shared/es.json +0 -272
- package/dist/cdn/translations/shared/zh-hk.json +0 -179
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-bb824ab4.js";import{C as e,b as t}from"./shared-25e67340.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./shared-11708514.js";import{_ as s,h as i}from"./shared-63eaded9.js";import{l as n}from"./shared-218ba06e.js";import{C as o}from"./shared-40b5267a.js";import{C as a}from"./shared-df730f90.js";import{N as r}from"./shared-39e3ae67.js";import{T as l,a as d,S as c,R as u}from"./shared-e68b9c83.js";import{c as h}from"./shared-4e709717.js";import{i as p}from"./shared-6d45a07b.js";import{G as g}from"./shared-02945b27.js";import{l as f}from"./shared-07134f93.js";import"./shared-ff79f3f9.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import"./shared-36629ded.js";import"./shared-ec861f31.js";import"./shared-5535f38f.js";import"./shared-b0f0e8b5.js";import"./shared-756034e4.js";import"./shared-7f0a9790.js";import"./shared-7684cb05.js";let _,y,x,b,m,$=e=>e;const v=a(l(d(r)));class k extends v{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return s(s({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return i(_||(_=$` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),h({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?i(y||(y=$`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),h({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const n=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return i(x||(x=$` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n||e,n?i(b||(b=$`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),h({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),h({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),h({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(m||(m=$`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let w,S,j,O=e=>e;const T=c(a(l(d(r))));class q extends T{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":k,"iron-icon":customElements.get("iron-icon")}}static get properties(){return s(s({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var e,t;return i(w||(w=O` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([e,t])=>{var n,o;let a;try{const t=new URL(this.regions);t.searchParams.set("country_code",e),a=t.toString()}catch(e){a=""}return i(S||(S=O` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===t?[]:t),e,p(null===(o=null===(n=this.data)||void 0===n?void 0:n.values[e])||void 0===o?void 0:o.default),a,this.lang,this.ns,this.disabled,this.readonly,(t=>{const i=s({},this.countries),n=t.currentTarget.regions;i[e]=n.length?n:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const t=s({},this.countries);delete t[e],this.countries=t,this.dispatchEvent(new CustomEvent("update:countries"))}))})),h({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),h({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>i(j||(j=O`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=s(s({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let C,N,J,E,F,R,H,I,V,z,A,D,G,L,M,P,U,W,Y,B,K,Q,X,Z,ee,te,se,ie=e=>e;const ne=c(u(a(l(d(r,"template-config-form")))));class oe extends ne{constructor(){super(...arguments),this.templates={},this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":q,"x-checkbox":o,"x-choice":e,"x-group":g}}static get properties(){return s(s({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,n=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},segment_io:{usage:"none",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return i(C||(C=ie` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> <div 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> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(n),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(n),s.matches("locations",!0)?"":this.__renderLocations(n),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(n),s.matches("cards",!0)?"":this.__renderCards(n),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(n),s.matches("consent",!0)?"":this.__renderConsent(n),s.matches("fields",!0)?"":this.__renderFields(n),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(n),s.matches("segment-io",!0)?"":this.__renderSegmentIo(n),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(n),s.matches("custom-config",!0)?"":this.__renderCustomConfig(n),s.matches("header",!0)?"":this.__renderHeader(n),s.matches("custom-fields",!0)?"":this.__renderCustomFields(n),s.matches("footer",!0)?"":this.__renderFooter(n),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(e){const{lang:t,ns:n}=this,o=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return i(N||(N=ie` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",t,n,e.cart_type,o,a,this.readonlySelector.matches("cart-type",!0),(t=>{this.edit({json:JSON.stringify(s(s({},e),{},{cart_type:t.detail}))})}),o.map((e=>i(J||(J=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,n,a?"text-disabled":"text-secondary",t,e,n))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:s,ns:n}=this,o=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,l=["combobox","search","disabled"],d="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=i(E||(E=ie` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),o,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),s,n);return i(F||(F=ie` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),o?"text-disabled":"",s,n,d,l,o,a,(s=>{s instanceof t&&(r.usage="disabled"===s.detail?"none":"required",r.show_combobox="combobox"===s.detail,this.edit({json:JSON.stringify(e)}))}),l.map((e=>i(R||(R=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,n,o?"text-disabled":"text-secondary",s,e,n))),"combobox"!==d,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return i(H||(H=ie` <vaadin-text-field data-testid="foxycomplete-${0}-icon" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],o,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==d,c,o,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),s,n,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,n=e.location_filtering,o=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===n.shipping_filter_type?"block":"allow",l="both"===n.usage?"copy":"blacklist"===n.billing_filter_type?"block":"allow",d=()=>{if("both"===n.usage)n.billing_filter_type=n.shipping_filter_type,n.billing_filter_values=n.shipping_filter_values;else{const e=Object.keys(n.billing_filter_values).length>0,t=Object.keys(n.shipping_filter_values).length>0;n.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return i(I||(I=ie` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),o?"text-disabled":"",t,s,o?"text-disabled":"text-tertiary",t,s,["allow","block"],r,o,a,(t=>{"both"!==n.usage&&(n.usage="independent"),n.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(n.shipping_filter_values),this.regions,this.countries,r,t,s,o,a,(t=>{n.shipping_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),o?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],l,o,a,(t=>{"copy"===t.detail?n.usage="both":(n.usage="independent",n.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),d(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(n.billing_filter_values),this.regions,this.countries,l,t,s,o,a,"copy"===l,(t=>{n.billing_filter_values=t.currentTarget.countries,d(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,n=[],o=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),l=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);n.push(t),"required"!==a.usage||a[e]||o.push(t)}"required"===a.usage&&o.push(...a.hidden_product_options);const d=()=>{a.usage="required",n.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===o.length?[c]:["0","0",c,c],p=r||!this.__addHiddenFieldInputValue;return i(V||(V=ie` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,o.map((o=>i(z||(z=ie` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),h({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":l,"text-disabled":r}),n.includes(o)?i(A||(A=ie`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):i(D||(D=ie`<span>${0}</span>`),o),this.t("delete"),h({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!l,hidden:l}),r,(()=>{"boolean"==typeof a[`show_${o}`]?a[`show_${o}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),h({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0,flex:!l,hidden:l}),this.t("add_field"),f(this.__addHiddenFieldInputValue),r,l,(e=>"Enter"===e.key&&d()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),n.filter((e=>!o.includes(e))).map((e=>i(G||(G=ie`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),h({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":p,"bg-success-10 text-success cursor-pointer":!p,"hover-bg-success hover-text-success-contrast":!p,"focus-outline-none focus-ring-2":!p}),p,d,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:s}=this,o=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let l,d;"all_cards"===e.csc_requirements?(l=!1,d=!1):"sso_only"===e.csc_requirements?(l=!0,d=!1):(l=!0,d=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(L||(L=ie` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),o?"text-disabled":"",t,s,Object.entries(n).map((([t,s])=>{if(!c[t])return;const n=r.includes(t);return i(M||(M=ie` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),h({"m-xs rounded":!0,"opacity-50 cursor-default":o,"cursor-pointer ring-primary-50 focus-within-ring-2":!o}),h({"overflow-hidden transition-colors flex rounded border":!0,"border-primary bg-primary-10 text-primary":n&&!a,"border-contrast bg-contrast-5 text-secondary":n&&a,"hover-text-body":n&&!o&&!a,"border-contrast-10":!n,"hover-border-primary":!n&&!o&&!a,"hover-text-primary":!n&&!o&&!a}),s,c[t],o,a,n,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),o||"new_cards_only"===e.csc_requirements,a,l,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,o,a,d,(t=>{e.csc_requirements=t.detail?"new_cards_only":l?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),o=this.readonlySelector.matches("checkout-type",!0);return i(P||(P=ie` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),n?"text-disabled":"",t,s,n,o,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),n?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,n=e.tos_checkbox_settings,o=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),l=this.readonlySelector.matches("consent",!0),d="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return i(U||(U=ie` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,l,"required"===n.usage||"optional"===n.usage,(t=>{n.initial_state=t.detail?n.initial_state:"unchecked",n.is_hidden=!1,n.usage=t.detail?"required":"none",n.url=t.detail?n.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===n.usage,this.t("location_url"),r,l,n.url,(t=>{n.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,l,"required"===n.usage,(t=>{n.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,l,"checked"===n.initial_state,(t=>{n.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,d,r,l,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,d,r,l,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("fields",!0),o=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return i(W||(W=ie` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 md-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden md-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),n?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,l])=>i(Y||(Y=ie` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),h({"flex items-center pl-m bg-base":!0,"text-secondary":o,"text-disabled":n}),t,r.replace("billing_",""),s,h({"flex items-center text-right font-medium h-s px-s m-xs":o,hidden:!o}),this.t(l.find((e=>a[r]===e))),h({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!n,"hover-text-primary":!n,"cursor-pointer":!n,"cursor-default":n,flex:!o,hidden:o}),r,h({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!n,"cursor-default":n}),n,o,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),l.map((e=>i(B||(B=ie` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,n=e.analytics_config,o=n.segment_io,a=n.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),l=this.readonlySelector.matches("google-analytics",!0);return i(K||(K=ie` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),f(a.account_id),r,l,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",n.usage=a.account_id||o.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,l,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderSegmentIo(e){const t=e.analytics_config,s=t.segment_io,n=t.google_analytics,o=!this.in("idle")||this.disabledSelector.matches("segment-io",!0),a=this.readonlySelector.matches("segment-io",!0);return i(Q||(Q=ie` <div data-testid="segment-io"> ${0} <x-group frame> <span class="${0}" slot="header">Segment.io</span> <div class="p-m"> <vaadin-text-field data-testid="segment-io-field" class="w-full" label="${0}" placeholder="MY-WRITE-KEY" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("segment-io:before"),o?"text-disabled":"",this.t("sio_account_id"),this.t("sio_account_id_explainer"),f(s.account_id),o,a,(e=>"Enter"===e.key&&this.submit()),(i=>{s.account_id=i.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=n.account_id||s.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("segment-io:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,n=e.debug,o=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return i(X||(X=ie` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),o?"text-disabled":"",t,s,o,a,"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}__renderCustomConfig(e){return i(Z||(Z=ie` <div data-testid="custom-config"> ${0} <vaadin-text-area data-testid="custom-config-field" class="w-full" label="${0}" placeholder='{ "key": "value" }' helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-config:before"),this.t("custom_config"),this.t("custom_config_helper_text"),e.custom_config?JSON.stringify(e.custom_config,null,2):"",!this.in("idle")||this.disabledSelector.matches("custom-config",!0),this.readonlySelector.matches("custom-config",!0),(t=>{const s=t.currentTarget;try{e.custom_config=s.value?JSON.parse(s.value):"",this.edit({json:JSON.stringify(e)}),s.invalid=!1}catch(e){s.invalid=!0}}),this.renderTemplateOrSlot("custom-config:after"))}__renderHeader(e){return i(ee||(ee=ie` <div data-testid="header"> ${0} <vaadin-text-area data-testid="header-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),e.custom_script_values.header,!this.in("idle")||this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("header:after"))}__renderCustomFields(e){return i(te||(te=ie` <div data-testid="custom-fields"> ${0} <vaadin-text-area data-testid="custom-fields-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-fields:before"),this.t("custom_fields"),this.t("custom_fields_helper_text"),e.custom_script_values.checkout_fields,!this.in("idle")||this.disabledSelector.matches("custom-fields",!0),this.readonlySelector.matches("custom-fields",!0),(t=>{const s=t.currentTarget.value;e.custom_script_values.checkout_fields=s,this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("custom-fields:after"))}__renderFooter(e){return i(se||(se=ie` <div data-testid="footer"> ${0} <vaadin-text-area data-testid="footer-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),e.custom_script_values.footer,!this.in("idle")||this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",oe);export{oe as TemplateConfigForm};
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-a040d79d.js";import{C as e,b as t}from"./shared-023a97c2.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";import{_ as s,h as i}from"./shared-63eaded9.js";import{l as n}from"./shared-218ba06e.js";import{C as o}from"./shared-5e2fd1c7.js";import{C as a}from"./shared-df730f90.js";import{N as r}from"./shared-39e3ae67.js";import{T as d,a as l,S as c,R as u}from"./shared-ae8cd227.js";import{c as h}from"./shared-4e709717.js";import{i as p}from"./shared-6d45a07b.js";import{G as g}from"./shared-027c537d.js";import{l as f}from"./shared-07134f93.js";import"./shared-ff79f3f9.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import"./shared-65dfd512.js";import"./shared-fab8c705.js";import"./shared-5535f38f.js";import"./shared-b0f0e8b5.js";import"./shared-756034e4.js";import"./shared-7f0a9790.js";import"./shared-7684cb05.js";let _,y,x,b,m,$=e=>e;const v=a(d(l(r)));class k extends v{constructor(){super(...arguments),this.regions=[],this.name="",this.code="",this.__newRegion=""}static get properties(){return s(s({},super.properties),{},{__newRegion:{attribute:!1},regions:{type:Array},name:{type:String},code:{type:String}})}render(){var e,t;return i(_||(_=$` <div class="${0}"> <div data-testid="country" class="h-m flex justify-between items-center border-b border-contrast-10"> <div class="ml-m"> <span>${0}</span> ${0} </div> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> <div data-testid="regions" class="flex flex-wrap p-xs"> ${0} <div data-testid="new-region" style="border-radius:var(--lumo-size-s)" class="${0}"> <input placeholder="${0}" class="bg-transparent appearance-none h-s text-s px-s focus-outline-none" style="width:8rem" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> <datalist id="list"> ${0} </datalist> </div> </div> `),h({"border border-contrast-10 rounded text-s":!0,"text-disabled":this.disabled}),this.name||this.code,this.name?i(y||(y=$`<span class="text-secondary">${0}</span>`),this.code):"",this.t("delete"),h({"mr-xs items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>this.dispatchEvent(new CustomEvent("delete"))),this.regions.map((e=>{var t,s;const n=null===(s=null===(t=this.data)||void 0===t?void 0:t.values[e])||void 0===s?void 0:s.default;return i(x||(x=$` <div class="flex items-center border border-contrast-10 h-s m-xs" style="border-radius:var(--lumo-size-s)"> <span class="mx-s"> <span>${0}</span> ${0} </span> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m"></iron-icon> </button> </div> `),n||e,n?i(b||(b=$`<span class="text-secondary">${0}</span>`),e):"",this.t("delete"),h({"items-center justify-center rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!this.disabled,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!this.disabled,"cursor-default":this.disabled,flex:!this.readonly,hidden:this.readonly}),this.disabled,(()=>{this.regions=this.regions.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("update:regions"))}))})),h({"h-s m-xs items-center transition-colors border border-contrast-10":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 ring-primary-50 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_region"),this.__newRegion,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newRegion&&this.__addRegion()}),(e=>{const t=e.currentTarget;this.__newRegion=t.value}),h({"flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newRegion,"bg-success-10 text-success cursor-pointer":!!this.__newRegion,"hover-bg-success hover-text-success-contrast":!!this.__newRegion,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newRegion}),this.disabled||!this.__newRegion,this.__addRegion,Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((e=>i(m||(m=$`<option value="${0}">${0}</option>`),e.code,e.default))))}__addRegion(){this.regions=[...new Set([...this.regions,this.__newRegion])],this.__newRegion="",this.dispatchEvent(new CustomEvent("update:regions"))}}let w,S,j,O=e=>e;const T=c(a(d(l(r))));class q extends T{constructor(){super(...arguments),this.countries={},this.regions="",this.__newCountry=""}static get scopedElements(){return{"x-country-card":k,"iron-icon":customElements.get("iron-icon")}}static get properties(){return s(s({},super.properties),{},{__newCountry:{attribute:!1},countries:{type:Object},regions:{type:String}})}render(){var e,t;return i(w||(w=O` <div> <div class="space-y-s" data-testid="countries"> ${0} <div data-testid="new-country" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m text-s px-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <button aria-label="${0}" class="${0}" style="width:calc(var(--lumo-size-s) - 2px);height:calc(var(--lumo-size-s) - 2px)" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </div> <datalist id="list"> ${0} </datalist> </div> `),Object.entries(this.countries).map((([e,t])=>{var n,o;let a;try{const t=new URL(this.regions);t.searchParams.set("country_code",e),a=t.toString()}catch(e){a=""}return i(S||(S=O` <x-country-card regions="${0}" code="${0}" name="${0}" href="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:regions="${0}" @delete="${0}"> </x-country-card> `),JSON.stringify("*"===t?[]:t),e,p(null===(o=null===(n=this.data)||void 0===n?void 0:n.values[e])||void 0===o?void 0:o.default),a,this.lang,this.ns,this.disabled,this.readonly,(t=>{const i=s({},this.countries),n=t.currentTarget.regions;i[e]=n.length?n:"*",this.countries=i,this.dispatchEvent(new CustomEvent("update:countries"))}),(()=>{const t=s({},this.countries);delete t[e],this.countries=t,this.dispatchEvent(new CustomEvent("update:countries"))}))})),h({"h-m flex items-center rounded transition-colors":!0,"border border-contrast-10 ring-primary-50":!0,"hover-border-contrast-40":!this.disabled,"focus-within-ring-1 focus-within-border-primary-50":!this.disabled,flex:!this.readonly,hidden:this.readonly}),this.t("add_country"),this.__newCountry,this.disabled,this.readonly,(e=>{"Enter"===e.key&&this.__newCountry&&this.__addCountry()}),(e=>{const t=e.currentTarget;this.__newCountry=t.value}),this.t("create"),h({"mr-xs flex-shrink-0":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":!this.__newCountry,"bg-success-10 text-success cursor-pointer":!!this.__newCountry,"hover-bg-success hover-text-success-contrast":!!this.__newCountry,"focus-outline-none focus-ring-2 ring-inset ring-success-50":!!this.__newCountry}),!this.__newCountry||this.disabled,this.__addCountry,Object.entries(null!==(t=null===(e=this.data)||void 0===e?void 0:e.values)&&void 0!==t?t:{}).map((([e,t])=>i(j||(j=O`<option value="${0}">${0}</option>`),e,t.default))))}__addCountry(){this.countries=s(s({},this.countries),{},{[this.__newCountry]:"*"}),this.__newCountry="",this.dispatchEvent(new CustomEvent("update:countries"))}}let C,N,J,E,F,R,H,I,V,z,A,D,G,L,M,P,U,W,Y,B,K,Q,X,Z,ee,te,se,ie=e=>e;const ne=c(u(a(d(l(r,"template-config-form")))));class oe extends ne{constructor(){super(...arguments),this.templates={},this.countries="",this.regions="",this.__addHiddenFieldInputValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-countries-list":q,"x-checkbox":o,"x-choice":e,"x-group":g}}static get properties(){return s(s({},super.properties),{},{__addHiddenFieldInputValue:{attribute:!1},countries:{type:String},regions:{type:String}})}render(){var e,t;const s=this.hiddenSelector,n=this.form.json?JSON.parse(this.form.json):{cart_type:"default",checkout_type:"default_account",csc_requirements:"all_cards",tos_checkbox_settings:{usage:"none",initial_state:"unchecked",is_hidden:!1,url:""},eu_secure_data_transfer_consent:{usage:"required"},newsletter_subscribe:{usage:"none"},analytics_config:{usage:"none",google_analytics:{usage:"none",account_id:"",include_on_site:!1},segment_io:{usage:"none",account_id:""}},colors:{usage:"none",primary:"4D4D4D",secondary:"FFFFFF",tertiary:"FFFFFF"},use_checkout_confirmation_window:{usage:"none"},supported_payment_cards:["visa","mastercard","discover","amex"],custom_checkout_field_requirements:{cart_controls:"enabled",coupon_entry:"enabled",billing_first_name:"required",billing_last_name:"required",billing_company:"optional",billing_tax_id:"hidden",billing_phone:"optional",billing_address1:"required",billing_address2:"optional",billing_city:"required",billing_region:"default",billing_postal_code:"required",billing_country:"required"},cart_display_config:{usage:"none",show_product_weight:!0,show_product_category:!0,show_product_code:!0,show_product_options:!0,show_sub_frequency:!0,show_sub_startdate:!0,show_sub_nextdate:!0,show_sub_enddate:!0,hidden_product_options:[]},foxycomplete:{usage:"required",show_combobox:!0,combobox_open:"\\u25bc",combobox_close:"\\u25b2",show_flags:!0},custom_script_values:{header:"",footer:"",checkout_fields:"",multiship_checkout_fields:""},http_receipt:!1,custom_config:"",debug:{usage:"none"},location_filtering:{usage:"none",shipping_filter_type:"blacklist",billing_filter_type:"blacklist",shipping_filter_values:{},billing_filter_values:{}},postal_code_lookup:{usage:"enabled"}};return i(C||(C=ie` <div class="relative" aria-busy="${0}" aria-live="polite"> <div class="space-y-l"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> <div 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> `),this.in("busy"),s.matches("cart-type",!0)?"":this.__renderCartType(n),s.matches("foxycomplete",!0)?"":this.__renderFoxycomplete(n),s.matches("locations",!0)?"":this.__renderLocations(n),s.matches("hidden-fields",!0)?"":this.__renderHiddenFields(n),s.matches("cards",!0)?"":this.__renderCards(n),s.matches("checkout-type",!0)?"":this.__renderCheckoutType(n),s.matches("consent",!0)?"":this.__renderConsent(n),s.matches("fields",!0)?"":this.__renderFields(n),s.matches("google-analytics",!0)?"":this.__renderGoogleAnalytics(n),s.matches("segment-io",!0)?"":this.__renderSegmentIo(n),s.matches("troubleshooting",!0)?"":this.__renderTroubleshooting(n),s.matches("custom-config",!0)?"":this.__renderCustomConfig(n),s.matches("header",!0)?"":this.__renderHeader(n),s.matches("custom-fields",!0)?"":this.__renderCustomFields(n),s.matches("footer",!0)?"":this.__renderFooter(n),h({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCartType(e){const{lang:t,ns:n}=this,o=["default","fullpage","custom"],a=!this.in("idle")||this.disabledSelector.matches("cart-type",!0);return i(N||(N=ie` <div data-testid="cart-type"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="cart_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="cart-type-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("cart-type:before"),a?"text-disabled":"",t,n,e.cart_type,o,a,this.readonlySelector.matches("cart-type",!0),(t=>{this.edit({json:JSON.stringify(s(s({},e),{},{cart_type:t.detail}))})}),o.map((e=>i(J||(J=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="cart_type_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="cart_type_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,t,e,n,a?"text-disabled":"text-secondary",t,e,n))),this.renderTemplateOrSlot("cart-type:after"))}__renderFoxycomplete(e){const{lang:s,ns:n}=this,o=!this.in("idle")||this.disabledSelector.matches("foxycomplete",!0),a=this.readonlySelector.matches("foxycomplete",!0),r=e.foxycomplete,d=["combobox","search","disabled"],l="none"===r.usage?"disabled":r.show_combobox?"combobox":"search",c=i(E||(E=ie` <x-checkbox data-testid="foxycomplete-flags-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="show_country_flags" ns="${0}"></foxy-i18n> </x-checkbox> `),o,a,r.show_flags,(t=>{r.show_flags=t.detail,this.edit({json:JSON.stringify(e)})}),s,n);return i(F||(F=ie` <div data-testid="foxycomplete"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="foxycomplete" ns="${0}"> </foxy-i18n> <x-choice data-testid="foxycomplete-choice" .value="${0}" .items="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} <div slot="combobox" class="space-y-m pb-s" ?hidden="${0}"> <div class="grid grid-cols-2 gap-m" style="max-width:16rem"> ${0} </div> ${0} </div> <div slot="search" class="pb-s" ?hidden="${0}">${0}</div> </x-choice> <div class="border-t border-contrast-10 p-m"> <x-checkbox data-testid="foxycomplete-lookup-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n lang="${0}" key="enable_postcode_lookup" ns="${0}"></foxy-i18n> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("foxycomplete:before"),o?"text-disabled":"",s,n,l,d,o,a,(s=>{s instanceof t&&(r.usage="disabled"===s.detail?"none":"required",r.show_combobox="combobox"===s.detail,this.edit({json:JSON.stringify(e)}))}),d.map((e=>i(R||(R=ie` <div slot="${0}-label" class="grid leading-s py-s"> <foxy-i18n lang="${0}" key="foxycomplete_${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs ${0}" lang="${0}" key="foxycomplete_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,s,e,n,o?"text-disabled":"text-secondary",s,e,n))),"combobox"!==l,["open","close"].map((t=>{const s="open"===t?"combobox_open":"combobox_close";return i(H||(H=ie` <vaadin-text-field data-testid="foxycomplete-${0}-icon" label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> `),t,this.t(`${t}_icon`),r[s],o,a,(e=>"Enter"===e.key&&this.submit()),(t=>{r[s]=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}))})),c,"search"!==l,c,o,a,"enabled"===e.postal_code_lookup.usage,(t=>{e.postal_code_lookup.usage=t.detail?"enabled":"none",this.edit({json:JSON.stringify(e)})}),s,n,this.renderTemplateOrSlot("foxycomplete:after"))}__renderLocations(e){const{lang:t,ns:s}=this,n=e.location_filtering,o=!this.in("idle")||this.disabledSelector.matches("locations",!0),a=this.readonlySelector.matches("locations",!0),r="blacklist"===n.shipping_filter_type?"block":"allow",d="both"===n.usage?"copy":"blacklist"===n.billing_filter_type?"block":"allow",l=()=>{if("both"===n.usage)n.billing_filter_type=n.shipping_filter_type,n.billing_filter_values=n.shipping_filter_values;else{const e=Object.keys(n.billing_filter_values).length>0,t=Object.keys(n.shipping_filter_values).length>0;n.usage=e||t?e&&!t?"billing":t&&!e?"shipping":"independent":"none"}};return i(I||(I=ie` <div data-testid="locations"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="location_plural" ns="${0}"> </foxy-i18n> <div class="grid sm-grid-cols-2 bg-contrast-10" style="gap:1px"> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="shipping" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-shipping-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <x-countries-list data-testid="locations-shipping-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> <x-group class="bg-base pt-m"> <foxy-i18n class="${0}" slot="header" lang="${0}" key="billing" ns="${0}"> </foxy-i18n> <x-choice data-testid="locations-billing-choice" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <foxy-i18n slot="allow-label" lang="${0}" key="allowlist" ns="${0}"></foxy-i18n> <foxy-i18n slot="block-label" lang="${0}" key="blocklist" ns="${0}"></foxy-i18n> <foxy-i18n slot="copy-label" lang="${0}" key="same_as_shipping" ns="${0}"> </foxy-i18n> <x-countries-list data-testid="locations-billing-list" countries="${0}" regions="${0}" class="mb-m" href="${0}" slot="${0}" lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" ?hidden="${0}" @update:countries="${0}"> </x-countries-list> </x-choice> </x-group> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("locations:before"),o?"text-disabled":"",t,s,o?"text-disabled":"text-tertiary",t,s,["allow","block"],r,o,a,(t=>{"both"!==n.usage&&(n.usage="independent"),n.shipping_filter_type="block"===t.detail?"blacklist":"whitelist",l(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,JSON.stringify(n.shipping_filter_values),this.regions,this.countries,r,t,s,o,a,(t=>{n.shipping_filter_values=t.currentTarget.countries,l(),this.edit({json:JSON.stringify(e)})}),o?"text-disabled":"text-tertiary",t,s,["allow","block","copy"],d,o,a,(t=>{"copy"===t.detail?n.usage="both":(n.usage="independent",n.billing_filter_type="block"===t.detail?"blacklist":"whitelist"),l(),this.edit({json:JSON.stringify(e)})}),t,s,t,s,t,s,JSON.stringify(n.billing_filter_values),this.regions,this.countries,d,t,s,o,a,"copy"===d,(t=>{n.billing_filter_values=t.currentTarget.countries,l(),this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("locations:after"))}__renderHiddenFields(e){const{lang:t,ns:s}=this,n=[],o=[],a=e.cart_display_config,r=!this.in("idle")||this.disabledSelector.matches("hidden-fields",!0),d=this.readonlySelector.matches("hidden-fields",!0);for(const e in a){if(!e.startsWith("show_"))continue;const t=e.substring(5);n.push(t),"required"!==a.usage||a[e]||o.push(t)}"required"===a.usage&&o.push(...a.hidden_product_options);const l=()=>{a.usage="required",n.includes(this.__addHiddenFieldInputValue)?a[`show_${this.__addHiddenFieldInputValue}`]=!1:a.hidden_product_options.includes(this.__addHiddenFieldInputValue)||a.hidden_product_options.push(this.__addHiddenFieldInputValue),this.edit({json:JSON.stringify(e)}),this.__addHiddenFieldInputValue=""},c="calc(var(--lumo-border-radius-l) / 1.2)",u=0===o.length?[c]:["0","0",c,c],p=r||!this.__addHiddenFieldInputValue;return i(V||(V=ie` <div data-testid="hidden-fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="hidden_fields" ns="${0}"> </foxy-i18n> <div class="divide-y divide-contrast-10" data-testid="hidden-fields-list"> ${0} </div> <div data-testid="hidden-fields-new" style="border-radius:${0}" class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m px-m focus-outline-none" list="hidden-fields-list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="hidden-fields-list"> ${0} </datalist> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:add" class="icon-inline text-m"></iron-icon> </button> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("hidden-fields:before"),r?"text-disabled":"",t,s,o.map((o=>i(z||(z=ie` <div class="${0}"> ${0} <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:close" class="icon-inline text-m m-auto"></iron-icon> </button> </div> `),h({"h-m ml-m pr-xs flex items-center justify-between":!0,"text-secondary":d,"text-disabled":r}),n.includes(o)?i(A||(A=ie`<foxy-i18n lang="${0}" key="${0}" ns="${0}"></foxy-i18n>`),t,o,s):i(D||(D=ie`<span>${0}</span>`),o),this.t("delete"),h({"w-xs h-xs rounded-full transition-colors":!0,"hover-bg-error-10 hover-text-error":!r,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!r,"cursor-default":r,flex:!d,hidden:d}),r,(()=>{"boolean"==typeof a[`show_${o}`]?a[`show_${o}`]=!0:a.hidden_product_options=a.hidden_product_options.filter((e=>e!==o)),this.edit({json:JSON.stringify(e)})})))),u.join(" "),h({"h-m flex items-center ring-inset ring-primary-50 focus-within-ring-2":!0,"border-t border-contrast-10":o.length>0,flex:!d,hidden:d}),this.t("add_field"),f(this.__addHiddenFieldInputValue),r,d,(e=>"Enter"===e.key&&l()),(e=>{this.__addHiddenFieldInputValue=e.currentTarget.value}),n.filter((e=>!o.includes(e))).map((e=>i(G||(G=ie`<option value="${0}">${0}</option>`),e,this.t(e)))),this.t("add_field"),h({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":p,"bg-success-10 text-success cursor-pointer":!p,"hover-bg-success hover-text-success-contrast":!p,"focus-outline-none focus-ring-2":!p}),p,l,this.renderTemplateOrSlot("hidden-fields:after"))}__renderCards(e){const{lang:t,ns:s}=this,o=!this.in("idle")||this.disabledSelector.matches("cards",!0),a=this.readonlySelector.matches("cards",!0),r=e.supported_payment_cards;let d,l;"all_cards"===e.csc_requirements?(d=!1,l=!1):"sso_only"===e.csc_requirements?(d=!0,l=!1):(d=!0,l=!0);const c={amex:"American Express",diners:"Diners Club",discover:"Discover",jcb:"JCB",maestro:"Maestro",mastercard:"Mastercard",unionpay:"UnionPay",visa:"Visa"};return i(L||(L=ie` <div data-testid="cards"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="supported_cards" ns="${0}"> </foxy-i18n> <div class="flex flex-wrap m-xs p-s"> ${0} </div> <div class="flex flex-wrap p-s border-t border-contrast-10"> <x-checkbox data-testid="cards-saved-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_saved" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="cards-sso-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="skip_csc_for_sso" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="supported_cards_disclaimer" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("cards:before"),o?"text-disabled":"",t,s,Object.entries(n).map((([t,s])=>{if(!c[t])return;const n=r.includes(t);return i(M||(M=ie` <div class="${0}"> <label class="${0}"> <div class="h-s">${0}</div> <div class="text-s font-medium mx-s my-auto leading-none"> ${0} </div> <input type="checkbox" class="sr-only" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> </label> </div> `),h({"m-xs rounded":!0,"opacity-50 cursor-default":o,"cursor-pointer ring-primary-50 focus-within-ring-2":!o}),h({"overflow-hidden transition-colors flex rounded border":!0,"border-primary bg-primary-10 text-primary":n&&!a,"border-contrast bg-contrast-5 text-secondary":n&&a,"hover-text-body":n&&!o&&!a,"border-contrast-10":!n,"hover-border-primary":!n&&!o&&!a,"hover-text-primary":!n&&!o&&!a}),s,c[t],o,a,n,(s=>{if(a)return s.preventDefault();s.stopPropagation(),s.currentTarget.checked?r.push(t):r.splice(r.indexOf(t),1),this.edit({json:JSON.stringify(e)})}))})),o||"new_cards_only"===e.csc_requirements,a,d,(t=>{e.csc_requirements=t.detail?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,o,a,l,(t=>{e.csc_requirements=t.detail?"new_cards_only":d?"sso_only":"all_cards",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("cards:after"))}__renderCheckoutType(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("checkout-type",!0),o=this.readonlySelector.matches("checkout-type",!0);return i(P||(P=ie` <div data-testid="checkout-type"> ${0} <div class="space-y-xs"> <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="checkout_type" ns="${0}"> </foxy-i18n> <x-choice data-testid="checkout-type-choice" ?disabled="${0}" ?readonly="${0}" .items="${0}" .value="${0}" .getText="${0}" @change="${0}"> </x-choice> </x-group> <foxy-i18n class="text-xs leading-s block ${0}" lang="${0}" key="checkout_type_helper_text" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("checkout-type:before"),n?"text-disabled":"",t,s,n,o,["default_account","default_guest","guest_only","account_only"],e.checkout_type,(e=>this.t(`checkout_type_${e}`)),(t=>{e.checkout_type=t.detail,this.edit({json:JSON.stringify(e)})}),n?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("checkout-type:after"))}__renderConsent(e){const{lang:t,ns:s}=this,n=e.tos_checkbox_settings,o=e.newsletter_subscribe,a=e.eu_secure_data_transfer_consent,r=!this.in("idle")||this.disabledSelector.matches("consent",!0),d=this.readonlySelector.matches("consent",!0),l="margin-left: calc(1.125rem + (var(--lumo-space-m) * 2))";return i(U||(U=ie` <div data-testid="consent"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="consent" ns="${0}"> </foxy-i18n> <x-checkbox data-testid="consent-tos-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_tos_link" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_tos_link_explainer" ns="${0}"> </foxy-i18n> </div> <div slot="content" ?hidden="${0}"> <vaadin-text-field data-testid="consent-tos-field" label="${0}" class="w-full mt-m" placeholder="https://example.com/path/to/tos" clear-button-visible ?disabled="${0}" ?readonly="${0}" .value="${0}" @input="${0}"> </vaadin-text-field> <div class="flex flex-wrap -mx-s -mb-s mt-s"> <x-checkbox data-testid="consent-tos-require-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="require_consent" ns="${0}"> </foxy-i18n> </x-checkbox> <x-checkbox data-testid="consent-tos-state-check" class="m-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="leading-s block" lang="${0}" key="checked_by_default" ns="${0}"> </foxy-i18n> </x-checkbox> </div> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-mail-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="newsletter_subscribe" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="newsletter_subscribe_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> <div style="${0}" class="border-b border-contrast-10"></div> <x-checkbox data-testid="consent-sdta-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" class="m-m" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="display_sdta" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="display_sdta_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </x-group> ${0} </div> `),this.renderTemplateOrSlot("consent:before"),r?"text-disabled":"",t,s,r,d,"required"===n.usage||"optional"===n.usage,(t=>{n.initial_state=t.detail?n.initial_state:"unchecked",n.is_hidden=!1,n.usage=t.detail?"required":"none",n.url=t.detail?n.url:"",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,"none"===n.usage,this.t("location_url"),r,d,n.url,(t=>{n.url=t.currentTarget.value,this.edit({json:JSON.stringify(e)})}),r,d,"required"===n.usage,(t=>{n.usage=t.detail?"required":"optional",this.edit({json:JSON.stringify(e)})}),t,s,r,d,"checked"===n.initial_state,(t=>{n.initial_state=t.detail?"checked":"unchecked",this.edit({json:JSON.stringify(e)})}),t,s,l,r,d,"required"===o.usage,(t=>{o.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,l,r,d,"required"===a.usage,(t=>{a.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("consent:after"))}__renderFields(e){const{lang:t,ns:s}=this,n=!this.in("idle")||this.disabledSelector.matches("fields",!0),o=this.readonlySelector.matches("fields",!0),a=e.custom_checkout_field_requirements;return i(W||(W=ie` <div data-testid="fields"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="field_plural" ns="${0}"> </foxy-i18n> <div class="bg-contrast-10 grid grid-cols-1 md-grid-cols-2" style="gap:1px"> ${0} <div class="bg-base hidden md-block"></div> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("fields:before"),n?"text-disabled":"",t,s,Object.entries({cart_controls:["enabled","disabled"],coupon_entry:["enabled","disabled"],billing_first_name:["default","optional","required","hidden"],billing_last_name:["default","optional","required","hidden"],billing_company:["default","optional","required","hidden"],billing_tax_id:["default","optional","required","hidden"],billing_phone:["default","optional","required","hidden"],billing_address1:["default","optional","required","hidden"],billing_address2:["default","optional","required","hidden"],billing_city:["default","optional","required","hidden"],billing_region:["default","optional","required","hidden"],billing_postal_code:["default","optional","required","hidden"],billing_country:["default","optional","required","hidden"]}).map((([r,d])=>i(Y||(Y=ie` <label class="${0}"> <foxy-i18n class="flex-1" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="${0}"> ${0} </div> <div class="${0}"> <select data-testid="fields-${0}" class="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </select> <iron-icon class="pointer-events-none icon-inline text-xl" icon="icons:expand-more"> </iron-icon> </div> </label> `),h({"flex items-center pl-m bg-base":!0,"text-secondary":o,"text-disabled":n}),t,r.replace("billing_",""),s,h({"flex items-center text-right font-medium h-s px-s m-xs":o,hidden:!o}),this.t(d.find((e=>a[r]===e))),h({"px-s m-xs flex items-center rounded leading-none":!0,"ring-primary-50 ring-inset focus-within-ring-2":!n,"hover-text-primary":!n,"cursor-pointer":!n,"cursor-default":n,flex:!o,hidden:o}),r,h({"h-s mr-xs text-right appearance-none bg-transparent font-medium":!0,"focus-outline-none cursor-pointer":!n,"cursor-default":n}),n,o,(t=>{const s=t.currentTarget,i=s.options[s.options.selectedIndex].value;a[r]=i,this.edit({json:JSON.stringify(e)})}),d.map((e=>i(B||(B=ie` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,a[r]===e,this.t(e))))))),this.renderTemplateOrSlot("fields:after"))}__renderGoogleAnalytics(e){const{lang:t,ns:s}=this,n=e.analytics_config,o=n.segment_io,a=n.google_analytics,r=!this.in("idle")||this.disabledSelector.matches("google-analytics",!0),d=this.readonlySelector.matches("google-analytics",!0);return i(K||(K=ie` <div data-testid="google-analytics"> ${0} <x-group frame> <span class="${0}" slot="header">Google Analytics</span> <div class="p-m space-y-m"> <vaadin-text-field data-testid="google-analytics-field" class="w-full" label="${0}" placeholder="UA-1234567-1" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> <x-checkbox data-testid="google-analytics-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="ga_include_on_site" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="ga_include_on_site_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("google-analytics:before"),r?"text-disabled":"",this.t("ga_account_id"),this.t("ga_account_id_explainer"),f(a.account_id),r,d,(e=>"Enter"===e.key&&this.submit()),(t=>{a.account_id=t.currentTarget.value,a.usage=a.account_id?"required":"none",n.usage=a.account_id||o.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),r,d,a.include_on_site,(t=>{a.include_on_site=t.detail,this.edit({json:JSON.stringify(e)})}),t,s,r?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("google-analytics:after"))}__renderSegmentIo(e){const t=e.analytics_config,s=t.segment_io,n=t.google_analytics,o=!this.in("idle")||this.disabledSelector.matches("segment-io",!0),a=this.readonlySelector.matches("segment-io",!0);return i(Q||(Q=ie` <div data-testid="segment-io"> ${0} <x-group frame> <span class="${0}" slot="header">Segment.io</span> <div class="p-m"> <vaadin-text-field data-testid="segment-io-field" class="w-full" label="${0}" placeholder="MY-WRITE-KEY" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible @keydown="${0}" @input="${0}"> </vaadin-text-field> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("segment-io:before"),o?"text-disabled":"",this.t("sio_account_id"),this.t("sio_account_id_explainer"),f(s.account_id),o,a,(e=>"Enter"===e.key&&this.submit()),(i=>{s.account_id=i.currentTarget.value,s.usage=s.account_id?"required":"none",t.usage=n.account_id||s.account_id?"required":"none",this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("segment-io:after"))}__renderTroubleshooting(e){const{lang:t,ns:s}=this,n=e.debug,o=!this.in("idle")||this.disabledSelector.matches("troubleshooting",!0),a=this.readonlySelector.matches("troubleshooting",!0);return i(X||(X=ie` <div data-testid="troubleshooting"> ${0} <x-group frame> <foxy-i18n class="${0}" slot="header" lang="${0}" key="troubleshooting" ns="${0}"> </foxy-i18n> <div class="p-m space-y-m"> <x-checkbox data-testid="troubleshooting-check" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <div class="flex flex-col"> <foxy-i18n lang="${0}" key="troubleshooting_debug" ns="${0}"></foxy-i18n> <foxy-i18n class="text-xs leading-s ${0}" lang="${0}" key="troubleshooting_debug_explainer" ns="${0}"> </foxy-i18n> </div> </x-checkbox> </div> </x-group> ${0} </div> `),this.renderTemplateOrSlot("troubleshooting:before"),o?"text-disabled":"",t,s,o,a,"required"===n.usage,(t=>{n.usage=t.detail?"required":"none",this.edit({json:JSON.stringify(e)})}),t,s,o?"text-disabled":"text-secondary",t,s,this.renderTemplateOrSlot("troubleshooting:after"))}__renderCustomConfig(e){return i(Z||(Z=ie` <div data-testid="custom-config"> ${0} <vaadin-text-area data-testid="custom-config-field" class="w-full" label="${0}" placeholder='{ "key": "value" }' helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-config:before"),this.t("custom_config"),this.t("custom_config_helper_text"),e.custom_config?JSON.stringify(e.custom_config,null,2):"",!this.in("idle")||this.disabledSelector.matches("custom-config",!0),this.readonlySelector.matches("custom-config",!0),(t=>{const s=t.currentTarget;try{e.custom_config=s.value?JSON.parse(s.value):"",this.edit({json:JSON.stringify(e)}),s.invalid=!1}catch(e){s.invalid=!0}}),this.renderTemplateOrSlot("custom-config:after"))}__renderHeader(e){return i(ee||(ee=ie` <div data-testid="header"> ${0} <vaadin-text-area data-testid="header-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.t("custom_header"),this.t("custom_header_helper_text"),e.custom_script_values.header,!this.in("idle")||this.disabledSelector.matches("header",!0),this.readonlySelector.matches("header",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{header:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("header:after"))}__renderCustomFields(e){return i(te||(te=ie` <div data-testid="custom-fields"> ${0} <vaadin-text-area data-testid="custom-fields-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("custom-fields:before"),this.t("custom_fields"),this.t("custom_fields_helper_text"),e.custom_script_values.checkout_fields,!this.in("idle")||this.disabledSelector.matches("custom-fields",!0),this.readonlySelector.matches("custom-fields",!0),(t=>{const s=t.currentTarget.value;e.custom_script_values.checkout_fields=s,this.edit({json:JSON.stringify(e)})}),this.renderTemplateOrSlot("custom-fields:after"))}__renderFooter(e){return i(se||(se=ie` <div data-testid="footer"> ${0} <vaadin-text-area data-testid="footer-field" class="w-full" label="${0}" helper-text="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @input="${0}"> </vaadin-text-area> ${0} </div> `),this.renderTemplateOrSlot("footer:before"),this.t("custom_footer"),this.t("custom_footer_helper_text"),e.custom_script_values.footer,!this.in("idle")||this.disabledSelector.matches("footer",!0),this.readonlySelector.matches("footer",!0),(t=>{const i=t.currentTarget,n=s(s({},e.custom_script_values),{},{footer:i.value});this.edit({json:JSON.stringify(s(s({},e),{},{custom_script_values:n}))})}),this.renderTemplateOrSlot("footer:after"))}}customElements.define("foxy-template-config-form",oe);export{oe as TemplateConfigForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-a040d79d.js";import{C as e,b as t}from"./shared-023a97c2.js";import"./shared-5a54a9bc.js";import"./shared-00d6a968.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";import{_ as i,j as a,h as s}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import{S as r,T as n,a as o}from"./shared-ae8cd227.js";import{c as d}from"./shared-4e709717.js";import"./shared-3f0a9c2c.js";import"./shared-340f7584.js";import"./shared-65dfd512.js";import"./shared-fab8c705.js";import{G as l}from"./shared-027c537d.js";import{P as c}from"./shared-09c5f9f1.js";import{C as h}from"./shared-df730f90.js";import{N as m}from"./shared-39e3ae67.js";import{l as p}from"./shared-07134f93.js";import"./shared-ff79f3f9.js";import"./shared-5535f38f.js";import"./shared-b0f0e8b5.js";import"./shared-756034e4.js";import"./shared-60126eee.js";import"./shared-7f0a9790.js";import"./shared-6d45a07b.js";import"./shared-7684cb05.js";let f,u,$,v,y,b,_,x=e=>e;const g=r(n(h(o(m,"template-form"))));class j extends g{constructor(){super(...arguments),this.templates={},this.__cacheState="idle",this.__contentChoice="default"}static get properties(){return i(i({},super.properties),{},{__cacheState:{attribute:!1},__contentChoice:{attribute:!1}})}static get styles(){return[...super.styles,a(f||(f=x`#cached-content::part(input-field){max-height:15em}`))]}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"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-text-area":customElements.get("vaadin-text-area"),"vaadin-button":customElements.get("vaadin-button"),"x-property-table":c,"x-choice":e,"x-group":l}}render(){var e,t;const{hiddenSelector:i,href:a,lang:r,ns:n}=this,o=a?"delete":"create",l=this.in("busy"),c=this.in("fail");return s(u||(u=x` <div class="space-y-m relative"> ${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(),i.matches("content",!0)?"":this.__renderContent(),i.matches("timestamps",!0)||!a?"":this.__renderTimestamps(),i.matches(o)?"":this.__renderAction(o),d({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!l&&!c}),c?"error":l?"busy":"empty",r,n,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderDescription(){var e,t;const i="description";return s($||($=x` <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(`${i}:before`),i,this.t(i),!this.in("idle")||this.disabledSelector.matches(i),this.readonlySelector.matches(i),null!==(t=null===(e=this.form)||void 0===e?void 0:e.description)&&void 0!==t?t:"",(e=>"Enter"===e.key&&this.submit()),(e=>{this.edit({description:e.currentTarget.value})}),this.renderTemplateOrSlot(`${i}:after`))}__renderContent(){var e;const i="content",a=!this.in("idle")||this.disabledSelector.matches(i),r=this.readonlySelector.matches(i),n=this.form.content_url?"url":this.form.content?"clipboard":this.__contentChoice;return s(v||(v=x` <div data-testid="content"> ${0} <x-group frame> <foxy-i18n class="${0}" lang="${0}" slot="header" key="template" ns="${0}"> </foxy-i18n> <x-choice data-testid="content-type" .value="${0}" .items="${0}" ?readonly="${0}" ?disabled="${0}" @change="${0}"> ${0} <div slot="url" ?hidden="${0}"> <div class="flex items-center mt-0 mb-m"> <vaadin-text-field data-testid="content-url" class="mr-s flex-grow" ?readonly="${0}" ?disabled="${0}" .value="${0}" @keydown="${0}" @input="${0}"> </vaadin-text-field> <vaadin-button data-testid="cache" class="relative" ?hidden="${0}" ?disabled="${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> </div> <div slot="clipboard" ?hidden="${0}"> <vaadin-text-area id="cached-content" data-testid="content-clipboard" class="w-full mb-m" ?readonly="${0}" ?disabled="${0}" .value="${0}" @input="${0}"> </vaadin-text-area> </div> </x-choice> </x-group> ${0} </div> `),this.renderTemplateOrSlot("content:before"),d({"transition-colors":!0,"text-disabled":a}),this.lang,this.ns,n,["default","url","clipboard"],r,a,(e=>{e instanceof t&&(this.edit({content:"",content_url:""}),this.__contentChoice=e.detail)}),["default","url","clipboard"].map((e=>s(y||(y=x` <div slot="${0}-label" class="py-s leading-s"> <foxy-i18n class="block" lang="${0}" key="template_${0}" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s opacity-70" lang="${0}" key="template_${0}_explainer" ns="${0}"> </foxy-i18n> </div> `),e,this.lang,e,this.ns,this.lang,e,this.ns))),"url"!==n,r,a,this.form.content_url,(e=>"Enter"===e.key&&this.submit()),(e=>{const t=e.currentTarget.value;this.edit({content:"",content_url:t})}),r||this.form.content_url!==(null===(e=this.data)||void 0===e?void 0:e.content_url),a||"busy"===this.__cacheState,this.__cache,d({"relative transition-opacity":!0,"opacity-0":"idle"!==this.__cacheState}),this.lang,this.ns,d({"absolute inset-0 flex transition-opacity":!0,"opacity-0":"idle"===this.__cacheState}),"fail"===this.__cacheState?"error":"busy",this.lang,this.ns,"clipboard"!==n,r,a,p(this.form.content),(e=>{const t=e.currentTarget.value;this.edit({content:t,content_url:""})}),this.renderTemplateOrSlot("content:after"))}__renderTimestamps(){const e="timestamps";return s(b||(b=x` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${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:t,href:i,lang:a,ns:r}=this,n=this.in({idle:{template:{dirty:"valid"}}}),o=this.in({idle:{snapshot:{dirty:"valid"}}}),d=!this.in("idle")||t.matches(e,!0),l=n||o;return s(_||(_=x` <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`),a,r,(e=>{e.detail.cancelled||this.delete()}),this.in("idle")?"primary "+(i?"error":"success"):"",e,this.in({idle:"template"})&&!l||d,(t=>{if("delete"===e){this.renderRoot.querySelector("#confirm").show(t.currentTarget)}else this.submit()}),r,e,a,this.renderTemplateOrSlot(`${e}:after`))}async __cache(){var e,t;this.__cacheState="busy";try{const i=null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href)&&void 0!==t?t:"",a=await new j.API(this).fetch(i,{method:"POST"});this.__cacheState=a.ok?"idle":"fail"}catch(e){this.__cacheState="fail"}}}customElements.define("foxy-template-form",j);export{j as TemplateForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";import{h as t}from"./shared-63eaded9.js";import{C as e}from"./shared-df730f90.js";import{N as s}from"./shared-39e3ae67.js";import{T as i,a as r}from"./shared-ae8cd227.js";import{c as a}from"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-ff79f3f9.js";import"./shared-60126eee.js";import"./shared-5535f38f.js";import"./shared-6d45a07b.js";import"./shared-7f0a9790.js";import"./shared-7684cb05.js";import"./shared-756034e4.js";let n,o,d,c,l,m,h,p,u,f,v,y,_=t=>t;const $=i(e(r(s,"transaction-card")));class x extends ${constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}render(){var e,s;const i=this.hiddenSelector,r=!i.matches("total",!0),d=!i.matches("status",!0);return t(n||(n=_` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${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}),r||d?t(o||(o=_` <div class="flex items-center justify-between"> ${0} ${0} </div> `),r?this.__renderTotal():"",d?this.__renderStatus():""):"",i.matches("description",!0)?"":this.__renderDescription(),i.matches("customer",!0)?"":this.__renderCustomer(),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:"")}async _sendGet(){const t=await super._sendGet(),e=await super._fetch(t._links["fx:store"].href);return this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",t}__renderTotal(){const e=this.data;let s;if(e){const i=`${e.total_order} ${e.currency_code}`,r=this.__currencyDisplay;s=t(d||(d=_` <foxy-i18n options="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({amount:i,currencyDisplay:r}),this.lang,this.ns)}else s=t(c||(c=_`​`));return t(l||(l=_` <div data-testid="total"> ${0} <div class="font-semibold truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,s,i,r;const a=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed";return t(m||(m=_` <div data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-s"> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline text-l ${0}" title="${0}" icon="${0}"> </iron-icon> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({value:null===(s=this.data)||void 0===s?void 0:s.transaction_date}),this.lang,this.ns,null!==(i={completed:"text-success",rejected:"text-error",declined:"text-error"}[a])&&void 0!==i?i:"text-tertiary",this.t(`transaction_${a}`),null!==(r={completed:"icons:done-all",refunded:"icons:restore",rejected:"icons:highlight-off",declined:"icons:highlight-off",voided:"icons:remove-circle-outline"}[a])&&void 0!==r?r:"icons:schedule",this.renderTemplateOrSlot("status:after"))}__renderDescription(){var e,s;const i=null===(s=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===s?void 0:s["fx:items"];let r;if(i){const e={most_expensive_item:[...i].sort(((t,e)=>t.price-e.price))[0],count:i.length};r=t(h||(h=_` <foxy-i18n options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify(e),this.lang,this.ns)}else r=t(p||(p=_`​`));return t(u||(u=_` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),r,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,s=e?t(f||(f=_`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):t(v||(v=_`​`));return t(y||(y=_` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),s,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",x);export{x as TransactionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";import{T as s}from"./shared-9cd49a3e.js";export{T as TransactionsTable}from"./shared-9cd49a3e.js";import"./shared-ff79f3f9.js";import"./shared-63eaded9.js";import"./shared-ae8cd227.js";import"./shared-5535f38f.js";import"./shared-e55088b4.js";import"./shared-df730f90.js";import"./shared-6d45a07b.js";import"./foxy-nucleon-element.js";import"./shared-39e3ae67.js";import"./shared-7f0a9790.js";import"./shared-7684cb05.js";import"./shared-756034e4.js";import"./shared-4e709717.js";customElements.define("foxy-transactions-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-a040d79d.js";import"./shared-5a54a9bc.js";import"./shared-00d6a968.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";export{U as UserForm}from"./shared-ecfd3539.js";import"./shared-8b20bc23.js";import"./shared-ff79f3f9.js";import"./shared-63eaded9.js";import"./shared-3f0a9c2c.js";import"./shared-7f0a9790.js";import"./shared-5535f38f.js";import"./shared-df730f90.js";import"./shared-6d45a07b.js";import"./shared-ae8cd227.js";import"./shared-4e709717.js";import"./shared-46ee137f.js";import"./shared-60126eee.js";import"./shared-5e2fd1c7.js";import"./shared-073cb8e9.js";import"./shared-023a97c2.js";import"./shared-65dfd512.js";import"./shared-fab8c705.js";import"./shared-b0f0e8b5.js";import"./shared-756034e4.js";import"./shared-340f7584.js";import"./shared-027c537d.js";import"./shared-39e3ae67.js";import"./shared-7684cb05.js";import"./shared-b738ee96.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-5a54a9bc.js";import"./foxy-form-dialog.js";import{r as s}from"./shared-ecfd3539.js";import"./foxy-spinner.js";import"./shared-84d2d490.js";import{h as e}from"./shared-63eaded9.js";import{T as a}from"./shared-e55088b4.js";import{a as t}from"./shared-ae8cd227.js";import"./shared-8b20bc23.js";import"./shared-ff79f3f9.js";import"./shared-00d6a968.js";import"./shared-3f0a9c2c.js";import"./shared-7f0a9790.js";import"./shared-5535f38f.js";import"./shared-df730f90.js";import"./shared-6d45a07b.js";import"./shared-4e709717.js";import"./shared-7684cb05.js";import"./shared-a040d79d.js";import"./shared-5e2fd1c7.js";import"./shared-46ee137f.js";import"./shared-073cb8e9.js";import"./shared-023a97c2.js";import"./shared-65dfd512.js";import"./shared-fab8c705.js";import"./shared-b0f0e8b5.js";import"./shared-756034e4.js";import"./shared-340f7584.js";import"./shared-027c537d.js";import"./shared-39e3ae67.js";import"./shared-b738ee96.js";import"./shared-60126eee.js";import"./foxy-nucleon-element.js";let r,o,d,i,m,n,l,f=s=>s;class p extends(t(a,"users-table")){constructor(){super(...arguments),this.columns=[p.nameColumn,p.emailColumn,p.rolesColumn,p.lastUpdatedColumn,p.actionsColumn]}render(){return e(r||(r=f` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}p.nameColumn={cell:s=>e(o||(o=f` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),s.data.first_name,s.data.last_name)},p.emailColumn={hideBelow:"md",cell:s=>e(d||(d=f` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),s.data.email)},p.rolesColumn={cell:a=>e(i||(i=f` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((t=>e(m||(m=f` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),a.data[t]?"":"text-disabled",s.find((s=>s.property===t)).icon))))},p.lastUpdatedColumn={hideBelow:"lg",cell:s=>e(n||(n=f` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:s.data.date_modified}),s.lang,s.ns,JSON.stringify({value:s.data.date_modified}),s.lang,s.ns)},p.actionsColumn={cell:s=>e(l||(l=f` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(e=>{const a=e.target,t=a.getRootNode().querySelector("#form");t.href=s.data._links.self.href,t.show(a)}),s.lang,s.ns)},customElements.define("foxy-users-table",p);export{p as UsersTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-5a54a9bc.js";import"./shared-84d2d490.js";import{_ as t,h as e}from"./shared-63eaded9.js";import{D as s}from"./shared-3f0a9c2c.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as e,P as t,A as a,L as s,
|
|
1
|
+
import{k as e,P as t,A as a,L as s,_ as i,j as r,h as n}from"./shared-63eaded9.js";import{F as l}from"./shared-46ee137f.js";import{E as o,C as d,T as h}from"./shared-8b20bc23.js";import"./shared-073cb8e9.js";import"./shared-65dfd512.js";import{a as u}from"./shared-a040d79d.js";import{h as c,P as p}from"./shared-ff79f3f9.js";import"./shared-fab8c705.js";import{p as m}from"./shared-84d2d490.js";import{a as v,c as g}from"./shared-ae8cd227.js";import{Q as b,T as f,U as _,V as y,W as x,X as w,Y as E,Z as T,b as k,$ as S,a0 as $,a1 as A,a2 as V,a3 as C,a4 as I,a5 as M,m as z,a6 as F}from"./shared-5535f38f.js";import{s as L}from"./shared-b0f0e8b5.js";import{i as q}from"./shared-756034e4.js";var P={raise:b,send:f,sendParent:_,sendUpdate:y,log:x,cancel:w,start:E,stop:T,assign:k,after:S,done:$,respond:A,forwardTo:V,escalate:C,choose:I,pure:M};const j=c`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-text-field">
|
|
4
4
|
[part="input-field"],
|
|
@@ -56,13 +56,13 @@ import{k as e,P as t,A as a,L as s,j as i,h as r,_ as n}from"./shared-63eaded9.j
|
|
|
56
56
|
}
|
|
57
57
|
</style>
|
|
58
58
|
</template>
|
|
59
|
-
</dom-module>`;document.head.appendChild(
|
|
59
|
+
</dom-module>`;document.head.appendChild(j.content);
|
|
60
60
|
/**
|
|
61
61
|
@license
|
|
62
62
|
Copyright (c) 2017 Vaadin Ltd.
|
|
63
63
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
64
64
|
*/
|
|
65
|
-
class
|
|
65
|
+
class H extends(o(u(d(h(p))))){static get template(){return c`
|
|
66
66
|
<style include="vaadin-text-field-shared-styles">
|
|
67
67
|
.vaadin-text-area-container {
|
|
68
68
|
flex: auto;
|
|
@@ -111,7 +111,7 @@ class F extends(o(u(d(h(p))))){static get template(){return c`
|
|
|
111
111
|
|
|
112
112
|
<label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
|
|
113
113
|
|
|
114
|
-
<div part="input-field" id="[[_inputId]]">
|
|
114
|
+
<div part="input-field" id="[[_inputId]]" on-scroll="__scrollPositionUpdated">
|
|
115
115
|
|
|
116
116
|
<slot name="prefix"></slot>
|
|
117
117
|
|
|
@@ -131,7 +131,7 @@ class F extends(o(u(d(h(p))))){static get template(){return c`
|
|
|
131
131
|
<div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
|
|
132
132
|
|
|
133
133
|
</div>
|
|
134
|
-
`}static get is(){return"vaadin-text-area"}static get version(){return"2.9.
|
|
134
|
+
`}static get is(){return"vaadin-text-area"}static get version(){return"2.9.2"}static get properties(){return{pattern:{type:String}}}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd),this._inputField=this.root.querySelector("[part=input-field]"),this._inputField.addEventListener("wheel",(e=>{const t=this._inputField.scrollTop;this._inputField.scrollTop+=e.deltaY,t!==this._inputField.scrollTop&&(e.preventDefault(),this.__scrollPositionUpdated())})),this.__scrollPositionUpdated()}__scrollPositionUpdated(){this.updateStyles({"--_text-area-vertical-scroll-position":this._inputField.scrollTop+"px"})}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,a=this.inputElement,s=this.value?this.value.length:0;if(this._oldValueLength>=s){const t=getComputedStyle(e).height,s=getComputedStyle(a).width;e.style.display="block",e.style.height=t,a.style.maxWidth=s,a.style.height="auto"}this._oldValueLength=s;const i=a.scrollHeight;i>a.clientHeight&&(a.style.height=i+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",i)}checkValidity(){if(!super.checkValidity())return!1;if(!this.pattern||!this.inputElement.value)return!0;try{const e=this.inputElement.value.match(this.pattern);return!!e&&e[0]===e.input}catch(e){return!0}}}customElements.define(H.is,H);class O extends CustomEvent{constructor(e){super("change",{detail:e})}}const U=c`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
135
135
|
<template>
|
|
136
136
|
<style include="lumo-required-field">
|
|
137
137
|
:host {
|
|
@@ -255,12 +255,12 @@ class F extends(o(u(d(h(p))))){static get template(){return c`
|
|
|
255
255
|
}
|
|
256
256
|
</style>
|
|
257
257
|
</template>
|
|
258
|
-
</dom-module>`;document.head.appendChild(
|
|
258
|
+
</dom-module>`;document.head.appendChild(U.content);const N=e=>class extends e{static get properties(){return{inputs:{type:Array,readOnly:!0},i18n:{type:Object,value:()=>({parseValue:function(e){return e.split("\t")},formatValue:function(e){return e.join("\t")}})},__errorId:String,__labelId:String,__helperTextId:String,__hasSlottedHelper:Boolean}}connectedCallback(){super.connectedCallback(),this.__observer&&this.__observer.connect()}disconnectedCallback(){super.disconnectedCallback(),this.__observer&&this.__observer.disconnect()}ready(){super.ready(),this.__setInputsFromSlot(),this.__observer=new l(this.$.slot,(()=>{this.__setInputsFromSlot()})),this.$.helperSlot.addEventListener("slotchange",this.__onHelperSlotChange.bind(this)),this.__onHelperSlotChange();const e=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor);this.addEventListener("keydown",(t=>{if(9===t.keyCode){if("slot"===t.target.parentElement.localName&&!t.defaultPrevented&&e){const e=t.target.parentElement;e.setAttribute("tabindex",-1),setTimeout((()=>e.removeAttribute("tabindex")))}this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue()}})),this.addEventListener("focusin",(()=>this.setAttribute("focused",""))),this.addEventListener("focusout",(e=>{const t=this.getRootNode().activeElement;this.inputs.some((e=>t===e||e.shadowRoot&&e.shadowRoot.contains(t)))||this.removeAttribute("focused")}));var t=N._uniqueId=1+N._uniqueId||1;this.__errorId=`${this.constructor.is}-error-${t}`,this.__labelId=`${this.constructor.is}-label-${t}`,this.__helperTextId=`${this.constructor.is}-helper-${t}`}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}__updateValue(e){e&&e.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0,this.value=this.i18n.formatValue.apply(this,[this.inputs.map((e=>e.value))]),this.__settingValue=!1}__queryAllAssignedElements(e){const t=[];let a;return"SLOT"===e.tagName?a=e.assignedNodes({flatten:!0}).filter((e=>e.nodeType===Node.ELEMENT_NODE)):(t.push(e),a=Array.from(e.children)),a.forEach((e=>t.push(...this.__queryAllAssignedElements(e)))),t}__getInputsFromSlot(){return this.__queryAllAssignedElements(this.$.slot).filter((e=>e.validate||e.checkValidity))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__valueChanged(e,t){if(this.__settingValue||!this.inputs)return;const a=this.i18n.parseValue(e);a&&0!=a.length?(this.inputs.forEach(((e,t)=>e.value=a[t])),void 0!==t&&this.validate()):console.warn("Value parser has not provided values array")}__onHelperSlotChange(){const e=this.$.helperSlot.assignedNodes({flatten:!0});this.__hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this.__hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}}
|
|
259
259
|
/**
|
|
260
260
|
@license
|
|
261
261
|
Copyright (c) 2018 Vaadin Ltd.
|
|
262
262
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
263
|
-
*/;class
|
|
263
|
+
*/;class D extends(o(N(h(p)))){static get template(){return c`
|
|
264
264
|
<style>
|
|
265
265
|
:host {
|
|
266
266
|
display: inline-flex;
|
|
@@ -299,4 +299,4 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
299
299
|
</div>
|
|
300
300
|
<div part="error-message" id="[[__errorId]]" aria-live="assertive" aria-hidden\$="[[__getErrorMessageAriaHidden(invalid, errorMessage, __errorId)]]">[[errorMessage]]</div>
|
|
301
301
|
</div>
|
|
302
|
-
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,a){e&&a&&a.hasAttribute(e)===!t&&(t?a.setAttribute(e,"boolean"==typeof t?"":t):a.removeAttribute(e))}__getActiveErrorId(e,t,a,s,i,r){const n=[];(s||r)&&n.push(i),t&&e&&n.push(a),n.length>0?this.setAttribute("aria-describedby",n.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,a){return(!(t&&e?a:void 0)).toString()}}customElements.define(U.is,U);class D extends CustomEvent{constructor(e){super("change",{detail:e})}}class B extends D{}const R=e((e=>s=>{const{element:i,name:r,strings:n}=s.committer;if(2!==n.length||""!==n[0]||""!==n[1])throw new Error("live directive bindings must not contain any static values");if(s.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(s instanceof t)i[r]!==e&&s.setValue(e);else{if(!(s instanceof a))throw new Error("live directive can only be used on attributes or properties");i.getAttribute(r)!==e&&s.setValue(e)}}));let Y,W,X=e=>e;class K extends s{constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=m(e);return[t.toString(),a]}},this.__getItems=I((e=>{const t=m(e).count;return[{value:"d",label:this.__t("day",{count:t})},{value:"w",label:this.__t("week",{count:t})},{value:"m",label:this.__t("month",{count:t})},{value:"y",label:this.__t("year",{count:t})}]}))}static get properties(){return{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String},lang:{type:String}}}static get styles(){return i(Y||(Y=X`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}connectedCallback(){super.connectedCallback(),this.__untrackTranslations=customElements.get("foxy-i18n").onTranslationChange((()=>{var e,t;null===(t=(e=this.__getItems.cache).clear)||void 0===t||t.call(e),this.requestUpdate()}))}render(){return r(W||(W=X` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,R(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__untrackTranslations)||void 0===e||e.call(this)}checkValidity(){return!0}get __t(){return customElements.get("foxy-i18n").i18next.getFixedT(this.lang)}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new B(this.value))}}const G=M({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:j.assign({defaultCustomValue:(e,t)=>t.data}),setValue:j.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:j.assign({custom:(e,t)=>t.data}),setItems:j.assign({items:(e,t)=>t.data}),setType:j.assign({type:(e,t)=>t.data}),setMin:j.assign({min:(e,t)=>t.data}),setMax:j.assign({max:(e,t)=>t.data})}});let Q,Z,J,ee,te,ae,se,ie,re,ne,le,oe,de,he=e=>e;const ue=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class ce extends z{constructor(){super(...arguments),this.getText=e=>e,this.__service=L(G).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":K,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,i(J||(J=he`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return n(n({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ue]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=r(ee||(ee=he` ${0} `),e.map(((e,s,i)=>{var n;const l=this.custom&&s===i.length-1,o=l?a:t?!!(null===(n=this.value)||void 0===n?void 0:n.includes(e)):e===String(this.value),d=this.disabled||!this._isI18nReady,h=q({value:l?ue:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":d,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===ue?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ue?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new O(this.value))}}),u=r(te||(te=he` <div> ${0} </div> `),e===ue?this._t("choice.other").toString():r(ae||(ae=he`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return r(se||(se=he` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const n="transition ease-in-out duration-200",l=`${n} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return r(Z||(Z=he` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,o,h,u):function(e,t,a,s,i){const n="transition ease-in-out duration-200",l=`${n} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return r(Q||(Q=he` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),n,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,o,h,u),e===ue&&a?this.__field:"",e!==ue?r(ie||(ie=he`<slot name="${0}"></slot>`),e):"")})));return r(re||(re=he`<form>${0}</form> `),s)}get __field(){const e=q({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new O(this.value))}});return"frequency"===this.type?r(ne||(ne=he`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?r(le||(le=he`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?r(oe||(oe=he`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):r(de||(de=he`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{ce as C,D,K as F,U as a,O as b,j as c};
|
|
302
|
+
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,a){e&&a&&a.hasAttribute(e)===!t&&(t?a.setAttribute(e,"boolean"==typeof t?"":t):a.removeAttribute(e))}__getActiveErrorId(e,t,a,s,i,r){const n=[];(s||r)&&n.push(i),t&&e&&n.push(a),n.length>0?this.setAttribute("aria-describedby",n.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,a){return(!(t&&e?a:void 0)).toString()}}customElements.define(D.is,D);class B extends CustomEvent{constructor(e){super("change",{detail:e})}}class R extends B{}const Y=e((e=>s=>{const{element:i,name:r,strings:n}=s.committer;if(2!==n.length||""!==n[0]||""!==n[1])throw new Error("live directive bindings must not contain any static values");if(s.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(s instanceof t)i[r]!==e&&s.setValue(e);else{if(!(s instanceof a))throw new Error("live directive can only be used on attributes or properties");i.getAttribute(r)!==e&&s.setValue(e)}}));let W,X,K=e=>e;class G extends(v(s)){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=m(e);return[t.toString(),a]}},this.__getItems=z((e=>{const t=m(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return i(i({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return r(W||(W=K`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return n(X||(X=K` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,Y(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new R(this.value))}}const Q=F({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:P.assign({defaultCustomValue:(e,t)=>t.data}),setValue:P.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:P.assign({custom:(e,t)=>t.data}),setItems:P.assign({items:(e,t)=>t.data}),setType:P.assign({type:(e,t)=>t.data}),setMin:P.assign({min:(e,t)=>t.data}),setMax:P.assign({max:(e,t)=>t.data})}});let Z,J,ee,te,ae,se,ie,re,ne,le,oe,de,he,ue=e=>e;const ce=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class pe extends g{constructor(){super(...arguments),this.getText=e=>e,this.__service=q(Q).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":G,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,r(ee||(ee=ue`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return i(i({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,ce]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=n(te||(te=ue` ${0} `),e.map(((e,s,i)=>{var r;const l=this.custom&&s===i.length-1,o=l?a:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),d=this.disabled||!this._isI18nReady,h=L({value:l?ce:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":d,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===ce?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===ce?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new O(this.value))}}),u=n(ae||(ae=ue` <div> ${0} </div> `),e===ce?this._t("choice.other").toString():n(se||(se=ue`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return n(ie||(ie=ue` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const r="transition ease-in-out duration-200",l=`${r} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return n(J||(J=ue` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,o,h,u):function(e,t,a,s,i){const r="transition ease-in-out duration-200",l=`${r} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return n(Z||(Z=ue` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,o,h,u),e===ce&&a?this.__field:"",e!==ce?n(re||(re=ue`<slot name="${0}"></slot>`),e):"")})));return n(ne||(ne=ue`<form>${0}</form> `),s)}get __field(){const e=L({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new O(this.value))}});return"frequency"===this.type?n(le||(le=ue`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?n(oe||(oe=ue`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?n(de||(de=ue`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):n(he||(he=ue`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{pe as C,B as D,G as F,D as a,O as b,P as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-
|
|
1
|
+
import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-ae8cd227.js";let a,o=e=>e;class d extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10 overflow-hidden":"")}}export{d as G};
|